import { Host, h } from "@stencil/core";
export class Alert {
    constructor() {
        /**
         * Sets the alert context
         * Options are: `"info"`, "success"`, `"danger"`, `"warning"`, and `"primary"`.
         * Default value is: 'info'
         */
        this.context = 'info';
    }
    onDismiss() {
        this.anjAlertWillDismiss.emit();
        this.element.remove();
    }
    onCollapseEvent(collapse) {
        this.collapsedClass = (collapse.detail) ? 'anj-collapsed' : undefined;
    }
    render() {
        return (h(Host, { class: this.collapsedClass },
            h("slot", null)));
    }
    static get is() { return "anj-alert"; }
    static get encapsulation() { return "scoped"; }
    static get originalStyleUrls() { return {
        "$": ["alert.scss"]
    }; }
    static get styleUrls() { return {
        "$": ["alert.css"]
    }; }
    static get properties() { return {
        "context": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": "Sets the alert context\nOptions are: `\"info\"`, \"success\"`, `\"danger\"`, `\"warning\"`, and `\"primary\"`.\nDefault value is: 'info'"
            },
            "attribute": "context",
            "reflect": true,
            "defaultValue": "'info'"
        }
    }; }
    static get states() { return {
        "collapsedClass": {}
    }; }
    static get events() { return [{
            "method": "anjAlertWillDismiss",
            "name": "anjAlertWillDismiss",
            "bubbles": true,
            "cancelable": true,
            "composed": true,
            "docs": {
                "tags": [],
                "text": "Fires when the button is focused"
            },
            "complexType": {
                "original": "void",
                "resolved": "void",
                "references": {}
            }
        }]; }
    static get elementRef() { return "element"; }
    static get listeners() { return [{
            "name": "anjClose",
            "method": "onDismiss",
            "target": undefined,
            "capture": false,
            "passive": false
        }, {
            "name": "anjCollapse",
            "method": "onCollapseEvent",
            "target": undefined,
            "capture": false,
            "passive": false
        }]; }
}
