Amounts Upload
This section describes the BfmAmountsUploadComponent component.
Composition
The BfmAmountsUploadComponent has no any composition component.
Usage
You can import the BfmAmountsUploadComponent directly in your route configuration.
import { BfmAmountsUploadComponent } from "@celerofinancas/ui-cash-flow";
@Component({
standalone: true,
selector: 'amounts-upload',
imports: [BfmAmountsUploadComponent],
templateUrl: './bfm-amounts-upload.component.html',
})
export class AmountsUploadComponent {}
Then, in your template, you can use the component like this:
<bfm-amounts-upload
[addEntriesButtonDescription]="'Adicionar lançamentos por CSV'"
[cancelSendButtonDescription]="'Cancelar envio do CSV'"
[companyPk]="'company-primary-key'"
[disabled]="false"
[downloadFileButtonDescription]="'Baixe o modelo CSV'"
[financialRecordPk]="'financial-record-primary-key'"
(amountsCreated)="handleAmountsCreated($event)"
(patchAmounts)="handlePatchAmounts($event)"
/>
Inputs
The BfmAmountsUploadComponent component has the following inputs:
addEntriesButtonDescription
Add entries button description.
| Type | Default |
|---|---|
string | 'Adicionar lançamentos por CSV' |
cancelSendButtonDescription
Cancel send button description.
| Type | Default |
|---|---|
string | 'Cancelar envio do CSV' |
companyPk
Company PK to which the amounts will be created.
| Type | Default |
|---|---|
string | undefined |
disabled
Disabled state control for the component.
| Type | Default |
|---|---|
boolean | false |
downloadFileButtonDescription
Download file button description.
| Type | Default |
|---|---|
string | 'Baixe o modelo CSV' |
financialRecordPk
Financial record PK to which the amounts will be created.
| Type | Default |
|---|---|
string | undefined |
Events
The BfmAmountsUploadComponent component has the following Events:
amountsCreated
Emits when new amounts are created successfully.
| Type |
|---|
EventEmitter |
patchAmounts
Emits when uploaded CSV needs to be patched back to formArray.
| Type |
|---|
EventEmitter |
Configuration
To customize the BfmAmountsUploadComponent, you can inject the VISIBILITY_AMOUNT_UPLOAD_TOKEN token in your module.
This token is used to provide custom values to the component. If is not provided, the default values will be used.
Properties
| Key | Description |
|---|---|
fileType | Specifies the type of file being uploaded. |
Example
To customize the BfmAmountsUploadComponent, you can inject the VISIBILITY_AMOUNT_UPLOAD_TOKEN token in your module.
import { ApplicationConfig } from '@angular/core';
import { VISIBILITY_AMOUNT_UPLOAD_TOKEN } from '@celerofinancas/ui-cash-flow';
export const appConfig: ApplicationConfig = {
providers: [
{
provide: VISIBILITY_AMOUNT_UPLOAD_TOKEN,
useValue: {
fileType: 'start',
},
},
],
};