import { Component, h, Host, Prop } from '@stencil/core';
export class DvnFieldDisplayMultipleChoice {
  constructor() {
    this.value = [];
  }
  render() {
    var _a;
    const placeholderListElementCount = (((_a = this.meta) === null || _a === void 0 ? void 0 : _a.lines) || 0) - this.value.length;
    if (this.field.inputType === 'tag-cloud') {
      return (h(Host, { style: { height: this.fixHeight ? `${(this.field.options || []).length * 20}px` : undefined } },
        this.value.map(v => (h("dvn-button", { leaned: true, scale: "small", shape: "rounded", view: "outline", tagMode: true }, this.field.getOptionOfValue(v).label))),
        this.value.length === 0 && '-'));
    }
    return (h(Host, { style: { height: this.fixHeight ? `${(this.field.options || []).length * 20}px` : undefined } },
      h("ul", null,
        this.value.map(v => (h("li", null, this.field.getOptionOfValue(v).label))),
        this.value.length === 0 && '-',
        placeholderListElementCount > 0 && new Array(placeholderListElementCount).fill(0).map(() => (h("li", null))))));
  }
  static get is() { return "dvn-field-display-multiple-choice"; }
  static get encapsulation() { return "scoped"; }
  static get originalStyleUrls() { return {
    "$": ["dvn-field-display-multiple-choice.css"]
  }; }
  static get styleUrls() { return {
    "$": ["dvn-field-display-multiple-choice.css"]
  }; }
  static get properties() { return {
    "value": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "any[]",
        "resolved": "any[]",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "defaultValue": "[]"
    },
    "field": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "MultipleChoiceField",
        "resolved": "MultipleChoiceField",
        "references": {
          "MultipleChoiceField": {
            "location": "import",
            "path": "../multiple-choice-field"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      }
    },
    "fixHeight": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "fix-height",
      "reflect": false
    },
    "meta": {
      "type": "any",
      "mutable": false,
      "complexType": {
        "original": "any",
        "resolved": "any",
        "references": {}
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "meta",
      "reflect": false
    }
  }; }
}
