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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFkZ2UuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IkM6L1VzZXJzL3VzZXIvRG9jdW1lbnRzL2xpYi1jb3JlLXVpL3Byb2plY3RzL3NkLWNvcmUvYmFkZ2UvIiwic291cmNlcyI6WyJzcmMvbGliL2JhZGdlLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsdUJBQXVCLEVBQUUsU0FBUyxFQUFFLFlBQVksRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBVWhHLE1BQU0sT0FBTyxPQUFPO0lBTnBCO1FBT0UsVUFBSyxHQUE2QixTQUFTLENBQUM7UUFDbkMsU0FBSSxHQUFnQyxRQUFRLENBQUM7UUFZdEQsU0FBSSxHQUFXLHFCQUFxQixDQUFDO1FBSzVCLFNBQUksR0FBOEIsSUFBSSxDQUFDO1FBQ3RDLFlBQU8sR0FBRyxJQUFJLFlBQVksRUFBRSxDQUFDO1FBQ3ZDLFlBQU8sR0FBRyxDQUFDLEtBQVksRUFBRSxFQUFFO1lBQ3pCLElBQUksQ0FBQyxPQUFPLENBQUMsU0FBUyxDQUFDLE1BQU0sQ0FBQTtZQUM3QixJQUFJLENBQUMsT0FBTyxDQUFDLElB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