@widergy/utilitygo-smart-bill-web 2.2.2 → 3.0.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 +13 -0
- package/dist/components/Advice/index.js +10 -6
- package/dist/components/Amount/index.js +26 -21
- package/dist/components/Amount/utils.js +2 -5
- package/dist/components/Banner/index.js +10 -6
- package/dist/components/BarChart/constants.js +3 -3
- package/dist/components/BarChart/index.js +28 -22
- package/dist/components/BarChart/utils.js +17 -16
- package/dist/components/BillCalculation/components/ConceptCard/index.js +52 -45
- package/dist/components/BillCalculation/components/Glossary/index.js +48 -64
- package/dist/components/BillCalculation/components/Glossary/styles.module.scss +1 -0
- package/dist/components/BillCalculation/constants.js +1 -1
- package/dist/components/BillCalculation/index.js +48 -51
- package/dist/components/BillCalculation/utils.js +22 -22
- package/dist/components/BillSummary/components/BilledConcepts/components/Concept/index.js +25 -22
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/constants.js +1 -1
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/index.js +15 -15
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/styles.module.scss +3 -3
- package/dist/components/BillSummary/components/BilledConcepts/constants.js +13 -14
- package/dist/components/BillSummary/components/BilledConcepts/index.js +29 -39
- package/dist/components/BillSummary/components/BilledConcepts/utils.js +50 -69
- package/dist/components/BillSummary/index.js +70 -69
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/DataLine/index.js +8 -8
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/index.js +17 -10
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/utils.js +3 -2
- package/dist/components/ConsumptionComparison/components/ComparisonTable/constants.js +147 -133
- package/dist/components/ConsumptionComparison/components/ComparisonTable/index.js +16 -14
- package/dist/components/ConsumptionComparison/components/ComparisonTable/utils.js +88 -89
- package/dist/components/ConsumptionComparison/components/ConsumptionAdvice/index.js +21 -11
- package/dist/components/ConsumptionComparison/components/ConsumptionAdvice/utils.js +3 -2
- package/dist/components/ConsumptionComparison/components/PercentageComparison/index.js +21 -14
- package/dist/components/ConsumptionComparison/components/PercentageComparison/utils.js +15 -10
- package/dist/components/ConsumptionComparison/index.js +41 -45
- package/dist/components/ConsumptionEnergyDetails/components/ConsumptionEnergyComparison/index.js +27 -22
- package/dist/components/ConsumptionEnergyDetails/components/ConsumptionEnergyComparison/styles.module.scss +1 -1
- package/dist/components/ConsumptionEnergyDetails/components/ConsumptionInDaysLabel/index.js +18 -13
- package/dist/components/ConsumptionEnergyDetails/components/EnergyTotalConsumption/index.js +15 -12
- package/dist/components/ConsumptionEnergyDetails/components/PercentageComparison/index.js +21 -15
- package/dist/components/ConsumptionEnergyDetails/components/PercentageComparison/utils.js +3 -2
- package/dist/components/ConsumptionEnergyDetails/index.js +46 -41
- package/dist/components/ConsumptionEnergyDetails/styles.module.scss +2 -2
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/index.js +64 -60
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/utils.js +12 -13
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderConsumption/index.js +20 -17
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderSettlement/index.js +16 -10
- package/dist/components/ConsumptionIncluded/components/TimelineRow/index.js +42 -37
- package/dist/components/ConsumptionIncluded/components/TimelineRow/styles.module.scss +2 -2
- package/dist/components/ConsumptionIncluded/index.js +31 -32
- package/dist/components/ConsumptionIncluded/utils.js +32 -34
- package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/components/ReadingRow/index.js +14 -10
- package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/index.js +23 -20
- package/dist/components/ConsumptionPeriod/components/HistoryGraph/index.js +18 -26
- package/dist/components/ConsumptionPeriod/components/Reading/index.js +35 -32
- package/dist/components/ConsumptionPeriod/index.js +12 -8
- package/dist/components/ConsumptionPeriod/utils.js +14 -15
- package/dist/components/Date/index.js +12 -9
- package/dist/components/DebtState/index.js +14 -8
- package/dist/components/IconAndDetails/index.js +19 -17
- package/dist/components/Magnitude/index.js +15 -12
- package/dist/components/Magnitude/utils.js +3 -8
- package/dist/components/MainBillData/components/BillAlert/components/BillParticularConditions/index.js +18 -14
- package/dist/components/MainBillData/components/BillAlert/index.js +24 -31
- package/dist/components/MainBillData/components/BillBody/components/ClientData/index.js +19 -11
- package/dist/components/MainBillData/components/BillBody/components/Consumption/index.js +14 -11
- package/dist/components/MainBillData/components/BillBody/components/Consumption/utils.js +2 -3
- package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/index.js +23 -15
- package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/styles.module.scss +2 -2
- package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/utils.js +3 -2
- package/dist/components/MainBillData/components/BillBody/index.js +42 -44
- package/dist/components/MainBillData/components/BillHeader/components/TypeAndNumber/index.js +16 -11
- package/dist/components/MainBillData/components/BillHeader/index.js +29 -24
- package/dist/components/MainBillData/components/BillHeader/styles.module.scss +1 -1
- package/dist/components/MainBillData/index.js +7 -5
- package/dist/components/MainBillData/theme.js +8 -9
- package/dist/components/MainBillData/utils.js +2 -5
- package/dist/components/Period/index.js +54 -43
- package/dist/components/PowerProgresBar/components/PowerConsumption/index.js +15 -11
- package/dist/components/PowerProgresBar/index.js +31 -30
- package/dist/components/RateAndCategory/index.js +25 -27
- package/dist/components/RatesDefinition/components/BillRate/components/RatePrices/index.js +20 -13
- package/dist/components/RatesDefinition/components/BillRate/index.js +24 -14
- package/dist/components/RatesDefinition/components/BillRate/styles.module.scss +1 -1
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/Category/index.js +14 -9
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/components/IndicatorLabel/index.js +26 -21
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/index.js +11 -7
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/styles.module.scss +1 -1
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/utils.js +11 -10
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Legend/index.js +21 -19
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Stages/index.js +34 -36
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/constants.js +2 -2
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/index.js +17 -30
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/utils.js +37 -48
- package/dist/components/RatesDefinition/components/CategoryByConsumption/constants.js +18 -18
- package/dist/components/RatesDefinition/components/CategoryByConsumption/index.js +23 -31
- package/dist/components/RatesDefinition/components/CategoryByConsumption/utils.js +2 -5
- package/dist/components/RatesDefinition/components/PurchasedRate/index.js +19 -13
- package/dist/components/RatesDefinition/index.js +20 -15
- package/dist/components/RatesDefinition/styles.module.scss +1 -1
- package/dist/components/SmartBillProvider/index.js +12 -34
- package/dist/components/StyledAmount/constants.js +1 -1
- package/dist/components/StyledAmount/index.js +19 -27
- package/dist/components/WithContextApi/index.js +18 -25
- package/dist/components/WithContextApi/layout.js +2 -2
- package/dist/components/WithSeason/index.js +6 -9
- package/dist/constants/deviceSizes.js +33 -18
- package/dist/constants/seasons.js +2 -2
- package/dist/index.js +14 -15
- package/dist/scss/variables/commonColors.module.scss +1 -1
- package/dist/shared/Context/index.js +7 -3
- package/dist/shared/constants/aliases.js +691 -556
- package/dist/shared/constants/consumptions.js +4 -4
- package/dist/shared/constants/periodicities.js +1 -1
- package/dist/shared/constants/rates.js +1 -1
- package/dist/shared/constants/readings.js +2 -2
- package/dist/shared/constants/seasons.js +2 -2
- package/dist/shared/constants/stagesGraph.js +4 -4
- package/dist/shared/types/assetsTypes.js +1 -1
- package/dist/shared/types/billDataTypes.js +5 -5
- package/dist/shared/types/componentsTypes.js +18 -10
- package/dist/shared/types/formattersTypes.js +1 -1
- package/dist/shared/types/rateStagesTypes.js +3 -3
- package/dist/shared/types/smartBillTypes.js +5 -10
- package/dist/shared/types/textsTypes.js +1 -1
- package/dist/shared/utils/billCalculation.js +11 -10
- package/dist/shared/utils/consumptions.js +34 -56
- package/dist/shared/utils/context.js +8 -6
- package/dist/shared/utils/expirations.js +2 -5
- package/dist/shared/utils/periods.js +20 -21
- package/dist/shared/utils/rates.js +2 -5
- package/dist/shared/utils/readings.js +4 -10
- package/dist/shared/utils/season.js +2 -5
- package/dist/shared/utils/stagesGraph.js +15 -15
- package/dist/utils/hooks.js +1 -1
- package/dist/utils.js +7 -8
- package/package.json +26 -63
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -13,38 +12,38 @@ var _utils = require("./utils");
|
|
|
13
12
|
var _TimelineRow = _interopRequireDefault(require("./components/TimelineRow"));
|
|
14
13
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
15
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
function _getRequireWildcardCache(
|
|
17
|
-
function _interopRequireWildcard(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
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); }
|
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
|
+
const ConsumptionIncluded = _ref => {
|
|
18
|
+
let {
|
|
19
|
+
contextApiInfo,
|
|
20
|
+
billData
|
|
21
|
+
} = _ref;
|
|
22
|
+
const {
|
|
23
|
+
config
|
|
24
|
+
} = contextApiInfo;
|
|
25
|
+
const {
|
|
26
|
+
consumptionIncluded
|
|
27
|
+
} = config.texts;
|
|
28
|
+
const data = (0, _react.useMemo)(() => (0, _utils.dataMapper)(billData.periods, consumptionIncluded), [billData.periods, consumptionIncluded]);
|
|
29
|
+
const currentIsFirstSettlement = data.some(item => item.isCurrent && item.settlementNumber === 1);
|
|
30
|
+
const handleRenderTimelineRow = item => /*#__PURE__*/_react.default.createElement(_TimelineRow.default, {
|
|
31
|
+
cardTitle: item.cardTitle,
|
|
32
|
+
cardSubtitle: item.cardSubtitle,
|
|
33
|
+
cardDescription1: item.cardDescription1,
|
|
34
|
+
cardDescription2: item.cardDescription2,
|
|
35
|
+
contextApiInfo: contextApiInfo,
|
|
36
|
+
startDate: item.startDate,
|
|
37
|
+
endDate: item.endDate,
|
|
38
|
+
unit: item.unit,
|
|
39
|
+
value: item.value,
|
|
40
|
+
settlementNumber: item.settlementNumber,
|
|
41
|
+
date: item.date,
|
|
42
|
+
isConsumption: item.isConsumption,
|
|
43
|
+
isCurrent: item.isCurrent,
|
|
44
|
+
isRemaining: item.isRemaining,
|
|
45
|
+
currentIsFirstSettlement: currentIsFirstSettlement
|
|
28
46
|
});
|
|
29
|
-
var handleRenderTimelineRow = function handleRenderTimelineRow(item) {
|
|
30
|
-
return /*#__PURE__*/_react.default.createElement(_TimelineRow.default, {
|
|
31
|
-
cardTitle: item.cardTitle,
|
|
32
|
-
cardSubtitle: item.cardSubtitle,
|
|
33
|
-
cardDescription1: item.cardDescription1,
|
|
34
|
-
cardDescription2: item.cardDescription2,
|
|
35
|
-
contextApiInfo: contextApiInfo,
|
|
36
|
-
startDate: item.startDate,
|
|
37
|
-
endDate: item.endDate,
|
|
38
|
-
unit: item.unit,
|
|
39
|
-
value: item.value,
|
|
40
|
-
settlementNumber: item.settlementNumber,
|
|
41
|
-
date: item.date,
|
|
42
|
-
isConsumption: item.isConsumption,
|
|
43
|
-
isCurrent: item.isCurrent,
|
|
44
|
-
isRemaining: item.isRemaining,
|
|
45
|
-
currentIsFirstSettlement: currentIsFirstSettlement
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
47
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
49
48
|
className: _stylesModule.default.titleContainer
|
|
50
49
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -10,51 +10,52 @@ var _consumptions = require("../../shared/utils/consumptions");
|
|
|
10
10
|
var _periodicities = require("../../shared/constants/periodicities");
|
|
11
11
|
var _consumptions2 = require("../../shared/constants/consumptions");
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
const getBimesterDateTitle = (_ref, text) => {
|
|
14
|
+
let {
|
|
15
|
+
year,
|
|
16
|
+
number,
|
|
17
|
+
settlements
|
|
18
|
+
} = _ref;
|
|
19
|
+
const isPeriodicity = (0, _string.stringToCompareWithoutAccentsInclusive)(settlements === null || settlements === void 0 ? void 0 : settlements.periodicity, _periodicities.PERIODICITY.BIMONTHLY);
|
|
18
20
|
if (!number || !year || !isPeriodicity) return '-';
|
|
19
21
|
return "".concat(text.bimester, " ").concat(number, " ").concat(text.of, " ").concat(year.substring(2));
|
|
20
22
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return item.current;
|
|
24
|
-
});
|
|
23
|
+
const getBimesterDate = (periods, text) => {
|
|
24
|
+
const currentPeriod = periods.find(item => item.current);
|
|
25
25
|
if (!currentPeriod) return '-';
|
|
26
26
|
return getBimesterDateTitle(currentPeriod, text);
|
|
27
27
|
};
|
|
28
|
-
|
|
28
|
+
exports.getBimesterDate = getBimesterDate;
|
|
29
|
+
const getTotalDaysDescriptionComsumption = (period, texts) => {
|
|
29
30
|
var _period$settlements;
|
|
30
|
-
|
|
31
|
+
const totalDays = period === null || period === void 0 || (_period$settlements = period.settlements) === null || _period$settlements === void 0 ? void 0 : _period$settlements.total_settlements_days;
|
|
31
32
|
return "".concat(totalDays, " ").concat(texts.days);
|
|
32
33
|
};
|
|
33
|
-
|
|
34
|
+
const getTotalDaysDescriptionSettlement = (period, texts, dataRetriver) => {
|
|
34
35
|
var _period$settlements2;
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
const totalDays = period === null || period === void 0 || (_period$settlements2 = period.settlements) === null || _period$settlements2 === void 0 ? void 0 : _period$settlements2.total_settlements_days;
|
|
37
|
+
const currentConsumptionDays = dataRetriver(period).days;
|
|
37
38
|
return currentConsumptionDays && totalDays ? "".concat(currentConsumptionDays, " ").concat(texts.of, " ").concat(totalDays, " ").concat(texts.days) : '-';
|
|
38
39
|
};
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
const getConsumptionDescriptionSettlement = (period, texts) => {
|
|
41
|
+
const totalConsumption = (0, _consumptions.getTotalConsumption)(period, _consumptions2.ENERGY_TYPES.ACTIVE);
|
|
41
42
|
return totalConsumption.unit ? "".concat(texts.of, " ").concat(totalConsumption.value, " ").concat(totalConsumption.unit) : '-';
|
|
42
43
|
};
|
|
43
|
-
|
|
44
|
+
const getCardSubtitleSettlement = (period, text, dataRetriver) => {
|
|
44
45
|
var _period$settlements3;
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
const currentSettlement = dataRetriver(period).number || 0;
|
|
47
|
+
const totalSettlements = (period === null || period === void 0 || (_period$settlements3 = period.settlements) === null || _period$settlements3 === void 0 ? void 0 : _period$settlements3.total_settlements) || 0;
|
|
47
48
|
return "".concat(text.settlement, " ").concat(currentSettlement, " ").concat(text.of, " ").concat(totalSettlements);
|
|
48
49
|
};
|
|
49
|
-
|
|
50
|
+
const getCurrent = period => {
|
|
50
51
|
var _period$settlements4;
|
|
51
52
|
return (period === null || period === void 0 || (_period$settlements4 = period.settlements) === null || _period$settlements4 === void 0 ? void 0 : _period$settlements4.current) || {};
|
|
52
53
|
};
|
|
53
|
-
|
|
54
|
+
const getRemaining = period => {
|
|
54
55
|
var _period$settlements5;
|
|
55
56
|
return (period === null || period === void 0 || (_period$settlements5 = period.settlements) === null || _period$settlements5 === void 0 || (_period$settlements5 = _period$settlements5.remaining) === null || _period$settlements5 === void 0 ? void 0 : _period$settlements5[0]) || {};
|
|
56
57
|
};
|
|
57
|
-
|
|
58
|
+
const consumptionMapper = (period, texts) => {
|
|
58
59
|
var _period$settlements6, _period$settlements7;
|
|
59
60
|
return {
|
|
60
61
|
startDate: period !== null && period !== void 0 && (_period$settlements6 = period.settlements) !== null && _period$settlements6 !== void 0 && _period$settlements6.start_date ? (0, _dayjs.default)(period.settlements.start_date).format('DD/MM/YYYY') : '-',
|
|
@@ -68,7 +69,7 @@ var consumptionMapper = function consumptionMapper(period, texts) {
|
|
|
68
69
|
order: 0
|
|
69
70
|
};
|
|
70
71
|
};
|
|
71
|
-
|
|
72
|
+
const settlementCurrentMapper = (period, texts) => {
|
|
72
73
|
var _period$settlements8, _period$settlements9, _period$settlements10;
|
|
73
74
|
return {
|
|
74
75
|
cardTitle: texts.billing,
|
|
@@ -83,7 +84,7 @@ var settlementCurrentMapper = function settlementCurrentMapper(period, texts) {
|
|
|
83
84
|
order: period === null || period === void 0 || (_period$settlements10 = period.settlements) === null || _period$settlements10 === void 0 || (_period$settlements10 = _period$settlements10.current) === null || _period$settlements10 === void 0 ? void 0 : _period$settlements10.number
|
|
84
85
|
};
|
|
85
86
|
};
|
|
86
|
-
|
|
87
|
+
const settlementRemainingMapper = (period, texts) => {
|
|
87
88
|
var _period$settlements11, _period$settlements12, _period$settlements13;
|
|
88
89
|
return {
|
|
89
90
|
cardTitle: texts.billing,
|
|
@@ -98,14 +99,11 @@ var settlementRemainingMapper = function settlementRemainingMapper(period, texts
|
|
|
98
99
|
order: period === null || period === void 0 || (_period$settlements13 = period.settlements) === null || _period$settlements13 === void 0 || (_period$settlements13 = _period$settlements13.remaining) === null || _period$settlements13 === void 0 || (_period$settlements13 = _period$settlements13[0]) === null || _period$settlements13 === void 0 ? void 0 : _period$settlements13.number
|
|
99
100
|
};
|
|
100
101
|
};
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
return item.current;
|
|
106
|
-
});
|
|
102
|
+
const dataMapper = function () {
|
|
103
|
+
let periods = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
104
|
+
let texts = arguments.length > 1 ? arguments[1] : undefined;
|
|
105
|
+
const currentPeriod = periods.find(item => item.current);
|
|
107
106
|
if (!currentPeriod) return [];
|
|
108
|
-
return [consumptionMapper(currentPeriod, texts), settlementCurrentMapper(currentPeriod, texts), settlementRemainingMapper(currentPeriod, texts)].sort(
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
};
|
|
107
|
+
return [consumptionMapper(currentPeriod, texts), settlementCurrentMapper(currentPeriod, texts), settlementRemainingMapper(currentPeriod, texts)].sort((a, b) => a.order - b.order);
|
|
108
|
+
};
|
|
109
|
+
exports.dataMapper = dataMapper;
|
|
@@ -11,16 +11,20 @@ var _WithContextApi = _interopRequireDefault(require("../../../../../WithContext
|
|
|
11
11
|
var _Magnitude = _interopRequireDefault(require("../../../../../Magnitude"));
|
|
12
12
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
const ReadingRow = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
alias,
|
|
17
|
+
numberAlias,
|
|
18
|
+
unitAlias,
|
|
19
|
+
contextApiInfo,
|
|
20
|
+
text,
|
|
21
|
+
value,
|
|
22
|
+
unit,
|
|
23
|
+
disableUnit
|
|
24
|
+
} = _ref;
|
|
25
|
+
const {
|
|
26
|
+
Label
|
|
27
|
+
} = contextApiInfo;
|
|
24
28
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
25
29
|
className: _stylesModule.default.container
|
|
26
30
|
}, /*#__PURE__*/_react.default.createElement(Label, {
|
|
@@ -13,26 +13,29 @@ var _WithContextApi = _interopRequireDefault(require("../../../WithContextApi"))
|
|
|
13
13
|
var _ReadingRow = _interopRequireDefault(require("./components/ReadingRow"));
|
|
14
14
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
classes =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
16
|
+
const ConsumptionSummary = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
contextApiInfo,
|
|
19
|
+
periodNumber,
|
|
20
|
+
year,
|
|
21
|
+
initialReadingDate,
|
|
22
|
+
finalReadingDate,
|
|
23
|
+
totalSettlementsDays,
|
|
24
|
+
initialReadingValue,
|
|
25
|
+
finalReadingValue,
|
|
26
|
+
totalConsumptionValue,
|
|
27
|
+
totalConsumptionUnit,
|
|
28
|
+
classes = {}
|
|
29
|
+
} = _ref;
|
|
30
|
+
const {
|
|
31
|
+
config,
|
|
32
|
+
Label
|
|
33
|
+
} = contextApiInfo;
|
|
34
|
+
const {
|
|
35
|
+
texts
|
|
36
|
+
} = config;
|
|
37
|
+
const formatDate = date => (0, _dayjs.default)(date).format('DD/MM/YYYY');
|
|
38
|
+
const daysLabel = totalSettlementsDays ? "(".concat(totalSettlementsDays, " ").concat(texts.consumptionPeriod.days, ")") : '';
|
|
36
39
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
37
40
|
className: "".concat(_stylesModule.default.container, " ").concat(classes.container)
|
|
38
41
|
}, periodNumber && year && /*#__PURE__*/_react.default.createElement(Label, {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -15,34 +14,27 @@ var _deviceSizes = require("../../../../constants/deviceSizes");
|
|
|
15
14
|
var _BarChart = _interopRequireDefault(require("../../../BarChart"));
|
|
16
15
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
17
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
|
-
function _getRequireWildcardCache(
|
|
19
|
-
function _interopRequireWildcard(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
setIsDesktopSize = _useState2[1];
|
|
35
|
-
var handleResizeScreen = function handleResizeScreen() {
|
|
36
|
-
return setIsDesktopSize((0, _browser.isDesktop)(_deviceSizes.TabletBreakpoint));
|
|
37
|
-
};
|
|
38
|
-
(0, _react.useEffect)(function () {
|
|
17
|
+
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); }
|
|
18
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
|
+
const HistoryGraph = _ref => {
|
|
20
|
+
let {
|
|
21
|
+
billData,
|
|
22
|
+
contextApiInfo
|
|
23
|
+
} = _ref;
|
|
24
|
+
const {
|
|
25
|
+
config
|
|
26
|
+
} = contextApiInfo;
|
|
27
|
+
const {
|
|
28
|
+
showPeriodsInChronologicalOrder
|
|
29
|
+
} = config;
|
|
30
|
+
const [isDesktopSize, setIsDesktopSize] = (0, _react.useState)((0, _browser.isDesktop)(_deviceSizes.TabletBreakpoint));
|
|
31
|
+
const handleResizeScreen = () => setIsDesktopSize((0, _browser.isDesktop)(_deviceSizes.TabletBreakpoint));
|
|
32
|
+
(0, _react.useEffect)(() => {
|
|
39
33
|
window.addEventListener(_browser.RESIZE_EVENT, handleResizeScreen);
|
|
40
34
|
handleResizeScreen();
|
|
41
|
-
return
|
|
42
|
-
return window.removeEventListener(_browser.RESIZE_EVENT, handleResizeScreen);
|
|
43
|
-
};
|
|
35
|
+
return () => window.removeEventListener(_browser.RESIZE_EVENT, handleResizeScreen);
|
|
44
36
|
}, []);
|
|
45
|
-
|
|
37
|
+
const consumptionHistoryData = (0, _consumptions.getConsumptionHistoryData)(billData, _consumptions2.ENERGY_TYPES.ACTIVE, showPeriodsInChronologicalOrder);
|
|
46
38
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
47
39
|
className: _stylesModule.default.container
|
|
48
40
|
}, /*#__PURE__*/_react.default.createElement(_BarChart.default, {
|
|
@@ -15,38 +15,41 @@ var _IconAndDetails = _interopRequireDefault(require("../../../IconAndDetails"))
|
|
|
15
15
|
var _aliases = require("../../../../shared/constants/aliases");
|
|
16
16
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
17
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
classes =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
18
|
+
const Reading = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
contextApiInfo,
|
|
21
|
+
title,
|
|
22
|
+
date,
|
|
23
|
+
readingType,
|
|
24
|
+
readingValue,
|
|
25
|
+
tooltip,
|
|
26
|
+
classes = {}
|
|
27
|
+
} = _ref;
|
|
28
|
+
const {
|
|
29
|
+
assets,
|
|
30
|
+
config,
|
|
31
|
+
Label,
|
|
32
|
+
Tooltip
|
|
33
|
+
} = contextApiInfo;
|
|
34
|
+
const {
|
|
35
|
+
texts,
|
|
36
|
+
colors
|
|
37
|
+
} = config;
|
|
38
|
+
const {
|
|
39
|
+
InfoIcon,
|
|
40
|
+
ReadingDateIcon,
|
|
41
|
+
ReadingTypeIcon,
|
|
42
|
+
EnergyIcon
|
|
43
|
+
} = assets;
|
|
44
|
+
const TitleLabel = () => /*#__PURE__*/_react.default.createElement(Label, {
|
|
45
|
+
alias: _aliases.READING_TITLE,
|
|
46
|
+
className: "".concat(!tooltip && _stylesModule.default.title)
|
|
47
|
+
}, title);
|
|
48
|
+
const EnergyIconStyled = () => /*#__PURE__*/_react.default.createElement(EnergyIcon, {
|
|
49
|
+
style: {
|
|
50
|
+
fill: colors.primary
|
|
51
|
+
}
|
|
52
|
+
});
|
|
50
53
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
51
54
|
className: "".concat(_stylesModule.default.container, " ").concat(classes.container)
|
|
52
55
|
}, tooltip ? /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -18,15 +18,19 @@ var _utils = require("./utils");
|
|
|
18
18
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
19
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
20
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
|
-
|
|
21
|
+
const ConsumptionPeriod = _ref => {
|
|
22
22
|
var _currentPeriod$settle, _currentPeriod$settle2;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
let {
|
|
24
|
+
contextApiInfo,
|
|
25
|
+
billData
|
|
26
|
+
} = _ref;
|
|
27
|
+
const {
|
|
28
|
+
texts
|
|
29
|
+
} = contextApiInfo.config;
|
|
30
|
+
const currentPeriod = (0, _periods.getCurrentPeriod)(billData);
|
|
31
|
+
const initialReading = (0, _readings.getReadingPeriod)(billData, _readings2.READING_MOMENTS.INITIAL);
|
|
32
|
+
const finalReading = (0, _readings.getReadingPeriod)(billData, _readings2.READING_MOMENTS.FINAL);
|
|
33
|
+
const consumptionSummaryProps = (0, _utils.getConsumptionSummaryProps)(currentPeriod, initialReading, finalReading);
|
|
30
34
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
31
35
|
className: _stylesModule.default.container
|
|
32
36
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -8,18 +8,17 @@ var _seamlessImmutable = require("seamless-immutable");
|
|
|
8
8
|
var _consumptions = require("../../shared/utils/consumptions");
|
|
9
9
|
var _readings = require("../../shared/utils/readings");
|
|
10
10
|
var _consumptions2 = require("../../shared/constants/consumptions");
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
};
|
|
11
|
+
const getConsumptionSummaryProps = (currentPeriod, initialReading, finalReading) => ({
|
|
12
|
+
periodNumber: currentPeriod.number,
|
|
13
|
+
year: currentPeriod.year,
|
|
14
|
+
initialReadingDate: initialReading.date,
|
|
15
|
+
finalReadingDate: finalReading.date,
|
|
16
|
+
totalSettlementsDays: (0, _seamlessImmutable.getIn)(currentPeriod, ['settlements', 'total_settlements_days']),
|
|
17
|
+
initialReadingValue: (0, _readings.getActiveEnergyRecord)(initialReading).value,
|
|
18
|
+
initialReadingUnit: (0, _readings.getActiveEnergyRecord)(initialReading).unit,
|
|
19
|
+
finalReadingValue: (0, _readings.getActiveEnergyRecord)(finalReading).value,
|
|
20
|
+
finalReadingUnit: (0, _readings.getActiveEnergyRecord)(finalReading).unit,
|
|
21
|
+
totalConsumptionValue: (0, _consumptions.getTotalConsumption)(currentPeriod, _consumptions2.ENERGY_TYPES.ACTIVE).value,
|
|
22
|
+
totalConsumptionUnit: (0, _consumptions.getTotalConsumption)(currentPeriod, _consumptions2.ENERGY_TYPES.ACTIVE).unit
|
|
23
|
+
});
|
|
24
|
+
exports.getConsumptionSummaryProps = getConsumptionSummaryProps;
|
|
@@ -11,15 +11,18 @@ var _smartBillTypes = require("../../shared/types/smartBillTypes");
|
|
|
11
11
|
var _WithContextApi = _interopRequireDefault(require("../WithContextApi"));
|
|
12
12
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
classes =
|
|
20
|
-
mainAlias
|
|
21
|
-
detailAlias
|
|
22
|
-
|
|
14
|
+
const Date = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
contextApiInfo,
|
|
17
|
+
date,
|
|
18
|
+
text,
|
|
19
|
+
classes = {},
|
|
20
|
+
mainAlias,
|
|
21
|
+
detailAlias
|
|
22
|
+
} = _ref;
|
|
23
|
+
const {
|
|
24
|
+
Label
|
|
25
|
+
} = contextApiInfo;
|
|
23
26
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
24
27
|
className: "".concat(_stylesModule.default.container, " ").concat(classes.container)
|
|
25
28
|
}, /*#__PURE__*/_react.default.createElement(Label, {
|
|
@@ -11,14 +11,20 @@ var _WithContextApi = _interopRequireDefault(require("../WithContextApi"));
|
|
|
11
11
|
var _aliases = require("../../shared/constants/aliases");
|
|
12
12
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
const DebtState = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
contextApiInfo,
|
|
17
|
+
debtStatusLabel,
|
|
18
|
+
isWarning
|
|
19
|
+
} = _ref;
|
|
20
|
+
const {
|
|
21
|
+
assets,
|
|
22
|
+
Label
|
|
23
|
+
} = contextApiInfo;
|
|
24
|
+
const {
|
|
25
|
+
PendingDebtIcon,
|
|
26
|
+
AdheredToServiceIcon
|
|
27
|
+
} = assets;
|
|
22
28
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
23
29
|
className: "".concat(_stylesModule.default.container, " ").concat(isWarning ? _stylesModule.default.withDebtsContainer : _stylesModule.default.adheredToAutomaticDebt, " ")
|
|
24
30
|
}, isWarning ? /*#__PURE__*/_react.default.createElement(PendingDebtIcon, null) : /*#__PURE__*/_react.default.createElement(AdheredToServiceIcon, null), /*#__PURE__*/_react.default.createElement(Label, {
|
|
@@ -13,23 +13,25 @@ var _WithContextApi = _interopRequireDefault(require("../WithContextApi"));
|
|
|
13
13
|
var _utils = require("../../utils");
|
|
14
14
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
tertiaryAlias =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
16
|
+
const IconAndDetails = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
children,
|
|
19
|
+
contextApiInfo,
|
|
20
|
+
Icon,
|
|
21
|
+
mainText,
|
|
22
|
+
secondaryText,
|
|
23
|
+
descriptionText,
|
|
24
|
+
tooltip,
|
|
25
|
+
mainAlias,
|
|
26
|
+
secondaryAlias,
|
|
27
|
+
tertiaryAlias = secondaryAlias,
|
|
28
|
+
classes = {}
|
|
29
|
+
} = _ref;
|
|
30
|
+
const {
|
|
31
|
+
Label,
|
|
32
|
+
Tooltip
|
|
33
|
+
} = contextApiInfo;
|
|
34
|
+
const repeatedData = mainText && secondaryText && (0, _string.stringCompare)(mainText, secondaryText);
|
|
33
35
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
34
36
|
className: "".concat(_stylesModule.default.container, " ").concat(classes.container)
|
|
35
37
|
}, /*#__PURE__*/_react.default.createElement(Tooltip, {
|
|
@@ -13,18 +13,21 @@ var _utils = require("../../utils");
|
|
|
13
13
|
var _utils2 = require("./utils");
|
|
14
14
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
classes =
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
const Magnitude = props => {
|
|
17
|
+
const {
|
|
18
|
+
contextApiInfo,
|
|
19
|
+
numberAlias,
|
|
20
|
+
unitAlias,
|
|
21
|
+
value,
|
|
22
|
+
unit,
|
|
23
|
+
disableUnit,
|
|
24
|
+
Icon,
|
|
25
|
+
classes = {}
|
|
26
|
+
} = props;
|
|
27
|
+
const {
|
|
28
|
+
Label
|
|
29
|
+
} = contextApiInfo;
|
|
30
|
+
const variantProps = (0, _utils2.getVariantProps)(props);
|
|
28
31
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
29
32
|
className: "".concat(_stylesModule.default.container, " ").concat(classes.container)
|
|
30
33
|
}, Icon && /*#__PURE__*/_react.default.createElement(Icon, {
|