import { Component } from '@angular/core';
import { FormControl } from '@angular/forms';
import { BaseControl } from '../basecontrol';
import * as i0 from "@angular/core";
import * as i1 from "../../service/common.service";
import * as i2 from "../form-box/form-box.component";
import * as i3 from "ng-devui";
import * as i4 from "@angular/common";
import * as i5 from "@angular/forms";
export class FormRadioComponent extends BaseControl {
    constructor(commonService) {
        super(commonService);
        this.commonService = commonService;
        this.control = new FormControl();
    }
    ngOnInit() {
        this.getData();
        this.commonService.testEvent.subscribe(o => {
            if (o == this.data.name) {
                this.getData();
            }
        });
    }
    getData() {
        this.commonService.getTheData(this.data)?.subscribe(o => {
            var res = null;
            eval("res =" + this.data.postdata.function);
            this.data.options = res(o);
        });
    }
}
FormRadioComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: FormRadioComponent, deps: [{ token: i1.CommonService }], target: i0.ɵɵFactoryTarget.Component });
FormRadioComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.6", type: FormRadioComponent, selector: "form-radio", usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"data.mode=='op'; else detail\">\r\n    <form-box #box [mainCarry]=\"detail\" [name]=\"data.name\" [controltype]=\"data.controltype\" (controlclick)=\"onClick($event)\"></form-box>\r\n</ng-container>\r\n<ng-template #detail>\r\n    <d-form-item>\r\n        <d-form-label [required]=\"data.required\" [hasHelp]=\"data.help\" [helpTips]=\"data.helptip||''\">{{data.label}}</d-form-label>\r\n        <d-form-control>\r\n            <d-radio-group \r\n            [formControl]=\"control\"\r\n            [(ngModel)]=\"data.defaultvalue\" \r\n            [disabled]=\"data.disabled\" \r\n            [attr.name]=\"data.controlname\" \r\n            [values]=\"data.options\" \r\n            [direction]=\"data.direction\" \r\n            [dValidateRules]=\"data.rules\">\r\n            </d-radio-group>\r\n        </d-form-control>\r\n    </d-form-item>\r\n</ng-template>", styles: [""], components: [{ type: i2.FormBoxComponent, selector: "form-box", inputs: ["mainCarry", "name", "controltype", "additionalcss"], outputs: ["controlclick"] }, { type: i3.FormItemComponent, selector: "d-form-item", inputs: ["dFeedbackType", "dHasFeedback"] }, { type: i3.FormLabelComponent, selector: "d-form-label", inputs: ["required", "hasHelp", "helpTips"] }, { type: i3.FormControlComponent, selector: "d-form-control", inputs: ["extraInfo", "feedbackStatus", "suffixTemplate"] }, { type: i3.RadioGroupComponent, selector: "d-radio-group", inputs: ["name", "values", "cssStyle", "direction", "disabled", "beforeChange"], outputs: ["change"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.DFormControlRuleDirective, selector: "[dValidateRules][formControlName],[dValidateRules][ngModel],[dValidateRules][formControl]", inputs: ["dValidateRules", "dValidatePopConfig"], outputs: ["dRulesStatusChange"], exportAs: ["dValidateRules"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: FormRadioComponent, decorators: [{
            type: Component,
            args: [{ selector: 'form-radio', template: "<ng-container *ngIf=\"data.mode=='op'; else detail\">\r\n    <form-box #box [mainCarry]=\"detail\" [name]=\"data.name\" [controltype]=\"data.controltype\" (controlclick)=\"onClick($event)\"></form-box>\r\n</ng-container>\r\n<ng-template #detail>\r\n    <d-form-item>\r\n        <d-form-label [required]=\"data.required\" [hasHelp]=\"data.help\" [helpTips]=\"data.helptip||''\">{{data.label}}</d-form-label>\r\n        <d-form-control>\r\n            <d-radio-group \r\n            [formControl]=\"control\"\r\n            [(ngModel)]=\"data.defaultvalue\" \r\n            [disabled]=\"data.disabled\" \r\n            [attr.name]=\"data.controlname\" \r\n            [values]=\"data.options\" \r\n            [direction]=\"data.direction\" \r\n            [dValidateRules]=\"data.rules\">\r\n            </d-radio-group>\r\n        </d-form-control>\r\n    </d-form-item>\r\n</ng-template>", styles: [""] }]
        }], ctorParameters: function () { return [{ type: i1.CommonService }]; } });
//# sourceMappingURL=data:application/json;base64, 