ag-common 0.0.683 → 0.0.685
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,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type IVarStyles } from '../../styles/common';
|
|
3
3
|
import type { IBarChartData } from './types';
|
|
4
|
-
export declare const BarChart: ({ data: dataRaw, style: sRaw, }: {
|
|
4
|
+
export declare const BarChart: ({ data: dataRaw, style: sRaw, className, }: {
|
|
5
5
|
data: IBarChartData[];
|
|
6
|
-
style?: Partial<IVarStyles
|
|
6
|
+
style?: Partial<IVarStyles> | undefined;
|
|
7
|
+
className?: string | undefined;
|
|
7
8
|
}) => React.JSX.Element;
|
|
@@ -26,11 +26,11 @@ const ItemStyled = (0, styled_1.default)(Item_1.Item) `
|
|
|
26
26
|
margin-bottom: 0;
|
|
27
27
|
}
|
|
28
28
|
`;
|
|
29
|
-
const BarChart = ({ data: dataRaw, style: sRaw, }) => {
|
|
29
|
+
const BarChart = ({ data: dataRaw, style: sRaw, className, }) => {
|
|
30
30
|
const style = (0, common_1.getVarStyles)(sRaw);
|
|
31
31
|
const UT = (0, useTooltip_1.useTooltip)();
|
|
32
32
|
const maxWidth = Math.max(...dataRaw.map((a) => a.total));
|
|
33
|
-
return (react_1.default.createElement(BarChartBase, { "data-type": "bcb", style: style },
|
|
33
|
+
return (react_1.default.createElement(BarChartBase, { "data-type": "bcb", style: style, className: className },
|
|
34
34
|
react_1.default.createElement(UT.Comp, { pos: UT.pos }, (p) => react_1.default.createElement(TooltipContent_1.TooltipContent, Object.assign({}, p, { style: style }))),
|
|
35
35
|
dataRaw.map((data) => (react_1.default.createElement(ItemStyled, { style: style, key: data.name, data: data, maxWidth: maxWidth, onMouseLeave: () => UT.setPos(undefined), onMouseMove: (element) => {
|
|
36
36
|
var _a, _b;
|
|
@@ -19,7 +19,7 @@ const Title = styled_1.default.div `
|
|
|
19
19
|
position: absolute;
|
|
20
20
|
left: 0.25rem;
|
|
21
21
|
`;
|
|
22
|
-
const Item = ({ data, className, onMouseMove, onMouseLeave, maxWidth, style, }) => (react_1.default.createElement(Base, { className: className, onMouseMove: onMouseMove, onMouseLeave: onMouseLeave, style: style },
|
|
22
|
+
const Item = ({ data, className, onMouseMove, onMouseLeave, maxWidth, style, }) => (react_1.default.createElement(Base, { className: className, onMouseMove: onMouseMove, onMouseLeave: onMouseLeave, style: style, "data-type": "bcb-item" },
|
|
23
23
|
react_1.default.createElement(Title, { style: {
|
|
24
24
|
color: style.color,
|
|
25
25
|
filter: (0, styles_1.HardOutlineFilter)(style.backgroundColor),
|
|
@@ -92,8 +92,9 @@ const Comp = ({ pos, children, }) => {
|
|
|
92
92
|
right,
|
|
93
93
|
top,
|
|
94
94
|
bottom, zIndex: 10 }, (pos.usePortal && { position: 'fixed' })), (!(size === null || size === void 0 ? void 0 : size.p) && { zIndex: -1 })) }, children(pos.data)));
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
const e = document.querySelector(`#${globalId}`);
|
|
96
|
+
if (pos.usePortal && e) {
|
|
97
|
+
return (0, react_dom_1.createPortal)(Content, e);
|
|
97
98
|
}
|
|
98
99
|
return Content;
|
|
99
100
|
};
|
package/package.json
CHANGED