46 lines
994 B
TypeScript
46 lines
994 B
TypeScript
import { Subject } from 'rxjs';
|
|
|
|
import {
|
|
Component,
|
|
OnInit,
|
|
OnDestroy,
|
|
ChangeDetectionStrategy,
|
|
ChangeDetectorRef,
|
|
Input,
|
|
EventEmitter,
|
|
Output
|
|
} from '@angular/core';
|
|
|
|
@Component({
|
|
selector: 'app-layouts-default-dialog',
|
|
templateUrl: './default-dialog.layout.component.html',
|
|
styleUrls: ['./default-dialog.layout.component.scss'],
|
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
})
|
|
export class DefaultDialogLayoutComponent implements OnInit, OnDestroy {
|
|
@Input()
|
|
disableClose = false;
|
|
|
|
@Output()
|
|
closed = new EventEmitter<MouseEvent>();
|
|
|
|
constructor(private changeDetectorRef: ChangeDetectorRef) {}
|
|
|
|
private ngOnDestroySubject: Subject<boolean>;
|
|
|
|
ngOnInit(): void {
|
|
this.ngOnDestroySubject = new Subject<boolean>();
|
|
}
|
|
|
|
ngOnDestroy(): void {
|
|
if (!!this.ngOnDestroySubject) {
|
|
this.ngOnDestroySubject.next();
|
|
this.ngOnDestroySubject.complete();
|
|
}
|
|
}
|
|
|
|
onClickClose(event: MouseEvent): void {
|
|
this.closed.emit(event);
|
|
}
|
|
}
|