"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("lodash"),o=require("../../../commons/utils/utils.js"),r=require("../../../commons/plugins/event/index.js"),b=["onClick"],E=e.defineComponent({__name:"base",props:{basicOption:{},useEvents:{}},emits:["on-click-item","on-change"],setup(u,{emit:v}){const a=v,t=u,l=e.ref(t.basicOption.value),p=s=>{l.value.map(n=>n.selected=!1),s.selected=!0,a("on-click-item",s),t.useEvents&&c.isArray(t.useEvents)&&r.SHJParseEvent.parseEvents(t.useEvents.filter(n=>n.clickname===s.id),"on-click-item"),a("on-change",s),t.useEvents&&c.isArray(t.useEvents)&&r.SHJParseEvent.parseEvents(t.useEvents,"on-change",{data:s.label})};return e.watch(()=>c.cloneDeep(t.basicOption),(s,n)=>{c.isEqual(s,n)||(l.value=t.basicOption.value)},{deep:!0}),(s,n)=>(e.openBlock(),e.createElementBlock("div",{class:"zv-tab",style:e.normalizeStyle(e.unref(o.Utils).json2cssObject(s.basicOption.css.tab))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(i,d)=>(e.openBlock(),e.createElementBlock("div",{key:d,class:e.normalizeClass(["zv-tab-item",{selected:i.selected}]),style:e.normalizeStyle(e.unref(o.Utils).json2cssObject(s.basicOption.css.item)),onClick:e.withModifiers(m=>p(i),["stop"])},e.toDisplayString(i.label),15,b))),128))],4))}});exports.default=E;
