@bpfdev/oly-ui 1.0.15 → 1.0.16

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.mjs CHANGED
@@ -17027,7 +17027,7 @@ function formatTooltipValue2(n) {
17027
17027
  );
17028
17028
  }
17029
17029
  function PeakBillingHoursTooltip(props) {
17030
- const { active, payload, label } = props;
17030
+ const { active, payload, label, formatValue: formatValue3 } = props;
17031
17031
  const { barChart: bc } = usePeakBillingHoursCustomization();
17032
17032
  const tt = bc?.tooltip;
17033
17033
  if (!active || !payload?.length) {
@@ -17104,7 +17104,7 @@ function PeakBillingHoursTooltip(props) {
17104
17104
  ] }),
17105
17105
  /* @__PURE__ */ jsxs43("div", { style: { ...rowStyle, marginTop: gap }, children: [
17106
17106
  /* @__PURE__ */ jsx54("span", { style: { color: prefixCol, fontWeight: prefixFw }, children: totalP }),
17107
- /* @__PURE__ */ jsx54("span", { style: { color: valueCol, fontWeight: valueFw }, children: formatTooltipValue2(num) })
17107
+ /* @__PURE__ */ jsx54("span", { style: { color: valueCol, fontWeight: valueFw }, children: formatValue3 ? formatValue3(num) : formatTooltipValue2(num) })
17108
17108
  ] })
17109
17109
  ] })
17110
17110
  ]
@@ -17127,7 +17127,17 @@ function toNum5(n) {
17127
17127
  return typeof n === "number" ? n : Number(n);
17128
17128
  }
17129
17129
  function PeakBarTopLabel(props) {
17130
- const { x, y, width, value, fill, fontSize, fontWeight, angle = 0 } = props;
17130
+ const {
17131
+ x,
17132
+ y,
17133
+ width,
17134
+ value,
17135
+ fill,
17136
+ fontSize,
17137
+ fontWeight,
17138
+ angle = 0,
17139
+ formatValue: formatValue3
17140
+ } = props;
17131
17141
  const nx = toNum5(x);
17132
17142
  const ny = toNum5(y);
17133
17143
  const nw = toNum5(width);
@@ -17151,7 +17161,7 @@ function PeakBarTopLabel(props) {
17151
17161
  fontWeight,
17152
17162
  textAnchor: isHorizontal ? "middle" : "start",
17153
17163
  transform: isHorizontal ? void 0 : `rotate(${angle} ${cx} ${cy})`,
17154
- children: String(Math.round(n))
17164
+ children: formatValue3 ? formatValue3(n) : String(Math.round(n))
17155
17165
  }
17156
17166
  );
17157
17167
  }
@@ -17166,7 +17176,9 @@ function BarPlot2({
17166
17176
  yAxisTickStyle,
17167
17177
  xAxisTickDx = 0,
17168
17178
  xAxisTickStyle,
17169
- barValueLabelAngle = 0
17179
+ barValueLabelAngle = 0,
17180
+ barValueLabelFormatter,
17181
+ tooltipValueFormatter
17170
17182
  }) {
17171
17183
  const { barChart: bc } = usePeakBillingHoursCustomization();
17172
17184
  const height = bc?.heightPx ?? 320;
@@ -17248,7 +17260,13 @@ function BarPlot2({
17248
17260
  });
17249
17261
  return customTooltip == null ? null : /* @__PURE__ */ jsx55(Fragment22, { children: customTooltip });
17250
17262
  }
17251
- return /* @__PURE__ */ jsx55(PeakBillingHoursTooltip, { ...tooltipProps });
17263
+ return /* @__PURE__ */ jsx55(
17264
+ PeakBillingHoursTooltip,
17265
+ {
17266
+ ...tooltipProps,
17267
+ formatValue: tooltipValueFormatter
17268
+ }
17269
+ );
17252
17270
  },
17253
17271
  cursor: {
17254
17272
  fill: hoverBandFill,
@@ -17278,7 +17296,8 @@ function BarPlot2({
17278
17296
  fill: labelFill,
17279
17297
  fontSize: labelFs,
17280
17298
  fontWeight: 500,
17281
- angle: barValueLabelAngle
17299
+ angle: barValueLabelAngle,
17300
+ formatValue: barValueLabelFormatter
17282
17301
  }
17283
17302
  )
17284
17303
  }
@@ -17304,6 +17323,10 @@ function PeakBillingHours({
17304
17323
  xAxisTickDx = 0,
17305
17324
  xAxisTickStyle,
17306
17325
  barValueLabelAngle = 0,
17326
+ barValueLabelFormatter,
17327
+ valueFormattersByTabId,
17328
+ tooltipValueFormatter,
17329
+ tooltipValueFormattersByTabId,
17307
17330
  yAxisDomain = [0, 50],
17308
17331
  yAxisTicks = [0, 10, 20, 30, 40, 50],
17309
17332
  infoPopover,
@@ -17317,6 +17340,8 @@ function PeakBillingHours({
17317
17340
  }
17318
17341
  return data ?? [];
17319
17342
  }, [seriesByTabId, data, activeTabId]);
17343
+ const resolvedBarValueLabelFormatter = valueFormattersByTabId?.[activeTabId] ?? barValueLabelFormatter;
17344
+ const resolvedTooltipValueFormatter = tooltipValueFormattersByTabId?.[activeTabId] ?? tooltipValueFormatter;
17320
17345
  const resolvedInfo = infoPopover === void 0 ? DEFAULT_PEAK_BILLING_HOURS_INFO_POPOVER : infoPopover;
17321
17346
  const rootSx = mergeSx3(
17322
17347
  {
@@ -17415,7 +17440,9 @@ function PeakBillingHours({
17415
17440
  yAxisTickStyle,
17416
17441
  xAxisTickDx,
17417
17442
  xAxisTickStyle,
17418
- barValueLabelAngle
17443
+ barValueLabelAngle,
17444
+ barValueLabelFormatter: resolvedBarValueLabelFormatter,
17445
+ tooltipValueFormatter: resolvedTooltipValueFormatter
17419
17446
  }
17420
17447
  ) : /* @__PURE__ */ jsx55(
17421
17448
  ChartEmptyState,