(function(c,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(c=typeof globalThis!="undefined"?globalThis:c||self,e(c.index={},c.Vue))})(this,function(c,e){"use strict";const m={type:{type:String,default:""},color:{type:String,default:""},titleContent:{type:String,default:""},checked:{type:Boolean,default:!1},deletable:{type:Boolean,default:!1},size:{type:String,default:"xs"}};function s(n,t,a){let o=n;return t&&(o+=`__${t}`),a&&(o+=`--${a}`),o}function v(n,t=!1){const a=t?`.devui-${n}`:`devui-${n}`;return{b:()=>s(a),e:l=>l?s(a,l):"",m:l=>l?s(a,"",l):"",em:(l,f)=>l&&f?s(a,l,f):""}}function y(n){const t=v("tag");return e.computed(()=>{const{type:a,color:o,deletable:u}=n;return`${t.e("item")} ${t.m(a||(o?"colorful":"")||"default")} ${u?t.m("deletable"):""} ${t.m(n.size)}`})}function b(n){return e.computed(()=>{const{color:t,type:a}=n,o={primary:"var(--devui-primary, #5e7ce0)",success:"var(--devui-success, #50d4ab)",warning:"var(--devui-warning, #fac20a)",danger:"var(--devui-danger, #f66f6a)"},u={"blue-w98":"#3383ff","aqua-w98":"#39afcc","olivine-w98":"#2fa898","green-w98":"#4eb15e","yellow-w98":"#b08d1a","orange-w98":"#d47f35","red-w98":"#f66f6a","pink-w98":"#f3689a","purple-w98":"#a97af8"};return!t&&a?o[a]:u[t]||t})}var V="",p=e.defineComponent({name:"DTag",props:m,emits:["click","tagDelete","checkedChange"],setup(n,{slots:t,emit:a}){const o=v("tag"),{type:u,color:i,checked:d,titleContent:l,deletable:f}=e.toRefs(n),h=y(n),g=b(n),w=l.value||"",k=()=>!u.value&&!i.value,T=r=>{a("click",r)},$=r=>{r.stopPropagation(),a("tagDelete",r)},N=()=>f.value?e.createVNode("a",{class:"remove-button",onClick:$},[k()?e.createVNode(e.resolveComponent("d-icon"),{size:"12px",name:"error-o",color:"#adb0b8"},null):e.createVNode(e.resolveComponent("d-icon"),{size:"12px",name:"close",color:g.value},null)]):null,S=e.watch(d,r=>{a("checkedChange",r)});return e.onUnmounted(()=>S()),()=>{var r;return e.createVNode("div",{class:o.b(),onClick:T},[e.createVNode("span",{class:h.value,style:{display:"block",color:d.value?"#fff":g.value,backgroundColor:d.value?g.value:i.value?"var(--devui-base-bg, #ffffff)":""},title:w},[(r=t.default)==null?void 0:r.call(t),N()])])}}}),C={title:"Tag \u6807\u7B7E",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(n){n.component(p.name,p)}};c.Tag=p,c.default=C,c.tagProps=m,Object.defineProperties(c,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
