Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/utils/index.cjs`),t=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),n=require(`../icon/icon-constants.cjs`),r=require(`./badge-constants.cjs`);let i=require(`vue`);var a={compatConfig:{MODE:3},name:`DtBadge`,props:{iconSize:{type:String,default:`200`,validator:e=>Object.keys(n.ICON_SIZE_MODIFIERS).includes(e)},text:{type:String,default:``},kind:{type:String,default:`label`,validator:e=>Object.keys(r.BADGE_KIND_MODIFIERS).includes(e)},type:{type:String,default:`default`,validator:e=>Object.keys(r.BADGE_TYPE_MODIFIERS).includes(e)},decoration:{type:String,default:void 0,validator:e=>Object.keys(r.BADGE_DECORATION_MODIFIERS).includes(e)},labelClass:{type:[String,Array,Object],default:``},subtle:{type:Boolean,default:!1},outlined:{type:Boolean,default:!1}},data(){return{BADGE_TYPE_MODIFIERS:r.BADGE_TYPE_MODIFIERS,BADGE_KIND_MODIFIERS:r.BADGE_KIND_MODIFIERS,BADGE_DECORATION_MODIFIERS:r.BADGE_DECORATION_MODIFIERS}},computed:{hasLeftIcon(){return e.hasSlotContent(this.$slots.leftIcon)},hasRightIcon(){return e.hasSlotContent(this.$slots.rightIcon)},hasIcons(){return this.hasLeftIcon||this.hasRightIcon}},updated(){this.validateProps()},methods:{validateProps(){this.validateTypePropCombination(),this.validateDecorationPropCombination()},validateTypePropCombination(){this.type===`ai`&&this.kind===`count`&&console.error(`DtBadge error: type: 'ai' with kind: 'count' is an invalid combination.`),this.type!==`bulletin`&&this.subtle&&console.error(`DtBadge error: subtle can only be used with type 'bulletin'`)},validateDecorationPropCombination(){this.decoration&&((this.kind!==`label`||this.type!==`default`)&&console.error(`DtBadge error: decoration prop can only be used with kind: 'label' and type: 'default'.`),this.hasIcons&&console.error(`DtBadge error: decoration prop cannot be used with leftIcon or rightIcon.`))}}},o={key:0,class:`d-badge__decorative`},s={key:1,class:`d-badge__icon-left`},c={key:2,class:`d-badge__icon-right`};function l(e,t,n,r,a,l){return(0,i.openBlock)(),(0,i.createElementBlock)(`span`,{class:(0,i.normalizeClass)([`d-badge`,a.BADGE_TYPE_MODIFIERS[n.type],a.BADGE_KIND_MODIFIERS[n.kind],a.BADGE_DECORATION_MODIFIERS[n.decoration],{"d-badge--subtle":n.subtle},{"d-badge--outlined":n.outlined}]),"data-qa":`dt-badge`},[n.decoration?((0,i.openBlock)(),(0,i.createElementBlock)(`span`,o)):(0,i.createCommentVNode)(``,!0),l.hasLeftIcon?((0,i.openBlock)(),(0,i.createElementBlock)(`span`,s,[(0,i.renderSlot)(e.$slots,`leftIcon`,{iconSize:n.iconSize})])):(0,i.createCommentVNode)(``,!0),(0,i.createElementVNode)(`span`,{class:(0,i.normalizeClass)([`d-badge__label`,n.labelClass])},[(0,i.renderSlot)(e.$slots,`default`,{},()=>[(0,i.createTextVNode)((0,i.toDisplayString)(n.text),1)])],2),l.hasRightIcon?((0,i.openBlock)(),(0,i.createElementBlock)(`span`,c,[(0,i.renderSlot)(e.$slots,`rightIcon`,{iconSize:n.iconSize})])):(0,i.createCommentVNode)(``,!0)],2)}var u=t.t(a,[[`render`,l]]);exports.default=u;
//# sourceMappingURL=badge.cjs.map