41 lines
1007 B
TypeScript
Raw Normal View History

import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { ucapAnimations } from '../../animations';
import { FileEventJson } from '@ucap-webmessenger/protocol-event';
import { DeviceType } from '@ucap-webmessenger/core';
2019-11-13 15:28:33 +09:00
import { FileDownloadItem } from '@ucap-webmessenger/api-common';
@Component({
selector: 'ucap-binary-viewer',
templateUrl: './binary-viewer.component.html',
styleUrls: ['./binary-viewer.component.scss'],
2019-11-13 15:28:33 +09:00
animations: ucapAnimations,
})
export class BinaryViewerComponent implements OnInit {
@Input()
fileInfo: FileEventJson;
@Input()
2019-11-07 13:48:25 +09:00
fileDownloadUrl: string;
2019-11-06 18:19:37 +09:00
@Output()
2019-11-13 15:28:33 +09:00
download = new EventEmitter<FileDownloadItem>();
2019-11-06 18:19:37 +09:00
@Output()
closed = new EventEmitter<void>();
2019-11-13 15:28:33 +09:00
fileDownloadItem: FileDownloadItem;
constructor() {}
2019-11-06 18:19:37 +09:00
ngOnInit() {}
2019-11-06 18:19:37 +09:00
2019-11-07 15:59:50 +09:00
onClickDownload(): void {
2019-11-13 15:28:33 +09:00
this.fileDownloadItem = new FileDownloadItem();
this.download.emit(this.fileDownloadItem);
2019-11-07 15:59:50 +09:00
}
2019-11-06 18:19:37 +09:00
onClickClose(): void {
this.closed.emit();
}
}