Skip to main content

Comparative Table

This section describes the BfmComparativeTableComponent component.

Usage

If you need more customization, you need to import it in your module and use it in your template.

comparative-table.component.ts
import { BfmComparativeTableComponent } from '@celerofinancas/ui-reports';

@Component({
standalone: true,
selector: 'comparative-table',
imports: [BfmComparativeTableComponent],
templateUrl: './comparative-table.component.html',
})
export class ComparativeTableComponent {}

Then, in your template, you can use the component like this:

comparative-table.component.html
<bfm-comparative-table 
[columnStyle]="columnStyle"
[comparativeObject]="comparativeObject"
[style]="style"
/>

Inputs

The BfmComparativeTableComponent component has the following inputs:

columnStyle

Column Style object for the table

TypeDefault
{}{}

comparativeObject

Object to be iterated and compared

TypeDefault
ComparativeObject{}

style

Style object for the table

TypeDefault
{}{}

isFixed

Controls whether the table is fixed to apply styles

TypeDefault
booleanfalse

Events

The BfmComparativeTableComponent component has no events.

Configuration

To customize the BfmComparativeTableComponent, you can inject configuration tokens in your module.

COMPARATIVE_REPORT_TABLE_CONFIG

This token is used to provide custom configuration for the comparative report table behavior. If not provided, the default values will be used.

Properties

KeyDescriptionDefault
useDirectiveColorDetermines whether to apply directive-specific colors to the table.false
showCustomLineIndicates whether a custom line should be displayed in the comparative table.

Example

app.config.ts
import { ApplicationConfig } from '@angular/core';
import { COMPARATIVE_REPORT_TABLE_CONFIG } from '@celerofinancas/ui-reports';

export const appConfig: ApplicationConfig = {
providers: [
{
provide: COMPARATIVE_REPORT_TABLE_CONFIG,
useValue: {
useDirectiveColor: true,
showCustomLine: true,
},
},
],
};