@widergy/utilitygo-smart-bill-web 3.17.0 → 3.18.1
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 +14 -0
- package/dist/components/ConsumptionComparison/components/ComparisonTable/utils.js +9 -7
- package/dist/components/SmartBillSummary/index.js +12 -0
- package/dist/components/SmartBillSummary/tabs/Billing/components/BillHeader/index.js +3 -0
- package/dist/components/SmartBillSummary/tabs/Billing/components/SecondHeader/index.js +53 -0
- package/dist/components/SmartBillSummary/tabs/Billing/components/SecondHeader/styles.module.scss +40 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [3.18.1](https://github.com/widergy/UtilityGO-Smart-Bill-Web/compare/v3.18.0...v3.18.1) (2025-12-09)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* loading when download smartbill ([#74](https://github.com/widergy/UtilityGO-Smart-Bill-Web/issues/74)) ([a3b9bb3](https://github.com/widergy/UtilityGO-Smart-Bill-Web/commit/a3b9bb32b1efb5956289187bc6d78bc88435e85a))
|
|
7
|
+
|
|
8
|
+
# [3.18.0](https://github.com/widergy/UtilityGO-Smart-Bill-Web/compare/v3.17.0...v3.18.0) (2025-11-06)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* [evep-228] step two change ([#71](https://github.com/widergy/UtilityGO-Smart-Bill-Web/issues/71)) ([c93b798](https://github.com/widergy/UtilityGO-Smart-Bill-Web/commit/c93b79824c15ceadd9da5f50cb80396a21850c48))
|
|
14
|
+
|
|
1
15
|
# [3.17.0](https://github.com/widergy/UtilityGO-Smart-Bill-Web/compare/v3.16.0...v3.17.0) (2025-11-06)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -5,12 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.mobileGetTableLines = exports.getPeriodFields = exports.desktopGetTableLines = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
8
9
|
var _DataLine = _interopRequireDefault(require("./components/DataLine"));
|
|
9
10
|
var _constants = require("./constants");
|
|
10
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
12
|
const getPeriodFields = function (contextApiInfo, period, periodAverageTemperature, withPowerComparison, isDesktop) {
|
|
12
13
|
let stylingOptions = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
|
|
13
14
|
let options = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : {};
|
|
15
|
+
let temporalyDisabled = arguments.length > 7 ? arguments[7] : undefined;
|
|
14
16
|
const {
|
|
15
17
|
config
|
|
16
18
|
} = contextApiInfo;
|
|
@@ -34,9 +36,9 @@ const getPeriodFields = function (contextApiInfo, period, periodAverageTemperatu
|
|
|
34
36
|
gray,
|
|
35
37
|
semibold
|
|
36
38
|
} = stylingOptions;
|
|
37
|
-
const formattedPeriod = period.number && period.year && `${period.number}/${period.year}
|
|
39
|
+
const formattedPeriod = period.number && period.year && !temporalyDisabled ? `${period.number}/${period.year}` : (0, _dayjs.default)(period.settlements?.end_date).tz().format('MM/YYYY');
|
|
38
40
|
const mobileLastYearPeriodFormatted = period.lastYearPeriod?.number && period.lastYearPeriod?.year && `${period.lastYearPeriod?.number}/${period.lastYearPeriod?.year}`;
|
|
39
|
-
const mobileCurrentYearPeriodFormatted = period.currentPeriod?.number && period.currentPeriod?.year && `${period.currentPeriod?.number}/${period.currentPeriod?.year}
|
|
41
|
+
const mobileCurrentYearPeriodFormatted = period.currentPeriod?.number && period.currentPeriod?.year && !temporalyDisabled ? `${period.currentPeriod?.number}/${period.currentPeriod?.year}` : (0, _dayjs.default)(period.currentPeriod?.settlements?.end_date).tz().format('MM/YYYY');
|
|
40
42
|
let noDataLastYearPeriod = false;
|
|
41
43
|
let noDataCurrentPeriod = false;
|
|
42
44
|
if (!isDesktop) {
|
|
@@ -93,13 +95,13 @@ const getPeriodFields = function (contextApiInfo, period, periodAverageTemperatu
|
|
|
93
95
|
}, _constants.FIELD_AVERAGE_TEMPERATURE)] : {};
|
|
94
96
|
};
|
|
95
97
|
exports.getPeriodFields = getPeriodFields;
|
|
96
|
-
const renderDataLine = (contextApiInfo, mobilePeriod, mobilePeriodAverageTemperature, withPowerComparison, isDesktop, data) => /*#__PURE__*/_react.default.createElement(_DataLine.default, {
|
|
98
|
+
const renderDataLine = (contextApiInfo, mobilePeriod, mobilePeriodAverageTemperature, withPowerComparison, isDesktop, data, temporalyDisabled) => /*#__PURE__*/_react.default.createElement(_DataLine.default, {
|
|
97
99
|
key: "",
|
|
98
100
|
fields: getPeriodFields(contextApiInfo, mobilePeriod, mobilePeriodAverageTemperature, withPowerComparison, isDesktop, {
|
|
99
101
|
primary: true,
|
|
100
102
|
gray: true,
|
|
101
103
|
semibold: true
|
|
102
|
-
}, data),
|
|
104
|
+
}, data, temporalyDisabled),
|
|
103
105
|
isDesktop: isDesktop
|
|
104
106
|
});
|
|
105
107
|
const desktopGetTableLines = (contextApiInfo, currentPeriod, currentPeriodAverageTemperature, lastYearPeriod, lastYearPeriodAverageTemperature, isDesktop, withPowerComparison, temporalyDisabled) => {
|
|
@@ -118,7 +120,7 @@ const desktopGetTableLines = (contextApiInfo, currentPeriod, currentPeriodAverag
|
|
|
118
120
|
semibold: true
|
|
119
121
|
}, {
|
|
120
122
|
current: true
|
|
121
|
-
}),
|
|
123
|
+
}, temporalyDisabled),
|
|
122
124
|
idModifier: "current_period",
|
|
123
125
|
isDesktop: isDesktop,
|
|
124
126
|
key: "current_period"
|
|
@@ -127,7 +129,7 @@ const desktopGetTableLines = (contextApiInfo, currentPeriod, currentPeriodAverag
|
|
|
127
129
|
Component: /*#__PURE__*/_react.default.createElement(_DataLine.default, {
|
|
128
130
|
fields: getPeriodFields(contextApiInfo, lastYearPeriod, showTemp && lastYearPeriodAverageTemperature, withPowerComparison, isDesktop, {
|
|
129
131
|
gray: true
|
|
130
|
-
}),
|
|
132
|
+
}, temporalyDisabled),
|
|
131
133
|
idModifier: "last_year_period",
|
|
132
134
|
isDesktop: isDesktop,
|
|
133
135
|
key: "last_year_period"
|
|
@@ -149,7 +151,7 @@ const mobileGetTableLines = (contextApiInfo, currentPeriod, currentPeriodAverage
|
|
|
149
151
|
})
|
|
150
152
|
};
|
|
151
153
|
return [{
|
|
152
|
-
Component: /*#__PURE__*/_react.default.createElement("div", null, _constants.dataFieldDictonary.map(data => renderDataLine(contextApiInfo, mobilePeriod, mobilePeriodAverageTemperature, withPowerComparison, isDesktop, data)))
|
|
154
|
+
Component: /*#__PURE__*/_react.default.createElement("div", null, _constants.dataFieldDictonary.map(data => renderDataLine(contextApiInfo, mobilePeriod, mobilePeriodAverageTemperature, withPowerComparison, isDesktop, data, temporalyDisabled)))
|
|
153
155
|
}];
|
|
154
156
|
};
|
|
155
157
|
exports.mobileGetTableLines = mobileGetTableLines;
|
|
@@ -14,6 +14,7 @@ var _utils = require("./utils");
|
|
|
14
14
|
var _AIPanel = _interopRequireDefault(require("./components/AIPanel"));
|
|
15
15
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
16
16
|
var _BillHeader = _interopRequireDefault(require("./tabs/Billing/components/BillHeader"));
|
|
17
|
+
var _SecondHeader = _interopRequireDefault(require("./tabs/Billing/components/SecondHeader"));
|
|
17
18
|
var _utils2 = require("./tabs/Billing/utils");
|
|
18
19
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
20
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
@@ -27,6 +28,7 @@ const SmartBillSummary = _ref => {
|
|
|
27
28
|
components,
|
|
28
29
|
constants,
|
|
29
30
|
downloadSmartbillEnabled,
|
|
31
|
+
downloadSmartBillLoading,
|
|
30
32
|
handlers,
|
|
31
33
|
loading,
|
|
32
34
|
showOnboarding = false,
|
|
@@ -152,8 +154,17 @@ const SmartBillSummary = _ref => {
|
|
|
152
154
|
debtStatusValidation: smartBill.debt_status_label !== null,
|
|
153
155
|
debtStatusLabel: smartBill.debt_status_label,
|
|
154
156
|
downloadSmartbillEnabled,
|
|
157
|
+
downloadSmartBillLoading,
|
|
155
158
|
handleDownloadSmartBill,
|
|
156
159
|
smartBill
|
|
160
|
+
}), tabs.find(tab => tab.value === currentTab)?.header && /*#__PURE__*/_react.default.createElement(_SecondHeader.default, {
|
|
161
|
+
accountNumber: smartBill.client?.client_number,
|
|
162
|
+
accountNumberHelpText: translations.billingTab.secondHeader?.accountNumberHelpText,
|
|
163
|
+
supplyAddress: smartBill.client?.account_address,
|
|
164
|
+
city: currentAccount?.city,
|
|
165
|
+
district: currentAccount?.district,
|
|
166
|
+
supplyAddressHelpText: translations.billingTab.secondHeader?.supplyAddressHelpText,
|
|
167
|
+
clientNumberFormatter: utils?.formatters?.clientNumberFormatter
|
|
157
168
|
}), _constants.TAB_COMPONENT_MAPPER?.[currentTab]?.({
|
|
158
169
|
assets,
|
|
159
170
|
billingLayout,
|
|
@@ -220,6 +231,7 @@ SmartBillSummary.propTypes = {
|
|
|
220
231
|
}),
|
|
221
232
|
constants: _propTypes.object,
|
|
222
233
|
downloadSmartbillEnabled: _propTypes.bool,
|
|
234
|
+
downloadSmartBillLoading: _propTypes.bool,
|
|
223
235
|
handlers: (0, _propTypes.shape)({
|
|
224
236
|
[_propTypes.string]: _propTypes.func
|
|
225
237
|
}),
|
|
@@ -21,6 +21,7 @@ const BillHeader = _ref => {
|
|
|
21
21
|
debtStatusLabel,
|
|
22
22
|
debtStatusValidation,
|
|
23
23
|
downloadSmartbillEnabled,
|
|
24
|
+
downloadSmartBillLoading,
|
|
24
25
|
handleDownloadSmartBill,
|
|
25
26
|
issuedOnDate,
|
|
26
27
|
smartBill,
|
|
@@ -58,6 +59,7 @@ const BillHeader = _ref => {
|
|
|
58
59
|
variant: "text",
|
|
59
60
|
disabled: true
|
|
60
61
|
}, "Anexos"), downloadSmartbillEnabled && /*#__PURE__*/_react.default.createElement(_energyUi.UTButton, {
|
|
62
|
+
loading: downloadSmartBillLoading,
|
|
61
63
|
onClick: handleDownloadSmartBill,
|
|
62
64
|
Icon: "IconDownload",
|
|
63
65
|
variant: "text"
|
|
@@ -72,6 +74,7 @@ BillHeader.propTypes = {
|
|
|
72
74
|
debtStatusLabel: _propTypes.string,
|
|
73
75
|
debtStatusValidation: _propTypes.bool,
|
|
74
76
|
downloadSmartbillEnabled: _propTypes.bool,
|
|
77
|
+
downloadSmartBillLoading: _propTypes.bool,
|
|
75
78
|
handleDownloadSmartBill: _propTypes.func,
|
|
76
79
|
issuedOnDate: _propTypes.string,
|
|
77
80
|
smartBill: _propTypes.object,
|
|
@@ -0,0 +1,53 @@
|
|
|
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 SecondHeader = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
accountNumber,
|
|
15
|
+
accountNumberHelpText,
|
|
16
|
+
supplyAddress,
|
|
17
|
+
city,
|
|
18
|
+
district,
|
|
19
|
+
supplyAddressHelpText,
|
|
20
|
+
clientNumberFormatter
|
|
21
|
+
} = _ref;
|
|
22
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
23
|
+
className: _stylesModule.default.secondHeader
|
|
24
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
25
|
+
className: _stylesModule.default.accountNumber
|
|
26
|
+
}, /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
27
|
+
variant: "small",
|
|
28
|
+
weight: "bold"
|
|
29
|
+
}, accountNumber && clientNumberFormatter?.(accountNumber) || accountNumber), /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
30
|
+
colorTheme: "gray",
|
|
31
|
+
variant: "small"
|
|
32
|
+
}, accountNumberHelpText)), /*#__PURE__*/_react.default.createElement("div", {
|
|
33
|
+
className: _stylesModule.default.locationTooltip
|
|
34
|
+
}, /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
35
|
+
variant: "small",
|
|
36
|
+
weight: "bold"
|
|
37
|
+
}, supplyAddress), /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
38
|
+
variant: "small"
|
|
39
|
+
}, `${city} - ${district}`), /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
40
|
+
colorTheme: "gray",
|
|
41
|
+
variant: "small"
|
|
42
|
+
}, supplyAddressHelpText)));
|
|
43
|
+
};
|
|
44
|
+
SecondHeader.propTypes = {
|
|
45
|
+
accountNumber: _propTypes.string,
|
|
46
|
+
accountNumberHelpText: _propTypes.string,
|
|
47
|
+
supplyAddress: _propTypes.string,
|
|
48
|
+
city: _propTypes.string,
|
|
49
|
+
district: _propTypes.string,
|
|
50
|
+
supplyAddressHelpText: _propTypes.string,
|
|
51
|
+
clientNumberFormatter: _propTypes.func
|
|
52
|
+
};
|
|
53
|
+
var _default = exports.default = SecondHeader;
|
package/dist/components/SmartBillSummary/tabs/Billing/components/SecondHeader/styles.module.scss
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
@import '../../../../../../scss/variables/mediaQueries.module.scss';
|
|
2
|
+
|
|
3
|
+
.secondHeader {
|
|
4
|
+
align-items: center;
|
|
5
|
+
background-color: var(--light01);
|
|
6
|
+
border-radius: 8px;
|
|
7
|
+
box-shadow: var(--shadowGrayBottom1);
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-wrap: wrap;
|
|
10
|
+
grid-gap: 50%;
|
|
11
|
+
justify-content: flex-start;
|
|
12
|
+
padding: 24px 48px;
|
|
13
|
+
margin: 16px 32px 0 32px;
|
|
14
|
+
|
|
15
|
+
@media #{$mobile} {
|
|
16
|
+
margin: 16px 16px 0 16px;
|
|
17
|
+
padding: 16px;
|
|
18
|
+
flex-wrap: nowrap;
|
|
19
|
+
justify-content: space-between;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.accountNumber {
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
align-items: flex-start;
|
|
27
|
+
grid-gap: 4px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.locationTooltip {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
grid-gap: 4px;
|
|
34
|
+
text-align: left;
|
|
35
|
+
align-items: flex-start;
|
|
36
|
+
|
|
37
|
+
@media #{$mobile} {
|
|
38
|
+
text-align: left;
|
|
39
|
+
}
|
|
40
|
+
}
|