import { __decorate } from "tslib";
import { Component, Input } from '@angular/core';
import { coerceBooleanProperty } from '@angular/cdk/coercion';
import { RadioGroupComponent } from './radio-group/radio-group.component';
var RadioComponent = /** @class */ (function () {
    function RadioComponent(group) {
        this.group = group;
    }
    Object.defineProperty(RadioComponent.prototype, "setDisabled", {
        set: function (value) {
            this.disabled = coerceBooleanProperty(value);
        },
        enumerable: true,
        configurable: true
    });
    RadioComponent.prototype.ngOnInit = function () {
    };
    Object.defineProperty(RadioComponent.prototype, "viewDisabled", {
        get: function () {
            var _a;
            return this.disabled || ((_a = this.group) === null || _a === void 0 ? void 0 : _a.disabled);
        },
        enumerable: true,
        configurable: true
    });
    RadioComponent.prototype.updateValue = function () {
        this.group.updateValue(this.value);
    };
    RadioComponent.ctorParameters = function () { return [
        { 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);
    return RadioComponent;
}());
export { RadioComponent };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmFkaW8uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vQGNiZGV2L3VpLWtpdC8iLCJzb3VyY2VzIjpbImxpYi9mb3JtL3JhZGlvL3JhZGlvLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUFDLFNBQVMsRUFBRSxLQUFLLEVBQVMsTUFBTSxlQUFlLENBQUM7QUFDdkQsT0FBTyxFQUFDLHFCQUFxQixFQUFDLE1BQU0sdUJBQXVCLENBQUM7QUFDNUQsT0FBTyxFQUFDLG1CQUFtQixFQUFDLE1BQU0scUNBQXFDLENBQUM7QUFPeEU7SUFVRSx3QkFBbUIsS0FBMEI7UUFBMUIsVUFBSyxHQUFMLEtBQUssQ0FBcUI7SUFDN0MsQ0FBQztJQUxrQixzQkFBSSx1Q0FBVzthQUFmLFVBQWdCLEtBQWM7WUFDL0MsSUFBSSxDQUFDLFFBQVEsR0FBRyxxQkFBcUIsQ0FBQyxLQUFLLENBQUMsQ0FBQztRQUMvQyxDQUFDOzs7T0FBQTtJQUtELGlDQUFRLEdBQVI7S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