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