import { h } from "@stencil/core";
import { popoverController } from "@ionic/core";
import { _t } from "../i18n/i18n";
export class DownloadButton {
  constructor() {
    this.clickPopover = (ev) => this.openPopover(ev);
  }
  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 popoverController.create(options);
    await popover.present();
    return popover;
  }
  render() {
    let title = _t("webmapgl.download-button.title");
    return (h("ion-button", { onClick: this.clickPopover, title: title }, h("ion-icon", { slot: "icon-only", name: "download-sharp" })));
  }
  static get is() { return "gl-download-button"; }
  static get elementRef() { return "el"; }
}
//# sourceMappingURL=download-button.js.map
