import { h } from '@stencil/core';
import { _t } from '../i18n/i18n';
export class DownloadButton {
    async openPopover(ev) {
        const options = {
            component: document.createElement('gl-download-list'),
            componentProps: {
                files: Array.from(this.el.querySelectorAll('gl-download-file'))
            },
            ev: ev
        };
        const popover = await this.popoverCtrl.create(options);
        await popover.present();
        return popover;
    }
    ;
    render() {
        let title = _t('webmapgl.download-button.title');
        return (h("ion-button", { onClick: (e) => this.openPopover(e), title: title },
            h("ion-icon", { slot: "icon-only", name: 'download' })));
    }
    static get is() { return "gl-download-button"; }
    static get connectProps() { return [{
            "name": "popoverCtrl",
            "connect": "ion-popover-controller"
        }]; }
    static get elementRef() { return "el"; }
}
