import { h } from "@stencil/core";
export class TableColumnVisibilityToggle {
  constructor() {
    this.toggleChanged = (e) => this.changeHandler(e);
    this.column = undefined;
    this.enabled = true;
  }
  changeHandler(e) {
    this.enabled = e.detail.checked;
    this.column.visible = this.enabled;
  }
  render() {
    return (h("ion-item", null, h("ion-label", null, this.column.label), h("ion-toggle", { value: "toggle", checked: this.enabled, onIonChange: this.toggleChanged })));
  }
  static get is() { return "gl-table-column-visibility-toggle"; }
  static get properties() {
    return {
      "column": {
        "type": "unknown",
        "mutable": false,
        "complexType": {
          "original": "HTMLGlTableColumnElement",
          "resolved": "HTMLGlTableColumnElement",
          "references": {
            "HTMLGlTableColumnElement": {
              "location": "global",
              "id": "global::HTMLGlTableColumnElement"
            }
          }
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "The column this visibility toggle works on."
        }
      },
      "enabled": {
        "type": "boolean",
        "mutable": true,
        "complexType": {
          "original": "boolean",
          "resolved": "boolean",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "When the column is currently visible or invisible."
        },
        "attribute": "enabled",
        "reflect": false,
        "defaultValue": "true"
      }
    };
  }
}
//# sourceMappingURL=table-column-visibility-toggle.js.map
