Skip to main content

Accounts Modal

The Accounts Modal lists every linked bank account of the active company ("Contas bancárias vinculadas"). It shows the balance totals, lets the user search and sort the accounts, rename them, choose which ones are shown on the home header and connect more accounts. When the accounts list fails to load, it shows an error state with a retry button.

The modal has a single template. White labels customize it only through the ACCOUNT_MODAL_CONFIG_TOKEN and the style API. Without configuration it renders the default layout.

AccountsModalComponent

This section describes the AccountsModalComponent component (bfm-accounts-modal).

Composition​

The AccountsModalComponent is composed of the following components:

Usage​

The modal is opened by the List Header when the user clicks the arrow at the end of the accounts list, so you do not open it directly. To customize it, provide the ACCOUNT_MODAL_CONFIG_TOKEN:

info

Modals are not components. They must be used with the ModalService to be opened.

To a better understanding, check the Modals documentation.

app.config.ts
import { ApplicationConfig } from '@angular/core';
import { ACCOUNT_MODAL_CONFIG_TOKEN } from '@celerofinancas/common-domain';

export const appConfig: ApplicationConfig = {
providers: [
{
provide: ACCOUNT_MODAL_CONFIG_TOKEN,
useValue: {
partnerName: 'Celero',
onclick: () => window.open('https://example.com/open-finance', '_blank'),
},
},
],
};

Inputs​

The AccountsModalComponent modalRef has no inputs. Everything is configured through the ACCOUNT_MODAL_CONFIG_TOKEN.

Events​

The AccountsModalComponent modalRef has no events. The "Conectar mais contas" action is the onclick of the ACCOUNT_MODAL_CONFIG_TOKEN.

Configuration​

ACCOUNT_MODAL_CONFIG_TOKEN​

This token provides the AccountModalConfig of the modal. Every property is optional; the ones not provided keep the default value.

Properties​

KeyDescriptionDefault
onclickAction of the "Conectar mais contas" button.() => {}
additionalFiltersExtra filters merged into every accounts list request.[]
partnerNamePartner name used by the default subtitle and scope tooltip ([PartnerName] e Open Finance). When empty, only "Open Finance" is shown.''
copyTexts of the modal. Merged field by field with the defaults, also inside totals, balanceTooltips, headers and error. See copy.Default texts
columnsTable columns. Replaces the default list. See columns.7 default columns
totalsTotals shown above the table. Replaces the default list. Available: available, blocked, automaticInvestment.['available', 'blocked']
iconsIcon font classes, merged field by field. See icons.See icons
loadingFirst page loading placeholder: { count, height }.{ count: 5, height: '64px' }
slotsComponents rendered in each region of the modal. Each listed slot replaces its default. See slots.See slots

copy​

KeyDescriptionDefault
titleModal title.Contas bancárias vinculadas
subtitle(partnerName, count) => string[PartnerName] e Open Finance (N contas)
scopeTooltip(partnerName) => string, tooltip of the subtitle.Explains which accounts are shown
searchPlaceholderPlaceholder of the search input.Pesquise por nº da conta ou banco
searchButtonText of the "Buscar" button and label of the search icon.Buscar
connectAccountsText of the connect button.Conectar mais contas
lastUpdateNoteNote below the table and tooltip of the "Última atualização" column.Last update explanation
totalsLabel of each total (available, blocked, automaticInvestment).Saldo disponível, Saldo bloqueado, Saldo com aplicação automática
balanceTooltipsTooltip of each total. An empty string hides the info icon of that total.One tooltip per total
headersHeader of each column, by column name.See columns
errortitle, description and retry texts of the error state.Algo deu errado, Não foi possível carregar as informações agora. Tente de novo em instantes., Atualizar página

columns​

Each column is { name, valueRef, align?, orderByfilter? }. valueRef is the field sent as order_by when orderByfilter is true.

nameDefault headerIn the default list
bank_idBancoYes
agency_accountAgência ContaYes
nameApelidoYes
available_balanceSaldo disponívelYes
blocked_balanceSaldo bloqueadoYes
last_statement_atÚltima atualizaçãoYes
to_showMostrar no inícioYes
agencyAgNo
accountContaNo
automatic_investment_balanceSaldo aplicado automaticamenteNo

icons​

The icons are classes of the Design System icon font, so each white label changes the glyphs by swapping the icon font (--cds-icon-font-family) in its custom layer. See Using custom icons. Extra classes are allowed (e.g. 'c-icon-medium cds-icon-search').

KeyDescriptionDefault
infoInfo icon of the tooltips.cds-icon-exclamation-circle
lockedIcon of the blocked balance total.cds-icon-padlock-stroke
searchIcon inside the search input.cds-icon-search
retryIcon of the "Atualizar página" button.cds-icon-refresh

slots​

Slots are fixed regions of the modal. Each one renders, in order, the components listed for it. A slot with an empty list renders nothing, and the footer is hidden when both footer slots are empty.

SlotRegionDefault
headerEndRight of the title[]
searchEndAfter the search input[]
afterTableBelow the table[AccountsModalLastUpdateNoteComponent]
footerStartLeft side of the footer[AccountsModalConnectButtonComponent]
footerEndRight side of the footer[]
errorBody shown when the list fails to load[AccountsModalErrorStateComponent]

Slot components can be the ones exported by the library or your own: they inject the AccountsModalContext to read the resolved configuration (config) and to call the modal (search(), retry()).

Example​

A white label that keeps the connect button on the header, adds the "Buscar" button, shows separate agency and account columns and hides the last update note:

app.config.ts
import { ApplicationConfig } from '@angular/core';
import {
ACCOUNT_MODAL_CONFIG_TOKEN,
AccountsModalConnectButtonComponent,
AccountsModalSearchButtonComponent,
} from '@celerofinancas/common-domain';

export const appConfig: ApplicationConfig = {
providers: [
{
provide: ACCOUNT_MODAL_CONFIG_TOKEN,
useValue: {
partnerName: 'Partner',
onclick: () => window.open('https://example.com/open-finance', '_blank'),
additionalFilters: [{ priority_bank_id: '104' }],
copy: {
title: 'Contas vinculadas | Partner e Open Finance',
subtitle: (_partnerName, count) => `(${count} Contas)`,
balanceTooltips: { available: '', blocked: '' },
headers: { to_show: 'Mostrar no cabeçalho' },
},
columns: [
{ name: 'bank_id', align: 'center', orderByfilter: false, valueRef: 'bank_id' },
{ name: 'agency', align: 'left', orderByfilter: false, valueRef: 'agency' },
{ name: 'account', align: 'left', orderByfilter: true, valueRef: 'bank_account' },
{ name: 'name', align: 'left', orderByfilter: false, valueRef: 'name' },
{ name: 'available_balance', align: 'right', orderByfilter: false, valueRef: 'bank_account_current_balance' },
{ name: 'blocked_balance', align: 'right', orderByfilter: false, valueRef: 'blocked_balance' },
{ name: 'to_show', align: 'center', orderByfilter: false, valueRef: 'to_show' },
],
loading: { count: 3, height: '135px' },
slots: {
headerEnd: [AccountsModalConnectButtonComponent],
searchEnd: [AccountsModalSearchButtonComponent],
afterTable: [],
footerStart: [],
},
},
},
],
};

Style API​

The classes and custom properties below are a public contract: renaming them is a breaking change. Use them in your custom layer to adapt the layout.

Classes​

ClassElement
.accounts-modal-header (__text, __title, __subtitle)Header with title and subtitle
.accounts-modal-slot--{header-end|search-end|after-table|footer-start|footer-end|error}Slot regions
.accounts-totals, .accounts-total (__label, __value)Balance totals
.accounts-search-row, .accounts-search (__input, __icon)Search
.accounts-table (__row, __row--body, __header, __cell)Accounts table
.accounts-modal-footerFooter
.accounts-modal-errorError state container
.accounts-modal-connect-button, .accounts-modal-search-button, .accounts-last-update-noteSlot components

Custom properties​

Set them on the bfm-accounts-modal element. The modal only reads them with fallbacks, so the values below apply when they are not set.

PropertyDescriptionDefault
--accounts-modal-widthModal width.1020px
--accounts-modal-table-heightTable height; the header stays fixed while the rows scroll.398px
--accounts-modal-columnsGrid columns of the table. All rows share them (subgrid).63px 97px minmax(160px, 1fr) minmax(115px, max-content) minmax(115px, max-content) 105px 85px
--accounts-modal-header-bgBackground of the table header.var(--cds-background-accent)
--accounts-modal-row-bg-evenBackground of the even rows (striped table).transparent
--accounts-modal-locked-colorColor of the blocked balance icon.#ffa608
modal-base.component.scss
:host ::ng-deep bfm-accounts-modal {
--accounts-modal-width : 1280px;
--accounts-modal-columns : 1fr 1fr 2fr 2fr 2fr 2fr 2fr;
--accounts-modal-row-bg-even : var(--cds-background-accent);
}

AccountItemModalComponent

Renders one cell of an account row (bfm-account-item-modal), according to the column name. It handles the nickname edition and the "Mostrar no início" toggle. It is used internally by the AccountsModalComponent.

AccountsModalConnectButtonComponent

"Conectar mais contas" button (bfm-accounts-modal-connect-button). Runs the onclick of the configuration. Default component of the footerStart slot.

AccountsModalErrorStateComponent

Error state (bfm-accounts-modal-error-state) with an illustration, the copy.error texts and the "Atualizar página" button, which reloads the list with the last applied filters. Default component of the error slot.

AccountsModalLastUpdateNoteComponent

Note below the table (bfm-accounts-modal-last-update-note) with the copy.lastUpdateNote text. Default component of the afterTable slot.

AccountsModalSearchButtonComponent

"Buscar" button (bfm-accounts-modal-search-button). Searches with the current input value. It is not in any slot by default; add it to the searchEnd slot when needed.