API reference
Tables, formatting and dates
Helpers of BaseDataTable and the formatters for numbers, money and dates.
Formatters follow the current language and NUXT_PUBLIC_DEFAULT_CURRENCY.
useTableFilters()
Resolves filter definitions (range limits from the data), counts active filters and filters items.
useTableFilters(): { resolveFilters: <T>(filters: TableFilter[], items: T[]) => ResolvedTableFilter[]; defaultValue: (filter: ResolvedTableFilter) => TableFilterValue; isFilterActive: (filter: Resol…resolveFiltersdefaultValueisFilterActivecountActiveFiltersnormalizeValuesfilterItemsuseTablePagination()
Builds the page buttons with ellipses and the “1–10 of 243” range.
useTablePagination(): { buildPageItems: (page: number, pageCount: number, siblings?: number) => TablePaginationItem[]; buildRange: (page: number, itemsPerPage: number, itemsLength: number) => TablePagi…buildPageItemsbuildRangeuseTableSorting()
Sort and group helpers for the table menus.
useTableSorting(): { defaultOrder: TableSortOrder; orderOptions: any; toColumnChoices: (headers: TableHeader[], allowedKeys?: string[]) => TableColumnChoice[]; toOrder: (value: unknown) => TableSort…defaultOrderorderOptionstoColumnChoicestoOrdernormalizeSortItemsuseNumberFormat()
currency, number and percent formatters for the current language, plus currencyCode and currencySymbol of NUXT_PUBLIC_DEFAULT_CURRENCY for field affixes such as prefix and suffix.
useNumberFormat(): { currencyCode: any; currencySymbol: any; currency: (value: number, options?: FormatNumberOptions) => string; number: (value: number, options?: FormatNumberOptions) => string; per…currencyCodecurrencySymbolcurrencynumberpercentuseFormatLocale()
The regional locale (formatLocale of APP_LOCALES, such as es-EC) for the current language. Pass it to every Intl formatter instead of the bare i18n code. formatLocaleOf(code) and languageOf(code) resolve the format locale and the page lang (es-419) of any code outside a component.
useFormatLocale(): ComputedRef<string>
formatLocaleOf(code: string): string
languageOf(code: string): string
useDateDay()
Day.js helpers bound to the current language: day(date) and fromNow(date).
useDateDay(): { day: (date?: dayjs.ConfigType) => dayjs.Dayjs; fromNow: (date: dayjs.ConfigType) => string; }dayfromNowuseDayLabel()
Labels a date as Today, Yesterday or relative, after mount so server and browser agree.
useDayLabel(): (date: string, { inline }?: { inline?: boolean; }) => anyuseRelativeDay()
Relative times (“5 min ago”), stamps and day labels that render after mount.
useRelativeDay(): { time: (date: dayjs.ConfigType) => any; stamp: (date: dayjs.ConfigType) => any; dayLabel: (date: dayjs.ConfigType) => any; daysAgo: (date: dayjs.ConfigType) => any; }timestampdayLabeldaysAgouseDashboardPeriod()
The period select of the dashboards (this week, month, quarter or year), kept in a cookie, with the matching comparison labels. Pair it with kpiForPeriod().
useDashboardPeriod(): { period: any; periodItems: any; comparisonLabel: any; previousLabel: any; periodPhrase: any; scale: (value: number) => number; }periodperiodItemscomparisonLabelpreviousLabelperiodPhrasescalekpiForPeriod(kpi: T, period: DashboardPeriod, kind: DashboardMetricKind, base: DashboardPeriod = 'month'): T
...kpivaluepreviousValuechangeseriespreviousSeriesuseKpiCard()
The logic of BaseKpiCard: formatted value, empty state, chart scrubbing and accessible summary.
useKpiCard(props: BaseKpiCardDefaultProps, slotFlags: MaybeRefOrGetter<KpiCardSlotFlags> = {}): { formattedValue: any; displayValue: any; isEmpty: any; isScrubbing: any; scrubCaption: any; showChart: any; haveChart: any; chartSummary: any; previousValueText: any; onScrub: (i…formattedValuedisplayValueisEmptyisScrubbingscrubCaptionshowCharthaveChartchartSummarypreviousValueTextonScrub