import{d as b,b as C,f as t,e as a,H as c,E as n,O as d,D as s,G as r,a3 as v,P as p,B as h,C as y}from"./index.1173b4aa.js";const B=["onClick"],j={class:"vtj-data-item__title"},g={class:"vtj-data-item__action"},w=["onClick"],D=["onClick"],$={key:0,class:"vtj-data-item__body"},S=b({__name:"DataItem",props:{title:{default:""},content:{default:""},editable:{type:Boolean,default:!1},removable:{type:Boolean,default:!1},active:{type:Boolean,default:!1},collapsible:{type:Boolean,default:!1},clickable:{type:Boolean,default:!1}},emits:["click","remove","edit"],setup(_,{emit:i}){const e=_,l=C(!0),f=()=>{i("edit")},m=()=>{i("remove")},k=()=>{e.clickable?i("click"):u()},u=()=>{l.value=!l.value};return(o,E)=>(t(),a("div",{class:n(["vtj-data-item",{"is-current":e.active}])},[c("div",{class:n(["vtj-data-item__header",{"is-pointer":e.clickable||e.collapsible}]),onClick:k},[e.collapsible?(t(),a("i",{key:0,class:n(["vtj-icon-greater arrow",{open:!l.value}]),onClick:d(u,["stop"])},null,10,B)):s("",!0),c("div",j,[r(o.$slots,"title",{},()=>[v(p(e.title),1)])]),c("div",g,[r(o.$slots,"action"),e.editable?(t(),a("i",{key:0,class:"vtj-icon-edit",title:"\u7F16\u8F91",onClick:d(f,["stop"])},null,8,w)):s("",!0),e.removable?(t(),a("i",{key:1,class:"vtj-icon-remove",title:"\u5220\u9664",onClick:d(m,["stop"])},null,8,D)):s("",!0)])],2),e.content||o.$slots.default?h((t(),a("div",$,[r(o.$slots,"default",{},()=>[v(p(e.content),1)])],512)),[[y,!l.value]]):s("",!0)],2))}});export{S as _};
