import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
export class SdBadge {
    constructor() {
        this.color = 'unknown';
        this.type = 'circle';
        this.icon = 'fiber_manual_record';
        this.size = 'sm';
        this.sdClick = new EventEmitter();
        this.onClick = (event) => {
            this.sdClick.observers.length;
            this.sdClick.emit(event);
        };
    }
    set _color(color) {
        if (!color || !['normal', 'primary', 'info', 'success', 'warning', 'danger'].includes(color)) {
            this.color = 'unknown';
        }
        else {
            this.color = color;
        }
    }
    ;
    set _icon(val) {
        this.icon = val || 'fiber_manual_record';
    }
    ;
}
SdBadge.decorators = [
    { type: Component, args: [{
                selector: 'sd-badge',
                template: "<div *ngIf=\"type === 'round'\" class=\"c-badge\" matTooltipPosition=\"above\" [matTooltip]=\"tooltip\"\r\n  [ngClass]=\"{'c-black400': color === 'normal', 'c-info': color === 'info', 'c-success': color === 'success', 'c-danger': color === 'danger', 'c-warning': color === 'warning'}\"\r\n  [class.pointer]=\"!!sdClick.observers?.length\" (click)=\"onClick($event)\">\r\n  {{ title }}\r\n</div>\r\n<div *ngIf=\"type === 'circle' || type === 'icon'\" class=\"d-flex\" matTooltipPosition=\"above\" [matTooltip]=\"tooltip\"\r\n  [ngClass]=\"{'c-badge-circle': type === 'circle','c-badge-icon': type === 'icon', 'c-unknown': color === 'unknown', 'c-primary': color === 'primary', 'c-black400': color === 'normal', 'c-info': color === 'info', 'c-success': color === 'success', 'c-danger': color === 'danger', 'c-warning': color === 'warning'}\"\r\n  [class.pointer]=\"!!sdClick.observers?.length\" (click)=\"onClick($event)\">\r\n  <div class=\"d-flex align-items-center\">\r\n    <span class=\"c-material-icon mr-4\" [ngClass]=\"{\r\n      'material-icons-outlined': color === 'unknown',\r\n      'material-icons-round': color !== 'unknown',\r\n      'c-xs': size === 'xs',\r\n      'c-sm': size === 'sm',\r\n      'c-md': size === 'md',\r\n      'c-lg': size === 'lg', \r\n      'c-unknown': color === 'unknown', \r\n      'c-primary': color === 'primary', \r\n      'c-black400': color === 'normal', \r\n      'c-info': color === 'info', \r\n      'c-success': color === 'success', \r\n      'c-danger': color === 'danger', \r\n      'c-warning': color === 'warning'\r\n    }\">\r\n      {{ icon }}\r\n    </span>\r\n    <div class=\"d-flex flex-column\">\r\n      <span class=\"T14R\">{{ title }}</span>\r\n      <span *ngIf=\"description\" class=\"T12R c-badge-description\">{{ description }}</span>\r\n    </div>\r\n  </div>\r\n</div>",
                changeDetection: ChangeDetectionStrategy.OnPush,
                styles: [".text-black400{color:#757575}.c-badge{border-radius:20px;display:inline-block;margin-bottom:4px;min-width:150px;overflow-wrap:break-word;padding:2px 12px;text-align:center}.c-badge.c-primary{background:#e7e9ff;color:#2962ff}.c-badge.c-black400{background:#e9e9e9;color:#757575}.c-badge.c-info{background:#e7e9ff;color:#2962ff}.c-badge.c-warning{background:#ffeacc;color:#ff9600}.c-badge.c-success{background:#dbefdc;color:#4caf50}.c-badge.c-danger{background:#fed5d0;color:#f82c13}.c-badge-circle{min-width:150px}.c-badge-circle .c-material-icon{font-size:16px;height:16px;width:16px}.c-badge-circle .c-material-icon.c-badge-icon{font-size:12px;height:12px;width:12px}.c-badge-circle.c-unknown{color:rgba(0,0,0,.5)}.c-badge-circle.c-primary{color:#2962ff}.c-badge-circle.c-black400{color:#757575}.c-badge-circle.c-info{color:#2962ff}.c-badge-circle.c-success{color:#4caf50}.c-badge-circle.c-danger{color:#f82c13}.c-badge-circle.c-warning{color:#ff9600}.c-badge-icon{min-width:50px}.c-badge-icon .c-material-icon{border-radius:50%;padding:2px}.c-badge-icon .c-material-icon.c-xs{font-size:14px;height:18px;width:18px}.c-badge-icon .c-material-icon.c-sm{font-size:16px;height:20px;width:20px}.c-badge-icon .c-material-icon.c-md{font-size:18px;height:22px;width:22px}.c-badge-icon .c-material-icon.c-lg{font-size:24px;height:28px;width:28px}.c-badge-icon .c-material-icon.c-unknown{color:rgba(0,0,0,.5)}.c-badge-icon .c-material-icon.c-primary{color:#2962ff}.c-badge-icon .c-material-icon.c-black400{color:#757575}.c-badge-icon .c-material-icon.c-info{color:#2962ff}.c-badge-icon .c-material-icon.c-success{color:#4caf50}.c-badge-icon .c-material-icon.c-danger{color:#f82c13}.c-badge-icon .c-material-icon.c-warning{color:#ff9600}.c-badge-description{color:rgba(0,0,0,.5)}"]
            },] }
];
SdBadge.propDecorators = {
    type: [{ type: Input }],
    _color: [{ type: Input, args: ['color',] }],
    title: [{ type: Input }],
    description: [{ type: Input }],
    tooltip: [{ type: Input }],
    _icon: [{ type: Input, args: ['icon',] }],
    size: [{ type: Input }],
    sdClick: [{ type: Output }]
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFkZ2UuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IkM6L1VzZXJzL25naGlhdHQxNV9vbmVtb3VudC9Eb2N1bWVudHMvbGliLWNvcmUtdWkvcHJvamVjdHMvc2QtY29yZS9iYWRnZS8iLCJzb3VyY2VzIjpbInNyYy9saWIvYmFkZ2UuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSx1QkFBdUIsRUFBRSxTQUFTLEVBQUUsWUFBWSxFQUFFLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFVaEcsTUFBTSxPQUFPLE9BQU87SUFOcEI7UUFPRSxVQUFLLEdBQTZCLFNBQVMsQ0FBQztRQUNuQyxTQUFJLEdBQWdDLFFBQVEsQ0FBQztRQVl0RCxTQUFJLEdBQVcscUJBQXFCLENBQUM7UUFLNUIsU0FBSSxHQUE4QixJQUFJLENBQUM7UUFDdEMsWUFBTyxHQUFHLElBQUksWUFBWSxFQUFFLENBQUM7UUFDdkMsWUFBTyxHQUFHLENBQUMsS0FBWSxFQUFFLEVBQUU7WUFDekIsSUFBSSxDQUFDLE9BQU8sQ0FBQyxTQUFTLENBQUMsTUFBTSxDQUFBO1lBQzdCLElBQUksQ0FBQyxPQUFP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