/*
 * Copyright (C) 2019 Robert Bosch GmbH Copyright (C) 2019 Robert Bosch Manufacturing Solutions GmbH, Germany. All rights reserved.
 */

import { Component } from '@angular/core';
import {FormBuilder, Validators} from '@angular/forms';
import { MatDialog } from '@angular/material/dialog';
import { ModalWindowService } from '@bci-web-core/core';
import { StepperDialogComponent } from './stepper-dialog/stepper-dialog.component';


@Component({
  selector: 'bci-stepper-demo',
  templateUrl: 'stepper-demo.html',
  styleUrls: ['stepper-demo.scss'],
})
export class StepperDemoComponent {
  firstFormGroup = this._formBuilder.group({
    firstCtrl: ['', Validators.required],
  });
  secondFormGroup = this._formBuilder.group({
    secondCtrl: ['', Validators.required],
  });

  firstForm2Group = this._formBuilder.group({
    firstCtrl: ['', Validators.required],
  });
  secondForm2Group = this._formBuilder.group({
    secondCtrl: ['', Validators.required],
  });

  constructor(private _formBuilder: FormBuilder,
    private _modalWindowService: ModalWindowService,private _matDialog: MatDialog) {}

  openStepperInsideModal(): void {
    this._modalWindowService
      .openDialogWithComponent(StepperDialogComponent, {
        width: "816px",
        maxWidth: "90%",
      }, this._matDialog)
      .afterClosed()
      .subscribe((data) => {
       console.log(JSON.stringify(data, undefined, 2));
      });
  }
}
