1import{d as W,i as r,k as R,Q as d,S as C,l as m,o as h,F as A,x as E,s as M,C as N,y as F,t as k,_ as I}from"./rNMPrltl.js";const $=["onClick"],z={key:0,class:"tab-badge"},D=W({__name:"TabBar",props:{tabList:{default:()=>[]},modelValue:{default:0},customActiveClass:{default:""},autoScroll:{type:Boolean,default:!0},scrollToStart:{type:Boolean,default:!1}},emits:["update:modelValue","tab-change"],setup(b,{emit:y}){const l=b,S=y,s=r(l.modelValue),n=r(0),p=r(375),c=r([]),u=r(null),_=r([]),g=(e,a)=>{if(e){const t=e||e.$el;t&&(_.value[a]=t)}},T=()=>new Promise(e=>{d(()=>{const a=[];_.value.forEach(t=>{t&&a.push(t.offsetWidth)}),c.value=a,e()})}),i=e=>{if(!c.value[e])return;const a=c.value.slice(0,e).reduce((L,B)=>L+B,0),t=a+c.value[e],o=n.value,v=o+p.value;a<o?n.value=Math.max(0,a-10):t>v&&(n.value=t-p.value+10),u.value&&u.value.scrollTo({left:n.value,behavior:"smooth"})},f=e=>{if(!c.value[e])return;const a=c.value.slice(0,e).reduce((t,o)=>t+o,0);n.value=Math.max(0,a),u.value&&u.value.scrollTo({left:n.value,behavior:"smooth"})},w=e=>{const a=e.target;n.value=a.scrollLeft},V=(e,a)=>{s.value=e,S("update:modelValue",e),l.autoScroll&&(l.scrollToStart?f(e):i(e)),S("tab-change",{index:e,item:a})};return R(()=>{typeof window<"u"&&(p.value=window.innerWidth),d(()=>{l.autoScroll&&T().then(()=>{l.scrollToStart?f(s.value):i(s.value)})})}),C(()=>l.modelValue,e=>{s.value=e,l.autoScroll&&d(()=>{setTimeout(()=>{l.scrollToStart?f(e):i(e)},100)})}),C(()=>l.tabList,()=>{d(()=>{T().then(()=>{l.autoScroll&&setTimeout(()=>{l.scrollToStart?f(s.value):i(s.value)},100)})})},{deep:!0}),(e,a)=>(h(),m("div",{ref_key:"scrollContainerRef",ref:u,class:"type-tab-section",onScroll:w},[(h(!0),m(A,null,E(b.tabList,(t,o)=>(h(),m("div",{key:t.id||o,ref_for:!0,ref:v=>g(v,o),class:M(["type-tab-item",{active:s.value===o,[b.customActiveClass]:s.value===o}]),onClick:v=>V(o,t)},[N(k(t.label||t.columnName||t.name)+" ",1),t.badge?(h(),m("span",z,k(t.badge),1)):F("",!0)],10,$))),128))],544))}}),Q=I(D,[["__scopeId","data-v-7dba6bca"]]);export{Q as _};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.