import { Component, h, Prop } from '@stencil/core';
export class DvnFieldInputMultipleChoice {
  render() {
    const { disabled, errors, field, value } = this;
    const { options = [] } = field;
    const hasError = errors && errors.length > 0;
    // const error = hasError ? errors![0] : undefined;
    if (field.inputType === 'select') {
      return (h("dvn-select", { 
        // dataAdapter={field.dataAdapter}
        // dataProvider={field.dataProvider}
        disabled: disabled || field.disabled, feedback: hasError ? 'error' : undefined, leaned: true, multiple: true, enableSearch: true, value: value, width: "240px" }, options.map(option => (h("dvn-select-option", { value: option.value }, option.label)))));
    }
    if (field.inputType === 'tag-cloud') {
      return (h("dvn-tag-cloud", { disabled: disabled || field.disabled, editable: true, options: field.options, value: value }));
    }
    return (h("dvn-checkbox-group", { options: field.options, value: value }));
  }
  static get is() { return "dvn-field-input-multiple-choice"; }
  static get properties() { return {
    "disabled": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "disabled",
      "reflect": false
    },
    "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": ""
      }
    },
    "errors": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "any[]",
        "resolved": "any[]",
        "references": {}
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": ""
      }
    },
    "value": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "string[]",
        "resolved": "string[]",
        "references": {}
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": ""
      }
    }
  }; }
}
