zzzz
2024-04-10 a835dca493534af6b7644bef2c4d3c678cdfca97
1
"use strict";(self["webpackChunkexchange"]=self["webpackChunkexchange"]||[]).push([[9546],{162:function(t,e,i){var n=i(51137),s=i(47456),r=i(99297),o=i(39763),l=(0,s.Y)("tab"),c=l[0],a=l[1];e.A=c({mixins:[(0,r.b)("vanTabs")],props:(0,n.A)({},o.aI,{dot:Boolean,name:[Number,String],info:[Number,String],badge:[Number,String],title:String,titleStyle:null,titleClass:null,disabled:Boolean}),data:function(){return{inited:!1}},computed:{computedName:function(){var t;return null!=(t=this.name)?t:this.index},isActive:function(){var t=this.computedName===this.parent.currentName;return t&&(this.inited=!0),t}},watch:{title:function(){this.parent.setLine(),this.parent.scrollIntoView()},inited:function(t){var e=this;this.parent.lazyRender&&t&&this.$nextTick((function(){e.parent.$emit("rendered",e.computedName,e.title)}))}},render:function(t){var e=this.slots,i=this.parent,n=this.isActive,s=e();if(s||i.animated){var r=i.scrollspy||n,o=this.inited||i.scrollspy||!i.lazyRender,l=o?s:t();return i.animated?t("div",{attrs:{role:"tabpanel","aria-hidden":!n},class:a("pane-wrapper",{inactive:!n})},[t("div",{class:a("pane")},[l])]):t("div",{directives:[{name:"show",value:r}],attrs:{role:"tabpanel"},class:a("pane")},[l])}}})},96356:function(t,e,i){i(76952)},26852:function(t,e,i){i.d(e,{A:function(){return O}});var n=i(47456),s=i(83462),r=i(33448),o=i(23102),l=i(32486);function c(t,e,i){var n=0,s=t.scrollLeft,r=0===i?1:Math.round(1e3*i/16);function l(){t.scrollLeft+=(e-s)/r,++n<r&&(0,o.er)(l)}l()}function a(t,e,i,n){var s=(0,l.hY)(t),r=s<e,c=0===i?1:Math.round(1e3*i/16),a=(e-s)/c;function h(){s+=a,(r&&s>e||!r&&s<e)&&(s=e),(0,l.LR)(t,s),r&&s<e||!r&&s>e?(0,o.er)(h):n&&(0,o.er)(n)}h()}var h=i(39763),u=i(73474),d=i(48499),f=i(56374),p=i(57707),v=i(99297),m=i(2879),b=i(52631),x=(0,n.Y)("tab"),g=x[0],y=x[1],S=g({props:{dot:Boolean,type:String,info:[Number,String],color:String,title:String,isActive:Boolean,disabled:Boolean,scrollable:Boolean,activeColor:String,inactiveColor:String},computed:{style:function(){var t={},e=this.color,i=this.isActive,n="card"===this.type;e&&n&&(t.borderColor=e,this.disabled||(i?t.backgroundColor=e:t.color=e));var s=i?this.activeColor:this.inactiveColor;return s&&(t.color=s),t}},methods:{onClick:function(){this.$emit("click")},genText:function(){var t=this.$createElement,e=t("span",{class:y("text",{ellipsis:!this.scrollable})},[this.slots()||this.title]);return this.dot||(0,r.C8)(this.info)&&""!==this.info?t("span",{class:y("text-wrapper")},[e,t(b.A,{attrs:{dot:this.dot,info:this.info}})]):e}},render:function(){var t=arguments[0];return t("div",{attrs:{role:"tab","aria-selected":this.isActive},class:[y({active:this.isActive,disabled:this.disabled})],style:this.style,on:{click:this.onClick}},[this.genText()])}}),C=(0,n.Y)("sticky"),I=C[0],k=C[1],$=I({mixins:[(0,m.x)((function(t,e){if(this.scroller||(this.scroller=(0,l.Rm)(this.$el)),this.observer){var i=e?"observe":"unobserve";this.observer[i](this.$el)}t(this.scroller,"scroll",this.onScroll,!0),this.onScroll()}))],props:{zIndex:[Number,String],container:null,offsetTop:{type:[Number,String],default:0}},data:function(){return{fixed:!1,height:0,transform:0}},computed:{offsetTopPx:function(){return(0,s.S)(this.offsetTop)},style:function(){if(this.fixed){var t={};return(0,r.C8)(this.zIndex)&&(t.zIndex=this.zIndex),this.offsetTopPx&&this.fixed&&(t.top=this.offsetTopPx+"px"),this.transform&&(t.transform="translate3d(0, "+this.transform+"px, 0)"),t}}},watch:{fixed:function(t){this.$emit("change",t)}},created:function(){var t=this;!r.S$&&window.IntersectionObserver&&(this.observer=new IntersectionObserver((function(e){e[0].intersectionRatio>0&&t.onScroll()}),{root:document.body}))},methods:{onScroll:function(){var t=this;if(!(0,u.d)(this.$el)){this.height=this.$el.offsetHeight;var e=this.container,i=this.offsetTopPx,n=(0,l.hY)(window),s=(0,l.mk)(this.$el),r=function(){t.$emit("scroll",{scrollTop:n,isFixed:t.fixed})};if(e){var o=s+e.offsetHeight;if(n+i+this.height>o){var c=this.height+n-o;return c<this.height?(this.fixed=!0,this.transform=-(c+i)):this.fixed=!1,void r()}}n+i>s?(this.fixed=!0,this.transform=0):this.fixed=!1,r()}}},render:function(){var t=arguments[0],e=this.fixed,i={height:e?this.height+"px":null};return t("div",{style:i},[t("div",{class:k({fixed:e}),style:this.style},[this.slots()])])}}),w=i(51137),T=i(28722),N=(0,n.Y)("tabs"),B=N[0],A=N[1],L=50,P=B({mixins:[T.B],props:{count:Number,duration:[Number,String],animated:Boolean,swipeable:Boolean,currentIndex:Number},computed:{style:function(){if(this.animated)return{transform:"translate3d("+-1*this.currentIndex*100+"%, 0, 0)",transitionDuration:this.duration+"s"}},listeners:function(){if(this.swipeable)return{touchstart:this.touchStart,touchmove:this.touchMove,touchend:this.onTouchEnd,touchcancel:this.onTouchEnd}}},methods:{onTouchEnd:function(){var t=this.direction,e=this.deltaX,i=this.currentIndex;"horizontal"===t&&this.offsetX>=L&&(e>0&&0!==i?this.$emit("change",i-1):e<0&&i!==this.count-1&&this.$emit("change",i+1))},genChildren:function(){var t=this.$createElement;return this.animated?t("div",{class:A("track"),style:this.style},[this.slots()]):this.slots()}},render:function(){var t=arguments[0];return t("div",{class:A("content",{animated:this.animated}),on:(0,w.A)({},this.listeners)},[this.genChildren()])}}),z=(0,n.Y)("tabs"),R=z[0],F=z[1],O=R({mixins:[(0,v.G)("vanTabs"),(0,m.x)((function(t){this.scroller||(this.scroller=(0,l.Rm)(this.$el)),t(window,"resize",this.resize,!0),this.scrollspy&&t(this.scroller,"scroll",this.onScroll,!0)}))],inject:{vanPopup:{default:null}},model:{prop:"active"},props:{color:String,border:Boolean,sticky:Boolean,animated:Boolean,swipeable:Boolean,scrollspy:Boolean,background:String,lineWidth:[Number,String],lineHeight:[Number,String],beforeChange:Function,titleActiveColor:String,titleInactiveColor:String,type:{type:String,default:"line"},active:{type:[Number,String],default:0},ellipsis:{type:Boolean,default:!0},duration:{type:[Number,String],default:.3},offsetTop:{type:[Number,String],default:0},lazyRender:{type:Boolean,default:!0},swipeThreshold:{type:[Number,String],default:5}},data:function(){return{position:"",currentIndex:null,lineStyle:{backgroundColor:this.color}}},computed:{scrollable:function(){return this.children.length>this.swipeThreshold||!this.ellipsis},navStyle:function(){return{borderColor:this.color,background:this.background}},currentName:function(){var t=this.children[this.currentIndex];if(t)return t.computedName},offsetTopPx:function(){return(0,s.S)(this.offsetTop)},scrollOffset:function(){return this.sticky?this.offsetTopPx+this.tabHeight:0}},watch:{color:"setLine",active:function(t){t!==this.currentName&&this.setCurrentIndexByName(t)},children:function(){var t=this;this.setCurrentIndexByName(this.active),this.setLine(),this.$nextTick((function(){t.scrollIntoView(!0)}))},currentIndex:function(){this.scrollIntoView(),this.setLine(),this.stickyFixed&&!this.scrollspy&&(0,l.Fk)(Math.ceil((0,l.mk)(this.$el)-this.offsetTopPx))},scrollspy:function(t){t?(0,d.on)(this.scroller,"scroll",this.onScroll,!0):(0,d.AU)(this.scroller,"scroll",this.onScroll)}},mounted:function(){var t=this;this.init(),this.vanPopup&&this.vanPopup.onReopen((function(){t.setLine()}))},activated:function(){this.init(),this.setLine()},methods:{resize:function(){this.setLine()},init:function(){var t=this;this.$nextTick((function(){t.inited=!0,t.tabHeight=(0,l.gP)(t.$refs.wrap),t.scrollIntoView(!0)}))},setLine:function(){var t=this,e=this.inited;this.$nextTick((function(){var i=t.$refs.titles;if(i&&i[t.currentIndex]&&"line"===t.type&&!(0,u.d)(t.$el)){var n=i[t.currentIndex].$el,o=t.lineWidth,l=t.lineHeight,c=n.offsetLeft+n.offsetWidth/2,a={width:(0,s._)(o),backgroundColor:t.color,transform:"translateX("+c+"px) translateX(-50%)"};if(e&&(a.transitionDuration=t.duration+"s"),(0,r.C8)(l)){var h=(0,s._)(l);a.height=h,a.borderRadius=h}t.lineStyle=a}}))},setCurrentIndexByName:function(t){var e=this.children.filter((function(e){return e.computedName===t})),i=(this.children[0]||{}).index||0;this.setCurrentIndex(e.length?e[0].index:i)},setCurrentIndex:function(t){var e=this.findAvailableTab(t);if((0,r.C8)(e)){var i=this.children[e],n=i.computedName,s=null!==this.currentIndex;this.currentIndex=e,n!==this.active&&(this.$emit("input",n),s&&this.$emit("change",n,i.title))}},findAvailableTab:function(t){var e=t<this.currentIndex?-1:1;while(t>=0&&t<this.children.length){if(!this.children[t].disabled)return t;t+=e}},onClick:function(t,e){var i=this,n=this.children[e],s=n.title,r=n.disabled,o=n.computedName;r?this.$emit("disabled",o,s):((0,p.m)({interceptor:this.beforeChange,args:[o],done:function(){i.setCurrentIndex(e),i.scrollToCurrentContent()}}),this.$emit("click",o,s),(0,h.wE)(t.$router,t))},scrollIntoView:function(t){var e=this.$refs.titles;if(this.scrollable&&e&&e[this.currentIndex]){var i=this.$refs.nav,n=e[this.currentIndex].$el,s=n.offsetLeft-(i.offsetWidth-n.offsetWidth)/2;c(i,s,t?0:+this.duration)}},onSticktScroll:function(t){this.stickyFixed=t.isFixed,this.$emit("scroll",t)},scrollTo:function(t){var e=this;this.$nextTick((function(){e.setCurrentIndexByName(t),e.scrollToCurrentContent(!0)}))},scrollToCurrentContent:function(t){var e=this;if(void 0===t&&(t=!1),this.scrollspy){var i=this.children[this.currentIndex],n=null==i?void 0:i.$el;if(n){var s=(0,l.mk)(n,this.scroller)-this.scrollOffset;this.lockScroll=!0,a(this.scroller,s,t?0:+this.duration,(function(){e.lockScroll=!1}))}}},onScroll:function(){if(this.scrollspy&&!this.lockScroll){var t=this.getCurrentIndexOnScroll();this.setCurrentIndex(t)}},getCurrentIndexOnScroll:function(){for(var t=this.children,e=0;e<t.length;e++){var i=(0,l.uB)(t[e].$el);if(i>this.scrollOffset)return 0===e?0:e-1}return t.length-1}},render:function(){var t,e=this,i=arguments[0],n=this.type,s=this.animated,r=this.scrollable,o=this.children.map((function(t,s){var o;return i(S,{ref:"titles",refInFor:!0,attrs:{type:n,dot:t.dot,info:null!=(o=t.badge)?o:t.info,title:t.title,color:e.color,isActive:s===e.currentIndex,disabled:t.disabled,scrollable:r,activeColor:e.titleActiveColor,inactiveColor:e.titleInactiveColor},style:t.titleStyle,class:t.titleClass,scopedSlots:{default:function(){return t.slots("title")}},on:{click:function(){e.onClick(t,s)}}})})),l=i("div",{ref:"wrap",class:[F("wrap",{scrollable:r}),(t={},t[f.pT]="line"===n&&this.border,t)]},[i("div",{ref:"nav",attrs:{role:"tablist"},class:F("nav",[n,{complete:this.scrollable}]),style:this.navStyle},[this.slots("nav-left"),o,"line"===n&&i("div",{class:F("line"),style:this.lineStyle}),this.slots("nav-right")])]);return i("div",{class:F([n])},[this.sticky?i($,{attrs:{container:this.$el,offsetTop:this.offsetTop},on:{scroll:this.onSticktScroll}},[l]):l,i(P,{attrs:{count:this.children.length,animated:s,duration:this.duration,swipeable:this.swipeable,currentIndex:this.currentIndex},on:{change:this.setCurrentIndex}},[this.slots()])])}})},1751:function(t,e,i){i(76952),i(98992)},73474:function(t,e,i){function n(t){var e=window.getComputedStyle(t),i="none"===e.display,n=null===t.offsetParent&&"fixed"!==e.position;return i||n}i.d(e,{d:function(){return n}})}}]);