import { getMap } from '../utils';
export class Drawer {
    constructor() {
        this.open = false;
    }
    componentDidUpdate() {
        let map = getMap(this.mapId);
        map.resizeMap();
    }
    toggle() {
        this.open = !this.open;
    }
    hostData() {
        return {
            class: {
                'gl-drawer-closed': !this.open,
                'gl-drawer-open': this.open
            }
        };
    }
    render() {
        return ([
            h("ion-header", null,
                h("ion-toolbar", null,
                    h("ion-buttons", { slot: "start" },
                        h("slot", { name: "toolbar-start-buttons" })),
                    h("ion-title", null, this.drawerTitle),
                    h("ion-buttons", { slot: "end" },
                        h("slot", { name: "toolbar-end-buttons" }),
                        h("ion-button", { title: "Close", onClick: () => { this.open = false; } },
                            h("ion-icon", { slot: "icon-only", name: "close" }))))),
            h("ion-content", null,
                h("slot", null))
        ]);
    }
    static get is() { return "gl-drawer"; }
    static get properties() { return {
        "content": {
            "state": true
        },
        "drawerTitle": {
            "type": String,
            "attr": "drawer-title",
            "mutable": true
        },
        "mapId": {
            "type": String,
            "attr": "map-id"
        },
        "open": {
            "type": Boolean,
            "attr": "open",
            "mutable": true
        },
        "toggle": {
            "method": true
        }
    }; }
    static get style() { return "/**style-placeholder:gl-drawer:**/"; }
}
