1 import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'
2 import { FormControl, FormGroup } from '@angular/forms'
3 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
6 selector: 'pngx-save-view-config-dialog',
7 templateUrl: './save-view-config-dialog.component.html',
8 styleUrls: ['./save-view-config-dialog.component.scss'],
10 export class SaveViewConfigDialogComponent implements OnInit {
11 constructor(private modal: NgbActiveModal) {}
14 public saveClicked = new EventEmitter()
27 return this._defaultName
31 set defaultName(value: string) {
32 this._defaultName = value
33 this.saveViewConfigForm.patchValue({ name: value })
36 saveViewConfigForm = new FormGroup({
37 name: new FormControl(''),
38 showInSideBar: new FormControl(false),
39 showOnDashboard: new FormControl(false),
43 // wait to enable close button so it doesn't steal focus from input since its the first clickable element in the DOM
45 this.closeEnabled = true
50 this.saveClicked.emit(this.saveViewConfigForm.value)