Skip to main content

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.

bfm-amounts-upload.component.html
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.component.html
<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.

TypeDefault
string'Adicionar lançamentos por CSV'

cancelSendButtonDescription

Cancel send button description.

TypeDefault
string'Cancelar envio do CSV'

companyPk

Company PK to which the amounts will be created.

TypeDefault
stringundefined

disabled

Disabled state control for the component.

TypeDefault
booleanfalse

downloadFileButtonDescription

Download file button description.

TypeDefault
string'Baixe o modelo CSV'

financialRecordPk

Financial record PK to which the amounts will be created.

TypeDefault
stringundefined

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

KeyDescription
fileTypeSpecifies the type of file being uploaded.

Example

To customize the BfmAmountsUploadComponent, you can inject the VISIBILITY_AMOUNT_UPLOAD_TOKEN token in your module.

app.config.ts
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',
},
},
],
};