import { Component, h, Host, Prop } from '@stencil/core';
export class DvnFieldDisplayText {
  constructor() {
    this.meta = {};
  }
  render() {
    const { field, meta } = this;
    let value = this.value || '-';
    if (this.value && field.inputType === 'url') {
      value = h("a", { href: value.startsWith('http') ? value : `http://${value}`, target: "_blank" }, value);
    }
    // 0 means no limit
    const { lines = 0 } = meta;
    return (h(Host, { style: { '--line-count': lines } }, field.format === 'markdown'
      ? h("dvn-markdown", { content: value })
      : value));
  }
  static get is() { return "dvn-field-display-text"; }
  static get originalStyleUrls() { return {
    "$": ["dvn-field-display-text.scss"]
  }; }
  static get styleUrls() { return {
    "$": ["dvn-field-display-text.css"]
  }; }
  static get properties() { return {
    "value": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "value",
      "reflect": false
    },
    "field": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "TextField",
        "resolved": "TextField",
        "references": {
          "TextField": {
            "location": "import",
            "path": "../text"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      }
    },
    "meta": {
      "type": "any",
      "mutable": false,
      "complexType": {
        "original": "any",
        "resolved": "any",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "meta",
      "reflect": false,
      "defaultValue": "{}"
    }
  }; }
}
