import { r as registerInstance, h, H as Host, g as getElement } from './index-72f3c995.js';
import { v as v4, a as getHostAttrsWithId } from './index-9dff857b.js';

const bsInputFieldCss = "bs-input-field{display:block;width:100%}";

const BsInputField = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    /** Native attributes to pass through to the input element. */
    this.attrs = {};
    this.disabled = false;
    this.error = undefined;
    this.hints = undefined;
    this.label = undefined;
    this.passAttrs = '';
    this.placeholder = undefined;
    this.required = undefined;
    this.type = 'text';
    this.value = undefined;
    this.hintId = null;
  }
  componentWillLoad() {
    this.hintId = this.hints ? v4() : null;
    this.attrs = getHostAttrsWithId(this.hostEl, [
      'autocomplete',
      'max',
      'min',
      'maxlength',
      'minlength',
      'name',
      ...this.passAttrs.split(',')
    ]);
  }
  render() {
    return (h(Host, null, h("bs-field-layout", { disabled: this.disabled, error: this.error, hints: this.hints, label: this.label, "label-for": this.attrs.id, required: this.required, hintId: this.hintId }, h("bs-input", Object.assign({ type: this.type, disabled: this.disabled, error: this.error, placeholder: this.placeholder, required: this.required, value: this.value, hintId: this.hintId }, this.attrs)))));
  }
  get hostEl() { return getElement(this); }
};
BsInputField.style = bsInputFieldCss;

export { BsInputField as bs_input_field };

//# sourceMappingURL=bs-input-field.entry.js.map