1 |
- !function(){function t(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var a,r,o=[],i=!0,l=!1;try{for(n=n.call(t);!(i=(a=n.next()).done)&&(o.push(a.value),!e||o.length!==e);i=!0);}catch(c){l=!0,r=c}finally{try{i||null==n.return||n.return()}finally{if(l)throw r}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return n(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return n(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n<e;n++)a[n]=t[n];return a}var a=document.createElement("style");a.innerHTML=":root{--van-sticky-z-index: 99}.van-sticky--fixed{position:fixed;z-index:var(--van-sticky-z-index)}:root{--van-tab-text-color: var(--van-gray-7);--van-tab-active-text-color: var(--van-text-color);--van-tab-disabled-text-color: var(--van-text-color-3);--van-tab-font-size: var(--van-font-size-md);--van-tab-line-height: var(--van-line-height-md);--van-tabs-default-color: var(--van-danger-color);--van-tabs-line-height: 1.17333rem;--van-tabs-card-height: .8rem;--van-tabs-nav-background-color: var(--van-background-color-light);--van-tabs-bottom-bar-width: 1.06667rem;--van-tabs-bottom-bar-height: .08rem;--van-tabs-bottom-bar-color: var(--van-danger-color)}.van-tab{position:relative;display:flex;flex:1;align-items:center;justify-content:center;box-sizing:border-box;padding:0 var(--van-padding-base);color:var(--van-tab-text-color);font-size:var(--van-tab-font-size);line-height:var(--van-tab-line-height);cursor:pointer}.van-tab--active{color:var(--van-tab-active-text-color);font-weight:var(--van-font-weight-bold)}.van-tab--disabled{color:var(--van-tab-disabled-text-color);cursor:not-allowed}.van-tab--grow{flex:1 0 auto;padding:0 var(--van-padding-sm)}.van-tab--shrink{flex:none;padding:0 var(--van-padding-xs)}.van-tab--card{color:var(--van-tabs-default-color);border-right:var(--van-border-width-base) solid var(--van-tabs-default-color)}.van-tab--card:last-child{border-right:none}.van-tab--card.van-tab--active{color:var(--van-white);background-color:var(--van-tabs-default-color)}.van-tab--card--disabled{color:var(--van-tab-disabled-text-color)}.van-tab__text--ellipsis{display:-webkit-box;overflow:hidden;-webkit-line-clamp:1;-webkit-box-orient:vertical}.van-tabs{position:relative}.van-tabs__wrap{overflow:hidden}.van-tabs__wrap--page-top{position:fixed}.van-tabs__wrap--content-bottom{top:auto;bottom:0}.van-tabs__nav{position:relative;display:flex;background:var(--van-tabs-nav-background-color);-webkit-user-select:none;user-select:none}.van-tabs__nav--complete{overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch}.van-tabs__nav--complete::-webkit-scrollbar{display:none}.van-tabs__nav--line{box-sizing:content-box;height:100%;padding-bottom:.4rem}.van-tabs__nav--line.van-tabs__nav--shrink,.van-tabs__nav--line.van-tabs__nav--complete{padding-right:var(--van-padding-xs);padding-left:var(--van-padding-xs)}.van-tabs__nav--card{box-sizing:border-box;height:var(--van-tabs-card-height);margin:0 var(--van-padding-md);border:var(--van-border-width-base) solid var(--van-tabs-default-color);border-radius:var(--van-border-radius-sm)}.van-tabs__nav--card.van-tabs__nav--shrink{display:inline-flex}.van-tabs__line{position:absolute;bottom:.4rem;left:0;z-index:1;width:var(--van-tabs-bottom-bar-width);height:var(--van-tabs-bottom-bar-height);background:var(--van-tabs-bottom-bar-color);border-radius:var(--van-tabs-bottom-bar-height)}.van-tabs__track{position:relative;display:flex;width:100%;height:100%;will-change:left}.van-tabs__content--animated{overflow:hidden}.van-tabs--line .van-tabs__wrap{height:var(--van-tabs-line-height)}.van-tabs--card>.van-tabs__wrap{height:var(--van-tabs-card-height)}.van-tab__panel,.van-tab__panel-wrapper{flex-shrink:0;box-sizing:border-box;width:100%}.van-tab__panel-wrapper--inactive{height:0;overflow:visible}\n",document.head.appendChild(a),System.register(["./index-legacy.bcc45929.js","./index-legacy.9b0f7f75.js","./use-tab-status-legacy.c3bd8ea3.js","./index-legacy.f1d76d4b.js"],(function(n){"use strict";var a,r,o,i,l,c,d,u,s,v,f,b,h,p,g,m,x,y,w,k,_,I,S,z,C,B,A,T,j,R,O,L,M,$,H,N,W,Z,E,F,q,D,P,V,X,G,Q,U,J,K,Y,tt,et,nt,at;return{setters:[function(t){a=t.q,r=t.r,o=t.L,i=t.M,l=t.h,c=t.z,d=t.A,u=t.y,s=t.d,v=t.N,f=t.k,b=t.s,h=t.p,p=t.w,g=t.F,m=t.c,x=t.b,y=t.f,w=t.G,k=t.O,_=t.E,I=t.H,S=t.x,z=t.P,C=t.Q,B=t.t,A=t.C,T=t.D},function(t){j=t.g,R=t.s,O=t.c,L=t.u,M=t.a,$=t.n,H=t.m,N=t.b,W=t.i,Z=t.w,E=t.t,F=t.B,q=t.d,D=t.e,P=t.f,V=t.o,X=t.h,G=t.j,Q=t.k,U=t.l,J=t.p,K=t.r,Y=t.q,tt=t.v},function(t){et=t.T},function(t){nt=t.S,at=t.a}],execute:function(){n("u",ot);var rt=0;function ot(){var t=a(),e=((null==t?void 0:t.type)||{}).name;return"".concat(void 0===e?"unknown":e,"-").concat(++rt)}function it(t,e,n,a){var r=j(t),o=r<e,l=0===n?1:Math.round(1e3*n/16),c=(e-r)/l;!function n(){r+=c,(o&&r>e||!o&&r<e)&&(r=e),R(t,r),o&&r<e||!o&&r>e?i(n):a&&i(a)}()}var lt=e(O("sticky"),2),ct=lt[0],dt=lt[1],ut={zIndex:$,position:H("top"),container:Object,offsetTop:N(0),offsetBottom:N(0)},st=s({name:ct,props:ut,emits:["scroll","change"],setup:function(e,n){var a=n.emit,o=n.slots,i=r(),s=v(i),y=f({fixed:!1,width:0,height:0,transform:0}),w=b((function(){return L("top"===e.position?e.offsetTop:e.offsetBottom)})),k=b((function(){var t=y.fixed,e=y.height,n=y.width;if(t)return{width:"".concat(n,"px"),height:"".concat(e,"px")}})),_=b((function(){if(y.fixed){var n=h(M(e.zIndex),t({width:"".concat(y.width,"px"),height:"".concat(y.height,"px")},e.position,"".concat(w.value,"px")));return y.transform&&(n.transform="translate3d(0, ".concat(y.transform,"px, 0)")),n}})),I=function(){if(i.value&&!W(i)){var t=e.container,n=e.position,r=x(i),o=j(window);if(y.width=r.width,y.height=r.height,"top"===n)if(t){var l=x(t),c=l.bottom-w.value-y.height;y.fixed=w.value>r.top&&l.bottom>0,y.transform=c<0?c:0}else y.fixed=w.value>r.top;else{var d=document.documentElement.clientHeight;if(t){var u=x(t),s=d-u.top-w.value-y.height;y.fixed=d-w.value<r.bottom&&d>u.top,y.transform=s<0?-s:0}else y.fixed=d-w.value<r.bottom}!function(t){a("scroll",{scrollTop:t,isFixed:y.fixed})}(o)}};return p((function(){return y.fixed}),(function(t){return a("change",t)})),g("scroll",I,{target:s}),function(t,e){if(l&&window.IntersectionObserver){var n=new IntersectionObserver((function(t){e(t[0].intersectionRatio>0)}),{root:document.body}),a=function(){t.value&&n.unobserve(t.value)};c(a),d(a),u((function(){t.value&&n.observe(t.value)}))}}(i,I),function(){var t;return m("div",{ref:i,style:k.value},[m("div",{class:dt({fixed:y.fixed}),style:_.value},[null==(t=o.default)?void 0:t.call(o)])])}}}),vt=Z(st),ft=e(O("tab"),2),bt=ft[0],ht=ft[1],pt=s({name:bt,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:function(t,e){var n=e.slots,a=b((function(){var e={},n=t.type,a=t.color,r=t.disabled,o=t.isActive,i=t.activeColor,l=t.inactiveColor;a&&"card"===n&&(e.borderColor=a,r||(o?e.backgroundColor=a:e.color=a));var c=o?i:l;return c&&(e.color=c),e}));return function(){return m("div",{id:t.id,role:"tab",class:[ht([t.type,{grow:t.scrollable&&!t.shrink,shrink:t.shrink,active:t.isActive,disabled:t.disabled}])],style:a.value,tabindex:t.disabled?void 0:t.isActive?0:-1,"aria-selected":t.isActive,"aria-disabled":t.disabled||void 0,"aria-controls":t.controls},[(e=m("span",{class:ht("text",{ellipsis:!t.scrollable})},[n.title?n.title():t.title]),t.dot||y(t.badge)&&""!==t.badge?m(F,{dot:t.dot,content:t.badge,showZero:t.showZeroBadge},{default:function(){return[e]}}):e)]);var e}}}),gt=e(O("tabs"),2),mt=gt[0],xt=gt[1],yt=s({name:mt,props:{count:q(Number),inited:Boolean,animated:Boolean,duration:q($),swipeable:Boolean,lazyRender:Boolean,currentIndex:q(Number)},emits:["change"],setup:function(t,e){var n=e.emit,a=e.slots,o=r(),i=function(t){return n("change",t)},l=function(e){var n=o.value;n&&n.state.active!==e&&n.swipeTo(e,{immediate:!t.inited})};return p((function(){return t.currentIndex}),l),w((function(){l(t.currentIndex)})),function(){return m("div",{class:xt("content",{animated:t.animated||t.swipeable})},[(n=null==(e=a.default)?void 0:e.call(a),t.animated||t.swipeable?m(nt,{ref:o,loop:!1,class:xt("track"),duration:1e3*+t.duration,touchable:t.swipeable,lazyRender:t.lazyRender,showIndicators:!1,onChange:i},{default:function(){return[n]}}):n)]);var e,n}}}),wt=e(O("tabs"),2),kt=wt[0],_t=wt[1],It={type:H("line"),color:String,border:Boolean,sticky:Boolean,shrink:Boolean,active:N(0),duration:N(.3),animated:Boolean,ellipsis:E,swipeable:Boolean,scrollspy:Boolean,offsetTop:N(0),background:String,lazyRender:E,lineWidth:$,lineHeight:$,beforeChange:Function,swipeThreshold:N(5),titleActiveColor:String,titleInactiveColor:String},St=Symbol(kt),zt=s({name:kt,props:It,emits:["click","change","scroll","disabled","rendered","click-tab","update:active"],setup:function(n,a){var l,c,d,s,h,w=a.emit,C=a.slots,B=r(),A=r(),T=r(),j=ot(),R=v(B),O=(s=r([]),h=[],o((function(){s.value=[]})),[s,function(t){return h[t]||(h[t]=function(e){s.value[t]=e}),h[t]}]),M=e(O,2),$=M[0],H=M[1],N=k(St),Z=N.children,E=N.linkChildren,F=f({inited:!1,position:"",lineStyle:{},currentIndex:-1}),q=b((function(){return Z.length>n.swipeThreshold||!n.ellipsis||n.shrink})),Y=b((function(){return{borderColor:n.color,background:n.background}})),tt=function(t,e){var n;return null!=(n=t.name)?n:e},et=b((function(){var t=Z[F.currentIndex];if(t)return tt(t,F.currentIndex)})),nt=b((function(){return L(n.offsetTop)})),at=b((function(){return n.sticky?nt.value+l:0})),rt=function(t){var e=A.value,a=$.value;if(q.value&&e&&a&&a[F.currentIndex]){var r=a[F.currentIndex].$el;!function(t,e,n){var a=0,r=t.scrollLeft,o=0===n?1:Math.round(1e3*n/16);!function n(){t.scrollLeft+=(e-r)/o,++a<o&&i(n)}()}(e,r.offsetLeft-(e.offsetWidth-r.offsetWidth)/2,t?0:+n.duration)}},lt=function(){var t=F.inited;_((function(){var e=$.value;if(e&&e[F.currentIndex]&&"line"===n.type&&!W(B.value)){var a=e[F.currentIndex].$el,r=n.lineWidth,o=n.lineHeight,i=a.offsetLeft+a.offsetWidth/2,l={width:X(r),backgroundColor:n.color,transform:"translateX(".concat(i,"px) translateX(-50%)")};if(t&&(l.transitionDuration="".concat(n.duration,"s")),y(o)){var c=X(o);l.height=c,l.borderRadius=c}F.lineStyle=l}}))},ct=function(t){var e=function(t){for(var e=t<F.currentIndex?-1:1;t>=0&&t<Z.length;){if(!Z[t].disabled)return t;t+=e}}(t);if(y(e)){var a=Z[e],r=tt(a,e),o=null!==F.currentIndex;F.currentIndex=e,r!==n.active&&(w("update:active",r),o&&w("change",r,a.title))}},dt=function(t){var e=Z.find((function(e,n){return tt(e,n)===t})),n=e?Z.indexOf(e):0;ct(n)},ut=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(n.scrollspy){var e=Z[F.currentIndex].$el;if(e&&R.value){var a=U(e,R.value)-at.value;c=!0,it(R.value,a,t?0:+n.duration,(function(){c=!1}))}}},st=function(t){d=t.isFixed,w("scroll",t)},ft=function(){return Z.map((function(t,e){return m(pt,S({key:t.id,id:"".concat(j,"-").concat(e),ref:H(e),type:n.type,color:n.color,style:t.titleStyle,class:t.titleClass,shrink:n.shrink,isActive:e===F.currentIndex,controls:t.id,scrollable:q.value,activeColor:n.titleActiveColor,inactiveColor:n.titleInactiveColor,onClick:function(a){return function(t,e,a){var r=Z[e],o=r.title,i=r.disabled,l=tt(Z[e],e);i?w("disabled",l,o):(J(n.beforeChange,{args:[l],done:function(){ct(e),ut()}}),w("click",l,o),K(t)),w("click-tab",{name:l,title:o,event:a,disabled:i})}(t,e,a)}},z(t,["dot","badge","title","disabled","showZeroBadge"])),{title:t.$slots.title})}))},bt=function(){if("line"===n.type&&Z.length)return m("div",{class:_t("line"),style:F.lineStyle},null)},ht=function(){var e,a,r=n.type,o=n.border;return m("div",{ref:T,class:[_t("wrap"),t({},G,"line"===r&&o)]},[m("div",{ref:A,role:"tablist",class:_t("nav",[r,{shrink:n.shrink,complete:q.value}]),style:Y.value,"aria-orientation":"horizontal"},[null==(e=C["nav-left"])?void 0:e.call(C),ft(),bt(),null==(a=C["nav-right"])?void 0:a.call(C)])])};p([function(){return n.color},D],lt),p((function(){return n.active}),(function(t){t!==et.value&&dt(t)})),p((function(){return Z.length}),(function(){F.inited&&(dt(n.active),lt(),_((function(){rt(!0)})))})),p((function(){return F.currentIndex}),(function(){rt(),lt(),d&&!n.scrollspy&&Q(Math.ceil(U(B.value)-nt.value))}));return P({resize:lt,scrollTo:function(t){_((function(){dt(t),ut(!0)}))}}),I(lt),V(lt),u((function(){dt(n.active),_((function(){F.inited=!0,T.value&&(l=x(T.value).height),rt(!0)}))})),g("scroll",(function(){if(n.scrollspy&&!c){var t=function(){for(var t=0;t<Z.length;t++)if(x(Z[t].$el).top>at.value)return 0===t?0:t-1;return Z.length-1}();ct(t)}}),{target:R}),E({id:j,props:n,setLine:lt,onRendered:function(t,e){return w("rendered",t,e)},currentName:et,scrollIntoView:rt}),function(){var t;return m("div",{ref:B,class:_t([n.type])},[n.sticky?m(vt,{container:B.value,offsetTop:nt.value,onScroll:st},{default:function(){var t;return[ht(),null==(t=C["nav-bottom"])?void 0:t.call(C)]}}):[ht(),null==(t=C["nav-bottom"])?void 0:t.call(C)],m(yt,{count:Z.length,inited:F.inited,animated:n.animated,duration:n.duration,swipeable:n.swipeable,lazyRender:n.lazyRender,currentIndex:F.currentIndex,onChange:ct},{default:function(){var t;return[null==(t=C.default)?void 0:t.call(C)]}})])}}}),Ct=e(O("tab"),2),Bt=Ct[0],At=Ct[1],Tt=h({},Y,{dot:Boolean,name:$,badge:$,title:String,disabled:Boolean,titleClass:tt,titleStyle:[String,Object],showZeroBadge:E}),jt=s({name:Bt,props:Tt,setup:function(t,e){var n=e.slots,a=ot(),o=r(!1),i=C(St),l=i.parent,c=i.index;if(l){var d=function(){var e;return null!=(e=t.name)?e:c.value},u=b((function(){var e=d()===l.currentName.value;return e&&!o.value&&(o.value=!0,l.props.lazyRender&&_((function(){l.onRendered(d(),t.title)}))),e}));return p((function(){return t.title}),(function(){l.setLine(),l.scrollIntoView()})),B(et,u),function(){var t,e="".concat(l.id,"-").concat(c.value),r=l.props,i=r.animated,d=r.swipeable,s=r.scrollspy,v=r.lazyRender;if(n.default||i){var f=s||u.value;if(i||d)return m(at,{id:a,role:"tabpanel",class:At("panel-wrapper",{inactive:!u.value}),tabindex:u.value?0:-1,"aria-hidden":!u.value,"aria-labelledby":e},{default:function(){var t;return[m("div",{class:At("panel")},[null==(t=n.default)?void 0:t.call(n)])]}});var b=o.value||s||!v?null==(t=n.default)?void 0:t.call(n):null;return P({id:a}),A(m("div",{id:a,role:"tabpanel",class:At("panel"),tabindex:f?0:-1,"aria-labelledby":e},[b]),[[T,f]])}}}}});n("a",Z(jt)),n("T",Z(zt))}}}))}();
|