import{ax as V,w as g,n as y,j as h,B as c,z as i,D as d,M as v,a7 as x,W as b,H as f,L as D}from"./vue-BJk78QHK.js";import{_ as K}from"./index-M_JNBppB.js";import"./element-3_pOinej.js";import"./utils-YI6ye1sf.js";import"./threejs-BafxXW5-.js";import"./vxe-Dx3zSILm.js";const T={class:"d-flex jc-between headerWrapper"},S=["onClick"],B=Object.assign({name:"TabsBtn"},{__name:"TabsBtn",props:{element:{type:Object,default:()=>({})},propValue:{type:Object,default:()=>({})},editorpage:{type:Boolean,default:!1},componentData:{type:Array,default:()=>[]}},setup(t){const e=t,r=V();g(()=>e.propValue.currentTab,o=>{const u=r.state.globalKey.findIndex(a=>a.globalKey===e.propValue.globalKey);u>-1&&(r.state.globalKey[u].globalValue=o),y(()=>{const a=e.propValue.tabData.findIndex(l=>l.value==o);if(a>-1){if(e.propValue.tabData[a].showComponents.length>0)for(let l=0;l<e.propValue.tabData[a].showComponents.length;l++){const p=e.propValue.tabData[a].showComponents[l],n=e.componentData.find(s=>s.id===p);n&&(n.hideSelf=!1)}if(e.propValue.tabData[a].hideComponents.length>0)for(let l=0;l<e.propValue.tabData[a].hideComponents.length;l++){const p=e.propValue.tabData[a].hideComponents[l],n=e.componentData.find(s=>s.id===p);n&&(n.hideSelf=!0)}}})},{immediate:!0}),h(()=>{e.propValue.global&&e.propValue.globalKey&&e.propValue.globalName&&(r.state.globalKey.some(o=>o.globalKey===e.propValue.globalKey)||r.commit("addGlobalKey",{globalKey:e.propValue.globalKey,globalName:e.propValue.globalName,globalValue:e.propValue.currentTab}))});function m(o){e.propValue.currentTab=o.value}return(o,u)=>(i(),c("div",T,[d("div",{class:f(["d-flex",{"direction-col":t.propValue.direction==="col"}]),style:b({"background-image":`url(${t.propValue.bgImg})`})},[(i(!0),c(v,null,x(t.propValue.tabData,(a,l)=>(i(),c("div",{class:f(["leftBox",{active:a.value===t.propValue.currentTab}]),key:l,style:b({color:t.propValue.color,"background-image":a.value==t.propValue.currentTab?`url(${t.propValue.activeStyle.bgImg})`:"none"}),onClick:p=>m(a)},[d("span",{class:"tab-text",style:b({"font-size":a.value==t.propValue.currentTab?`${t.propValue.activeStyle.fontSize}px`:`${t.propValue.fontSize}px`,color:a.value==t.propValue.currentTab?t.propValue.activeStyle.color:t.propValue.color,"font-family":t.element.style.fontFamily})},D(a.label),5)],14,S))),128))],6)]))}}),$=K(B,[["__scopeId","data-v-fea70f47"]]);export{$ as default};
