import { h } from "@stencil/core";
import { modalController } from "@ionic/core";
import { _t } from "../i18n/i18n";
export class TableColumnVisibilityButton {
  constructor() {
    this.openClick = (e) => this.openModal(e);
    this.label = _t("webmapgl.table-column-visibility.label");
    this.tableId = undefined;
  }
  async openModal(ev) {
    const options = {
      component: document.createElement("gl-table-column-visibility"),
      componentOptions: {
        tableId: this.tableId,
      },
      event: ev,
    };
    const modal = await modalController.create(options);
    await modal.present();
    return modal;
  }
  render() {
    return h("ion-button", { onClick: this.openClick }, this.label);
  }
  static get is() { return "gl-table-column-visibility-button"; }
  static get properties() {
    return {
      "label": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "A label for the button.\nIn english it defaults to 'Column Visibility'."
        },
        "attribute": "label",
        "reflect": false,
        "defaultValue": "_t(\"webmapgl.table-column-visibility.label\")"
      },
      "tableId": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "An id for the table."
        },
        "attribute": "table-id",
        "reflect": false
      }
    };
  }
}
//# sourceMappingURL=table-column-visibility-button.js.map
