@ttoss/react-dashboard 0.3.5 → 0.3.6
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/dist/esm/index.js +18 -11
- package/package.json +4 -4
package/dist/esm/index.js
CHANGED
|
@@ -159,16 +159,30 @@ var getTrendColor = /* @__PURE__ */__name(trend => {
|
|
|
159
159
|
if (!trend) {
|
|
160
160
|
return colors.neutral;
|
|
161
161
|
}
|
|
162
|
-
const isGoodTrend = trend.
|
|
162
|
+
const isGoodTrend = trend.status === "positive";
|
|
163
163
|
if (isGoodTrend) {
|
|
164
164
|
return colors.positive;
|
|
165
165
|
}
|
|
166
|
-
const isBadTrend = trend.
|
|
166
|
+
const isBadTrend = trend.status === "negative";
|
|
167
167
|
if (isBadTrend) {
|
|
168
168
|
return colors.negative;
|
|
169
169
|
}
|
|
170
170
|
return colors.neutral;
|
|
171
171
|
}, "getTrendColor");
|
|
172
|
+
var TrendIcon = /* @__PURE__ */__name(({
|
|
173
|
+
trend
|
|
174
|
+
}) => {
|
|
175
|
+
let icon = "mdi:minus";
|
|
176
|
+
if (trend.type === "higher" && trend.status === "positive" || trend.type === "lower" && trend.status === "negative") {
|
|
177
|
+
icon = "mdi:arrow-up";
|
|
178
|
+
} else if (trend.type === "higher" && trend.status === "negative" || trend.type === "lower" && trend.status === "positive") {
|
|
179
|
+
icon = "mdi:arrow-down";
|
|
180
|
+
}
|
|
181
|
+
return /* @__PURE__ */React.createElement(Icon, {
|
|
182
|
+
icon,
|
|
183
|
+
width: 12
|
|
184
|
+
});
|
|
185
|
+
}, "TrendIcon");
|
|
172
186
|
var BigNumber = /* @__PURE__ */__name(props => {
|
|
173
187
|
const total = props.data.meta?.total ?? props.data.api?.total ?? void 0;
|
|
174
188
|
const formattedValue = formatNumber(total, props.numberType, props.numberDecimalPlaces);
|
|
@@ -206,15 +220,8 @@ var BigNumber = /* @__PURE__ */__name(props => {
|
|
|
206
220
|
display: "flex",
|
|
207
221
|
alignItems: "center"
|
|
208
222
|
}
|
|
209
|
-
},
|
|
210
|
-
|
|
211
|
-
width: 12
|
|
212
|
-
}) : props.trend.status === "negative" ? /* @__PURE__ */React.createElement(Icon, {
|
|
213
|
-
icon: "mdi:arrow-down",
|
|
214
|
-
width: 12
|
|
215
|
-
}) : /* @__PURE__ */React.createElement(Icon, {
|
|
216
|
-
icon: "mdi:minus",
|
|
217
|
-
width: 12
|
|
223
|
+
}, /* @__PURE__ */React.createElement(TrendIcon, {
|
|
224
|
+
trend: props.trend
|
|
218
225
|
}), props.trend.value.toFixed(1), "%", " "), /* @__PURE__ */React.createElement(Text, {
|
|
219
226
|
sx: {
|
|
220
227
|
color: "input.background.muted.disabled",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/react-dashboard",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.6",
|
|
4
4
|
"description": "ttoss dashboard module for React apps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ttoss",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"react-day-picker": "^9.13.0",
|
|
28
28
|
"react-grid-layout": "^1.5.2",
|
|
29
29
|
"@ttoss/components": "^2.12.6",
|
|
30
|
-
"@ttoss/forms": "^0.40.1",
|
|
31
30
|
"@ttoss/react-icons": "^0.5.7",
|
|
32
|
-
"@ttoss/
|
|
33
|
-
"@ttoss/ui": "^6.5.1"
|
|
31
|
+
"@ttoss/forms": "^0.40.1",
|
|
32
|
+
"@ttoss/ui": "^6.5.1",
|
|
33
|
+
"@ttoss/react-i18n": "^2.0.26"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"react": ">=16.8.0"
|