@widergy/utilitygo-smart-bill-web 2.2.2 → 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 +13 -0
- package/dist/components/Advice/index.js +10 -6
- package/dist/components/Amount/index.js +26 -21
- package/dist/components/Amount/utils.js +2 -5
- package/dist/components/Banner/index.js +10 -6
- package/dist/components/BarChart/constants.js +3 -3
- package/dist/components/BarChart/index.js +28 -22
- package/dist/components/BarChart/utils.js +17 -16
- package/dist/components/BillCalculation/components/ConceptCard/index.js +52 -45
- package/dist/components/BillCalculation/components/Glossary/index.js +48 -64
- package/dist/components/BillCalculation/components/Glossary/styles.module.scss +1 -0
- package/dist/components/BillCalculation/constants.js +1 -1
- package/dist/components/BillCalculation/index.js +48 -51
- package/dist/components/BillCalculation/utils.js +22 -22
- package/dist/components/BillSummary/components/BilledConcepts/components/Concept/index.js +25 -22
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/constants.js +1 -1
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/index.js +15 -15
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/styles.module.scss +3 -3
- package/dist/components/BillSummary/components/BilledConcepts/constants.js +13 -14
- package/dist/components/BillSummary/components/BilledConcepts/index.js +29 -39
- package/dist/components/BillSummary/components/BilledConcepts/utils.js +50 -69
- package/dist/components/BillSummary/index.js +70 -69
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/DataLine/index.js +8 -8
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/index.js +17 -10
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/utils.js +3 -2
- package/dist/components/ConsumptionComparison/components/ComparisonTable/constants.js +147 -133
- package/dist/components/ConsumptionComparison/components/ComparisonTable/index.js +16 -14
- package/dist/components/ConsumptionComparison/components/ComparisonTable/utils.js +88 -89
- package/dist/components/ConsumptionComparison/components/ConsumptionAdvice/index.js +21 -11
- package/dist/components/ConsumptionComparison/components/ConsumptionAdvice/utils.js +3 -2
- package/dist/components/ConsumptionComparison/components/PercentageComparison/index.js +21 -14
- package/dist/components/ConsumptionComparison/components/PercentageComparison/utils.js +15 -10
- package/dist/components/ConsumptionComparison/index.js +41 -45
- package/dist/components/ConsumptionEnergyDetails/components/ConsumptionEnergyComparison/index.js +27 -22
- package/dist/components/ConsumptionEnergyDetails/components/ConsumptionEnergyComparison/styles.module.scss +1 -1
- package/dist/components/ConsumptionEnergyDetails/components/ConsumptionInDaysLabel/index.js +18 -13
- package/dist/components/ConsumptionEnergyDetails/components/EnergyTotalConsumption/index.js +15 -12
- package/dist/components/ConsumptionEnergyDetails/components/PercentageComparison/index.js +21 -15
- package/dist/components/ConsumptionEnergyDetails/components/PercentageComparison/utils.js +3 -2
- package/dist/components/ConsumptionEnergyDetails/index.js +46 -41
- package/dist/components/ConsumptionEnergyDetails/styles.module.scss +2 -2
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/index.js +64 -60
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/utils.js +12 -13
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderConsumption/index.js +20 -17
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderSettlement/index.js +16 -10
- package/dist/components/ConsumptionIncluded/components/TimelineRow/index.js +42 -37
- package/dist/components/ConsumptionIncluded/components/TimelineRow/styles.module.scss +2 -2
- package/dist/components/ConsumptionIncluded/index.js +31 -32
- package/dist/components/ConsumptionIncluded/utils.js +32 -34
- package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/components/ReadingRow/index.js +14 -10
- package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/index.js +23 -20
- package/dist/components/ConsumptionPeriod/components/HistoryGraph/index.js +18 -26
- package/dist/components/ConsumptionPeriod/components/Reading/index.js +35 -32
- package/dist/components/ConsumptionPeriod/index.js +12 -8
- package/dist/components/ConsumptionPeriod/utils.js +14 -15
- package/dist/components/Date/index.js +12 -9
- package/dist/components/DebtState/index.js +14 -8
- package/dist/components/IconAndDetails/index.js +19 -17
- package/dist/components/Magnitude/index.js +15 -12
- package/dist/components/Magnitude/utils.js +3 -8
- package/dist/components/MainBillData/components/BillAlert/components/BillParticularConditions/index.js +18 -14
- package/dist/components/MainBillData/components/BillAlert/index.js +24 -31
- package/dist/components/MainBillData/components/BillBody/components/ClientData/index.js +19 -11
- package/dist/components/MainBillData/components/BillBody/components/Consumption/index.js +14 -11
- package/dist/components/MainBillData/components/BillBody/components/Consumption/utils.js +2 -3
- package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/index.js +23 -15
- package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/styles.module.scss +2 -2
- package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/utils.js +3 -2
- package/dist/components/MainBillData/components/BillBody/index.js +42 -44
- package/dist/components/MainBillData/components/BillHeader/components/TypeAndNumber/index.js +16 -11
- package/dist/components/MainBillData/components/BillHeader/index.js +29 -24
- package/dist/components/MainBillData/components/BillHeader/styles.module.scss +1 -1
- package/dist/components/MainBillData/index.js +7 -5
- package/dist/components/MainBillData/theme.js +8 -9
- package/dist/components/MainBillData/utils.js +2 -5
- package/dist/components/Period/index.js +54 -43
- package/dist/components/PowerProgresBar/components/PowerConsumption/index.js +15 -11
- package/dist/components/PowerProgresBar/index.js +31 -30
- package/dist/components/RateAndCategory/index.js +25 -27
- package/dist/components/RatesDefinition/components/BillRate/components/RatePrices/index.js +20 -13
- package/dist/components/RatesDefinition/components/BillRate/index.js +24 -14
- package/dist/components/RatesDefinition/components/BillRate/styles.module.scss +1 -1
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/Category/index.js +14 -9
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/components/IndicatorLabel/index.js +26 -21
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/index.js +11 -7
- 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 +11 -10
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Legend/index.js +21 -19
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Stages/index.js +34 -36
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/constants.js +2 -2
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/index.js +17 -30
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/utils.js +37 -48
- package/dist/components/RatesDefinition/components/CategoryByConsumption/constants.js +18 -18
- package/dist/components/RatesDefinition/components/CategoryByConsumption/index.js +23 -31
- package/dist/components/RatesDefinition/components/CategoryByConsumption/utils.js +2 -5
- package/dist/components/RatesDefinition/components/PurchasedRate/index.js +19 -13
- package/dist/components/RatesDefinition/index.js +20 -15
- package/dist/components/RatesDefinition/styles.module.scss +1 -1
- package/dist/components/SmartBillProvider/index.js +12 -34
- package/dist/components/StyledAmount/constants.js +1 -1
- package/dist/components/StyledAmount/index.js +19 -27
- package/dist/components/WithContextApi/index.js +18 -25
- package/dist/components/WithContextApi/layout.js +2 -2
- package/dist/components/WithSeason/index.js +6 -9
- package/dist/constants/deviceSizes.js +33 -18
- package/dist/constants/seasons.js +2 -2
- package/dist/index.js +14 -15
- package/dist/scss/variables/commonColors.module.scss +1 -1
- package/dist/shared/Context/index.js +7 -3
- package/dist/shared/constants/aliases.js +691 -556
- package/dist/shared/constants/consumptions.js +4 -4
- package/dist/shared/constants/periodicities.js +1 -1
- package/dist/shared/constants/rates.js +1 -1
- package/dist/shared/constants/readings.js +2 -2
- package/dist/shared/constants/seasons.js +2 -2
- package/dist/shared/constants/stagesGraph.js +4 -4
- package/dist/shared/types/assetsTypes.js +1 -1
- package/dist/shared/types/billDataTypes.js +5 -5
- package/dist/shared/types/componentsTypes.js +18 -10
- package/dist/shared/types/formattersTypes.js +1 -1
- package/dist/shared/types/rateStagesTypes.js +3 -3
- package/dist/shared/types/smartBillTypes.js +5 -10
- package/dist/shared/types/textsTypes.js +1 -1
- package/dist/shared/utils/billCalculation.js +11 -10
- package/dist/shared/utils/consumptions.js +34 -56
- package/dist/shared/utils/context.js +8 -6
- package/dist/shared/utils/expirations.js +2 -5
- package/dist/shared/utils/periods.js +20 -21
- package/dist/shared/utils/rates.js +2 -5
- package/dist/shared/utils/readings.js +4 -10
- package/dist/shared/utils/season.js +2 -5
- package/dist/shared/utils/stagesGraph.js +15 -15
- package/dist/utils/hooks.js +1 -1
- package/dist/utils.js +7 -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
|
});
|
|
@@ -19,47 +18,59 @@ var _DebtState = _interopRequireDefault(require("../DebtState"));
|
|
|
19
18
|
var _aliases = require("../../shared/constants/aliases");
|
|
20
19
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
21
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
22
|
-
function _getRequireWildcardCache(
|
|
23
|
-
function _interopRequireWildcard(
|
|
24
|
-
|
|
21
|
+
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); }
|
|
22
|
+
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; }
|
|
23
|
+
const Period = _ref => {
|
|
25
24
|
var _settlements$current;
|
|
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
|
-
|
|
25
|
+
let {
|
|
26
|
+
contextApiInfo,
|
|
27
|
+
billData,
|
|
28
|
+
currentPeriod,
|
|
29
|
+
multipleSettlements,
|
|
30
|
+
issuedDate,
|
|
31
|
+
alias
|
|
32
|
+
} = _ref;
|
|
33
|
+
const {
|
|
34
|
+
assets,
|
|
35
|
+
config,
|
|
36
|
+
Label,
|
|
37
|
+
Tooltip
|
|
38
|
+
} = contextApiInfo;
|
|
39
|
+
const {
|
|
40
|
+
texts,
|
|
41
|
+
formatters,
|
|
42
|
+
colors
|
|
43
|
+
} = config;
|
|
44
|
+
const {
|
|
45
|
+
periodFormatter
|
|
46
|
+
} = formatters;
|
|
47
|
+
const {
|
|
48
|
+
bimester,
|
|
49
|
+
ofPreposition,
|
|
50
|
+
settlement,
|
|
51
|
+
period,
|
|
52
|
+
issuedOnDate
|
|
53
|
+
} = texts.commons;
|
|
54
|
+
const desktopAlias = alias || _aliases.PERIOD;
|
|
55
|
+
const {
|
|
56
|
+
isDesktopSize
|
|
57
|
+
} = (0, _hooks.useScreenSize)();
|
|
58
|
+
const debtStatusLabel = billData === null || billData === void 0 ? void 0 : billData.debt_status_label;
|
|
59
|
+
const debtStatusValidation = !!debtStatusLabel;
|
|
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 {
|
|
63
|
+
number: periodNumber,
|
|
64
|
+
year
|
|
65
|
+
} = currentPeriod;
|
|
66
|
+
const currentSettlement = settlements === null || settlements === void 0 || (_settlements$current = settlements.current) === null || _settlements$current === void 0 ? void 0 : _settlements$current.number;
|
|
67
|
+
const totalSettlements = settlements === null || settlements === void 0 ? void 0 : settlements.total_settlements;
|
|
68
|
+
const startDate = (0, _dayjs.default)(settlements === null || settlements === void 0 ? void 0 : settlements.start_date).format('DD/MM');
|
|
69
|
+
const endDate = (0, _dayjs.default)(settlements === null || settlements === void 0 ? void 0 : settlements.end_date).format('DD/MM');
|
|
70
|
+
const periodicityLabel = "".concat(multipleSettlements ? (0, _string.stringToCompareWithoutAccentsInclusive)(periodicity, _periodicities.PERIODICITY.BIMONTHLY) ? bimester : '-' : period, " ").concat((0, _utils.stringOrDash)(periodNumber));
|
|
71
|
+
const settlementLabel = "".concat(settlement, " ").concat((0, _utils.numberOrDash)(currentSettlement), " ").concat(ofPreposition, " ").concat((0, _utils.numberOrDash)(totalSettlements));
|
|
72
|
+
const issuedDateLabel = "".concat((0, _dayjs.default)(issuedDate, 'YYYY-MM-DD').format('DD/MM/YYYY'));
|
|
73
|
+
const issuedOnDateLabel = /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
63
74
|
className: _stylesModule.default.issueDateContainer
|
|
64
75
|
}, /*#__PURE__*/_react.default.createElement(Label, {
|
|
65
76
|
className: _stylesModule.default.issueDate,
|
|
@@ -67,8 +78,8 @@ var Period = function Period(_ref) {
|
|
|
67
78
|
}, "".concat(issuedOnDate, ":\xA0")), /*#__PURE__*/_react.default.createElement(Label, {
|
|
68
79
|
alias: _aliases.PERIOD_ISSUED_DATE
|
|
69
80
|
}, issuedDateLabel)));
|
|
70
|
-
|
|
71
|
-
|
|
81
|
+
const yearAndPeriodicityLabel = "".concat((0, _utils.stringOrDash)(year), " - ").concat(periodicityLabel);
|
|
82
|
+
const bimesterOfYearLabel = "".concat(periodicityLabel, " ").concat(ofPreposition, " ").concat((0, _utils.stringOrDash)(year));
|
|
72
83
|
return periodFormatter ? /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
73
84
|
className: issuedDate ? _stylesModule.default.withIssuedDateContainer : _stylesModule.default.withOutIssuedDateContainer
|
|
74
85
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -12,17 +12,21 @@ 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
14
|
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); }
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
15
|
+
const PowerConsumption = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
contextApiInfo,
|
|
18
|
+
consumption,
|
|
19
|
+
unit,
|
|
20
|
+
text,
|
|
21
|
+
isHired,
|
|
22
|
+
powerExceeded
|
|
23
|
+
} = _ref;
|
|
24
|
+
const {
|
|
25
|
+
Label
|
|
26
|
+
} = contextApiInfo;
|
|
27
|
+
const alias = !isHired ? _aliases.POWER_CONSUMPTION : _aliases.POWER_CONSUMPTION_GRAY;
|
|
28
|
+
const unitAlias = !isHired ? _aliases.POWER_CONSUMPTION_UNIT : _aliases.POWER_CONSUMPTION_UNIT_GRAY;
|
|
29
|
+
const textAlias = !isHired ? _aliases.POWER_CONSUMPTION_TEXT : _aliases.POWER_CONSUMPTION_TEXT_GRAY;
|
|
26
30
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
27
31
|
className: _stylesModule.default.powerLabel
|
|
28
32
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -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,35 +13,37 @@ var _utils = require("../../utils");
|
|
|
14
13
|
var _PowerConsumption = _interopRequireDefault(require("./components/PowerConsumption"));
|
|
15
14
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
16
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
function _getRequireWildcardCache(
|
|
18
|
-
function _interopRequireWildcard(
|
|
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
|
-
};
|
|
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; }
|
|
18
|
+
const PowerProgresBar = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
contextApiInfo,
|
|
21
|
+
hiredPowerConsumption,
|
|
22
|
+
registeredPowerConsumption,
|
|
23
|
+
exceededPower
|
|
24
|
+
} = _ref;
|
|
25
|
+
const {
|
|
26
|
+
ProgressBar,
|
|
27
|
+
config,
|
|
28
|
+
Label,
|
|
29
|
+
assets
|
|
30
|
+
} = contextApiInfo;
|
|
31
|
+
const {
|
|
32
|
+
texts
|
|
33
|
+
} = config;
|
|
34
|
+
const {
|
|
35
|
+
RedAlertIcon
|
|
36
|
+
} = assets;
|
|
37
|
+
const powerExceeded = exceededPower.alert_message;
|
|
38
|
+
const powerConsumption = (consumption, unit, text, isHired) => /*#__PURE__*/_react.default.createElement(_PowerConsumption.default, {
|
|
39
|
+
consumption: consumption,
|
|
40
|
+
unit: unit,
|
|
41
|
+
text: text,
|
|
42
|
+
isHired: isHired,
|
|
43
|
+
powerExceeded: !!powerExceeded
|
|
44
|
+
});
|
|
45
|
+
const HiredPowerLabel = () => powerConsumption(hiredPowerConsumption.value, hiredPowerConsumption.unit, texts.commons.hired, true);
|
|
46
|
+
const RegisteredPowerLabel = () => powerConsumption(registeredPowerConsumption.value, registeredPowerConsumption.unit, texts.commons.registered);
|
|
46
47
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
47
48
|
className: _stylesModule.default.container
|
|
48
49
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -1,11 +1,10 @@
|
|
|
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
|
});
|
|
7
6
|
exports.default = void 0;
|
|
8
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
8
|
var _propTypes = require("prop-types");
|
|
10
9
|
var _smartBillTypes = require("../../shared/types/smartBillTypes");
|
|
11
10
|
var _WithContextApi = _interopRequireDefault(require("../WithContextApi"));
|
|
@@ -13,31 +12,30 @@ 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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
Label
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
};
|
|
15
|
+
const RatePrices = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
contextApiInfo,
|
|
18
|
+
rate,
|
|
19
|
+
category,
|
|
20
|
+
title,
|
|
21
|
+
classes = {},
|
|
22
|
+
showCategory
|
|
23
|
+
} = _ref;
|
|
24
|
+
const {
|
|
25
|
+
config,
|
|
26
|
+
Label
|
|
27
|
+
} = contextApiInfo;
|
|
28
|
+
const {
|
|
29
|
+
commons
|
|
30
|
+
} = config.texts;
|
|
31
|
+
const Title = () => /*#__PURE__*/_react.default.createElement(Label, {
|
|
32
|
+
alias: _aliases.TITLE,
|
|
33
|
+
className: "".concat(classes.title)
|
|
34
|
+
}, title);
|
|
35
|
+
const Category = () => /*#__PURE__*/_react.default.createElement(Label, {
|
|
36
|
+
alias: _aliases.CATEGORY,
|
|
37
|
+
className: "".concat(_stylesModule.default.category, " ").concat(classes.category)
|
|
38
|
+
}, "".concat(commons.category, " ").concat((0, _utils.stringOrDash)(category)));
|
|
41
39
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
42
40
|
className: "".concat(_stylesModule.default.container, " ").concat(classes.container)
|
|
43
41
|
}, showCategory ? /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -12,19 +12,26 @@ var _StyledAmount = _interopRequireDefault(require("../../../../../StyledAmount"
|
|
|
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
|
-
|
|
15
|
+
const RateAndCategory = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
contextApiInfo,
|
|
18
|
+
fixedChargeValue,
|
|
19
|
+
variableChargeValue
|
|
20
|
+
} = _ref;
|
|
21
|
+
const {
|
|
22
|
+
config,
|
|
23
|
+
ExternalLink,
|
|
24
|
+
Label
|
|
25
|
+
} = contextApiInfo;
|
|
26
|
+
const {
|
|
27
|
+
ratesTableLink
|
|
28
|
+
} = config.externalLinks;
|
|
29
|
+
const {
|
|
30
|
+
fixedCharge,
|
|
31
|
+
variableCharge,
|
|
32
|
+
currency,
|
|
33
|
+
seeRatesTable
|
|
34
|
+
} = config.texts.ratesDefinition;
|
|
28
35
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
29
36
|
className: _stylesModule.default.container
|
|
30
37
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -12,20 +12,30 @@ var _aliases = require("../../../../shared/constants/aliases");
|
|
|
12
12
|
var _RatePrices = _interopRequireDefault(require("./components/RatePrices"));
|
|
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
|
-
|
|
15
|
+
const BillRate = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
contextApiInfo,
|
|
18
|
+
rate,
|
|
19
|
+
category,
|
|
20
|
+
fixedCharge,
|
|
21
|
+
variableCharge
|
|
22
|
+
} = _ref;
|
|
23
|
+
const {
|
|
24
|
+
assets,
|
|
25
|
+
config,
|
|
26
|
+
Label,
|
|
27
|
+
Tooltip
|
|
28
|
+
} = contextApiInfo;
|
|
29
|
+
const {
|
|
30
|
+
texts,
|
|
31
|
+
colors
|
|
32
|
+
} = config;
|
|
33
|
+
const {
|
|
34
|
+
rateFormatter
|
|
35
|
+
} = config.formatters;
|
|
36
|
+
const {
|
|
37
|
+
billRatePrices
|
|
38
|
+
} = config.texts.ratesDefinition;
|
|
29
39
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
30
40
|
className: _stylesModule.default.container
|
|
31
41
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -12,15 +12,20 @@ var _utils = require("../../../../../../utils");
|
|
|
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
|
-
|
|
15
|
+
const Category = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
contextApiInfo,
|
|
18
|
+
category,
|
|
19
|
+
wrap
|
|
20
|
+
} = _ref;
|
|
21
|
+
const {
|
|
22
|
+
config,
|
|
23
|
+
Label
|
|
24
|
+
} = contextApiInfo;
|
|
25
|
+
const {
|
|
26
|
+
commons,
|
|
27
|
+
ratesDefinition
|
|
28
|
+
} = config.texts;
|
|
24
29
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
25
30
|
className: wrap ? _stylesModule.default.containerWrap : _stylesModule.default.container
|
|
26
31
|
}, /*#__PURE__*/_react.default.createElement(Label, {
|
|
@@ -12,27 +12,32 @@ var _Magnitude = _interopRequireDefault(require("../../../../../../../../../Magn
|
|
|
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
|
-
classes =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
15
|
+
const IndicatorLabel = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
contextApiInfo,
|
|
18
|
+
value,
|
|
19
|
+
unit,
|
|
20
|
+
labelOffset,
|
|
21
|
+
classes = {}
|
|
22
|
+
} = _ref;
|
|
23
|
+
const {
|
|
24
|
+
assets,
|
|
25
|
+
config,
|
|
26
|
+
Label
|
|
27
|
+
} = contextApiInfo;
|
|
28
|
+
const {
|
|
29
|
+
texts,
|
|
30
|
+
colors
|
|
31
|
+
} = config;
|
|
32
|
+
const {
|
|
33
|
+
indicatorLabel
|
|
34
|
+
} = texts.ratesDefinition;
|
|
35
|
+
const EnergyIcon = () => /*#__PURE__*/_react.default.createElement(assets.EnergyIcon, {
|
|
36
|
+
className: _stylesModule.default.icon,
|
|
37
|
+
style: {
|
|
38
|
+
fill: colors.primary
|
|
39
|
+
}
|
|
40
|
+
});
|
|
36
41
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
37
42
|
style: {
|
|
38
43
|
transform: "translate(".concat(labelOffset, ")")
|
|
@@ -14,13 +14,17 @@ var _IndicatorLabel = _interopRequireDefault(require("./components/IndicatorLabe
|
|
|
14
14
|
var _utils = require("./utils");
|
|
15
15
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
const Indicator = _ref => {
|
|
18
|
+
let {
|
|
19
|
+
indicatorPosition,
|
|
20
|
+
value,
|
|
21
|
+
unit,
|
|
22
|
+
rateStages,
|
|
23
|
+
contextApiInfo
|
|
24
|
+
} = _ref;
|
|
25
|
+
const {
|
|
26
|
+
primary
|
|
27
|
+
} = contextApiInfo.config.colors;
|
|
24
28
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
25
29
|
className: _stylesModule.default.container
|
|
26
30
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -6,16 +6,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getLabelOffset = void 0;
|
|
7
7
|
var _constants = require("../../../../constants");
|
|
8
8
|
var _utils = require("../../../../utils");
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
const relativePorcentageValue = (value, rateStages) => {
|
|
10
|
+
const globalLastSubRate = rateStages.at(-1).sub_rate_stages.at(-1).range;
|
|
11
|
+
const globalMaxValue = globalLastSubRate.at(-1) || globalLastSubRate.at(0) + _constants.DEFAULT_INFINITE_SUB_STAGE_RANGE_WIDTH;
|
|
12
|
+
const clippedMaxValue = value > globalMaxValue ? globalMaxValue : value;
|
|
13
13
|
return clippedMaxValue / globalMaxValue * 100;
|
|
14
14
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
const getLabelOffset = (value, rateStages) => {
|
|
16
|
+
const rateIndex = rateStages.indexOf((0, _utils.getCurrentStage)(value, rateStages));
|
|
17
|
+
const isFirstRate = rateIndex === 0;
|
|
18
|
+
const isLastRate = rateIndex === rateStages.length - 1;
|
|
19
|
+
const baseOffset = "".concat(relativePorcentageValue(value, rateStages), "%");
|
|
20
20
|
return isLastRate ? "calc(-".concat(baseOffset, " + ").concat(_constants.INDICATOR_LABEL_LAST_OFFSET, ")") : isFirstRate ? "calc(-".concat(baseOffset, " - ").concat(_constants.INDICATOR_LABEL_FIRST_OFFSET, ")") : _constants.INDICATOR_LABEL_DEFAULT_OFFSET;
|
|
21
|
-
};
|
|
21
|
+
};
|
|
22
|
+
exports.getLabelOffset = getLabelOffset;
|
|
@@ -10,27 +10,29 @@ var _WithContextApi = _interopRequireDefault(require("../../../../../../../WithC
|
|
|
10
10
|
var _smartBillTypes = require("../../../../../../../../shared/types/smartBillTypes");
|
|
11
11
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
const Legend = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
stagesFormattedData,
|
|
16
|
+
contextApiInfo
|
|
17
|
+
} = _ref;
|
|
18
|
+
const {
|
|
19
|
+
Label,
|
|
20
|
+
config
|
|
21
|
+
} = contextApiInfo;
|
|
22
|
+
const {
|
|
23
|
+
texts
|
|
24
|
+
} = config;
|
|
19
25
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
20
26
|
className: _stylesModule.default.legendContainer
|
|
21
|
-
}, stagesFormattedData.map(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
weight: "medium"
|
|
31
|
-
}, substage.legend));
|
|
32
|
-
});
|
|
33
|
-
}));
|
|
27
|
+
}, stagesFormattedData.map(stage => stage.sub_rate_stages.map(substage => /*#__PURE__*/_react.default.createElement("div", {
|
|
28
|
+
className: _stylesModule.default.legendLine
|
|
29
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
30
|
+
className: _stylesModule.default.leftLabels
|
|
31
|
+
}, /*#__PURE__*/_react.default.createElement(Label, {
|
|
32
|
+
weight: "medium"
|
|
33
|
+
}, substage.name), /*#__PURE__*/_react.default.createElement(Label, null, substage.i === 0 ? texts.ratesDefinition.consumptionUpToDesktop : texts.ratesDefinition.consumptionMoreThanDesktop)), /*#__PURE__*/_react.default.createElement(Label, {
|
|
34
|
+
weight: "medium"
|
|
35
|
+
}, substage.legend)))));
|
|
34
36
|
};
|
|
35
37
|
Legend.propTypes = {
|
|
36
38
|
contextApiInfo: _smartBillTypes.contextApiInfoTypes,
|