import { Component, Element, Event, h, Host, Method, Prop } from '@stencil/core';
export class DvnFieldInputCellSingleChoice {
  async focus() {
    var _a, _b;
    (_b = (_a = this.el.querySelector('dvn-select')) === null || _a === void 0 ? void 0 : _a.focusOnInput) === null || _b === void 0 ? void 0 : _b.call(_a);
  }
  ;
  render() {
    const { field, value } = this;
    const { options = [] } = field;
    return (h(Host, null,
      h("dvn-select", { dataAdapter: field.dataAdapter, dataProvider: field.dataProvider, disabled: field.disabled, leaned: true, value: value, width: "100%", scale: "small", onClick: (e) => {
          e.stopImmediatePropagation();
        }, onBlur: (e) => {
          e.stopImmediatePropagation();
          this.cellFormCancel.emit();
        }, onChange: (e) => {
          e.stopImmediatePropagation();
          this.cellFormSubmit.emit({ value: e.detail });
          this.cellFormCancel.emit();
        } }, options.map(option => (h("dvn-select-option", { value: option.value }, option.label))))));
  }
  static get is() { return "dvn-field-input-cell-single-choice"; }
  static get originalStyleUrls() { return {
    "$": ["dvn-field-input-cell-single-choice.scss"]
  }; }
  static get styleUrls() { return {
    "$": ["dvn-field-input-cell-single-choice.css"]
  }; }
  static get properties() { return {
    "field": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "SingleChoiceField",
        "resolved": "SingleChoiceField",
        "references": {
          "SingleChoiceField": {
            "location": "import",
            "path": "@dvn/core/doldurma/src/fields/single-choice"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      }
    },
    "value": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "value",
      "reflect": false
    }
  }; }
  static get events() { return [{
      "method": "cellFormCancel",
      "name": "cellFormCancel",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "complexType": {
        "original": "any",
        "resolved": "any",
        "references": {}
      }
    }, {
      "method": "cellFormSubmit",
      "name": "cellFormSubmit",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "complexType": {
        "original": "any",
        "resolved": "any",
        "references": {}
      }
    }]; }
  static get methods() { return {
    "focus": {
      "complexType": {
        "signature": "() => Promise<void>",
        "parameters": [],
        "references": {
          "Promise": {
            "location": "global"
          }
        },
        "return": "Promise<void>"
      },
      "docs": {
        "text": "",
        "tags": []
      }
    }
  }; }
  static get elementRef() { return "el"; }
}
