@aveonline/ui-react 2.5.2 → 2.5.3
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.
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { IPropsBar } from './IBar';
|
|
3
|
-
export default function Bar<T>({ className, data, cells, paintLastCellForKey, width, height, margin, xAxis, yAxis, isLoading, legend }: IPropsBar<T>): JSX.Element;
|
|
3
|
+
export default function Bar<T>({ className, data, cells, paintLastCellForKey, width, height, margin, xAxis, yAxis, isLoading, legend, tooltipItems }: IPropsBar<T>): JSX.Element;
|
|
@@ -5,6 +5,10 @@ export interface CellBar {
|
|
|
5
5
|
group: number;
|
|
6
6
|
color: ColorBar;
|
|
7
7
|
}
|
|
8
|
+
export interface TooltipItem {
|
|
9
|
+
key: string | number;
|
|
10
|
+
newKey: string | number;
|
|
11
|
+
}
|
|
8
12
|
export interface MarginBar {
|
|
9
13
|
top: number;
|
|
10
14
|
right: number;
|
|
@@ -23,4 +27,5 @@ export interface IPropsBar<T> {
|
|
|
23
27
|
xAxis?: XAxisProps;
|
|
24
28
|
yAxis?: YAxisProps;
|
|
25
29
|
legend?: LegendProps['payload'];
|
|
30
|
+
tooltipItems?: TooltipItem[];
|
|
26
31
|
}
|
package/dist/ui-react.mjs
CHANGED
|
@@ -33322,37 +33322,48 @@ function Wae({
|
|
|
33322
33322
|
xAxis: s,
|
|
33323
33323
|
yAxis: l,
|
|
33324
33324
|
isLoading: u = !1,
|
|
33325
|
-
legend: c
|
|
33325
|
+
legend: c,
|
|
33326
|
+
tooltipItems: f
|
|
33326
33327
|
}) {
|
|
33327
33328
|
if (u)
|
|
33328
33329
|
return /* @__PURE__ */ b.jsx("div", { className: "flex flex-col items-center gap-y-3 justify-center text-center rounded-b-sm border-border-subdued", children: /* @__PURE__ */ b.jsx("div", { className: "py-8", children: /* @__PURE__ */ b.jsx(iu, { size: "lg" }) }) });
|
|
33329
|
-
const
|
|
33330
|
-
index:
|
|
33331
|
-
name:
|
|
33332
|
-
color:
|
|
33333
|
-
}) => r &&
|
|
33330
|
+
const g = ({
|
|
33331
|
+
index: p,
|
|
33332
|
+
name: v,
|
|
33333
|
+
color: d
|
|
33334
|
+
}) => r && p === t.length - 1 && v in r ? qu(r[v]) : qu(d);
|
|
33334
33335
|
return /* @__PURE__ */ b.jsx("div", { className: K(e), children: /* @__PURE__ */ b.jsxs(hte, { width: i, height: a, data: t, margin: o, children: [
|
|
33335
33336
|
/* @__PURE__ */ b.jsx(Os, { ...s }),
|
|
33336
33337
|
/* @__PURE__ */ b.jsx(Bs, { ...l }),
|
|
33337
|
-
/* @__PURE__ */ b.jsx(
|
|
33338
|
+
/* @__PURE__ */ b.jsx(
|
|
33339
|
+
Wi,
|
|
33340
|
+
{
|
|
33341
|
+
formatter: (p, v) => {
|
|
33342
|
+
let d = p;
|
|
33343
|
+
return f && f.forEach((h) => {
|
|
33344
|
+
h.key === v && (d = [p.toString(), h.newKey]);
|
|
33345
|
+
}), d;
|
|
33346
|
+
}
|
|
33347
|
+
}
|
|
33348
|
+
),
|
|
33338
33349
|
/* @__PURE__ */ b.jsx(Lo, { payload: c }),
|
|
33339
|
-
n.map(({ name:
|
|
33350
|
+
n.map(({ name: p, group: v, color: d }) => /* @__PURE__ */ b.jsx(
|
|
33340
33351
|
Ss,
|
|
33341
33352
|
{
|
|
33342
|
-
role:
|
|
33343
|
-
dataKey:
|
|
33344
|
-
stackId:
|
|
33345
|
-
fill: qu(
|
|
33346
|
-
children: t.map((
|
|
33353
|
+
role: p,
|
|
33354
|
+
dataKey: p,
|
|
33355
|
+
stackId: v,
|
|
33356
|
+
fill: qu(d),
|
|
33357
|
+
children: t.map((h, A) => /* @__PURE__ */ b.jsx(
|
|
33347
33358
|
rh,
|
|
33348
33359
|
{
|
|
33349
33360
|
role: "img",
|
|
33350
|
-
fill:
|
|
33361
|
+
fill: g({ index: A, name: p, color: d })
|
|
33351
33362
|
},
|
|
33352
|
-
`cell-${
|
|
33363
|
+
`cell-${A}`
|
|
33353
33364
|
))
|
|
33354
33365
|
},
|
|
33355
|
-
|
|
33366
|
+
p
|
|
33356
33367
|
))
|
|
33357
33368
|
] }) });
|
|
33358
33369
|
}
|