@trackunit/react-chart-components 1.3.174 → 1.3.181
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/index.cjs.js +2 -2
- package/index.esm.js +2 -2
- package/package.json +8 -8
- package/src/Chart/Chart.d.ts +2 -27
package/index.cjs.js
CHANGED
|
@@ -162,13 +162,13 @@ const cvaEChart = cssClassVarianceUtilities.cvaMerge(["w-full", "h-full"]);
|
|
|
162
162
|
* The Chart component is a wrapper component for ECharts.
|
|
163
163
|
* Handles events and click functionality.
|
|
164
164
|
*/
|
|
165
|
-
const Chart = ({ options,
|
|
165
|
+
const Chart = ({ options, showLoading, className, style, onChartReady, onClick, onEvents, merge = true, loadingOption, timezoneLabel, renderer = "canvas", dataTestId, }) => {
|
|
166
166
|
const containerStyle = {
|
|
167
167
|
height: style?.height ?? "300px",
|
|
168
168
|
width: style?.width ?? "100%",
|
|
169
169
|
...style,
|
|
170
170
|
};
|
|
171
|
-
return (jsxRuntime.jsx("div", { className: "grid h-full w-full grid-cols-1 grid-rows-1 items-center gap-1", "data-testid": dataTestId, style: containerStyle, children: showLoading ? (jsxRuntime.jsxs("div", { className: "grid place-items-center overflow-y-auto", "data-testid": `${dataTestId}-loading`, children: [jsxRuntime.jsx(reactComponents.Spinner, { centering: "centered" }), loadingOption?.text ? (jsxRuntime.jsx(reactComponents.Text, { align: "center", subtle: true, children: loadingOption.text })) : null] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(EChart, { className: className, dataTestId: `${dataTestId}-chart`, notMerge: !merge, onChartReady: onChartReady, onClick: onClick, onEvents: onEvents, option: options
|
|
171
|
+
return (jsxRuntime.jsx("div", { className: "grid h-full w-full grid-cols-1 grid-rows-1 items-center gap-1", "data-testid": dataTestId, style: containerStyle, children: showLoading ? (jsxRuntime.jsxs("div", { className: "grid place-items-center overflow-y-auto", "data-testid": `${dataTestId}-loading`, children: [jsxRuntime.jsx(reactComponents.Spinner, { centering: "centered" }), loadingOption?.text ? (jsxRuntime.jsx(reactComponents.Text, { align: "center", subtle: true, children: loadingOption.text })) : null] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(EChart, { className: className, dataTestId: `${dataTestId}-chart`, notMerge: !merge, onChartReady: onChartReady, onClick: onClick, onEvents: onEvents, option: options, renderer: renderer, style: style }), timezoneLabel] })) }));
|
|
172
172
|
};
|
|
173
173
|
|
|
174
174
|
const cvaLegendItem = cssClassVarianceUtilities.cvaMerge([
|
package/index.esm.js
CHANGED
|
@@ -141,13 +141,13 @@ const cvaEChart = cvaMerge(["w-full", "h-full"]);
|
|
|
141
141
|
* The Chart component is a wrapper component for ECharts.
|
|
142
142
|
* Handles events and click functionality.
|
|
143
143
|
*/
|
|
144
|
-
const Chart = ({ options,
|
|
144
|
+
const Chart = ({ options, showLoading, className, style, onChartReady, onClick, onEvents, merge = true, loadingOption, timezoneLabel, renderer = "canvas", dataTestId, }) => {
|
|
145
145
|
const containerStyle = {
|
|
146
146
|
height: style?.height ?? "300px",
|
|
147
147
|
width: style?.width ?? "100%",
|
|
148
148
|
...style,
|
|
149
149
|
};
|
|
150
|
-
return (jsx("div", { className: "grid h-full w-full grid-cols-1 grid-rows-1 items-center gap-1", "data-testid": dataTestId, style: containerStyle, children: showLoading ? (jsxs("div", { className: "grid place-items-center overflow-y-auto", "data-testid": `${dataTestId}-loading`, children: [jsx(Spinner, { centering: "centered" }), loadingOption?.text ? (jsx(Text, { align: "center", subtle: true, children: loadingOption.text })) : null] })) : (jsxs(Fragment, { children: [jsx(EChart, { className: className, dataTestId: `${dataTestId}-chart`, notMerge: !merge, onChartReady: onChartReady, onClick: onClick, onEvents: onEvents, option: options
|
|
150
|
+
return (jsx("div", { className: "grid h-full w-full grid-cols-1 grid-rows-1 items-center gap-1", "data-testid": dataTestId, style: containerStyle, children: showLoading ? (jsxs("div", { className: "grid place-items-center overflow-y-auto", "data-testid": `${dataTestId}-loading`, children: [jsx(Spinner, { centering: "centered" }), loadingOption?.text ? (jsx(Text, { align: "center", subtle: true, children: loadingOption.text })) : null] })) : (jsxs(Fragment, { children: [jsx(EChart, { className: className, dataTestId: `${dataTestId}-chart`, notMerge: !merge, onChartReady: onChartReady, onClick: onClick, onEvents: onEvents, option: options, renderer: renderer, style: style }), timezoneLabel] })) }));
|
|
151
151
|
};
|
|
152
152
|
|
|
153
153
|
const cvaLegendItem = cvaMerge([
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-chart-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.181",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"echarts": "5.6.0",
|
|
11
11
|
"react": "19.0.0",
|
|
12
|
-
"@trackunit/date-and-time-utils": "1.3.
|
|
13
|
-
"@trackunit/react-date-and-time-hooks": "1.3.
|
|
14
|
-
"@trackunit/ui-design-tokens": "1.3.
|
|
15
|
-
"@trackunit/shared-utils": "1.5.
|
|
16
|
-
"@trackunit/css-class-variance-utilities": "1.3.
|
|
17
|
-
"@trackunit/react-components": "1.4.
|
|
18
|
-
"@trackunit/react-test-setup": "1.0.
|
|
12
|
+
"@trackunit/date-and-time-utils": "1.3.140",
|
|
13
|
+
"@trackunit/react-date-and-time-hooks": "1.3.162",
|
|
14
|
+
"@trackunit/ui-design-tokens": "1.3.138",
|
|
15
|
+
"@trackunit/shared-utils": "1.5.140",
|
|
16
|
+
"@trackunit/css-class-variance-utilities": "1.3.140",
|
|
17
|
+
"@trackunit/react-components": "1.4.171",
|
|
18
|
+
"@trackunit/react-test-setup": "1.0.30"
|
|
19
19
|
},
|
|
20
20
|
"module": "./index.esm.js",
|
|
21
21
|
"main": "./index.cjs.js",
|
package/src/Chart/Chart.d.ts
CHANGED
|
@@ -2,35 +2,11 @@ import { CommonProps } from "@trackunit/react-components";
|
|
|
2
2
|
import type { ECElementEvent, ECharts, EChartsOption } from "echarts";
|
|
3
3
|
import { CSSProperties, ReactElement, ReactNode } from "react";
|
|
4
4
|
import { type EventName } from "../EChart/EChart";
|
|
5
|
-
|
|
6
|
-
[key: string]: any;
|
|
7
|
-
}
|
|
8
|
-
type UnsafeOptionsCondition = {
|
|
9
|
-
/**
|
|
10
|
-
* Option values for EChart.
|
|
11
|
-
*/
|
|
12
|
-
options?: never;
|
|
13
|
-
/**
|
|
14
|
-
* Option values for EChart. Not typed.
|
|
15
|
-
*
|
|
16
|
-
* @deprecated Use options instead. Will be removed in next major version.
|
|
17
|
-
*/
|
|
18
|
-
unsafeOptions: UnsafeOptions;
|
|
19
|
-
};
|
|
20
|
-
type SafeOptionsCondition = {
|
|
5
|
+
export type ChartProps = CommonProps & {
|
|
21
6
|
/**
|
|
22
7
|
* Option values for EChart.
|
|
23
8
|
*/
|
|
24
9
|
options: EChartsOption;
|
|
25
|
-
/**
|
|
26
|
-
* Option values for EChart. Not typed.
|
|
27
|
-
*
|
|
28
|
-
* @deprecated Use options instead. Will be removed in next major version.
|
|
29
|
-
*/
|
|
30
|
-
unsafeOptions?: never;
|
|
31
|
-
};
|
|
32
|
-
type ConditionalChartOptions = UnsafeOptionsCondition | SafeOptionsCondition;
|
|
33
|
-
export type ChartProps = CommonProps & ConditionalChartOptions & {
|
|
34
10
|
/**
|
|
35
11
|
* Whether or not to show the preloader.
|
|
36
12
|
*/
|
|
@@ -83,5 +59,4 @@ export type ChartProps = CommonProps & ConditionalChartOptions & {
|
|
|
83
59
|
* The Chart component is a wrapper component for ECharts.
|
|
84
60
|
* Handles events and click functionality.
|
|
85
61
|
*/
|
|
86
|
-
export declare const Chart: ({ options,
|
|
87
|
-
export {};
|
|
62
|
+
export declare const Chart: ({ options, showLoading, className, style, onChartReady, onClick, onEvents, merge, loadingOption, timezoneLabel, renderer, dataTestId, }: ChartProps) => ReactElement;
|