import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './chunk-8105bee0.js';
var RadioGroup = /** @class */ (function () {
    function RadioGroup(hostRef) {
        registerInstance(this, hostRef);
        this.change = createEvent(this, "change", 7);
    }
    RadioGroup.prototype.componentDidLoad = function () {
        var _this = this;
        var isRadioChecked = this.host.querySelector('materials-radio[checked]');
        this.value = isRadioChecked ? isRadioChecked.value : null;
        this.materialsRadioNodes = Array.from(this.host.querySelectorAll('materials-radio'));
        this.materialsRadioNodes.forEach(function (radioEl) {
            radioEl.addEventListener('change', function (value) { return _this.handleEvent(value); });
        });
    };
    RadioGroup.prototype.handleEvent = function (event) {
        event.stopPropagation();
        this.value = event.detail;
        this.cleanNeighbors(this.value);
        this.change.emit(this.value);
    };
    RadioGroup.prototype.cleanNeighbors = function (except) {
        this.materialsRadioNodes.filter(function (el) { return !except || el.value !== except; }).forEach(function (el) { return el.checked = false; });
    };
    RadioGroup.prototype.render = function () {
        return (h(Host, { class: { 'linebreak': this.linebreak } }, this.label && h("span", null, this.label), h("slot", null)));
    };
    Object.defineProperty(RadioGroup.prototype, "host", {
        get: function () { return getElement(this); },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RadioGroup, "style", {
        get: function () { return ":host linebreak{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}"; },
        enumerable: true,
        configurable: true
    });
    return RadioGroup;
}());
export { RadioGroup as materials_radio_group };
