"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
exports.__esModule = true;
exports.LoanEditComponent = void 0;
var core_1 = require("@angular/core");
var forms_1 = require("@angular/forms");
var LoanEditComponent = /** @class */ (function () {
    //form access
    //@ViewChild('birthDate', {static: true}) birthDate: LoanEditComponent;
    function LoanEditComponent() {
        //popup
        this.dialogOpened = false;
        this.windowOpened = false;
        //test
        this.somedata = "opened";
        this.min = new Date(2015, 0, 1);
        this.max = new Date(2030, 4, 31);
        this.registerForm = new forms_1.FormGroup({
            transID: new forms_1.FormControl(),
            submissionDate: new forms_1.FormControl(new Date(2020, 0, 10)),
            clientNames: new forms_1.FormControl([1]),
            brokers: new forms_1.FormControl([2]),
            referals: new forms_1.FormControl([3]),
            status: new forms_1.FormControl(),
            lender: new forms_1.FormControl(),
            limit: new forms_1.FormControl(),
            settlementDate: new forms_1.FormControl(new Date(2020, 0, 9))
        });
        this.listLoanStatus = [
            { text: 'John', value: 1 },
            { text: 'Steven', value: 2 },
            { text: 'William', value: 3 }
        ];
        this.statis = { text: 'Female', value: 2 };
    }
    LoanEditComponent.prototype.ngOnInit = function () {
    };
    LoanEditComponent.prototype.close = function (component) {
        this.somedata = "" + Math.random();
        this[component + 'Opened'] = false;
    };
    LoanEditComponent.prototype.open = function (component) {
        //this.somedata = "" + Math.random();
        this[component + 'Opened'] = true;
    };
    LoanEditComponent.prototype.action = function (status) {
        console.log("Dialog result: " + status);
        this.dialogOpened = false;
    };
    LoanEditComponent.prototype.submitForm = function () {
        this.registerForm.markAllAsTouched();
        //this.action('yes');
    };
    LoanEditComponent.prototype.clearForm = function () {
        this.registerForm.reset();
        //this.action('no');
    };
    LoanEditComponent = __decorate([
        core_1.Component({
            selector: 'app-loan-edit',
            templateUrl: './loan-edit.component.html',
            styleUrls: ['./loan-edit.component.scss']
        })
    ], LoanEditComponent);
    return LoanEditComponent;
}());
exports.LoanEditComponent = LoanEditComponent;
