import { __decorate } from "tslib";
import { Component, Input } from '@angular/core';
import { coerceBooleanProperty } from '@angular/cdk/coercion';
import { RadioGroupComponent } from './radio-group/radio-group.component';
let RadioComponent = 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.ctorParameters = () => [
    { type: RadioGroupComponent }
];
__decorate([
    Input()
], RadioComponent.prototype, "value", void 0);
__decorate([
    Input('disabled')
], RadioComponent.prototype, "setDisabled", null);
RadioComponent = __decorate([
    Component({
        selector: 'ui-radio',
        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: [":host{display:block;padding:0 0 15px;line-height:1.3}input:checked,input:not(:checked){position:absolute;left:-9999px}input:checked+span,input:not(:checked)+span{display:block;position:relative;cursor:pointer;padding:3px 0 3px 36px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}input:checked+span:before,input:not(:checked)+span:before{content:\"\";position:absolute;left:0;top:0;width:20px;height:20px;border:var(--checkRadioBorderWidth) solid var(--checkRadioBorderColor);background:var(--checkRadioBackground);box-shadow:var(--checkRadioShadow);transition:.2s;border-radius:50%}input:checked+span:after,input:not(:checked)+span:after{content:\"\";position:absolute;transition:.2s;left:6px;top:6px;width:8px;height:8px;border-radius:50%;background:var(--color-primary-contrast)}input:checked+span:hover:before,input:not(:checked)+span:hover:before{border-color:var(--checkRadioBorderColor)}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:disabled:checked+span,input:disabled:not(:checked)+span{color:#d0d0d0}input:disabled:checked+span:before,input:disabled:not(:checked)+span:before{box-shadow:none;border-color:#d0d0d0;background-color:#f0f0f0}input:disabled:checked+span:after{color:#999}input:disabled+span{color:#aaa}input:checked:focus+span:before,input:not(:checked):focus+span:before{border:var(--checkRadioBorderWidth) solid var(--checkRadioBorderColor)}input:checked:focus+span:before{border-color:var(--color-primary)}"]
    })
], RadioComponent);
export { RadioComponent };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmFkaW8uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vQGNiZGV2L3VpLWtpdC8iLCJzb3VyY2VzIjpbImxpYi9mb3JtL3JhZGlvL3JhZGlvLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUFDLFNBQVMsRUFBRSxLQUFLLEVBQVMsTUFBTSxlQUFlLENBQUM7QUFDdkQsT0FBTyxFQUFDLHFCQUFxQixFQUFDLE1BQU0sdUJBQXVCLENBQUM7QUFDNUQsT0FBTyxFQUFDLG1CQUFtQixFQUFDLE1BQU0scUNBQXFDLENBQUM7QUFPeEUsSUFBYSxjQUFjLEdBQTNCLE1BQWEsY0FBYztJQVV6QixZQUFtQixLQUEwQjtRQUExQixVQUFLLEdBQUwsS0FBSyxDQUFxQjtJQUM3QyxDQUFDO0lBTGtCLElBQUksV0FBVyxDQUFDLEtBQWM7UUFDL0MsSUFBSSxDQUFDLFFBQVEsR0FBRyxxQkFBcUIsQ0FBQyxLQUFLLENBQUMsQ0FBQztJQUMvQyxDQUFDO0lBS0QsUUFBUTtJQUNSLENBQUM7SUFFRCxJQUFJLFlBQVk7O1FBQ2QsT0FBTyxJQUFJLENBQUMsUUFBUSxXQUFJLElBQUksQ0FBQyxLQUFLLDBDQUFFLFFBQVEsQ0FBQSxDQUFDO0lBQy9DLENBQUM7SUFFRCxXQUFXO1F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