import { Component, forwardRef, Input } from '@angular/core';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { EvoBaseControl } from '../../common/evo-base-control';
import * as i0 from "@angular/core";
export class EvoRadioComponent extends EvoBaseControl {
    constructor() {
        super(...arguments);
        this.onChange = (_) => { };
        this.onTouch = () => { };
    }
    get checked() {
        return this.control ? this.control.value === this.value : false;
    }
    handleOnChange() {
        this.onChange(this.value);
    }
    registerOnChange(fn) {
        this.onChange = fn;
    }
    registerOnTouched(fn) {
        this.onTouch = fn;
    }
    setDisabledState(isDisabled) {
        this.disabled = isDisabled;
    }
    writeValue(obj) {
    }
}
EvoRadioComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: EvoRadioComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
EvoRadioComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: EvoRadioComponent, selector: "evo-radio", inputs: { value: "value", name: "name" }, providers: [
        {
            provide: NG_VALUE_ACCESSOR,
            useExisting: forwardRef(() => EvoRadioComponent),
            multi: true,
        },
    ], usesInheritance: true, ngImport: i0, template: "<label class=\"evo-radio\">\n    <input class=\"evo-radio__input\"\n           type=\"radio\"\n           (change)=\"handleOnChange()\"\n           [name]=\"name\"\n           [value]=\"value\"\n           [checked]=\"checked\"\n           [disabled]=\"disabled\">\n    <span class=\"evo-radio__element\"></span>\n    <span class=\"evo-radio__content\">\n        <ng-content></ng-content>\n    </span>\n</label>\n", styles: [":host{display:inline-block}.evo-radio{display:flex;align-items:center;cursor:pointer}.evo-radio__element{position:relative;display:block;flex:0 0 20px;width:20px;height:20px;margin:2px 8px 2px 2px;padding:4px;background-color:#fff;border:2px solid #C6C6C6;border-radius:50%;transition:background .3s,border-color .3s}.evo-radio__element:before{content:\"\";position:absolute;top:50%;left:50%;display:block;box-sizing:border-box;width:10px;height:10px;margin-top:-5px;margin-left:-5px;background-color:#0986e2;border-radius:50%;transform:scale(0);transform-origin:center;opacity:0;transition:background .3s,transform .3s}.evo-radio__input{display:none}.evo-radio__input[disabled]~.evo-radio__element{background-color:#f4f6f8}.evo-radio__input:checked[disabled]~.evo-radio__element{background-color:#fff}.evo-radio__input:checked[disabled]~.evo-radio__element:before{background-color:#c6c6c6}.evo-radio__input:checked~.evo-radio__element:before{transform:scale(1);opacity:1}.evo-radio__content{color:#212121;font-size:14px;line-height:22px;-webkit-user-select:none;user-select:none}\n"] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: EvoRadioComponent, decorators: [{
            type: Component,
            args: [{ selector: 'evo-radio', providers: [
                        {
                            provide: NG_VALUE_ACCESSOR,
                            useExisting: forwardRef(() => EvoRadioComponent),
                            multi: true,
                        },
                    ], template: "<label class=\"evo-radio\">\n    <input class=\"evo-radio__input\"\n           type=\"radio\"\n           (change)=\"handleOnChange()\"\n           [name]=\"name\"\n           [value]=\"value\"\n           [checked]=\"checked\"\n           [disabled]=\"disabled\">\n    <span class=\"evo-radio__element\"></span>\n    <span class=\"evo-radio__content\">\n        <ng-content></ng-content>\n    </span>\n</label>\n", styles: [":host{display:inline-block}.evo-radio{display:flex;align-items:center;cursor:pointer}.evo-radio__element{position:relative;display:block;flex:0 0 20px;width:20px;height:20px;margin:2px 8px 2px 2px;padding:4px;background-color:#fff;border:2px solid #C6C6C6;border-radius:50%;transition:background .3s,border-color .3s}.evo-radio__element:before{content:\"\";position:absolute;top:50%;left:50%;display:block;box-sizing:border-box;width:10px;height:10px;margin-top:-5px;margin-left:-5px;background-color:#0986e2;border-radius:50%;transform:scale(0);transform-origin:center;opacity:0;transition:background .3s,transform .3s}.evo-radio__input{display:none}.evo-radio__input[disabled]~.evo-radio__element{background-color:#f4f6f8}.evo-radio__input:checked[disabled]~.evo-radio__element{background-color:#fff}.evo-radio__input:checked[disabled]~.evo-radio__element:before{background-color:#c6c6c6}.evo-radio__input:checked~.evo-radio__element:before{transform:scale(1);opacity:1}.evo-radio__content{color:#212121;font-size:14px;line-height:22px;-webkit-user-select:none;user-select:none}\n"] }]
        }], propDecorators: { value: [{
                type: Input
            }], name: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXZvLXJhZGlvLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2V2by11aS1raXQvc3JjL2xpYi9jb21wb25lbnRzL2V2by1yYWRpby9ldm8tcmFkaW8uY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvZXZvLXVpLWtpdC9zcmMvbGliL2NvbXBvbmVudHMvZXZvLXJhZGlvL2V2by1yYWRpby5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLFVBQVUsRUFBRSxLQUFLLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDN0QsT0FBTyxFQUF3QixpQkFBaUIsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQ3pFLE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSwrQkFBK0IsQ0FBQzs7QUFjL0QsTUFBTSxPQUFPLGlCQUFrQixTQUFRLGNBQWM7SUFackQ7O1FBa0JJLGFBQVEsR0FBRyxDQUFDLENBQUMsRUFBRSxFQUFFLEdBQUUsQ0FBQyxDQUFDO1FBQ3JCLFlBQU8sR0FBRyxHQUFHLEVBQUUsR0FBRSxDQUFDLENBQUM7S0F5QnRCO0lBdkJHLElBQUksT0FBTztRQUNQLE9BQU8sSUFBSSxDQUFDLE9BQU8sQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxLQUFLLEtBQUssSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDO0lBQ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