"use strict";const o=require("vue"),n=require("./base-iCmnU-fv.js"),l=o.defineComponent({name:"ClBadge",__name:"Index",props:{className:String,color:{type:String,default:"default"},colorSty:String,num:[String,Number],maxNum:{type:Number,default:-1},isHideZero:{type:Boolean,default:!0},isDot:{type:Boolean,default:!1}},setup(a){const e=a,r=()=>{n.CommonBase.isEmpty(e.num)&&!e.isDot&&console.warn('[ClBadge] Warning: Either "num" prop or "isDot" prop is required. When "num" is not provided, "isDot" must be true.')};o.onMounted(()=>{r()}),o.watch(()=>[e.num,e.isDot],()=>{r()});const m=o.computed(()=>{let t="";if(!n.CommonBase.isEmpty(e.num)){const s=Number(e.num);s===0&&e.isHideZero?t="":s>(e.maxNum??-1)&&(e.maxNum??-1)>0?t=`${e.maxNum}+`:t=s.toString()}return t}),i=o.computed(()=>{const t={badge:!0};return n.CommonBase.isEmpty(e.color)||(t[`bg-${e.color}`]=!0),e.className&&!n.CommonBase.isEmpty(e.className)&&e.className.split(" ").forEach(s=>{n.CommonBase.isEmpty(s)||(t[s]=!0)}),e.isDot&&(t["badge-dot"]=!0),t}),u=o.computed(()=>{const t={};return n.CommonBase.isEmpty(e.colorSty)||(t["background-color"]=`${e.colorSty} !important`),t});return(t,s)=>(o.openBlock(),o.createElementBlock("span",{class:o.normalizeClass(i.value),style:o.normalizeStyle(u.value)},o.toDisplayString(m.value),7))}});exports._sfc_main=l;
//# sourceMappingURL=Index.vue_vue_type_script_setup_true_lang-DfYsa_hk.js.map
