@factorialco/f0-react 4.32.0 → 4.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/f0.d.ts +7 -0
- package/dist/f0.js +1 -1
- package/package.json +1 -1
package/dist/f0.d.ts
CHANGED
|
@@ -3702,6 +3702,13 @@ export declare interface DashboardMetricItem<Filters extends FiltersDefinition =
|
|
|
3702
3702
|
format?: MetricFormat;
|
|
3703
3703
|
/** Number of decimal places. @default 0 */
|
|
3704
3704
|
decimals?: number;
|
|
3705
|
+
/**
|
|
3706
|
+
* Custom value formatter — takes precedence over `format`/`decimals`.
|
|
3707
|
+
* The built-in presets format with the browser locale; this lets the
|
|
3708
|
+
* consumer control locale and currency, mirroring the chart configs'
|
|
3709
|
+
* `valueFormatter`.
|
|
3710
|
+
*/
|
|
3711
|
+
valueFormatter?: (value: number) => string;
|
|
3705
3712
|
/** Async data fetcher — receives dashboard filters */
|
|
3706
3713
|
fetchData: (filters: FiltersState<Filters>) => Promise<DashboardMetricData>;
|
|
3707
3714
|
}
|
package/dist/f0.js
CHANGED
|
@@ -81496,7 +81496,7 @@ function MetricItem({
|
|
|
81496
81496
|
handleDelete: L,
|
|
81497
81497
|
itemId: T.id,
|
|
81498
81498
|
children: X && /* @__PURE__ */ jsx("div", { className: "flex h-full min-h-0 items-end overflow-auto px-4 pb-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-baseline gap-3", children: [
|
|
81499
|
-
/* @__PURE__ */ jsx("span", { className: "whitespace-nowrap text-4xl font-semibold leading-none tracking-tight text-f1-foreground", children: formatValue(X.value, T.format, T.decimals) }),
|
|
81499
|
+
/* @__PURE__ */ jsx("span", { className: "whitespace-nowrap text-4xl font-semibold leading-none tracking-tight text-f1-foreground", children: T.valueFormatter ? T.valueFormatter(X.value) : formatValue(X.value, T.format, T.decimals) }),
|
|
81500
81500
|
R && R.direction !== "flat" && /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center", children: [
|
|
81501
81501
|
R.direction === "up" ? /* @__PURE__ */ jsx(F0Icon, { icon: ForwardRef$O, color: "positive", size: "sm" }) : /* @__PURE__ */ jsx(F0Icon, { icon: ForwardRef$P, color: "critical", size: "sm" }),
|
|
81502
81502
|
/* @__PURE__ */ jsxs(
|