import{en as P,d as w,dx as D,b$ as F,c as t,o as s,l,w as r,h as O,a9 as I,F as T,ca as u,ae as U,aa as V,i as $,D as m,eo as j,p as A,A as q,dq as L,r as C,Z as x,ep as S,N as B,eq as W,er as E,j as c,W as G,X as R}from"./index-9PRMimni.js";import{o as X}from"./omit-B2_8Y6O_.js";import{_ as Z}from"./Flex-CTSf12gq.js";import"./_flatRest-DBrd2CHT.js";import"./flatten-DeoUZLdb.js";const z={...P,options:{type:Array,default:()=>[]},color:{type:Object},type:{type:String,default:"default"},closable:{type:Boolean,default:!1},checkable:{type:Boolean,default:!1}},H={class:"flex items-center"},v=w({__name:"BasicTag",props:{...z},emits:["close","update:checked"],setup(N,{emit:i}){const d=D(),k=N,b=F(),f=i;function p(o){return L(o.closable)?o.closable:k.closable}function n(o){return X({item:o,...b},["prefix","suffix","icon"])}function a(o,_,e){f("close",o,_,e)}function y(o,_,e){f("update:checked",o,_,e)}return(o,_)=>(s(),t(l(Z),null,{default:r(()=>[(s(!0),O(T,null,I(o.options,(e,h)=>(s(),t(u(l(U)),V({ref_for:!0},n(e),{closable:p(e),key:`${h}_${l(d)}`,type:e.type??o.type,checkable:o.checkable||e.checkable,onClose:g=>a(g,e,h),checked:e.checked,"onUpdate:checked":g=>y(g,e,h),class:"flex items-center"}),{default:r(()=>[$("div",H,[e.prefix?(s(),t(u(e.prefix),{key:0})):m("",!0),e.icon?(s(),t(u(e.icon),{key:1})):m("",!0),l(j)(e.label)?(s(),t(u(e.label),{key:2})):(s(),O(T,{key:3},[A(q(e.label),1)],64)),e.suffix?(s(),t(u(e.suffix),{key:4})):m("",!0)])]),_:2},1040,["closable","type","checkable","onClose","checked","onUpdate:checked"]))),128))]),_:1}))}}),ee=w({__name:"tagGroup",setup(N){const i=C([{label:"预约中",type:"info",key:1},{label:"已到店",type:"warning",key:2},{label:"已服务",type:"success",key:3,closable:!0}]),d=C([{label:"预约中",key:1,checked:!1},{label:"已到店",key:2,checked:!0},{label:"已服务",key:3,checked:!1}]),k=C([{label:"预约中",type:"info",key:1,prefix:x(B,{component:S})},{label:"已到店",type:"warning",icon:x(B,{component:W,class:"inline-block"}),key:2},{label:"已服务",type:"success",suffix:x(B,{component:E}),key:3}]);function b(p,n,a){console.log("index",a),console.log("option",n),i.value.splice(a,1)}function f(p,n,a){console.log("option",n),d.value[a].checked=p}return(p,n)=>{const a=G,y=R;return s(),t(y,{title:"标签组",content:"BasicTag 基于 Tag 组件扩展，在你写 render 的时候，能够让你少写一些代码",showFooter:""},{default:r(()=>[c(a,{bordered:!1,class:"mt-3",title:"基本使用"},{default:r(()=>[c(l(v),{options:i.value,onClose:b,closable:""},null,8,["options"])]),_:1}),c(a,{bordered:!1,class:"mt-3",title:"自定义：前缀 / 后缀 / Icon"},{default:r(()=>[c(l(v),{options:k.value},null,8,["options"])]),_:1}),c(a,{bordered:!1,class:"mt-3",title:"可选择Tag"},{default:r(()=>[c(l(v),{options:d.value,checkable:"","onUpdate:checked":f},null,8,["options"])]),_:1})]),_:1})}}});export{ee as default};
