@@ -22,6 +22,7 @@ import { FontAwesomeModule } from "@fortawesome/angular-fontawesome";
2222import { ErrorHintComponent } from "../../../core/common-components/error-hint/error-hint.component" ;
2323import { NotAvailableOfflineError } from "../../../core/session/not-available-offline.error" ;
2424import { NAVIGATOR_TOKEN } from "../../../utils/di-tokens" ;
25+ import { FileFieldConfig } from "../file.datatype" ;
2526
2627/**
2728 * This component should be used as a `editComponent` when a property should store files.
@@ -51,6 +52,18 @@ export class EditFileComponent extends EditComponent<string> implements OnInit {
5152 private removeClicked = false ;
5253 initialValue : string ;
5354
55+ /**
56+ * config for the given form field / entity attribute, containing special settings for this component.
57+ * (re-declared here for better typing)
58+ */
59+ declare additional : FileFieldConfig ;
60+
61+ /**
62+ * The accepted file types for file selection dialog.
63+ * If not defined, allows any file.
64+ */
65+ acceptedFileTypes : string = "*" ;
66+
5467 constructor (
5568 protected fileService : FileService ,
5669 private alertService : AlertService ,
@@ -63,6 +76,10 @@ export class EditFileComponent extends EditComponent<string> implements OnInit {
6376 override ngOnInit ( ) {
6477 super . ngOnInit ( ) ;
6578 this . initialValue = this . formControl . value ;
79+
80+ this . acceptedFileTypes =
81+ this . additional ?. acceptedFileTypes ?? this . acceptedFileTypes ;
82+
6683 this . formControl . statusChanges
6784 . pipe (
6885 distinctUntilChanged ( ) ,
0 commit comments