index.88a00aa9.js 16 KB

123456
  1. <<<<<<<< HEAD:dist/assets/index.466e527a.js
  2. import{aE as K,ap as ye,aF as we,R as S,aG as Te,t as H,d as M,z as $,v as E,y as x,c as b,a1 as X,aH as Ce,av as U,Z as _,$ as Se,W as G,u as ke,w as O,Q as le,an as Ie,x as Re,r as xe,az as Be,aI as _e,_ as B,aJ as $e,aK as Pe,aL as Ae,a0 as ze,at as Ne,U as p,G as Oe,I as Le,aM as ee,E as Ee,al as He,am as te,aN as Me,aO as We,N as De,ae as Ze,O as Fe,C as Ue,aP as Ve,X as Ke,ac as Xe,aQ as Ge,D as ie}from"./index.ffe80dbe.js";import{T as Qe}from"./use-tab-status.5a3cd090.js";import{S as Ye,a as je}from"./index.b4b77b5a.js";import{S as qe}from"./index.02edecb1.js";function Je(e,l,o){let s=0;const a=e.scrollLeft,f=o===0?1:Math.round(o*1e3/16);function d(){e.scrollLeft+=(l-a)/f,++s<f&&K(d)}d()}function pe(e,l,o,s){let a=ye(e);const f=a<l,d=o===0?1:Math.round(o*1e3/16),v=(l-a)/d;function r(){a+=v,(f&&a>l||!f&&a<l)&&(a=l),we(e,a),f&&a<l||!f&&a>l?K(r):s&&K(s)}r()}function et(){const e=S([]),l=[];return Te(()=>{e.value=[]}),[e,s=>(l[s]||(l[s]=a=>{e.value[s]=a}),l[s])]}const[tt,ne]=H("tab");var nt=M({name:tt,props:{id:String,dot:Boolean,type:String,color:String,title:String,badge:$,shrink:Boolean,isActive:Boolean,disabled:Boolean,controls:String,scrollable:Boolean,activeColor:String,inactiveColor:String,showZeroBadge:E},setup(e,{slots:l}){const o=x(()=>{const a={},{type:f,color:d,disabled:v,isActive:r,activeColor:w,inactiveColor:h}=e;d&&f==="card"&&(a.borderColor=d,v||(r?a.backgroundColor=d:a.color=d));const C=r?w:h;return C&&(a.color=C),a}),s=()=>{const a=b("span",{class:ne("text",{ellipsis:!e.scrollable})},[l.title?l.title():e.title]);return e.dot||X(e.badge)&&e.badge!==""?b(Ce,{dot:e.dot,content:e.badge,showZero:e.showZeroBadge},{default:()=>[a]}):a};return()=>b("div",{id:e.id,role:"tab",class:[ne([e.type,{grow:e.scrollable&&!e.shrink,shrink:e.shrink,active:e.isActive,disabled:e.disabled}])],style:o.value,tabindex:e.disabled?void 0:e.isActive?0:-1,"aria-selected":e.isActive,"aria-disabled":e.disabled||void 0,"aria-controls":e.controls},[s()])}});const[at,ae]=H("tabs");var lt=M({name:at,props:{count:U(Number),inited:Boolean,animated:Boolean,duration:U($),swipeable:Boolean,lazyRender:Boolean,currentIndex:U(Number)},emits:["change"],setup(e,{emit:l,slots:o}){const s=S(),a=v=>l("change",v),f=()=>{var v;const r=(v=o.default)==null?void 0:v.call(o);return e.animated||e.swipeable?b(Ye,{ref:s,loop:!1,class:ae("track"),duration:+e.duration*1e3,touchable:e.swipeable,lazyRender:e.lazyRender,showIndicators:!1,onChange:a},{default:()=>[r]}):r},d=v=>{const r=s.value;r&&r.state.active!==v&&r.swipeTo(v,{immediate:!e.inited})};return _(()=>e.currentIndex,d),Se(()=>{d(e.currentIndex)}),G({swipeRef:s}),()=>b("div",{class:ae("content",{animated:e.animated||e.swipeable})},[f()])}});const[oe,L]=H("tabs"),it={type:ke("line"),color:String,border:Boolean,sticky:Boolean,shrink:Boolean,active:O(0),duration:O(.3),animated:Boolean,ellipsis:E,swipeable:Boolean,scrollspy:Boolean,offsetTop:O(0),background:String,lazyRender:E,lineWidth:$,lineHeight:$,beforeChange:Function,swipeThreshold:O(5),titleActiveColor:String,titleInactiveColor:String},re=Symbol(oe);var ot=M({name:oe,props:it,emits:["change","scroll","rendered","clickTab","update:active"],setup(e,{emit:l,slots:o}){let s,a,f;const d=S(),v=S(),r=S(),w=S(),h=le(),T=Ie(d),[C,W]=et(),{children:u,linkChildren:D}=Re(re),c=xe({inited:!1,position:"",lineStyle:{},currentIndex:-1}),P=x(()=>u.length>e.swipeThreshold||!e.ellipsis||e.shrink),Z=x(()=>({borderColor:e.color,background:e.background})),k=(t,n)=>{var i;return(i=t.name)!=null?i:n},Q=x(()=>{const t=u[c.currentIndex];if(t)return k(t,c.currentIndex)}),F=x(()=>Be(e.offsetTop)),Y=x(()=>e.sticky?F.value+s:0),A=t=>{const n=v.value,i=C.value;if(!P.value||!n||!i||!i[c.currentIndex])return;const m=i[c.currentIndex].$el,g=m.offsetLeft-(n.offsetWidth-m.offsetWidth)/2;Je(n,g,t?0:+e.duration)},I=()=>{const t=c.inited;B(()=>{const n=C.value;if(!n||!n[c.currentIndex]||e.type!=="line"||Ne(d.value))return;const i=n[c.currentIndex].$el,{lineWidth:m,lineHeight:g}=e,y=i.offsetLeft+i.offsetWidth/2,R={width:p(m),backgroundColor:e.color,transform:`translateX(${y}px) translateX(-50%)`};if(t&&(R.transitionDuration=`${e.duration}s`),X(g)){const J=p(g);R.height=J,R.borderRadius=J}c.lineStyle=R})},se=t=>{const n=t<c.currentIndex?-1:1;for(;t>=0&&t<u.length;){if(!u[t].disabled)return t;t+=n}},z=(t,n)=>{const i=se(t);if(!X(i))return;const m=u[i],g=k(m,i),y=c.currentIndex!==null;c.currentIndex!==i&&(c.currentIndex=i,n||A(),I()),g!==e.active&&(l("update:active",g),y&&l("change",g,m.title)),f&&!e.scrollspy&&Le(Math.ceil(ee(d.value)-F.value))},N=(t,n)=>{const i=u.find((g,y)=>k(g,y)===t),m=i?u.indexOf(i):0;z(m,n)},j=(t=!1)=>{if(e.scrollspy){const n=u[c.currentIndex].$el;if(n&&T.value){const i=ee(n,T.value)-Y.value;a=!0,pe(T.value,i,t?0:+e.duration,()=>{a=!1})}}},ce=(t,n,i)=>{const{title:m,disabled:g}=u[n],y=k(u[n],n);g||(Me(e.beforeChange,{args:[y],done:()=>{z(n),j()}}),We(t)),l("clickTab",{name:y,title:m,event:i,disabled:g})},de=t=>{f=t.isFixed,l("scroll",t)},ue=t=>{B(()=>{N(t),j(!0)})},fe=()=>{for(let t=0;t<u.length;t++){const{top:n}=te(u[t].$el);if(n>Y.value)return t===0?0:t-1}return u.length-1},ve=()=>{if(e.scrollspy&&!a){const t=fe();z(t)}},be=()=>u.map((t,n)=>b(nt,Ee({key:t.id,id:`${h}-${n}`,ref:W(n),type:e.type,color:e.color,style:t.titleStyle,class:t.titleClass,shrink:e.shrink,isActive:n===c.currentIndex,controls:t.id,scrollable:P.value,activeColor:e.titleActiveColor,inactiveColor:e.titleInactiveColor,onClick:i=>ce(t,n,i)},He(t,["dot","badge","title","disabled","showZeroBadge"])),{title:t.$slots.title})),he=()=>{if(e.type==="line"&&u.length)return b("div",{class:L("line"),style:c.lineStyle},null)},q=()=>{var t,n,i;const{type:m,border:g,sticky:y}=e,R=[b("div",{ref:y?void 0:r,class:[L("wrap"),{[Oe]:m==="line"&&g}]},[b("div",{ref:v,role:"tablist",class:L("nav",[m,{shrink:e.shrink,complete:P.value}]),style:Z.value,"aria-orientation":"horizontal"},[(t=o["nav-left"])==null?void 0:t.call(o),be(),he(),(n=o["nav-right"])==null?void 0:n.call(o)])]),(i=o["nav-bottom"])==null?void 0:i.call(o)];return y?b("div",{ref:r},[R]):R};_([()=>e.color,_e],I),_(()=>e.active,t=>{t!==Q.value&&N(t)}),_(()=>u.length,()=>{c.inited&&(N(e.active),I(),B(()=>{A(!0)}))});const ge=()=>{N(e.active,!0),B(()=>{c.inited=!0,r.value&&(s=te(r.value).height),A(!0)})},me=(t,n)=>l("rendered",t,n);return G({resize:()=>{I(),B(()=>{var t,n;return(n=(t=w.value)==null?void 0:t.swipeRef.value)==null?void 0:n.resize()})},scrollTo:ue}),$e(I),Pe(I),Ae(ge),ze("scroll",ve,{target:T,passive:!0}),D({id:h,props:e,setLine:I,onRendered:me,currentName:Q,scrollIntoView:A}),()=>b("div",{ref:d,class:L([e.type])},[e.sticky?b(qe,{container:d.value,offsetTop:F.value,onScroll:de},{default:()=>[q()]}):q(),b(lt,{ref:w,count:u.length,inited:c.inited,animated:e.animated,duration:e.duration,swipeable:e.swipeable,lazyRender:e.lazyRender,currentIndex:c.currentIndex,onChange:z},{default:()=>{var t;return[(t=o.default)==null?void 0:t.call(o)]}})])}});const[rt,V]=H("tab"),st=De({},Ze,{dot:Boolean,name:$,badge:$,title:String,disabled:Boolean,titleClass:Fe,titleStyle:[String,Object],showZeroBadge:E});var ct=M({name:rt,props:st,setup(e,{slots:l}){const o=le(),s=S(!1),{parent:a,index:f}=Ue(re);if(!a){console.error("[Vant] <Tab> must be a child component of <Tabs>.");return}const d=()=>{var h;return(h=e.name)!=null?h:f.value},v=()=>{s.value=!0,a.props.lazyRender&&B(()=>{a.onRendered(d(),e.title)})},r=x(()=>{const h=d()===a.currentName.value;return h&&!s.value&&v(),h}),w=S(!r.value);return _(r,h=>{h?w.value=!1:Ve(()=>{w.value=!0})}),_(()=>e.title,()=>{a.setLine(),a.scrollIntoView()}),Ke(Qe,r),()=>{var h;const T=`${a.id}-${f.value}`,{animated:C,swipeable:W,scrollspy:u,lazyRender:D}=a.props;if(!l.default&&!C)return;const c=u||r.value;if(C||W)return b(je,{id:o,role:"tabpanel",class:V("panel-wrapper",{inactive:w.value}),tabindex:r.value?0:-1,"aria-hidden":!r.value,"aria-labelledby":T},{default:()=>{var k;return[b("div",{class:V("panel")},[(k=l.default)==null?void 0:k.call(l)])]}});const Z=s.value||u||!D?(h=l.default)==null?void 0:h.call(l):null;return G({id:o}),Xe(b("div",{id:o,role:"tabpanel",class:V("panel"),tabindex:c?0:-1,"aria-labelledby":T},[Z]),[[Ge,c]])}}});const ht=ie(ct),gt=ie(ot);export{gt as T,ht as a,et as u};
  3. ========
  4. import{aI as V,ar as ye,aF as we,R as C,aK as Se,t as H,d as M,z as $,v as E,y as B,c as b,a1 as X,aL as Te,aB as U,Z as _,$ as Ce,W as Q,u as ke,w as O,Q as le,ap as Ie,x as Re,r as Be,aM as xe,aN as _e,_ as x,aO as $e,aP as Ae,aH as Pe,a0 as Ne,aA as ze,U as p,G as Oe,I as Le,aQ as ee,an as te,E as Ee,am as He,aR as Me,aS as We,N as De,ae as Ze,O as Fe,C as Ue,aT as Ke,X as Ve,ac as Xe,ay as Qe,D as ie}from"./index.1c621181.js";import{T as Ye}from"./use-tab-status.40058c51.js";import{S as je,a as qe}from"./index.78a302c3.js";import{S as Ge}from"./index.d5b73933.js";function Je(e,l,o){let s=0;const a=e.scrollLeft,f=o===0?1:Math.round(o*1e3/16);function d(){e.scrollLeft+=(l-a)/f,++s<f&&V(d)}d()}function pe(e,l,o,s){let a=ye(e);const f=a<l,d=o===0?1:Math.round(o*1e3/16),v=(l-a)/d;function r(){a+=v,(f&&a>l||!f&&a<l)&&(a=l),we(e,a),f&&a<l||!f&&a>l?V(r):s&&V(s)}r()}function et(){const e=C([]),l=[];return Se(()=>{e.value=[]}),[e,s=>(l[s]||(l[s]=a=>{e.value[s]=a}),l[s])]}const[tt,ne]=H("tab");var nt=M({name:tt,props:{id:String,dot:Boolean,type:String,color:String,title:String,badge:$,shrink:Boolean,isActive:Boolean,disabled:Boolean,controls:String,scrollable:Boolean,activeColor:String,inactiveColor:String,showZeroBadge:E},setup(e,{slots:l}){const o=B(()=>{const a={},{type:f,color:d,disabled:v,isActive:r,activeColor:w,inactiveColor:h}=e;d&&f==="card"&&(a.borderColor=d,v||(r?a.backgroundColor=d:a.color=d));const T=r?w:h;return T&&(a.color=T),a}),s=()=>{const a=b("span",{class:ne("text",{ellipsis:!e.scrollable})},[l.title?l.title():e.title]);return e.dot||X(e.badge)&&e.badge!==""?b(Te,{dot:e.dot,content:e.badge,showZero:e.showZeroBadge},{default:()=>[a]}):a};return()=>b("div",{id:e.id,role:"tab",class:[ne([e.type,{grow:e.scrollable&&!e.shrink,shrink:e.shrink,active:e.isActive,disabled:e.disabled}])],style:o.value,tabindex:e.disabled?void 0:e.isActive?0:-1,"aria-selected":e.isActive,"aria-disabled":e.disabled||void 0,"aria-controls":e.controls},[s()])}});const[at,ae]=H("tabs");var lt=M({name:at,props:{count:U(Number),inited:Boolean,animated:Boolean,duration:U($),swipeable:Boolean,lazyRender:Boolean,currentIndex:U(Number)},emits:["change"],setup(e,{emit:l,slots:o}){const s=C(),a=v=>l("change",v),f=()=>{var v;const r=(v=o.default)==null?void 0:v.call(o);return e.animated||e.swipeable?b(je,{ref:s,loop:!1,class:ae("track"),duration:+e.duration*1e3,touchable:e.swipeable,lazyRender:e.lazyRender,showIndicators:!1,onChange:a},{default:()=>[r]}):r},d=v=>{const r=s.value;r&&r.state.active!==v&&r.swipeTo(v,{immediate:!e.inited})};return _(()=>e.currentIndex,d),Ce(()=>{d(e.currentIndex)}),Q({swipeRef:s}),()=>b("div",{class:ae("content",{animated:e.animated||e.swipeable})},[f()])}});const[oe,L]=H("tabs"),it={type:ke("line"),color:String,border:Boolean,sticky:Boolean,shrink:Boolean,active:O(0),duration:O(.3),animated:Boolean,ellipsis:E,swipeable:Boolean,scrollspy:Boolean,offsetTop:O(0),background:String,lazyRender:E,lineWidth:$,lineHeight:$,beforeChange:Function,swipeThreshold:O(5),titleActiveColor:String,titleInactiveColor:String},re=Symbol(oe);var ot=M({name:oe,props:it,emits:["change","scroll","rendered","clickTab","update:active"],setup(e,{emit:l,slots:o}){let s,a,f;const d=C(),v=C(),r=C(),w=C(),h=le(),S=Ie(d),[T,W]=et(),{children:u,linkChildren:D}=Re(re),c=Be({inited:!1,position:"",lineStyle:{},currentIndex:-1}),A=B(()=>u.length>e.swipeThreshold||!e.ellipsis||e.shrink),Z=B(()=>({borderColor:e.color,background:e.background})),k=(t,n)=>{var i;return(i=t.name)!=null?i:n},Y=B(()=>{const t=u[c.currentIndex];if(t)return k(t,c.currentIndex)}),F=B(()=>xe(e.offsetTop)),j=B(()=>e.sticky?F.value+s:0),P=t=>{const n=v.value,i=T.value;if(!A.value||!n||!i||!i[c.currentIndex])return;const m=i[c.currentIndex].$el,g=m.offsetLeft-(n.offsetWidth-m.offsetWidth)/2;Je(n,g,t?0:+e.duration)},I=()=>{const t=c.inited;x(()=>{const n=T.value;if(!n||!n[c.currentIndex]||e.type!=="line"||ze(d.value))return;const i=n[c.currentIndex].$el,{lineWidth:m,lineHeight:g}=e,y=i.offsetLeft+i.offsetWidth/2,R={width:p(m),backgroundColor:e.color,transform:`translateX(${y}px) translateX(-50%)`};if(t&&(R.transitionDuration=`${e.duration}s`),X(g)){const J=p(g);R.height=J,R.borderRadius=J}c.lineStyle=R})},se=t=>{const n=t<c.currentIndex?-1:1;for(;t>=0&&t<u.length;){if(!u[t].disabled)return t;t+=n}},N=(t,n)=>{const i=se(t);if(!X(i))return;const m=u[i],g=k(m,i),y=c.currentIndex!==null;c.currentIndex!==i&&(c.currentIndex=i,n||P(),I()),g!==e.active&&(l("update:active",g),y&&l("change",g,m.title)),f&&!e.scrollspy&&Le(Math.ceil(ee(d.value)-F.value))},z=(t,n)=>{const i=u.find((g,y)=>k(g,y)===t),m=i?u.indexOf(i):0;N(m,n)},q=(t=!1)=>{if(e.scrollspy){const n=u[c.currentIndex].$el;if(n&&S.value){const i=ee(n,S.value)-j.value;a=!0,pe(S.value,i,t?0:+e.duration,()=>{a=!1})}}},ce=(t,n,i)=>{const{title:m,disabled:g}=u[n],y=k(u[n],n);g||(Me(e.beforeChange,{args:[y],done:()=>{N(n),q()}}),We(t)),l("clickTab",{name:y,title:m,event:i,disabled:g})},de=t=>{f=t.isFixed,l("scroll",t)},ue=t=>{x(()=>{z(t),q(!0)})},fe=()=>{for(let t=0;t<u.length;t++){const{top:n}=te(u[t].$el);if(n>j.value)return t===0?0:t-1}return u.length-1},ve=()=>{if(e.scrollspy&&!a){const t=fe();N(t)}},be=()=>u.map((t,n)=>b(nt,Ee({key:t.id,id:`${h}-${n}`,ref:W(n),type:e.type,color:e.color,style:t.titleStyle,class:t.titleClass,shrink:e.shrink,isActive:n===c.currentIndex,controls:t.id,scrollable:A.value,activeColor:e.titleActiveColor,inactiveColor:e.titleInactiveColor,onClick:i=>ce(t,n,i)},He(t,["dot","badge","title","disabled","showZeroBadge"])),{title:t.$slots.title})),he=()=>{if(e.type==="line"&&u.length)return b("div",{class:L("line"),style:c.lineStyle},null)},G=()=>{var t,n,i;const{type:m,border:g,sticky:y}=e,R=[b("div",{ref:y?void 0:r,class:[L("wrap"),{[Oe]:m==="line"&&g}]},[b("div",{ref:v,role:"tablist",class:L("nav",[m,{shrink:e.shrink,complete:A.value}]),style:Z.value,"aria-orientation":"horizontal"},[(t=o["nav-left"])==null?void 0:t.call(o),be(),he(),(n=o["nav-right"])==null?void 0:n.call(o)])]),(i=o["nav-bottom"])==null?void 0:i.call(o)];return y?b("div",{ref:r},[R]):R};_([()=>e.color,_e],I),_(()=>e.active,t=>{t!==Y.value&&z(t)}),_(()=>u.length,()=>{c.inited&&(z(e.active),I(),x(()=>{P(!0)}))});const ge=()=>{z(e.active,!0),x(()=>{c.inited=!0,r.value&&(s=te(r.value).height),P(!0)})},me=(t,n)=>l("rendered",t,n);return Q({resize:()=>{I(),x(()=>{var t,n;return(n=(t=w.value)==null?void 0:t.swipeRef.value)==null?void 0:n.resize()})},scrollTo:ue}),$e(I),Ae(I),Pe(ge),Ne("scroll",ve,{target:S,passive:!0}),D({id:h,props:e,setLine:I,onRendered:me,currentName:Y,scrollIntoView:P}),()=>b("div",{ref:d,class:L([e.type])},[e.sticky?b(Ge,{container:d.value,offsetTop:F.value,onScroll:de},{default:()=>[G()]}):G(),b(lt,{ref:w,count:u.length,inited:c.inited,animated:e.animated,duration:e.duration,swipeable:e.swipeable,lazyRender:e.lazyRender,currentIndex:c.currentIndex,onChange:N},{default:()=>{var t;return[(t=o.default)==null?void 0:t.call(o)]}})])}});const[rt,K]=H("tab"),st=De({},Ze,{dot:Boolean,name:$,badge:$,title:String,disabled:Boolean,titleClass:Fe,titleStyle:[String,Object],showZeroBadge:E});var ct=M({name:rt,props:st,setup(e,{slots:l}){const o=le(),s=C(!1),{parent:a,index:f}=Ue(re);if(!a)return;const d=()=>{var h;return(h=e.name)!=null?h:f.value},v=()=>{s.value=!0,a.props.lazyRender&&x(()=>{a.onRendered(d(),e.title)})},r=B(()=>{const h=d()===a.currentName.value;return h&&!s.value&&v(),h}),w=C(!r.value);return _(r,h=>{h?w.value=!1:Ke(()=>{w.value=!0})}),_(()=>e.title,()=>{a.setLine(),a.scrollIntoView()}),Ve(Ye,r),()=>{var h;const S=`${a.id}-${f.value}`,{animated:T,swipeable:W,scrollspy:u,lazyRender:D}=a.props;if(!l.default&&!T)return;const c=u||r.value;if(T||W)return b(qe,{id:o,role:"tabpanel",class:K("panel-wrapper",{inactive:w.value}),tabindex:r.value?0:-1,"aria-hidden":!r.value,"aria-labelledby":S},{default:()=>{var k;return[b("div",{class:K("panel")},[(k=l.default)==null?void 0:k.call(l)])]}});const Z=s.value||u||!D?(h=l.default)==null?void 0:h.call(l):null;return Q({id:o}),Xe(b("div",{id:o,role:"tabpanel",class:K("panel"),tabindex:c?0:-1,"aria-labelledby":S},[Z]),[[Qe,c]])}}});const ht=ie(ct),gt=ie(ot);export{gt as T,ht as a,et as u};
  5. >>>>>>>> online:dist/assets/index.88a00aa9.js