import { Host, h } from "@stencil/core";
import { ElementIDUtils } from "@sankhyalabs/core";
import { cardFormResizeObserver } from "./CardFormResizeObserver";
export class SnkFormSummary {
  constructor() {
    this.fixed = false;
    this.contracted = false;
    this.summary = undefined;
  }
  componentDidRender() {
    cardFormResizeObserver.disconnect();
    if (this._summaryElement) {
      cardFormResizeObserver.observe(this._summaryElement);
    }
  }
  disconnectedCallback() {
    cardFormResizeObserver.disconnect();
  }
  render() {
    ElementIDUtils.addIDInfoIfNotExists(this._elem, 'ezFormCard');
    return (h(Host, null, h("div", { ref: el => this._summaryElement = el, class: "summary-wrapper" }, Object.entries(this.summary).map(([key, value]) => h("div", { class: "summary-container", title: `${key}: ${value}` }, h("label", { class: "ez-text summary-field summary-field__title" }, key), h("label", { class: " ez-text summary-field summary-field__content" }, value))))));
  }
  static get is() { return "snk-form-summary"; }
  static get encapsulation() { return "scoped"; }
  static get originalStyleUrls() {
    return {
      "$": ["snk-form-summary.css"]
    };
  }
  static get styleUrls() {
    return {
      "$": ["snk-form-summary.css"]
    };
  }
  static get properties() {
    return {
      "fixed": {
        "type": "boolean",
        "mutable": true,
        "complexType": {
          "original": "boolean",
          "resolved": "boolean",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "Define se o card est\u00E1 fixado ou n\u00E3o."
        },
        "attribute": "fixed",
        "reflect": true,
        "defaultValue": "false"
      },
      "contracted": {
        "type": "boolean",
        "mutable": true,
        "complexType": {
          "original": "boolean",
          "resolved": "boolean",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "Define se o card est\u00E1 contra\u00EDdo ou n\u00E3o."
        },
        "attribute": "contracted",
        "reflect": true,
        "defaultValue": "false"
      },
      "summary": {
        "type": "unknown",
        "mutable": false,
        "complexType": {
          "original": "{ [key:string] : any }",
          "resolved": "{ [key: string]: any; }",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "Define quais s\u00E3o as informa\u00E7\u00F5es exibidas no modo contra\u00EDdo.\nCada atributo ser\u00E1 exibido com seu respectivo valor."
        }
      }
    };
  }
  static get elementRef() { return "_elem"; }
}
