next-helios-fe 1.8.115 → 1.8.117
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/package.json
CHANGED
@@ -75,7 +75,7 @@ export const Button: React.FC<ButtonProps> = ({
|
|
75
75
|
>
|
76
76
|
<button
|
77
77
|
className={`relative ${width} px-3 ${height} rounded-md text-left ${variant} ${border} ${isActive} select-none disabled:pointer-events-none ${className}`}
|
78
|
-
disabled={loading
|
78
|
+
disabled={loading ?? rest.disabled}
|
79
79
|
{...rest}
|
80
80
|
>
|
81
81
|
<div
|
@@ -28,7 +28,14 @@ interface ChartProps {
|
|
28
28
|
labels?: string[];
|
29
29
|
series: any;
|
30
30
|
xaxis?: {
|
31
|
-
categories
|
31
|
+
categories?: string[];
|
32
|
+
datetime?: boolean;
|
33
|
+
min?: number;
|
34
|
+
max?: number;
|
35
|
+
};
|
36
|
+
yaxis?: {
|
37
|
+
min?: number;
|
38
|
+
max?: number;
|
32
39
|
};
|
33
40
|
options?: {
|
34
41
|
theme?: "light" | "dark";
|
@@ -47,6 +54,7 @@ export const Chart: React.FC<ChartProps> = ({
|
|
47
54
|
series,
|
48
55
|
labels,
|
49
56
|
xaxis,
|
57
|
+
yaxis,
|
50
58
|
options,
|
51
59
|
}) => {
|
52
60
|
const areaOptions = type === "area" && {
|
@@ -75,11 +83,36 @@ export const Chart: React.FC<ChartProps> = ({
|
|
75
83
|
align: "left",
|
76
84
|
},
|
77
85
|
xaxis: {
|
78
|
-
|
86
|
+
...(xaxis?.datetime
|
87
|
+
? {
|
88
|
+
type: "datetime",
|
89
|
+
}
|
90
|
+
: {}),
|
91
|
+
...(xaxis?.categories ? { categories: xaxis?.categories } : {}),
|
79
92
|
labels: {
|
93
|
+
...(xaxis?.datetime
|
94
|
+
? {
|
95
|
+
datetimeFormatter: {
|
96
|
+
year: "yyyy",
|
97
|
+
month: "MMM 'yy",
|
98
|
+
day: "dd MMM",
|
99
|
+
hour: "HH:mm",
|
100
|
+
},
|
101
|
+
}
|
102
|
+
: {}),
|
80
103
|
maxHeight: 40,
|
81
104
|
},
|
105
|
+
...(xaxis?.min ? { min: xaxis?.min } : {}),
|
106
|
+
...(xaxis?.max ? { min: xaxis?.max } : {}),
|
82
107
|
},
|
108
|
+
...(yaxis?.min !== undefined || yaxis?.max !== undefined
|
109
|
+
? {
|
110
|
+
yaxis: {
|
111
|
+
...(yaxis?.min ? { min: yaxis?.min } : {}),
|
112
|
+
...(yaxis?.max ? { min: yaxis?.max } : {}),
|
113
|
+
},
|
114
|
+
}
|
115
|
+
: {}),
|
83
116
|
labels: labels ?? [],
|
84
117
|
colors: options?.mainColor
|
85
118
|
? [
|
@@ -164,6 +197,11 @@ export const Chart: React.FC<ChartProps> = ({
|
|
164
197
|
tooltip: {
|
165
198
|
theme: options?.theme === "light" ? "light" : "dark",
|
166
199
|
fillSeriesColor: false,
|
200
|
+
...(xaxis?.datetime
|
201
|
+
? {
|
202
|
+
x: { format: "dd MMM yyyy" },
|
203
|
+
}
|
204
|
+
: {}),
|
167
205
|
},
|
168
206
|
grid: {
|
169
207
|
borderColor: options?.theme === "light" ? "#e5e6e8" : "#545869",
|