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 {
        "buttonTitle": {
            "type": String,
            "attr": "button-title"
        },
        "el": {
            "elementRef": true
        },
        "icon": {
            "type": String,
            "attr": "icon"
        },
        "lazyDrawer": {
            "connect": "gl-drawer"
        }
    }; }
}
