@widergy/utilitygo-smart-bill-web 3.6.1 → 3.6.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 +7 -0
- package/dist/components/SmartBillSummary/components/AIPanel/index.js +1 -0
- package/dist/components/SmartBillSummary/components/AIPanel/styles.module.scss +4 -0
- package/dist/components/SmartBillSummary/index.js +13 -13
- package/dist/components/SmartBillSummary/tabs/Billing/components/RateCard/components/ProgressBar/index.js +2 -2
- package/dist/components/SmartBillSummary/tabs/Billing/components/RateCard/components/ProgressBar/utils.js +1 -1
- package/dist/components/SmartBillSummary/tabs/Billing/components/RateCard/index.js +19 -29
- package/dist/components/SmartBillSummary/tabs/Billing/index.js +0 -4
- package/dist/components/SmartBillSummary/tabs/Billing/styles.module.scss +14 -1
- package/dist/components/SmartBillSummary/tabs/Consumptions/components/BimestralConsumption/styles.module.scss +6 -0
- package/dist/components/SmartBillSummary/tabs/Consumptions/components/CurrentConsumption/index.js +2 -2
- package/dist/components/SmartBillSummary/tabs/Consumptions/components/CurrentConsumption/utils.js +2 -1
- package/dist/components/SmartBillSummary/tabs/Consumptions/styles.module.scss +5 -0
- package/dist/components/SmartBillSummary/utils.js +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [3.6.2](https://github.com/widergy/UtilityGO-Smart-Bill-Web/compare/v3.6.1...v3.6.2) (2025-05-26)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* [CX-689] smartbill visual fixes ([#51](https://github.com/widergy/UtilityGO-Smart-Bill-Web/issues/51)) ([1f9a1b9](https://github.com/widergy/UtilityGO-Smart-Bill-Web/commit/1f9a1b9cce714a9ada91faee97c47b33b0b787df))
|
|
7
|
+
|
|
1
8
|
## [3.6.1](https://github.com/widergy/UtilityGO-Smart-Bill-Web/compare/v3.6.0...v3.6.1) (2025-05-16)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -94,6 +94,7 @@ const AIPanel = _ref => {
|
|
|
94
94
|
name: notEnoughBills ? 'IconFileX' : 'IconCircleX',
|
|
95
95
|
shade: "04"
|
|
96
96
|
}), /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, null, notEnoughBills ? notEnoughBillsContent : errorContent)) : answerContent ? /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
97
|
+
className: _stylesModule.default.answerContent,
|
|
97
98
|
withMarkdown: true
|
|
98
99
|
}, answerContent), /*#__PURE__*/_react.default.createElement("div", {
|
|
99
100
|
className: _stylesModule.default.generatedByLabel
|
|
@@ -19,14 +19,8 @@ const SmartBillSummary = _ref => {
|
|
|
19
19
|
let {
|
|
20
20
|
assets,
|
|
21
21
|
constants,
|
|
22
|
-
consumptionLevels,
|
|
23
22
|
components,
|
|
24
|
-
currentAccount,
|
|
25
|
-
getGlossaryData,
|
|
26
|
-
glossaryData,
|
|
27
|
-
glossaryLoading,
|
|
28
23
|
handlers,
|
|
29
|
-
isDesktopSize,
|
|
30
24
|
loading,
|
|
31
25
|
smartBill,
|
|
32
26
|
tabOptions,
|
|
@@ -36,16 +30,23 @@ const SmartBillSummary = _ref => {
|
|
|
36
30
|
const {
|
|
37
31
|
aiQuestionsList,
|
|
38
32
|
aiQuestionsPanelEnabled,
|
|
33
|
+
consumptionLevels,
|
|
34
|
+
currentAccount,
|
|
35
|
+
glossaryData,
|
|
36
|
+
glossaryError,
|
|
37
|
+
glossaryLoading,
|
|
38
|
+
isDesktopSize,
|
|
39
39
|
notEnoughBillsErrorType,
|
|
40
40
|
smartBillAIAnswer = {},
|
|
41
41
|
smartBillAIAnswerError,
|
|
42
42
|
smartBillAIAnswerLoading
|
|
43
43
|
} = constants;
|
|
44
44
|
const {
|
|
45
|
+
getGlossaryData,
|
|
45
46
|
getSmartBillAIAnswer,
|
|
46
47
|
resetSmartBillAIAnswers
|
|
47
48
|
} = handlers;
|
|
48
|
-
const filteredTabOptions = loading ? [] : (0, _utils.getTabOptions)(tabOptions, smartBill);
|
|
49
|
+
const filteredTabOptions = loading ? [] : (0, _utils.getTabOptions)(isDesktopSize, tabOptions, smartBill);
|
|
49
50
|
const defaultCurrentTab = (0, _utils.getDefaultCurrentTab)(filteredTabOptions);
|
|
50
51
|
const [currentTab, setCurrentTab] = (0, _react.useState)(defaultCurrentTab);
|
|
51
52
|
const [aiPanelIsOpen, setAiPanelIsOpen] = (0, _react.useState)(false);
|
|
@@ -58,6 +59,11 @@ const SmartBillSummary = _ref => {
|
|
|
58
59
|
(0, _react.useEffect)(() => {
|
|
59
60
|
if (defaultCurrentTab) changeCurrentTab(defaultCurrentTab);
|
|
60
61
|
}, [defaultCurrentTab]);
|
|
62
|
+
(0, _react.useEffect)(() => {
|
|
63
|
+
if (glossaryError && !glossaryLoading && defaultCurrentTab) {
|
|
64
|
+
changeCurrentTab(defaultCurrentTab);
|
|
65
|
+
}
|
|
66
|
+
}, [defaultCurrentTab, glossaryError, glossaryLoading]);
|
|
61
67
|
return /*#__PURE__*/_react.default.createElement(_energyUi.UTLoading, {
|
|
62
68
|
className: _stylesModule.default.loadingContainer,
|
|
63
69
|
loading: loading
|
|
@@ -112,18 +118,12 @@ const SmartBillSummary = _ref => {
|
|
|
112
118
|
SmartBillSummary.propTypes = {
|
|
113
119
|
assets: _propTypes.object,
|
|
114
120
|
constants: _propTypes.object,
|
|
115
|
-
consumptionLevels: _propTypes.array,
|
|
116
121
|
components: (0, _propTypes.shape)({
|
|
117
122
|
[_propTypes.string]: _propTypes.elementType
|
|
118
123
|
}),
|
|
119
|
-
currentAccount: _propTypes.array,
|
|
120
|
-
getGlossaryData: undefined || _propTypes.object,
|
|
121
|
-
glossaryData: undefined || _propTypes.object,
|
|
122
|
-
glossaryLoading: _propTypes.bool,
|
|
123
124
|
handlers: (0, _propTypes.shape)({
|
|
124
125
|
[_propTypes.string]: _propTypes.func
|
|
125
126
|
}),
|
|
126
|
-
isDesktopSize: _propTypes.bool,
|
|
127
127
|
loading: _propTypes.bool,
|
|
128
128
|
smartBill: _billDataTypes.billDataTypes,
|
|
129
129
|
tabOptions: (0, _propTypes.arrayOf)((0, _propTypes.shape)({
|
|
@@ -46,7 +46,7 @@ const ProgressBar = _ref => {
|
|
|
46
46
|
value
|
|
47
47
|
}) || {};
|
|
48
48
|
const consumptionPercentage = (0, _utils.getConsumptionPercentage)(value, limitValue, isOverLimit) || _constants.MAX_VALUE_PROGRESS;
|
|
49
|
-
const shouldRenderDynamicLabel = value > 0 && limitValue > 0;
|
|
49
|
+
const shouldRenderDynamicLabel = value > 0 && limitValue > 0 && limitValue !== 'Infinity';
|
|
50
50
|
const [limitLabelWidth, setLimitLabelWidth] = (0, _react.useState)(0);
|
|
51
51
|
const limitLabelRef = (0, _react.useRef)(null);
|
|
52
52
|
(0, _react.useEffect)(() => {
|
|
@@ -94,7 +94,7 @@ const ProgressBar = _ref => {
|
|
|
94
94
|
className: _stylesModule.default.consumptionComparison
|
|
95
95
|
}, value >= 0 && /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
96
96
|
variant: "subtitle1"
|
|
97
|
-
}, currentValueLabel), value >= 0 && limitValue > 0 && /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
97
|
+
}, currentValueLabel), value >= 0 && limitValue > 0 && limitValue !== 'Infinity' && /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
98
98
|
colorTheme: "gray",
|
|
99
99
|
variant: "small"
|
|
100
100
|
}, contrastValueLabel)), tooltipContent && /*#__PURE__*/_react.default.createElement(_energyUi.UTTooltip, {
|
|
@@ -34,7 +34,7 @@ const formatLabels = _ref => {
|
|
|
34
34
|
return {
|
|
35
35
|
initialLabel: _constants.MIN_VALUE_PROGRESS,
|
|
36
36
|
dynamicLabel: isOverLimit ? contrastValueFormatted : currentValueFormatted,
|
|
37
|
-
finalLabel: isOverLimit || !limitValue ? currentValueFormatted : contrastValueFormatted,
|
|
37
|
+
finalLabel: isOverLimit || !limitValue || limitValue === 'Infinity' ? currentValueFormatted : contrastValueFormatted,
|
|
38
38
|
currentValueLabel: currentValueWithUnitLabel?.({
|
|
39
39
|
value: currentValueFormatted,
|
|
40
40
|
day: formatMaxPowerRegisteredDate(maxConsumptionDay)
|
|
@@ -38,13 +38,13 @@ const RateCard = _ref => {
|
|
|
38
38
|
} = rateCardTranslations;
|
|
39
39
|
const {
|
|
40
40
|
client,
|
|
41
|
-
detail,
|
|
42
41
|
periods
|
|
43
42
|
} = smartBill;
|
|
44
43
|
const purchasedRate = client?.rate?.purchased || '';
|
|
45
44
|
const periodsToCompare = (0, _utils.getConsumptionPeriodsToCompare)(periods);
|
|
46
45
|
const {
|
|
47
|
-
totalConsumption
|
|
46
|
+
totalConsumption,
|
|
47
|
+
totalConsumptionFormatted
|
|
48
48
|
} = (0, _utils.getConsumptionLabels)(periodsToCompare) || {};
|
|
49
49
|
const {
|
|
50
50
|
levels = []
|
|
@@ -71,17 +71,7 @@ const RateCard = _ref => {
|
|
|
71
71
|
const currentRate = rates[currentIndex] ?? {};
|
|
72
72
|
const startRateValue = Array.isArray(currentRate?.range) && currentRate.range[0];
|
|
73
73
|
const limitRateValue = Array.isArray(currentRate?.range) && currentRate.range.length > 0 && currentRate.range[currentRate.range.length - 1];
|
|
74
|
-
const
|
|
75
|
-
const fixedCharges = concepts?.[0];
|
|
76
|
-
const variableCharges = concepts?.[1];
|
|
77
|
-
const {
|
|
78
|
-
title: fixedChargeTitle,
|
|
79
|
-
amount: fixedChargeValue
|
|
80
|
-
} = fixedCharges || {};
|
|
81
|
-
const {
|
|
82
|
-
title: variableChargeTitle,
|
|
83
|
-
amount: variableChargeValue
|
|
84
|
-
} = variableCharges || {};
|
|
74
|
+
const charges = client?.rate?.charges || [];
|
|
85
75
|
const isT1 = purchasedRate.includes('T1');
|
|
86
76
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
87
77
|
className: _stylesModule.default.container
|
|
@@ -117,26 +107,26 @@ const RateCard = _ref => {
|
|
|
117
107
|
}, /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
118
108
|
variant: "title3",
|
|
119
109
|
weight: "medium"
|
|
120
|
-
},
|
|
110
|
+
}, totalConsumptionFormatted, " ", unit), /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
121
111
|
colorTheme: "gray",
|
|
122
112
|
variant: "small"
|
|
123
113
|
}, yourConsumption))), /*#__PURE__*/_react.default.createElement("div", {
|
|
124
114
|
className: _stylesModule.default.footer
|
|
125
|
-
},
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
115
|
+
}, charges.map(_ref5 => {
|
|
116
|
+
let {
|
|
117
|
+
concept,
|
|
118
|
+
amount
|
|
119
|
+
} = _ref5;
|
|
120
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
121
|
+
className: _stylesModule.default.detail,
|
|
122
|
+
key: concept
|
|
123
|
+
}, /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
124
|
+
weight: "medium"
|
|
125
|
+
}, concept), /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
126
|
+
variant: "subtitle1",
|
|
127
|
+
weight: "medium"
|
|
128
|
+
}, formatAmount?.(amount)));
|
|
129
|
+
}), /*#__PURE__*/_react.default.createElement("a", {
|
|
140
130
|
className: _stylesModule.default.footerAction,
|
|
141
131
|
href: ratesTableLink,
|
|
142
132
|
rel: "noopener noreferrer",
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
padding: 24px 32px;
|
|
8
8
|
|
|
9
9
|
@media #{$mobile} {
|
|
10
|
+
grid-gap: 24px;
|
|
10
11
|
padding: 24px 16px;
|
|
11
12
|
}
|
|
12
13
|
}
|
|
@@ -14,8 +15,10 @@
|
|
|
14
15
|
.billHeader {
|
|
15
16
|
align-items: center;
|
|
16
17
|
background-color: var(--light01);
|
|
18
|
+
border-radius: 8px;
|
|
17
19
|
box-shadow: var(--shadowGrayBottom1);
|
|
18
20
|
display: flex;
|
|
21
|
+
flex-wrap: wrap;
|
|
19
22
|
grid-gap: 16px;
|
|
20
23
|
justify-content: space-between;
|
|
21
24
|
padding: 12px 16px;
|
|
@@ -30,9 +33,15 @@
|
|
|
30
33
|
.billHeaderLabels {
|
|
31
34
|
align-items: center;
|
|
32
35
|
display: flex;
|
|
36
|
+
flex-wrap: wrap;
|
|
33
37
|
grid-gap: 32px;
|
|
34
38
|
justify-content: space-between;
|
|
35
39
|
padding: 16px 0;
|
|
40
|
+
|
|
41
|
+
@media #{$mobile} {
|
|
42
|
+
grid-gap: 16px;
|
|
43
|
+
padding: 0;
|
|
44
|
+
}
|
|
36
45
|
}
|
|
37
46
|
|
|
38
47
|
.valueAndHelpText {
|
|
@@ -46,6 +55,10 @@
|
|
|
46
55
|
flex: 1;
|
|
47
56
|
flex-wrap: wrap;
|
|
48
57
|
grid-gap: 32px;
|
|
58
|
+
|
|
59
|
+
@media #{$mobile} {
|
|
60
|
+
grid-gap: 24px;
|
|
61
|
+
}
|
|
49
62
|
}
|
|
50
63
|
|
|
51
64
|
.column {
|
|
@@ -117,7 +130,7 @@
|
|
|
117
130
|
|
|
118
131
|
.totalCard {
|
|
119
132
|
background-color: var(--light01);
|
|
120
|
-
border-radius:
|
|
133
|
+
border-radius: 8px;
|
|
121
134
|
box-shadow: var(--shadowGrayBottom1);
|
|
122
135
|
display: flex;
|
|
123
136
|
flex-direction: column;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@import '../../../../../../scss/variables/mediaQueries.module.scss';
|
|
2
|
+
|
|
1
3
|
$bimestral-consumption-card-min-width: 328px;
|
|
2
4
|
|
|
3
5
|
.bimestralConsumption {
|
|
@@ -18,6 +20,10 @@ $bimestral-consumption-card-min-width: 328px;
|
|
|
18
20
|
flex-wrap: wrap;
|
|
19
21
|
grid-gap: 32px;
|
|
20
22
|
justify-content: space-between;
|
|
23
|
+
|
|
24
|
+
@media #{$mobile} {
|
|
25
|
+
grid-gap: 24px;
|
|
26
|
+
}
|
|
21
27
|
}
|
|
22
28
|
|
|
23
29
|
.bimestralConsumptionCardHeader {
|
package/dist/components/SmartBillSummary/tabs/Consumptions/components/CurrentConsumption/index.js
CHANGED
|
@@ -24,7 +24,7 @@ const CurrentConsumption = _ref => {
|
|
|
24
24
|
} = smartBill || {};
|
|
25
25
|
const periodsToCompare = (0, _utils.getConsumptionPeriodsToCompare)(periods);
|
|
26
26
|
const {
|
|
27
|
-
|
|
27
|
+
totalConsumptionFormatted,
|
|
28
28
|
unit,
|
|
29
29
|
description
|
|
30
30
|
} = (0, _utils.getConsumptionLabels)(periodsToCompare, texts) || {};
|
|
@@ -41,7 +41,7 @@ const CurrentConsumption = _ref => {
|
|
|
41
41
|
}, /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
42
42
|
variant: "title1",
|
|
43
43
|
weight: "medium"
|
|
44
|
-
},
|
|
44
|
+
}, totalConsumptionFormatted), /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
|
45
45
|
variant: "subtitle1",
|
|
46
46
|
weight: "medium"
|
|
47
47
|
}, unit)), /*#__PURE__*/_react.default.createElement(_energyUi.UTLabel, {
|
package/dist/components/SmartBillSummary/tabs/Consumptions/components/CurrentConsumption/utils.js
CHANGED
|
@@ -49,7 +49,8 @@ const getConsumptionLabels = function () {
|
|
|
49
49
|
});
|
|
50
50
|
return {
|
|
51
51
|
description,
|
|
52
|
-
totalConsumption: (
|
|
52
|
+
totalConsumption: Number(totalConsumptionValue),
|
|
53
|
+
totalConsumptionFormatted: (0, _numeral.default)(totalConsumptionValue).format('0,0.[00]'),
|
|
53
54
|
unit: totalConsumptionUnit
|
|
54
55
|
};
|
|
55
56
|
};
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
padding: 24px 32px;
|
|
8
8
|
|
|
9
9
|
@media #{$mobile} {
|
|
10
|
+
grid-gap: 24px;
|
|
10
11
|
padding: 24px 16px;
|
|
11
12
|
}
|
|
12
13
|
}
|
|
@@ -22,6 +23,10 @@
|
|
|
22
23
|
flex: 1;
|
|
23
24
|
flex-wrap: wrap;
|
|
24
25
|
grid-gap: 32px;
|
|
26
|
+
|
|
27
|
+
@media #{$mobile} {
|
|
28
|
+
grid-gap: 24px;
|
|
29
|
+
}
|
|
25
30
|
}
|
|
26
31
|
|
|
27
32
|
.consumptionDetail {
|
|
@@ -10,13 +10,13 @@ var _lodash = require("lodash");
|
|
|
10
10
|
var _tabs = require("../../shared/constants/tabs");
|
|
11
11
|
var _constants = require("./constants");
|
|
12
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
-
const getTabOptions = (tabOptions, smartBill) => {
|
|
13
|
+
const getTabOptions = (isDesktopSize, tabOptions, smartBill) => {
|
|
14
14
|
const hasBimestralPeriodicity = smartBill?.periods?.some(period => period.settlements?.periodicity === _constants.BIMESTRAL_PERIODICITY);
|
|
15
15
|
return tabOptions.map(tab => ({
|
|
16
16
|
...tab,
|
|
17
|
-
icon: /*#__PURE__*/_react.default.createElement(_energyUi.UTIcon, {
|
|
17
|
+
icon: isDesktopSize ? /*#__PURE__*/_react.default.createElement(_energyUi.UTIcon, {
|
|
18
18
|
name: tab.icon
|
|
19
|
-
})
|
|
19
|
+
}) : null
|
|
20
20
|
})).filter(_ref => {
|
|
21
21
|
let {
|
|
22
22
|
enabled,
|