@widergy/utilitygo-smart-bill-web 3.5.2 → 3.5.3

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [3.5.3](https://github.com/widergy/UtilityGO-Smart-Bill-Web/compare/v3.5.2...v3.5.3) (2025-05-09)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * smartbill consumption comparison ([#48](https://github.com/widergy/UtilityGO-Smart-Bill-Web/issues/48)) ([395d61d](https://github.com/widergy/UtilityGO-Smart-Bill-Web/commit/395d61d3d6094ffc78b91f3283ffa448067f3532))
7
+
1
8
  ## [3.5.2](https://github.com/widergy/UtilityGO-Smart-Bill-Web/compare/v3.5.1...v3.5.2) (2025-04-30)
2
9
 
3
10
 
@@ -20,11 +20,12 @@ const ConsumptionComparison = _ref => {
20
20
  } = _ref;
21
21
  const maxValue = (0, _utils.getMaxValue)(periodsToCompare);
22
22
  const title = texts?.consumptions?.comparisonTitle;
23
+ const showComparison = periodsToCompare?.length > 1;
23
24
  return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
24
- className: _stylesModule.default.consumptionComparisonLabel,
25
25
  colorTheme: "gray",
26
+ className: showComparison ? _stylesModule.default.consumptionComparisonLabel : _stylesModule.default.consumptionComparisonLabelNoData,
26
27
  variant: "small"
27
- }, title), /*#__PURE__*/_react.default.createElement("div", {
28
+ }, title), showComparison && /*#__PURE__*/_react.default.createElement("div", {
28
29
  className: _stylesModule.default.container
29
30
  }, periodsToCompare.map(_ref2 => {
30
31
  let {
@@ -2,6 +2,10 @@
2
2
  margin: 12px 0;
3
3
  }
4
4
 
5
+ .consumptionComparisonLabelNoData {
6
+ margin: 12px 0 -20px 0;
7
+ }
8
+
5
9
  .container {
6
10
  align-items: flex-end;
7
11
  display: flex;
@@ -32,7 +32,9 @@ const ConsumptionEvolution = _ref => {
32
32
  icon,
33
33
  Image,
34
34
  percentage,
35
- period
35
+ period,
36
+ shade = '04',
37
+ size = 24
36
38
  } = (0, _utils.getConsumptionComparison)(backgroundImages, consumptionEvolutionLabels, periods);
37
39
  return /*#__PURE__*/_react.default.createElement(_energyUi.UTActionCard, {
38
40
  BackgroundImage: Image,
@@ -54,8 +56,8 @@ const ConsumptionEvolution = _ref => {
54
56
  area: true,
55
57
  colorTheme: colorTheme,
56
58
  name: icon,
57
- shade: "04",
58
- size: 24
59
+ shade: shade,
60
+ size: size
59
61
  }), percentage && /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
60
62
  colorTheme: colorTheme,
61
63
  variant: "title2",
@@ -42,7 +42,8 @@ const getConsumptionComparison = (backgroundImages, labels, periods) => {
42
42
  icon: 'IconEyeOff',
43
43
  Image: LightEvolutionImage,
44
44
  percentage: null,
45
- period: noData
45
+ period: noData,
46
+ shade: '05'
46
47
  };
47
48
  }
48
49
  const percentageChange = previousConsumption === 0 && currentConsumption === 0 ? 0 : previousConsumption !== 0 ? (currentConsumption - previousConsumption) / previousConsumption * 100 : 100;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widergy/utilitygo-smart-bill-web",
3
- "version": "3.5.2",
3
+ "version": "3.5.3",
4
4
  "description": "UtilityGO SmartBill Web",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",