import { Host } from "@stencil/core";
import { h } from "@stencil/core";
export class DgaHeaderAction {
    constructor() {
        this.iconPosition = 'inline';
        this.iconProps = {
            type: 'rounded',
            variant: 'stroke',
        };
        this.active = false;
        this.extraClasses = '';
        this.openSubMenu = false;
    }
    handleClick(event) {
        event.preventDefault();
        if (this.onClick) {
            this.onClick();
        }
    }
    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(Host, { key: 'a9f4cd725a88c83b4a2c4b90fc7e1abb9745d4ca' }, h("li", { key: '5b0be006d4b1c8b6507d1cbd273fe117ac2da28d', onMouseEnter: () => {
                this.openSubMenu = true;
                //   this.active = true;
            }, onMouseLeave: () => {
                this.openSubMenu = false;
                //   this.active = false;
            } }, h("a", { key: '7d6d57169648f8ee7011504e0143a6aca08a8a1a', href: "#", class: `header-menu__item ${this.active ? 'header-menu__item--active' : ''} 
            
            ${this.iconPosition === 'inline' ? 'header-menu__item--inline' : 'header-menu__item--top'}
            
            ${this.extraClasses}`, onClick: this.handleClick.bind(this) }, h("span", { key: '0bbc750fca9d12c3cab04c2b809c8cfa6e80f660', class: "header-menu__item-arrow" }, h("dga-icon-v2", Object.assign({ key: '7833f6f3dd84f5ecd3afa6dbb5b3e8e636d6ecfb', name: this.icon }, this.iconProps))), h("span", { key: '7956ef28e2ee4976cee3bfa3ec3d1f6ab925dbc3', class: "header-menu__item-label" }, this.label)), this.openSubMenu && h("slot", { key: 'b4e193c9ff715dfbd4b1da74e39def02a4dd03b4', name: "dga-header-sub-menu" }))));
    }
    static get is() { return "dga-header-action"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["dga-header-action.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["dga-header-action.css"]
        };
    }
    static get properties() {
        return {
            "label": {
                "type": "string",
                "attribute": "label",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "iconPosition": {
                "type": "string",
                "attribute": "icon-position",
                "mutable": false,
                "complexType": {
                    "original": "'inline' | 'top'",
                    "resolved": "\"inline\" | \"top\"",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "'inline'"
            },
            "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
            },
            "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": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "false"
            },
            "onClick": {
                "type": "unknown",
                "attribute": "on-click",
                "mutable": false,
                "complexType": {
                    "original": "() => void",
                    "resolved": "() => void",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false
            },
            "extraClasses": {
                "type": "string",
                "attribute": "extra-classes",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "''"
            }
        };
    }
    static get states() {
        return {
            "openSubMenu": {}
        };
    }
    static get elementRef() { return "el"; }
}
