1 line
4.1 KiB
JavaScript
1 line
4.1 KiB
JavaScript
System.register(["./vue-legacy-BnJhYd-u.js","./_plugin-vue_export-helper-legacy-DNBbTZ02.js"],function(t,e){var a,s,i,r,n,c,l,u,b,d,o,v,h,p,f,w,m,g,y,T,x,$,_,k,S,L,C;return{setters:[function(t){a=t.At,s=t.B,i=t.G,r=t.H,n=t.K,c=t.L,l=t.Mt,u=t.Tt,b=t.Z,d=t.at,o=t.b,v=t.ct,h=t.dt,p=t.g,f=t.kt,w=t.ot,m=t.vt,g=t.xt},function(t){y=t.t}],execute:function(){(T=document.createElement("style")).textContent='.tab-pane[data-v-afaa716d]{z-index:1;position:relative}.tabs[data-v-c15626a7]{flex-direction:row;align-items:center;display:flex}.tabs.tabs-switch[data-v-c15626a7]{border-radius:var(--tabs-switch-radius,10px);padding:var(--tabs-switch-padding,4px);background:var(--tabs-switch-bg,var(--Fills-F2));justify-content:center;gap:0;position:relative}.tabs.tabs-switch[data-v-c15626a7] .tab-pane{height:var(--tabs-switch-pane-height,32px);cursor:pointer;user-select:none;color:var(--tabs-switch-pane-color,var(--Labels-Tertiary));flex:1;justify-content:center;align-items:center;display:flex}.tabs.tabs-switch[data-v-c15626a7] .tab-pane:not(.actived):not(.disabled):hover{color:var(--tabs-switch-pane-hover-color,var(--Labels-Primary))}.tabs.tabs-switch[data-v-c15626a7] .tab-pane.actived{color:var(--tabs-switch-pane-active-color,var(--Labels-Primary))}.tabs.tabs-switch[data-v-c15626a7] .tab-pane.disabled{cursor:not-allowed}.tabs.tabs-switch[data-v-c15626a7]:before{content:"";top:var(--tabs-switch-top,50%);left:var(--tabs-switch-left,50%);width:var(--tabs-switch-width,0);height:var(--tabs-switch-height,0);border-radius:var(--tabs-switch-indicator-radius,8px);background:var(--tabs-switch-indicator-bg,var(--Bg-Primary));transition:top .2s cubic-bezier(.13,.13,0,.98),left .2s cubic-bezier(.13,.13,0,.98),width .2s cubic-bezier(.13,.13,0,.98),height .2s cubic-bezier(.13,.13,0,.98);position:absolute}\n/*$vite$:1*/',document.head.appendChild(T),[x,$]=o(()=>{const t=u(),e=u([]);return{currentTab:t,tabs:e,setCurrentTab:a=>{t.value=e.value.find(t=>t.name===a)??e.value[0]},registerTab:t=>{e.value.find(e=>e.name===t)||e.value.push({name:t,index:e.value.length})},unregisterTab:t=>{e.value=e.value.filter(e=>e.name!==t)}}}),[_,k]=o(()=>!0),S={class:"tab-list"},t("r",b({__name:"TabList",props:{current:{}},emits:["update:current"],setup(t,{emit:e}){const a=t,s=e,{currentTab:i,setCurrentTab:r}=x();return m(()=>i.value,()=>{s("update:current",i.value?.name)}),w(()=>{r(a.current)}),(t,e)=>(v(),n("div",S,[h(t.$slots,"default")]))}})),L=["data-tab-name"],C=b({__name:"TabPane",props:{name:{},disabled:{type:Boolean},keepAlive:{type:Boolean}},setup(t){const e=t,l=k(),u=$(),b=r(()=>u?.currentTab?.value),o=r(()=>b.value?.name===e.name),p=r(()=>l||o.value);function f(){l&&(e.disabled||u?.setCurrentTab(e.name))}return u?.registerTab(e.name),d(()=>{l&&u?.unregisterTab(e.name)}),(t,r)=>g((v(),n("div",{class:a(["tab-pane",{actived:o.value,disabled:e.disabled,hidden:!p.value}]),"data-tab-name":e.name,onClick:f},[e.keepAlive?h(t.$slots,"default",{key:0},void 0,!0):(v(),n(s,{key:1},[p.value?h(t.$slots,"default",{key:0},void 0,!0):i("",!0)],64))],10,L)),[[c,p.value]])}}),t("n",y(C,[["__scopeId","data-v-afaa716d"]])),t("t",y(b({__name:"Tabs",props:{tabStyle:{default:"switch"}},setup(t){const e=t,s=u();_();const{switchSelectedStyle:i}=function(t,e){const a=$(),s=u({});function i(){const t=e.value?.querySelector(`[data-tab-name="${a?.currentTab?.value?.name}"]`);if(!t)return{};const s=t.clientWidth,i=t.clientHeight;return{"--switch-left":`${t.offsetLeft}%`,"--switch-width":`${s}%`,"--tabs-width":`${e.value.clientWidth}%`,"--tabs-switch-width":s/e.value.clientWidth*100+"%","--tabs-switch-height":i/e.value.clientHeight*100+"%","--tabs-switch-left":`calc(${(t.offsetLeft-4)/e.value.clientWidth*100}% + 4px)`,"--tabs-switch-top":`calc(${(t.offsetTop-4)/e.value.clientHeight*100}% + 4px)`}}return"switch"===t&&(m(()=>[a?.currentTab?.value,a?.tabs.value],()=>{s.value=i()},{immediate:!0}),p(e,()=>{s.value=i()})),{switchSelectedStyle:s}}(e.tabStyle,s);return(t,r)=>(v(),n("div",{class:a(["tabs",{"tabs-switch":"switch"===e.tabStyle}]),ref_key:"$tabs",ref:s,style:l(f(i))},[h(t.$slots,"default",{},void 0,!0)],6))}}),[["__scopeId","data-v-c15626a7"]]))}}}); |