1 |
- !function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t,n,r){return(n=function(t){var n=function(t,n){if("object"!==e(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,n||"default");if("object"!==e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"===e(n)?n:String(n)}(n))in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}function n(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){var r,i,o,a,l=[],u=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);u=!0);}catch(s){c=!0,i=s}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return l}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(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 r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}System.register(["./index-legacy-fff8b745.js","./use-tab-status-legacy-45817f45.js","./index-legacy-22cc4940.js"],(function(e,r){"use strict";var i,o,a,l,u,c,s,f,d,v,p,b,h,g,y,m,x,w,S,I,k,C,B,T,R,z,A,j,O,Z,W,$,L,N,F,H,M,E,P,V,X,U,D,G,K,Q,Y,_,q,J,ee,te,ne,re,ie,oe,ae,le,ue,ce,se,fe,de;return{setters:[function(e){i=e.aZ,o=e.ad,a=e.aS,l=e.a_,u=e.r,c=e.a$,s=e.ay,f=e.aG,d=e.ax,v=e.aU,p=e.c,b=e.n,h=e.m,g=e.b,y=e.d,m=e.aR,x=e.x,w=e.e,S=e.b0,I=e.a9,k=e.i,C=e.w,B=e.Y,T=e.b1,R=e.z,z=e.Z,A=e.b2,j=e.b3,O=e.a,Z=e.k,W=e.b4,$=e.y,L=e.X,N=e.t,F=e.b5,H=e.a7,M=e.aF,E=e.aT,P=e.o,V=e.W,X=e.a8,U=e.b6,D=e.b7,G=e.$,K=e.b8,Q=e.av,Y=e.as,_=e.a3,q=e.aa,J=e.aw,ee=e.b9,te=e.ba,ne=e.aN,re=e.ac,ie=e.aK,oe=e.g,ae=e.v,le=e.h,ue=e.ae,ce=e.aC},function(e){se=e.T},function(e){fe=e.S,de=e.a}],execute:function(){function r(e,t){if(s&&window.IntersectionObserver){var n=new IntersectionObserver((function(e){t(e[0].intersectionRatio>0)}),{root:document.body}),r=function(){e.value&&n.unobserve(e.value)};f(r),d(r),v((function(){e.value&&n.observe(e.value)}))}}var ve=n(p("sticky"),2),pe=ve[0],be=ve[1],he={zIndex:b,position:h("top"),container:Object,offsetTop:g(0),offsetBottom:g(0)},ge=y({name:pe,props:he,emits:["scroll","change"],setup:function(e,n){var i=n.emit,o=n.slots,l=u(),c=m(l),s=x({fixed:!1,width:0,height:0,transform:0}),f=u(!1),d=w((function(){return S("top"===e.position?e.offsetTop:e.offsetBottom)})),v=w((function(){if(!f.value){var e=s.fixed,t=s.height,n=s.width;return e?{width:"".concat(n,"px"),height:"".concat(t,"px")}:void 0}})),p=w((function(){if(s.fixed&&!f.value){var n=I(k(e.zIndex),t({width:"".concat(s.width,"px"),height:"".concat(s.height,"px")},e.position,"".concat(d.value,"px")));return s.transform&&(n.transform="translate3d(0, ".concat(s.transform,"px, 0)")),n}})),b=function(){if(l.value&&!T(l)){var t=e.container,n=e.position,r=z(l),o=a(window);if(s.width=r.width,s.height=r.height,"top"===n)if(t){var u=z(t),c=u.bottom-d.value-s.height;s.fixed=d.value>r.top&&u.bottom>0,s.transform=c<0?c:0}else s.fixed=d.value>r.top;else{var f=document.documentElement.clientHeight;if(t){var v=z(t),p=f-v.top-d.value-s.height;s.fixed=f-d.value<r.bottom&&f>v.top,s.transform=p<0?-p:0}else s.fixed=f-d.value<r.bottom}!function(e){i("scroll",{scrollTop:e,isFixed:s.fixed})}(o)}};return C((function(){return s.fixed}),(function(e){return i("change",e)})),B("scroll",b,{target:c,passive:!0}),r(l,b),C([A,j],(function(){l.value&&!T(l)&&s.fixed&&(f.value=!0,R((function(){var e=z(l);s.width=e.width,s.height=e.height,f.value=!1})))})),function(){var e;return O("div",{ref:l,style:v.value},[O("div",{class:be({fixed:s.fixed&&!f.value}),style:p.value},[null==(e=o.default)?void 0:e.call(o)])])}}}),ye=Z(ge),me=n(p("tabs"),2),xe=me[0],we=me[1],Se=y({name:xe,props:{count:W(Number),inited:Boolean,animated:Boolean,duration:W(b),swipeable:Boolean,lazyRender:Boolean,currentIndex:W(Number)},emits:["change"],setup:function(e,t){var n=t.emit,r=t.slots,i=u(),o=function(e){return n("change",e)},a=function(t){var n=i.value;n&&n.state.active!==t&&n.swipeTo(t,{immediate:!e.inited})};return C((function(){return e.currentIndex}),a),$((function(){a(e.currentIndex)})),L({swipeRef:i}),function(){return O("div",{class:we("content",{animated:e.animated||e.swipeable})},[(n=null==(t=r.default)?void 0:t.call(r),e.animated||e.swipeable?O(fe,{ref:i,loop:!1,class:we("track"),duration:1e3*+e.duration,touchable:e.swipeable,lazyRender:e.lazyRender,showIndicators:!1,onChange:o},{default:function(){return[n]}}):n)]);var t,n}}}),Ie=n(p("tabs"),2),ke=Ie[0],Ce=Ie[1],Be={type:h("line"),color:String,border:Boolean,sticky:Boolean,shrink:Boolean,active:g(0),duration:g(.3),animated:Boolean,ellipsis:N,swipeable:Boolean,scrollspy:Boolean,offsetTop:g(0),background:String,lazyRender:N,lineWidth:b,lineHeight:b,beforeChange:Function,swipeThreshold:g(5),titleActiveColor:String,titleInactiveColor:String},Te=Symbol(ke),Re=y({name:ke,props:Be,emits:["change","scroll","rendered","clickTab","update:active"],setup:function(e,s){var f,d,p,b,h,g,y,I=s.emit,k=s.slots,j=u(),Z=u(),W=u(),$=u(),N=F(),Q=m(j),Y=n((g=u([]),y=[],c((function(){g.value=[]})),[g,function(e){return y[e]||(y[e]=function(t){g.value[e]=t}),y[e]}]),2),_=Y[0],q=Y[1],J=H(Te),ee=J.children,te=J.linkChildren,ne=x({inited:!1,position:"",lineStyle:{},currentIndex:-1}),re=w((function(){return ee.length>+e.swipeThreshold||!e.ellipsis||e.shrink})),ie=w((function(){return{borderColor:e.color,background:e.background}})),oe=function(e,t){var n;return null!=(n=e.name)?n:t},ae=w((function(){var e=ee[ne.currentIndex];if(e)return oe(e,ne.currentIndex)})),le=w((function(){return S(e.offsetTop)})),ue=w((function(){return e.sticky?le.value+f:0})),ce=function(t){var n=Z.value,r=_.value;if(re.value&&n&&r&&r[ne.currentIndex]){var a=r[ne.currentIndex].$el,l=a.offsetLeft-(n.offsetWidth-a.offsetWidth)/2;b&&b(),b=function(e,t,n){var r,a=0,l=e.scrollLeft,u=0===n?1:Math.round(1e3*n/16);return function n(){e.scrollLeft+=(t-l)/u,++a<u&&(r=o(n))}(),function(){i(r)}}(n,l,t?0:+e.duration)}},se=function(){var t=ne.inited;R((function(){var n=_.value;if(n&&n[ne.currentIndex]&&"line"===e.type&&!T(j.value)){var r=n[ne.currentIndex].$el,i=e.lineWidth,o=e.lineHeight,a=r.offsetLeft+r.offsetWidth/2,l={width:P(i),backgroundColor:e.color,transform:"translateX(".concat(a,"px) translateX(-50%)")};if(t&&(l.transitionDuration="".concat(e.duration,"s")),V(o)){var u=P(o);l.height=u,l.borderRadius=u}ne.lineStyle=l}}))},fe=function(t,n){var r=function(e){for(var t=e<ne.currentIndex?-1:1;e>=0&&e<ee.length;){if(!ee[e].disabled)return e;e+=t}}(t);if(V(r)){var i=ee[r],o=oe(i,r),a=null!==ne.currentIndex;ne.currentIndex!==r&&(ne.currentIndex=r,n||ce(),se()),o!==e.active&&(I("update:active",o),a&&I("change",o,i.title)),p&&!e.scrollspy&&U(Math.ceil(D(j.value)-le.value))}},de=function(e,t){var n=ee.find((function(t,n){return oe(t,n)===e})),r=n?ee.indexOf(n):0;fe(r,t)},ve=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e.scrollspy){var n=ee[ne.currentIndex].$el;if(n&&Q.value){var r=D(n,Q.value)-ue.value;d=!0,h&&h(),h=function(e,t,n,r){var u,c=a(e),s=c<t,f=0===n?1:Math.round(1e3*n/16),d=(t-c)/f;return function n(){c+=d,(s&&c>t||!s&&c<t)&&(c=t),l(e,c),s&&c<t||!s&&c>t?u=o(n):r&&(u=o(r))}(),function(){i(u)}}(Q.value,r,t?0:+e.duration,(function(){d=!1}))}}},pe=function(t,n,r){var i=ee[n],o=i.title,a=i.disabled,l=oe(ee[n],n);a||(G(e.beforeChange,{args:[l],done:function(){fe(n),ve()}}),K(t)),I("clickTab",{name:l,title:o,event:r,disabled:a})},be=function(e){p=e.isFixed,I("scroll",e)},he=function(){if("line"===e.type&&ee.length)return O("div",{class:Ce("line"),style:ne.lineStyle},null)},ge=function(){var n,r,i,o=e.type,a=e.border,l=e.sticky,u=[O("div",{ref:l?void 0:W,class:[Ce("wrap"),t({},X,"line"===o&&a)]},[O("div",{ref:Z,role:"tablist",class:Ce("nav",[o,{shrink:e.shrink,complete:re.value}]),style:ie.value,"aria-orientation":"horizontal"},[null==(n=k["nav-left"])?void 0:n.call(k),ee.map((function(e){return e.renderTitle(pe)})),he(),null==(r=k["nav-right"])?void 0:r.call(k)])]),null==(i=k["nav-bottom"])?void 0:i.call(k)];return l?O("div",{ref:W},[u]):u},me=function(){se(),R((function(){var e,t;ce(!0),null==(t=null==(e=$.value)?void 0:e.swipeRef.value)||t.resize()}))};C((function(){return[e.color,e.duration,e.lineWidth,e.lineHeight]}),se),C(A,me),C((function(){return e.active}),(function(e){e!==ae.value&&de(e)})),C((function(){return ee.length}),(function(){ne.inited&&(de(e.active),se(),R((function(){ce(!0)})))}));return L({resize:me,scrollTo:function(e){R((function(){de(e),ve(!0)}))}}),M(se),E(se),v((function(){de(e.active,!0),R((function(){ne.inited=!0,W.value&&(f=z(W.value).height),ce(!0)}))})),r(j,se),B("scroll",(function(){if(e.scrollspy&&!d){var t=function(){for(var e=0;e<ee.length;e++)if(z(ee[e].$el).top>ue.value)return 0===e?0:e-1;return ee.length-1}();fe(t)}}),{target:Q,passive:!0}),te({id:N,props:e,setLine:se,scrollable:re,onRendered:function(e,t){return I("rendered",e,t)},currentName:ae,setTitleRefs:q,scrollIntoView:ce}),function(){return O("div",{ref:j,class:Ce([e.type])},[e.sticky?O(ye,{container:j.value,offsetTop:le.value,onScroll:be},{default:function(){return[ge()]}}):ge(),O(Se,{ref:$,count:ee.length,inited:ne.inited,animated:e.animated,duration:e.duration,swipeable:e.swipeable,lazyRender:e.lazyRender,currentIndex:ne.currentIndex,onChange:fe},{default:function(){var e;return[null==(e=k.default)?void 0:e.call(k)]}})])}}}),ze=n(p("tab"),2),Ae=ze[0],je=ze[1],Oe=y({name:Ae,props:{id:String,dot:Boolean,type:String,color:String,title:String,badge:b,shrink:Boolean,isActive:Boolean,disabled:Boolean,controls:String,scrollable:Boolean,activeColor:String,inactiveColor:String,showZeroBadge:N},setup:function(e,t){var n=t.slots,r=w((function(){var t={},n=e.type,r=e.color,i=e.disabled,o=e.isActive,a=e.activeColor,l=e.inactiveColor;r&&"card"===n&&(t.borderColor=r,i||(o?t.backgroundColor=r:t.color=r));var u=o?a:l;return u&&(t.color=u),t}));return function(){return O("div",{id:e.id,role:"tab",class:[je([e.type,{grow:e.scrollable&&!e.shrink,shrink:e.shrink,active:e.isActive,disabled:e.disabled}])],style:r.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=O("span",{class:je("text",{ellipsis:!e.scrollable})},[n.title?n.title():e.title]),e.dot||V(e.badge)&&""!==e.badge?O(Q,{dot:e.dot,content:e.badge,showZero:e.showZeroBadge},{default:function(){return[t]}}):t)]);var t}}}),Ze=n(p("tab"),2),We=Ze[0],$e=Ze[1],Le=I({},Y,{dot:Boolean,name:b,badge:b,title:String,disabled:Boolean,titleClass:_,titleStyle:[String,Object],showZeroBadge:N}),Ne=y({name:We,props:Le,setup:function(e,t){var n=t.slots,r=F(),i=u(!1),o=ce(),a=q(Te),l=a.parent,c=a.index;if(l){var s=function(){var t;return null!=(t=e.name)?t:c.value},f=w((function(){var t=s()===l.currentName.value;return t&&!i.value&&(i.value=!0,l.props.lazyRender&&R((function(){l.onRendered(s(),e.title)}))),t})),d=u(""),v=u("");J((function(){var t=e.titleClass,n=e.titleStyle;d.value=t?ee(t):"",v.value=n&&"string"!=typeof n?te(ne(n)):n}));var p=u(!f.value);return C(f,(function(e){e?p.value=!1:re((function(){p.value=!0}))})),C((function(){return e.title}),(function(){l.setLine(),l.scrollIntoView()})),ie(se,f),L({id:r,renderTitle:function(t){return O(Oe,le({key:r,id:"".concat(l.id,"-").concat(c.value),ref:l.setTitleRefs(c.value),style:v.value,class:d.value,isActive:f.value,controls:r,scrollable:l.scrollable.value,activeColor:l.props.titleActiveColor,inactiveColor:l.props.titleInactiveColor,onClick:function(e){return t(o.proxy,c.value,e)}},ue(l.props,["type","color","shrink"]),ue(e,["dot","badge","title","disabled","showZeroBadge"])),{title:n.title})}}),function(){var e,t="".concat(l.id,"-").concat(c.value),o=l.props,a=o.animated,u=o.swipeable,s=o.scrollspy,d=o.lazyRender;if(n.default||a){var v=s||f.value;if(a||u)return O(de,{id:r,role:"tabpanel",class:$e("panel-wrapper",{inactive:p.value}),tabindex:f.value?0:-1,"aria-hidden":!f.value,"aria-labelledby":t},{default:function(){var e;return[O("div",{class:$e("panel")},[null==(e=n.default)?void 0:e.call(n)])]}});var b=i.value||s||!d?null==(e=n.default)?void 0:e.call(n):null;return oe(O("div",{id:r,role:"tabpanel",class:$e("panel"),tabindex:v?0:-1,"aria-labelledby":t},[b]),[[ae,v]])}}}console.error("[Vant] <Tab> must be a child component of <Tabs>.")}});e("a",Z(Ne)),e("T",Z(Re))}}}))}();
|