var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { h, Host } from '@stencil/core';
import { MapToComponentField, VegaSlimmer } from 'vega-slimmer/core';
export class VegaComboBoxRenderer extends VegaSlimmer {
  constructor() {
    super(...arguments);
    /**
     * The below method is e2e-test covered in
     * @see{module:vega-combo-box-focus-by-label-e2e}
     */
    /* istanbul ignore next */
    this.onLabelClick = () => {
      this.dropdownRenderer.focusInput();
    };
  }
  render() {
    return (h(Host, { class: {
        'vega-combo-box-disabled': this.disabled,
      } },
      this.renderLabel(),
      this.dropdownRenderer.renderDropdown(),
      this.renderHint()));
  }
  renderLabel() {
    return (h("vega-field-label", { onClick: this.onLabelClick, "is-field-required": this.required, disabled: this.disabled, label: this.label }));
  }
  renderHint() {
    return h("div", { class: "vega-combo-box-hint" }, this.hint);
  }
}
__decorate([
  MapToComponentField()
], VegaComboBoxRenderer.prototype, "required", void 0);
__decorate([
  MapToComponentField()
], VegaComboBoxRenderer.prototype, "hint", void 0);
__decorate([
  MapToComponentField()
], VegaComboBoxRenderer.prototype, "disabled", void 0);
__decorate([
  MapToComponentField()
], VegaComboBoxRenderer.prototype, "dropdownRenderer", void 0);
__decorate([
  MapToComponentField()
], VegaComboBoxRenderer.prototype, "label", void 0);
