import { h } from "@stencil/core";
export class Badge {
    value = '';
    max = 99;
    isDot = false;
    hidden = false;
    type = 'danger';
    get displayValue() {
        if (this.isDot)
            return '';
        const num = typeof this.value === 'number' ? this.value : parseInt(this.value, 10);
        if (!isNaN(num) && num > this.max)
            return `${this.max}+`;
        return String(this.value);
    }
    render() {
        return (h("div", { key: 'e979ef5ba0392f4d7f802a8019f1c81ced8f8eac', class: "hb-badge" }, h("slot", { key: '8c1083ff2f2699bbf2652199e3a40b3690c7ab45' }), !this.hidden && (h("sup", { key: '955da69dfdb7543ef65eb8d811c4d95f4789fe87', class: { 'hb-badge__content': true, [`hb-badge__content--${this.type}`]: true, 'hb-badge__content--dot': this.isDot } }, this.displayValue))));
    }
    static get is() { return "hb-badge"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["badge.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["badge.css"]
        };
    }
    static get properties() {
        return {
            "value": {
                "type": "any",
                "mutable": false,
                "complexType": {
                    "original": "string | number",
                    "resolved": "number | string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "value",
                "reflect": false,
                "defaultValue": "''"
            },
            "max": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "max",
                "reflect": false,
                "defaultValue": "99"
            },
            "isDot": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "is-dot",
                "reflect": false,
                "defaultValue": "false"
            },
            "hidden": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "hidden",
                "reflect": false,
                "defaultValue": "false"
            },
            "type": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'primary' | 'success' | 'warning' | 'danger' | 'info'",
                    "resolved": "\"danger\" | \"info\" | \"primary\" | \"success\" | \"warning\"",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "type",
                "reflect": false,
                "defaultValue": "'danger'"
            }
        };
    }
}
//# sourceMappingURL=Badge.js.map
