index-1b4df78e.js 17 KB

12345
  1. <<<<<<<< HEAD:dist/assets/index-74200891.js
  2. import{aC as se,aD as q,bp as Ce,bm as ke,c as U,d as j,bb as X,r as C,w as B,y as Ie,a3 as J,a as h,n as z,m as xe,b as Z,t as F,bs as ce,bG as Re,ah as Be,x as _e,e as R,bJ as Pe,bN as $e,z as A,aW as Ae,bP as ze,bo as Ne,a4 as Le,bI as Oe,o as ne,a2 as G,aP as Ee,a5 as ae,br as He,bQ as le,a7 as We,bR as De,b8 as Me,aj as Ze,b5 as Ve,ac as Fe,ak as Ue,aZ as je,bh as Ke,bS as Xe,b0 as Ye,aR as qe,aH as Ge,g as Je,v as Qe,h as pe,al as ie,aU as et,k as de}from"./index-ec1086fa.js";import{T as tt}from"./index-093fb0c6.js";import{S as nt,a as at}from"./index-1f0b43e3.js";import{u as lt}from"./use-refs-d1b93d2a.js";import{u as it,S as ot}from"./index-78905f3c.js";function rt(e,l,i){let v,c=0;const n=e.scrollLeft,o=i===0?1:Math.round(i*1e3/16);function u(){se(v)}function s(){e.scrollLeft+=(l-n)/o,++c<o&&(v=q(s))}return s(),u}function st(e,l,i,v){let c,n=Ce(e);const o=n<l,u=i===0?1:Math.round(i*1e3/16),s=(l-n)/u;function g(){se(c)}function T(){n+=s,(o&&n>l||!o&&n<l)&&(n=l),ke(e,n),o&&n<l||!o&&n>l?c=q(T):v&&(c=q(v))}return T(),g}const[ct,oe]=U("tabs");var dt=j({name:ct,props:{count:X(Number),inited:Boolean,animated:Boolean,duration:X(z),swipeable:Boolean,lazyRender:Boolean,currentIndex:X(Number)},emits:["change"],setup(e,{emit:l,slots:i}){const v=C(),c=u=>l("change",u),n=()=>{var u;const s=(u=i.default)==null?void 0:u.call(i);return e.animated||e.swipeable?h(nt,{ref:v,loop:!1,class:oe("track"),duration:+e.duration*1e3,touchable:e.swipeable,lazyRender:e.lazyRender,showIndicators:!1,onChange:c},{default:()=>[s]}):s},o=u=>{const s=v.value;s&&s.state.active!==u&&s.swipeTo(u,{immediate:!e.inited})};return B(()=>e.currentIndex,o),Ie(()=>{o(e.currentIndex)}),J({swipeRef:v}),()=>h("div",{class:oe("content",{animated:e.animated||e.swipeable})},[n()])}});const[ue,V]=U("tabs"),ut={type:xe("line"),color:String,border:Boolean,sticky:Boolean,shrink:Boolean,active:Z(0),duration:Z(.3),animated:Boolean,ellipsis:F,swipeable:Boolean,scrollspy:Boolean,offsetTop:Z(0),background:String,lazyRender:F,lineWidth:z,lineHeight:z,beforeChange:Function,swipeThreshold:Z(5),titleActiveColor:String,titleInactiveColor:String},fe=Symbol(ue);var ft=j({name:ue,props:ut,emits:["change","scroll","rendered","clickTab","update:active"],setup(e,{emit:l,slots:i}){let v,c,n,o,u;const s=C(),g=C(),T=C(),_=C(),P=ce(),k=Re(s),[b,S]=lt(),{children:f,linkChildren:K}=Be(fe),d=_e({inited:!1,position:"",lineStyle:{},currentIndex:-1}),N=R(()=>f.length>+e.swipeThreshold||!e.ellipsis||e.shrink),E=R(()=>({borderColor:e.color,background:e.background})),L=(t,a)=>{var r;return(r=t.name)!=null?r:a},H=R(()=>{const t=f[d.currentIndex];if(t)return L(t,d.currentIndex)}),$=R(()=>Pe(e.offsetTop)),Q=R(()=>e.sticky?$.value+v:0),O=t=>{const a=g.value,r=b.value;if(!N.value||!a||!r||!r[d.currentIndex])return;const y=r[d.currentIndex].$el,m=y.offsetLeft-(a.offsetWidth-y.offsetWidth)/2;o&&o(),o=rt(a,m,t?0:+e.duration)},I=()=>{const t=d.inited;A(()=>{const a=b.value;if(!a||!a[d.currentIndex]||e.type!=="line"||Oe(s.value))return;const r=a[d.currentIndex].$el,{lineWidth:y,lineHeight:m}=e,w=r.offsetLeft+r.offsetWidth/2,x={width:ne(y),backgroundColor:e.color,transform:`translateX(${w}px) translateX(-50%)`};if(t&&(x.transitionDuration=`${e.duration}s`),G(m)){const M=ne(m);x.height=M,x.borderRadius=M}d.lineStyle=x})},ve=t=>{const a=t<d.currentIndex?-1:1;for(;t>=0&&t<f.length;){if(!f[t].disabled)return t;t+=a}},W=(t,a)=>{const r=ve(t);if(!G(r))return;const y=f[r],m=L(y,r),w=d.currentIndex!==null;d.currentIndex!==r&&(d.currentIndex=r,a||O(),I()),m!==e.active&&(l("update:active",m),w&&l("change",m,y.title)),n&&!e.scrollspy&&He(Math.ceil(le(s.value)-$.value))},D=(t,a)=>{const r=f.find((m,w)=>L(m,w)===t),y=r?f.indexOf(r):0;W(y,a)},p=(t=!1)=>{if(e.scrollspy){const a=f[d.currentIndex].$el;if(a&&k.value){const r=le(a,k.value)-Q.value;c=!0,u&&u(),u=st(k.value,r,t?0:+e.duration,()=>{c=!1})}}},be=(t,a,r)=>{const{title:y,disabled:m}=f[a],w=L(f[a],a);m||(We(e.beforeChange,{args:[w],done:()=>{W(a),p()}}),De(t)),l("clickTab",{name:w,title:y,event:r,disabled:m})},he=t=>{n=t.isFixed,l("scroll",t)},me=t=>{A(()=>{D(t),p(!0)})},ge=()=>{for(let t=0;t<f.length;t++){const{top:a}=ae(f[t].$el);if(a>Q.value)return t===0?0:t-1}return f.length-1},ye=()=>{if(e.scrollspy&&!c){const t=ge();W(t)}},Te=()=>{if(e.type==="line"&&f.length)return h("div",{class:V("line"),style:d.lineStyle},null)},ee=()=>{var t,a,r;const{type:y,border:m,sticky:w}=e,x=[h("div",{ref:w?void 0:T,class:[V("wrap"),{[Ee]:y==="line"&&m}]},[h("div",{ref:g,role:"tablist",class:V("nav",[y,{shrink:e.shrink,complete:N.value}]),style:E.value,"aria-orientation":"horizontal"},[(t=i["nav-left"])==null?void 0:t.call(i),f.map(M=>M.renderTitle(be)),Te(),(a=i["nav-right"])==null?void 0:a.call(i)])]),(r=i["nav-bottom"])==null?void 0:r.call(i)];return w?h("div",{ref:T},[x]):x},te=()=>{I(),A(()=>{var t,a;O(!0),(a=(t=_.value)==null?void 0:t.swipeRef.value)==null||a.resize()})};B(()=>[e.color,e.duration,e.lineWidth,e.lineHeight],I),B($e,te),B(()=>e.active,t=>{t!==H.value&&D(t)}),B(()=>f.length,()=>{d.inited&&(D(e.active),I(),A(()=>{O(!0)}))});const Se=()=>{D(e.active,!0),A(()=>{d.inited=!0,T.value&&(v=ae(T.value).height),O(!0)})},we=(t,a)=>l("rendered",t,a);return J({resize:te,scrollTo:me}),Ae(I),ze(I),Ne(Se),it(s,I),Le("scroll",ye,{target:k,passive:!0}),K({id:P,props:e,setLine:I,scrollable:N,onRendered:we,currentName:H,setTitleRefs:S,scrollIntoView:O}),()=>h("div",{ref:s,class:V([e.type])},[e.sticky?h(ot,{container:s.value,offsetTop:$.value,onScroll:he},{default:()=>[ee()]}):ee(),h(dt,{ref:_,count:f.length,inited:d.inited,animated:e.animated,duration:e.duration,swipeable:e.swipeable,lazyRender:e.lazyRender,currentIndex:d.currentIndex,onChange:W},{default:()=>{var t;return[(t=i.default)==null?void 0:t.call(i)]}})])}});const[vt,re]=U("tab"),bt=j({name:vt,props:{id:String,dot:Boolean,type:String,color:String,title:String,badge:z,shrink:Boolean,isActive:Boolean,disabled:Boolean,controls:String,scrollable:Boolean,activeColor:String,inactiveColor:String,showZeroBadge:F},setup(e,{slots:l}){const i=R(()=>{const c={},{type:n,color:o,disabled:u,isActive:s,activeColor:g,inactiveColor:T}=e;o&&n==="card"&&(c.borderColor=o,u||(s?c.backgroundColor=o:c.color=o));const P=s?g:T;return P&&(c.color=P),c}),v=()=>{const c=h("span",{class:re("text",{ellipsis:!e.scrollable})},[l.title?l.title():e.title]);return e.dot||G(e.badge)&&e.badge!==""?h(Me,{dot:e.dot,content:e.badge,showZero:e.showZeroBadge},{default:()=>[c]}):c};return()=>h("div",{id:e.id,role:"tab",class:[re([e.type,{grow:e.scrollable&&!e.shrink,shrink:e.shrink,active:e.isActive,disabled:e.disabled}])],style:i.value,tabindex:e.disabled?void 0:e.isActive?0:-1,"aria-selected":e.isActive,"aria-disabled":e.disabled||void 0,"aria-controls":e.controls},[v()])}}),[ht,Y]=U("tab"),mt=Ze({},Ve,{dot:Boolean,name:z,badge:z,title:String,disabled:Boolean,titleClass:Fe,titleStyle:[String,Object],showZeroBadge:F});var gt=j({name:ht,props:mt,setup(e,{slots:l}){const i=ce(),v=C(!1),c=et(),{parent:n,index:o}=Ue(fe);if(!n){console.error("[Vant] <Tab> must be a child component of <Tabs>.");return}const u=()=>{var b;return(b=e.name)!=null?b:o.value},s=()=>{v.value=!0,n.props.lazyRender&&A(()=>{n.onRendered(u(),e.title)})},g=R(()=>{const b=u()===n.currentName.value;return b&&!v.value&&s(),b}),T=C(""),_=C("");je(()=>{const{titleClass:b,titleStyle:S}=e;T.value=b?Ke(b):"",_.value=S&&typeof S!="string"?Xe(Ye(S)):S});const P=b=>h(bt,pe({key:i,id:`${n.id}-${o.value}`,ref:n.setTitleRefs(o.value),style:_.value,class:T.value,isActive:g.value,controls:i,scrollable:n.scrollable.value,activeColor:n.props.titleActiveColor,inactiveColor:n.props.titleInactiveColor,onClick:S=>b(c.proxy,o.value,S)},ie(n.props,["type","color","shrink"]),ie(e,["dot","badge","title","disabled","showZeroBadge"])),{title:l.title}),k=C(!g.value);return B(g,b=>{b?k.value=!1:qe(()=>{k.value=!0})}),B(()=>e.title,()=>{n.setLine(),n.scrollIntoView()}),Ge(tt,g),J({id:i,renderTitle:P}),()=>{var b;const S=`${n.id}-${o.value}`,{animated:f,swipeable:K,scrollspy:d,lazyRender:N}=n.props;if(!l.default&&!f)return;const E=d||g.value;if(f||K)return h(at,{id:i,role:"tabpanel",class:Y("panel-wrapper",{inactive:k.value}),tabindex:g.value?0:-1,"aria-hidden":!g.value,"aria-labelledby":S},{default:()=>{var $;return[h("div",{class:Y("panel")},[($=l.default)==null?void 0:$.call(l)])]}});const H=v.value||d||!N?(b=l.default)==null?void 0:b.call(l):null;return Je(h("div",{id:i,role:"tabpanel",class:Y("panel"),tabindex:E?0:-1,"aria-labelledby":S},[H]),[[Qe,E]])}}});const kt=de(gt),It=de(ft);export{It as T,kt as a};
  3. ========
  4. import{aC as se,aD as q,bp as Ce,bm as ke,c as K,d as U,bb as X,r as C,w as B,y as xe,a3 as Q,a as h,n as z,m as Ie,b as Z,t as F,bt as ce,bH as Re,ah as Be,x as _e,e as R,bK as $e,bO as Pe,z as A,aW as Ae,bQ as ze,bo as Ne,a4 as Le,bJ as Oe,o as ne,a2 as J,aP as He,a5 as ae,bs as Ee,bR as le,a7 as We,bS as De,b8 as Me,aj as Ze,b5 as Ve,ac as Fe,ak as Ke,aZ as Ue,bh as je,bT as Xe,b0 as Ye,aR as qe,aH as Je,g as Qe,v as Ge,h as pe,al as ie,aU as et,k as de}from"./index-010a77d0.js";import{T as tt}from"./index-ed76276f.js";import{S as nt,a as at}from"./index-dcf2cb19.js";import{u as lt}from"./use-refs-0d3d47c2.js";import{u as it,S as ot}from"./index-b4e114f2.js";function rt(e,l,i){let v,c=0;const n=e.scrollLeft,o=i===0?1:Math.round(i*1e3/16);function u(){se(v)}function s(){e.scrollLeft+=(l-n)/o,++c<o&&(v=q(s))}return s(),u}function st(e,l,i,v){let c,n=Ce(e);const o=n<l,u=i===0?1:Math.round(i*1e3/16),s=(l-n)/u;function g(){se(c)}function T(){n+=s,(o&&n>l||!o&&n<l)&&(n=l),ke(e,n),o&&n<l||!o&&n>l?c=q(T):v&&(c=q(v))}return T(),g}const[ct,oe]=K("tabs");var dt=U({name:ct,props:{count:X(Number),inited:Boolean,animated:Boolean,duration:X(z),swipeable:Boolean,lazyRender:Boolean,currentIndex:X(Number)},emits:["change"],setup(e,{emit:l,slots:i}){const v=C(),c=u=>l("change",u),n=()=>{var u;const s=(u=i.default)==null?void 0:u.call(i);return e.animated||e.swipeable?h(nt,{ref:v,loop:!1,class:oe("track"),duration:+e.duration*1e3,touchable:e.swipeable,lazyRender:e.lazyRender,showIndicators:!1,onChange:c},{default:()=>[s]}):s},o=u=>{const s=v.value;s&&s.state.active!==u&&s.swipeTo(u,{immediate:!e.inited})};return B(()=>e.currentIndex,o),xe(()=>{o(e.currentIndex)}),Q({swipeRef:v}),()=>h("div",{class:oe("content",{animated:e.animated||e.swipeable})},[n()])}});const[ue,V]=K("tabs"),ut={type:Ie("line"),color:String,border:Boolean,sticky:Boolean,shrink:Boolean,active:Z(0),duration:Z(.3),animated:Boolean,ellipsis:F,swipeable:Boolean,scrollspy:Boolean,offsetTop:Z(0),background:String,lazyRender:F,lineWidth:z,lineHeight:z,beforeChange:Function,swipeThreshold:Z(5),titleActiveColor:String,titleInactiveColor:String},fe=Symbol(ue);var ft=U({name:ue,props:ut,emits:["change","scroll","rendered","clickTab","update:active"],setup(e,{emit:l,slots:i}){let v,c,n,o,u;const s=C(),g=C(),T=C(),_=C(),$=ce(),k=Re(s),[b,S]=lt(),{children:f,linkChildren:j}=Be(fe),d=_e({inited:!1,position:"",lineStyle:{},currentIndex:-1}),N=R(()=>f.length>+e.swipeThreshold||!e.ellipsis||e.shrink),H=R(()=>({borderColor:e.color,background:e.background})),L=(t,a)=>{var r;return(r=t.name)!=null?r:a},E=R(()=>{const t=f[d.currentIndex];if(t)return L(t,d.currentIndex)}),P=R(()=>$e(e.offsetTop)),G=R(()=>e.sticky?P.value+v:0),O=t=>{const a=g.value,r=b.value;if(!N.value||!a||!r||!r[d.currentIndex])return;const y=r[d.currentIndex].$el,m=y.offsetLeft-(a.offsetWidth-y.offsetWidth)/2;o&&o(),o=rt(a,m,t?0:+e.duration)},x=()=>{const t=d.inited;A(()=>{const a=b.value;if(!a||!a[d.currentIndex]||e.type!=="line"||Oe(s.value))return;const r=a[d.currentIndex].$el,{lineWidth:y,lineHeight:m}=e,w=r.offsetLeft+r.offsetWidth/2,I={width:ne(y),backgroundColor:e.color,transform:`translateX(${w}px) translateX(-50%)`};if(t&&(I.transitionDuration=`${e.duration}s`),J(m)){const M=ne(m);I.height=M,I.borderRadius=M}d.lineStyle=I})},ve=t=>{const a=t<d.currentIndex?-1:1;for(;t>=0&&t<f.length;){if(!f[t].disabled)return t;t+=a}},W=(t,a)=>{const r=ve(t);if(!J(r))return;const y=f[r],m=L(y,r),w=d.currentIndex!==null;d.currentIndex!==r&&(d.currentIndex=r,a||O(),x()),m!==e.active&&(l("update:active",m),w&&l("change",m,y.title)),n&&!e.scrollspy&&Ee(Math.ceil(le(s.value)-P.value))},D=(t,a)=>{const r=f.find((m,w)=>L(m,w)===t),y=r?f.indexOf(r):0;W(y,a)},p=(t=!1)=>{if(e.scrollspy){const a=f[d.currentIndex].$el;if(a&&k.value){const r=le(a,k.value)-G.value;c=!0,u&&u(),u=st(k.value,r,t?0:+e.duration,()=>{c=!1})}}},be=(t,a,r)=>{const{title:y,disabled:m}=f[a],w=L(f[a],a);m||(We(e.beforeChange,{args:[w],done:()=>{W(a),p()}}),De(t)),l("clickTab",{name:w,title:y,event:r,disabled:m})},he=t=>{n=t.isFixed,l("scroll",t)},me=t=>{A(()=>{D(t),p(!0)})},ge=()=>{for(let t=0;t<f.length;t++){const{top:a}=ae(f[t].$el);if(a>G.value)return t===0?0:t-1}return f.length-1},ye=()=>{if(e.scrollspy&&!c){const t=ge();W(t)}},Te=()=>{if(e.type==="line"&&f.length)return h("div",{class:V("line"),style:d.lineStyle},null)},ee=()=>{var t,a,r;const{type:y,border:m,sticky:w}=e,I=[h("div",{ref:w?void 0:T,class:[V("wrap"),{[He]:y==="line"&&m}]},[h("div",{ref:g,role:"tablist",class:V("nav",[y,{shrink:e.shrink,complete:N.value}]),style:H.value,"aria-orientation":"horizontal"},[(t=i["nav-left"])==null?void 0:t.call(i),f.map(M=>M.renderTitle(be)),Te(),(a=i["nav-right"])==null?void 0:a.call(i)])]),(r=i["nav-bottom"])==null?void 0:r.call(i)];return w?h("div",{ref:T},[I]):I},te=()=>{x(),A(()=>{var t,a;O(!0),(a=(t=_.value)==null?void 0:t.swipeRef.value)==null||a.resize()})};B(()=>[e.color,e.duration,e.lineWidth,e.lineHeight],x),B(Pe,te),B(()=>e.active,t=>{t!==E.value&&D(t)}),B(()=>f.length,()=>{d.inited&&(D(e.active),x(),A(()=>{O(!0)}))});const Se=()=>{D(e.active,!0),A(()=>{d.inited=!0,T.value&&(v=ae(T.value).height),O(!0)})},we=(t,a)=>l("rendered",t,a);return Q({resize:te,scrollTo:me}),Ae(x),ze(x),Ne(Se),it(s,x),Le("scroll",ye,{target:k,passive:!0}),j({id:$,props:e,setLine:x,scrollable:N,onRendered:we,currentName:E,setTitleRefs:S,scrollIntoView:O}),()=>h("div",{ref:s,class:V([e.type])},[e.sticky?h(ot,{container:s.value,offsetTop:P.value,onScroll:he},{default:()=>[ee()]}):ee(),h(dt,{ref:_,count:f.length,inited:d.inited,animated:e.animated,duration:e.duration,swipeable:e.swipeable,lazyRender:e.lazyRender,currentIndex:d.currentIndex,onChange:W},{default:()=>{var t;return[(t=i.default)==null?void 0:t.call(i)]}})])}});const[vt,re]=K("tab"),bt=U({name:vt,props:{id:String,dot:Boolean,type:String,color:String,title:String,badge:z,shrink:Boolean,isActive:Boolean,disabled:Boolean,controls:String,scrollable:Boolean,activeColor:String,inactiveColor:String,showZeroBadge:F},setup(e,{slots:l}){const i=R(()=>{const c={},{type:n,color:o,disabled:u,isActive:s,activeColor:g,inactiveColor:T}=e;o&&n==="card"&&(c.borderColor=o,u||(s?c.backgroundColor=o:c.color=o));const $=s?g:T;return $&&(c.color=$),c}),v=()=>{const c=h("span",{class:re("text",{ellipsis:!e.scrollable})},[l.title?l.title():e.title]);return e.dot||J(e.badge)&&e.badge!==""?h(Me,{dot:e.dot,content:e.badge,showZero:e.showZeroBadge},{default:()=>[c]}):c};return()=>h("div",{id:e.id,role:"tab",class:[re([e.type,{grow:e.scrollable&&!e.shrink,shrink:e.shrink,active:e.isActive,disabled:e.disabled}])],style:i.value,tabindex:e.disabled?void 0:e.isActive?0:-1,"aria-selected":e.isActive,"aria-disabled":e.disabled||void 0,"aria-controls":e.controls},[v()])}}),[ht,Y]=K("tab"),mt=Ze({},Ve,{dot:Boolean,name:z,badge:z,title:String,disabled:Boolean,titleClass:Fe,titleStyle:[String,Object],showZeroBadge:F});var gt=U({name:ht,props:mt,setup(e,{slots:l}){const i=ce(),v=C(!1),c=et(),{parent:n,index:o}=Ke(fe);if(!n){console.error("[Vant] <Tab> must be a child component of <Tabs>.");return}const u=()=>{var b;return(b=e.name)!=null?b:o.value},s=()=>{v.value=!0,n.props.lazyRender&&A(()=>{n.onRendered(u(),e.title)})},g=R(()=>{const b=u()===n.currentName.value;return b&&!v.value&&s(),b}),T=C(""),_=C("");Ue(()=>{const{titleClass:b,titleStyle:S}=e;T.value=b?je(b):"",_.value=S&&typeof S!="string"?Xe(Ye(S)):S});const $=b=>h(bt,pe({key:i,id:`${n.id}-${o.value}`,ref:n.setTitleRefs(o.value),style:_.value,class:T.value,isActive:g.value,controls:i,scrollable:n.scrollable.value,activeColor:n.props.titleActiveColor,inactiveColor:n.props.titleInactiveColor,onClick:S=>b(c.proxy,o.value,S)},ie(n.props,["type","color","shrink"]),ie(e,["dot","badge","title","disabled","showZeroBadge"])),{title:l.title}),k=C(!g.value);return B(g,b=>{b?k.value=!1:qe(()=>{k.value=!0})}),B(()=>e.title,()=>{n.setLine(),n.scrollIntoView()}),Je(tt,g),Q({id:i,renderTitle:$}),()=>{var b;const S=`${n.id}-${o.value}`,{animated:f,swipeable:j,scrollspy:d,lazyRender:N}=n.props;if(!l.default&&!f)return;const H=d||g.value;if(f||j)return h(at,{id:i,role:"tabpanel",class:Y("panel-wrapper",{inactive:k.value}),tabindex:g.value?0:-1,"aria-hidden":!g.value,"aria-labelledby":S},{default:()=>{var P;return[h("div",{class:Y("panel")},[(P=l.default)==null?void 0:P.call(l)])]}});const E=v.value||d||!N?(b=l.default)==null?void 0:b.call(l):null;return Qe(h("div",{id:i,role:"tabpanel",class:Y("panel"),tabindex:H?0:-1,"aria-labelledby":S},[E]),[[Ge,H]])}}});const kt=de(gt),xt=de(ft);export{xt as T,kt as a};
  5. >>>>>>>> iteration-20250327-light:dist/assets/index-1b4df78e.js