@embeddable.com/remarkable-ui 2.0.45 → 2.0.46

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/index.d.ts CHANGED
@@ -84,6 +84,11 @@ type KpiChartProps = {
84
84
  valueFormatter?: (value: number) => string;
85
85
  };
86
86
 
87
+ declare const getKpiDisplayValue: ({ value, displayNullAs, valueFormatter, }: {
88
+ value: number | null | undefined;
89
+ displayNullAs: string | number;
90
+ valueFormatter?: (value: number) => string;
91
+ }) => string | number;
87
92
  declare const KpiChart: FC<KpiChartProps>;
88
93
 
89
94
  type PieChartConfigurationProps = {
@@ -597,4 +602,4 @@ declare const endOfDayUTC: (date: Date) => Date;
597
602
 
598
603
  declare const shallowEqual: (object1: any, object2: any) => boolean;
599
604
 
600
- export { ActionIcon, BarChart, type BarChartProps, Button, ButtonIcon, Card, CardContent, CardFeedback, CardHeader, type CssSize, DateRangePicker, DateRangePickerField, type DateRangePickerProps, Divider, DonutChart, type DonutLabelChartProps, Dropdown, type DropdownProps, FieldFeedback, type FieldFeedbackProps, FieldHeader, type FieldHeaderProps, GhostButton, GhostButtonIcon, HeatMap, type HeatMapProps, type HeatMapPropsDimension, type HeatMapPropsMeasure, type HeatMapPropsThreshold, KpiChart, LineChart, type LineChartProps, Markdown, MarkdownEditor, MultiSelectField, type MultiSelectFieldProps, NumberField, Overlay, PieChart, type PieChartProps, PivotTable, type PivotTableProps, type PivotTablePropsColumnDimension, type PivotTablePropsMeasure, type PivotTablePropsRowDimension, SelectFieldCategory, SelectFieldContent, SelectFieldContentList, SelectFieldTrigger, SelectListOption, type SelectListOptionProps, type SelectListOptionPropsWithCategory, SingleSelectField, type SingleSelectFieldProps, Skeleton, StylesKeys, Switch, TableBody, TableBodyCellWithCopy, type TableBodyProps, TableHeader, TableHeaderAlign, type TableHeaderCell, type TableHeaderCellStyle, type TableHeaderItem, type TableHeaderItemAlign, type TableHeaderProps, TablePaginated, type TablePaginatedProps, TablePagination, type TablePaginationProps, TableScrollable, type TableScrollableHandle, type TableScrollableProps, type TableSort, TableSortDirection, TextField, Tooltip, Typography, chartjsAxisOptionsLayoutPadding, chartjsAxisOptionsLayoutPaddingLarge, endOfDayUTC, getBarChartData, getBarChartOptions, getChartColors, getChartjsAxisOptions, getChartjsAxisOptionsPlugins, getChartjsAxisOptionsScales, getChartjsAxisOptionsScalesGrid, getChartjsAxisOptionsScalesGridColor, getChartjsAxisOptionsScalesTicksDefault, getChartjsAxisOptionsScalesTicksMuted, getChartjsAxisOptionsScalesTitle, getDonutChartOptions, getLineChartData, getLineChartOptions, getPieChartData, getPieChartOptions, getStyle, getStyleNumber, getTableTotalPages, isSameDate, isSameDateRange, shallowEqual, useDebounce, useResizeObserver, useTableGetRowsPerPage };
605
+ export { ActionIcon, BarChart, type BarChartProps, Button, ButtonIcon, Card, CardContent, CardFeedback, CardHeader, type CssSize, DateRangePicker, DateRangePickerField, type DateRangePickerProps, Divider, DonutChart, type DonutLabelChartProps, Dropdown, type DropdownProps, FieldFeedback, type FieldFeedbackProps, FieldHeader, type FieldHeaderProps, GhostButton, GhostButtonIcon, HeatMap, type HeatMapProps, type HeatMapPropsDimension, type HeatMapPropsMeasure, type HeatMapPropsThreshold, KpiChart, LineChart, type LineChartProps, Markdown, MarkdownEditor, MultiSelectField, type MultiSelectFieldProps, NumberField, Overlay, PieChart, type PieChartProps, PivotTable, type PivotTableProps, type PivotTablePropsColumnDimension, type PivotTablePropsMeasure, type PivotTablePropsRowDimension, SelectFieldCategory, SelectFieldContent, SelectFieldContentList, SelectFieldTrigger, SelectListOption, type SelectListOptionProps, type SelectListOptionPropsWithCategory, SingleSelectField, type SingleSelectFieldProps, Skeleton, StylesKeys, Switch, TableBody, TableBodyCellWithCopy, type TableBodyProps, TableHeader, TableHeaderAlign, type TableHeaderCell, type TableHeaderCellStyle, type TableHeaderItem, type TableHeaderItemAlign, type TableHeaderProps, TablePaginated, type TablePaginatedProps, TablePagination, type TablePaginationProps, TableScrollable, type TableScrollableHandle, type TableScrollableProps, type TableSort, TableSortDirection, TextField, Tooltip, Typography, chartjsAxisOptionsLayoutPadding, chartjsAxisOptionsLayoutPaddingLarge, endOfDayUTC, getBarChartData, getBarChartOptions, getChartColors, getChartjsAxisOptions, getChartjsAxisOptionsPlugins, getChartjsAxisOptionsScales, getChartjsAxisOptionsScalesGrid, getChartjsAxisOptionsScalesGridColor, getChartjsAxisOptionsScalesTicksDefault, getChartjsAxisOptionsScalesTicksMuted, getChartjsAxisOptionsScalesTitle, getDonutChartOptions, getKpiDisplayValue, getLineChartData, getLineChartOptions, getPieChartData, getPieChartOptions, getStyle, getStyleNumber, getTableTotalPages, isSameDate, isSameDateRange, shallowEqual, useDebounce, useResizeObserver, useTableGetRowsPerPage };
package/dist/index.js CHANGED
@@ -683,6 +683,18 @@ var ConditionalWrapper_default = ConditionalWrapper;
683
683
 
684
684
  // src/components/charts/kpis/KpiChart.tsx
685
685
  import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
686
+ var getKpiDisplayValue = ({
687
+ value,
688
+ displayNullAs,
689
+ valueFormatter
690
+ }) => {
691
+ if (value == null) {
692
+ if (displayNullAs === "") return "";
693
+ const numericDisplayNullAs = Number(displayNullAs);
694
+ return Number.isNaN(numericDisplayNullAs) ? displayNullAs : valueFormatter?.(numericDisplayNullAs) ?? numericDisplayNullAs;
695
+ }
696
+ return valueFormatter?.(value) ?? value;
697
+ };
686
698
  var KpiChart = ({
687
699
  value,
688
700
  valueFontSize,
@@ -698,7 +710,7 @@ var KpiChart = ({
698
710
  valueFormatter
699
711
  }) => {
700
712
  const hasComparisonValue = comparisonValue !== void 0;
701
- const displayValue = value == null ? displayNullAs : valueFormatter?.(value) ?? value;
713
+ const displayValue = getKpiDisplayValue({ value, displayNullAs, valueFormatter });
702
714
  const autoResizeValueFontSize = !valueFontSize;
703
715
  return /* @__PURE__ */ jsxs2("div", { className: styles5.kpiChartContainer, children: [
704
716
  /* @__PURE__ */ jsx5("div", { className: styles5.kpiChartValueContainer, children: /* @__PURE__ */ jsx5(
@@ -3558,6 +3570,7 @@ export {
3558
3570
  getChartjsAxisOptionsScalesTicksMuted,
3559
3571
  getChartjsAxisOptionsScalesTitle,
3560
3572
  getDonutChartOptions,
3573
+ getKpiDisplayValue,
3561
3574
  getLineChartData,
3562
3575
  getLineChartOptions,
3563
3576
  getPieChartData,