@widergy/utilitygo-smart-bill-web 3.13.0 → 3.14.0

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.14.0](https://github.com/widergy/UtilityGO-Smart-Bill-Web/compare/v3.13.1...v3.14.0) (2025-10-07)
2
+
3
+
4
+ ### Features
5
+
6
+ * download button ([#65](https://github.com/widergy/UtilityGO-Smart-Bill-Web/issues/65)) ([51fb1c1](https://github.com/widergy/UtilityGO-Smart-Bill-Web/commit/51fb1c168d49b4cbe33019370c67610b0495bdf0))
7
+
8
+ ## [3.13.1](https://github.com/widergy/UtilityGO-Smart-Bill-Web/compare/v3.13.0...v3.13.1) (2025-09-30)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * [UGDESA-2719] visual fixes ([#64](https://github.com/widergy/UtilityGO-Smart-Bill-Web/issues/64)) ([2f8f778](https://github.com/widergy/UtilityGO-Smart-Bill-Web/commit/2f8f7780cf474c0859dd9ff6a5c50c2ab8bb75aa))
14
+
1
15
  # [3.13.0](https://github.com/widergy/UtilityGO-Smart-Bill-Web/compare/v3.12.0...v3.13.0) (2025-09-29)
2
16
 
3
17
 
@@ -26,6 +26,7 @@ const SmartBillSummary = _ref => {
26
26
  colors,
27
27
  components,
28
28
  constants,
29
+ downloadSmartbillEnabled,
29
30
  handlers,
30
31
  loading,
31
32
  showOnboarding = false,
@@ -57,6 +58,7 @@ const SmartBillSummary = _ref => {
57
58
  getGlossaryData,
58
59
  getSmartBillAIAnswer,
59
60
  getSmartBillAIQuestions,
61
+ handleDownloadSmartBill,
60
62
  resetSmartBillAIAnswers,
61
63
  trackAIFloatingButtonClick,
62
64
  trackTabChange
@@ -141,11 +143,14 @@ const SmartBillSummary = _ref => {
141
143
  annex,
142
144
  UtilityLogo: assets.billingTab.UtilityLogo,
143
145
  billNumber: smartBill.bill_number,
146
+ billType: smartBill.bill_type,
144
147
  billTypeHelpText: translations.billingTab.header.billTypeHelpText,
145
148
  issuedOnDate: (0, _utils2.getFormattedDate)((0, _utils2.getCurrentPeriod)(smartBill)?.settlements?.current?.issued_on),
146
149
  billIssueDate: translations.billingTab.header.billIssueDate,
147
150
  debtStatusValidation: smartBill.debt_status_label !== null,
148
151
  debtStatusLabel: smartBill.debt_status_label,
152
+ downloadSmartbillEnabled,
153
+ handleDownloadSmartBill,
149
154
  smartBill
150
155
  }), _constants.TAB_COMPONENT_MAPPER?.[currentTab]?.({
151
156
  assets,
@@ -208,6 +213,7 @@ SmartBillSummary.propTypes = {
208
213
  [_propTypes.string]: _propTypes.elementType
209
214
  }),
210
215
  constants: _propTypes.object,
216
+ downloadSmartbillEnabled: _propTypes.bool,
211
217
  handlers: (0, _propTypes.shape)({
212
218
  [_propTypes.string]: _propTypes.func
213
219
  }),
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _energyUi = require("@widergy/energy-ui");
9
+ var _propTypes = require("prop-types");
10
+ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
+ const AccountCard = _ref => {
13
+ let {
14
+ accountCardTitle,
15
+ meterNumber,
16
+ readingType,
17
+ meterNumberHelpText,
18
+ readingTypeHelpText
19
+ } = _ref;
20
+ return /*#__PURE__*/_react.default.createElement("div", {
21
+ className: _stylesModule.default.accountCard
22
+ }, /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
23
+ variant: "title2",
24
+ weight: "medium"
25
+ }, accountCardTitle), /*#__PURE__*/_react.default.createElement("div", {
26
+ className: _stylesModule.default.content
27
+ }, meterNumber && /*#__PURE__*/_react.default.createElement("div", {
28
+ className: _stylesModule.default.data
29
+ }, /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
30
+ className: _stylesModule.default.dataTitle,
31
+ weight: "bold"
32
+ }, meterNumber), /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
33
+ colorTheme: "gray"
34
+ }, meterNumberHelpText)), readingType && /*#__PURE__*/_react.default.createElement("div", {
35
+ className: _stylesModule.default.data
36
+ }, /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
37
+ className: _stylesModule.default.dataTitle,
38
+ weight: "bold"
39
+ }, readingType), /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
40
+ colorTheme: "gray"
41
+ }, readingTypeHelpText))));
42
+ };
43
+ AccountCard.propTypes = {
44
+ accountCardTitle: _propTypes.string,
45
+ meterNumber: _propTypes.string,
46
+ readingType: _propTypes.string,
47
+ meterNumberHelpText: _propTypes.string,
48
+ readingTypeHelpText: _propTypes.string
49
+ };
50
+ var _default = exports.default = AccountCard;
@@ -0,0 +1,25 @@
1
+ .accountCard {
2
+ background-color: var(--light01);
3
+ border-radius: 8px;
4
+ box-shadow: var(--shadowGrayBottom1);
5
+ display: flex;
6
+ flex-direction: column;
7
+ grid-gap: 24px;
8
+ padding: 24px;
9
+ }
10
+
11
+ .content {
12
+ display: flex;
13
+ }
14
+
15
+ .data {
16
+ display: flex;
17
+ flex: 1;
18
+ flex-direction: column;
19
+ grid-gap: 8px;
20
+ padding: 12px 0;
21
+ }
22
+
23
+ .dataTitle {
24
+ padding: 4px 0;
25
+ }
@@ -27,7 +27,8 @@ const ActionCards = _ref => {
27
27
  onClick,
28
28
  rightIcon,
29
29
  showStatus,
30
- title
30
+ title,
31
+ subtitle
31
32
  } = _ref2;
32
33
  return /*#__PURE__*/_react.default.createElement(_energyUi.UTTouchableWithoutFeedback, {
33
34
  className: `${_stylesModule.default.cardContainer} ${!onClick && _stylesModule.default.unclickableCardContainer}`,
@@ -38,11 +39,14 @@ const ActionCards = _ref => {
38
39
  }, isDesktopSize && /*#__PURE__*/_react.default.createElement(_energyUi.UTIcon, _extends({
39
40
  colorTheme: "gray",
40
41
  name: leftIcon
41
- }, leftIconProps)), /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
42
- className: _stylesModule.default.cardTitle,
42
+ }, leftIconProps)), /*#__PURE__*/_react.default.createElement("div", {
43
+ className: _stylesModule.default.cardContent
44
+ }, /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
43
45
  variant: "subtitle1",
44
46
  weight: "medium"
45
- }, title), showStatus && /*#__PURE__*/_react.default.createElement(_energyUi.UTStatus, {
47
+ }, title), subtitle && /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
48
+ colorTheme: "gray"
49
+ }, subtitle)), showStatus && /*#__PURE__*/_react.default.createElement(_energyUi.UTStatus, {
46
50
  type: "light",
47
51
  variant: isAdhered ? 'success' : 'unassigned',
48
52
  withoutIcon: !isAdhered
@@ -12,12 +12,15 @@
12
12
  transition: all 0.2s;
13
13
  }
14
14
 
15
- .unclickableCardContainer {
16
- cursor: default;
15
+ .cardContent {
16
+ display: flex;
17
+ flex-direction: column;
18
+ grid-gap: 4px;
19
+ flex: 1;
17
20
  }
18
21
 
19
- .cardTitle {
20
- flex: 1;
22
+ .unclickableCardContainer {
23
+ cursor: default;
21
24
  }
22
25
 
23
26
  .cardIconContainer {
@@ -7,20 +7,24 @@ exports.default = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _energyUi = require("@widergy/energy-ui");
9
9
  var _propTypes = require("prop-types");
10
+ var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
10
11
  var _DebtStatusLabel = _interopRequireDefault(require("../DebtStatusLabel"));
11
12
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
12
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
14
  const BillHeader = _ref => {
14
15
  let {
15
16
  annex,
16
- UtilityLogo,
17
+ billIssueDate,
17
18
  billNumber,
19
+ billType,
18
20
  billTypeHelpText,
19
- issuedOnDate,
20
- billIssueDate,
21
- debtStatusValidation,
22
21
  debtStatusLabel,
23
- smartBill
22
+ debtStatusValidation,
23
+ downloadSmartbillEnabled,
24
+ handleDownloadSmartBill,
25
+ issuedOnDate,
26
+ smartBill,
27
+ UtilityLogo
24
28
  } = _ref;
25
29
  return /*#__PURE__*/_react.default.createElement("div", {
26
30
  className: _stylesModule.default.billHeader
@@ -30,9 +34,14 @@ const BillHeader = _ref => {
30
34
  className: _stylesModule.default.logo
31
35
  }), /*#__PURE__*/_react.default.createElement("div", {
32
36
  className: _stylesModule.default.valueAndHelpText
33
- }, /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
37
+ }, /*#__PURE__*/_react.default.createElement("div", {
38
+ className: _stylesModule.default.billTypeAndNumberContainer
39
+ }, !(0, _isEmpty.default)(billType) && /*#__PURE__*/_react.default.createElement(_energyUi.UTStatus, {
40
+ variant: "unassigned",
41
+ withoutIcon: true
42
+ }, billType), /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
34
43
  variant: "small"
35
- }, billNumber), /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
44
+ }, billNumber)), /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
36
45
  colorTheme: "gray",
37
46
  variant: "small"
38
47
  }, billTypeHelpText)), /*#__PURE__*/_react.default.createElement("div", {
@@ -45,20 +54,27 @@ const BillHeader = _ref => {
45
54
  }, billIssueDate)), debtStatusValidation && /*#__PURE__*/_react.default.createElement(_DebtStatusLabel.default, {
46
55
  debtStatusLabel: debtStatusLabel,
47
56
  isWarning: smartBill?.warning
48
- })), annex && /*#__PURE__*/_react.default.createElement(_energyUi.UTButton, {
57
+ })), /*#__PURE__*/_react.default.createElement("div", null, annex && /*#__PURE__*/_react.default.createElement(_energyUi.UTButton, {
49
58
  variant: "text",
50
59
  disabled: true
51
- }, "Anexos"));
60
+ }, "Anexos"), downloadSmartbillEnabled && /*#__PURE__*/_react.default.createElement(_energyUi.UTButton, {
61
+ onClick: handleDownloadSmartBill,
62
+ Icon: "IconDownload",
63
+ variant: "text"
64
+ })));
52
65
  };
53
66
  BillHeader.propTypes = {
54
67
  annex: _propTypes.bool,
55
- UtilityLogo: _propTypes.elementType,
68
+ billIssueDate: _propTypes.string,
56
69
  billNumber: _propTypes.string,
70
+ billType: _propTypes.string,
57
71
  billTypeHelpText: _propTypes.string,
58
- issuedOnDate: _propTypes.string,
59
- billIssueDate: _propTypes.string,
60
- debtStatusValidation: _propTypes.bool,
61
72
  debtStatusLabel: _propTypes.string,
62
- smartBill: _propTypes.object
73
+ debtStatusValidation: _propTypes.bool,
74
+ downloadSmartbillEnabled: _propTypes.bool,
75
+ handleDownloadSmartBill: _propTypes.func,
76
+ issuedOnDate: _propTypes.string,
77
+ smartBill: _propTypes.object,
78
+ UtilityLogo: _propTypes.elementType
63
79
  };
64
80
  var _default = exports.default = BillHeader;
@@ -41,3 +41,9 @@
41
41
  flex-direction: column;
42
42
  grid-gap: 4px;
43
43
  }
44
+
45
+ .billTypeAndNumberContainer {
46
+ align-items: center;
47
+ display: flex;
48
+ grid-gap: 4px;
49
+ }
@@ -8,10 +8,12 @@ var _ActionCards = _interopRequireDefault(require("../ActionCards"));
8
8
  var _TitularCard = _interopRequireDefault(require("../TitularCard"));
9
9
  var _TotalCard = _interopRequireDefault(require("../TotalCard"));
10
10
  var _RateCard = _interopRequireDefault(require("../RateCard"));
11
+ var _AccountCard = _interopRequireDefault(require("../AccountCard"));
11
12
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
13
  const COMPONENTS = exports.COMPONENTS = {
13
14
  ActionCards: _ActionCards.default,
14
15
  TitularCard: _TitularCard.default,
15
16
  TotalCard: _TotalCard.default,
16
- RateCard: _RateCard.default
17
+ RateCard: _RateCard.default,
18
+ AccountCard: _AccountCard.default
17
19
  };
@@ -52,7 +52,8 @@ const Billing = _ref => {
52
52
  ratesTableLink,
53
53
  titularCard = {},
54
54
  totalAmountLabel,
55
- totalCard = {}
55
+ totalCard = {},
56
+ accountCard = {}
56
57
  } = translations;
57
58
  const {
58
59
  title: digitalBillTitle
@@ -70,6 +71,11 @@ const Billing = _ref => {
70
71
  clientNumberHelpText,
71
72
  ivaConditionHelpText
72
73
  } = titularCard;
74
+ const {
75
+ title: accountCardTitle,
76
+ meterNumberHelpText,
77
+ readingTypeHelpText
78
+ } = accountCard;
73
79
  const {
74
80
  firstExpiration,
75
81
  secondExpiration
@@ -77,10 +83,14 @@ const Billing = _ref => {
77
83
  const {
78
84
  client,
79
85
  detail,
80
- expirations
86
+ expirations,
87
+ meter_number: meterNumber,
88
+ reading_periods: readingPeriods
81
89
  } = smartBill;
90
+ const readingType = readingPeriods?.[0]?.type;
82
91
  const currentPeriod = (0, _utils.getCurrentPeriod)(smartBill);
83
92
  const isAdheredToDigitalBill = client?.adherence_to_digital_bill;
93
+ const emailDigitalBill = client?.email_digital_bill;
84
94
  const {
85
95
  account_address: accountAddress,
86
96
  client_number: clientNumber = '',
@@ -97,7 +107,7 @@ const Billing = _ref => {
97
107
  adherence_to_automatic_debit: adherenceToAutomaticDebit,
98
108
  normalized_rate: normalizedRate,
99
109
  subsidy_level: subsidy
100
- } = currentAccount;
110
+ } = currentAccount || {};
101
111
  const isAdheredToAutomaticDebit = adherenceToAutomaticDebit === adherenceStatus?.subscribed;
102
112
  const renderTitularFooter = clientNumber || ivaCondition;
103
113
  const actionCards = [{
@@ -105,7 +115,8 @@ const Billing = _ref => {
105
115
  leftIcon: 'IconReceipt',
106
116
  onClick: !isAdheredToDigitalBill && handleGoToDigitalBill,
107
117
  showStatus: true,
108
- title: digitalBillTitle
118
+ title: digitalBillTitle,
119
+ subtitle: emailDigitalBill
109
120
  }, {
110
121
  isAdhered: isAdheredToAutomaticDebit,
111
122
  leftIcon: 'IconCreditCard',
@@ -141,6 +152,11 @@ const Billing = _ref => {
141
152
  firstExpirationDate,
142
153
  secondExpiration,
143
154
  secondExpirationDate,
155
+ accountCardTitle,
156
+ meterNumber,
157
+ readingType,
158
+ meterNumberHelpText,
159
+ readingTypeHelpText,
144
160
  consumptionLevels,
145
161
  components,
146
162
  currentPeriod,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widergy/utilitygo-smart-bill-web",
3
- "version": "3.13.0",
3
+ "version": "3.14.0",
4
4
  "description": "UtilityGO SmartBill Web",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",