import { h } from "@stencil/core";
export class DgaMenuItem {
    constructor() {
        this.disabled = false;
        this.hasTrailElement = false;
        this.hasLeadIcon = false;
        this.pressed = false;
    }
    handleClick(event) {
        if (!this.disabled) {
            this.onClick.emit(event);
        }
    }
    render() {
        return (h("li", { key: 'fb4a6bf8dd61f3ec664aab550a8486e3e5dce216', class: `menu-item ${this.disabled ? 'disabled' : ''} ${this.pressed ? "pressed" : ""}`, onMouseDown: () => this.pressed = true, onMouseUp: () => this.pressed = false, tabindex: "0", onClick: this.handleClick }, this.hasLeadIcon && h("span", { key: '720e0c8c18f6bc14c086478ca798674549f76570', class: "menu-item__icon" }, h("slot", { key: '6c65c2e801ae667be3499bccabacaafc85274508', name: "lead-icon" })), h("span", { key: '7475b71c0b54d77d21d383520b00a2287e96d565', class: "menu-item__label" }, this.label), this.hasTrailElement && h("div", { key: 'ba22327f6a9cedca74179b4532ffe011da4bed32', class: "menu-item__trail-element" }, h("slot", { key: '0cb5af30a61389dbb256d85af58be22ae0cf9070', name: "trail-element" }))));
    }
    static get is() { return "dga-menu-item"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["dga-menu-item.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["dga-menu-item.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
            },
            "disabled": {
                "type": "boolean",
                "attribute": "disabled",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "false"
            },
            "hasTrailElement": {
                "type": "boolean",
                "attribute": "has-trail-element",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "false"
            },
            "hasLeadIcon": {
                "type": "boolean",
                "attribute": "has-lead-icon",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "false"
            }
        };
    }
    static get states() {
        return {
            "pressed": {}
        };
    }
    static get events() {
        return [{
                "method": "onClick",
                "name": "onClick",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "complexType": {
                    "original": "MouseEvent",
                    "resolved": "MouseEvent",
                    "references": {
                        "MouseEvent": {
                            "location": "global",
                            "id": "global::MouseEvent"
                        }
                    }
                }
            }];
    }
}
