index-legacy.1fccc4ce.js 9.8 KB

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