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: '2ef2567a3055adbf60ff3507cb6ba5940712e8a3', 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: '92954df1003841ea134104b7b96ba4ad93708b66', class: "menu-item__icon" }, h("slot", { key: 'af29f044f37105de19de66e13ed17859ddaa71be', name: "lead-icon" })), h("span", { key: '418c6ac9a6bcdac5f16298b0f9d6f55666c024ad', class: "menu-item__label" }, this.label), this.hasTrailElement && h("div", { key: 'eadfeb124de253aab38ba9bcc32ea1e94a29fa22', class: "menu-item__trail-element" }, h("slot", { key: '92d71d39afe57f3bb0f0f9b63c6f8a17098041a6', 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",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "label",
                "reflect": false
            },
            "disabled": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "disabled",
                "reflect": false,
                "defaultValue": "false"
            },
            "hasTrailElement": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "has-trail-element",
                "reflect": false,
                "defaultValue": "false"
            },
            "hasLeadIcon": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "has-lead-icon",
                "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"
                        }
                    }
                }
            }];
    }
}
//# sourceMappingURL=dga-menu-item.js.map
