import { h, Fragment } from "@stencil/core";
import { guid } from "../../utils";
export class DgaInlineAlert {
    constructor() {
        this.type = 'neutral';
        this.isactionButtons = true;
        this.isCloseButton = true;
        this.colored = false;
        this.buttonsList = [];
        this.icons = {
            error: 'hgi-stroke hgi-help-circle',
            warning: 'hgi-stroke hgi-alert-02',
            success: 'hgi-stroke hgi-tick-02',
            info: 'hgi-stroke hgi-help-circle',
            neutral: 'hgi-stroke hgi-help-circle',
        };
    }
    render() {
        return (h("div", { key: '54614d7ad24329cbac5e01db6f905b8a892edff0', class: `alert alert--${this.type} ${this.colored ? `alert--${this.type}-bg` : ''}` }, h("div", { key: 'b16c983879b0a34cfdebe1493e92eb6eb91b12c5', class: `alert__header ${this.helperText ? '' : 'dga-flex-center-y'}` }, h("div", { key: 'fd2a7c1d229169522e6173bef9cb06d22bebb21c', class: `featured-icon featured-icon--circle featured-icon--md featured-icon--light-${this.type === 'neutral' ? 'gray' : this.type}` }, h("i", { key: '32d114a9c6306d02fd5b4d12077d68147c7f18a0', class: this.icons[this.type], style: { fontSize: '20px' } })), h("div", { key: 'a132a551be39bafc84b609f207a3e52ad6780edf', class: "alert__body" }, h("h4", { key: '3ffcc76369ce1a2021ada1f398f044205bc2e92f', class: "alert__title text-md-semibold" }, this.leadText), this.helperText && h("p", { key: 'aa1c355d011c33a01ea07e4e2b0ebbf38e8cf6b9', class: "alert__content text-sm-regular" }, this.helperText)), this.isCloseButton && (h("div", { key: '452c0cd93ac50777f57f2e6e4285d1201f77daeb', class: "alert__close-btn" }, h("button", { key: '5902264cdab13b6f0e0652d83784cb71c0cf8fcc', class: "dga-btn dga-btn--close dga-btn--icon dga-btn--md", onClick: e => this.onClose && this.onClose(e) }, h("span", { key: '00544db4a40b5da0a66667dcb83d803fff4b90aa', class: "dga-btn-icon" }, h("i", { key: 'e6943b6920e2677c1745b45cd27591b73807dd68', class: "hgi-stroke hgi-multiplication-sign", style: { fontSize: '20px' } })))))), this.isactionButtons && this.buttonsList.length > 0 && (h(Fragment, { key: '0d6a5b7dc67d02c67d9050a70fd973bdfdaffeb9' }, h("div", { key: '50ac214816ca7c9d2b2cbc7da535d4baeebacbb4', class: "alert__action" }, this.buttonsList.map(({ id, onClick, exraClasses, title, label }) => {
            return (h("button", Object.assign({ key: id ? id : guid(), id: id ? id : guid(), onClick: e => onClick(e), class: `dga-btn dga-btn--subtle dga-btn--md ${exraClasses}` }, (title && { title: title })), label));
        })), h("div", { key: '13e2b29a360d121bd24171bc6dcd6d6ada7b5484', class: "alert__action-mobile" }, this.buttonsList.map(({ id, onClick, exraClasses, title, label }) => {
            return (h("button", Object.assign({ key: id ? id : guid(), id: id ? id : guid(), onClick: e => onClick(e), class: `btn btn--secondary btn--lg ${exraClasses}` }, (title && { title: title })), label));
        }))))));
    }
    static get is() { return "dga-inline-alert"; }
    static get originalStyleUrls() {
        return {
            "$": ["dga-inline-alert.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["dga-inline-alert.css"]
        };
    }
    static get properties() {
        return {
            "type": {
                "type": "string",
                "attribute": "type",
                "mutable": false,
                "complexType": {
                    "original": "'neutral' | 'info' | 'error' | 'success' | 'warning'",
                    "resolved": "\"error\" | \"info\" | \"neutral\" | \"success\" | \"warning\"",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "'neutral'"
            },
            "leadText": {
                "type": "string",
                "attribute": "lead-text",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "helperText": {
                "type": "string",
                "attribute": "helper-text",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "isactionButtons": {
                "type": "boolean",
                "attribute": "isaction-buttons",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "true"
            },
            "isCloseButton": {
                "type": "boolean",
                "attribute": "is-close-button",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "true"
            },
            "onClose": {
                "type": "unknown",
                "attribute": "on-close",
                "mutable": false,
                "complexType": {
                    "original": "(event: any) => void",
                    "resolved": "(event: any) => void",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false
            },
            "colored": {
                "type": "boolean",
                "attribute": "colored",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "false"
            },
            "buttonsList": {
                "type": "unknown",
                "attribute": "buttons-list",
                "mutable": false,
                "complexType": {
                    "original": "{\n    id?: string;\n    label: string;\n    onClick: (event?: any) => void;\n    exraClasses?: string;\n    title?: string;\n  }[]",
                    "resolved": "{ id?: string; label: string; onClick: (event?: any) => void; exraClasses?: string; title?: string; }[]",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "defaultValue": "[]"
            }
        };
    }
}
