File Upload
This section describes the BfmFileUploadComponent component.
Composition
The BfmFileUploadComponent has no any composition component.
Usage
You need to import it in your module and use it in your template.
import { BfmFileUploadComponent } from '@celerofinancas/ui-cash-flow';
@Component({
standalone: true,
selector: 'bfm-file-upload',
templateUrl: './file-upload.component.html',
styleUrls: ['./file-upload.component.scss'],
imports: [BfmFileUploadComponent],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class FileUploadComponent {}
Then, in your template, you can use the component like this:
<bfm-file-upload
[csvExampleSrc]="'example.csv'"
[fileExtensions]="['.csv', '.xls']"
[form]="uploadForm"
[loading]="isLoading"
[sendButtonLabel]="'Send File'"
(submitFile)="handleSubmitFile($event)"
/>
Inputs
The BfmFileUploadComponent component has the following inputs:
csvExampleSrc
Source URL for the CSV example file.
| Type | Default |
|---|---|
string | '' |
fileExtensions
Array of allowed file extensions.
| Type | Default |
|---|---|
string[] | ['.csv'] |
form
Form group to be used in the file upload.
| Type | Default |
|---|---|
FormGroup | new FormGroup({}) |
loading
Flag to indicate if the component is in a loading state.
| Type | Default |
|---|---|
boolean | false |
sendButtonLabel
Label for the send file button.
| Type | Default |
|---|---|
string | 'Enviar arquivo' |
Events
The BfmFileUploadComponent component has the following events:
submitFile
Event emitted when the user submits a file.
| Type |
|---|
EventEmitter<File> |