@widergy/utilitygo-smart-bill-web 1.13.4 → 2.0.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 +21 -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,54 +1,41 @@
|
|
|
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 _propTypes = require("prop-types");
|
|
13
|
-
|
|
14
10
|
var _smartBillTypes = require("../../../../shared/types/smartBillTypes");
|
|
15
|
-
|
|
16
11
|
var _WithContextApi = _interopRequireDefault(require("../../../WithContextApi"));
|
|
17
|
-
|
|
18
12
|
var _Card = _interopRequireDefault(require("./components/Card"));
|
|
19
|
-
|
|
20
13
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
21
|
-
|
|
22
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
-
|
|
24
15
|
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); }
|
|
25
|
-
|
|
26
16
|
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; }
|
|
27
|
-
|
|
28
17
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
29
|
-
|
|
30
18
|
var TimelineRow = function TimelineRow(_ref) {
|
|
31
19
|
var contextApiInfo = _ref.contextApiInfo,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
20
|
+
cardTitle = _ref.cardTitle,
|
|
21
|
+
cardSubtitle = _ref.cardSubtitle,
|
|
22
|
+
cardDescription1 = _ref.cardDescription1,
|
|
23
|
+
cardDescription2 = _ref.cardDescription2,
|
|
24
|
+
startDate = _ref.startDate,
|
|
25
|
+
endDate = _ref.endDate,
|
|
26
|
+
unit = _ref.unit,
|
|
27
|
+
value = _ref.value,
|
|
28
|
+
settlementNumber = _ref.settlementNumber,
|
|
29
|
+
isConsumption = _ref.isConsumption,
|
|
30
|
+
isCurrent = _ref.isCurrent,
|
|
31
|
+
isRemaining = _ref.isRemaining,
|
|
32
|
+
currentIsFirstSettlement = _ref.currentIsFirstSettlement;
|
|
45
33
|
var assets = contextApiInfo.assets,
|
|
46
|
-
|
|
34
|
+
config = contextApiInfo.config;
|
|
47
35
|
var colors = config.colors;
|
|
48
36
|
var Minicheck = assets.Minicheck,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
37
|
+
MinicheckRemaining = assets.MinicheckRemaining,
|
|
38
|
+
ClockIcon = assets.ClockIcon;
|
|
52
39
|
var CardRender = function CardRender(consumption, current, remaining, initialDate, finalDate) {
|
|
53
40
|
return /*#__PURE__*/_react.default.createElement(_Card.default, _extends({
|
|
54
41
|
contextApiInfo: contextApiInfo,
|
|
@@ -62,7 +49,6 @@ var TimelineRow = function TimelineRow(_ref) {
|
|
|
62
49
|
currentIsFirstSettlement: currentIsFirstSettlement
|
|
63
50
|
}, consumption, current, remaining, initialDate, finalDate));
|
|
64
51
|
};
|
|
65
|
-
|
|
66
52
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
67
53
|
className: "".concat(isConsumption ? _stylesModule.default.consumptionContainerRow : _stylesModule.default.settlementContainerRow && settlementNumber === 1 ? _stylesModule.default.settlementOne : _stylesModule.default.settlementTwo)
|
|
68
54
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -102,7 +88,6 @@ var TimelineRow = function TimelineRow(_ref) {
|
|
|
102
88
|
remaining: isRemaining
|
|
103
89
|
})))));
|
|
104
90
|
};
|
|
105
|
-
|
|
106
91
|
TimelineRow.propTypes = {
|
|
107
92
|
contextApiInfo: _smartBillTypes.contextApiInfoTypes,
|
|
108
93
|
cardTitle: _propTypes.string,
|
|
@@ -119,7 +104,5 @@ TimelineRow.propTypes = {
|
|
|
119
104
|
isCurrent: _propTypes.bool,
|
|
120
105
|
isRemaining: _propTypes.bool
|
|
121
106
|
};
|
|
122
|
-
|
|
123
107
|
var _default = (0, _WithContextApi.default)()(TimelineRow);
|
|
124
|
-
|
|
125
108
|
exports.default = _default;
|
|
@@ -1,35 +1,23 @@
|
|
|
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 _smartBillTypes = require("../../shared/types/smartBillTypes");
|
|
13
|
-
|
|
14
10
|
var _billDataTypes = require("../../shared/types/billDataTypes");
|
|
15
|
-
|
|
16
11
|
var _WithContextApi = _interopRequireDefault(require("../WithContextApi"));
|
|
17
|
-
|
|
18
12
|
var _utils = require("./utils");
|
|
19
|
-
|
|
20
13
|
var _TimelineRow = _interopRequireDefault(require("./components/TimelineRow"));
|
|
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
|
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); }
|
|
27
|
-
|
|
28
17
|
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; }
|
|
29
|
-
|
|
30
18
|
var ConsumptionIncluded = function ConsumptionIncluded(_ref) {
|
|
31
19
|
var contextApiInfo = _ref.contextApiInfo,
|
|
32
|
-
|
|
20
|
+
billData = _ref.billData;
|
|
33
21
|
var config = contextApiInfo.config;
|
|
34
22
|
var consumptionIncluded = config.texts.consumptionIncluded;
|
|
35
23
|
var data = (0, _react.useMemo)(function () {
|
|
@@ -38,7 +26,6 @@ var ConsumptionIncluded = function ConsumptionIncluded(_ref) {
|
|
|
38
26
|
var currentIsFirstSettlement = data.some(function (item) {
|
|
39
27
|
return item.isCurrent && item.settlementNumber === 1;
|
|
40
28
|
});
|
|
41
|
-
|
|
42
29
|
var handleRenderTimelineRow = function handleRenderTimelineRow(item) {
|
|
43
30
|
return /*#__PURE__*/_react.default.createElement(_TimelineRow.default, {
|
|
44
31
|
cardTitle: item.cardTitle,
|
|
@@ -58,19 +45,15 @@ var ConsumptionIncluded = function ConsumptionIncluded(_ref) {
|
|
|
58
45
|
currentIsFirstSettlement: currentIsFirstSettlement
|
|
59
46
|
});
|
|
60
47
|
};
|
|
61
|
-
|
|
62
48
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
63
49
|
className: _stylesModule.default.titleContainer
|
|
64
50
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
65
51
|
className: _stylesModule.default.cardsContainer
|
|
66
52
|
}, data.map(handleRenderTimelineRow)));
|
|
67
53
|
};
|
|
68
|
-
|
|
69
54
|
ConsumptionIncluded.propTypes = {
|
|
70
55
|
contextApiInfo: _smartBillTypes.contextApiInfoTypes,
|
|
71
56
|
billData: _billDataTypes.billDataTypes
|
|
72
57
|
};
|
|
73
|
-
|
|
74
58
|
var _default = (0, _WithContextApi.default)()(ConsumptionIncluded);
|
|
75
|
-
|
|
76
59
|
exports.default = _default;
|
|
@@ -4,28 +4,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getBimesterDate = exports.dataMapper = void 0;
|
|
7
|
-
|
|
8
7
|
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
9
|
-
|
|
10
8
|
var _string = require("@widergy/web-utils/lib/string");
|
|
11
|
-
|
|
12
9
|
var _consumptions = require("../../shared/utils/consumptions");
|
|
13
|
-
|
|
14
10
|
var _periodicities = require("../../shared/constants/periodicities");
|
|
15
|
-
|
|
16
11
|
var _consumptions2 = require("../../shared/constants/consumptions");
|
|
17
|
-
|
|
18
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
13
|
var getBimesterDateTitle = function getBimesterDateTitle(_ref, text) {
|
|
21
14
|
var year = _ref.year,
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
number = _ref.number,
|
|
16
|
+
settlements = _ref.settlements;
|
|
24
17
|
var isPeriodicity = (0, _string.stringToCompareWithoutAccentsInclusive)(settlements === null || settlements === void 0 ? void 0 : settlements.periodicity, _periodicities.PERIODICITY.BIMONTHLY);
|
|
25
18
|
if (!number || !year || !isPeriodicity) return '-';
|
|
26
19
|
return "".concat(text.bimester, " ").concat(number, " ").concat(text.of, " ").concat(year.substring(2));
|
|
27
20
|
};
|
|
28
|
-
|
|
29
21
|
var getBimesterDate = function getBimesterDate(periods, text) {
|
|
30
22
|
var currentPeriod = periods.find(function (item) {
|
|
31
23
|
return item.current;
|
|
@@ -33,52 +25,38 @@ var getBimesterDate = function getBimesterDate(periods, text) {
|
|
|
33
25
|
if (!currentPeriod) return '-';
|
|
34
26
|
return getBimesterDateTitle(currentPeriod, text);
|
|
35
27
|
};
|
|
36
|
-
|
|
37
28
|
exports.getBimesterDate = getBimesterDate;
|
|
38
|
-
|
|
39
29
|
var getTotalDaysDescriptionComsumption = function getTotalDaysDescriptionComsumption(period, texts) {
|
|
40
30
|
var _period$settlements;
|
|
41
|
-
|
|
42
31
|
var totalDays = period === null || period === void 0 ? void 0 : (_period$settlements = period.settlements) === null || _period$settlements === void 0 ? void 0 : _period$settlements.total_settlements_days;
|
|
43
32
|
return "".concat(totalDays, " ").concat(texts.days);
|
|
44
33
|
};
|
|
45
|
-
|
|
46
34
|
var getTotalDaysDescriptionSettlement = function getTotalDaysDescriptionSettlement(period, texts, dataRetriver) {
|
|
47
35
|
var _period$settlements2;
|
|
48
|
-
|
|
49
36
|
var totalDays = period === null || period === void 0 ? void 0 : (_period$settlements2 = period.settlements) === null || _period$settlements2 === void 0 ? void 0 : _period$settlements2.total_settlements_days;
|
|
50
37
|
var currentConsumptionDays = dataRetriver(period).days;
|
|
51
38
|
return currentConsumptionDays && totalDays ? "".concat(currentConsumptionDays, " ").concat(texts.of, " ").concat(totalDays, " ").concat(texts.days) : '-';
|
|
52
39
|
};
|
|
53
|
-
|
|
54
40
|
var getConsumptionDescriptionSettlement = function getConsumptionDescriptionSettlement(period, texts) {
|
|
55
41
|
var totalConsumption = (0, _consumptions.getTotalConsumption)(period, _consumptions2.ENERGY_TYPES.ACTIVE);
|
|
56
42
|
return totalConsumption.unit ? "".concat(texts.of, " ").concat(totalConsumption.value, " ").concat(totalConsumption.unit) : '-';
|
|
57
43
|
};
|
|
58
|
-
|
|
59
44
|
var getCardSubtitleSettlement = function getCardSubtitleSettlement(period, text, dataRetriver) {
|
|
60
45
|
var _period$settlements3;
|
|
61
|
-
|
|
62
46
|
var currentSettlement = dataRetriver(period).number || 0;
|
|
63
47
|
var totalSettlements = (period === null || period === void 0 ? void 0 : (_period$settlements3 = period.settlements) === null || _period$settlements3 === void 0 ? void 0 : _period$settlements3.total_settlements) || 0;
|
|
64
48
|
return "".concat(text.settlement, " ").concat(currentSettlement, " ").concat(text.of, " ").concat(totalSettlements);
|
|
65
49
|
};
|
|
66
|
-
|
|
67
50
|
var getCurrent = function getCurrent(period) {
|
|
68
51
|
var _period$settlements4;
|
|
69
|
-
|
|
70
52
|
return (period === null || period === void 0 ? void 0 : (_period$settlements4 = period.settlements) === null || _period$settlements4 === void 0 ? void 0 : _period$settlements4.current) || {};
|
|
71
53
|
};
|
|
72
|
-
|
|
73
54
|
var getRemaining = function getRemaining(period) {
|
|
74
55
|
var _period$settlements5, _period$settlements5$;
|
|
75
|
-
|
|
76
56
|
return (period === null || period === void 0 ? void 0 : (_period$settlements5 = period.settlements) === null || _period$settlements5 === void 0 ? void 0 : (_period$settlements5$ = _period$settlements5.remaining) === null || _period$settlements5$ === void 0 ? void 0 : _period$settlements5$[0]) || {};
|
|
77
57
|
};
|
|
78
|
-
|
|
79
58
|
var consumptionMapper = function consumptionMapper(period, texts) {
|
|
80
59
|
var _period$settlements6, _period$settlements7;
|
|
81
|
-
|
|
82
60
|
return {
|
|
83
61
|
startDate: period !== null && period !== void 0 && (_period$settlements6 = period.settlements) !== null && _period$settlements6 !== void 0 && _period$settlements6.start_date ? (0, _dayjs.default)(period.settlements.start_date).format('DD/MM/YYYY') : '-',
|
|
84
62
|
endDate: period !== null && period !== void 0 && (_period$settlements7 = period.settlements) !== null && _period$settlements7 !== void 0 && _period$settlements7.end_date ? (0, _dayjs.default)(period.settlements.end_date).format('DD/MM/YYYY') : '-',
|
|
@@ -91,10 +69,8 @@ var consumptionMapper = function consumptionMapper(period, texts) {
|
|
|
91
69
|
order: 0
|
|
92
70
|
};
|
|
93
71
|
};
|
|
94
|
-
|
|
95
72
|
var settlementCurrentMapper = function settlementCurrentMapper(period, texts) {
|
|
96
73
|
var _period$settlements8, _period$settlements8$, _period$settlements9, _period$settlements9$, _period$settlements10, _period$settlements11;
|
|
97
|
-
|
|
98
74
|
return {
|
|
99
75
|
cardTitle: texts.billing,
|
|
100
76
|
cardSubtitle: getCardSubtitleSettlement(period, texts, getCurrent),
|
|
@@ -108,10 +84,8 @@ var settlementCurrentMapper = function settlementCurrentMapper(period, texts) {
|
|
|
108
84
|
order: period === null || period === void 0 ? void 0 : (_period$settlements10 = period.settlements) === null || _period$settlements10 === void 0 ? void 0 : (_period$settlements11 = _period$settlements10.current) === null || _period$settlements11 === void 0 ? void 0 : _period$settlements11.number
|
|
109
85
|
};
|
|
110
86
|
};
|
|
111
|
-
|
|
112
87
|
var settlementRemainingMapper = function settlementRemainingMapper(period, texts) {
|
|
113
88
|
var _period$settlements12, _period$settlements13, _period$settlements14, _period$settlements15, _period$settlements16, _period$settlements17, _period$settlements18, _period$settlements19;
|
|
114
|
-
|
|
115
89
|
return {
|
|
116
90
|
cardTitle: texts.billing,
|
|
117
91
|
cardSubtitle: getCardSubtitleSettlement(period, texts, getRemaining),
|
|
@@ -125,7 +99,6 @@ var settlementRemainingMapper = function settlementRemainingMapper(period, texts
|
|
|
125
99
|
order: period === null || period === void 0 ? void 0 : (_period$settlements17 = period.settlements) === null || _period$settlements17 === void 0 ? void 0 : (_period$settlements18 = _period$settlements17.remaining) === null || _period$settlements18 === void 0 ? void 0 : (_period$settlements19 = _period$settlements18[0]) === null || _period$settlements19 === void 0 ? void 0 : _period$settlements19.number
|
|
126
100
|
};
|
|
127
101
|
};
|
|
128
|
-
|
|
129
102
|
var dataMapper = function dataMapper() {
|
|
130
103
|
var periods = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
131
104
|
var texts = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -137,5 +110,4 @@ var dataMapper = function dataMapper() {
|
|
|
137
110
|
return a.order - b.order;
|
|
138
111
|
});
|
|
139
112
|
};
|
|
140
|
-
|
|
141
113
|
exports.dataMapper = dataMapper;
|
|
@@ -4,37 +4,28 @@ 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 _Magnitude = _interopRequireDefault(require("../../../../../Magnitude"));
|
|
17
|
-
|
|
18
12
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
19
|
-
|
|
20
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
|
|
22
14
|
var ReadingRow = function ReadingRow(_ref) {
|
|
23
15
|
var alias = _ref.alias,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
16
|
+
numberAlias = _ref.numberAlias,
|
|
17
|
+
unitAlias = _ref.unitAlias,
|
|
18
|
+
contextApiInfo = _ref.contextApiInfo,
|
|
19
|
+
text = _ref.text,
|
|
20
|
+
value = _ref.value,
|
|
21
|
+
unit = _ref.unit,
|
|
22
|
+
disableUnit = _ref.disableUnit;
|
|
31
23
|
var Label = contextApiInfo.Label;
|
|
32
24
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
33
25
|
className: _stylesModule.default.container
|
|
34
26
|
}, /*#__PURE__*/_react.default.createElement(Label, {
|
|
35
27
|
alias: alias
|
|
36
28
|
}, "".concat(text, ":")), /*#__PURE__*/_react.default.createElement(_Magnitude.default, {
|
|
37
|
-
primary: true,
|
|
38
29
|
numberAlias: numberAlias,
|
|
39
30
|
unitAlias: unitAlias,
|
|
40
31
|
value: value,
|
|
@@ -45,7 +36,6 @@ var ReadingRow = function ReadingRow(_ref) {
|
|
|
45
36
|
}
|
|
46
37
|
}));
|
|
47
38
|
};
|
|
48
|
-
|
|
49
39
|
ReadingRow.propTypes = {
|
|
50
40
|
contextApiInfo: _smartBillTypes.contextApiInfoTypes,
|
|
51
41
|
text: _propTypes.string,
|
|
@@ -56,7 +46,5 @@ ReadingRow.propTypes = {
|
|
|
56
46
|
numberAlias: _propTypes.string,
|
|
57
47
|
unitAlias: _propTypes.string
|
|
58
48
|
};
|
|
59
|
-
|
|
60
49
|
var _default = (0, _WithContextApi.default)()(ReadingRow);
|
|
61
|
-
|
|
62
50
|
exports.default = _default;
|
|
@@ -4,46 +4,34 @@ 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 _dayjs = _interopRequireDefault(require("dayjs"));
|
|
13
|
-
|
|
14
10
|
var _aliases = require("../../../../shared/constants/aliases");
|
|
15
|
-
|
|
16
11
|
var _smartBillTypes = require("../../../../shared/types/smartBillTypes");
|
|
17
|
-
|
|
18
12
|
var _WithContextApi = _interopRequireDefault(require("../../../WithContextApi"));
|
|
19
|
-
|
|
20
13
|
var _ReadingRow = _interopRequireDefault(require("./components/ReadingRow"));
|
|
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 ConsumptionSummary = function ConsumptionSummary(_ref) {
|
|
27
17
|
var contextApiInfo = _ref.contextApiInfo,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
18
|
+
periodNumber = _ref.periodNumber,
|
|
19
|
+
year = _ref.year,
|
|
20
|
+
initialReadingDate = _ref.initialReadingDate,
|
|
21
|
+
finalReadingDate = _ref.finalReadingDate,
|
|
22
|
+
totalSettlementsDays = _ref.totalSettlementsDays,
|
|
23
|
+
initialReadingValue = _ref.initialReadingValue,
|
|
24
|
+
finalReadingValue = _ref.finalReadingValue,
|
|
25
|
+
totalConsumptionValue = _ref.totalConsumptionValue,
|
|
26
|
+
totalConsumptionUnit = _ref.totalConsumptionUnit,
|
|
27
|
+
_ref$classes = _ref.classes,
|
|
28
|
+
classes = _ref$classes === void 0 ? {} : _ref$classes;
|
|
39
29
|
var config = contextApiInfo.config,
|
|
40
|
-
|
|
30
|
+
Label = contextApiInfo.Label;
|
|
41
31
|
var texts = config.texts;
|
|
42
|
-
|
|
43
32
|
var formatDate = function formatDate(date) {
|
|
44
33
|
return (0, _dayjs.default)(date).format('DD/MM/YYYY');
|
|
45
34
|
};
|
|
46
|
-
|
|
47
35
|
var daysLabel = totalSettlementsDays ? "(".concat(totalSettlementsDays, " ").concat(texts.consumptionPeriod.days, ")") : '';
|
|
48
36
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
49
37
|
className: "".concat(_stylesModule.default.container, " ").concat(classes.container)
|
|
@@ -82,7 +70,6 @@ var ConsumptionSummary = function ConsumptionSummary(_ref) {
|
|
|
82
70
|
unit: totalConsumptionUnit
|
|
83
71
|
})));
|
|
84
72
|
};
|
|
85
|
-
|
|
86
73
|
ConsumptionSummary.propTypes = {
|
|
87
74
|
contextApiInfo: _smartBillTypes.contextApiInfoTypes,
|
|
88
75
|
periodNumber: _propTypes.string,
|
|
@@ -98,7 +85,5 @@ ConsumptionSummary.propTypes = {
|
|
|
98
85
|
container: _propTypes.string
|
|
99
86
|
})
|
|
100
87
|
};
|
|
101
|
-
|
|
102
88
|
var _default = (0, _WithContextApi.default)()(ConsumptionSummary);
|
|
103
|
-
|
|
104
89
|
exports.default = _default;
|
|
@@ -1,63 +1,40 @@
|
|
|
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 _browser = require("@widergy/web-utils/lib/browser");
|
|
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 _deviceSizes = require("../../../../constants/deviceSizes");
|
|
23
|
-
|
|
24
15
|
var _BarChart = _interopRequireDefault(require("../../../BarChart"));
|
|
25
|
-
|
|
26
16
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
27
|
-
|
|
28
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
-
|
|
30
18
|
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); }
|
|
31
|
-
|
|
32
19
|
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; }
|
|
33
|
-
|
|
34
20
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
35
|
-
|
|
36
21
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
37
|
-
|
|
38
22
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
39
|
-
|
|
40
|
-
function
|
|
41
|
-
|
|
42
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
43
|
-
|
|
23
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
24
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
44
25
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
45
|
-
|
|
46
26
|
var HistoryGraph = function HistoryGraph(_ref) {
|
|
47
27
|
var billData = _ref.billData,
|
|
48
|
-
|
|
28
|
+
contextApiInfo = _ref.contextApiInfo;
|
|
49
29
|
var config = contextApiInfo.config;
|
|
50
30
|
var showPeriodsInChronologicalOrder = config.showPeriodsInChronologicalOrder;
|
|
51
|
-
|
|
52
31
|
var _useState = (0, _react.useState)((0, _browser.isDesktop)(_deviceSizes.TabletBreakpoint)),
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
32
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
33
|
+
isDesktopSize = _useState2[0],
|
|
34
|
+
setIsDesktopSize = _useState2[1];
|
|
57
35
|
var handleResizeScreen = function handleResizeScreen() {
|
|
58
36
|
return setIsDesktopSize((0, _browser.isDesktop)(_deviceSizes.TabletBreakpoint));
|
|
59
37
|
};
|
|
60
|
-
|
|
61
38
|
(0, _react.useEffect)(function () {
|
|
62
39
|
window.addEventListener(_browser.RESIZE_EVENT, handleResizeScreen);
|
|
63
40
|
handleResizeScreen();
|
|
@@ -74,7 +51,6 @@ var HistoryGraph = function HistoryGraph(_ref) {
|
|
|
74
51
|
isDesktop: isDesktopSize
|
|
75
52
|
}));
|
|
76
53
|
};
|
|
77
|
-
|
|
78
54
|
HistoryGraph.propTypes = {
|
|
79
55
|
billData: _billDataTypes.billDataTypes,
|
|
80
56
|
contextApiInfo: _smartBillTypes.contextApiInfoTypes
|
|
@@ -4,56 +4,42 @@ 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 _dayjs = _interopRequireDefault(require("dayjs"));
|
|
13
|
-
|
|
14
10
|
var _numeral = _interopRequireDefault(require("config/numeral"));
|
|
15
|
-
|
|
16
11
|
var _readings = require("../../../../shared/constants/readings");
|
|
17
|
-
|
|
18
12
|
var _smartBillTypes = require("../../../../shared/types/smartBillTypes");
|
|
19
|
-
|
|
20
13
|
var _WithContextApi = _interopRequireDefault(require("../../../WithContextApi"));
|
|
21
|
-
|
|
22
14
|
var _IconAndDetails = _interopRequireDefault(require("../../../IconAndDetails"));
|
|
23
|
-
|
|
24
15
|
var _aliases = require("../../../../shared/constants/aliases");
|
|
25
|
-
|
|
26
16
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
27
|
-
|
|
28
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
-
|
|
30
18
|
var Reading = function Reading(_ref) {
|
|
31
19
|
var contextApiInfo = _ref.contextApiInfo,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
20
|
+
title = _ref.title,
|
|
21
|
+
date = _ref.date,
|
|
22
|
+
readingType = _ref.readingType,
|
|
23
|
+
readingValue = _ref.readingValue,
|
|
24
|
+
tooltip = _ref.tooltip,
|
|
25
|
+
_ref$classes = _ref.classes,
|
|
26
|
+
classes = _ref$classes === void 0 ? {} : _ref$classes;
|
|
39
27
|
var assets = contextApiInfo.assets,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
28
|
+
config = contextApiInfo.config,
|
|
29
|
+
Label = contextApiInfo.Label,
|
|
30
|
+
Tooltip = contextApiInfo.Tooltip;
|
|
43
31
|
var texts = config.texts,
|
|
44
|
-
|
|
32
|
+
colors = config.colors;
|
|
45
33
|
var InfoIcon = assets.InfoIcon,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
34
|
+
ReadingDateIcon = assets.ReadingDateIcon,
|
|
35
|
+
ReadingTypeIcon = assets.ReadingTypeIcon,
|
|
36
|
+
EnergyIcon = assets.EnergyIcon;
|
|
50
37
|
var TitleLabel = function TitleLabel() {
|
|
51
38
|
return /*#__PURE__*/_react.default.createElement(Label, {
|
|
52
39
|
alias: _aliases.READING_TITLE,
|
|
53
|
-
className: !tooltip && _stylesModule.default.title
|
|
40
|
+
className: "".concat(!tooltip && _stylesModule.default.title)
|
|
54
41
|
}, title);
|
|
55
42
|
};
|
|
56
|
-
|
|
57
43
|
var EnergyIconStyled = function EnergyIconStyled() {
|
|
58
44
|
return /*#__PURE__*/_react.default.createElement(EnergyIcon, {
|
|
59
45
|
style: {
|
|
@@ -61,7 +47,6 @@ var Reading = function Reading(_ref) {
|
|
|
61
47
|
}
|
|
62
48
|
});
|
|
63
49
|
};
|
|
64
|
-
|
|
65
50
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
66
51
|
className: "".concat(_stylesModule.default.container, " ").concat(classes.container)
|
|
67
52
|
}, tooltip ? /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -105,7 +90,6 @@ var Reading = function Reading(_ref) {
|
|
|
105
90
|
alias: _aliases.READING_STATE
|
|
106
91
|
}, (0, _numeral.default)(readingValue).format('0,0')))));
|
|
107
92
|
};
|
|
108
|
-
|
|
109
93
|
Reading.propTypes = {
|
|
110
94
|
contextApiInfo: _smartBillTypes.contextApiInfoTypes,
|
|
111
95
|
title: _propTypes.string,
|
|
@@ -117,7 +101,5 @@ Reading.propTypes = {
|
|
|
117
101
|
}),
|
|
118
102
|
tooltip: _propTypes.bool
|
|
119
103
|
};
|
|
120
|
-
|
|
121
104
|
var _default = (0, _WithContextApi.default)()(Reading);
|
|
122
|
-
|
|
123
105
|
exports.default = _default;
|
|
@@ -4,40 +4,24 @@ 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 _periods = require("../../shared/utils/periods");
|
|
11
|
-
|
|
12
9
|
var _readings = require("../../shared/utils/readings");
|
|
13
|
-
|
|
14
10
|
var _readings2 = require("../../shared/constants/readings");
|
|
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 _Reading = _interopRequireDefault(require("./components/Reading"));
|
|
23
|
-
|
|
24
15
|
var _ConsumptionSummary = _interopRequireDefault(require("./components/ConsumptionSummary"));
|
|
25
|
-
|
|
26
16
|
var _HistoryGraph = _interopRequireDefault(require("./components/HistoryGraph"));
|
|
27
|
-
|
|
28
17
|
var _utils = require("./utils");
|
|
29
|
-
|
|
30
18
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
31
|
-
|
|
32
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
|
-
|
|
34
20
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
35
|
-
|
|
36
21
|
var ConsumptionPeriod = function ConsumptionPeriod(_ref) {
|
|
37
22
|
var _currentPeriod$settle, _currentPeriod$settle2;
|
|
38
|
-
|
|
39
23
|
var contextApiInfo = _ref.contextApiInfo,
|
|
40
|
-
|
|
24
|
+
billData = _ref.billData;
|
|
41
25
|
var texts = contextApiInfo.config.texts;
|
|
42
26
|
var currentPeriod = (0, _periods.getCurrentPeriod)(billData);
|
|
43
27
|
var initialReading = (0, _readings.getReadingPeriod)(billData, _readings2.READING_MOMENTS.INITIAL);
|
|
@@ -77,12 +61,9 @@ var ConsumptionPeriod = function ConsumptionPeriod(_ref) {
|
|
|
77
61
|
contextApiInfo: contextApiInfo
|
|
78
62
|
}));
|
|
79
63
|
};
|
|
80
|
-
|
|
81
64
|
ConsumptionPeriod.propTypes = {
|
|
82
65
|
contextApiInfo: _smartBillTypes.contextApiInfoTypes,
|
|
83
66
|
billData: _billDataTypes.billDataTypes
|
|
84
67
|
};
|
|
85
|
-
|
|
86
68
|
var _default = (0, _WithContextApi.default)()(ConsumptionPeriod);
|
|
87
|
-
|
|
88
69
|
exports.default = _default;
|