import { h, Host } from "@stencil/core";
import { cls } from "../../utils/helpers";
export class XDockItem {
    constructor() {
        this.active = undefined;
        this.label = undefined;
    }
    /**
     * Watch loop changes
     */
    watchLoop() {
        this.el.parentElement.dispatchEvent(new CustomEvent('switch', { detail: this.el }));
    }
    /**
     * Listen for click element
     */
    handleSwitch() {
        this.el.parentElement.dispatchEvent(new CustomEvent('switch', { detail: this.el }));
    }
    /**
     * Render component
     */
    render() {
        return h(Host, { key: '1d9df67693af821f94c6b0eaa46924b152103155', class: cls({ 'with-label': this.label }) }, h("div", { key: '04fe0fce65ff9e19774b28a91705cdb42cb1675a' }, h("slot", { key: '6cf73c1d38b35da0388db5d11a42ce55ca6502c7' }), this.label && h("small", { key: '4f61dcc0c4adefa202bc6c434d0a7462330803d8', innerHTML: this.label })));
    }
    static get is() { return "x-dock-item"; }
    static get originalStyleUrls() {
        return {
            "$": ["./style.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["style.css"]
        };
    }
    static get properties() {
        return {
            "active": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element active status"
                },
                "attribute": "active",
                "reflect": false
            },
            "label": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element label"
                },
                "attribute": "label",
                "reflect": false
            }
        };
    }
    static get elementRef() { return "el"; }
    static get watchers() {
        return [{
                "propName": "active",
                "methodName": "watchLoop"
            }];
    }
    static get listeners() {
        return [{
                "name": "click",
                "method": "handleSwitch",
                "target": undefined,
                "capture": false,
                "passive": false
            }];
    }
}
