@widergy/utilitygo-smart-bill-web 1.10.0 → 1.12.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.
Files changed (141) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/components/Advice/index.js +6 -10
  3. package/dist/components/Amount/index.js +21 -26
  4. package/dist/components/Amount/utils.js +5 -1
  5. package/dist/components/Banner/index.js +6 -10
  6. package/dist/components/BarChart/constants.js +3 -3
  7. package/dist/components/BarChart/index.js +25 -28
  8. package/dist/components/BarChart/utils.js +15 -15
  9. package/dist/components/BillCalculation/components/ConceptCard/index.js +48 -47
  10. package/dist/components/BillCalculation/constants.js +1 -1
  11. package/dist/components/BillCalculation/index.js +54 -44
  12. package/dist/components/BillCalculation/utils.js +14 -17
  13. package/dist/components/BillSummary/components/BilledConcepts/components/Concept/index.js +25 -26
  14. package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/constants.js +9 -3
  15. package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/index.js +31 -34
  16. package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/styles.module.scss +2 -2
  17. package/dist/components/BillSummary/components/BilledConcepts/constants.js +14 -12
  18. package/dist/components/BillSummary/components/BilledConcepts/index.js +49 -31
  19. package/dist/components/BillSummary/components/BilledConcepts/utils.js +76 -44
  20. package/dist/components/BillSummary/index.js +78 -76
  21. package/dist/components/ConsumptionComparison/components/ComparisonTable/components/DataLine/index.js +8 -8
  22. package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/index.js +12 -17
  23. package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/utils.js +1 -1
  24. package/dist/components/ConsumptionComparison/components/ComparisonTable/constants.js +135 -148
  25. package/dist/components/ConsumptionComparison/components/ComparisonTable/index.js +14 -16
  26. package/dist/components/ConsumptionComparison/components/ComparisonTable/utils.js +94 -89
  27. package/dist/components/ConsumptionComparison/components/ConsumptionAdvice/index.js +11 -21
  28. package/dist/components/ConsumptionComparison/components/ConsumptionAdvice/utils.js +1 -1
  29. package/dist/components/ConsumptionComparison/components/PercentageComparison/index.js +16 -21
  30. package/dist/components/ConsumptionComparison/components/PercentageComparison/utils.js +9 -13
  31. package/dist/components/ConsumptionComparison/index.js +56 -42
  32. package/dist/components/ConsumptionEnergyDetails/components/ConsumptionEnergyComparison/index.js +26 -30
  33. package/dist/components/ConsumptionEnergyDetails/components/ConsumptionInDaysLabel/index.js +13 -18
  34. package/dist/components/ConsumptionEnergyDetails/components/EnergyTotalConsumption/index.js +15 -17
  35. package/dist/components/ConsumptionEnergyDetails/components/PercentageComparison/index.js +17 -21
  36. package/dist/components/ConsumptionEnergyDetails/components/PercentageComparison/utils.js +1 -1
  37. package/dist/components/ConsumptionEnergyDetails/index.js +47 -51
  38. package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/index.js +65 -66
  39. package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/utils.js +13 -11
  40. package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderConsumption/index.js +19 -22
  41. package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderSettlement/index.js +10 -16
  42. package/dist/components/ConsumptionIncluded/components/TimelineRow/index.js +39 -43
  43. package/dist/components/ConsumptionIncluded/index.js +36 -34
  44. package/dist/components/ConsumptionIncluded/utils.js +33 -29
  45. package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/components/ReadingRow/index.js +10 -14
  46. package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/index.js +22 -25
  47. package/dist/components/ConsumptionPeriod/components/HistoryGraph/index.js +34 -18
  48. package/dist/components/ConsumptionPeriod/components/Reading/index.js +34 -37
  49. package/dist/components/ConsumptionPeriod/index.js +8 -12
  50. package/dist/components/ConsumptionPeriod/utils.js +15 -13
  51. package/dist/components/Date/index.js +9 -12
  52. package/dist/components/DebtState/index.js +8 -14
  53. package/dist/components/IconAndDetails/index.js +17 -19
  54. package/dist/components/Magnitude/index.js +12 -15
  55. package/dist/components/Magnitude/utils.js +8 -2
  56. package/dist/components/MainBillData/components/BillAlert/components/BillParticularConditions/index.js +16 -20
  57. package/dist/components/MainBillData/components/BillAlert/index.js +45 -28
  58. package/dist/components/MainBillData/components/BillBody/components/ClientData/index.js +11 -19
  59. package/dist/components/MainBillData/components/BillBody/components/Consumption/index.js +11 -14
  60. package/dist/components/MainBillData/components/BillBody/components/Consumption/utils.js +3 -1
  61. package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/index.js +15 -23
  62. package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/utils.js +1 -1
  63. package/dist/components/MainBillData/components/BillBody/index.js +50 -45
  64. package/dist/components/MainBillData/components/BillHeader/components/TypeAndNumber/index.js +9 -15
  65. package/dist/components/MainBillData/components/BillHeader/index.js +26 -29
  66. package/dist/components/MainBillData/index.js +5 -7
  67. package/dist/components/MainBillData/theme.js +9 -7
  68. package/dist/components/MainBillData/utils.js +5 -1
  69. package/dist/components/Period/index.js +47 -55
  70. package/dist/components/PowerProgresBar/components/PowerConsumption/index.js +11 -15
  71. package/dist/components/PowerProgresBar/index.js +36 -36
  72. package/dist/components/RateAndCategory/index.js +31 -30
  73. package/dist/components/RatesDefinition/components/BillRate/components/RatePrices/index.js +13 -20
  74. package/dist/components/RatesDefinition/components/BillRate/index.js +14 -24
  75. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/Category/index.js +9 -14
  76. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/components/IndicatorLabel/index.js +21 -26
  77. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/index.js +13 -19
  78. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/styles.module.scss +1 -4
  79. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/utils.js +13 -56
  80. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Legend/index.js +50 -0
  81. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Legend/styles.module.scss +34 -0
  82. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Stages/index.js +65 -0
  83. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Stages/styles.module.scss +88 -0
  84. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/constants.js +6 -37
  85. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/index.js +51 -16
  86. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/styles.module.scss +4 -1
  87. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/utils.js +68 -23
  88. package/dist/components/RatesDefinition/components/CategoryByConsumption/constants.js +42 -0
  89. package/dist/components/RatesDefinition/components/CategoryByConsumption/index.js +45 -36
  90. package/dist/components/RatesDefinition/components/CategoryByConsumption/utils.js +16 -0
  91. package/dist/components/RatesDefinition/components/PurchasedRate/index.js +13 -19
  92. package/dist/components/RatesDefinition/index.js +15 -20
  93. package/dist/components/SmartBillProvider/index.js +47 -12
  94. package/dist/components/StyledAmount/constants.js +1 -1
  95. package/dist/components/StyledAmount/index.js +35 -19
  96. package/dist/components/WithContextApi/index.js +27 -16
  97. package/dist/components/WithContextApi/layout.js +2 -2
  98. package/dist/components/WithSeason/index.js +9 -5
  99. package/dist/constants/deviceSizes.js +17 -27
  100. package/dist/constants/seasons.js +2 -2
  101. package/dist/index.js +16 -14
  102. package/dist/shared/Context/index.js +3 -5
  103. package/dist/shared/constants/aliases.js +550 -683
  104. package/dist/shared/constants/components.js +2 -1
  105. package/dist/shared/constants/consumptions.js +4 -4
  106. package/dist/shared/constants/periodicities.js +1 -1
  107. package/dist/shared/constants/rates.js +1 -1
  108. package/dist/shared/constants/readings.js +2 -2
  109. package/dist/shared/constants/seasons.js +2 -2
  110. package/dist/shared/constants/stagesGraph.js +4 -4
  111. package/dist/shared/types/assetsTypes.js +1 -1
  112. package/dist/shared/types/billDataTypes.js +4 -4
  113. package/dist/shared/types/componentsTypes.js +13 -18
  114. package/dist/shared/types/formattersTypes.js +1 -1
  115. package/dist/shared/types/rateStagesTypes.js +4 -4
  116. package/dist/shared/types/smartBillTypes.js +10 -5
  117. package/dist/shared/types/textsTypes.js +1 -1
  118. package/dist/shared/utils/billCalculation.js +9 -9
  119. package/dist/shared/utils/consumptions.js +62 -28
  120. package/dist/shared/utils/context.js +8 -7
  121. package/dist/shared/utils/expirations.js +5 -1
  122. package/dist/shared/utils/periods.js +20 -14
  123. package/dist/shared/utils/rates.js +5 -1
  124. package/dist/shared/utils/readings.js +10 -2
  125. package/dist/shared/utils/season.js +5 -1
  126. package/dist/shared/utils/stagesGraph.js +15 -11
  127. package/dist/utils/hooks.js +5 -37
  128. package/dist/utils.js +8 -4
  129. package/package.json +2 -2
  130. package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/utils.js +0 -27
  131. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/components/Stage/components/LimitsLine/index.js +0 -21
  132. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/components/Stage/components/LimitsLine/styles.module.scss +0 -15
  133. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/components/Stage/components/SubStage/index.js +0 -69
  134. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/components/Stage/components/SubStage/styles.module.scss +0 -5
  135. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/components/Stage/components/SubStage/utils.js +0 -12
  136. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/components/Stage/index.js +0 -68
  137. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/components/Stage/styles.module.scss +0 -32
  138. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/index.js +0 -59
  139. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/styles.module.scss +0 -3
  140. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/LegendItem/index.js +0 -83
  141. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/LegendItem/styles.module.scss +0 -57
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
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
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -33,63 +35,53 @@ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
33
35
 
34
36
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
35
37
 
36
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
38
+ 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); }
37
39
 
38
- 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; }
40
+ 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; }
39
41
 
40
- const Period = _ref => {
42
+ var Period = function Period(_ref) {
41
43
  var _settlements$current;
42
44
 
43
- let {
44
- contextApiInfo,
45
- billData,
46
- currentPeriod,
47
- multipleSettlements,
48
- issueedDate,
49
- alias
50
- } = _ref;
51
- const {
52
- assets,
53
- config,
54
- Label,
55
- Tooltip
56
- } = contextApiInfo;
57
- const {
58
- texts,
59
- formatters,
60
- colors
61
- } = config;
62
- const {
63
- periodFormatter
64
- } = formatters;
65
- const {
66
- bimester,
67
- ofPreposition,
68
- settlement,
69
- period,
70
- issuedOnDate
71
- } = texts.commons;
72
- const desktopAlias = alias || _aliases.PERIOD;
73
- const {
74
- isDesktopSize
75
- } = (0, _hooks.useScreenSize)();
76
- const debtStatusLabel = billData === null || billData === void 0 ? void 0 : billData.debt_status_label;
77
- const debtStatusValidation = !!debtStatusLabel;
78
- const settlements = currentPeriod === null || currentPeriod === void 0 ? void 0 : currentPeriod.settlements;
79
- const periodicity = settlements === null || settlements === void 0 ? void 0 : settlements.periodicity;
80
- const {
81
- number: periodNumber,
82
- year
83
- } = currentPeriod;
84
- const currentSettlement = settlements === null || settlements === void 0 ? void 0 : (_settlements$current = settlements.current) === null || _settlements$current === void 0 ? void 0 : _settlements$current.number;
85
- const totalSettlements = settlements === null || settlements === void 0 ? void 0 : settlements.total_settlements;
86
- const startDate = (0, _dayjs.default)(settlements === null || settlements === void 0 ? void 0 : settlements.start_date).format('DD/MM');
87
- const endDate = (0, _dayjs.default)(settlements === null || settlements === void 0 ? void 0 : settlements.end_date).format('DD/MM');
88
- const periodicityLabel = "".concat(multipleSettlements ? (0, _string.stringToCompareWithoutAccentsInclusive)(periodicity, _periodicities.PERIODICITY.BIMONTHLY) ? bimester : '-' : period, " ").concat((0, _utils.stringOrDash)(periodNumber));
89
- const settlementLabel = "".concat(settlement, " ").concat((0, _utils.numberOrDash)(currentSettlement), " ").concat(ofPreposition, " ").concat((0, _utils.numberOrDash)(totalSettlements));
90
- const issuedDateLabel = "".concat((0, _dayjs.default)(issueedDate, 'YYYY-MM-DD').format('DD/MM/YYYY'));
91
-
92
- const issuedOnDateLabel = /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
45
+ var contextApiInfo = _ref.contextApiInfo,
46
+ billData = _ref.billData,
47
+ currentPeriod = _ref.currentPeriod,
48
+ multipleSettlements = _ref.multipleSettlements,
49
+ issueedDate = _ref.issueedDate,
50
+ alias = _ref.alias;
51
+ var assets = contextApiInfo.assets,
52
+ config = contextApiInfo.config,
53
+ Label = contextApiInfo.Label,
54
+ Tooltip = contextApiInfo.Tooltip;
55
+ var texts = config.texts,
56
+ formatters = config.formatters,
57
+ colors = config.colors;
58
+ var periodFormatter = formatters.periodFormatter;
59
+ var _texts$commons = texts.commons,
60
+ bimester = _texts$commons.bimester,
61
+ ofPreposition = _texts$commons.ofPreposition,
62
+ settlement = _texts$commons.settlement,
63
+ period = _texts$commons.period,
64
+ issuedOnDate = _texts$commons.issuedOnDate;
65
+ var desktopAlias = alias || _aliases.PERIOD;
66
+
67
+ var _useScreenSize = (0, _hooks.useScreenSize)(),
68
+ isDesktopSize = _useScreenSize.isDesktopSize;
69
+
70
+ var debtStatusLabel = billData === null || billData === void 0 ? void 0 : billData.debt_status_label;
71
+ var debtStatusValidation = !!debtStatusLabel;
72
+ var settlements = currentPeriod === null || currentPeriod === void 0 ? void 0 : currentPeriod.settlements;
73
+ var periodicity = settlements === null || settlements === void 0 ? void 0 : settlements.periodicity;
74
+ var periodNumber = currentPeriod.number,
75
+ year = currentPeriod.year;
76
+ var currentSettlement = settlements === null || settlements === void 0 ? void 0 : (_settlements$current = settlements.current) === null || _settlements$current === void 0 ? void 0 : _settlements$current.number;
77
+ var totalSettlements = settlements === null || settlements === void 0 ? void 0 : settlements.total_settlements;
78
+ var startDate = (0, _dayjs.default)(settlements === null || settlements === void 0 ? void 0 : settlements.start_date).format('DD/MM');
79
+ var endDate = (0, _dayjs.default)(settlements === null || settlements === void 0 ? void 0 : settlements.end_date).format('DD/MM');
80
+ var periodicityLabel = "".concat(multipleSettlements ? (0, _string.stringToCompareWithoutAccentsInclusive)(periodicity, _periodicities.PERIODICITY.BIMONTHLY) ? bimester : '-' : period, " ").concat((0, _utils.stringOrDash)(periodNumber));
81
+ var settlementLabel = "".concat(settlement, " ").concat((0, _utils.numberOrDash)(currentSettlement), " ").concat(ofPreposition, " ").concat((0, _utils.numberOrDash)(totalSettlements));
82
+ var issuedDateLabel = "".concat((0, _dayjs.default)(issueedDate, 'YYYY-MM-DD').format('DD/MM/YYYY'));
83
+
84
+ var issuedOnDateLabel = /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
93
85
  className: _stylesModule.default.issueDateContainer
94
86
  }, /*#__PURE__*/_react.default.createElement(Label, {
95
87
  className: _stylesModule.default.issueDate,
@@ -98,8 +90,8 @@ const Period = _ref => {
98
90
  alias: _aliases.PERIOD_ISSUED_DATE
99
91
  }, issuedDateLabel)));
100
92
 
101
- const yearAndPeriodicityLabel = "".concat((0, _utils.stringOrDash)(year), " - ").concat(periodicityLabel);
102
- const bimesterOfYearLabel = "".concat(periodicityLabel, " ").concat(ofPreposition, " ").concat((0, _utils.stringOrDash)(year));
93
+ var yearAndPeriodicityLabel = "".concat((0, _utils.stringOrDash)(year), " - ").concat(periodicityLabel);
94
+ var bimesterOfYearLabel = "".concat(periodicityLabel, " ").concat(ofPreposition, " ").concat((0, _utils.stringOrDash)(year));
103
95
  return periodFormatter ? /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
104
96
  className: issueedDate ? _stylesModule.default.withIssuedDateContainer : _stylesModule.default.withOutIssuedDateContainer
105
97
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -19,21 +19,17 @@ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
19
19
 
20
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
21
 
22
- const PowerConsumption = _ref => {
23
- let {
24
- contextApiInfo,
25
- consumption,
26
- unit,
27
- text,
28
- isHired,
29
- powerExceeded
30
- } = _ref;
31
- const {
32
- Label
33
- } = contextApiInfo;
34
- const alias = !isHired ? _aliases.POWER_CONSUMPTION : _aliases.POWER_CONSUMPTION_GRAY;
35
- const unitAlias = !isHired ? _aliases.POWER_CONSUMPTION_UNIT : _aliases.POWER_CONSUMPTION_UNIT_GRAY;
36
- const textAlias = !isHired ? _aliases.POWER_CONSUMPTION_TEXT : _aliases.POWER_CONSUMPTION_TEXT_GRAY;
22
+ var PowerConsumption = function PowerConsumption(_ref) {
23
+ var contextApiInfo = _ref.contextApiInfo,
24
+ consumption = _ref.consumption,
25
+ unit = _ref.unit,
26
+ text = _ref.text,
27
+ isHired = _ref.isHired,
28
+ powerExceeded = _ref.powerExceeded;
29
+ var Label = contextApiInfo.Label;
30
+ var alias = !isHired ? _aliases.POWER_CONSUMPTION : _aliases.POWER_CONSUMPTION_GRAY;
31
+ var unitAlias = !isHired ? _aliases.POWER_CONSUMPTION_UNIT : _aliases.POWER_CONSUMPTION_UNIT_GRAY;
32
+ var textAlias = !isHired ? _aliases.POWER_CONSUMPTION_TEXT : _aliases.POWER_CONSUMPTION_TEXT_GRAY;
37
33
  return /*#__PURE__*/_react.default.createElement("div", {
38
34
  className: _stylesModule.default.powerLabel
39
35
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
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
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -23,42 +25,40 @@ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
23
25
 
24
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
27
 
26
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
27
-
28
- 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
- const PowerProgresBar = _ref => {
31
- let {
32
- contextApiInfo,
33
- hiredPowerConsumption,
34
- registeredPowerConsumption,
35
- exceededPower
36
- } = _ref;
37
- const {
38
- ProgressBar,
39
- config,
40
- Label,
41
- assets
42
- } = contextApiInfo;
43
- const {
44
- texts
45
- } = config;
46
- const {
47
- RedAlertIcon
48
- } = assets;
49
- const powerExceeded = exceededPower.alert_message;
50
-
51
- const powerConsumption = (consumption, unit, text, isHired) => /*#__PURE__*/_react.default.createElement(_PowerConsumption.default, {
52
- consumption: consumption,
53
- unit: unit,
54
- text: text,
55
- isHired: isHired,
56
- powerExceeded: powerExceeded
57
- });
58
-
59
- const HiredPowerLabel = () => powerConsumption(hiredPowerConsumption.value, hiredPowerConsumption.unit, texts.commons.hired, true);
60
-
61
- const RegisteredPowerLabel = () => powerConsumption(registeredPowerConsumption.value, registeredPowerConsumption.unit, texts.commons.registered);
28
+ 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); }
29
+
30
+ 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; }
31
+
32
+ var PowerProgresBar = function PowerProgresBar(_ref) {
33
+ var contextApiInfo = _ref.contextApiInfo,
34
+ hiredPowerConsumption = _ref.hiredPowerConsumption,
35
+ registeredPowerConsumption = _ref.registeredPowerConsumption,
36
+ exceededPower = _ref.exceededPower;
37
+ var ProgressBar = contextApiInfo.ProgressBar,
38
+ config = contextApiInfo.config,
39
+ Label = contextApiInfo.Label,
40
+ assets = contextApiInfo.assets;
41
+ var texts = config.texts;
42
+ var RedAlertIcon = assets.RedAlertIcon;
43
+ var powerExceeded = exceededPower.alert_message;
44
+
45
+ var powerConsumption = function powerConsumption(consumption, unit, text, isHired) {
46
+ return /*#__PURE__*/_react.default.createElement(_PowerConsumption.default, {
47
+ consumption: consumption,
48
+ unit: unit,
49
+ text: text,
50
+ isHired: isHired,
51
+ powerExceeded: powerExceeded
52
+ });
53
+ };
54
+
55
+ var HiredPowerLabel = function HiredPowerLabel() {
56
+ return powerConsumption(hiredPowerConsumption.value, hiredPowerConsumption.unit, texts.commons.hired, true);
57
+ };
58
+
59
+ var RegisteredPowerLabel = function RegisteredPowerLabel() {
60
+ return powerConsumption(registeredPowerConsumption.value, registeredPowerConsumption.unit, texts.commons.registered);
61
+ };
62
62
 
63
63
  return /*#__PURE__*/_react.default.createElement("div", {
64
64
  className: _stylesModule.default.container
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
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
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -21,36 +23,35 @@ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
21
23
 
22
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
25
 
24
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
25
-
26
- 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
- const RatePrices = _ref => {
29
- let {
30
- contextApiInfo,
31
- rate,
32
- category,
33
- title,
34
- classes = {},
35
- showCategory
36
- } = _ref;
37
- const {
38
- config,
39
- Label
40
- } = contextApiInfo;
41
- const {
42
- commons
43
- } = config.texts;
44
-
45
- const Title = () => /*#__PURE__*/_react.default.createElement(Label, {
46
- alias: _aliases.TITLE,
47
- className: "".concat(_stylesModule.default.title, " ").concat(classes.title)
48
- }, title);
49
-
50
- const Category = () => /*#__PURE__*/_react.default.createElement(Label, {
51
- alias: _aliases.CATEGORY,
52
- className: "".concat(_stylesModule.default.category, " ").concat(classes.category)
53
- }, "".concat(commons.category, " ").concat((0, _utils.stringOrDash)(category)));
26
+ 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
+ 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
+ var RatePrices = function RatePrices(_ref) {
31
+ var contextApiInfo = _ref.contextApiInfo,
32
+ rate = _ref.rate,
33
+ category = _ref.category,
34
+ title = _ref.title,
35
+ _ref$classes = _ref.classes,
36
+ classes = _ref$classes === void 0 ? {} : _ref$classes,
37
+ showCategory = _ref.showCategory;
38
+ var config = contextApiInfo.config,
39
+ Label = contextApiInfo.Label;
40
+ var commons = config.texts.commons;
41
+
42
+ var Title = function Title() {
43
+ return /*#__PURE__*/_react.default.createElement(Label, {
44
+ alias: _aliases.TITLE,
45
+ className: "".concat(_stylesModule.default.title, " ").concat(classes.title)
46
+ }, title);
47
+ };
48
+
49
+ var Category = function Category() {
50
+ return /*#__PURE__*/_react.default.createElement(Label, {
51
+ alias: _aliases.CATEGORY,
52
+ className: "".concat(_stylesModule.default.category, " ").concat(classes.category)
53
+ }, "".concat(commons.category, " ").concat((0, _utils.stringOrDash)(category)));
54
+ };
54
55
 
55
56
  return /*#__PURE__*/_react.default.createElement("div", {
56
57
  className: "".concat(_stylesModule.default.container, " ").concat(classes.container)
@@ -21,26 +21,19 @@ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
21
21
 
22
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
23
 
24
- const RateAndCategory = _ref => {
25
- let {
26
- contextApiInfo,
27
- fixedChargeValue,
28
- variableChargeValue
29
- } = _ref;
30
- const {
31
- config,
32
- ExternalLink,
33
- Label
34
- } = contextApiInfo;
35
- const {
36
- ratesTableLink
37
- } = config.externalLinks;
38
- const {
39
- fixedCharge,
40
- variableCharge,
41
- currency,
42
- seeRatesTable
43
- } = config.texts.ratesDefinition;
24
+ var RateAndCategory = function RateAndCategory(_ref) {
25
+ var contextApiInfo = _ref.contextApiInfo,
26
+ fixedChargeValue = _ref.fixedChargeValue,
27
+ variableChargeValue = _ref.variableChargeValue;
28
+ var config = contextApiInfo.config,
29
+ ExternalLink = contextApiInfo.ExternalLink,
30
+ Label = contextApiInfo.Label;
31
+ var ratesTableLink = config.externalLinks.ratesTableLink;
32
+ var _config$texts$ratesDe = config.texts.ratesDefinition,
33
+ fixedCharge = _config$texts$ratesDe.fixedCharge,
34
+ variableCharge = _config$texts$ratesDe.variableCharge,
35
+ currency = _config$texts$ratesDe.currency,
36
+ seeRatesTable = _config$texts$ratesDe.seeRatesTable;
44
37
  return /*#__PURE__*/_react.default.createElement("div", {
45
38
  className: _stylesModule.default.container
46
39
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -21,30 +21,20 @@ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
21
21
 
22
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
23
 
24
- const BillRate = _ref => {
25
- let {
26
- contextApiInfo,
27
- rate,
28
- category,
29
- fixedCharge,
30
- variableCharge
31
- } = _ref;
32
- const {
33
- assets,
34
- config,
35
- Label,
36
- Tooltip
37
- } = contextApiInfo;
38
- const {
39
- texts,
40
- colors
41
- } = config;
42
- const {
43
- rateFormatter
44
- } = config.formatters;
45
- const {
46
- billRatePrices
47
- } = config.texts.ratesDefinition;
24
+ var BillRate = function BillRate(_ref) {
25
+ var contextApiInfo = _ref.contextApiInfo,
26
+ rate = _ref.rate,
27
+ category = _ref.category,
28
+ fixedCharge = _ref.fixedCharge,
29
+ variableCharge = _ref.variableCharge;
30
+ var assets = contextApiInfo.assets,
31
+ config = contextApiInfo.config,
32
+ Label = contextApiInfo.Label,
33
+ Tooltip = contextApiInfo.Tooltip;
34
+ var texts = config.texts,
35
+ colors = config.colors;
36
+ var rateFormatter = config.formatters.rateFormatter;
37
+ var billRatePrices = config.texts.ratesDefinition.billRatePrices;
48
38
  return /*#__PURE__*/_react.default.createElement("div", {
49
39
  className: _stylesModule.default.container
50
40
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -21,20 +21,15 @@ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
21
21
 
22
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
23
 
24
- const Category = _ref => {
25
- let {
26
- contextApiInfo,
27
- category,
28
- wrap
29
- } = _ref;
30
- const {
31
- config,
32
- Label
33
- } = contextApiInfo;
34
- const {
35
- commons,
36
- ratesDefinition
37
- } = config.texts;
24
+ var Category = function Category(_ref) {
25
+ var contextApiInfo = _ref.contextApiInfo,
26
+ category = _ref.category,
27
+ wrap = _ref.wrap;
28
+ var config = contextApiInfo.config,
29
+ Label = contextApiInfo.Label;
30
+ var _config$texts = config.texts,
31
+ commons = _config$texts.commons,
32
+ ratesDefinition = _config$texts.ratesDefinition;
38
33
  return /*#__PURE__*/_react.default.createElement("div", {
39
34
  className: wrap ? _stylesModule.default.containerWrap : _stylesModule.default.container
40
35
  }, /*#__PURE__*/_react.default.createElement(Label, {
@@ -21,33 +21,28 @@ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
21
21
 
22
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
23
 
24
- const IndicatorLabel = _ref => {
25
- let {
26
- contextApiInfo,
27
- value,
28
- unit,
29
- labelOffset,
30
- classes = {}
31
- } = _ref;
32
- const {
33
- assets,
34
- config,
35
- Label
36
- } = contextApiInfo;
37
- const {
38
- texts,
39
- colors
40
- } = config;
41
- const {
42
- indicatorLabel
43
- } = texts.ratesDefinition;
24
+ var IndicatorLabel = function IndicatorLabel(_ref) {
25
+ var contextApiInfo = _ref.contextApiInfo,
26
+ value = _ref.value,
27
+ unit = _ref.unit,
28
+ labelOffset = _ref.labelOffset,
29
+ _ref$classes = _ref.classes,
30
+ classes = _ref$classes === void 0 ? {} : _ref$classes;
31
+ var assets = contextApiInfo.assets,
32
+ config = contextApiInfo.config,
33
+ Label = contextApiInfo.Label;
34
+ var texts = config.texts,
35
+ colors = config.colors;
36
+ var indicatorLabel = texts.ratesDefinition.indicatorLabel;
44
37
 
45
- const EnergyIcon = () => /*#__PURE__*/_react.default.createElement(assets.EnergyIcon, {
46
- className: _stylesModule.default.icon,
47
- style: {
48
- fill: colors.primary
49
- }
50
- });
38
+ var EnergyIcon = function EnergyIcon() {
39
+ return /*#__PURE__*/_react.default.createElement(assets.EnergyIcon, {
40
+ className: _stylesModule.default.icon,
41
+ style: {
42
+ fill: colors.primary
43
+ }
44
+ });
45
+ };
51
46
 
52
47
  return /*#__PURE__*/_react.default.createElement("div", {
53
48
  style: {
@@ -15,6 +15,8 @@ var _WithContextApi = _interopRequireDefault(require("../../../../../../../WithC
15
15
 
16
16
  var _smartBillTypes = require("../../../../../../../../shared/types/smartBillTypes");
17
17
 
18
+ var _constants = require("../../../../constants");
19
+
18
20
  var _IndicatorLabel = _interopRequireDefault(require("./components/IndicatorLabel"));
19
21
 
20
22
  var _utils = require("./utils");
@@ -23,26 +25,18 @@ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
23
25
 
24
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
27
 
26
- const Indicator = _ref => {
27
- let {
28
- value,
29
- unit,
30
- rateStages,
31
- isDesktop,
32
- contextApiInfo
33
- } = _ref;
34
- const {
35
- primary
36
- } = contextApiInfo.config.colors;
37
- const {
38
- containerLeft,
39
- labelOffset
40
- } = (0, _utils.getIndicatorPosition)(value, rateStages, isDesktop);
28
+ var Indicator = function Indicator(_ref) {
29
+ var indicatorPosition = _ref.indicatorPosition,
30
+ value = _ref.value,
31
+ unit = _ref.unit,
32
+ rateStages = _ref.rateStages,
33
+ contextApiInfo = _ref.contextApiInfo;
34
+ var primary = contextApiInfo.config.colors.primary;
41
35
  return /*#__PURE__*/_react.default.createElement("div", {
42
36
  className: _stylesModule.default.container
43
37
  }, /*#__PURE__*/_react.default.createElement("div", {
44
38
  style: {
45
- left: containerLeft
39
+ left: "calc(".concat(indicatorPosition * 100, "% + ").concat(_constants.INITIAL_INDICATOR_POSITION, ")")
46
40
  },
47
41
  className: _stylesModule.default.indicator
48
42
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -53,16 +47,16 @@ const Indicator = _ref => {
53
47
  }), /*#__PURE__*/_react.default.createElement(_IndicatorLabel.default, {
54
48
  value: value,
55
49
  unit: unit,
56
- labelOffset: labelOffset
50
+ labelOffset: (0, _utils.getLabelOffset)(value, rateStages)
57
51
  })));
58
52
  };
59
53
 
60
54
  Indicator.propTypes = {
61
55
  value: _propTypes.number,
56
+ indicatorPosition: _propTypes.number,
62
57
  unit: _propTypes.string,
63
58
  contextApiInfo: _smartBillTypes.contextApiInfoTypes,
64
- rateStages: _rateStagesTypes.rateStagesTypes,
65
- isDesktop: _propTypes.bool
59
+ rateStages: _rateStagesTypes.rateStagesTypes
66
60
  };
67
61
 
68
62
  var _default = (0, _WithContextApi.default)()(Indicator);
@@ -1,12 +1,9 @@
1
- @import '../../../../../../../../scss/variables/_colorsExport.scss';
2
- @import '../../../../../../../../scss/variables/_mediaQueries';
3
- @import '../../../../../../../../scss/variables/_sizes.scss';
4
-
5
1
  $arrow-width: 12px;
6
2
  $arrow-height: 8px;
7
3
 
8
4
  .container {
9
5
  display: flex;
6
+ padding-top: 0 !important;
10
7
  width: 100%;
11
8
  }
12
9