import { h } from '@stencil/core';
import { _t } from '../i18n/i18n';
export class DrawerToggle {
    constructor() {
        this.icon = 'settings';
        this.buttonTitle = _t('webmapgl.drawer-toggle.label');
    }
    async componentWillLoad() {
        this.drawer = await this.lazyDrawer.componentOnReady();
    }
    toggleDrawer() {
        this.drawer.open = !this.drawer.open;
    }
    render() {
        return (h("ion-button", { onClick: () => this.toggleDrawer(), title: this.buttonTitle },
            h("ion-icon", { slot: "icon-only", name: this.icon })));
    }
    static get is() { return "gl-drawer-toggle"; }
    static get properties() { return {
        "icon": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "icon",
            "reflect": false,
            "defaultValue": "'settings'"
        },
        "buttonTitle": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "button-title",
            "reflect": false,
            "defaultValue": "_t('webmapgl.drawer-toggle.label')"
        }
    }; }
    static get connectProps() { return [{
            "name": "lazyDrawer",
            "connect": "gl-drawer"
        }]; }
    static get elementRef() { return "el"; }
}
