import { Component, Input } from '@angular/core';
import { coerceBooleanProperty } from '@angular/cdk/coercion';
import * as i0 from "@angular/core";
import * as i1 from "./radio-group/radio-group.component";
import * as i2 from "@angular/forms";
export class RadioComponent {
    constructor(group) {
        this.group = group;
    }
    set setDisabled(value) {
        this.disabled = coerceBooleanProperty(value);
    }
    ngOnInit() {
    }
    get viewDisabled() {
        var _a;
        return this.disabled || ((_a = this.group) === null || _a === void 0 ? void 0 : _a.disabled);
    }
    updateValue() {
        this.group.updateValue(this.value);
    }
}
RadioComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0, type: RadioComponent, deps: [{ token: i1.RadioGroupComponent }], target: i0.ɵɵFactoryTarget.Component });
RadioComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.4", type: RadioComponent, selector: "ui-radio", inputs: { value: "value", alignRight: "alignRight", setDisabled: ["disabled", "setDisabled"] }, ngImport: i0, template: "<label>\n  <input type=\"radio\"\n         [ngModel]=\"group.value\"\n         (ngModelChange)=\"updateValue()\"\n         [value]=\"value\"\n         [name]=\"group.name\"\n         [disabled]=\"viewDisabled\">\n  <span>\n    <ng-content></ng-content>\n  </span>\n</label>\n", styles: [".transition{transition:all .5s ease-in}.transition-fast{transition:all .2s ease-in}:host-context(ui-radio-group-input-layout){display:flex;flex-flow:column;justify-content:center;min-height:var(--field-height);padding:0;background:var(--field-bg);box-sizing:border-box;border-radius:var(--radius-regular);transition:background .2s ease-in-out}:host-context(ui-radio-group-input-layout)>label{flex:1;cursor:pointer;display:flex;align-items:center;padding:var(--field-padding)}:host-context(ui-radio-group-input-layout)>label input+span{flex:1;padding:3px 29px 3px 0}:host-context(ui-radio-group-input-layout)>label input+span:before{top:50%;right:0;left:auto;transform:translateY(-50%)}:host-context(ui-radio-group-input-layout)>label input:checked+span:before,:host-context(ui-radio-group-input-layout)>label input:not(:checked)+span:before{border-radius:50%}:host-context(ui-radio-group-input-layout)>label input:checked+span:after,:host-context(ui-radio-group-input-layout)>label input:not(:checked)+span:after{right:6px;left:auto;top:50%;transform:translateY(-50%)}@media not all and (pointer:coarse){:host-context(ui-radio-group-input-layout):hover{--field-bg:var(--field-bg-hover)}}:host-context(ui-radio-group-right){display:flex;flex-flow:column;justify-content:center}:host-context(ui-radio-group-right)>label{flex:1;cursor:pointer;display:flex;align-items:center}:host-context(ui-radio-group-right)>label input+span{flex:1;padding:3px 29px 3px 0}:host-context(ui-radio-group-right)>label input+span:before{top:50%;right:0;left:auto;transform:translateY(-50%)}:host-context(ui-radio-group-right)>label input:checked+span:before,:host-context(ui-radio-group-right)>label input:not(:checked)+span:before{border-radius:50%}:host-context(ui-radio-group-right)>label input:checked+span:after,:host-context(ui-radio-group-right)>label input:not(:checked)+span:after{right:6px;left:auto;top:50%;transform:translateY(-50%)}:host{display:block;padding:0 0 15px;line-height:1.3}input:checked,input:not(:checked){position:absolute;width:20px;height:20px;opacity:.00001}input:checked+span,input:not(:checked)+span{display:block;position:relative;cursor:pointer;padding:3px 0 3px 29px;-webkit-user-select:none;-moz-user-select:none;user-select:none}input:checked+span:before,input:not(:checked)+span:before{content:\"\";position:absolute;left:0;top:2px;width:20px;height:20px;border:var(--checkRadioBorderWidth) solid var(--checkRadioBorderColor);background:var(--checkRadioBackground);box-shadow:var(--checkRadioShadow);transition:all .2s}input:checked+span:after,input:not(:checked)+span:after{content:\"\";position:absolute;transition:all .2s}input:focus+span:before{border-color:var(--checkRadioBorderColorFocus)}input:focus:not(:focus-visible)+span:before{border-color:var(--checkRadioBorderColor);box-shadow:none!important}input:hover+span:before{border-color:var(--checkRadioBorderColorHover)}input:checked+span:before,input:not(:checked)+span:before{border-radius:50%}input:checked+span:after,input:not(:checked)+span:after{left:6px;top:8px;width:8px;height:8px;border-radius:50%;background:var(--color-primary-contrast)}input:not(:checked)+span:after{opacity:0;transform:scale(0)}input:checked+span:after{opacity:1;transform:scale(1)}input:checked+span:before{background:var(--color-primary);border-color:var(--color-primary)}input:checked:focus+span:before{border-color:var(--checkRadioBorderColorFocus);box-shadow:0 0 0 6px var(--color-contrast-5)}input:disabled:checked+span,input:disabled:not(:checked)+span{color:var(--checkRadioLabelDisabled);cursor:default}input:disabled:checked+span:before,input:disabled:not(:checked)+span:before{border-color:var(--checkRadioBackgroundDisabled);background:var(--checkRadioBackgroundDisabled)}input:disabled:checked+span:after{color:var(--checkRadioMarkColorDisabled)}input:disabled+span{color:var(--checkRadioLabelDisabled)}input.invalid+span:before{border-color:var(--color-error)}"], directives: [{ type: i2.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0, type: RadioComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'ui-radio',
                    templateUrl: './radio.component.html',
                    styleUrls: ['./radio.component.scss']
                }]
        }], ctorParameters: function () { return [{ type: i1.RadioGroupComponent }]; }, propDecorators: { value: [{
                type: Input
            }], alignRight: [{
                type: Input
            }], setDisabled: [{
                type: Input,
                args: ['disabled']
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmFkaW8uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vdWkta2l0L3NyYy9saWIvZm9ybS9yYWRpby9yYWRpby5jb21wb25lbnQudHMiLCI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