import { _t } from '../i18n/i18n';
export class App {
    constructor() {
        this.menu = true;
        this.menuLabel = _t('webmapgl.app.menulabel');
        this.splitPane = true;
    }
    componentDidLoad() {
        this.el.querySelector('gl-map').resizeMap();
    }
    getMenu() {
        if (this.menu === true) {
            return (h("ion-menu", null,
                h("ion-header", null,
                    h("ion-toolbar", null,
                        h("ion-title", null, this.menuLabel))),
                h("ion-content", null,
                    h("div", { class: "gl-menu-content" },
                        h("slot", { name: "menu" })))));
        }
        else if (this.menu === 'custom') {
            return h("slot", { name: "menu" });
        }
        ;
    }
    getMenuButton() {
        if (this.menu)
            return (h("ion-menu-toggle", null,
                h("ion-button", null,
                    h("ion-icon", { slot: "icon-only", name: "menu" }))));
    }
    getMain() {
        return (h("div", { class: "pane-main", main: true },
            h("ion-header", null,
                h("ion-toolbar", null,
                    h("ion-buttons", { slot: "start" },
                        this.getMenuButton(),
                        h("slot", { name: "start-buttons" })),
                    h("ion-buttons", { slot: "end" },
                        h("slot", { name: "end-buttons" })),
                    h("ion-title", null, this.label))),
            h("ion-content", { scrollX: false, scrollY: false, class: "map-content" },
                h("div", { class: "fixed-content", slot: "fixed" },
                    h("slot", null))),
            h("slot", { name: "after-content" }),
            h("ion-footer", null,
                h("slot", { name: "footer" }))));
    }
    render() {
        let content = [this.getMenu(), this.getMain()];
        if (this.splitPane)
            content = [h("ion-split-pane", null, content)];
        return [
            h("ion-app", null, content)
        ];
    }
    static get is() { return "gl-app"; }
    static get properties() { return {
        "el": {
            "elementRef": true
        },
        "label": {
            "type": String,
            "attr": "label"
        },
        "menu": {
            "type": "Any",
            "attr": "menu"
        },
        "menuLabel": {
            "type": String,
            "attr": "menu-label"
        },
        "splitPane": {
            "type": Boolean,
            "attr": "split-pane"
        }
    }; }
    static get style() { return "/**style-placeholder:gl-app:**/"; }
}
