1 |
- !function(){function e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var a,r,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(a=n.next()).done)&&(o.push(a.value),!t||o.length!==t);i=!0);}catch(c){l=!0,r=c}finally{try{i||null==n.return||n.return()}finally{if(l)throw r}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);"Object"===a&&e.constructor&&(a=e.constructor.name);if("Map"===a||"Set"===a)return Array.from(e);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return n(e,t)}(e,t)||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(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[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.7ef67fdb.js","./index-legacy.53298efe.js","./use-tab-status-legacy.14cce99d.js","./index-legacy.863b202f.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,B,C,A,T,j,R,O,L,$,H,M,W,Z,E,N,F,D,P,U,V,X,q,J,K,Q,G,Y,ee,te,ne,ae;return{setters:[function(e){a=e.x,r=e.r,o=e.O,i=e.P,l=e.l,c=e.D,d=e.E,u=e.C,s=e.d,v=e.Q,f=e.n,b=e.y,h=e.v,p=e.w,g=e.K,m=e.c,x=e.g,y=e.j,w=e.o,k=e.R,_=e.J,I=e.L,S=e.B,z=e.S,B=e.U,C=e.z,A=e.H,T=e.I},function(e){j=e.g,R=e.s,O=e.c,L=e.u,$=e.a,H=e.n,M=e.m,W=e.b,Z=e.i,E=e.w,N=e.t,F=e.B,D=e.d,P=e.e,U=e.f,V=e.o,X=e.h,q=e.j,J=e.k,K=e.l,Q=e.p,G=e.r,Y=e.q,ee=e.v},function(e){te=e.T},function(e){ne=e.S,ae=e.a}],execute:function(){n("u",oe);var re=0;function oe(){var e=a(),t=((null==e?void 0:e.type)||{}).name;return"".concat(void 0===t?"unknown":t,"-").concat(++re)}function ie(e,t,n,a){var r=j(e),o=r<t,l=0===n?1:Math.round(1e3*n/16),c=(t-r)/l;!function n(){r+=c,(o&&r>t||!o&&r<t)&&(r=t),R(e,r),o&&r<t||!o&&r>t?i(n):a&&i(a)}()}var le=t(O("sticky"),2),ce=le[0],de=le[1],ue={zIndex:H,position:M("top"),container:Object,offsetTop:W(0),offsetBottom:W(0)},se=s({name:ce,props:ue,emits:["scroll","change"],setup:function(t,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"===t.position?t.offsetTop:t.offsetBottom)})),k=b((function(){var e=y.fixed,t=y.height,n=y.width;if(e)return{width:"".concat(n,"px"),height:"".concat(t,"px")}})),_=b((function(){if(y.fixed){var n=h($(t.zIndex),e({width:"".concat(y.width,"px"),height:"".concat(y.height,"px")},t.position,"".concat(w.value,"px")));return y.transform&&(n.transform="translate3d(0, ".concat(y.transform,"px, 0)")),n}})),I=function(){if(i.value&&!Z(i)){var e=t.container,n=t.position,r=x(i),o=j(window);if(y.width=r.width,y.height=r.height,"top"===n)if(e){var l=x(e),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(e){var u=x(e),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(e){a("scroll",{scrollTop:e,isFixed:y.fixed})}(o)}};return p((function(){return y.fixed}),(function(e){return a("change",e)})),g("scroll",I,{target:s}),function(e,t){if(l&&window.IntersectionObserver){var n=new IntersectionObserver((function(e){t(e[0].intersectionRatio>0)}),{root:document.body}),a=function(){e.value&&n.unobserve(e.value)};c(a),d(a),u((function(){e.value&&n.observe(e.value)}))}}(i,I),function(){var e;return m("div",{ref:i,style:k.value},[m("div",{class:de({fixed:y.fixed}),style:_.value},[null==(e=o.default)?void 0:e.call(o)])])}}}),ve=E(se),fe=t(O("tab"),2),be=fe[0],he=fe[1],pe=s({name:be,props:{id:String,dot:Boolean,type:String,color:String,title:String,badge:H,shrink:Boolean,isActive:Boolean,disabled:Boolean,controls:String,scrollable:Boolean,activeColor:String,inactiveColor:String,showZeroBadge:N},setup:function(e,t){var n=t.slots,a=b((function(){var t={},n=e.type,a=e.color,r=e.disabled,o=e.isActive,i=e.activeColor,l=e.inactiveColor;a&&"card"===n&&(t.borderColor=a,r||(o?t.backgroundColor=a:t.color=a));var c=o?i:l;return c&&(t.color=c),t}));return function(){return m("div",{id:e.id,role:"tab",class:[he([e.type,{grow:e.scrollable&&!e.shrink,shrink:e.shrink,active:e.isActive,disabled:e.disabled}])],style:a.value,tabindex:e.disabled?void 0:e.isActive?0:-1,"aria-selected":e.isActive,"aria-disabled":e.disabled||void 0,"aria-controls":e.controls},[(t=m("span",{class:he("text",{ellipsis:!e.scrollable})},[n.title?n.title():e.title]),e.dot||y(e.badge)&&""!==e.badge?m(F,{dot:e.dot,content:e.badge,showZero:e.showZeroBadge},{default:function(){return[t]}}):t)]);var t}}}),ge=t(O("tabs"),2),me=ge[0],xe=ge[1],ye=s({name:me,props:{count:D(Number),inited:Boolean,animated:Boolean,duration:D(H),swipeable:Boolean,lazyRender:Boolean,currentIndex:D(Number)},emits:["change"],setup:function(e,t){var n=t.emit,a=t.slots,o=r(),i=function(e){return n("change",e)},l=function(t){var n=o.value;n&&n.state.active!==t&&n.swipeTo(t,{immediate:!e.inited})};return p((function(){return e.currentIndex}),l),w((function(){l(e.currentIndex)})),function(){return m("div",{class:xe("content",{animated:e.animated||e.swipeable})},[(n=null==(t=a.default)?void 0:t.call(a),e.animated||e.swipeable?m(ne,{ref:o,loop:!1,class:xe("track"),duration:1e3*+e.duration,touchable:e.swipeable,lazyRender:e.lazyRender,showIndicators:!1,onChange:i},{default:function(){return[n]}}):n)]);var t,n}}}),we=t(O("tabs"),2),ke=we[0],_e=we[1],Ie={type:M("line"),color:String,border:Boolean,sticky:Boolean,shrink:Boolean,active:W(0),duration:W(.3),animated:Boolean,ellipsis:N,swipeable:Boolean,scrollspy:Boolean,offsetTop:W(0),background:String,lazyRender:N,lineWidth:H,lineHeight:H,beforeChange:Function,swipeThreshold:W(5),titleActiveColor:String,titleInactiveColor:String},Se=Symbol(ke),ze=s({name:ke,props:Ie,emits:["click","change","scroll","disabled","rendered","click-tab","update:active"],setup:function(n,a){var l,c,d,s,h,w=a.emit,B=a.slots,C=r(),A=r(),T=r(),j=oe(),R=v(C),O=(s=r([]),h=[],o((function(){s.value=[]})),[s,function(e){return h[e]||(h[e]=function(t){s.value[e]=t}),h[e]}]),$=t(O,2),H=$[0],M=$[1],W=k(Se),E=W.children,N=W.linkChildren,F=f({inited:!1,position:"",lineStyle:{},currentIndex:-1}),D=b((function(){return E.length>n.swipeThreshold||!n.ellipsis||n.shrink})),Y=b((function(){return{borderColor:n.color,background:n.background}})),ee=function(e,t){var n;return null!=(n=e.name)?n:t},te=b((function(){var e=E[F.currentIndex];if(e)return ee(e,F.currentIndex)})),ne=b((function(){return L(n.offsetTop)})),ae=b((function(){return n.sticky?ne.value+l:0})),re=function(e){var t=A.value,a=H.value;if(D.value&&t&&a&&a[F.currentIndex]){var r=a[F.currentIndex].$el;!function(e,t,n){var a=0,r=e.scrollLeft,o=0===n?1:Math.round(1e3*n/16);!function n(){e.scrollLeft+=(t-r)/o,++a<o&&i(n)}()}(t,r.offsetLeft-(t.offsetWidth-r.offsetWidth)/2,e?0:+n.duration)}},le=function(){var e=F.inited;_((function(){var t=H.value;if(t&&t[F.currentIndex]&&"line"===n.type&&!Z(C.value)){var a=t[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(e&&(l.transitionDuration="".concat(n.duration,"s")),y(o)){var c=X(o);l.height=c,l.borderRadius=c}F.lineStyle=l}}))},ce=function(e){var t=function(e){for(var t=e<F.currentIndex?-1:1;e>=0&&e<E.length;){if(!E[e].disabled)return e;e+=t}}(e);if(y(t)){var a=E[t],r=ee(a,t),o=null!==F.currentIndex;F.currentIndex=t,r!==n.active&&(w("update:active",r),o&&w("change",r,a.title))}},de=function(e){var t=E.find((function(t,n){return ee(t,n)===e})),n=t?E.indexOf(t):0;ce(n)},ue=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(n.scrollspy){var t=E[F.currentIndex].$el;if(t&&R.value){var a=K(t,R.value)-ae.value;c=!0,ie(R.value,a,e?0:+n.duration,(function(){c=!1}))}}},se=function(e){d=e.isFixed,w("scroll",e)},fe=function(){return E.map((function(e,t){return m(pe,S({key:e.id,id:"".concat(j,"-").concat(t),ref:M(t),type:n.type,color:n.color,style:e.titleStyle,class:e.titleClass,shrink:n.shrink,isActive:t===F.currentIndex,controls:e.id,scrollable:D.value,activeColor:n.titleActiveColor,inactiveColor:n.titleInactiveColor,onClick:function(a){return function(e,t,a){var r=E[t],o=r.title,i=r.disabled,l=ee(E[t],t);i?w("disabled",l,o):(Q(n.beforeChange,{args:[l],done:function(){ce(t),ue()}}),w("click",l,o),G(e)),w("click-tab",{name:l,title:o,event:a,disabled:i})}(e,t,a)}},z(e,["dot","badge","title","disabled","showZeroBadge"])),{title:e.$slots.title})}))},be=function(){if("line"===n.type&&E.length)return m("div",{class:_e("line"),style:F.lineStyle},null)},he=function(){var t,a,r=n.type,o=n.border;return m("div",{ref:T,class:[_e("wrap"),e({},q,"line"===r&&o)]},[m("div",{ref:A,role:"tablist",class:_e("nav",[r,{shrink:n.shrink,complete:D.value}]),style:Y.value,"aria-orientation":"horizontal"},[null==(t=B["nav-left"])?void 0:t.call(B),fe(),be(),null==(a=B["nav-right"])?void 0:a.call(B)])])};p([function(){return n.color},P],le),p((function(){return n.active}),(function(e){e!==te.value&&de(e)})),p((function(){return E.length}),(function(){F.inited&&(de(n.active),le(),_((function(){re(!0)})))})),p((function(){return F.currentIndex}),(function(){re(),le(),d&&!n.scrollspy&&J(Math.ceil(K(C.value)-ne.value))}));return U({resize:le,scrollTo:function(e){_((function(){de(e),ue(!0)}))}}),I(le),V(le),u((function(){de(n.active),_((function(){F.inited=!0,T.value&&(l=x(T.value).height),re(!0)}))})),g("scroll",(function(){if(n.scrollspy&&!c){var e=function(){for(var e=0;e<E.length;e++)if(x(E[e].$el).top>ae.value)return 0===e?0:e-1;return E.length-1}();ce(e)}}),{target:R}),N({id:j,props:n,setLine:le,onRendered:function(e,t){return w("rendered",e,t)},currentName:te,scrollIntoView:re}),function(){var e;return m("div",{ref:C,class:_e([n.type])},[n.sticky?m(ve,{container:C.value,offsetTop:ne.value,onScroll:se},{default:function(){var e;return[he(),null==(e=B["nav-bottom"])?void 0:e.call(B)]}}):[he(),null==(e=B["nav-bottom"])?void 0:e.call(B)],m(ye,{count:E.length,inited:F.inited,animated:n.animated,duration:n.duration,swipeable:n.swipeable,lazyRender:n.lazyRender,currentIndex:F.currentIndex,onChange:ce},{default:function(){var e;return[null==(e=B.default)?void 0:e.call(B)]}})])}}}),Be=t(O("tab"),2),Ce=Be[0],Ae=Be[1],Te=h({},Y,{dot:Boolean,name:H,badge:H,title:String,disabled:Boolean,titleClass:ee,titleStyle:[String,Object],showZeroBadge:N}),je=s({name:Ce,props:Te,setup:function(e,t){var n=t.slots,a=oe(),o=r(!1),i=B(Se),l=i.parent,c=i.index;if(l){var d=function(){var t;return null!=(t=e.name)?t:c.value},u=b((function(){var t=d()===l.currentName.value;return t&&!o.value&&(o.value=!0,l.props.lazyRender&&_((function(){l.onRendered(d(),e.title)}))),t}));return p((function(){return e.title}),(function(){l.setLine(),l.scrollIntoView()})),C(te,u),function(){var e,t="".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(ae,{id:a,role:"tabpanel",class:Ae("panel-wrapper",{inactive:!u.value}),tabindex:u.value?0:-1,"aria-hidden":!u.value,"aria-labelledby":t},{default:function(){var e;return[m("div",{class:Ae("panel")},[null==(e=n.default)?void 0:e.call(n)])]}});var b=o.value||s||!v?null==(e=n.default)?void 0:e.call(n):null;return U({id:a}),A(m("div",{id:a,role:"tabpanel",class:Ae("panel"),tabindex:f?0:-1,"aria-labelledby":t},[b]),[[T,f]])}}}}});n("a",E(je)),n("T",E(ze))}}}))}();
|