@widergy/utilitygo-smart-bill-web 2.2.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/components/Advice/index.js +11 -8
- package/dist/components/Amount/index.js +27 -23
- package/dist/components/Amount/utils.js +1 -5
- package/dist/components/Banner/index.js +11 -8
- package/dist/components/BarChart/constants.js +3 -6
- package/dist/components/BarChart/index.js +29 -24
- package/dist/components/BarChart/utils.js +15 -15
- package/dist/components/BillCalculation/components/ConceptCard/index.js +53 -47
- package/dist/components/BillCalculation/components/Glossary/index.js +49 -66
- package/dist/components/BillCalculation/components/Glossary/styles.module.scss +1 -0
- package/dist/components/BillCalculation/constants.js +1 -2
- package/dist/components/BillCalculation/index.js +49 -53
- package/dist/components/BillCalculation/utils.js +19 -22
- package/dist/components/BillSummary/components/BilledConcepts/components/Concept/index.js +26 -24
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/constants.js +2 -3
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/index.js +16 -17
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/styles.module.scss +3 -3
- package/dist/components/BillSummary/components/BilledConcepts/constants.js +12 -17
- package/dist/components/BillSummary/components/BilledConcepts/index.js +30 -41
- package/dist/components/BillSummary/components/BilledConcepts/utils.js +44 -68
- package/dist/components/BillSummary/index.js +71 -71
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/DataLine/index.js +9 -10
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/index.js +18 -12
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/utils.js +1 -1
- package/dist/components/ConsumptionComparison/components/ComparisonTable/constants.js +144 -143
- package/dist/components/ConsumptionComparison/components/ComparisonTable/index.js +17 -16
- package/dist/components/ConsumptionComparison/components/ComparisonTable/utils.js +84 -88
- package/dist/components/ConsumptionComparison/components/ConsumptionAdvice/index.js +22 -13
- package/dist/components/ConsumptionComparison/components/ConsumptionAdvice/utils.js +1 -1
- package/dist/components/ConsumptionComparison/components/PercentageComparison/index.js +22 -16
- package/dist/components/ConsumptionComparison/components/PercentageComparison/utils.js +13 -9
- package/dist/components/ConsumptionComparison/index.js +42 -47
- package/dist/components/ConsumptionEnergyDetails/components/ConsumptionEnergyComparison/index.js +28 -24
- package/dist/components/ConsumptionEnergyDetails/components/ConsumptionEnergyComparison/styles.module.scss +1 -1
- package/dist/components/ConsumptionEnergyDetails/components/ConsumptionInDaysLabel/index.js +19 -15
- package/dist/components/ConsumptionEnergyDetails/components/EnergyTotalConsumption/index.js +16 -14
- package/dist/components/ConsumptionEnergyDetails/components/PercentageComparison/index.js +22 -17
- package/dist/components/ConsumptionEnergyDetails/components/PercentageComparison/utils.js +1 -1
- package/dist/components/ConsumptionEnergyDetails/index.js +47 -43
- package/dist/components/ConsumptionEnergyDetails/styles.module.scss +2 -2
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/index.js +65 -62
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/utils.js +11 -13
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderConsumption/index.js +21 -19
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderSettlement/index.js +17 -12
- package/dist/components/ConsumptionIncluded/components/TimelineRow/index.js +43 -39
- package/dist/components/ConsumptionIncluded/components/TimelineRow/styles.module.scss +2 -2
- package/dist/components/ConsumptionIncluded/index.js +32 -34
- package/dist/components/ConsumptionIncluded/utils.js +29 -33
- package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/components/ReadingRow/index.js +15 -12
- package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/index.js +24 -22
- package/dist/components/ConsumptionPeriod/components/HistoryGraph/index.js +19 -28
- package/dist/components/ConsumptionPeriod/components/Reading/index.js +36 -34
- package/dist/components/ConsumptionPeriod/index.js +13 -10
- package/dist/components/ConsumptionPeriod/utils.js +13 -15
- package/dist/components/Date/index.js +13 -11
- package/dist/components/DebtState/index.js +15 -10
- package/dist/components/IconAndDetails/index.js +20 -19
- package/dist/components/Magnitude/index.js +16 -14
- package/dist/components/Magnitude/utils.js +2 -8
- package/dist/components/MainBillData/components/BillAlert/components/BillParticularConditions/index.js +19 -16
- package/dist/components/MainBillData/components/BillAlert/index.js +25 -33
- package/dist/components/MainBillData/components/BillBody/components/ClientData/index.js +20 -13
- package/dist/components/MainBillData/components/BillBody/components/Consumption/index.js +15 -13
- package/dist/components/MainBillData/components/BillBody/components/Consumption/utils.js +1 -3
- package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/index.js +24 -17
- package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/styles.module.scss +2 -2
- package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/utils.js +1 -1
- package/dist/components/MainBillData/components/BillBody/index.js +43 -46
- package/dist/components/MainBillData/components/BillHeader/components/TypeAndNumber/index.js +17 -13
- package/dist/components/MainBillData/components/BillHeader/index.js +30 -26
- package/dist/components/MainBillData/components/BillHeader/styles.module.scss +1 -1
- package/dist/components/MainBillData/index.js +8 -7
- package/dist/components/MainBillData/theme.js +7 -9
- package/dist/components/MainBillData/utils.js +1 -5
- package/dist/components/Period/index.js +55 -45
- package/dist/components/PowerProgresBar/components/PowerConsumption/index.js +16 -13
- package/dist/components/PowerProgresBar/index.js +32 -32
- package/dist/components/RateAndCategory/index.js +26 -29
- package/dist/components/RatesDefinition/components/BillRate/components/RatePrices/index.js +21 -15
- package/dist/components/RatesDefinition/components/BillRate/index.js +25 -16
- package/dist/components/RatesDefinition/components/BillRate/styles.module.scss +1 -1
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/Category/index.js +15 -11
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/components/IndicatorLabel/index.js +27 -23
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/index.js +12 -9
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/styles.module.scss +1 -1
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/utils.js +9 -9
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Legend/index.js +22 -21
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Stages/index.js +35 -38
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Stages/styles.module.scss +0 -1
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/constants.js +2 -4
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/index.js +18 -32
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/utils.js +35 -47
- package/dist/components/RatesDefinition/components/CategoryByConsumption/constants.js +18 -36
- package/dist/components/RatesDefinition/components/CategoryByConsumption/index.js +24 -33
- package/dist/components/RatesDefinition/components/CategoryByConsumption/utils.js +1 -5
- package/dist/components/RatesDefinition/components/PurchasedRate/index.js +20 -15
- package/dist/components/RatesDefinition/index.js +21 -17
- package/dist/components/RatesDefinition/styles.module.scss +1 -1
- package/dist/components/SmartBillProvider/index.js +13 -36
- package/dist/components/StyledAmount/constants.js +2 -3
- package/dist/components/StyledAmount/index.js +20 -29
- package/dist/components/WithContextApi/index.js +19 -27
- package/dist/components/WithContextApi/layout.js +3 -4
- package/dist/components/WithSeason/index.js +7 -11
- package/dist/constants/deviceSizes.js +27 -24
- package/dist/constants/seasons.js +3 -5
- package/dist/index.js +19 -19
- package/dist/scss/variables/commonColors.module.scss +1 -1
- package/dist/shared/Context/index.js +5 -3
- package/dist/shared/constants/aliases.js +691 -694
- package/dist/shared/constants/consumptions.js +5 -9
- package/dist/shared/constants/periodicities.js +2 -3
- package/dist/shared/constants/rates.js +2 -3
- package/dist/shared/constants/readings.js +3 -5
- package/dist/shared/constants/seasons.js +3 -5
- package/dist/shared/constants/stagesGraph.js +4 -8
- package/dist/shared/types/assetsTypes.js +1 -2
- package/dist/shared/types/billDataTypes.js +6 -11
- package/dist/shared/types/componentsTypes.js +19 -14
- package/dist/shared/types/formattersTypes.js +2 -3
- package/dist/shared/types/rateStagesTypes.js +3 -6
- package/dist/shared/types/smartBillTypes.js +5 -11
- package/dist/shared/types/textsTypes.js +2 -3
- package/dist/shared/utils/billCalculation.js +9 -9
- package/dist/shared/utils/consumptions.js +27 -55
- package/dist/shared/utils/context.js +6 -5
- package/dist/shared/utils/expirations.js +1 -5
- package/dist/shared/utils/periods.js +14 -20
- package/dist/shared/utils/rates.js +1 -5
- package/dist/shared/utils/readings.js +2 -10
- package/dist/shared/utils/season.js +1 -5
- package/dist/shared/utils/stagesGraph.js +11 -15
- package/dist/utils/hooks.js +2 -3
- package/dist/utils.js +4 -8
- package/package.json +26 -63
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -13,18 +12,22 @@ var _utils = require("../../../../utils");
|
|
|
13
12
|
var _aliases = require("../../../../shared/constants/aliases");
|
|
14
13
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
15
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
function _getRequireWildcardCache(
|
|
17
|
-
function _interopRequireWildcard(
|
|
15
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
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); }
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
const EnergyTotalConsumption = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
contextApiInfo,
|
|
21
|
+
consumption,
|
|
22
|
+
unit,
|
|
23
|
+
text,
|
|
24
|
+
exceededReactiveEnergy
|
|
25
|
+
} = _ref;
|
|
26
|
+
const {
|
|
27
|
+
Label
|
|
28
|
+
} = contextApiInfo;
|
|
29
|
+
const alias = exceededReactiveEnergy ? _aliases.ENERGY_TOTAL_CONSUMPTION_EXCEEDED : _aliases.ENERGY_TOTAL_CONSUMPTION;
|
|
30
|
+
const unitAlias = exceededReactiveEnergy ? _aliases.ENERGY_TOTAL_CONSUMPTION_EXCEEDED_UNIT : _aliases.ENERGY_TOTAL_CONSUMPTION_UNIT;
|
|
28
31
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
29
32
|
className: _stylesModule.default.energyConsumotionLabel
|
|
30
33
|
}, /*#__PURE__*/_react.default.createElement(Label, _extends({
|
|
@@ -46,5 +49,4 @@ EnergyTotalConsumption.propTypes = {
|
|
|
46
49
|
text: _propTypes.string,
|
|
47
50
|
exceededReactiveEnergy: _propTypes.bool
|
|
48
51
|
};
|
|
49
|
-
var _default = (0, _WithContextApi.default)()(EnergyTotalConsumption);
|
|
50
|
-
exports.default = _default;
|
|
52
|
+
var _default = exports.default = (0, _WithContextApi.default)()(EnergyTotalConsumption);
|
|
@@ -12,21 +12,27 @@ var _aliases = require("../../../../shared/constants/aliases");
|
|
|
12
12
|
var _utils = require("./utils");
|
|
13
13
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
15
|
+
const PercentageComparison = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
contextApiInfo,
|
|
18
|
+
savingsPercentage,
|
|
19
|
+
multipleSettlements
|
|
20
|
+
} = _ref;
|
|
21
|
+
const {
|
|
22
|
+
assets,
|
|
23
|
+
config,
|
|
24
|
+
Label
|
|
25
|
+
} = contextApiInfo;
|
|
26
|
+
const {
|
|
27
|
+
consumptionComparissonWithLasYear,
|
|
28
|
+
activeEnergycomparisonWithLastYear
|
|
29
|
+
} = config.texts.billSummary;
|
|
30
|
+
const {
|
|
31
|
+
Icon,
|
|
32
|
+
sign,
|
|
33
|
+
value,
|
|
34
|
+
background
|
|
35
|
+
} = (0, _utils.getProps)(savingsPercentage, assets);
|
|
30
36
|
return savingsPercentage === 0 || savingsPercentage ? /*#__PURE__*/_react.default.createElement("div", {
|
|
31
37
|
className: "".concat(_stylesModule.default.container, " ").concat(background)
|
|
32
38
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -44,5 +50,4 @@ PercentageComparison.propTypes = {
|
|
|
44
50
|
savingsPercentage: _propTypes.number,
|
|
45
51
|
multipleSettlements: _propTypes.bool
|
|
46
52
|
};
|
|
47
|
-
var _default = (0, _WithContextApi.default)()(PercentageComparison);
|
|
48
|
-
exports.default = _default;
|
|
53
|
+
var _default = exports.default = (0, _WithContextApi.default)()(PercentageComparison);
|
|
@@ -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
|
-
|
|
9
|
+
const getProps = (savingsPercentage, assets) => {
|
|
10
10
|
if (savingsPercentage > 0) {
|
|
11
11
|
return {
|
|
12
12
|
Icon: assets.ConsumptionReductionIcon,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -21,46 +20,52 @@ var _EnergyTotalConsumption = _interopRequireDefault(require("./components/Energ
|
|
|
21
20
|
var _PercentageComparison = _interopRequireDefault(require("./components/PercentageComparison"));
|
|
22
21
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
23
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
|
-
function _getRequireWildcardCache(
|
|
25
|
-
function _interopRequireWildcard(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
23
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
24
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
25
|
+
const ConsumptionEnergyDetails = _ref => {
|
|
26
|
+
let {
|
|
27
|
+
contextApiInfo,
|
|
28
|
+
currentPeriod,
|
|
29
|
+
billData,
|
|
30
|
+
multipleSettlements,
|
|
31
|
+
consumptionComparison,
|
|
32
|
+
withPercentage
|
|
33
|
+
} = _ref;
|
|
34
|
+
const {
|
|
35
|
+
config,
|
|
36
|
+
Label,
|
|
37
|
+
assets
|
|
38
|
+
} = contextApiInfo;
|
|
39
|
+
const {
|
|
40
|
+
texts,
|
|
41
|
+
validations
|
|
42
|
+
} = config;
|
|
43
|
+
const {
|
|
44
|
+
RedAlertIcon
|
|
45
|
+
} = assets;
|
|
46
|
+
const {
|
|
47
|
+
useCosinePhi,
|
|
48
|
+
showMultipleSettlementsConsumption,
|
|
49
|
+
showPercentageComparison,
|
|
50
|
+
showSingleSettlementDays
|
|
51
|
+
} = validations;
|
|
52
|
+
const currentConsumption = (0, _consumptions.getCurrentConsumption)(currentPeriod, _consumptions2.ENERGY_TYPES.ACTIVE);
|
|
53
|
+
const remainingConsumption = (0, _consumptions.getRemainingConsumption)(currentPeriod, _consumptions2.ENERGY_TYPES.ACTIVE);
|
|
54
|
+
const totalConsumption = (0, _consumptions.getTotalConsumption)(currentPeriod, _consumptions2.ENERGY_TYPES.ACTIVE);
|
|
55
|
+
const powerFactorType = useCosinePhi(billData) ? _consumptions2.POWER_FACTORS.COSINE_PHI : _consumptions2.POWER_FACTORS.TANGENT_PHI;
|
|
56
|
+
const powerFactor = (0, _consumptions.getTotalConsumption)(currentPeriod, powerFactorType);
|
|
57
|
+
const totalReactiveConsumption = (0, _consumptions.getTotalConsumption)(currentPeriod, _consumptions2.ENERGY_TYPES.REACTIVE);
|
|
58
|
+
const savingsPercentage = (0, _periods.getSavingsPercentage)(currentPeriod);
|
|
59
|
+
const dataValidation = data => (0, _utils.stringOrDash)(data);
|
|
60
|
+
const settlements = currentPeriod === null || currentPeriod === void 0 ? void 0 : currentPeriod.settlements;
|
|
61
|
+
const periodicity = settlements === null || settlements === void 0 ? void 0 : settlements.periodicity;
|
|
62
|
+
const periodNumber = currentPeriod === null || currentPeriod === void 0 ? void 0 : currentPeriod.number;
|
|
63
|
+
const year = currentPeriod === null || currentPeriod === void 0 ? void 0 : currentPeriod.year;
|
|
64
|
+
const currentIsFirstSettlement = multipleSettlements && settlements.current.number === 1;
|
|
65
|
+
const Title = style => /*#__PURE__*/_react.default.createElement(Label, {
|
|
66
|
+
alias: _aliases.TITLE,
|
|
67
|
+
className: "".concat(style && _stylesModule.default.title)
|
|
68
|
+
}, texts.billSummary.consumptionTitle);
|
|
64
69
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
65
70
|
className: _stylesModule.default.container
|
|
66
71
|
}, showMultipleSettlementsConsumption(billData) ? consumptionComparison ? /*#__PURE__*/_react.default.createElement(_ConsumptionEnergyComparison.default, {
|
|
@@ -137,5 +142,4 @@ ConsumptionEnergyDetails.propTypes = {
|
|
|
137
142
|
consumptionComparison: _propTypes.bool,
|
|
138
143
|
withPercentage: _propTypes.bool
|
|
139
144
|
};
|
|
140
|
-
var _default = (0, _WithContextApi.default)()(ConsumptionEnergyDetails);
|
|
141
|
-
exports.default = _default;
|
|
145
|
+
var _default = exports.default = (0, _WithContextApi.default)()(ConsumptionEnergyDetails);
|
|
@@ -33,10 +33,10 @@ $border-radius: 5px;
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
.singleSettlementDaysContainer {
|
|
36
|
-
border-top: 1px solid $borders-gray;
|
|
36
|
+
border-top: 1px solid $borders-gray;
|
|
37
37
|
display: flex;
|
|
38
|
-
padding: 12px 24px;
|
|
39
38
|
justify-content: space-between;
|
|
39
|
+
padding: 12px 24px;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
.multipleSettlementsContainer {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -14,67 +13,72 @@ var _HeaderConsumption = _interopRequireDefault(require("../HeaderConsumption"))
|
|
|
14
13
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
15
14
|
var _utils = require("./utils");
|
|
16
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
function _getRequireWildcardCache(
|
|
18
|
-
function _interopRequireWildcard(
|
|
16
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
17
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
18
|
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); }
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
19
|
+
const Card = _ref => {
|
|
20
|
+
let {
|
|
21
|
+
contextApiInfo,
|
|
22
|
+
cardTitle,
|
|
23
|
+
cardSubtitle,
|
|
24
|
+
cardDescription1,
|
|
25
|
+
cardDescription2,
|
|
26
|
+
consumption,
|
|
27
|
+
remaining,
|
|
28
|
+
current,
|
|
29
|
+
settlementNumber,
|
|
30
|
+
currentIsFirstSettlement,
|
|
31
|
+
unit,
|
|
32
|
+
value,
|
|
33
|
+
initialDate,
|
|
34
|
+
finalDate
|
|
35
|
+
} = _ref;
|
|
36
|
+
const {
|
|
37
|
+
Label,
|
|
38
|
+
assets,
|
|
39
|
+
config
|
|
40
|
+
} = contextApiInfo;
|
|
41
|
+
const {
|
|
42
|
+
colors
|
|
43
|
+
} = config;
|
|
44
|
+
const {
|
|
45
|
+
consumptionIncluded
|
|
46
|
+
} = config.texts;
|
|
47
|
+
const {
|
|
48
|
+
EnergyIcon
|
|
49
|
+
} = assets;
|
|
50
|
+
const consumptionText = current ? consumptionIncluded.consumptionIncluded : settlementNumber === 1 ? consumptionIncluded.consumptionBilled : consumptionIncluded.consumptionNotBilled;
|
|
51
|
+
const EnergyStyledIcon = {
|
|
52
|
+
primary: () => /*#__PURE__*/_react.default.createElement(EnergyIcon, {
|
|
53
|
+
className: _stylesModule.default.energyIcon,
|
|
54
|
+
style: {
|
|
55
|
+
fill: colors.primary
|
|
56
|
+
}
|
|
57
|
+
}),
|
|
58
|
+
white: () => /*#__PURE__*/_react.default.createElement(EnergyIcon, {
|
|
59
|
+
className: _stylesModule.default.energyIcon,
|
|
60
|
+
style: {
|
|
61
|
+
fill: 'white'
|
|
62
|
+
}
|
|
63
|
+
}),
|
|
64
|
+
gray: () => /*#__PURE__*/_react.default.createElement(EnergyIcon, {
|
|
65
|
+
className: _stylesModule.default.energyIcon,
|
|
66
|
+
style: {
|
|
67
|
+
fill: colors.gray
|
|
68
|
+
}
|
|
69
|
+
})
|
|
67
70
|
};
|
|
68
|
-
|
|
69
|
-
magnitudeAlias
|
|
70
|
-
unitAlias
|
|
71
|
-
consumptionAlias
|
|
72
|
-
cardTitleAlias
|
|
73
|
-
cardDescriptionAlias
|
|
74
|
-
cardDescriptionRemainingAlias
|
|
75
|
-
cardSubtitleAlias
|
|
76
|
-
cardConsumptionDescriptionAlias
|
|
77
|
-
cardConsumptionTextAlias
|
|
71
|
+
const {
|
|
72
|
+
magnitudeAlias,
|
|
73
|
+
unitAlias,
|
|
74
|
+
consumptionAlias,
|
|
75
|
+
cardTitleAlias,
|
|
76
|
+
cardDescriptionAlias,
|
|
77
|
+
cardDescriptionRemainingAlias,
|
|
78
|
+
cardSubtitleAlias,
|
|
79
|
+
cardConsumptionDescriptionAlias,
|
|
80
|
+
cardConsumptionTextAlias
|
|
81
|
+
} = (0, _utils.getAliases)(consumption, current, remaining);
|
|
78
82
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
79
83
|
className: "".concat(_stylesModule.default.container, " ").concat(current && _stylesModule.default.containerCurrent, " ").concat(remaining && _stylesModule.default.containerRemaining),
|
|
80
84
|
style: current && {
|
|
@@ -151,5 +155,4 @@ Card.propTypes = {
|
|
|
151
155
|
initialDate: _propTypes.string,
|
|
152
156
|
finalDate: _propTypes.string
|
|
153
157
|
};
|
|
154
|
-
var _default = (0, _WithContextApi.default)()(Card);
|
|
155
|
-
exports.default = _default;
|
|
158
|
+
var _default = exports.default = (0, _WithContextApi.default)()(Card);
|
|
@@ -5,17 +5,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getAliases = void 0;
|
|
7
7
|
var _aliases = require("../../../../../../shared/constants/aliases");
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
};
|
|
8
|
+
const getAliases = (consumption, current, remaining) => ({
|
|
9
|
+
magnitudeAlias: consumption ? _aliases.CARD_PRIMARY_MAGNITUDE : current ? _aliases.CARD_WHITE_MAGNITUDE : _aliases.CARD_GRAY_MAGNITUDE,
|
|
10
|
+
unitAlias: consumption ? _aliases.CARD_PRIMARY_UNIT : current ? _aliases.CARD_WHITE_UNIT : _aliases.CARD_GRAY_UNIT,
|
|
11
|
+
consumptionAlias: consumption ? _aliases.CARD_PRIMARY_CONSUMPTION : current ? _aliases.CARD_WHITE_CONSUMPTION : _aliases.CARD_GRAY_CONSUMPTION,
|
|
12
|
+
cardTitleAlias: consumption ? _aliases.CARD_MAIN_TITLE : _aliases.CARD_SECONDARY_TITLE,
|
|
13
|
+
cardDescriptionAlias: _aliases.CARD_DESCRIPTION,
|
|
14
|
+
cardDescriptionRemainingAlias: remaining ? _aliases.CARD_DESCRIPTION_REMAINING : _aliases.CARD_DESCRIPTION,
|
|
15
|
+
cardSubtitleAlias: remaining ? _aliases.CARD_SUBTITLE_REMAINING : _aliases.CARD_SUBTITLE,
|
|
16
|
+
cardConsumptionDescriptionAlias: current ? _aliases.CARD_CONSUMPTION_DESCRIPTION_WHITE : _aliases.CARD_CONSUMPTION_DESCRIPTION_GRAY,
|
|
17
|
+
cardConsumptionTextAlias: current ? _aliases.CARD_CONSUMPTION_TEXT_CURRENT : _aliases.CARD_CONSUMPTION_TEXT_REMAINING
|
|
18
|
+
});
|
|
21
19
|
exports.getAliases = getAliases;
|
|
@@ -12,23 +12,26 @@ var _WithContextApi = _interopRequireDefault(require("../../../../../WithContext
|
|
|
12
12
|
var _aliases = require("../../../../../../shared/constants/aliases");
|
|
13
13
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
15
|
+
const HeaderConsumption = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
contextApiInfo,
|
|
18
|
+
startDate,
|
|
19
|
+
endDate
|
|
20
|
+
} = _ref;
|
|
21
|
+
const {
|
|
22
|
+
Label,
|
|
23
|
+
assets,
|
|
24
|
+
config
|
|
25
|
+
} = contextApiInfo;
|
|
26
|
+
const {
|
|
27
|
+
ofPreposition,
|
|
28
|
+
toPreposition
|
|
29
|
+
} = config.texts.commons;
|
|
30
|
+
const {
|
|
31
|
+
CalendarIcon
|
|
32
|
+
} = assets;
|
|
33
|
+
const parseDate = date => (0, _dayjs.default)(date, 'DD/MM/YYYY');
|
|
34
|
+
const formatDate = date => "".concat(parseDate(date).format('DD'), " ").concat(ofPreposition, " ").concat(parseDate(date).format('MMM'));
|
|
32
35
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
33
36
|
className: _stylesModule.default.container
|
|
34
37
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -44,5 +47,4 @@ HeaderConsumption.propTypes = {
|
|
|
44
47
|
startDate: _propTypes.string,
|
|
45
48
|
endDate: _propTypes.string
|
|
46
49
|
};
|
|
47
|
-
var _default = (0, _WithContextApi.default)()(HeaderConsumption);
|
|
48
|
-
exports.default = _default;
|
|
50
|
+
var _default = exports.default = (0, _WithContextApi.default)()(HeaderConsumption);
|
|
@@ -11,16 +11,22 @@ var _WithContextApi = _interopRequireDefault(require("../../../../../WithContext
|
|
|
11
11
|
var _aliases = require("../../../../../../shared/constants/aliases");
|
|
12
12
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
const HeaderSettlement = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
contextApiInfo,
|
|
17
|
+
date,
|
|
18
|
+
settlementNumber,
|
|
19
|
+
isRemaining
|
|
20
|
+
} = _ref;
|
|
21
|
+
const {
|
|
22
|
+
Label,
|
|
23
|
+
config
|
|
24
|
+
} = contextApiInfo;
|
|
25
|
+
const {
|
|
26
|
+
consumptionIncluded
|
|
27
|
+
} = config.texts;
|
|
28
|
+
const mainLabelAlias = isRemaining ? _aliases.HEADER_SETTLEMENT_REMAINING : _aliases.HEADER_SETTLEMENT;
|
|
29
|
+
const dateLabelAlias = isRemaining ? _aliases.HEADER_SETTLEMENT_REMAINING_DATE : _aliases.HEADER_SETTLEMENT_DATE;
|
|
24
30
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
25
31
|
className: "".concat(_stylesModule.default.container, " ").concat(isRemaining && _stylesModule.default.disabledContainer)
|
|
26
32
|
}, /*#__PURE__*/_react.default.createElement(Label, {
|
|
@@ -37,5 +43,4 @@ HeaderSettlement.propTypes = {
|
|
|
37
43
|
settlementNumber: _propTypes.number,
|
|
38
44
|
isRemaining: _propTypes.bool
|
|
39
45
|
};
|
|
40
|
-
var _default = (0, _WithContextApi.default)()(HeaderSettlement);
|
|
41
|
-
exports.default = _default;
|
|
46
|
+
var _default = exports.default = (0, _WithContextApi.default)()(HeaderSettlement);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -12,43 +11,49 @@ var _WithContextApi = _interopRequireDefault(require("../../../WithContextApi"))
|
|
|
12
11
|
var _Card = _interopRequireDefault(require("./components/Card"));
|
|
13
12
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
14
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
function _getRequireWildcardCache(
|
|
16
|
-
function _interopRequireWildcard(
|
|
14
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
16
|
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); }
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
17
|
+
const TimelineRow = _ref => {
|
|
18
|
+
let {
|
|
19
|
+
contextApiInfo,
|
|
20
|
+
cardTitle,
|
|
21
|
+
cardSubtitle,
|
|
22
|
+
cardDescription1,
|
|
23
|
+
cardDescription2,
|
|
24
|
+
startDate,
|
|
25
|
+
endDate,
|
|
26
|
+
unit,
|
|
27
|
+
value,
|
|
28
|
+
settlementNumber,
|
|
29
|
+
isConsumption,
|
|
30
|
+
isCurrent,
|
|
31
|
+
isRemaining,
|
|
32
|
+
currentIsFirstSettlement
|
|
33
|
+
} = _ref;
|
|
34
|
+
const {
|
|
35
|
+
assets,
|
|
36
|
+
config
|
|
37
|
+
} = contextApiInfo;
|
|
38
|
+
const {
|
|
39
|
+
colors
|
|
40
|
+
} = config;
|
|
41
|
+
const {
|
|
42
|
+
Minicheck,
|
|
43
|
+
MinicheckRemaining,
|
|
44
|
+
ClockIcon
|
|
45
|
+
} = assets;
|
|
46
|
+
const CardRender = (consumption, current, remaining, initialDate, finalDate) => /*#__PURE__*/_react.default.createElement(_Card.default, _extends({
|
|
47
|
+
contextApiInfo: contextApiInfo,
|
|
48
|
+
cardTitle: cardTitle,
|
|
49
|
+
cardSubtitle: cardSubtitle,
|
|
50
|
+
cardDescription1: cardDescription1,
|
|
51
|
+
cardDescription2: cardDescription2,
|
|
52
|
+
unit: unit,
|
|
53
|
+
value: value,
|
|
54
|
+
settlementNumber: settlementNumber,
|
|
55
|
+
currentIsFirstSettlement: currentIsFirstSettlement
|
|
56
|
+
}, consumption, current, remaining, initialDate, finalDate));
|
|
52
57
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
53
58
|
className: "".concat(isConsumption ? _stylesModule.default.consumptionContainerRow : _stylesModule.default.settlementContainerRow && settlementNumber === 1 ? _stylesModule.default.settlementOne : _stylesModule.default.settlementTwo)
|
|
54
59
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -104,5 +109,4 @@ TimelineRow.propTypes = {
|
|
|
104
109
|
isCurrent: _propTypes.bool,
|
|
105
110
|
isRemaining: _propTypes.bool
|
|
106
111
|
};
|
|
107
|
-
var _default = (0, _WithContextApi.default)()(TimelineRow);
|
|
108
|
-
exports.default = _default;
|
|
112
|
+
var _default = exports.default = (0, _WithContextApi.default)()(TimelineRow);
|