import { withHooks } from "@saasquatch/stencil-hooks";
import { Component, getElement, h, Host, Method, Prop } from "@stencil/core";
import { useRequestRerender } from "../../../tables/re-render";
/**
 * @uiName Referral Table Generic Column
 * @validParents ["sqm-referral-table"]
 */
export class ReferralTableGenericColumn {
  constructor() {
    withHooks(this);
  }
  disconnectedCallback() { }
  async renderCell(_) {
    // this is insecure, <script> tags can be added
    return (h("sqm-referral-table-cell", { "inner-template": getElement(this).innerHTML }));
  }
  async renderLabel() {
    return Promise.resolve(this.columnTitle);
  }
  render() {
    useRequestRerender([this.columnTitle]);
    return (h(Host, { style: { display: "none" } },
      h("slot", null)));
  }
  static get is() { return "sqm-referral-table-column"; }
  static get encapsulation() { return "shadow"; }
  static get properties() { return {
    "columnTitle": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "text": "Column title",
            "name": "uiName"
          }],
        "text": ""
      },
      "attribute": "column-title",
      "reflect": false
    }
  }; }
  static get methods() { return {
    "renderCell": {
      "complexType": {
        "signature": "(_: Referral) => Promise<any>",
        "parameters": [{
            "tags": [],
            "text": ""
          }],
        "references": {
          "Promise": {
            "location": "global"
          },
          "Referral": {
            "location": "import",
            "path": "../../../saasquatch"
          }
        },
        "return": "Promise<any>"
      },
      "docs": {
        "text": "",
        "tags": []
      }
    },
    "renderLabel": {
      "complexType": {
        "signature": "() => Promise<string>",
        "parameters": [],
        "references": {
          "Promise": {
            "location": "global"
          }
        },
        "return": "Promise<string>"
      },
      "docs": {
        "text": "",
        "tags": []
      }
    }
  }; }
}
