@widergy/utilitygo-smart-bill-web 1.7.3 → 1.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/dist/components/Advice/index.js +1 -2
- package/dist/components/Advice/styles.module.scss +2 -1
- package/dist/components/Amount/index.js +2 -2
- package/dist/components/Amount/styles.module.scss +10 -2
- package/dist/components/BarChart/constants.js +19 -3
- package/dist/components/BarChart/index.js +70 -101
- package/dist/components/BarChart/styles.module.scss +71 -0
- package/dist/components/BarChart/utils.js +31 -15
- package/dist/components/BillCalculation/components/ConceptCard/index.js +28 -9
- package/dist/components/BillCalculation/components/ConceptCard/styles.module.scss +16 -6
- package/dist/components/BillCalculation/index.js +10 -5
- package/dist/components/BillCalculation/utils.js +14 -9
- package/dist/components/BillSummary/components/BilledConcepts/components/Concept/index.js +11 -18
- package/dist/components/BillSummary/components/BilledConcepts/components/Concept/styles.module.scss +1 -5
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/constants.js +9 -3
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/index.js +21 -28
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/styles.module.scss +2 -2
- package/dist/components/BillSummary/components/BilledConcepts/constants.js +1 -1
- package/dist/components/BillSummary/components/BilledConcepts/index.js +8 -3
- package/dist/components/BillSummary/components/BilledConcepts/styles.module.scss +1 -1
- package/dist/components/BillSummary/components/BilledConcepts/utils.js +20 -6
- package/dist/components/BillSummary/styles.module.scss +2 -3
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/DataLine/index.js +3 -3
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/DataLine/styles.module.scss +4 -2
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/index.js +3 -3
- package/dist/components/ConsumptionComparison/components/ComparisonTable/constants.js +61 -37
- package/dist/components/ConsumptionComparison/components/ComparisonTable/styles.module.scss +14 -6
- package/dist/components/ConsumptionComparison/components/ComparisonTable/utils.js +4 -2
- package/dist/components/ConsumptionComparison/components/ConsumptionAdvice/index.js +2 -5
- package/dist/components/ConsumptionComparison/components/ConsumptionAdvice/styles.module.scss +4 -5
- package/dist/components/ConsumptionComparison/components/PercentageComparison/index.js +4 -3
- package/dist/components/ConsumptionComparison/components/PercentageComparison/styles.module.scss +3 -12
- package/dist/components/ConsumptionComparison/index.js +9 -11
- package/dist/components/ConsumptionComparison/styles.module.scss +5 -4
- package/dist/components/ConsumptionEnergyDetails/components/ConsumptionEnergyComparison/index.js +26 -2
- package/dist/components/ConsumptionEnergyDetails/components/ConsumptionEnergyComparison/styles.module.scss +2 -0
- package/dist/components/ConsumptionEnergyDetails/components/PercentageComparison/styles.module.scss +1 -1
- package/dist/components/ConsumptionEnergyDetails/index.js +21 -11
- package/dist/components/ConsumptionEnergyDetails/styles.module.scss +13 -1
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/index.js +61 -42
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/styles.module.scss +33 -20
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/utils.js +24 -0
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderConsumption/index.js +13 -19
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderConsumption/styles.module.scss +3 -6
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderSettlement/index.js +7 -9
- package/dist/components/ConsumptionIncluded/components/TimelineRow/index.js +11 -3
- package/dist/components/ConsumptionIncluded/components/TimelineRow/styles.module.scss +10 -13
- package/dist/components/ConsumptionIncluded/styles.module.scss +5 -0
- package/dist/components/ConsumptionIncluded/utils.js +6 -6
- package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/components/ReadingRow/styles.module.scss +2 -0
- package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/index.js +8 -6
- package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/styles.module.scss +16 -4
- package/dist/components/ConsumptionPeriod/components/HistoryGraph/index.js +1 -7
- package/dist/components/ConsumptionPeriod/components/Reading/index.js +26 -9
- package/dist/components/ConsumptionPeriod/components/Reading/styles.module.scss +13 -8
- package/dist/components/ConsumptionPeriod/styles.module.scss +11 -10
- package/dist/components/Date/index.js +2 -2
- package/dist/components/Date/styles.module.scss +3 -0
- package/dist/components/DebtState/styles.module.scss +1 -1
- package/dist/components/IconAndDetails/index.js +4 -1
- package/dist/components/IconAndDetails/styles.module.scss +2 -2
- package/dist/components/Magnitude/index.js +6 -5
- package/dist/components/Magnitude/styles.module.scss +5 -5
- package/dist/components/MainBillData/components/BillAlert/components/BillParticularConditions/index.js +5 -5
- package/dist/components/MainBillData/components/BillAlert/styles.module.scss +5 -3
- package/dist/components/MainBillData/components/BillBody/components/ClientData/index.js +13 -13
- package/dist/components/MainBillData/components/BillBody/components/ClientData/styles.module.scss +3 -3
- package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/styles.module.scss +1 -1
- package/dist/components/MainBillData/components/BillBody/styles.module.scss +4 -3
- package/dist/components/MainBillData/components/BillHeader/components/TypeAndNumber/index.js +3 -2
- package/dist/components/MainBillData/components/BillHeader/components/TypeAndNumber/styles.module.scss +7 -3
- package/dist/components/MainBillData/components/BillHeader/index.js +2 -2
- package/dist/components/MainBillData/components/BillHeader/styles.module.scss +10 -9
- package/dist/components/MainBillData/styles.module.scss +0 -1
- package/dist/components/Period/index.js +39 -11
- package/dist/components/Period/styles.module.scss +13 -4
- package/dist/components/PowerProgresBar/components/PowerConsumption/index.js +2 -3
- package/dist/components/PowerProgresBar/index.js +3 -4
- package/dist/components/RatesDefinition/components/BillRate/components/RatePrices/index.js +6 -17
- package/dist/components/RatesDefinition/components/BillRate/components/RatePrices/styles.module.scss +8 -3
- package/dist/components/RatesDefinition/components/BillRate/index.js +10 -11
- package/dist/components/RatesDefinition/components/BillRate/styles.module.scss +8 -29
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/Category/index.js +9 -5
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/Category/styles.module.scss +12 -18
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/components/Stage/components/SubStage/index.js +4 -3
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/components/Stage/index.js +13 -62
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/components/Stage/styles.module.scss +2 -6
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/index.js +1 -0
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/components/IndicatorLabel/index.js +18 -12
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/components/IndicatorLabel/styles.module.scss +7 -3
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/index.js +23 -14
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/styles.module.scss +6 -19
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/utils.js +35 -1
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/LegendItem/index.js +80 -0
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/LegendItem/styles.module.scss +57 -0
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/constants.js +17 -9
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/styles.module.scss +2 -1
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/utils.js +1 -1
- package/dist/components/RatesDefinition/components/CategoryByConsumption/index.js +61 -7
- package/dist/components/RatesDefinition/components/CategoryByConsumption/styles.module.scss +20 -4
- package/dist/components/RatesDefinition/components/PurchasedRate/index.js +12 -22
- package/dist/components/RatesDefinition/components/PurchasedRate/styles.module.scss +14 -44
- package/dist/components/RatesDefinition/index.js +16 -12
- package/dist/components/RatesDefinition/styles.module.scss +38 -10
- package/dist/components/StyledAmount/constants.js +0 -45
- package/dist/components/StyledAmount/index.js +5 -14
- package/dist/components/StyledAmount/styles.module.scss +14 -8
- package/dist/components/WithContextApi/index.js +9 -1
- package/dist/constants/deviceSizes.js +1 -1
- package/dist/index.js +28 -15
- package/dist/shared/Context/index.js +1 -1
- package/dist/shared/constants/aliases.js +532 -10
- package/dist/shared/constants/components.js +3 -1
- package/dist/shared/constants/consumptions.js +1 -1
- package/dist/shared/constants/readings.js +1 -1
- package/dist/shared/constants/stagesGraph.js +1 -1
- package/dist/shared/types/assetsTypes.js +1 -30
- package/dist/shared/types/billDataTypes.js +1 -1
- package/dist/shared/types/componentsTypes.js +4 -2
- package/dist/shared/types/rateStagesTypes.js +1 -1
- package/dist/shared/utils/consumptions.js +3 -3
- package/dist/shared/utils/context.js +3 -1
- package/dist/shared/utils/periods.js +1 -1
- package/dist/shared/utils/readings.js +1 -1
- package/dist/shared/utils/stagesGraph.js +1 -1
- package/dist/utils.js +1 -1
- package/package.json +2 -3
- package/dist/components/BarChart/components/CustomBar/index.js +0 -111
- package/dist/components/BarChart/components/CustomLabelText/index.js +0 -48
- package/dist/components/BarChart/components/CustomXAxisLabel/index.js +0 -58
- package/dist/components/BarChart/styles.js +0 -90
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/utils.js +0 -27
- package/dist/components/BillSummary/components/Rate/index.js +0 -56
- package/dist/components/BillSummary/components/Rate/styles.module.scss +0 -43
|
@@ -7,7 +7,7 @@ exports.periodToTitleMapper = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _string = require("@widergy/web-utils/lib/string");
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
11
11
|
|
|
12
12
|
var _periodicities = require("../../shared/constants/periodicities");
|
|
13
13
|
|
|
@@ -15,21 +15,26 @@ var _periods = require("../../shared/utils/periods");
|
|
|
15
15
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
|
|
18
|
-
var periodToTitleMapper = function periodToTitleMapper(billData, texts, withBillCalcTitleDate) {
|
|
19
|
-
var
|
|
18
|
+
var periodToTitleMapper = function periodToTitleMapper(billData, texts, periodFormatter, withBillCalcTitleDate) {
|
|
19
|
+
var _settlements$current, _settlements$current2;
|
|
20
20
|
|
|
21
|
-
var currentPeriod = (0, _periods.getCurrentPeriod)(billData);
|
|
22
|
-
var
|
|
23
|
-
var
|
|
24
|
-
var
|
|
21
|
+
var currentPeriod = (0, _periods.getCurrentPeriod)(billData) || {};
|
|
22
|
+
var settlements = currentPeriod.settlements;
|
|
23
|
+
var periodicity = settlements === null || settlements === void 0 ? void 0 : settlements.periodicity;
|
|
24
|
+
var currentSettlement = (settlements === null || settlements === void 0 ? void 0 : (_settlements$current = settlements.current) === null || _settlements$current === void 0 ? void 0 : _settlements$current.number) || '-';
|
|
25
|
+
var totalSettlements = (settlements === null || settlements === void 0 ? void 0 : settlements.total_settlements) || '-';
|
|
25
26
|
var periodNumber = (currentPeriod === null || currentPeriod === void 0 ? void 0 : currentPeriod.number) || '-';
|
|
26
27
|
var year = (currentPeriod === null || currentPeriod === void 0 ? void 0 : currentPeriod.year) || '-';
|
|
27
28
|
var _texts$commons = texts.commons,
|
|
28
29
|
settlement = _texts$commons.settlement,
|
|
29
30
|
period = _texts$commons.period,
|
|
30
31
|
bimester = _texts$commons.bimester;
|
|
31
|
-
var issueedDate =
|
|
32
|
-
var issuedDateLabel = withBillCalcTitleDate ? " (".concat((0,
|
|
32
|
+
var issueedDate = settlements === null || settlements === void 0 ? void 0 : (_settlements$current2 = settlements.current) === null || _settlements$current2 === void 0 ? void 0 : _settlements$current2.issued_on;
|
|
33
|
+
var issuedDateLabel = withBillCalcTitleDate ? " (".concat((0, _dayjs.default)(issueedDate, 'YYYY-MM-DD').format('MM/YYYY'), ")") : '';
|
|
34
|
+
if (periodFormatter) return periodFormatter({
|
|
35
|
+
startDate: settlements === null || settlements === void 0 ? void 0 : settlements.start_date,
|
|
36
|
+
endDate: settlements === null || settlements === void 0 ? void 0 : settlements.end_date
|
|
37
|
+
});
|
|
33
38
|
if ((0, _string.stringToCompareWithoutAccentsInclusive)(periodicity, _periodicities.PERIODICITY.MONTHLY)) return "".concat(year, " - ").concat(period, " ").concat(periodNumber).concat(issuedDateLabel);
|
|
34
39
|
if ((0, _string.stringToCompareWithoutAccentsInclusive)(periodicity, _periodicities.PERIODICITY.BIMONTHLY)) return "".concat(settlement, " ").concat(currentSettlement, " ").concat(texts.commons.ofPreposition, " ").concat(totalSettlements, " - ").concat(bimester, " ").concat(periodNumber).concat(issuedDateLabel);
|
|
35
40
|
return '-';
|
|
@@ -30,6 +30,7 @@ var Concept = function Concept(_ref) {
|
|
|
30
30
|
isFirst = _ref.isFirst,
|
|
31
31
|
title = _ref.title,
|
|
32
32
|
percentage = _ref.percentage,
|
|
33
|
+
progressBarPercentage = _ref.progressBarPercentage,
|
|
33
34
|
value = _ref.value,
|
|
34
35
|
showPercentage = _ref.showPercentage,
|
|
35
36
|
negativeAmmount = _ref.negativeAmmount,
|
|
@@ -41,23 +42,15 @@ var Concept = function Concept(_ref) {
|
|
|
41
42
|
var _useScreenSize = (0, _hooks.useScreenSize)(),
|
|
42
43
|
isDesktopSize = _useScreenSize.isDesktopSize;
|
|
43
44
|
|
|
44
|
-
var
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
semibold: true,
|
|
49
|
-
large: true,
|
|
50
|
-
className: _stylesModule.default.graphicPercentages
|
|
51
|
-
}, "(".concat((0, _numeral.default)(percentage).format('0,0.0'), "%)"));
|
|
52
|
-
};
|
|
45
|
+
var alias = isFirst ? _aliases.CONCEPT_FIRST_AMOUNT : _aliases.CONCEPT_SECONDARY_AMOUNT;
|
|
46
|
+
var aliasDecimal = isFirst ? _aliases.CONCEPT_FIRST_AMOUNT_DECIMAL : _aliases.CONCEPT_SECONDARY_AMOUNT_DECIMAL;
|
|
47
|
+
var aliasName = isFirst ? _aliases.CONCEPT_FIRST_NAME : _aliases.CONCEPT_SECONDARY_NAME;
|
|
48
|
+
var percentageValue = "".concat((0, _numeral.default)(percentage).format('0,0.0'), "%");
|
|
53
49
|
|
|
54
50
|
var renderPercentageValidation = function renderPercentageValidation(withProgresBar) {
|
|
55
51
|
return showPercentage && percentage && (withProgresBar ? showProgressBar : !showProgressBar);
|
|
56
52
|
};
|
|
57
53
|
|
|
58
|
-
var alias = isFirst ? _aliases.CONCEPT_FIRST_AMOUNT : _aliases.CONCEPT_SECONDARY_AMOUNT;
|
|
59
|
-
var aliasDecimal = isFirst ? _aliases.CONCEPT_CARD_AMOUNT_DECIMAL : _aliases.CONCEPT_LIST_AMOUNT_DECIMAL;
|
|
60
|
-
var aliasName = isFirst ? _aliases.CONCEPT_FIRST_NAME : _aliases.CONCEPT_SECONDARY_NAME;
|
|
61
54
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
62
55
|
className: _stylesModule.default.container
|
|
63
56
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -68,19 +61,18 @@ var Concept = function Concept(_ref) {
|
|
|
68
61
|
backgroundColor: color
|
|
69
62
|
}
|
|
70
63
|
}), /*#__PURE__*/_react.default.createElement(Label, {
|
|
71
|
-
alias: aliasName
|
|
72
|
-
|
|
73
|
-
}, title), isDesktopSize && renderPercentageValidation(false) && /*#__PURE__*/_react.default.createElement(Percentage, null), !isDesktopSize && /*#__PURE__*/_react.default.createElement("div", {
|
|
64
|
+
alias: aliasName
|
|
65
|
+
}, "".concat(title, " ").concat(renderPercentageValidation(false) ? "(".concat(percentageValue, ")") : '')), !isDesktopSize && /*#__PURE__*/_react.default.createElement("div", {
|
|
74
66
|
className: _stylesModule.default.mobileAmount
|
|
75
67
|
}, /*#__PURE__*/_react.default.createElement(_StyledAmount.default, {
|
|
76
68
|
alias: alias,
|
|
77
69
|
aliasDecimal: aliasDecimal,
|
|
78
70
|
variant: "xlarge",
|
|
79
71
|
amount: value
|
|
80
|
-
}))),
|
|
72
|
+
}))), renderPercentageValidation(true) && /*#__PURE__*/_react.default.createElement("div", {
|
|
81
73
|
className: _stylesModule.default.progressBarContainer
|
|
82
74
|
}, /*#__PURE__*/_react.default.createElement(ProgressBar, {
|
|
83
|
-
value:
|
|
75
|
+
value: progressBarPercentage,
|
|
84
76
|
classNames: {
|
|
85
77
|
root: "".concat(_stylesModule.default.progressBarRoot, " ").concat(value === 0 && _stylesModule.default.hidden),
|
|
86
78
|
barColorPrimary: isFirst ? _stylesModule.default.primaryProgressBar : _stylesModule.default.grayProgressBar,
|
|
@@ -88,7 +80,7 @@ var Concept = function Concept(_ref) {
|
|
|
88
80
|
container: _stylesModule.default.progressContainer
|
|
89
81
|
},
|
|
90
82
|
withLabel: value !== 0,
|
|
91
|
-
customLabel:
|
|
83
|
+
customLabel: percentageValue
|
|
92
84
|
})), isDesktopSize && /*#__PURE__*/_react.default.createElement("div", {
|
|
93
85
|
className: showProgressBar ? _stylesModule.default.progressBarValueContainer : _stylesModule.default.graphicValueContainer
|
|
94
86
|
}, /*#__PURE__*/_react.default.createElement(_StyledAmount.default, {
|
|
@@ -105,6 +97,7 @@ Concept.propTypes = {
|
|
|
105
97
|
title: _propTypes.string,
|
|
106
98
|
value: _propTypes.number,
|
|
107
99
|
percentage: _propTypes.number,
|
|
100
|
+
progressBarPercentage: _propTypes.number,
|
|
108
101
|
showPercentage: _propTypes.bool,
|
|
109
102
|
negativeAmmount: _propTypes.bool,
|
|
110
103
|
showProgressBar: _propTypes.bool,
|
package/dist/components/BillSummary/components/BilledConcepts/components/Concept/styles.module.scss
CHANGED
|
@@ -9,7 +9,7 @@ $progress-bar-border-radius: 2px;
|
|
|
9
9
|
%progress-bar-label {
|
|
10
10
|
font-size: $xsmall;
|
|
11
11
|
font-weight: 600;
|
|
12
|
-
margin: 0;
|
|
12
|
+
margin: 2px 0;
|
|
13
13
|
|
|
14
14
|
@media #{$tablet-mobile} {
|
|
15
15
|
font-size: $small;
|
|
@@ -59,10 +59,6 @@ $progress-bar-border-radius: 2px;
|
|
|
59
59
|
width: 15px;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
.titleLabelContainer {
|
|
63
|
-
max-width: 55%;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
62
|
.graphicPercentages {
|
|
67
63
|
margin-left: 24px;
|
|
68
64
|
|
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
var
|
|
8
|
-
|
|
6
|
+
exports.PIE_CHART_CUSTOMIZATION = void 0;
|
|
7
|
+
var PIE_CHART_CUSTOMIZATION = {
|
|
8
|
+
animationLength: 800,
|
|
9
|
+
height: 200,
|
|
10
|
+
minAngle: 0.1,
|
|
11
|
+
outerRadius: 100,
|
|
12
|
+
width: 200
|
|
13
|
+
};
|
|
14
|
+
exports.PIE_CHART_CUSTOMIZATION = PIE_CHART_CUSTOMIZATION;
|
package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/index.js
CHANGED
|
@@ -7,21 +7,27 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
var _recharts = require("recharts");
|
|
11
|
-
|
|
12
10
|
var _propTypes = require("prop-types");
|
|
13
11
|
|
|
12
|
+
var _smartBillTypes = require("../../../../../../shared/types/smartBillTypes");
|
|
13
|
+
|
|
14
|
+
var _WithContextApi = _interopRequireDefault(require("../../../../../WithContextApi"));
|
|
15
|
+
|
|
14
16
|
var _utils = require("../../utils");
|
|
15
17
|
|
|
16
|
-
var
|
|
18
|
+
var _constants = require("./constants");
|
|
17
19
|
|
|
18
20
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
19
21
|
|
|
20
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
23
|
|
|
24
|
+
function _extends() { _extends = Object.assign || 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); }
|
|
25
|
+
|
|
22
26
|
var PieChartContainer = function PieChartContainer(_ref) {
|
|
23
27
|
var concepts = _ref.concepts,
|
|
24
|
-
additionalInfo = _ref.additionalInfo
|
|
28
|
+
additionalInfo = _ref.additionalInfo,
|
|
29
|
+
contextApiInfo = _ref.contextApiInfo;
|
|
30
|
+
var PieChart = contextApiInfo.PieChart;
|
|
25
31
|
var pieConceptsData = concepts.map(function (concept) {
|
|
26
32
|
return {
|
|
27
33
|
color: concept.color,
|
|
@@ -31,35 +37,22 @@ var PieChartContainer = function PieChartContainer(_ref) {
|
|
|
31
37
|
});
|
|
32
38
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
33
39
|
className: _stylesModule.default.container
|
|
34
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
35
|
-
className: _stylesModule.default.
|
|
36
|
-
}, !additionalInfo.negativeAmmount && /*#__PURE__*/_react.default.createElement(_recharts.ResponsiveContainer, {
|
|
37
|
-
height: 250
|
|
38
|
-
}, /*#__PURE__*/_react.default.createElement(_recharts.PieChart, {
|
|
39
|
-
width: 400,
|
|
40
|
-
height: 250
|
|
41
|
-
}, /*#__PURE__*/_react.default.createElement(_recharts.Pie, {
|
|
40
|
+
}, !additionalInfo.negativeAmmount && /*#__PURE__*/_react.default.createElement(PieChart, _extends({
|
|
41
|
+
className: _stylesModule.default.pie,
|
|
42
42
|
data: pieConceptsData,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
outerRadius: 100,
|
|
48
|
-
fill: "#8884d8",
|
|
49
|
-
dataKey: "value"
|
|
50
|
-
}, concepts === null || concepts === void 0 ? void 0 : concepts.map(function (concept) {
|
|
51
|
-
return /*#__PURE__*/_react.default.createElement(_recharts.Cell, {
|
|
52
|
-
fill: concept.color,
|
|
53
|
-
stroke: "none"
|
|
54
|
-
});
|
|
55
|
-
}))))), concepts.map(function (concept) {
|
|
56
|
-
return (0, _utils.renderConcept)(concept, additionalInfo);
|
|
43
|
+
withLabels: false,
|
|
44
|
+
withLegend: false
|
|
45
|
+
}, _constants.PIE_CHART_CUSTOMIZATION)), concepts.map(function (concept, index) {
|
|
46
|
+
return (0, _utils.renderConcept)(concept, additionalInfo, index === 0);
|
|
57
47
|
}));
|
|
58
48
|
};
|
|
59
49
|
|
|
60
50
|
PieChartContainer.propTypes = {
|
|
51
|
+
additionalInfo: (0, _propTypes.shape)((0, _propTypes.objectOf)(_propTypes.any)),
|
|
61
52
|
concepts: (0, _propTypes.shape)((0, _propTypes.objectOf)(_propTypes.any)),
|
|
62
|
-
|
|
53
|
+
contextApiInfo: _smartBillTypes.contextApiInfoTypes
|
|
63
54
|
};
|
|
64
|
-
|
|
55
|
+
|
|
56
|
+
var _default = (0, _WithContextApi.default)()(PieChartContainer);
|
|
57
|
+
|
|
65
58
|
exports.default = _default;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.toggleOptions = exports.progressBar = exports.pieChart = exports.COLORS = void 0;
|
|
7
7
|
|
|
8
8
|
var _colorsExport = require("../../../../scss/variables/_colorsExport.scss");
|
|
9
9
|
|
|
@@ -44,7 +44,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
44
44
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
45
45
|
|
|
46
46
|
var BilledConcepts = function BilledConcepts(_ref) {
|
|
47
|
-
var _billData$detail
|
|
47
|
+
var _billData$detail;
|
|
48
48
|
|
|
49
49
|
var contextApiInfo = _ref.contextApiInfo,
|
|
50
50
|
billData = _ref.billData;
|
|
@@ -52,7 +52,8 @@ var BilledConcepts = function BilledConcepts(_ref) {
|
|
|
52
52
|
Label = contextApiInfo.Label,
|
|
53
53
|
Toggle = contextApiInfo.Toggle,
|
|
54
54
|
assets = contextApiInfo.assets;
|
|
55
|
-
var showZeroConcepts = config.showZeroConcepts
|
|
55
|
+
var showZeroConcepts = config.showZeroConcepts,
|
|
56
|
+
colors = config.colors;
|
|
56
57
|
var billedConceptsTitle = config.texts.billSummary.billedConceptsTitle;
|
|
57
58
|
|
|
58
59
|
var _useState = (0, _react.useState)(_constants.progressBar),
|
|
@@ -65,7 +66,11 @@ var BilledConcepts = function BilledConcepts(_ref) {
|
|
|
65
66
|
};
|
|
66
67
|
|
|
67
68
|
var totalAmount = billData === null || billData === void 0 ? void 0 : (_billData$detail = billData.detail) === null || _billData$detail === void 0 ? void 0 : _billData$detail.total_amount;
|
|
68
|
-
var concepts = (0,
|
|
69
|
+
var concepts = (0, _react.useMemo)(function () {
|
|
70
|
+
var _billData$detail2;
|
|
71
|
+
|
|
72
|
+
return (0, _utils.getOrderedAndColoredConcepts)(billData === null || billData === void 0 ? void 0 : (_billData$detail2 = billData.detail) === null || _billData$detail2 === void 0 ? void 0 : _billData$detail2.concepts, totalAmount, showZeroConcepts, (0, _utils.getColorsDefinition)(colors));
|
|
73
|
+
}, []);
|
|
69
74
|
var negativeAmmount = concepts.some(function (concept) {
|
|
70
75
|
return concept.total < 0;
|
|
71
76
|
});
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getOrderedAndColoredConcepts = exports.getItemColor = exports.
|
|
6
|
+
exports.renderConcept = exports.getOrderedAndColoredConcepts = exports.getItemColor = exports.getColorsDefinition = exports.calculatePercentages = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
@@ -49,11 +49,16 @@ var calculatePercentages = function calculatePercentages(billConcepts, totalAmou
|
|
|
49
49
|
|
|
50
50
|
exports.calculatePercentages = calculatePercentages;
|
|
51
51
|
|
|
52
|
+
var getProgressBarPercentage = function getProgressBarPercentage(maxPercentage, percentage) {
|
|
53
|
+
return percentage / maxPercentage * 100;
|
|
54
|
+
};
|
|
55
|
+
|
|
52
56
|
var renderConcept = function renderConcept(conceptData, additionalInfo, isFirst) {
|
|
53
57
|
var title = conceptData.title,
|
|
54
58
|
total = conceptData.total,
|
|
55
59
|
color = conceptData.color,
|
|
56
|
-
percentage = conceptData.percentage
|
|
60
|
+
percentage = conceptData.percentage,
|
|
61
|
+
progressBarPercentage = conceptData.progressBarPercentage;
|
|
57
62
|
var showProgressBar = additionalInfo.showProgressBar,
|
|
58
63
|
negativeAmmount = additionalInfo.negativeAmmount,
|
|
59
64
|
totalAmount = additionalInfo.totalAmount;
|
|
@@ -62,6 +67,7 @@ var renderConcept = function renderConcept(conceptData, additionalInfo, isFirst)
|
|
|
62
67
|
key: title,
|
|
63
68
|
title: title,
|
|
64
69
|
percentage: showPercentage && !negativeAmmount && percentage,
|
|
70
|
+
progressBarPercentage: progressBarPercentage,
|
|
65
71
|
showPercentage: showPercentage,
|
|
66
72
|
negativeAmmount: negativeAmmount,
|
|
67
73
|
value: total,
|
|
@@ -89,26 +95,34 @@ var getSortedData = function getSortedData(concepts, showZeroConcepts) {
|
|
|
89
95
|
};
|
|
90
96
|
};
|
|
91
97
|
|
|
92
|
-
var
|
|
98
|
+
var getColorsDefinition = function getColorsDefinition(externalColors) {
|
|
99
|
+
return [externalColors.primary || _constants.COLORS.primary].concat(_toConsumableArray(_constants.COLORS.slice(1)));
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
exports.getColorsDefinition = getColorsDefinition;
|
|
103
|
+
|
|
104
|
+
var getItemColor = function getItemColor(index, nonZeroLength, colorsDefinition) {
|
|
93
105
|
var colorsLen = _constants.COLORS.length;
|
|
94
106
|
var colorIndex = index % colorsLen;
|
|
95
107
|
var isLastNonZero = index === nonZeroLength - 1;
|
|
96
108
|
var nextColorIndex = (index + 1) % colorsLen;
|
|
97
|
-
return
|
|
109
|
+
return colorsDefinition[isLastNonZero && colorsDefinition[colorIndex] === colorsDefinition[0] ? nextColorIndex : colorIndex];
|
|
98
110
|
};
|
|
99
111
|
|
|
100
112
|
exports.getItemColor = getItemColor;
|
|
101
113
|
|
|
102
|
-
var getOrderedAndColoredConcepts = function getOrderedAndColoredConcepts(concepts, totalAmount, showZeroConcepts) {
|
|
114
|
+
var getOrderedAndColoredConcepts = function getOrderedAndColoredConcepts(concepts, totalAmount, showZeroConcepts, colorsDefinition) {
|
|
103
115
|
var _getSortedData = getSortedData(concepts, showZeroConcepts),
|
|
104
116
|
sortedConcepts = _getSortedData.sortedConcepts,
|
|
105
117
|
nonZeroLength = _getSortedData.nonZeroLength;
|
|
106
118
|
|
|
107
119
|
var percentages = calculatePercentages(sortedConcepts, totalAmount);
|
|
120
|
+
var maxPercentage = Math.max.apply(Math, _toConsumableArray(percentages));
|
|
108
121
|
return sortedConcepts.map(function (concept, index) {
|
|
109
122
|
return _objectSpread(_objectSpread({}, concept), {}, {
|
|
110
123
|
percentage: percentages[index],
|
|
111
|
-
|
|
124
|
+
progressBarPercentage: getProgressBarPercentage(maxPercentage, percentages[index]),
|
|
125
|
+
color: !isZeroConcept(concept) && getItemColor(index, nonZeroLength, colorsDefinition)
|
|
112
126
|
});
|
|
113
127
|
});
|
|
114
128
|
};
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
$containers-width: 50%;
|
|
7
7
|
|
|
8
|
-
|
|
9
8
|
.container {
|
|
10
9
|
display: flex;
|
|
11
10
|
justify-content: center;
|
|
@@ -20,7 +19,7 @@ $containers-width: 50%;
|
|
|
20
19
|
|
|
21
20
|
.ConsumptionBannerIcon {
|
|
22
21
|
border-radius: $default-container-border-radius;
|
|
23
|
-
margin:
|
|
22
|
+
margin: 24px 0;
|
|
24
23
|
width: 100%;
|
|
25
24
|
}
|
|
26
25
|
|
|
@@ -49,7 +48,7 @@ $containers-width: 50%;
|
|
|
49
48
|
padding: $default-container-padding;
|
|
50
49
|
|
|
51
50
|
@media #{$tablet-mobile} {
|
|
52
|
-
padding: $default-container-padding
|
|
51
|
+
padding: $default-container-padding;
|
|
53
52
|
}
|
|
54
53
|
}
|
|
55
54
|
|
|
@@ -19,14 +19,14 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
19
19
|
|
|
20
20
|
var DataLine = function DataLine(_ref) {
|
|
21
21
|
var fields = _ref.fields;
|
|
22
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
22
|
+
return !(0, _object.objectIsEmpty)(fields) && /*#__PURE__*/_react.default.createElement("div", {
|
|
23
23
|
className: _stylesModule.default.container
|
|
24
|
-
},
|
|
24
|
+
}, fields === null || fields === void 0 ? void 0 : fields.map(function (field) {
|
|
25
25
|
return field && /*#__PURE__*/_react.default.createElement("div", {
|
|
26
26
|
key: field.id,
|
|
27
27
|
className: _stylesModule.default.cell
|
|
28
28
|
}, field.Component);
|
|
29
|
-
}))
|
|
29
|
+
}));
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
DataLine.propTypes = {
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
@media #{$tablet-mobile} {
|
|
15
|
-
justify-content: space-
|
|
16
|
-
margin-bottom:
|
|
15
|
+
justify-content: space-between;
|
|
16
|
+
margin-bottom: 24px;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -33,10 +33,12 @@
|
|
|
33
33
|
|
|
34
34
|
&:first-child {
|
|
35
35
|
justify-content: flex-start;
|
|
36
|
+
text-align: left;
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
&:last-child {
|
|
39
40
|
justify-content: flex-end;
|
|
41
|
+
text-align: right;
|
|
40
42
|
}
|
|
41
43
|
}
|
|
42
44
|
}
|
package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/index.js
CHANGED
|
@@ -15,6 +15,8 @@ var _WithContextApi = _interopRequireDefault(require("../../../../../WithContext
|
|
|
15
15
|
|
|
16
16
|
var _WithSeason = _interopRequireDefault(require("../../../../../WithSeason"));
|
|
17
17
|
|
|
18
|
+
var _aliases = require("../../../../../../shared/constants/aliases");
|
|
19
|
+
|
|
18
20
|
var _utils = require("./utils");
|
|
19
21
|
|
|
20
22
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
@@ -38,9 +40,7 @@ var Season = function Season(_ref) {
|
|
|
38
40
|
}, /*#__PURE__*/_react.default.createElement(Icon, {
|
|
39
41
|
className: _stylesModule.default.icon
|
|
40
42
|
}), /*#__PURE__*/_react.default.createElement(Label, {
|
|
41
|
-
|
|
42
|
-
semibold: true,
|
|
43
|
-
large: true
|
|
43
|
+
alias: _aliases.SEASON
|
|
44
44
|
}, text)) : null;
|
|
45
45
|
};
|
|
46
46
|
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.noPeriodData = exports.getField = exports.desktopGetHeaderFields = exports.dataFieldDictonary = exports.NO_DATA_FIELD = exports.
|
|
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
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
11
11
|
|
|
12
12
|
var _consumptions = require("../../../../shared/utils/consumptions");
|
|
13
13
|
|
|
@@ -62,8 +62,7 @@ var desktopGetHeaderFields = function desktopGetHeaderFields(contextApiInfo, wit
|
|
|
62
62
|
return [{
|
|
63
63
|
id: 'season',
|
|
64
64
|
Component: /*#__PURE__*/_react.default.createElement(Label, {
|
|
65
|
-
alias: _aliases.DETAIL
|
|
66
|
-
semibold: true
|
|
65
|
+
alias: _aliases.DETAIL
|
|
67
66
|
}, withPowerComparison ? yearOrBimester : yearOrPeriod)
|
|
68
67
|
}, {
|
|
69
68
|
id: 'period_dates',
|
|
@@ -110,87 +109,112 @@ var formatInterval = function formatInterval(period) {
|
|
|
110
109
|
|
|
111
110
|
var startDate = period === null || period === void 0 ? void 0 : (_period$settlements = period.settlements) === null || _period$settlements === void 0 ? void 0 : _period$settlements.start_date;
|
|
112
111
|
var endDate = period === null || period === void 0 ? void 0 : (_period$settlements2 = period.settlements) === null || _period$settlements2 === void 0 ? void 0 : _period$settlements2.end_date;
|
|
113
|
-
return startDate && endDate && "".concat((0,
|
|
112
|
+
return startDate && endDate && "".concat((0, _dayjs.default)(startDate).format('DD/MM'), " - ").concat((0, _dayjs.default)(endDate).format('DD/MM'));
|
|
114
113
|
};
|
|
115
114
|
|
|
116
|
-
var getField = function getField(
|
|
117
|
-
var
|
|
115
|
+
var getField = function getField() {
|
|
116
|
+
var _data$period, _data$period$settleme, _getDailyConsumption$, _ref;
|
|
118
117
|
|
|
118
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
119
|
+
var contextApiInfo = arguments.length > 1 ? arguments[1] : undefined;
|
|
119
120
|
var Label = contextApiInfo.Label;
|
|
121
|
+
var isHeader = options.isHeader,
|
|
122
|
+
data = options.data,
|
|
123
|
+
primary = options.primary,
|
|
124
|
+
mobileLastYear = options.mobileLastYear,
|
|
125
|
+
text = options.text;
|
|
120
126
|
|
|
121
127
|
var textLabel = /*#__PURE__*/_react.default.createElement(Label, {
|
|
122
128
|
alias: _aliases.DETAIL
|
|
123
|
-
},
|
|
129
|
+
}, text);
|
|
124
130
|
|
|
125
|
-
var textAlias =
|
|
126
|
-
var magnitudeAlias =
|
|
127
|
-
var unitAlias =
|
|
131
|
+
var textAlias = primary ? _aliases.PERIOD_COMPARISON_TEXT : _aliases.PERIOD_COMPARISON_TEXT_PREV;
|
|
132
|
+
var magnitudeAlias = primary ? _aliases.PERIOD_COMPARISON_NUMBER : _aliases.PERIOD_COMPARISON_NUMBER_PREV;
|
|
133
|
+
var unitAlias = primary ? _aliases.PERIOD_COMPARISON_UNIT : _aliases.PERIOD_COMPARISON_UNIT_PREV;
|
|
128
134
|
return _ref = {}, _defineProperty(_ref, FIELD_PERIOD_COMPARISION, {
|
|
129
135
|
id: FIELD_PERIOD_COMPARISION,
|
|
130
|
-
Component: !
|
|
136
|
+
Component: !isHeader ? /*#__PURE__*/_react.default.createElement(Label, {
|
|
131
137
|
alias: textAlias,
|
|
132
|
-
className: "".concat(
|
|
133
|
-
},
|
|
138
|
+
className: "".concat(mobileLastYear && _stylesModule.default.mobileLastYear)
|
|
139
|
+
}, text || (0, _utils.stringOrDash)(data)) : textLabel
|
|
134
140
|
}), _defineProperty(_ref, FIELD_PERIOD_DATES, {
|
|
135
141
|
id: FIELD_PERIOD_DATES,
|
|
136
|
-
Component: !
|
|
142
|
+
Component: !isHeader ? /*#__PURE__*/_react.default.createElement(Label, {
|
|
137
143
|
alias: textAlias
|
|
138
|
-
},
|
|
144
|
+
}, text || (0, _utils.stringOrDash)(formatInterval(data))) : textLabel
|
|
139
145
|
}), _defineProperty(_ref, FIELD_SETTLEMENTS_DAYS, {
|
|
140
146
|
id: FIELD_SETTLEMENTS_DAYS,
|
|
141
|
-
Component:
|
|
147
|
+
Component: data ? /*#__PURE__*/_react.default.createElement(_Magnitude.default, {
|
|
142
148
|
numberAlias: magnitudeAlias,
|
|
143
149
|
unitAlias: unitAlias,
|
|
144
|
-
value: (
|
|
145
|
-
unit:
|
|
150
|
+
value: (_data$period = data.period) === null || _data$period === void 0 ? void 0 : (_data$period$settleme = _data$period.settlements) === null || _data$period$settleme === void 0 ? void 0 : _data$period$settleme.total_settlements_days,
|
|
151
|
+
unit: data.daysUnit,
|
|
152
|
+
classes: {
|
|
153
|
+
numberAndUnit: _stylesModule.default.numberAndUnit
|
|
154
|
+
}
|
|
146
155
|
}) : textLabel
|
|
147
156
|
}), _defineProperty(_ref, FIELD_TOTAL_CONSUMPTIONS, {
|
|
148
157
|
id: FIELD_TOTAL_CONSUMPTIONS,
|
|
149
|
-
Component:
|
|
158
|
+
Component: data ? /*#__PURE__*/_react.default.createElement(_Magnitude.default, {
|
|
150
159
|
numberAlias: magnitudeAlias,
|
|
151
160
|
unitAlias: unitAlias,
|
|
152
|
-
value: (0, _consumptions.getTotalConsumption)(
|
|
153
|
-
unit: (0, _consumptions.getTotalConsumption)(
|
|
161
|
+
value: (0, _consumptions.getTotalConsumption)(data, _consumptions2.ENERGY_TYPES.ACTIVE).value,
|
|
162
|
+
unit: (0, _consumptions.getTotalConsumption)(data, _consumptions2.ENERGY_TYPES.ACTIVE).unit,
|
|
163
|
+
classes: {
|
|
164
|
+
numberAndUnit: _stylesModule.default.numberAndUnit
|
|
165
|
+
}
|
|
154
166
|
}) : textLabel
|
|
155
167
|
}), _defineProperty(_ref, FIELD_ENERGY_CONSUMPTION, {
|
|
156
168
|
id: FIELD_ENERGY_CONSUMPTION,
|
|
157
|
-
Component:
|
|
169
|
+
Component: data ? /*#__PURE__*/_react.default.createElement(_Magnitude.default, {
|
|
158
170
|
numberAlias: magnitudeAlias,
|
|
159
171
|
unitAlias: unitAlias,
|
|
160
|
-
value: (0, _consumptions.getTotalConsumption)(
|
|
161
|
-
unit: (0, _consumptions.getTotalConsumption)(
|
|
172
|
+
value: (0, _consumptions.getTotalConsumption)(data, _consumptions2.ENERGY_TYPES.ACTIVE).value,
|
|
173
|
+
unit: (0, _consumptions.getTotalConsumption)(data, _consumptions2.ENERGY_TYPES.ACTIVE).unit,
|
|
174
|
+
classes: {
|
|
175
|
+
numberAndUnit: _stylesModule.default.numberAndUnit
|
|
176
|
+
}
|
|
162
177
|
}) : textLabel
|
|
163
178
|
}), _defineProperty(_ref, FIELD_POWER_CONSUMPTION, {
|
|
164
179
|
id: FIELD_POWER_CONSUMPTION,
|
|
165
|
-
Component:
|
|
180
|
+
Component: data ? /*#__PURE__*/_react.default.createElement(_Magnitude.default, {
|
|
166
181
|
numberAlias: magnitudeAlias,
|
|
167
182
|
unitAlias: unitAlias,
|
|
168
|
-
value: (0, _consumptions.getTotalConsumption)(
|
|
169
|
-
unit: (0, _consumptions.getTotalConsumption)(
|
|
183
|
+
value: (0, _consumptions.getTotalConsumption)(data, _consumptions2.POWER_TYPES.REGISTERED).value,
|
|
184
|
+
unit: (0, _consumptions.getTotalConsumption)(data, _consumptions2.POWER_TYPES.REGISTERED).unit,
|
|
185
|
+
classes: {
|
|
186
|
+
numberAndUnit: _stylesModule.default.numberAndUnit
|
|
187
|
+
}
|
|
170
188
|
}) : textLabel
|
|
171
189
|
}), _defineProperty(_ref, FIELD_DAILY_CONSUMPTIONS, {
|
|
172
190
|
id: FIELD_DAILY_CONSUMPTIONS,
|
|
173
|
-
Component:
|
|
191
|
+
Component: data ? /*#__PURE__*/_react.default.createElement(_Magnitude.default, {
|
|
174
192
|
numberAlias: magnitudeAlias,
|
|
175
193
|
unitAlias: unitAlias,
|
|
176
|
-
value: (_getDailyConsumption$ = (0, _consumptions.getDailyConsumption)(
|
|
177
|
-
unit: (0, _consumptions.getDailyConsumption)(
|
|
194
|
+
value: (_getDailyConsumption$ = (0, _consumptions.getDailyConsumption)(data, _consumptions2.ENERGY_TYPES.ACTIVE).value) === null || _getDailyConsumption$ === void 0 ? void 0 : _getDailyConsumption$.toFixed(1).toString().replace(/\./, ','),
|
|
195
|
+
unit: (0, _consumptions.getDailyConsumption)(data, _consumptions2.ENERGY_TYPES.ACTIVE).unit,
|
|
196
|
+
classes: {
|
|
197
|
+
numberAndUnit: _stylesModule.default.numberAndUnit
|
|
198
|
+
}
|
|
178
199
|
}) : /*#__PURE__*/_react.default.createElement(Label, {
|
|
179
200
|
alias: _aliases.DETAIL
|
|
180
|
-
},
|
|
201
|
+
}, text)
|
|
181
202
|
}), _defineProperty(_ref, FIELD_AVERAGE_TEMPERATURE, {
|
|
182
203
|
id: FIELD_AVERAGE_TEMPERATURE,
|
|
183
|
-
Component:
|
|
204
|
+
Component: data ? /*#__PURE__*/_react.default.createElement(_Magnitude.default, {
|
|
184
205
|
numberAlias: magnitudeAlias,
|
|
185
206
|
unitAlias: unitAlias,
|
|
186
|
-
value: Math.round(
|
|
187
|
-
unit:
|
|
207
|
+
value: Math.round(data.periodAverageTemperature || data.period),
|
|
208
|
+
unit: data.temperatureUnit,
|
|
209
|
+
classes: {
|
|
210
|
+
numberAndUnit: _stylesModule.default.numberAndUnit
|
|
211
|
+
}
|
|
188
212
|
}) : textLabel
|
|
189
213
|
}), _defineProperty(_ref, NO_DATA_FIELD, {
|
|
190
214
|
id: NO_DATA_FIELD,
|
|
191
215
|
Component: /*#__PURE__*/_react.default.createElement(Label, {
|
|
192
|
-
|
|
193
|
-
},
|
|
216
|
+
alias: textAlias
|
|
217
|
+
}, data)
|
|
194
218
|
}), _ref;
|
|
195
219
|
};
|
|
196
220
|
|