@widergy/utilitygo-smart-bill-web 1.13.4 → 2.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 +12 -0
- package/dist/components/Advice/index.js +3 -14
- package/dist/components/Amount/index.js +11 -29
- package/dist/components/Amount/styles.module.scss +1 -2
- package/dist/components/Amount/utils.js +0 -3
- package/dist/components/Banner/index.js +3 -12
- package/dist/components/BarChart/index.js +12 -32
- package/dist/components/BarChart/styles.module.scss +5 -5
- package/dist/components/BarChart/utils.js +1 -6
- package/dist/components/BillCalculation/components/ConceptCard/index.js +31 -36
- package/dist/components/BillCalculation/components/Glossary/index.js +30 -50
- package/dist/components/BillCalculation/components/Glossary/styles.module.scss +0 -6
- package/dist/components/BillCalculation/index.js +13 -46
- package/dist/components/BillCalculation/utils.js +3 -15
- package/dist/components/BillSummary/components/BilledConcepts/components/Concept/index.js +11 -29
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/index.js +2 -15
- package/dist/components/BillSummary/components/BilledConcepts/constants.js +0 -4
- package/dist/components/BillSummary/components/BilledConcepts/index.js +11 -40
- package/dist/components/BillSummary/components/BilledConcepts/styles.module.scss +1 -1
- package/dist/components/BillSummary/components/BilledConcepts/utils.js +13 -38
- package/dist/components/BillSummary/index.js +7 -42
- package/dist/components/BillSummary/styles.module.scss +0 -4
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/DataLine/index.js +0 -8
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/index.js +5 -20
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/utils.js +0 -7
- package/dist/components/ConsumptionComparison/components/ComparisonTable/constants.js +18 -39
- package/dist/components/ConsumptionComparison/components/ComparisonTable/index.js +2 -16
- package/dist/components/ConsumptionComparison/components/ComparisonTable/utils.js +15 -37
- package/dist/components/ConsumptionComparison/components/ConsumptionAdvice/index.js +8 -16
- package/dist/components/ConsumptionComparison/components/ConsumptionAdvice/utils.js +0 -7
- package/dist/components/ConsumptionComparison/components/PercentageComparison/index.js +12 -25
- package/dist/components/ConsumptionComparison/components/PercentageComparison/styles.module.scss +0 -10
- package/dist/components/ConsumptionComparison/components/PercentageComparison/utils.js +4 -11
- package/dist/components/ConsumptionComparison/index.js +9 -44
- package/dist/components/ConsumptionComparison/styles.module.scss +0 -5
- package/dist/components/ConsumptionEnergyDetails/components/ConsumptionEnergyComparison/index.js +13 -38
- package/dist/components/ConsumptionEnergyDetails/components/ConsumptionInDaysLabel/index.js +9 -20
- package/dist/components/ConsumptionEnergyDetails/components/EnergyTotalConsumption/index.js +14 -26
- package/dist/components/ConsumptionEnergyDetails/components/EnergyTotalConsumption/styles.module.scss +0 -6
- package/dist/components/ConsumptionEnergyDetails/components/PercentageComparison/index.js +10 -24
- package/dist/components/ConsumptionEnergyDetails/components/PercentageComparison/utils.js +0 -6
- package/dist/components/ConsumptionEnergyDetails/index.js +14 -41
- package/dist/components/ConsumptionEnergyDetails/styles.module.scss +2 -6
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/index.js +39 -55
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/styles.module.scss +2 -8
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/utils.js +0 -3
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderConsumption/index.js +7 -23
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderConsumption/styles.module.scss +0 -4
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderSettlement/index.js +4 -15
- package/dist/components/ConsumptionIncluded/components/TimelineRow/index.js +16 -33
- package/dist/components/ConsumptionIncluded/index.js +1 -18
- package/dist/components/ConsumptionIncluded/utils.js +2 -30
- package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/components/ReadingRow/index.js +7 -19
- package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/index.js +12 -27
- package/dist/components/ConsumptionPeriod/components/HistoryGraph/index.js +6 -30
- package/dist/components/ConsumptionPeriod/components/Reading/index.js +15 -33
- package/dist/components/ConsumptionPeriod/components/Reading/styles.module.scss +0 -1
- package/dist/components/ConsumptionPeriod/index.js +1 -20
- package/dist/components/ConsumptionPeriod/utils.js +0 -6
- package/dist/components/Date/index.js +6 -17
- package/dist/components/Date/styles.module.scss +2 -4
- package/dist/components/DebtState/index.js +6 -16
- package/dist/components/DebtState/styles.module.scss +2 -11
- package/dist/components/IconAndDetails/index.js +13 -26
- package/dist/components/Magnitude/index.js +18 -39
- package/dist/components/Magnitude/utils.js +0 -29
- package/dist/components/MainBillData/components/BillAlert/components/BillParticularConditions/index.js +6 -17
- package/dist/components/MainBillData/components/BillAlert/index.js +12 -39
- package/dist/components/MainBillData/components/BillAlert/styles.module.scss +4 -1
- package/dist/components/MainBillData/components/BillBody/components/ClientData/index.js +5 -19
- package/dist/components/MainBillData/components/BillBody/components/ClientData/styles.module.scss +1 -3
- package/dist/components/MainBillData/components/BillBody/components/Consumption/index.js +4 -20
- package/dist/components/MainBillData/components/BillBody/components/Consumption/utils.js +0 -2
- package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/index.js +16 -30
- package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/utils.js +0 -5
- package/dist/components/MainBillData/components/BillBody/index.js +3 -35
- package/dist/components/MainBillData/components/BillHeader/components/TypeAndNumber/index.js +7 -19
- package/dist/components/MainBillData/components/BillHeader/index.js +4 -27
- package/dist/components/MainBillData/index.js +1 -16
- package/dist/components/MainBillData/theme.js +0 -3
- package/dist/components/MainBillData/utils.js +0 -3
- package/dist/components/Period/index.js +18 -44
- package/dist/components/Period/styles.module.scss +9 -9
- package/dist/components/PowerProgresBar/components/PowerConsumption/index.js +21 -28
- package/dist/components/PowerProgresBar/components/PowerConsumption/styles.module.scss +0 -7
- package/dist/components/PowerProgresBar/index.js +8 -29
- package/dist/components/PowerProgresBar/styles.module.scss +5 -9
- package/dist/components/RateAndCategory/index.js +8 -26
- package/dist/components/RateAndCategory/styles.module.scss +1 -4
- package/dist/components/RatesDefinition/components/BillRate/components/RatePrices/index.js +11 -23
- package/dist/components/RatesDefinition/components/BillRate/components/RatePrices/styles.module.scss +0 -1
- package/dist/components/RatesDefinition/components/BillRate/index.js +8 -20
- package/dist/components/RatesDefinition/components/BillRate/styles.module.scss +1 -2
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/Category/index.js +5 -17
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/Category/styles.module.scss +2 -4
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/components/IndicatorLabel/index.js +8 -22
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/index.js +4 -18
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/utils.js +0 -7
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Legend/index.js +4 -14
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Legend/styles.module.scss +1 -9
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Stages/index.js +8 -16
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Stages/styles.module.scss +0 -4
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/constants.js +0 -1
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/index.js +12 -39
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/utils.js +14 -24
- package/dist/components/RatesDefinition/components/CategoryByConsumption/index.js +11 -38
- package/dist/components/RatesDefinition/components/CategoryByConsumption/utils.js +0 -3
- package/dist/components/RatesDefinition/components/PurchasedRate/index.js +11 -23
- package/dist/components/RatesDefinition/components/PurchasedRate/styles.module.scss +5 -4
- package/dist/components/RatesDefinition/index.js +4 -25
- package/dist/components/SmartBillProvider/index.js +5 -26
- package/dist/components/StyledAmount/constants.js +0 -3
- package/dist/components/StyledAmount/index.js +18 -38
- package/dist/components/StyledAmount/styles.module.scss +2 -3
- package/dist/components/WithContextApi/index.js +4 -15
- package/dist/components/WithContextApi/layout.js +0 -9
- package/dist/components/WithSeason/index.js +0 -6
- package/dist/constants/deviceSizes.js +4 -16
- package/dist/index.js +0 -18
- package/dist/scss/variables/_colors.scss +0 -6
- package/dist/scss/variables/_colorsExport.scss +0 -6
- package/dist/shared/Context/index.js +1 -5
- package/dist/shared/constants/aliases.js +84 -82
- package/dist/shared/types/assetsTypes.js +0 -3
- package/dist/shared/types/billDataTypes.js +13 -13
- package/dist/shared/types/componentsTypes.js +4 -10
- package/dist/shared/types/formattersTypes.js +0 -2
- package/dist/shared/types/rateStagesTypes.js +0 -2
- package/dist/shared/types/smartBillTypes.js +4 -10
- package/dist/shared/types/textsTypes.js +0 -2
- package/dist/shared/utils/billCalculation.js +0 -6
- package/dist/shared/utils/consumptions.js +1 -32
- package/dist/shared/utils/context.js +0 -6
- package/dist/shared/utils/expirations.js +0 -3
- package/dist/shared/utils/periods.js +0 -15
- package/dist/shared/utils/rates.js +0 -4
- package/dist/shared/utils/readings.js +0 -7
- package/dist/shared/utils/season.js +0 -3
- package/dist/shared/utils/stagesGraph.js +0 -11
- package/dist/utils/hooks.js +0 -2
- package/dist/utils.js +0 -8
- package/package.json +1 -1
|
@@ -1,67 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _periods = require("../../shared/utils/periods");
|
|
13
|
-
|
|
14
10
|
var _consumptions = require("../../shared/utils/consumptions");
|
|
15
|
-
|
|
16
11
|
var _consumptions2 = require("../../shared/constants/consumptions");
|
|
17
|
-
|
|
18
12
|
var _billDataTypes = require("../../shared/types/billDataTypes");
|
|
19
|
-
|
|
20
13
|
var _smartBillTypes = require("../../shared/types/smartBillTypes");
|
|
21
|
-
|
|
22
14
|
var _Amount = _interopRequireDefault(require("../Amount"));
|
|
23
|
-
|
|
24
15
|
var _RateAndCategory = _interopRequireDefault(require("../RateAndCategory"));
|
|
25
|
-
|
|
26
16
|
var _WithContextApi = _interopRequireDefault(require("../WithContextApi"));
|
|
27
|
-
|
|
28
17
|
var _Period = _interopRequireDefault(require("../Period"));
|
|
29
|
-
|
|
30
18
|
var _hooks = require("../../utils/hooks");
|
|
31
|
-
|
|
32
19
|
var _PowerProgresBar = _interopRequireDefault(require("../PowerProgresBar"));
|
|
33
|
-
|
|
34
20
|
var _ConsumptionEnergyDetails = _interopRequireDefault(require("../ConsumptionEnergyDetails"));
|
|
35
|
-
|
|
36
21
|
var _Banner = _interopRequireDefault(require("../Banner"));
|
|
37
|
-
|
|
38
22
|
var _aliases = require("../../shared/constants/aliases");
|
|
39
|
-
|
|
40
23
|
var _BilledConcepts = _interopRequireDefault(require("./components/BilledConcepts"));
|
|
41
|
-
|
|
42
24
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
43
|
-
|
|
44
25
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
45
|
-
|
|
46
26
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
47
|
-
|
|
48
27
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
49
|
-
|
|
50
28
|
var BillSummary = function BillSummary(_ref) {
|
|
51
29
|
var _billData$client, _billData$client$rate, _billData$client2, _billData$client2$rat, _currentPeriod$settle, _currentPeriod$settle2, _currentPeriod$settle3;
|
|
52
|
-
|
|
53
30
|
var contextApiInfo = _ref.contextApiInfo,
|
|
54
|
-
|
|
31
|
+
billData = _ref.billData;
|
|
55
32
|
var config = contextApiInfo.config,
|
|
56
|
-
|
|
33
|
+
assets = contextApiInfo.assets;
|
|
57
34
|
var consumptionDetail = config.externalLinks.consumptionDetail;
|
|
58
35
|
var _config$validations = config.validations,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
36
|
+
showBillSummaryBanner = _config$validations.showBillSummaryBanner,
|
|
37
|
+
showPower = _config$validations.showPower,
|
|
38
|
+
showCategory = _config$validations.showCategory;
|
|
62
39
|
var texts = config.texts;
|
|
63
40
|
var ConsumptionBannerIcon = assets.ConsumptionBannerIcon,
|
|
64
|
-
|
|
41
|
+
ConsumptionBannerResponsiveIcon = assets.ConsumptionBannerResponsiveIcon;
|
|
65
42
|
var currentPeriod = (0, _periods.getCurrentPeriod)(billData);
|
|
66
43
|
var hiredPowerConsumption = (0, _consumptions.getTotalConsumption)(currentPeriod, _consumptions2.POWER_TYPES.PURCHASED);
|
|
67
44
|
var registeredPowerConsumption = (0, _consumptions.getTotalConsumption)(currentPeriod, _consumptions2.POWER_TYPES.REGISTERED);
|
|
@@ -70,12 +47,9 @@ var BillSummary = function BillSummary(_ref) {
|
|
|
70
47
|
var category = billData === null || billData === void 0 ? void 0 : (_billData$client2 = billData.client) === null || _billData$client2 === void 0 ? void 0 : (_billData$client2$rat = _billData$client2.rate) === null || _billData$client2$rat === void 0 ? void 0 : _billData$client2$rat.category;
|
|
71
48
|
var multipleSettlements = (currentPeriod === null || currentPeriod === void 0 ? void 0 : (_currentPeriod$settle = currentPeriod.settlements) === null || _currentPeriod$settle === void 0 ? void 0 : _currentPeriod$settle.total_settlements) > 1;
|
|
72
49
|
var issueedDate = currentPeriod === null || currentPeriod === void 0 ? void 0 : (_currentPeriod$settle2 = currentPeriod.settlements) === null || _currentPeriod$settle2 === void 0 ? void 0 : (_currentPeriod$settle3 = _currentPeriod$settle2.current) === null || _currentPeriod$settle3 === void 0 ? void 0 : _currentPeriod$settle3.issued_on;
|
|
73
|
-
|
|
74
50
|
var _useScreenSize = (0, _hooks.useScreenSize)(),
|
|
75
|
-
|
|
76
|
-
|
|
51
|
+
isDesktopSize = _useScreenSize.isDesktopSize;
|
|
77
52
|
var withBanner = ConsumptionBannerIcon && ConsumptionBannerResponsiveIcon && showBillSummaryBanner(billData);
|
|
78
|
-
|
|
79
53
|
var RenderPeriod = function RenderPeriod() {
|
|
80
54
|
return /*#__PURE__*/_react.default.createElement(_Period.default, {
|
|
81
55
|
billData: billData,
|
|
@@ -85,7 +59,6 @@ var BillSummary = function BillSummary(_ref) {
|
|
|
85
59
|
issueedDate: issueedDate
|
|
86
60
|
});
|
|
87
61
|
};
|
|
88
|
-
|
|
89
62
|
var RenderConsumptionEnergyDetails = function RenderConsumptionEnergyDetails() {
|
|
90
63
|
return /*#__PURE__*/_react.default.createElement(_ConsumptionEnergyDetails.default, {
|
|
91
64
|
billData: billData,
|
|
@@ -94,7 +67,6 @@ var BillSummary = function BillSummary(_ref) {
|
|
|
94
67
|
withPercentage: true
|
|
95
68
|
});
|
|
96
69
|
};
|
|
97
|
-
|
|
98
70
|
var RenderRateAndCategory = function RenderRateAndCategory() {
|
|
99
71
|
return /*#__PURE__*/_react.default.createElement(_RateAndCategory.default, {
|
|
100
72
|
rate: rate,
|
|
@@ -102,14 +74,12 @@ var BillSummary = function BillSummary(_ref) {
|
|
|
102
74
|
title: texts.billSummary.rateTitle,
|
|
103
75
|
classes: {
|
|
104
76
|
container: _stylesModule.default.rateContainer,
|
|
105
|
-
title: _stylesModule.default.title,
|
|
106
77
|
purchasedRate: _stylesModule.default.purchasedRate,
|
|
107
78
|
category: showCategory(billData) ? _stylesModule.default.category : _stylesModule.default.hidden
|
|
108
79
|
},
|
|
109
80
|
showCategory: showCategory(billData)
|
|
110
81
|
});
|
|
111
82
|
};
|
|
112
|
-
|
|
113
83
|
var RenderPowerProgresBar = function RenderPowerProgresBar() {
|
|
114
84
|
return /*#__PURE__*/_react.default.createElement(_PowerProgresBar.default, {
|
|
115
85
|
hiredPowerConsumption: hiredPowerConsumption,
|
|
@@ -117,13 +87,11 @@ var BillSummary = function BillSummary(_ref) {
|
|
|
117
87
|
exceededPower: exceededPower
|
|
118
88
|
});
|
|
119
89
|
};
|
|
120
|
-
|
|
121
90
|
var RenderBilledConcepts = function RenderBilledConcepts() {
|
|
122
91
|
return /*#__PURE__*/_react.default.createElement(_BilledConcepts.default, {
|
|
123
92
|
billData: billData
|
|
124
93
|
});
|
|
125
94
|
};
|
|
126
|
-
|
|
127
95
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, isDesktopSize ? /*#__PURE__*/_react.default.createElement("div", {
|
|
128
96
|
className: _stylesModule.default.container
|
|
129
97
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -146,12 +114,9 @@ var BillSummary = function BillSummary(_ref) {
|
|
|
146
114
|
externalLink: consumptionDetail
|
|
147
115
|
}));
|
|
148
116
|
};
|
|
149
|
-
|
|
150
117
|
BillSummary.propTypes = {
|
|
151
118
|
contextApiInfo: _smartBillTypes.contextApiInfoTypes,
|
|
152
119
|
billData: _billDataTypes.billDataTypes
|
|
153
120
|
};
|
|
154
|
-
|
|
155
121
|
var _default = (0, _WithContextApi.default)()(BillSummary);
|
|
156
|
-
|
|
157
122
|
exports.default = _default;
|
|
@@ -4,19 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = require("prop-types");
|
|
11
|
-
|
|
12
9
|
var _object = require("@widergy/web-utils/lib/object");
|
|
13
|
-
|
|
14
10
|
var _componentsTypes = require("../../../../../../shared/types/componentsTypes");
|
|
15
|
-
|
|
16
11
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
17
|
-
|
|
18
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
13
|
var DataLine = function DataLine(_ref) {
|
|
21
14
|
var fields = _ref.fields;
|
|
22
15
|
return !(0, _object.objectIsEmpty)(fields) && /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -28,7 +21,6 @@ var DataLine = function DataLine(_ref) {
|
|
|
28
21
|
}, field.Component);
|
|
29
22
|
}));
|
|
30
23
|
};
|
|
31
|
-
|
|
32
24
|
DataLine.propTypes = {
|
|
33
25
|
fields: (0, _propTypes.arrayOf)((0, _propTypes.shape)({
|
|
34
26
|
id: _propTypes.string,
|
package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/index.js
CHANGED
|
@@ -4,37 +4,25 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = require("prop-types");
|
|
11
|
-
|
|
12
9
|
var _smartBillTypes = require("../../../../../../shared/types/smartBillTypes");
|
|
13
|
-
|
|
14
10
|
var _WithContextApi = _interopRequireDefault(require("../../../../../WithContextApi"));
|
|
15
|
-
|
|
16
11
|
var _WithSeason = _interopRequireDefault(require("../../../../../WithSeason"));
|
|
17
|
-
|
|
18
12
|
var _aliases = require("../../../../../../shared/constants/aliases");
|
|
19
|
-
|
|
20
13
|
var _utils = require("./utils");
|
|
21
|
-
|
|
22
14
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
23
|
-
|
|
24
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
-
|
|
26
16
|
var Season = function Season(_ref) {
|
|
27
17
|
var contextApiInfo = _ref.contextApiInfo,
|
|
28
|
-
|
|
18
|
+
season = _ref.season;
|
|
29
19
|
var assets = contextApiInfo.assets,
|
|
30
|
-
|
|
31
|
-
|
|
20
|
+
config = contextApiInfo.config,
|
|
21
|
+
Label = contextApiInfo.Label;
|
|
32
22
|
var texts = config.texts;
|
|
33
|
-
|
|
34
23
|
var _getSeasonProps = (0, _utils.getSeasonProps)(season, texts, assets),
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
24
|
+
Icon = _getSeasonProps.Icon,
|
|
25
|
+
text = _getSeasonProps.text;
|
|
38
26
|
return Icon && text ? /*#__PURE__*/_react.default.createElement("div", {
|
|
39
27
|
className: _stylesModule.default.container
|
|
40
28
|
}, /*#__PURE__*/_react.default.createElement(Icon, {
|
|
@@ -43,12 +31,9 @@ var Season = function Season(_ref) {
|
|
|
43
31
|
alias: _aliases.SEASON
|
|
44
32
|
}, text)) : null;
|
|
45
33
|
};
|
|
46
|
-
|
|
47
34
|
Season.propTypes = {
|
|
48
35
|
contextApiInfo: _smartBillTypes.contextApiInfoTypes,
|
|
49
36
|
season: _propTypes.string
|
|
50
37
|
};
|
|
51
|
-
|
|
52
38
|
var _default = (0, _WithContextApi.default)()((0, _WithSeason.default)()(Season));
|
|
53
|
-
|
|
54
39
|
exports.default = _default;
|
package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/utils.js
CHANGED
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getSeasonProps = void 0;
|
|
7
|
-
|
|
8
7
|
var _seasons = require("../../../../../../shared/constants/seasons");
|
|
9
|
-
|
|
10
8
|
var getSeasonProps = function getSeasonProps(season, texts, assets) {
|
|
11
9
|
switch (season) {
|
|
12
10
|
case _seasons.SEASONS.AUTUMN:
|
|
@@ -14,28 +12,23 @@ var getSeasonProps = function getSeasonProps(season, texts, assets) {
|
|
|
14
12
|
text: texts.commons.autumn,
|
|
15
13
|
Icon: assets.AutumnIcon
|
|
16
14
|
};
|
|
17
|
-
|
|
18
15
|
case _seasons.SEASONS.WINTER:
|
|
19
16
|
return {
|
|
20
17
|
text: texts.commons.winter,
|
|
21
18
|
Icon: assets.WinterIcon
|
|
22
19
|
};
|
|
23
|
-
|
|
24
20
|
case _seasons.SEASONS.SPRING:
|
|
25
21
|
return {
|
|
26
22
|
text: texts.commons.spring,
|
|
27
23
|
Icon: assets.SpringIcon
|
|
28
24
|
};
|
|
29
|
-
|
|
30
25
|
case _seasons.SEASONS.SUMMER:
|
|
31
26
|
return {
|
|
32
27
|
text: texts.commons.summer,
|
|
33
28
|
Icon: assets.SummerIcon
|
|
34
29
|
};
|
|
35
|
-
|
|
36
30
|
default:
|
|
37
31
|
return {};
|
|
38
32
|
}
|
|
39
33
|
};
|
|
40
|
-
|
|
41
34
|
exports.getSeasonProps = getSeasonProps;
|
|
@@ -4,27 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.noPeriodData = exports.getField = exports.desktopGetHeaderFields = exports.dataFieldDictonary = exports.NO_DATA_FIELD = exports.FIELD_TOTAL_CONSUMPTIONS = exports.FIELD_SETTLEMENTS_DAYS = exports.FIELD_POWER_CONSUMPTION = exports.FIELD_PERIOD_DATES = exports.FIELD_PERIOD_COMPARISION = exports.FIELD_ENERGY_CONSUMPTION = exports.FIELD_DAILY_CONSUMPTIONS = exports.FIELD_AVERAGE_TEMPERATURE = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
11
|
-
|
|
12
9
|
var _consumptions = require("../../../../shared/utils/consumptions");
|
|
13
|
-
|
|
14
10
|
var _consumptions2 = require("../../../../shared/constants/consumptions");
|
|
15
|
-
|
|
16
11
|
var _Magnitude = _interopRequireDefault(require("../../../Magnitude"));
|
|
17
|
-
|
|
18
12
|
var _utils = require("../../../../utils");
|
|
19
|
-
|
|
20
13
|
var _aliases = require("../../../../shared/constants/aliases");
|
|
21
|
-
|
|
22
14
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
23
|
-
|
|
24
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
-
|
|
26
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
27
|
-
|
|
16
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
17
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
18
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
19
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
28
20
|
var FIELD_PERIOD_COMPARISION = 'period_comparison';
|
|
29
21
|
exports.FIELD_PERIOD_COMPARISION = FIELD_PERIOD_COMPARISION;
|
|
30
22
|
var FIELD_PERIOD_DATES = 'period_dates';
|
|
@@ -45,20 +37,19 @@ var NO_DATA_FIELD = 'no_data_cell';
|
|
|
45
37
|
exports.NO_DATA_FIELD = NO_DATA_FIELD;
|
|
46
38
|
var dataFieldDictonary = ['period_comparison', 'period_dates', 'settlements_days', 'total_consumptions', 'energy_consumption', 'power_consumption', 'daily_consumptions', 'average_temperature'];
|
|
47
39
|
exports.dataFieldDictonary = dataFieldDictonary;
|
|
48
|
-
|
|
49
40
|
var desktopGetHeaderFields = function desktopGetHeaderFields(contextApiInfo, withPowerComparison, showTemp) {
|
|
50
41
|
var config = contextApiInfo.config,
|
|
51
|
-
|
|
42
|
+
Label = contextApiInfo.Label;
|
|
52
43
|
var _config$texts$consump = config.texts.consumptionComparison,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
44
|
+
periodDates = _config$texts$consump.periodDates,
|
|
45
|
+
settlementDays = _config$texts$consump.settlementDays,
|
|
46
|
+
energyConsumption = _config$texts$consump.energyConsumption,
|
|
47
|
+
powerConsumption = _config$texts$consump.powerConsumption,
|
|
48
|
+
totalConsumption = _config$texts$consump.totalConsumption,
|
|
49
|
+
dailyConsumption = _config$texts$consump.dailyConsumption,
|
|
50
|
+
averageTemperature = _config$texts$consump.averageTemperature,
|
|
51
|
+
yearOrBimester = _config$texts$consump.yearOrBimester,
|
|
52
|
+
yearOrPeriod = _config$texts$consump.yearOrPeriod;
|
|
62
53
|
return [{
|
|
63
54
|
id: 'season',
|
|
64
55
|
Component: /*#__PURE__*/_react.default.createElement(Label, {
|
|
@@ -101,41 +92,32 @@ var desktopGetHeaderFields = function desktopGetHeaderFields(contextApiInfo, wit
|
|
|
101
92
|
}, averageTemperature)
|
|
102
93
|
}];
|
|
103
94
|
};
|
|
104
|
-
|
|
105
95
|
exports.desktopGetHeaderFields = desktopGetHeaderFields;
|
|
106
|
-
|
|
107
96
|
var formatInterval = function formatInterval(period) {
|
|
108
97
|
var _period$settlements, _period$settlements2;
|
|
109
|
-
|
|
110
98
|
var startDate = period === null || period === void 0 ? void 0 : (_period$settlements = period.settlements) === null || _period$settlements === void 0 ? void 0 : _period$settlements.start_date;
|
|
111
99
|
var endDate = period === null || period === void 0 ? void 0 : (_period$settlements2 = period.settlements) === null || _period$settlements2 === void 0 ? void 0 : _period$settlements2.end_date;
|
|
112
100
|
return startDate && endDate && "".concat((0, _dayjs.default)(startDate).format('DD/MM'), " - ").concat((0, _dayjs.default)(endDate).format('DD/MM'));
|
|
113
101
|
};
|
|
114
|
-
|
|
115
102
|
var getField = function getField() {
|
|
116
103
|
var _data$period, _data$period$settleme, _getDailyConsumption$, _ref;
|
|
117
|
-
|
|
118
104
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
119
105
|
var contextApiInfo = arguments.length > 1 ? arguments[1] : undefined;
|
|
120
106
|
var Label = contextApiInfo.Label;
|
|
121
107
|
var isHeader = options.isHeader,
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
text = options.text;
|
|
126
|
-
|
|
108
|
+
data = options.data,
|
|
109
|
+
primary = options.primary,
|
|
110
|
+
text = options.text;
|
|
127
111
|
var textLabel = /*#__PURE__*/_react.default.createElement(Label, {
|
|
128
112
|
alias: _aliases.DETAIL
|
|
129
113
|
}, text);
|
|
130
|
-
|
|
131
114
|
var textAlias = primary ? _aliases.PERIOD_COMPARISON_TEXT : _aliases.PERIOD_COMPARISON_TEXT_PREV;
|
|
132
115
|
var magnitudeAlias = primary ? _aliases.PERIOD_COMPARISON_NUMBER : _aliases.PERIOD_COMPARISON_NUMBER_PREV;
|
|
133
116
|
var unitAlias = primary ? _aliases.PERIOD_COMPARISON_UNIT : _aliases.PERIOD_COMPARISON_UNIT_PREV;
|
|
134
117
|
return _ref = {}, _defineProperty(_ref, FIELD_PERIOD_COMPARISION, {
|
|
135
118
|
id: FIELD_PERIOD_COMPARISION,
|
|
136
119
|
Component: !isHeader ? /*#__PURE__*/_react.default.createElement(Label, {
|
|
137
|
-
alias: textAlias
|
|
138
|
-
className: "".concat(mobileLastYear && _stylesModule.default.mobileLastYear)
|
|
120
|
+
alias: textAlias
|
|
139
121
|
}, text || (0, _utils.stringOrDash)(data)) : textLabel
|
|
140
122
|
}), _defineProperty(_ref, FIELD_PERIOD_DATES, {
|
|
141
123
|
id: FIELD_PERIOD_DATES,
|
|
@@ -217,14 +199,11 @@ var getField = function getField() {
|
|
|
217
199
|
}, data)
|
|
218
200
|
}), _ref;
|
|
219
201
|
};
|
|
220
|
-
|
|
221
202
|
exports.getField = getField;
|
|
222
|
-
|
|
223
203
|
var noPeriodData = function noPeriodData(primary, noData, contextApiInfo) {
|
|
224
204
|
return getField({
|
|
225
205
|
primary: primary,
|
|
226
206
|
data: noData
|
|
227
207
|
}, contextApiInfo)[NO_DATA_FIELD];
|
|
228
208
|
};
|
|
229
|
-
|
|
230
209
|
exports.noPeriodData = noPeriodData;
|
|
@@ -4,31 +4,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _seamlessImmutable = require("seamless-immutable");
|
|
11
|
-
|
|
12
9
|
var _propTypes = require("prop-types");
|
|
13
|
-
|
|
14
10
|
var _periods = require("../../../../shared/utils/periods");
|
|
15
|
-
|
|
16
11
|
var _smartBillTypes = require("../../../../shared/types/smartBillTypes");
|
|
17
|
-
|
|
18
12
|
var _billDataTypes = require("../../../../shared/types/billDataTypes");
|
|
19
|
-
|
|
20
13
|
var _WithContextApi = _interopRequireDefault(require("../../../WithContextApi"));
|
|
21
|
-
|
|
22
14
|
var _utils = require("./utils");
|
|
23
|
-
|
|
24
15
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
25
|
-
|
|
26
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
|
-
|
|
28
17
|
var ComparisonTable = function ComparisonTable(_ref) {
|
|
29
18
|
var contextApiInfo = _ref.contextApiInfo,
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
billData = _ref.billData,
|
|
20
|
+
isDesktopSize = _ref.isDesktopSize;
|
|
32
21
|
var currentPeriod = (0, _periods.getCurrentPeriod)(billData);
|
|
33
22
|
var lastYearPeriod = (0, _periods.getLastYearPeriod)(billData);
|
|
34
23
|
var withPowerComparison = contextApiInfo.config.validations.withPowerComparison;
|
|
@@ -42,13 +31,10 @@ var ComparisonTable = function ComparisonTable(_ref) {
|
|
|
42
31
|
return line.Component;
|
|
43
32
|
}));
|
|
44
33
|
};
|
|
45
|
-
|
|
46
34
|
ComparisonTable.propTypes = {
|
|
47
35
|
contextApiInfo: _smartBillTypes.contextApiInfoTypes,
|
|
48
36
|
billData: _billDataTypes.billDataTypes,
|
|
49
37
|
isDesktopSize: _propTypes.bool
|
|
50
38
|
};
|
|
51
|
-
|
|
52
39
|
var _default = (0, _WithContextApi.default)()(ComparisonTable);
|
|
53
|
-
|
|
54
40
|
exports.default = _default;
|
|
@@ -4,39 +4,32 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.mobileGetTableLines = exports.getPeriodFields = exports.desktopGetTableLines = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _aliases = require("../../../../shared/constants/aliases");
|
|
11
|
-
|
|
12
9
|
var _DataLine = _interopRequireDefault(require("./components/DataLine"));
|
|
13
|
-
|
|
14
10
|
var _constants = require("./constants");
|
|
15
|
-
|
|
16
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
12
|
var getPeriodFields = function getPeriodFields(contextApiInfo, period, periodAverageTemperature, withPowerComparison, isDesktop) {
|
|
19
13
|
var _period$lastYearPerio, _period$lastYearPerio2, _period$lastYearPerio3, _period$lastYearPerio4, _period$currentPeriod, _period$currentPeriod2, _period$currentPeriod3, _period$currentPeriod4;
|
|
20
|
-
|
|
21
14
|
var stylingOptions = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
|
|
22
15
|
var options = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : {};
|
|
23
16
|
var config = contextApiInfo.config,
|
|
24
|
-
|
|
17
|
+
Label = contextApiInfo.Label;
|
|
25
18
|
var _config$texts$consump = config.texts.consumptionComparison,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
19
|
+
daysUnit = _config$texts$consump.daysUnit,
|
|
20
|
+
temperatureUnit = _config$texts$consump.temperatureUnit,
|
|
21
|
+
periodDates = _config$texts$consump.periodDates,
|
|
22
|
+
settlementDays = _config$texts$consump.settlementDays,
|
|
23
|
+
energyConsumption = _config$texts$consump.energyConsumption,
|
|
24
|
+
powerConsumption = _config$texts$consump.powerConsumption,
|
|
25
|
+
totalConsumption = _config$texts$consump.totalConsumption,
|
|
26
|
+
dailyConsumption = _config$texts$consump.dailyConsumption,
|
|
27
|
+
averageTemperature = _config$texts$consump.averageTemperature,
|
|
28
|
+
yearOrPeriodMobile = _config$texts$consump.yearOrPeriodMobile;
|
|
36
29
|
var noData = config.texts.commons.noData;
|
|
37
30
|
var primary = stylingOptions.primary,
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
gray = stylingOptions.gray,
|
|
32
|
+
semibold = stylingOptions.semibold;
|
|
40
33
|
var formattedPeriod = period.number && period.year && "".concat(period.number, "/").concat(period.year);
|
|
41
34
|
var mobileLastYearPeriodFormatted = ((_period$lastYearPerio = period.lastYearPeriod) === null || _period$lastYearPerio === void 0 ? void 0 : _period$lastYearPerio.number) && ((_period$lastYearPerio2 = period.lastYearPeriod) === null || _period$lastYearPerio2 === void 0 ? void 0 : _period$lastYearPerio2.year) && "".concat((_period$lastYearPerio3 = period.lastYearPeriod) === null || _period$lastYearPerio3 === void 0 ? void 0 : _period$lastYearPerio3.number, "/").concat((_period$lastYearPerio4 = period.lastYearPeriod) === null || _period$lastYearPerio4 === void 0 ? void 0 : _period$lastYearPerio4.year);
|
|
42
35
|
var mobileCurrentYearPeriodFormatted = ((_period$currentPeriod = period.currentPeriod) === null || _period$currentPeriod === void 0 ? void 0 : _period$currentPeriod.number) && ((_period$currentPeriod2 = period.currentPeriod) === null || _period$currentPeriod2 === void 0 ? void 0 : _period$currentPeriod2.year) && "".concat((_period$currentPeriod3 = period.currentPeriod) === null || _period$currentPeriod3 === void 0 ? void 0 : _period$currentPeriod3.number, "/").concat((_period$currentPeriod4 = period.currentPeriod) === null || _period$currentPeriod4 === void 0 ? void 0 : _period$currentPeriod4.year);
|
|
@@ -48,17 +41,13 @@ var getPeriodFields = function getPeriodFields(contextApiInfo, period, periodAve
|
|
|
48
41
|
}];
|
|
49
42
|
var noDataLastYearPeriod = false;
|
|
50
43
|
var noDataCurrentPeriod = false;
|
|
51
|
-
|
|
52
44
|
if (!isDesktop && Object.keys(period === null || period === void 0 ? void 0 : period.lastYearPeriod).length === 0) {
|
|
53
45
|
noDataLastYearPeriod = true;
|
|
54
46
|
}
|
|
55
|
-
|
|
56
47
|
if (!isDesktop && Object.keys(period.currentPeriod).length === 0) {
|
|
57
48
|
noDataCurrentPeriod = true;
|
|
58
49
|
}
|
|
59
|
-
|
|
60
50
|
var mobileNoPeriodData = (0, _constants.noPeriodData)(primary, noData, contextApiInfo);
|
|
61
|
-
|
|
62
51
|
var desktopFields = function desktopFields(data, fieldId) {
|
|
63
52
|
return (0, _constants.getField)({
|
|
64
53
|
primary: primary,
|
|
@@ -68,13 +57,11 @@ var getPeriodFields = function getPeriodFields(contextApiInfo, period, periodAve
|
|
|
68
57
|
data: data
|
|
69
58
|
}, contextApiInfo)[fieldId];
|
|
70
59
|
};
|
|
71
|
-
|
|
72
60
|
var mobileFieldsLastYear = function mobileFieldsLastYear(data, fieldId) {
|
|
73
61
|
return !noDataLastYearPeriod ? (0, _constants.getField)({
|
|
74
62
|
data: data
|
|
75
63
|
}, contextApiInfo)[fieldId] : mobileNoPeriodData;
|
|
76
64
|
};
|
|
77
|
-
|
|
78
65
|
var mobileTextField = function mobileTextField(text, fieldId) {
|
|
79
66
|
return (0, _constants.getField)({
|
|
80
67
|
gray: gray,
|
|
@@ -82,7 +69,6 @@ var getPeriodFields = function getPeriodFields(contextApiInfo, period, periodAve
|
|
|
82
69
|
isHeader: true
|
|
83
70
|
}, contextApiInfo)[fieldId];
|
|
84
71
|
};
|
|
85
|
-
|
|
86
72
|
var mobileFieldCurrentYear = function mobileFieldCurrentYear(data, fieldId) {
|
|
87
73
|
return !noDataCurrentPeriod ? (0, _constants.getField)({
|
|
88
74
|
primary: primary,
|
|
@@ -90,11 +76,9 @@ var getPeriodFields = function getPeriodFields(contextApiInfo, period, periodAve
|
|
|
90
76
|
data: data
|
|
91
77
|
}, contextApiInfo)[fieldId] : mobileNoPeriodData;
|
|
92
78
|
};
|
|
93
|
-
|
|
94
79
|
var _ref = periodAverageTemperature || {},
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
80
|
+
lastYearPeriodAverageTemperature = _ref.lastYearPeriodAverageTemperature,
|
|
81
|
+
currentPeriodAverageTemperature = _ref.currentPeriodAverageTemperature;
|
|
98
82
|
return isDesktop ? [desktopFields(formattedPeriod, _constants.FIELD_PERIOD_COMPARISION), desktopFields(period, _constants.FIELD_PERIOD_DATES), desktopFields({
|
|
99
83
|
period: period,
|
|
100
84
|
daysUnit: daysUnit
|
|
@@ -115,9 +99,7 @@ var getPeriodFields = function getPeriodFields(contextApiInfo, period, periodAve
|
|
|
115
99
|
temperatureUnit: temperatureUnit
|
|
116
100
|
}, _constants.FIELD_AVERAGE_TEMPERATURE)] : {};
|
|
117
101
|
};
|
|
118
|
-
|
|
119
102
|
exports.getPeriodFields = getPeriodFields;
|
|
120
|
-
|
|
121
103
|
var renderDataLine = function renderDataLine(contextApiInfo, mobilePeriod, mobilePeriodAverageTemperature, withPowerComparison, isDesktop, data) {
|
|
122
104
|
return /*#__PURE__*/_react.default.createElement(_DataLine.default, {
|
|
123
105
|
key: "",
|
|
@@ -129,7 +111,6 @@ var renderDataLine = function renderDataLine(contextApiInfo, mobilePeriod, mobil
|
|
|
129
111
|
isDesktop: isDesktop
|
|
130
112
|
});
|
|
131
113
|
};
|
|
132
|
-
|
|
133
114
|
var desktopGetTableLines = function desktopGetTableLines(contextApiInfo, currentPeriod, currentPeriodAverageTemperature, lastYearPeriod, lastYearPeriodAverageTemperature, isDesktop, withPowerComparison) {
|
|
134
115
|
var showTemp = currentPeriodAverageTemperature && lastYearPeriodAverageTemperature;
|
|
135
116
|
return [{
|
|
@@ -159,9 +140,7 @@ var desktopGetTableLines = function desktopGetTableLines(contextApiInfo, current
|
|
|
159
140
|
})
|
|
160
141
|
}];
|
|
161
142
|
};
|
|
162
|
-
|
|
163
143
|
exports.desktopGetTableLines = desktopGetTableLines;
|
|
164
|
-
|
|
165
144
|
var mobileGetTableLines = function mobileGetTableLines(contextApiInfo, currentPeriod, currentPeriodAverageTemperature, lastYearPeriod, lastYearPeriodAverageTemperature, isDesktop, withPowerComparison) {
|
|
166
145
|
var mobilePeriod = {
|
|
167
146
|
currentPeriod: currentPeriod,
|
|
@@ -177,5 +156,4 @@ var mobileGetTableLines = function mobileGetTableLines(contextApiInfo, currentPe
|
|
|
177
156
|
}))
|
|
178
157
|
}];
|
|
179
158
|
};
|
|
180
|
-
|
|
181
159
|
exports.mobileGetTableLines = mobileGetTableLines;
|
|
@@ -4,28 +4,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _aliases = require("../../../../shared/constants/aliases");
|
|
11
|
-
|
|
12
9
|
var _smartBillTypes = require("../../../../shared/types/smartBillTypes");
|
|
13
|
-
|
|
14
10
|
var _WithContextApi = _interopRequireDefault(require("../../../WithContextApi"));
|
|
15
|
-
|
|
16
11
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
17
|
-
|
|
18
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
13
|
var ConsumptionAdvice = function ConsumptionAdvice(_ref) {
|
|
21
14
|
var contextApiInfo = _ref.contextApiInfo;
|
|
22
15
|
var config = contextApiInfo.config,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
16
|
+
assets = contextApiInfo.assets,
|
|
17
|
+
Label = contextApiInfo.Label,
|
|
18
|
+
Button = contextApiInfo.Button,
|
|
19
|
+
ExternalLink = contextApiInfo.ExternalLink;
|
|
27
20
|
var texts = config.texts,
|
|
28
|
-
|
|
21
|
+
stylesConfig = config.stylesConfig;
|
|
29
22
|
var consumptionSimulator = config.externalLinks.consumptionSimulator;
|
|
30
23
|
var LightBulbIcon = assets.LightBulbIcon;
|
|
31
24
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -43,14 +36,13 @@ var ConsumptionAdvice = function ConsumptionAdvice(_ref) {
|
|
|
43
36
|
url: consumptionSimulator,
|
|
44
37
|
className: _stylesModule.default.externalLink
|
|
45
38
|
}, /*#__PURE__*/_react.default.createElement(Button, {
|
|
46
|
-
|
|
39
|
+
classNames: {
|
|
40
|
+
root: _stylesModule.default.button
|
|
41
|
+
}
|
|
47
42
|
}, texts.consumptionComparison.buttonLabel)));
|
|
48
43
|
};
|
|
49
|
-
|
|
50
44
|
ConsumptionAdvice.propTypes = {
|
|
51
45
|
contextApiInfo: _smartBillTypes.contextApiInfoTypes
|
|
52
46
|
};
|
|
53
|
-
|
|
54
47
|
var _default = (0, _WithContextApi.default)()(ConsumptionAdvice);
|
|
55
|
-
|
|
56
48
|
exports.default = _default;
|