import { h } from '@stencil/core';
import { getMap } from '../utils';
export class Drawer {
    constructor() {
        this.open = false;
    }
    componentDidUpdate() {
        let map = getMap(this.mapId);
        map.resizeMap();
    }
    async 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 originalStyleUrls() { return {
        "$": ["drawer.css"]
    }; }
    static get styleUrls() { return {
        "$": ["drawer.css"]
    }; }
    static get properties() { return {
        "drawerTitle": {
            "type": "string",
            "mutable": true,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "drawer-title",
            "reflect": false
        },
        "mapId": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "map-id",
            "reflect": false
        },
        "open": {
            "type": "boolean",
            "mutable": true,
            "complexType": {
                "original": "boolean",
                "resolved": "boolean",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "open",
            "reflect": false,
            "defaultValue": "false"
        }
    }; }
    static get states() { return {
        "content": {}
    }; }
    static get methods() { return {
        "toggle": {
            "complexType": {
                "signature": "() => Promise<void>",
                "parameters": [],
                "references": {
                    "Promise": {
                        "location": "global"
                    }
                },
                "return": "Promise<void>"
            },
            "docs": {
                "text": "",
                "tags": []
            }
        }
    }; }
}
