import { h } from "@stencil/core";
export class DgaNavHeaderLink {
    constructor() {
        this.icon = "arrow-down-01"; // Icon name
        this.iconProps = {
            type: 'rounded',
            variant: 'stroke',
        };
        this.active = false;
        this.subMenuBackground = 'white';
        this.subMenuFullWidth = true;
        this.openSubMenu = false;
        this.handleClick = (event) => {
            event.preventDefault();
            this.linkClicked.emit();
        };
    }
    componentWillLoad() {
        this.el.childNodes.forEach(item => {
            const el = item;
            if (el.tagName === 'DGA-HEADER-SUB-MENU' && el.attributes.getNamedItem('slot') === null) {
                el.setAttribute('slot', 'dga-header-sub-menu');
            }
        });
    }
    render() {
        return (h("li", { key: 'f223e35af2b766eb2f574129a45d1c9f207931ac', onMouseEnter: () => {
                this.openSubMenu = true;
            }, onMouseLeave: () => {
                this.openSubMenu = false;
            }, style: {
                display: 'inline-block',
            } }, h("a", { key: '2bab47cf392d391f10f1fde72653865701b12d74', href: "#", class: `dga-header-menu__item ${this.active ? 'dga-header-menu__item--active' : ''}`, onClick: this.handleClick }, h("span", { key: 'eaa28a4bafaa8cdade7e90b3fd1a560c8b6fb3a8', class: "dga-header-menu__item-label" }, this.label), h("span", { key: '391cf3a0a8e4560fc6bdcef23de137bbcaebb63f', class: "dga-header-menu__item-arrow" }, h("dga-icon-v2", Object.assign({ key: '742aaff8fb346acd3e870cd440d657f640e38b1f', name: this.icon }, this.iconProps)))), this.openSubMenu && h("slot", { key: 'bfc71f4b6d650ce68290ba880ab13cc0376ca859', name: "dga-header-sub-menu" })));
    }
    static get is() { return "dga-header-menu-item"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["dga-header-menu-item.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["dga-header-menu-item.css"]
        };
    }
    static get properties() {
        return {
            "label": {
                "type": "string",
                "attribute": "label",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "icon": {
                "type": "string",
                "attribute": "icon",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "\"arrow-down-01\""
            },
            "iconProps": {
                "type": "unknown",
                "attribute": "icon-props",
                "mutable": false,
                "complexType": {
                    "original": "{\n    size?: number;\n    color?: string;\n    variant?: 'stroke' | 'solid' | 'duotone' | 'twotone' | 'bulk';\n    type?: 'rounded' | 'sharp' | 'standard';\n  }",
                    "resolved": "{ size?: number; color?: string; variant?: \"stroke\" | \"solid\" | \"duotone\" | \"twotone\" | \"bulk\"; type?: \"rounded\" | \"sharp\" | \"standard\"; }",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "defaultValue": "{\n    type: 'rounded',\n    variant: 'stroke',\n  }"
            },
            "active": {
                "type": "boolean",
                "attribute": "active",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "false"
            },
            "subMenuBackground": {
                "type": "string",
                "attribute": "sub-menu-background",
                "mutable": false,
                "complexType": {
                    "original": "'brand' | 'white'",
                    "resolved": "\"brand\" | \"white\"",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "'white'"
            },
            "subMenuFullWidth": {
                "type": "boolean",
                "attribute": "sub-menu-full-width",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "true"
            }
        };
    }
    static get states() {
        return {
            "openSubMenu": {}
        };
    }
    static get events() {
        return [{
                "method": "linkClicked",
                "name": "linkClicked",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "complexType": {
                    "original": "void",
                    "resolved": "void",
                    "references": {}
                }
            }];
    }
    static get elementRef() { return "el"; }
}
