/**
 * @license
 * Copyright Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
import { setDefaultAria } from '../../constants';
import { BaseAdapter } from '../../core/base/';
import { RADIO_CONSTANTS } from '../radio/radio-constants';
export class RadioGroupAdapter extends BaseAdapter {
    constructor(component) {
        super(component);
    }
    attachLabel(label) {
        label.nonInteractive = true;
        label.forElement = this._component;
    }
    setDisabled(value) {
        this._component[setDefaultAria]({ ariaDisabled: value ? 'true' : null });
        this._disableRadios(value);
    }
    _disableRadios(value) {
        this._component.querySelectorAll(RADIO_CONSTANTS.elementName).forEach(radio => {
            radio.disabled = value;
        });
    }
}
