1 |
- System.register(["./index-legacy-835c2a22.js","./use-tab-status-legacy-485fedbe.js","./index-legacy-c29fefdd.js"],(function(e,t){"use strict";var l,n,a,o,i,r,s,d,c,u,v,f,p,h,b,g,m,x,y,w,k,I,B,C,S,T,$,R,z,A,j,H,L,W,N,O,Z,F,M,V,D,E,X,q,G,J,K,Q,P,U,Y,_,ee,te,le,ne,ae,oe,ie,re,se,de,ce;return{setters:[e=>{l=e.$,n=e.a0,a=e.a1,o=e.a2,i=e.Q,r=e.a3,s=e.a4,d=e.a5,c=e.a6,u=e.a7,v=e.t,f=e.w,p=e.N,h=e.x,b=e.d,g=e.a8,m=e.r,x=e.c,y=e.a9,w=e.D,k=e.aa,I=e.S,B=e.k,C=e.ab,S=e.V,T=e.ac,$=e.ad,R=e.ae,z=e.a,A=e.C,j=e.af,H=e.o,L=e.ag,W=e.v,N=e.ah,O=e.y,Z=e.ai,F=e.aj,M=e.z,V=e.ak,D=e.al,E=e.am,X=e.an,q=e.ao,G=e.ap,J=e.K,K=e.E,Q=e.aq,P=e.G,U=e.ar,Y=e.as,_=e.at,ee=e.au,te=e.av,le=e.aw,ne=e.ax,ae=e.J,oe=e.ay,ie=e.az,re=e.aA},e=>{se=e.T},e=>{de=e.S,ce=e.a}],execute:function(){function t(e,t){if(!s||!window.IntersectionObserver)return;const l=new IntersectionObserver((e=>{t(e[0].intersectionRatio>0)}),{root:document.body}),n=()=>{e.value&&l.unobserve(e.value)};d(n),c(n),u((()=>{e.value&&l.observe(e.value)}))}const[ue,ve]=v("sticky"),fe={zIndex:f,position:p("top"),container:Object,offsetTop:h(0),offsetBottom:h(0)};var pe=b({name:ue,props:fe,emits:["scroll","change"],setup(e,{emit:l,slots:n}){const o=i(),r=g(o),s=m({fixed:!1,width:0,height:0,transform:0}),d=i(!1),c=x((()=>y("top"===e.position?e.offsetTop:e.offsetBottom))),u=x((()=>{if(d.value)return;const{fixed:e,height:t,width:l}=s;return e?{width:`${l}px`,height:`${t}px`}:void 0})),v=x((()=>{if(!s.fixed||d.value)return;const t=w(k(e.zIndex),{width:`${s.width}px`,height:`${s.height}px`,[e.position]:`${c.value}px`});return s.transform&&(t.transform=`translate3d(0, ${s.transform}px, 0)`),t})),f=()=>{if(!o.value||C(o))return;const{container:t,position:n}=e,i=T(o),r=a(window);if(s.width=i.width,s.height=i.height,"top"===n)if(t){const e=T(t),l=e.bottom-c.value-s.height;s.fixed=c.value>i.top&&e.bottom>0,s.transform=l<0?l:0}else s.fixed=c.value>i.top;else{const{clientHeight:e}=document.documentElement;if(t){const l=T(t),n=e-l.top-c.value-s.height;s.fixed=e-c.value<i.bottom&&e>l.top,s.transform=n<0?-n:0}else s.fixed=e-c.value<i.bottom}(e=>{l("scroll",{scrollTop:e,isFixed:s.fixed})})(r)};return I((()=>s.fixed),(e=>l("change",e))),B("scroll",f,{target:r,passive:!0}),t(o,f),I([$,R],(()=>{o.value&&!C(o)&&s.fixed&&(d.value=!0,S((()=>{const e=T(o);s.width=e.width,s.height=e.height,d.value=!1})))})),()=>{var e;return z("div",{ref:o,style:u.value},[z("div",{"class":ve({fixed:s.fixed&&!d.value}),style:v.value},[null==(e=n["default"])?void 0:e.call(n)])])}}});const he=A(pe),[be,ge]=v("tabs");var me=b({name:be,props:{count:j(Number),inited:Boolean,animated:Boolean,duration:j(f),swipeable:Boolean,lazyRender:Boolean,currentIndex:j(Number)},emits:["change"],setup(e,{emit:t,slots:l}){const n=i(),a=e=>t("change",e),o=()=>{var t;const o=null==(t=l["default"])?void 0:t.call(l);return e.animated||e.swipeable?z(de,{ref:n,loop:!1,"class":ge("track"),duration:1e3*+e.duration,touchable:e.swipeable,lazyRender:e.lazyRender,showIndicators:!1,onChange:a},{"default":()=>[o]}):o},r=t=>{const l=n.value;l&&l.state.active!==t&&l.swipeTo(t,{immediate:!e.inited})};return I((()=>e.currentIndex),r),H((()=>{r(e.currentIndex)})),L({swipeRef:n}),()=>z("div",{"class":ge("content",{animated:e.animated||e.swipeable})},[o()])}});const[xe,ye]=v("tabs"),we={type:p("line"),color:String,border:Boolean,sticky:Boolean,shrink:Boolean,active:h(0),duration:h(.3),animated:Boolean,ellipsis:W,swipeable:Boolean,scrollspy:Boolean,offsetTop:h(0),background:String,lazyRender:W,showHeader:W,lineWidth:f,lineHeight:f,beforeChange:Function,swipeThreshold:h(5),titleActiveColor:String,titleInactiveColor:String},ke=Symbol(xe);var Ie=b({name:xe,props:we,emits:["change","scroll","rendered","clickTab","update:active"],setup(e,{emit:s,slots:d}){let c,v,f,p,h;const b=i(),w=i(),k=i(),R=i(),A=N(),j=g(b),[H,W]=function(){const e=i([]),t=[];return r((()=>{e.value=[]})),[e,l=>(t[l]||(t[l]=t=>{e.value[l]=t}),t[l])]}(),{children:J,linkChildren:K}=O(ke),Q=m({inited:!1,position:"",lineStyle:{},currentIndex:-1}),P=x((()=>J.length>+e.swipeThreshold||!e.ellipsis||e.shrink)),U=x((()=>({borderColor:e.color,background:e.background}))),Y=(e,t)=>{var l;return null!=(l=e.name)?l:t},_=x((()=>{const e=J[Q.currentIndex];if(e)return Y(e,Q.currentIndex)})),ee=x((()=>y(e.offsetTop))),te=x((()=>e.sticky?ee.value+c:0)),le=t=>{const a=w.value,o=H.value;if(!(P.value&&a&&o&&o[Q.currentIndex]))return;const i=o[Q.currentIndex].$el,r=i.offsetLeft-(a.offsetWidth-i.offsetWidth)/2;p&&p(),p=function(e,t,a){let o,i=0;const r=e.scrollLeft,s=0===a?1:Math.round(1e3*a/16);return function d(){e.scrollLeft+=(t-r)/s,++i<s&&(o=n(d))}(),function(){l(o)}}(a,r,t?0:+e.duration)},ne=()=>{const t=Q.inited;S((()=>{const l=H.value;if(!l||!l[Q.currentIndex]||"line"!==e.type||C(b.value))return;const n=l[Q.currentIndex].$el,{lineWidth:a,lineHeight:o}=e,i=n.offsetLeft+n.offsetWidth/2,r={width:M(a),backgroundColor:e.color,transform:`translateX(${i}px) translateX(-50%)`};if(t&&(r.transitionDuration=`${e.duration}s`),V(o)){const e=M(o);r.height=e,r.borderRadius=e}Q.lineStyle=r}))},ae=(t,l)=>{const n=(e=>{const t=e<Q.currentIndex?-1:1;for(;e>=0&&e<J.length;){if(!J[e].disabled)return e;e+=t}})(t);if(!V(n))return;const a=J[n],o=Y(a,n),i=null!==Q.currentIndex;Q.currentIndex!==n&&(Q.currentIndex=n,l||le(),ne()),o!==e.active&&(s("update:active",o),i&&s("change",o,a.title)),f&&!e.scrollspy&&E(Math.ceil(X(b.value)-ee.value))},oe=(e,t)=>{const l=J.find(((t,l)=>Y(t,l)===e)),n=l?J.indexOf(l):0;ae(n,t)},ie=(t=!1)=>{if(e.scrollspy){const i=J[Q.currentIndex].$el;if(i&&j.value){const r=X(i,j.value)-te.value;v=!0,h&&h(),h=function(e,t,i,r){let s,d=a(e);const c=d<t,u=0===i?1:Math.round(1e3*i/16),v=(t-d)/u;return function f(){d+=v,(c&&d>t||!c&&d<t)&&(d=t),o(e,d),c&&d<t||!c&&d>t?s=n(f):r&&(s=n(r))}(),function(){l(s)}}(j.value,r,t?0:+e.duration,(()=>{v=!1}))}}},re=(t,l,n)=>{const{title:a,disabled:o}=J[l],i=Y(J[l],l);o||(q(e.beforeChange,{args:[i],done:()=>{ae(l),ie()}}),G(t)),s("clickTab",{name:i,title:a,event:n,disabled:o})},se=e=>{f=e.isFixed,s("scroll",e)},de=()=>{if("line"===e.type&&J.length)return z("div",{"class":ye("line"),style:Q.lineStyle},null)},ce=()=>{var t,l,n;const{type:a,border:o,sticky:i}=e,r=[z("div",{ref:i?void 0:k,"class":[ye("wrap"),{[D]:"line"===a&&o}]},[z("div",{ref:w,role:"tablist","class":ye("nav",[a,{shrink:e.shrink,complete:P.value}]),style:U.value,"aria-orientation":"horizontal"},[null==(t=d["nav-left"])?void 0:t.call(d),J.map((e=>e.renderTitle(re))),de(),null==(l=d["nav-right"])?void 0:l.call(d)])]),null==(n=d["nav-bottom"])?void 0:n.call(d)];return i?z("div",{ref:k},[r]):r},ue=()=>{ne(),S((()=>{var e,t;le(!0),null==(t=null==(e=R.value)?void 0:e.swipeRef.value)||t.resize()}))};return I((()=>[e.color,e.duration,e.lineWidth,e.lineHeight]),ne),I($,ue),I((()=>e.active),(e=>{e!==_.value&&oe(e)})),I((()=>J.length),(()=>{Q.inited&&(oe(e.active),ne(),S((()=>{le(!0)})))})),L({resize:ue,scrollTo:e=>{S((()=>{oe(e),ie(!0)}))}}),Z(ne),F(ne),u((()=>{oe(e.active,!0),S((()=>{Q.inited=!0,k.value&&(c=T(k.value).height),le(!0)}))})),t(b,ne),B("scroll",(()=>{if(e.scrollspy&&!v){const e=(()=>{for(let e=0;e<J.length;e++){const{top:t}=T(J[e].$el);if(t>te.value)return 0===e?0:e-1}return J.length-1})();ae(e)}}),{target:j,passive:!0}),K({id:A,props:e,setLine:ne,scrollable:P,onRendered:(e,t)=>s("rendered",e,t),currentName:_,setTitleRefs:W,scrollIntoView:le}),()=>z("div",{ref:b,"class":ye([e.type])},[e.showHeader?e.sticky?z(he,{container:b.value,offsetTop:ee.value,onScroll:se},{"default":()=>[ce()]}):ce():null,z(me,{ref:R,count:J.length,inited:Q.inited,animated:e.animated,duration:e.duration,swipeable:e.swipeable,lazyRender:e.lazyRender,currentIndex:Q.currentIndex,onChange:ae},{"default":()=>{var e;return[null==(e=d["default"])?void 0:e.call(d)]}})])}});const[Be,Ce]=v("tab"),Se=b({name:Be,props:{id:String,dot:Boolean,type:String,color:String,title:String,badge:f,shrink:Boolean,isActive:Boolean,disabled:Boolean,controls:String,scrollable:Boolean,activeColor:String,inactiveColor:String,showZeroBadge:W},setup(e,{slots:t}){const l=x((()=>{const t={},{type:l,color:n,disabled:a,isActive:o,activeColor:i,inactiveColor:r}=e;n&&"card"===l&&(t.borderColor=n,a||(o?t.backgroundColor=n:t.color=n));const s=o?i:r;return s&&(t.color=s),t})),n=()=>{const l=z("span",{"class":Ce("text",{ellipsis:!e.scrollable})},[t.title?t.title():e.title]);return e.dot||V(e.badge)&&""!==e.badge?z(J,{dot:e.dot,content:e.badge,showZero:e.showZeroBadge},{"default":()=>[l]}):l};return()=>z("div",{id:e.id,role:"tab","class":[Ce([e.type,{grow:e.scrollable&&!e.shrink,shrink:e.shrink,active:e.isActive,disabled:e.disabled}])],style:l.value,tabindex:e.disabled?void 0:e.isActive?0:-1,"aria-selected":e.isActive,"aria-disabled":e.disabled||void 0,"aria-controls":e.controls},[n()])}}),[Te,$e]=v("tab"),Re=w({},K,{dot:Boolean,name:f,badge:f,title:String,disabled:Boolean,titleClass:Q,titleStyle:[String,Object],showZeroBadge:W});var ze=b({name:Te,props:Re,setup(e,{slots:t}){const l=N(),n=i(!1),a=ie(),{parent:o,index:r}=P(ke);if(!o)return;const s=()=>{var t;return null!=(t=e.name)?t:r.value},d=x((()=>{const t=s()===o.currentName.value;return t&&!n.value&&(n.value=!0,o.props.lazyRender&&S((()=>{o.onRendered(s(),e.title)}))),t})),c=i(""),u=i("");U((()=>{const{titleClass:t,titleStyle:l}=e;c.value=t?te(t):"",u.value=l&&"string"!=typeof l?le(ne(l)):l}));const v=i(!d.value);return I(d,(e=>{e?v.value=!1:Y((()=>{v.value=!0}))})),I((()=>e.title),(()=>{o.setLine(),o.scrollIntoView()})),_(se,d),L({id:l,renderTitle:n=>z(Se,ae({key:l,id:`${o.id}-${r.value}`,ref:o.setTitleRefs(r.value),style:u.value,"class":c.value,isActive:d.value,controls:l,scrollable:o.scrollable.value,activeColor:o.props.titleActiveColor,inactiveColor:o.props.titleInactiveColor,onClick:e=>n(a.proxy,r.value,e)},oe(o.props,["type","color","shrink"]),oe(e,["dot","badge","title","disabled","showZeroBadge"])),{title:t.title})}),()=>{var e;const a=`${o.id}-${r.value}`,{animated:i,swipeable:s,scrollspy:c,lazyRender:u}=o.props;if(!t["default"]&&!i)return;const f=c||d.value;if(i||s)return z(ce,{id:l,role:"tabpanel","class":$e("panel-wrapper",{inactive:v.value}),tabindex:d.value?0:-1,"aria-hidden":!d.value,"aria-labelledby":a},{"default":()=>{var e;return[z("div",{"class":$e("panel")},[null==(e=t["default"])?void 0:e.call(t)])]}});const p=n.value||c||!u?null==(e=t["default"])?void 0:e.call(t):null;return ee(z("div",{id:l,role:"tabpanel","class":$e("panel"),tabindex:f?0:-1,"aria-labelledby":a},[p]),[[re,f]])}}});e("a",A(ze)),e("T",A(Ie))}}}));
|