import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a736066d.js';

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

const BsFormCheckGroup = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.bsChange = 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 (h(Host, null, h("slot", null)));
  }
  get el() { return getElement(this); }
  static get watchers() { return {
    "value": ["valueChanged"]
  }; }
};
BsFormCheckGroup.style = bsFormCheckGroupCss;

export { BsFormCheckGroup as bs_form_check_group };

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