1import{d as J,i as S,c as g,k as O,S as R,l as m,o as C,F as P,x as U,n as b,s as W,m as z,y as E,t as K,A as X,Q as Y,_ as Z}from"./D1FcBL9p.js";const ee=["onClick"],te=["onClick"],le={key:1,class:"tag-badge"},oe=J({name:"TagBar",__name:"TagBar",props:{tagList:{default:()=>[]},multiple:{type:Boolean,default:!1},showClose:{type:Boolean,default:!1},fontSize:{default:"25px"},closeIconColor:{default:"#999999"},inactiveBgColor:{default:"#F5F5F5"},activeBgColor:{default:"#E60013"},inactiveTextColor:{default:"#666666"},activeTextColor:{default:"#FFFFFF"},inactiveBorderColor:{default:"transparent"},activeBorderColor:{default:"transparent"},autoScroll:{type:Boolean,default:!0},modelValue:{default:null}},emits:["tag-click","tag-close","update:modelValue"],setup(s,{emit:M}){const o=s,r=M,y=S(null),h=S([]),u=S(-1),c=S([]),N=(e,t)=>{if(e){if(e instanceof HTMLElement){h.value[t]=e;return}typeof e=="object"&&"getBoundingClientRect"in e&&(h.value[t]=e)}},n=(e,t)=>{var l;return(l=e.id)!=null?l:t},B=g(()=>o.tagList.map((e,t)=>e.checked?t:-1).filter(e=>e!==-1)),d=g(()=>B.value.length>0),A=()=>{if(o.modelValue===null||o.modelValue===void 0||o.modelValue==="")return-1;const e=o.tagList.findIndex((l,a)=>String(n(l,a))===String(o.modelValue));if(e!==-1)return e;const t=Number(o.modelValue);return Number.isInteger(t)&&t>=0&&t<o.tagList.length?t:-1},i=g(()=>{var t;if(d.value)return(t=B.value[0])!=null?t:-1;const e=A();return e!==-1?e:u.value}),w=g(()=>d.value?new Set(B.value.map(e=>n(o.tagList[e],e))):o.multiple?new Set(c.value):i.value===-1?new Set:new Set([n(o.tagList[i.value],i.value)])),V=g(()=>o.tagList.filter((e,t)=>w.value.has(n(e,t)))),f=(e,t)=>w.value.has(n(e,t)),$=(e,t)=>f(e,t)?o.activeBgColor:o.inactiveBgColor,j=(e,t)=>f(e,t)?o.activeTextColor:o.inactiveTextColor,D=(e,t)=>f(e,t)?o.activeBorderColor:o.inactiveBorderColor,L=e=>{Y(()=>{if(!y.value)return;const t=y.value,l=h.value[e];if(!l)return;const a=t.getBoundingClientRect(),v=l.getBoundingClientRect();let p=0;for(let k=0;k<e;k++){const _=h.value[k];_&&(p+=_.getBoundingClientRect().width+10)}const I=p+v.width,x=t.scrollLeft,G=x+a.width,F=20;I>G?t.scrollTo({left:I-a.width+F,behavior:"smooth"}):p<x&&t.scrollTo({left:Math.max(0,p-F),behavior:"smooth"})})},H=e=>{},Q=(e,t)=>{const l=n(t,e);if(o.multiple){if(!d.value){const a=new Set(c.value);a.has(l)?a.delete(l):a.add(l),c.value=[...a]}r("tag-click",{currentTag:t,selectedTags:V.value})}else d.value||(u.value=e,r("update:modelValue",e)),r("tag-click",{index:e,item:t});o.autoScroll&&L(e)},q=(e,t)=>{if(!d.value)if(o.multiple){const l=n(t,e);c.value=c.value.filter(a=>a!==l)}else i.value===e&&(u.value=-1,r("update:modelValue",-1));r("tag-close",{index:e,item:t,selectedTags:o.multiple?V.value:null})},T=()=>{o.autoScroll&&i.value!==-1&&L(i.value)};return O(()=>{T()}),R(()=>o.tagList,()=>{const e=o.tagList.length-1;u.value>e&&(u.value=e),c.value=c.value.filter(t=>o.tagList.some((l,a)=>n(l,a)===t)),T()},{deep:!0}),R(()=>i.value,()=>{T()}),(e,t)=>(C(),m("div",{ref_key:"scrollContainerRef",ref:y,class:"tag-bar-section",onScroll:H},[(C(!0),m(P,null,U(s.tagList,(l,a)=>(C(),m("div",{key:l.id||a,ref_for:!0,ref:v=>N(v,a),class:W(["tag-item",{active:f(l,a),closable:l.closable!==!1&&s.showClose}]),style:b({background:$(l,a),color:j(l,a),borderColor:D(l,a)}),onClick:v=>Q(a,l)},[z("span",{class:"tag-text",style:b({fontSize:s.fontSize})},K(l.columnName||l.label||l.name||l.text),5),s.showClose&&f(l,a)?(C(),m("div",{key:0,class:"tag-close",style:b({color:s.closeIconColor,fontSize:s.fontSize}),onClick:X(v=>q(a,l),["stop"])},[...t[0]||(t[0]=[z("span",{class:"close-icon"},"x",-1)])],12,te)):E("",!0),l.badge?(C(),m("span",le,K(l.badge),1)):E("",!0)],14,ee))),128))],544))}}),ne=Z(oe,[["__scopeId","data-v-7a61c9e7"]]);export{ne 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.