@trackunit/react-chart-components 0.0.46 → 0.0.49

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.
Files changed (3) hide show
  1. package/index.cjs +1 -1
  2. package/index.js +1 -1
  3. package/package.json +3 -3
package/index.cjs CHANGED
@@ -200,7 +200,7 @@ const Indicator = tailwindStyledComponents.tw.div `
200
200
  * @param {PieChartProps} props - The props for the Chart component
201
201
  * @returns {JSX.Element} Chart component
202
202
  */
203
- const PieChart = ({ data, size = "full", loading, onClick, className, dataTestId, }) => (jsxRuntime.jsxs(ChartRoot, Object.assign({ className: className, "data-testid": dataTestId }, { children: [jsxRuntime.jsx("div", { children: size === "full" && (jsxRuntime.jsx("div", Object.assign({ className: "flex flex-col", "data-testid": "legend" }, { children: data === null || data === void 0 ? void 0 : data.map(item => (jsxRuntime.jsx(LegendItem, { dataTestId: `legend-${item.id}`, label: (item === null || item === void 0 ? void 0 : item.count) !== undefined ? `${item.name} (${item.count})` : item.name, onClick: onClick ? () => onClick(item) : undefined, selected: item.selected, color: item.color }, item.id))) }))) }), jsxRuntime.jsx(Chart, { showLoading: loading, style: size === "full" ? { height: 110, width: 110 } : { height: 60, width: 60 }, onClick: evt => {
203
+ const PieChart = ({ data, size = "full", loading, onClick, className, dataTestId, }) => (jsxRuntime.jsxs(ChartRoot, Object.assign({ className: className, "data-testid": dataTestId }, { children: [jsxRuntime.jsx("div", { children: size === "full" && (jsxRuntime.jsx("div", Object.assign({ className: "flex flex-col", "data-testid": "legend" }, { children: data === null || data === void 0 ? void 0 : data.map(item => (jsxRuntime.jsx(LegendItem, { dataTestId: `legend-${item.id}`, label: (item === null || item === void 0 ? void 0 : item.count) !== undefined ? `${item.name} (${item.count})` : item.name, onClick: onClick ? () => onClick(item) : undefined, selected: item.selected, color: item.color }, item.id))) }))) }), jsxRuntime.jsx(Chart, { dataTestId: "pie-chart", showLoading: loading, style: size === "full" ? { height: 110, width: 110 } : { height: 60, width: 60 }, onClick: evt => {
204
204
  const clickedEntry = data === null || data === void 0 ? void 0 : data.find(x => x.id === evt.data.id);
205
205
  if (onClick && clickedEntry) {
206
206
  onClick(clickedEntry);
package/index.js CHANGED
@@ -173,7 +173,7 @@ const Indicator = tw.div `
173
173
  * @param {PieChartProps} props - The props for the Chart component
174
174
  * @returns {JSX.Element} Chart component
175
175
  */
176
- const PieChart = ({ data, size = "full", loading, onClick, className, dataTestId, }) => (jsxs(ChartRoot, Object.assign({ className: className, "data-testid": dataTestId }, { children: [jsx("div", { children: size === "full" && (jsx("div", Object.assign({ className: "flex flex-col", "data-testid": "legend" }, { children: data === null || data === void 0 ? void 0 : data.map(item => (jsx(LegendItem, { dataTestId: `legend-${item.id}`, label: (item === null || item === void 0 ? void 0 : item.count) !== undefined ? `${item.name} (${item.count})` : item.name, onClick: onClick ? () => onClick(item) : undefined, selected: item.selected, color: item.color }, item.id))) }))) }), jsx(Chart, { showLoading: loading, style: size === "full" ? { height: 110, width: 110 } : { height: 60, width: 60 }, onClick: evt => {
176
+ const PieChart = ({ data, size = "full", loading, onClick, className, dataTestId, }) => (jsxs(ChartRoot, Object.assign({ className: className, "data-testid": dataTestId }, { children: [jsx("div", { children: size === "full" && (jsx("div", Object.assign({ className: "flex flex-col", "data-testid": "legend" }, { children: data === null || data === void 0 ? void 0 : data.map(item => (jsx(LegendItem, { dataTestId: `legend-${item.id}`, label: (item === null || item === void 0 ? void 0 : item.count) !== undefined ? `${item.name} (${item.count})` : item.name, onClick: onClick ? () => onClick(item) : undefined, selected: item.selected, color: item.color }, item.id))) }))) }), jsx(Chart, { dataTestId: "pie-chart", showLoading: loading, style: size === "full" ? { height: 110, width: 110 } : { height: 60, width: 60 }, onClick: evt => {
177
177
  const clickedEntry = data === null || data === void 0 ? void 0 : data.find(x => x.id === evt.data.id);
178
178
  if (onClick && clickedEntry) {
179
179
  onClick(clickedEntry);
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@trackunit/react-chart-components",
3
- "version": "0.0.46",
3
+ "version": "0.0.49",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "dependencies": {
7
- "@trackunit/react-components": "0.1.104",
7
+ "@trackunit/react-components": "0.1.106",
8
8
  "@trackunit/tailwind-styled-components": "0.0.56",
9
- "@trackunit/ui-design-tokens": "0.0.67",
9
+ "@trackunit/ui-design-tokens": "0.0.68",
10
10
  "echarts": "5.4.0",
11
11
  "echarts-for-react": "3.0.2",
12
12
  "react": "18.2.0"