@widergy/utilitygo-smart-bill-web 3.20.0 → 3.20.2

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,17 @@
1
+ ## [3.20.2](https://github.com/widergy/UtilityGO-Smart-Bill-Web/compare/v3.20.1...v3.20.2) (2026-01-21)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * banner, tooltip and new link ([#79](https://github.com/widergy/UtilityGO-Smart-Bill-Web/issues/79)) ([9edc1d4](https://github.com/widergy/UtilityGO-Smart-Bill-Web/commit/9edc1d4b95fadd658390e38abd34f3289e696480))
7
+
8
+ ## [3.20.1](https://github.com/widergy/UtilityGO-Smart-Bill-Web/compare/v3.20.0...v3.20.1) (2026-01-16)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * [EVEP-292] billing date range ([#77](https://github.com/widergy/UtilityGO-Smart-Bill-Web/issues/77)) ([683c944](https://github.com/widergy/UtilityGO-Smart-Bill-Web/commit/683c9449c63c7e2520e385a58bda25730f2096fe))
14
+
1
15
  # [3.20.0](https://github.com/widergy/UtilityGO-Smart-Bill-Web/compare/v3.19.0...v3.20.0) (2025-12-23)
2
16
 
3
17
 
@@ -50,6 +50,7 @@ const Billing = _ref => {
50
50
  notAdhered,
51
51
  rateCard: rateCardTranslations,
52
52
  ratesTableLink,
53
+ meetBillLink,
53
54
  titularCard = {},
54
55
  totalAmountLabel,
55
56
  totalCard = {},
@@ -163,6 +164,7 @@ const Billing = _ref => {
163
164
  normalizedRate,
164
165
  rateCardTranslations,
165
166
  ratesTableLink,
167
+ meetBillLink,
166
168
  smartBill,
167
169
  subsidy,
168
170
  subsidyLevels,
@@ -22,6 +22,7 @@ const Billing = _ref => {
22
22
  periodSpan = _constants.BIMESTRAL_SPAN
23
23
  } = _ref;
24
24
  const {
25
+ dateRange,
25
26
  title,
26
27
  tagLabel,
27
28
  clarification,
@@ -29,12 +30,27 @@ const Billing = _ref => {
29
30
  } = texts?.billing || {};
30
31
  const currentPeriod = smartBill?.periods?.find(period => period.current);
31
32
  const billingsToShow = (0, _utils.getBillingsToShow)(currentPeriod?.settlements, periodSpan);
33
+ const {
34
+ start_date: startDate,
35
+ end_date: endDate
36
+ } = currentPeriod?.settlements || {};
37
+ const {
38
+ start,
39
+ end
40
+ } = (0, _utils.getDateRange)(startDate, endDate);
32
41
  return /*#__PURE__*/_react.default.createElement("div", {
33
42
  className: _stylesModule.default.container
34
43
  }, /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
35
44
  colorTheme: "gray",
36
45
  variant: "subtitle1"
37
- }, title), /*#__PURE__*/_react.default.createElement("div", {
46
+ }, title), /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
47
+ className: _stylesModule.default.dateRange,
48
+ colorTheme: "gray",
49
+ variant: "body"
50
+ }, dateRange?.({
51
+ start,
52
+ end
53
+ })), /*#__PURE__*/_react.default.createElement("div", {
38
54
  className: _stylesModule.default.details
39
55
  }, billingsToShow.map(_ref2 => {
40
56
  let {
@@ -11,6 +11,10 @@
11
11
  margin: 24px -24px 0;
12
12
  }
13
13
 
14
+ .dateRange {
15
+ margin-top: 8px;
16
+ }
17
+
14
18
  .billing {
15
19
  border-bottom: 1px solid var(--light04);
16
20
  display: flex;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getMonthName = exports.getConsumptionLabel = exports.getBillingsToShow = void 0;
6
+ exports.getMonthName = exports.getDateRange = exports.getConsumptionLabel = exports.getBillingsToShow = void 0;
7
7
  var _dayjs = _interopRequireDefault(require("dayjs"));
8
8
  require("dayjs/locale/es");
9
9
  var _constants = require("./constants");
@@ -31,6 +31,15 @@ const getBillingsToShow = (settlements, periodSpan) => {
31
31
  exports.getBillingsToShow = getBillingsToShow;
32
32
  const getMonthName = date => (0, _dayjs.default)(date).format('MMMM');
33
33
  exports.getMonthName = getMonthName;
34
+ const getDateRange = (startDate, endDate) => {
35
+ const start = startDate ? (0, _dayjs.default)(startDate).format('DD/MM/YYYY') : '';
36
+ const end = endDate ? (0, _dayjs.default)(endDate).format('DD/MM/YYYY') : '';
37
+ return {
38
+ start,
39
+ end
40
+ };
41
+ };
42
+ exports.getDateRange = getDateRange;
34
43
  const getConsumptionLabel = consumptions => {
35
44
  const consumption = consumptions?.[0];
36
45
  const {
@@ -32,6 +32,7 @@ const RateCard = _ref => {
32
32
  normalizedRate = '',
33
33
  rateCardTranslations = {},
34
34
  ratesTableLink,
35
+ meetBillLink,
35
36
  seeFooter = true,
36
37
  smallTitle = false,
37
38
  smartBill = {},
@@ -48,7 +49,6 @@ const RateCard = _ref => {
48
49
  startRateValueLabel,
49
50
  title,
50
51
  tooltipContent,
51
- tooltipText,
52
52
  unit,
53
53
  yourConsumption,
54
54
  yourRate
@@ -104,9 +104,9 @@ const RateCard = _ref => {
104
104
  debouncedTrackRedirection.cancel();
105
105
  };
106
106
  }, [debouncedTrackRedirection]);
107
- const handleClickButton = () => {
108
- debouncedTrackRedirection(ratesTableLink);
109
- if (ratesTableLink) window.open(ratesTableLink, '_blank');
107
+ const handleClickButton = link => {
108
+ debouncedTrackRedirection(link);
109
+ if (link) window.open(link, '_blank');
110
110
  };
111
111
  return /*#__PURE__*/_react.default.createElement("div", {
112
112
  className: _stylesModule.default.container
@@ -121,7 +121,7 @@ const RateCard = _ref => {
121
121
  }, title), /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
122
122
  colorTheme: "gray",
123
123
  dataTestId: smartBillTestIds.rateCard.helpText
124
- }, helpText), banner && limitSubsidyValue !== 0 && totalConsumption > limitSubsidyValue && /*#__PURE__*/_react.default.createElement("div", {
124
+ }, helpText), !(0, _isEmpty.default)(banner.label) && limitSubsidyValue !== 0 && totalConsumption > limitSubsidyValue && /*#__PURE__*/_react.default.createElement("div", {
125
125
  className: _stylesModule.default.bannerDetail,
126
126
  "data-testid": smartBillTestIds.rateCard.banner
127
127
  }, /*#__PURE__*/_react.default.createElement(_energyUi.UTIcon, {
@@ -176,7 +176,7 @@ const RateCard = _ref => {
176
176
  dataTestId: smartBillTestIds.rateCard.levelLabel,
177
177
  variant: "subtitle1"
178
178
  }, banner.level?.(levelNumber)), /*#__PURE__*/_react.default.createElement(_energyUi.UTTooltip, {
179
- content: tooltipText,
179
+ content: rateCardTranslations[`tooltipSubsidy${levelNumber}`],
180
180
  dataTestId: smartBillTestIds.rateCard.levelTooltip
181
181
  }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_energyUi.UTIcon, {
182
182
  name: "IconHelp"
@@ -208,7 +208,7 @@ const RateCard = _ref => {
208
208
  dataTestId: smartBillTestIds.rateCard.seeRatesTable,
209
209
  Icon: "IconChevronRight",
210
210
  iconPlacement: "right",
211
- onClick: handleClickButton,
211
+ onClick: () => handleClickButton(ratesTableLink),
212
212
  variant: "text"
213
213
  }, seeRatesTable), !(0, _isEmpty.default)(seeBill) && /*#__PURE__*/_react.default.createElement(_energyUi.UTButton, {
214
214
  classNames: {
@@ -219,7 +219,7 @@ const RateCard = _ref => {
219
219
  dataTestId: smartBillTestIds.rateCard.seeBill,
220
220
  Icon: "IconChevronRight",
221
221
  iconPlacement: "right",
222
- onClick: handleClickButton,
222
+ onClick: () => handleClickButton(meetBillLink),
223
223
  variant: "text"
224
224
  }, seeBill)));
225
225
  };
@@ -231,6 +231,7 @@ RateCard.propTypes = {
231
231
  normalizedRate: _propTypes.string,
232
232
  rateCardTranslations: _propTypes.object,
233
233
  ratesTableLink: _propTypes.string,
234
+ meetBillLink: _propTypes.string,
234
235
  seeFooter: _propTypes.bool,
235
236
  smallTitle: _propTypes.bool,
236
237
  smartBill: _propTypes.object,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widergy/utilitygo-smart-bill-web",
3
- "version": "3.20.0",
3
+ "version": "3.20.2",
4
4
  "description": "UtilityGO SmartBill Web",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",