import { __decorate, __metadata } from "tslib";
import { FormGroup, FormArray } from '@angular/forms';
import { FormComponentBaseModel } from '@anglr/dynamic/form';
import { ModelPropertyMetadata } from '@anglr/common/forms';
import { mapValuesToThis } from '@jscrpt/common';
export class RadioOptionModel {
    //######################### constructor #########################
    constructor(value) {
        this.code = '';
        this.text = '';
        mapValuesToThis.bind(this)(value);
    }
}
/**
 * Radio model for properties editor
 */
export class RadioModel extends FormComponentBaseModel {
    //######################### constructor #########################
    constructor(value) {
        super(value);
        //######################### public properties #########################
        /**
         * @inheritdoc
         */
        this.options = null;
        mapValuesToThis.bind(this)(value);
        if (this.options?.length) {
            this.options = this.options.map(itm => new RadioOptionModel(itm));
        }
    }
}
__decorate([
    ModelPropertyMetadata({ childType: FormGroup, type: FormArray }),
    __metadata("design:type", Object)
], RadioModel.prototype, "options", void 0);
//# sourceMappingURL=radio.model.js.map