|
|
|
@ -15,6 +15,7 @@ import {
|
|
|
|
|
})
|
|
|
|
|
export class DragDropComponent implements OnChanges {
|
|
|
|
|
@Input() initialFiles: string[] = [];
|
|
|
|
|
@Input() errorMessage: string = '';
|
|
|
|
|
fileNames: string[] = [];
|
|
|
|
|
@Output() filesSelected = new EventEmitter<FileList>();
|
|
|
|
|
@Output() fileRemoved = new EventEmitter<string>();
|
|
|
|
@ -61,9 +62,8 @@ export class DragDropComponent implements OnChanges {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private updateFileNames(files: FileList): void {
|
|
|
|
|
for (let i = 0; i < files.length; i++) {
|
|
|
|
|
this.fileNames.push(files[i].name);
|
|
|
|
|
}
|
|
|
|
|
const newFileNames = Array.from(files).map(file => file.name);
|
|
|
|
|
this.fileNames = [...this.fileNames, ...newFileNames];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
removeFile(fileName: string, event: Event): void {
|
|
|
|
|