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 } from '@stencil/core';
import { VegaSlimmer, MapToComponentField } from 'vega-slimmer/core';
/** The VegaTimePickerLabelRenderer class is a TypeScript React component that renders a label for a time picker input field. */
export class VegaTimePickerLabelRenderer extends VegaSlimmer {
  constructor() {
    super(...arguments);
    /**
     * The below method is e2e-test covered in
     * @see{module:vega-time-picker-select-time-e2e}
     */
    /* istanbul ignore next */
    this.onTimePickerFocus = async () => {
      if (this.mode === 'single') {
        await this.singleInputRenderer.getInputRef().doFocus();
      }
      else {
        await this.rangeInputRenderer.getStartInputRef().doFocus();
      }
    };
  }
  render() {
    return (h("vega-field-label", { onClick: this.onTimePickerFocus, "is-field-required": this.required, disabled: this.disabled, label: this.label }));
  }
}
__decorate([
  MapToComponentField()
], VegaTimePickerLabelRenderer.prototype, "label", void 0);
__decorate([
  MapToComponentField()
], VegaTimePickerLabelRenderer.prototype, "mode", void 0);
__decorate([
  MapToComponentField()
], VegaTimePickerLabelRenderer.prototype, "required", void 0);
__decorate([
  MapToComponentField()
], VegaTimePickerLabelRenderer.prototype, "disabled", void 0);
__decorate([
  MapToComponentField()
], VegaTimePickerLabelRenderer.prototype, "singleInputRenderer", void 0);
__decorate([
  MapToComponentField()
], VegaTimePickerLabelRenderer.prototype, "rangeInputRenderer", void 0);
