'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-6e6e9b7c.js');
const index$1 = require('./index-680e4e32.js');

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

const BsTextareaField = class {
  constructor(hostRef) {
    index.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 ? index$1.v4() : null;
    this.attrs = index$1.getHostAttrsWithId(this.hostEl, [
      'autocomplete',
      'maxlength',
      'minlength',
      'name',
      ...this.passAttrs.split(',')
    ]);
  }
  render() {
    return (index.h(index.Host, null, index.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 }, index.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 index.getElement(this); }
};
BsTextareaField.style = bsTextareaFieldCss;

exports.bs_textarea_field = BsTextareaField;

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