import { r as registerInstance, h, H as Host, g as getElement } from './index-7e09edea.js';
import { v as v4, a as getHostAttrsWithId } from './index-ed2d325c.js';

const bsTextareaFieldCss = "bs-textarea-field{display:block;width:100%}";

const BsTextareaField = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    /** Native attributes to pass through to the input element. */
    this.attrs = {};
    this.charMax = undefined;
    this.disabled = false;
    this.error = undefined;
    this.hints = undefined;
    this.label = undefined;
    this.placeholder = undefined;
    this.required = undefined;
    this.value = '';
    this.passAttrs = '';
    this.hintId = null;
  }
  get charCount() {
    var _a;
    return ((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) || 0;
  }
  componentWillLoad() {
    this.hintId = this.hints ? v4() : null;
    this.attrs = getHostAttrsWithId(this.hostEl, [
      'autocomplete',
      '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, labelFor: this.attrs.id, required: this.required, charCount: this.charCount, charMax: this.charMax, hintId: this.hintId }, h("bs-textarea", Object.assign({ 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); }
};
BsTextareaField.style = bsTextareaFieldCss;

export { BsTextareaField as bs_textarea_field };

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