@widergy/utilitygo-smart-bill-web 2.2.2 → 2.2.3
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/dist/components/Advice/index.js +2 -1
- package/dist/components/Amount/index.js +2 -1
- package/dist/components/Amount/utils.js +3 -2
- package/dist/components/Banner/index.js +2 -1
- package/dist/components/BarChart/constants.js +6 -3
- package/dist/components/BarChart/index.js +2 -1
- package/dist/components/BarChart/utils.js +3 -2
- package/dist/components/BillCalculation/components/ConceptCard/index.js +2 -1
- package/dist/components/BillCalculation/components/Glossary/index.js +2 -1
- package/dist/components/BillCalculation/constants.js +2 -1
- package/dist/components/BillCalculation/index.js +2 -1
- package/dist/components/BillCalculation/utils.js +7 -4
- package/dist/components/BillSummary/components/BilledConcepts/components/Concept/index.js +2 -1
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/constants.js +3 -2
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/index.js +2 -1
- package/dist/components/BillSummary/components/BilledConcepts/constants.js +8 -4
- package/dist/components/BillSummary/components/BilledConcepts/index.js +2 -1
- package/dist/components/BillSummary/components/BilledConcepts/utils.js +11 -6
- package/dist/components/BillSummary/index.js +2 -1
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/DataLine/index.js +2 -1
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/index.js +2 -1
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/utils.js +3 -2
- package/dist/components/ConsumptionComparison/components/ComparisonTable/constants.js +27 -14
- package/dist/components/ConsumptionComparison/components/ComparisonTable/index.js +2 -1
- package/dist/components/ConsumptionComparison/components/ComparisonTable/styles.module.scss +1 -0
- package/dist/components/ConsumptionComparison/components/ComparisonTable/utils.js +7 -4
- package/dist/components/ConsumptionComparison/components/ConsumptionAdvice/index.js +2 -1
- package/dist/components/ConsumptionComparison/components/ConsumptionAdvice/utils.js +3 -2
- package/dist/components/ConsumptionComparison/components/PercentageComparison/index.js +2 -1
- package/dist/components/ConsumptionComparison/components/PercentageComparison/styles.module.scss +1 -0
- package/dist/components/ConsumptionComparison/components/PercentageComparison/utils.js +3 -2
- package/dist/components/ConsumptionComparison/index.js +2 -1
- package/dist/components/ConsumptionEnergyDetails/components/ConsumptionEnergyComparison/index.js +2 -1
- package/dist/components/ConsumptionEnergyDetails/components/ConsumptionInDaysLabel/index.js +2 -1
- package/dist/components/ConsumptionEnergyDetails/components/EnergyTotalConsumption/index.js +2 -1
- package/dist/components/ConsumptionEnergyDetails/components/PercentageComparison/index.js +2 -1
- package/dist/components/ConsumptionEnergyDetails/components/PercentageComparison/utils.js +3 -2
- package/dist/components/ConsumptionEnergyDetails/index.js +2 -1
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/index.js +2 -1
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/utils.js +3 -2
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderConsumption/index.js +2 -1
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderSettlement/index.js +2 -1
- package/dist/components/ConsumptionIncluded/components/TimelineRow/index.js +2 -1
- package/dist/components/ConsumptionIncluded/index.js +2 -1
- package/dist/components/ConsumptionIncluded/utils.js +5 -3
- package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/components/ReadingRow/index.js +2 -1
- package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/components/ReadingRow/styles.module.scss +1 -0
- package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/index.js +2 -1
- package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/styles.module.scss +1 -0
- package/dist/components/ConsumptionPeriod/components/HistoryGraph/index.js +2 -1
- package/dist/components/ConsumptionPeriod/components/Reading/index.js +2 -1
- package/dist/components/ConsumptionPeriod/index.js +2 -1
- package/dist/components/ConsumptionPeriod/styles.module.scss +1 -0
- package/dist/components/ConsumptionPeriod/utils.js +3 -2
- package/dist/components/Date/index.js +2 -1
- package/dist/components/DebtState/index.js +2 -1
- package/dist/components/IconAndDetails/index.js +2 -1
- package/dist/components/Magnitude/index.js +2 -1
- package/dist/components/Magnitude/utils.js +3 -2
- package/dist/components/MainBillData/components/BillAlert/components/BillParticularConditions/index.js +2 -1
- package/dist/components/MainBillData/components/BillAlert/index.js +2 -1
- package/dist/components/MainBillData/components/BillBody/components/ClientData/index.js +2 -1
- package/dist/components/MainBillData/components/BillBody/components/Consumption/index.js +2 -1
- package/dist/components/MainBillData/components/BillBody/components/Consumption/utils.js +3 -2
- package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/index.js +2 -1
- package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/styles.module.scss +1 -0
- package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/utils.js +3 -2
- package/dist/components/MainBillData/components/BillBody/index.js +2 -1
- package/dist/components/MainBillData/components/BillHeader/components/TypeAndNumber/index.js +2 -1
- package/dist/components/MainBillData/components/BillHeader/index.js +2 -1
- package/dist/components/MainBillData/index.js +2 -1
- package/dist/components/MainBillData/theme.js +3 -2
- package/dist/components/MainBillData/utils.js +3 -2
- package/dist/components/Period/index.js +2 -1
- package/dist/components/Period/styles.module.scss +0 -6
- package/dist/components/PowerProgresBar/components/PowerConsumption/index.js +2 -1
- package/dist/components/PowerProgresBar/index.js +2 -1
- package/dist/components/RateAndCategory/index.js +2 -1
- package/dist/components/RatesDefinition/components/BillRate/components/RatePrices/index.js +2 -1
- package/dist/components/RatesDefinition/components/BillRate/index.js +2 -1
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/Category/index.js +2 -1
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/components/IndicatorLabel/index.js +2 -1
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/index.js +2 -1
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/utils.js +3 -2
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Legend/index.js +2 -1
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Stages/index.js +2 -1
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/constants.js +4 -2
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/index.js +2 -1
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/utils.js +3 -2
- package/dist/components/RatesDefinition/components/CategoryByConsumption/constants.js +36 -18
- package/dist/components/RatesDefinition/components/CategoryByConsumption/index.js +2 -1
- package/dist/components/RatesDefinition/components/CategoryByConsumption/utils.js +3 -2
- package/dist/components/RatesDefinition/components/PurchasedRate/index.js +2 -1
- package/dist/components/RatesDefinition/index.js +2 -1
- package/dist/components/SmartBillProvider/index.js +2 -1
- package/dist/components/StyledAmount/constants.js +3 -2
- package/dist/components/StyledAmount/index.js +2 -1
- package/dist/components/WithContextApi/index.js +2 -1
- package/dist/components/WithContextApi/layout.js +2 -1
- package/dist/components/WithSeason/index.js +2 -1
- package/dist/constants/deviceSizes.js +25 -13
- package/dist/constants/seasons.js +5 -3
- package/dist/index.js +4 -5
- package/dist/shared/Context/index.js +4 -2
- package/dist/shared/constants/aliases.js +277 -139
- package/dist/shared/constants/consumptions.js +9 -5
- package/dist/shared/constants/periodicities.js +3 -2
- package/dist/shared/constants/rates.js +3 -2
- package/dist/shared/constants/readings.js +5 -3
- package/dist/shared/constants/seasons.js +5 -3
- package/dist/shared/constants/stagesGraph.js +8 -4
- package/dist/shared/types/assetsTypes.js +2 -1
- package/dist/shared/types/billDataTypes.js +11 -6
- package/dist/shared/types/componentsTypes.js +7 -4
- package/dist/shared/types/formattersTypes.js +3 -2
- package/dist/shared/types/rateStagesTypes.js +6 -3
- package/dist/shared/types/smartBillTypes.js +3 -2
- package/dist/shared/types/textsTypes.js +3 -2
- package/dist/shared/utils/billCalculation.js +3 -2
- package/dist/shared/utils/consumptions.js +13 -7
- package/dist/shared/utils/context.js +3 -2
- package/dist/shared/utils/expirations.js +3 -2
- package/dist/shared/utils/periods.js +11 -6
- package/dist/shared/utils/rates.js +3 -2
- package/dist/shared/utils/readings.js +5 -3
- package/dist/shared/utils/season.js +3 -2
- package/dist/shared/utils/stagesGraph.js +9 -5
- package/dist/utils/hooks.js +3 -2
- package/dist/utils.js +7 -4
- package/package.json +1 -1
- package/CHANGELOG.md +0 -269
|
@@ -75,4 +75,5 @@ Amount.propTypes = {
|
|
|
75
75
|
containerClassName: _propTypes.string,
|
|
76
76
|
withBottomMargin: _propTypes.bool
|
|
77
77
|
};
|
|
78
|
-
var _default =
|
|
78
|
+
var _default = (0, _WithContextApi.default)()(Amount);
|
|
79
|
+
exports.default = _default;
|
|
@@ -5,8 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getFirstExpiration = void 0;
|
|
7
7
|
var _seamlessImmutable = require("seamless-immutable");
|
|
8
|
-
var getFirstExpiration =
|
|
8
|
+
var getFirstExpiration = function getFirstExpiration(billData) {
|
|
9
9
|
return (0, _seamlessImmutable.getIn)(billData, ['expirations'], []).find(function (expiration) {
|
|
10
10
|
return expiration.number === 1;
|
|
11
11
|
}) || {};
|
|
12
|
-
};
|
|
12
|
+
};
|
|
13
|
+
exports.getFirstExpiration = getFirstExpiration;
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.RESPONSIVE_BAR_WIDTH = exports.DESKTOP_BAR_WIDTH = exports.BAR_CHART_CONFIG = void 0;
|
|
7
|
-
var BAR_CHART_CONFIG =
|
|
7
|
+
var BAR_CHART_CONFIG = {
|
|
8
8
|
spacingOptions: {
|
|
9
9
|
axisPadding: 10,
|
|
10
10
|
scrollPadding: 0,
|
|
@@ -17,5 +17,8 @@ var BAR_CHART_CONFIG = exports.BAR_CHART_CONFIG = {
|
|
|
17
17
|
center: true,
|
|
18
18
|
hideYAxis: true
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
var
|
|
20
|
+
exports.BAR_CHART_CONFIG = BAR_CHART_CONFIG;
|
|
21
|
+
var DESKTOP_BAR_WIDTH = 40;
|
|
22
|
+
exports.DESKTOP_BAR_WIDTH = DESKTOP_BAR_WIDTH;
|
|
23
|
+
var RESPONSIVE_BAR_WIDTH = 90;
|
|
24
|
+
exports.RESPONSIVE_BAR_WIDTH = RESPONSIVE_BAR_WIDTH;
|
|
@@ -81,4 +81,5 @@ BarChartSection.propTypes = {
|
|
|
81
81
|
isDesktop: _propTypes.bool,
|
|
82
82
|
unit: _propTypes.string
|
|
83
83
|
};
|
|
84
|
-
var _default =
|
|
84
|
+
var _default = (0, _WithContextApi.default)()(BarChartSection);
|
|
85
|
+
exports.default = _default;
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getProcessedData = void 0;
|
|
7
|
-
var getProcessedData =
|
|
7
|
+
var getProcessedData = function getProcessedData(data) {
|
|
8
8
|
var colors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
9
9
|
var getBarColor = function getBarColor(index) {
|
|
10
10
|
return index === 0 ? colors.first : index === data.length - 1 ? colors.last : colors.main;
|
|
@@ -34,4 +34,5 @@ var getProcessedData = exports.getProcessedData = function getProcessedData(data
|
|
|
34
34
|
processedData: [processedData],
|
|
35
35
|
xAxisDefinition: xAxisDefinition
|
|
36
36
|
};
|
|
37
|
-
};
|
|
37
|
+
};
|
|
38
|
+
exports.getProcessedData = getProcessedData;
|
|
@@ -106,4 +106,5 @@ Glossary.propTypes = {
|
|
|
106
106
|
glossaryConcepts: (0, _propTypes.arrayOf)(_propTypes.any),
|
|
107
107
|
contextApiInfo: _smartBillTypes.contextApiInfoTypes
|
|
108
108
|
};
|
|
109
|
-
var _default =
|
|
109
|
+
var _default = (0, _WithContextApi.default)()(Glossary);
|
|
110
|
+
exports.default = _default;
|
|
@@ -91,4 +91,5 @@ BillCalculation.propTypes = {
|
|
|
91
91
|
billData: _billDataTypes.billDataTypes,
|
|
92
92
|
contextApiInfo: _smartBillTypes.contextApiInfoTypes
|
|
93
93
|
};
|
|
94
|
-
var _default =
|
|
94
|
+
var _default = (0, _WithContextApi.default)()(BillCalculation);
|
|
95
|
+
exports.default = _default;
|
|
@@ -9,7 +9,7 @@ var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
|
9
9
|
var _periodicities = require("../../shared/constants/periodicities");
|
|
10
10
|
var _periods = require("../../shared/utils/periods");
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
var periodToTitleMapper =
|
|
12
|
+
var periodToTitleMapper = function periodToTitleMapper(billData, texts, periodFormatter, withBillCalcTitleDate) {
|
|
13
13
|
var _settlements$current, _settlements$current2;
|
|
14
14
|
var currentPeriod = (0, _periods.getCurrentPeriod)(billData) || {};
|
|
15
15
|
var settlements = currentPeriod.settlements;
|
|
@@ -32,11 +32,14 @@ var periodToTitleMapper = exports.periodToTitleMapper = function periodToTitleMa
|
|
|
32
32
|
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);
|
|
33
33
|
return '-';
|
|
34
34
|
};
|
|
35
|
-
|
|
35
|
+
exports.periodToTitleMapper = periodToTitleMapper;
|
|
36
|
+
var shouldShowConcept = function shouldShowConcept(concept, showZeroConcepts) {
|
|
36
37
|
return concept.total !== 0 || showZeroConcepts;
|
|
37
38
|
};
|
|
38
|
-
|
|
39
|
+
exports.shouldShowConcept = shouldShowConcept;
|
|
40
|
+
var filterGlossaryConcepts = function filterGlossaryConcepts(concepts, showZeroConcepts) {
|
|
39
41
|
return concepts.filter(function (concept) {
|
|
40
42
|
return concept.description && shouldShowConcept(concept, showZeroConcepts);
|
|
41
43
|
});
|
|
42
|
-
};
|
|
44
|
+
};
|
|
45
|
+
exports.filterGlossaryConcepts = filterGlossaryConcepts;
|
|
@@ -4,10 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.PIE_CHART_CUSTOMIZATION = void 0;
|
|
7
|
-
var PIE_CHART_CUSTOMIZATION =
|
|
7
|
+
var PIE_CHART_CUSTOMIZATION = {
|
|
8
8
|
animationLength: 800,
|
|
9
9
|
height: 200,
|
|
10
10
|
minAngle: 0.1,
|
|
11
11
|
outerRadius: 100,
|
|
12
12
|
width: 200
|
|
13
|
-
};
|
|
13
|
+
};
|
|
14
|
+
exports.PIE_CHART_CUSTOMIZATION = PIE_CHART_CUSTOMIZATION;
|
package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/index.js
CHANGED
|
@@ -41,4 +41,5 @@ PieChartContainer.propTypes = {
|
|
|
41
41
|
concepts: (0, _propTypes.shape)((0, _propTypes.objectOf)(_propTypes.any)),
|
|
42
42
|
contextApiInfo: _smartBillTypes.contextApiInfoTypes
|
|
43
43
|
};
|
|
44
|
-
var _default =
|
|
44
|
+
var _default = (0, _WithContextApi.default)()(PieChartContainer);
|
|
45
|
+
exports.default = _default;
|
|
@@ -5,9 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.toggleOptions = exports.progressBar = exports.pieChart = exports.COLORS = void 0;
|
|
7
7
|
var _colorsExportModule = require("../../../../scss/variables/colorsExport.module.scss");
|
|
8
|
-
var pieChart =
|
|
9
|
-
|
|
10
|
-
var
|
|
8
|
+
var pieChart = 'pieChart';
|
|
9
|
+
exports.pieChart = pieChart;
|
|
10
|
+
var progressBar = 'progressBar';
|
|
11
|
+
exports.progressBar = progressBar;
|
|
12
|
+
var toggleOptions = function toggleOptions(assets) {
|
|
11
13
|
return [{
|
|
12
14
|
value: progressBar,
|
|
13
15
|
Icon: assets.ListGrayIcon,
|
|
@@ -18,4 +20,6 @@ var toggleOptions = exports.toggleOptions = function toggleOptions(assets) {
|
|
|
18
20
|
SelectedIcon: assets.PieWhiteIcon
|
|
19
21
|
}];
|
|
20
22
|
};
|
|
21
|
-
|
|
23
|
+
exports.toggleOptions = toggleOptions;
|
|
24
|
+
var COLORS = [_colorsExportModule.primary, _colorsExportModule.darkGray, _colorsExportModule.pieChartGray, _colorsExportModule.pieChartLightGray];
|
|
25
|
+
exports.COLORS = COLORS;
|
|
@@ -80,4 +80,5 @@ BilledConcepts.propTypes = {
|
|
|
80
80
|
contextApiInfo: _smartBillTypes.contextApiInfoTypes,
|
|
81
81
|
billData: _billDataTypes.billDataTypes
|
|
82
82
|
};
|
|
83
|
-
var _default =
|
|
83
|
+
var _default = (0, _WithContextApi.default)()(BilledConcepts);
|
|
84
|
+
exports.default = _default;
|
|
@@ -23,7 +23,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
23
23
|
var roundPercentage = function roundPercentage(value) {
|
|
24
24
|
return Math.round(value * 10) / 10;
|
|
25
25
|
};
|
|
26
|
-
var calculatePercentages =
|
|
26
|
+
var calculatePercentages = function calculatePercentages(billConcepts, totalAmount) {
|
|
27
27
|
var indexToAdjust = billConcepts.findIndex(function (concept) {
|
|
28
28
|
return concept.total !== 0;
|
|
29
29
|
});
|
|
@@ -34,10 +34,11 @@ var calculatePercentages = exports.calculatePercentages = function calculatePerc
|
|
|
34
34
|
return roundPercentage(concept.total / totalAmount * 100 + (index === indexToAdjust ? adjustValue : 0));
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
|
+
exports.calculatePercentages = calculatePercentages;
|
|
37
38
|
var getProgressBarPercentage = function getProgressBarPercentage(maxPercentage, percentage) {
|
|
38
39
|
return percentage / maxPercentage * 100;
|
|
39
40
|
};
|
|
40
|
-
var renderConcept =
|
|
41
|
+
var renderConcept = function renderConcept(conceptData, additionalInfo, isFirst) {
|
|
41
42
|
var title = conceptData.title,
|
|
42
43
|
total = conceptData.total,
|
|
43
44
|
color = conceptData.color,
|
|
@@ -61,6 +62,7 @@ var renderConcept = exports.renderConcept = function renderConcept(conceptData,
|
|
|
61
62
|
color: !showProgressBar && color
|
|
62
63
|
});
|
|
63
64
|
};
|
|
65
|
+
exports.renderConcept = renderConcept;
|
|
64
66
|
var isZeroConcept = function isZeroConcept(concept) {
|
|
65
67
|
return concept.total === 0;
|
|
66
68
|
};
|
|
@@ -74,17 +76,19 @@ var getSortedData = function getSortedData(concepts, showZeroConcepts) {
|
|
|
74
76
|
nonZeroLength: nonZeroConcepts.length
|
|
75
77
|
};
|
|
76
78
|
};
|
|
77
|
-
var getColorsDefinition =
|
|
79
|
+
var getColorsDefinition = function getColorsDefinition(externalColors) {
|
|
78
80
|
return [externalColors.primary || _constants.COLORS.primary].concat(_toConsumableArray(_constants.COLORS.slice(1)));
|
|
79
81
|
};
|
|
80
|
-
|
|
82
|
+
exports.getColorsDefinition = getColorsDefinition;
|
|
83
|
+
var getItemColor = function getItemColor(index, nonZeroLength, colorsDefinition) {
|
|
81
84
|
var colorsLen = _constants.COLORS.length;
|
|
82
85
|
var colorIndex = index % colorsLen;
|
|
83
86
|
var isLastNonZero = index === nonZeroLength - 1;
|
|
84
87
|
var nextColorIndex = (index + 1) % colorsLen;
|
|
85
88
|
return colorsDefinition[isLastNonZero && colorsDefinition[colorIndex] === colorsDefinition[0] ? nextColorIndex : colorIndex];
|
|
86
89
|
};
|
|
87
|
-
|
|
90
|
+
exports.getItemColor = getItemColor;
|
|
91
|
+
var getOrderedAndColoredConcepts = function getOrderedAndColoredConcepts(concepts, totalAmount, showZeroConcepts, colorsDefinition) {
|
|
88
92
|
var _getSortedData = getSortedData(concepts, showZeroConcepts),
|
|
89
93
|
sortedConcepts = _getSortedData.sortedConcepts,
|
|
90
94
|
nonZeroLength = _getSortedData.nonZeroLength;
|
|
@@ -97,4 +101,5 @@ var getOrderedAndColoredConcepts = exports.getOrderedAndColoredConcepts = functi
|
|
|
97
101
|
color: !isZeroConcept(concept) && getItemColor(index, nonZeroLength, colorsDefinition)
|
|
98
102
|
});
|
|
99
103
|
});
|
|
100
|
-
};
|
|
104
|
+
};
|
|
105
|
+
exports.getOrderedAndColoredConcepts = getOrderedAndColoredConcepts;
|
|
@@ -118,4 +118,5 @@ BillSummary.propTypes = {
|
|
|
118
118
|
contextApiInfo: _smartBillTypes.contextApiInfoTypes,
|
|
119
119
|
billData: _billDataTypes.billDataTypes
|
|
120
120
|
};
|
|
121
|
-
var _default =
|
|
121
|
+
var _default = (0, _WithContextApi.default)()(BillSummary);
|
|
122
|
+
exports.default = _default;
|
package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/index.js
CHANGED
|
@@ -35,4 +35,5 @@ Season.propTypes = {
|
|
|
35
35
|
contextApiInfo: _smartBillTypes.contextApiInfoTypes,
|
|
36
36
|
season: _propTypes.string
|
|
37
37
|
};
|
|
38
|
-
var _default =
|
|
38
|
+
var _default = (0, _WithContextApi.default)()((0, _WithSeason.default)()(Season));
|
|
39
|
+
exports.default = _default;
|
package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/utils.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getSeasonProps = void 0;
|
|
7
7
|
var _seasons = require("../../../../../../shared/constants/seasons");
|
|
8
|
-
var getSeasonProps =
|
|
8
|
+
var getSeasonProps = function getSeasonProps(season, texts, assets) {
|
|
9
9
|
switch (season) {
|
|
10
10
|
case _seasons.SEASONS.AUTUMN:
|
|
11
11
|
return {
|
|
@@ -30,4 +30,5 @@ var getSeasonProps = exports.getSeasonProps = function getSeasonProps(season, te
|
|
|
30
30
|
default:
|
|
31
31
|
return {};
|
|
32
32
|
}
|
|
33
|
-
};
|
|
33
|
+
};
|
|
34
|
+
exports.getSeasonProps = getSeasonProps;
|
|
@@ -17,17 +17,27 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
17
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
18
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
19
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); }
|
|
20
|
-
var FIELD_PERIOD_COMPARISION =
|
|
21
|
-
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
var
|
|
20
|
+
var FIELD_PERIOD_COMPARISION = 'period_comparison';
|
|
21
|
+
exports.FIELD_PERIOD_COMPARISION = FIELD_PERIOD_COMPARISION;
|
|
22
|
+
var FIELD_PERIOD_DATES = 'period_dates';
|
|
23
|
+
exports.FIELD_PERIOD_DATES = FIELD_PERIOD_DATES;
|
|
24
|
+
var FIELD_SETTLEMENTS_DAYS = 'settlements_days';
|
|
25
|
+
exports.FIELD_SETTLEMENTS_DAYS = FIELD_SETTLEMENTS_DAYS;
|
|
26
|
+
var FIELD_ENERGY_CONSUMPTION = 'energy_consumption';
|
|
27
|
+
exports.FIELD_ENERGY_CONSUMPTION = FIELD_ENERGY_CONSUMPTION;
|
|
28
|
+
var FIELD_POWER_CONSUMPTION = 'power_consumption';
|
|
29
|
+
exports.FIELD_POWER_CONSUMPTION = FIELD_POWER_CONSUMPTION;
|
|
30
|
+
var FIELD_TOTAL_CONSUMPTIONS = 'total_consumptions';
|
|
31
|
+
exports.FIELD_TOTAL_CONSUMPTIONS = FIELD_TOTAL_CONSUMPTIONS;
|
|
32
|
+
var FIELD_DAILY_CONSUMPTIONS = 'daily_consumptions';
|
|
33
|
+
exports.FIELD_DAILY_CONSUMPTIONS = FIELD_DAILY_CONSUMPTIONS;
|
|
34
|
+
var FIELD_AVERAGE_TEMPERATURE = 'average_temperature';
|
|
35
|
+
exports.FIELD_AVERAGE_TEMPERATURE = FIELD_AVERAGE_TEMPERATURE;
|
|
36
|
+
var NO_DATA_FIELD = 'no_data_cell';
|
|
37
|
+
exports.NO_DATA_FIELD = NO_DATA_FIELD;
|
|
38
|
+
var dataFieldDictonary = ['period_comparison', 'period_dates', 'settlements_days', 'total_consumptions', 'energy_consumption', 'power_consumption', 'daily_consumptions', 'average_temperature'];
|
|
39
|
+
exports.dataFieldDictonary = dataFieldDictonary;
|
|
40
|
+
var desktopGetHeaderFields = function desktopGetHeaderFields(contextApiInfo, withPowerComparison, showTemp) {
|
|
31
41
|
var config = contextApiInfo.config,
|
|
32
42
|
Label = contextApiInfo.Label;
|
|
33
43
|
var _config$texts$consump = config.texts.consumptionComparison,
|
|
@@ -82,13 +92,14 @@ var desktopGetHeaderFields = exports.desktopGetHeaderFields = function desktopGe
|
|
|
82
92
|
}, averageTemperature)
|
|
83
93
|
}];
|
|
84
94
|
};
|
|
95
|
+
exports.desktopGetHeaderFields = desktopGetHeaderFields;
|
|
85
96
|
var formatInterval = function formatInterval(period) {
|
|
86
97
|
var _period$settlements, _period$settlements2;
|
|
87
98
|
var startDate = period === null || period === void 0 || (_period$settlements = period.settlements) === null || _period$settlements === void 0 ? void 0 : _period$settlements.start_date;
|
|
88
99
|
var endDate = period === null || period === void 0 || (_period$settlements2 = period.settlements) === null || _period$settlements2 === void 0 ? void 0 : _period$settlements2.end_date;
|
|
89
100
|
return startDate && endDate && "".concat((0, _dayjs.default)(startDate).format('DD/MM'), " - ").concat((0, _dayjs.default)(endDate).format('DD/MM'));
|
|
90
101
|
};
|
|
91
|
-
var getField =
|
|
102
|
+
var getField = function getField() {
|
|
92
103
|
var _data$period, _getDailyConsumption$, _ref;
|
|
93
104
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
94
105
|
var contextApiInfo = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -188,9 +199,11 @@ var getField = exports.getField = function getField() {
|
|
|
188
199
|
}, data)
|
|
189
200
|
}), _ref;
|
|
190
201
|
};
|
|
191
|
-
|
|
202
|
+
exports.getField = getField;
|
|
203
|
+
var noPeriodData = function noPeriodData(primary, noData, contextApiInfo) {
|
|
192
204
|
return getField({
|
|
193
205
|
primary: primary,
|
|
194
206
|
data: noData
|
|
195
207
|
}, contextApiInfo)[NO_DATA_FIELD];
|
|
196
|
-
};
|
|
208
|
+
};
|
|
209
|
+
exports.noPeriodData = noPeriodData;
|
|
@@ -36,4 +36,5 @@ ComparisonTable.propTypes = {
|
|
|
36
36
|
billData: _billDataTypes.billDataTypes,
|
|
37
37
|
isDesktopSize: _propTypes.bool
|
|
38
38
|
};
|
|
39
|
-
var _default =
|
|
39
|
+
var _default = (0, _WithContextApi.default)()(ComparisonTable);
|
|
40
|
+
exports.default = _default;
|
|
@@ -9,7 +9,7 @@ var _aliases = require("../../../../shared/constants/aliases");
|
|
|
9
9
|
var _DataLine = _interopRequireDefault(require("./components/DataLine"));
|
|
10
10
|
var _constants = require("./constants");
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
var getPeriodFields =
|
|
12
|
+
var getPeriodFields = function getPeriodFields(contextApiInfo, period, periodAverageTemperature, withPowerComparison, isDesktop) {
|
|
13
13
|
var _period$lastYearPerio, _period$lastYearPerio2, _period$lastYearPerio3, _period$lastYearPerio4, _period$currentPeriod, _period$currentPeriod2, _period$currentPeriod3, _period$currentPeriod4;
|
|
14
14
|
var stylingOptions = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
|
|
15
15
|
var options = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : {};
|
|
@@ -99,6 +99,7 @@ var getPeriodFields = exports.getPeriodFields = function getPeriodFields(context
|
|
|
99
99
|
temperatureUnit: temperatureUnit
|
|
100
100
|
}, _constants.FIELD_AVERAGE_TEMPERATURE)] : {};
|
|
101
101
|
};
|
|
102
|
+
exports.getPeriodFields = getPeriodFields;
|
|
102
103
|
var renderDataLine = function renderDataLine(contextApiInfo, mobilePeriod, mobilePeriodAverageTemperature, withPowerComparison, isDesktop, data) {
|
|
103
104
|
return /*#__PURE__*/_react.default.createElement(_DataLine.default, {
|
|
104
105
|
key: "",
|
|
@@ -110,7 +111,7 @@ var renderDataLine = function renderDataLine(contextApiInfo, mobilePeriod, mobil
|
|
|
110
111
|
isDesktop: isDesktop
|
|
111
112
|
});
|
|
112
113
|
};
|
|
113
|
-
var desktopGetTableLines =
|
|
114
|
+
var desktopGetTableLines = function desktopGetTableLines(contextApiInfo, currentPeriod, currentPeriodAverageTemperature, lastYearPeriod, lastYearPeriodAverageTemperature, isDesktop, withPowerComparison) {
|
|
114
115
|
var showTemp = currentPeriodAverageTemperature && lastYearPeriodAverageTemperature;
|
|
115
116
|
return [{
|
|
116
117
|
Component: /*#__PURE__*/_react.default.createElement(_DataLine.default, {
|
|
@@ -139,7 +140,8 @@ var desktopGetTableLines = exports.desktopGetTableLines = function desktopGetTab
|
|
|
139
140
|
})
|
|
140
141
|
}];
|
|
141
142
|
};
|
|
142
|
-
|
|
143
|
+
exports.desktopGetTableLines = desktopGetTableLines;
|
|
144
|
+
var mobileGetTableLines = function mobileGetTableLines(contextApiInfo, currentPeriod, currentPeriodAverageTemperature, lastYearPeriod, lastYearPeriodAverageTemperature, isDesktop, withPowerComparison) {
|
|
143
145
|
var mobilePeriod = {
|
|
144
146
|
currentPeriod: currentPeriod,
|
|
145
147
|
lastYearPeriod: lastYearPeriod
|
|
@@ -153,4 +155,5 @@ var mobileGetTableLines = exports.mobileGetTableLines = function mobileGetTableL
|
|
|
153
155
|
return renderDataLine(contextApiInfo, mobilePeriod, mobilePeriodAverageTemperature, withPowerComparison, isDesktop, data);
|
|
154
156
|
}))
|
|
155
157
|
}];
|
|
156
|
-
};
|
|
158
|
+
};
|
|
159
|
+
exports.mobileGetTableLines = mobileGetTableLines;
|
|
@@ -44,4 +44,5 @@ var ConsumptionAdvice = function ConsumptionAdvice(_ref) {
|
|
|
44
44
|
ConsumptionAdvice.propTypes = {
|
|
45
45
|
contextApiInfo: _smartBillTypes.contextApiInfoTypes
|
|
46
46
|
};
|
|
47
|
-
var _default =
|
|
47
|
+
var _default = (0, _WithContextApi.default)()(ConsumptionAdvice);
|
|
48
|
+
exports.default = _default;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getSeasonProps = void 0;
|
|
7
7
|
var _seasons = require("../../../../shared/constants/seasons");
|
|
8
|
-
var getSeasonProps =
|
|
8
|
+
var getSeasonProps = function getSeasonProps(season, texts) {
|
|
9
9
|
switch (season) {
|
|
10
10
|
case _seasons.SEASONS.AUTUMN:
|
|
11
11
|
return {
|
|
@@ -30,4 +30,5 @@ var getSeasonProps = exports.getSeasonProps = function getSeasonProps(season, te
|
|
|
30
30
|
default:
|
|
31
31
|
return {};
|
|
32
32
|
}
|
|
33
|
-
};
|
|
33
|
+
};
|
|
34
|
+
exports.getSeasonProps = getSeasonProps;
|
|
@@ -46,4 +46,5 @@ PercentageComparison.propTypes = {
|
|
|
46
46
|
savingsPercentage: _propTypes.number,
|
|
47
47
|
multipleSettlements: _propTypes.bool
|
|
48
48
|
};
|
|
49
|
-
var _default =
|
|
49
|
+
var _default = (0, _WithContextApi.default)()(PercentageComparison);
|
|
50
|
+
exports.default = _default;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getProps = void 0;
|
|
7
7
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
8
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
var getProps =
|
|
9
|
+
var getProps = function getProps(savingsPercentage, assets, texts, multipleSettlements) {
|
|
10
10
|
var consumptionComparison = texts.consumptionComparison;
|
|
11
11
|
var lastYearBimesterPercentageComparisonDescended = consumptionComparison.lastYearBimesterPercentageComparisonDescended,
|
|
12
12
|
lastYearPercentageComparisonDescended = consumptionComparison.lastYearPercentageComparisonDescended,
|
|
@@ -40,4 +40,5 @@ var getProps = exports.getProps = function getProps(savingsPercentage, assets, t
|
|
|
40
40
|
background: _stylesModule.default.consumptionInvariantBackground,
|
|
41
41
|
text: lastYearPercentageStatic
|
|
42
42
|
};
|
|
43
|
-
};
|
|
43
|
+
};
|
|
44
|
+
exports.getProps = getProps;
|
|
@@ -96,4 +96,5 @@ ConsumptionComparison.propTypes = {
|
|
|
96
96
|
billData: _billDataTypes.billDataTypes,
|
|
97
97
|
contextApiInfo: _smartBillTypes.contextApiInfoTypes
|
|
98
98
|
};
|
|
99
|
-
var _default =
|
|
99
|
+
var _default = (0, _WithContextApi.default)()(ConsumptionComparison);
|
|
100
|
+
exports.default = _default;
|
package/dist/components/ConsumptionEnergyDetails/components/ConsumptionEnergyComparison/index.js
CHANGED
|
@@ -113,4 +113,5 @@ ConsumptionEnergyComparison.propTypes = {
|
|
|
113
113
|
savingsPercentage: _propTypes.number,
|
|
114
114
|
currentIsFirstSettlement: _propTypes.bool
|
|
115
115
|
};
|
|
116
|
-
var _default =
|
|
116
|
+
var _default = (0, _WithContextApi.default)()(ConsumptionEnergyComparison);
|
|
117
|
+
exports.default = _default;
|
|
@@ -48,4 +48,5 @@ ConsumptionInDaysLabel.propTypes = {
|
|
|
48
48
|
unitAlias: _propTypes.string,
|
|
49
49
|
daysAlias: _propTypes.string
|
|
50
50
|
};
|
|
51
|
-
var _default =
|
|
51
|
+
var _default = (0, _WithContextApi.default)()(ConsumptionInDaysLabel);
|
|
52
|
+
exports.default = _default;
|
|
@@ -46,4 +46,5 @@ EnergyTotalConsumption.propTypes = {
|
|
|
46
46
|
text: _propTypes.string,
|
|
47
47
|
exceededReactiveEnergy: _propTypes.bool
|
|
48
48
|
};
|
|
49
|
-
var _default =
|
|
49
|
+
var _default = (0, _WithContextApi.default)()(EnergyTotalConsumption);
|
|
50
|
+
exports.default = _default;
|
|
@@ -44,4 +44,5 @@ PercentageComparison.propTypes = {
|
|
|
44
44
|
savingsPercentage: _propTypes.number,
|
|
45
45
|
multipleSettlements: _propTypes.bool
|
|
46
46
|
};
|
|
47
|
-
var _default =
|
|
47
|
+
var _default = (0, _WithContextApi.default)()(PercentageComparison);
|
|
48
|
+
exports.default = _default;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getProps = void 0;
|
|
7
7
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
8
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
var getProps =
|
|
9
|
+
var getProps = function getProps(savingsPercentage, assets) {
|
|
10
10
|
if (savingsPercentage > 0) {
|
|
11
11
|
return {
|
|
12
12
|
Icon: assets.ConsumptionReductionIcon,
|
|
@@ -29,4 +29,5 @@ var getProps = exports.getProps = function getProps(savingsPercentage, assets) {
|
|
|
29
29
|
value: 0,
|
|
30
30
|
background: _stylesModule.default.consumptionInvariantBackground
|
|
31
31
|
};
|
|
32
|
-
};
|
|
32
|
+
};
|
|
33
|
+
exports.getProps = getProps;
|
|
@@ -137,4 +137,5 @@ ConsumptionEnergyDetails.propTypes = {
|
|
|
137
137
|
consumptionComparison: _propTypes.bool,
|
|
138
138
|
withPercentage: _propTypes.bool
|
|
139
139
|
};
|
|
140
|
-
var _default =
|
|
140
|
+
var _default = (0, _WithContextApi.default)()(ConsumptionEnergyDetails);
|
|
141
|
+
exports.default = _default;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getAliases = void 0;
|
|
7
7
|
var _aliases = require("../../../../../../shared/constants/aliases");
|
|
8
|
-
var getAliases =
|
|
8
|
+
var getAliases = function getAliases(consumption, current, remaining) {
|
|
9
9
|
return {
|
|
10
10
|
magnitudeAlias: consumption ? _aliases.CARD_PRIMARY_MAGNITUDE : current ? _aliases.CARD_WHITE_MAGNITUDE : _aliases.CARD_GRAY_MAGNITUDE,
|
|
11
11
|
unitAlias: consumption ? _aliases.CARD_PRIMARY_UNIT : current ? _aliases.CARD_WHITE_UNIT : _aliases.CARD_GRAY_UNIT,
|
|
@@ -17,4 +17,5 @@ var getAliases = exports.getAliases = function getAliases(consumption, current,
|
|
|
17
17
|
cardConsumptionDescriptionAlias: current ? _aliases.CARD_CONSUMPTION_DESCRIPTION_WHITE : _aliases.CARD_CONSUMPTION_DESCRIPTION_GRAY,
|
|
18
18
|
cardConsumptionTextAlias: current ? _aliases.CARD_CONSUMPTION_TEXT_CURRENT : _aliases.CARD_CONSUMPTION_TEXT_REMAINING
|
|
19
19
|
};
|
|
20
|
-
};
|
|
20
|
+
};
|
|
21
|
+
exports.getAliases = getAliases;
|
|
@@ -44,4 +44,5 @@ HeaderConsumption.propTypes = {
|
|
|
44
44
|
startDate: _propTypes.string,
|
|
45
45
|
endDate: _propTypes.string
|
|
46
46
|
};
|
|
47
|
-
var _default =
|
|
47
|
+
var _default = (0, _WithContextApi.default)()(HeaderConsumption);
|
|
48
|
+
exports.default = _default;
|
|
@@ -37,4 +37,5 @@ HeaderSettlement.propTypes = {
|
|
|
37
37
|
settlementNumber: _propTypes.number,
|
|
38
38
|
isRemaining: _propTypes.bool
|
|
39
39
|
};
|
|
40
|
-
var _default =
|
|
40
|
+
var _default = (0, _WithContextApi.default)()(HeaderSettlement);
|
|
41
|
+
exports.default = _default;
|
|
@@ -104,4 +104,5 @@ TimelineRow.propTypes = {
|
|
|
104
104
|
isCurrent: _propTypes.bool,
|
|
105
105
|
isRemaining: _propTypes.bool
|
|
106
106
|
};
|
|
107
|
-
var _default =
|
|
107
|
+
var _default = (0, _WithContextApi.default)()(TimelineRow);
|
|
108
|
+
exports.default = _default;
|
|
@@ -55,4 +55,5 @@ ConsumptionIncluded.propTypes = {
|
|
|
55
55
|
contextApiInfo: _smartBillTypes.contextApiInfoTypes,
|
|
56
56
|
billData: _billDataTypes.billDataTypes
|
|
57
57
|
};
|
|
58
|
-
var _default =
|
|
58
|
+
var _default = (0, _WithContextApi.default)()(ConsumptionIncluded);
|
|
59
|
+
exports.default = _default;
|