'use strict';

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

const index = require('./index-0b777b3f.js');

const bsFormCheckGroupCss = ":host{display:flex}";

const BsFormCheckGroup = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.bsChange = index.createEvent(this, "bsChange", 7);
    this.value = undefined;
  }
  valueChanged(value) {
    this.bsChange.emit(value);
  }
  handleChange(e) {
    const radioList = this.el.querySelectorAll("bs-form-check");
    radioList.forEach((radioItem) => {
      if (radioItem.value !== e.detail.value) {
        radioItem.checked = false;
      }
      else {
        this.value = e.detail;
      }
    });
  }
  componentDidLoad() {
    const radioList = this.el.querySelectorAll('bs-form-check[type="radio"]');
    radioList.forEach(radioItem => {
      radioItem.addEventListener('bsInput', this.handleChange.bind(this));
    });
  }
  render() {
    return (index.h(index.Host, null, index.h("slot", null)));
  }
  get el() { return index.getElement(this); }
  static get watchers() { return {
    "value": ["valueChanged"]
  }; }
};
BsFormCheckGroup.style = bsFormCheckGroupCss;

exports.bs_form_check_group = BsFormCheckGroup;

//# sourceMappingURL=bs-form-check-group.cjs.entry.js.map