(function(u,o){typeof exports=="object"&&typeof module!="undefined"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(u=typeof globalThis!="undefined"?globalThis:u||self,o(u.index={},u.Vue))})(this,function(u,o){"use strict";const b=["danger","warning","waiting","success","info","common"],y=["top-left","top-right","bottom-left","bottom-right"],r={count:{type:[Number,String]},maxCount:{type:Number,default:99},showDot:{type:Boolean,default:!1},status:{type:String,validator:t=>b.includes(t),default:"info"},position:{type:String,default:"top-right",validator:t=>y.includes(t)},offset:{type:Array},bgColor:{type:String},textColor:{type:String},hidden:{type:Boolean,default:!1}};function l(t,a,e){let d=t;return a&&(d+=`__${a}`),e&&(d+=`--${e}`),d}function h(t,a=!1){const e=a?`.devui-${t}`:`devui-${t}`;return{b:()=>l(e),e:n=>n?l(e,n):"",m:n=>n?l(e,"",n):"",em:(n,i)=>n&&i?l(e,n,i):""}}var B="",f=o.defineComponent({name:"DBadge",props:r,setup(t,a){const e=h("badge"),d=o.computed(()=>[e.e("content"),t.showDot?e.m("dot"):e.m("count"),t.status&&e.m(t.status),a.slots.default&&t.position&&e.m(t.position),a.slots.default&&e.m("fixed"),t.hidden?e.m("hidden"):e.m("show")].join(" ")),m=o.computed(()=>{const s={bgColor:"background",textColor:"color"},n=Object.keys(s).reduce((i,c)=>(t[c]&&(i[s[c]]=t[c]),i),{});if(a.slots.default&&t.offset){const[i,c]=t.offset,[x,C]=t.position.split("-");n[x]=c+"px",n[C]=i+"px"}return n}),g=o.computed(()=>{if(!t.showDot)return typeof t.count=="number"&&typeof t.maxCount=="number"&&t.count>t.maxCount?`${t.maxCount}+`:t.count});return()=>{var s,n;return o.createVNode("div",{class:e.b()},[(n=(s=a.slots).default)==null?void 0:n.call(s),o.createVNode("div",{class:d.value,style:m.value},[g.value])])}}}),v={title:"Badge \u5FBD\u6807",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(t){t.component(f.name,f)}};u.Badge=f,u.badgeProps=r,u.default=v,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
