Skip to main content

Results Period Filter

This section describes the BfmResultsPeriodFilterComponent component.

Usage​

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

results-period-filter.component.ts
import { BfmResultsPeriodFilterComponent } from '@celerofinancas/ui-reports';

@Component({
standalone: true,
selector: 'results-period-filter',
imports: [BfmResultsPeriodFilterComponent],
templateUrl: './results-period-filter.component.html',
})
export class ResultsPeriodFilterComponent {}

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

results-period-filter.component.html
<bfm-results-period-filter
[companyPk]="'companyPkValue'"
[filterText]="'Analisar'"
[header]="'Selecione o período de análise'"
[showCostCenter]="false"
(periodSelected)="handlePeriodSelected($event)"
/>

Inputs​

The BfmResultsPeriodFilterComponent component has the following inputs:

companyPk​

Company primary key

TypeDefault
string''

filterText​

Filter text label

TypeDefault
string'Analisar'

Header text

TypeDefault
string'Selecione o período de análise'

showCostCenter​

Show cost center filter

TypeDefault
booleanfalse

textCostCenter​

Text for the cost center label

TypeDefault
string'Centro de Custo'

showCostCenterTooltipRight​

Whether to show the cost center tooltip on the Right side

TypeDefault
booleanfalse

costCenterTooltipRightText​

Tooltip text for the cost center filter when shown on the Right side

TypeDefault
string''

Events​

The BfmResultsPeriodFilterComponent component has the following events:

periodSelected​

Emits the selected filters

Type
EventEmitter<any>

TOKEN RESULTS_PERIOD_FILTER_CONFIG​

To customize the BfmResultsPeriodFilterComponent, you can inject the RESULTS_PERIOD_FILTER_CONFIG 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​

KeyDescriptionDefault
selectPeriodLabelLabel for the period selection'Selecione o período de análise'
showCostCenterWhether to show the cost center filterfalse
showCostCenterTooltipWhether to show the cost center tooltipfalse
costCenterTooltipTextTooltip text for the cost center filter'Você pode criar um Centro de Custo para organizar e acompanhar entradas e saidas de dinheiro da empresa por área, projeto ou finalidade'
buttonFilterTextText for the filter button'Analisar'
useQueryParamsWhether to use query parameters for the selected tab and filterstrue
textCostCenterText for the cost center tooltip'Centro de Custo'
showCostCenterTooltipRightWhether to show the cost center tooltip on the Right side-
costCenterTooltipRightTextTooltip text for the cost center filter when shown on the Right side-

The RESULTS_PERIOD_FILTER_CONFIG default values are:


export const RESULTS_PERIOD_FILTER_CONFIG = {
selectPeriodLabel: 'Selecione o período de análise',
showCostCenter: false,
showCostCenterTooltip: false,
costCenterTooltipText: 'Você pode criar um Centro de Custo para organizar e acompanhar entradas e saidas de dinheiro da empresa por área, projeto ou finalidade',
buttonFilterText: 'Analisar',
useQueryParams: true,
textCostCenter: 'Centro de Custo',
};

Example​

results-period-filter.component.ts

import { Component } from '@angular/core';

import { BfmResultsPeriodFilterComponent } from '@celerofinancas/ui-reports';
import { RESULTS_PERIOD_FILTER_CONFIG } from '@celerofinancas/ui-reports';

@Component({
standalone: true,
selector: 'results-period-filter',
imports: [BfmResultsPeriodFilterComponent],
templateUrl: './results-period-filter.component.html',
providers: [
{
provide: RESULTS_PERIOD_FILTER_CONFIG,
useValue: {
selectPeriodLabel: 'Selecione o período de análise',
showCostCenter: false,
showCostCenterTooltip: false,
costCenterTooltipText: 'Você pode criar um Centro de Custo para organizar e acompanhar entradas e saidas de dinheiro da empresa por área, projeto ou finalidade',
buttonFilterText: 'Analisar',
useQueryParams: true,
textCostCenter: 'Setor/Projeto',
showCostCenterTooltipRight: true,
costCenterTooltipRightText: 'Texto que será apresentando no tooltip a direita'
},
},
],
})
export class ResultsPeriodFilterComponent {
handlePeriodSelected(event: any) {
console.log('Selected period:', event);
}
}
results-period-filter.component.html
<bfm-results-period-filter
[companyPk]="'companyPkValue'"
[filterText]="'Analisar'"
[header]="'Selecione o período de análise'"
[showCostCenter]="false"
(periodSelected)="handlePeriodSelected($event)"
/>