import { withHooks } from "@saasquatch/stencil-hooks";
import { Component, h, Host, Method, Prop } from "@stencil/core";
import { useRequestRerender } from "../../../tables/re-render";
/**
 * @uiName Rewards Table Reward Column
 * @validParents ["sqm-rewards-table"]
 * @exampleGroup Rewards
 * @example Reward Column - <sqm-rewards-table-reward-column column-title="Reward" redeemed-text="{redeemedAmount} redeemed" available-text="{availableAmount} remaining" copy-text="Copied!"></sqm-rewards-table-reward-column>
 */
export class RewardsTableColumn {
  constructor() {
    /**
     * @uiName Reward column title
     */
    this.columnTitle = "Reward";
    /**
     * @uiName Redeemed amount text
     */
    this.redeemedText = "{redeemedAmount} redeemed";
    /**
     * @uiName Remaining amount text
     */
    this.availableText = "{availableAmount} remaining";
    /**
     * @uiName Copied fuel tank text
     */
    this.copyText = "Copied!";
    withHooks(this);
  }
  disconnectedCallback() { }
  async renderCell(data, options) {
    return (h("sqm-rewards-table-reward-cell", { reward: data, redeemedText: this.redeemedText, availableText: this.availableText, copyText: this.copyText, locale: options === null || options === void 0 ? void 0 : options.locale, exportparts: "sqm-rewards-cell-value, sqm-rewards-cell-progress-bar, sqm-rewards-cell-subtext" }));
  }
  async renderLabel() {
    return this.columnTitle;
  }
  render() {
    useRequestRerender([
      this.columnTitle,
      this.redeemedText,
      this.availableText,
      this.copyText,
    ]);
    return h(Host, { style: { display: "none" } });
  }
  static get is() { return "sqm-rewards-table-reward-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": "Reward column title",
            "name": "uiName"
          }],
        "text": ""
      },
      "attribute": "column-title",
      "reflect": false,
      "defaultValue": "\"Reward\""
    },
    "redeemedText": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "text": "Redeemed amount text",
            "name": "uiName"
          }],
        "text": ""
      },
      "attribute": "redeemed-text",
      "reflect": false,
      "defaultValue": "\"{redeemedAmount} redeemed\""
    },
    "availableText": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "text": "Remaining amount text",
            "name": "uiName"
          }],
        "text": ""
      },
      "attribute": "available-text",
      "reflect": false,
      "defaultValue": "\"{availableAmount} remaining\""
    },
    "copyText": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "text": "Copied fuel tank text",
            "name": "uiName"
          }],
        "text": ""
      },
      "attribute": "copy-text",
      "reflect": false,
      "defaultValue": "\"Copied!\""
    }
  }; }
  static get methods() { return {
    "renderCell": {
      "complexType": {
        "signature": "(data: Reward, options?: { locale: string; }) => Promise<any>",
        "parameters": [{
            "tags": [],
            "text": ""
          }, {
            "tags": [],
            "text": ""
          }],
        "references": {
          "Promise": {
            "location": "global"
          },
          "Reward": {
            "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": []
      }
    }
  }; }
}
