@widergy/utilitygo-smart-bill-web 1.13.4 → 2.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.
Files changed (142) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/components/Advice/index.js +3 -14
  3. package/dist/components/Amount/index.js +11 -29
  4. package/dist/components/Amount/styles.module.scss +1 -2
  5. package/dist/components/Amount/utils.js +0 -3
  6. package/dist/components/Banner/index.js +3 -12
  7. package/dist/components/BarChart/index.js +12 -32
  8. package/dist/components/BarChart/styles.module.scss +5 -5
  9. package/dist/components/BarChart/utils.js +1 -6
  10. package/dist/components/BillCalculation/components/ConceptCard/index.js +31 -36
  11. package/dist/components/BillCalculation/components/Glossary/index.js +30 -50
  12. package/dist/components/BillCalculation/components/Glossary/styles.module.scss +0 -6
  13. package/dist/components/BillCalculation/index.js +13 -46
  14. package/dist/components/BillCalculation/utils.js +3 -15
  15. package/dist/components/BillSummary/components/BilledConcepts/components/Concept/index.js +11 -29
  16. package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/index.js +2 -15
  17. package/dist/components/BillSummary/components/BilledConcepts/constants.js +0 -4
  18. package/dist/components/BillSummary/components/BilledConcepts/index.js +11 -40
  19. package/dist/components/BillSummary/components/BilledConcepts/styles.module.scss +1 -1
  20. package/dist/components/BillSummary/components/BilledConcepts/utils.js +13 -38
  21. package/dist/components/BillSummary/index.js +7 -42
  22. package/dist/components/BillSummary/styles.module.scss +0 -4
  23. package/dist/components/ConsumptionComparison/components/ComparisonTable/components/DataLine/index.js +0 -8
  24. package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/index.js +5 -20
  25. package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/utils.js +0 -7
  26. package/dist/components/ConsumptionComparison/components/ComparisonTable/constants.js +18 -39
  27. package/dist/components/ConsumptionComparison/components/ComparisonTable/index.js +2 -16
  28. package/dist/components/ConsumptionComparison/components/ComparisonTable/utils.js +15 -37
  29. package/dist/components/ConsumptionComparison/components/ConsumptionAdvice/index.js +8 -16
  30. package/dist/components/ConsumptionComparison/components/ConsumptionAdvice/utils.js +0 -7
  31. package/dist/components/ConsumptionComparison/components/PercentageComparison/index.js +12 -25
  32. package/dist/components/ConsumptionComparison/components/PercentageComparison/styles.module.scss +0 -10
  33. package/dist/components/ConsumptionComparison/components/PercentageComparison/utils.js +4 -11
  34. package/dist/components/ConsumptionComparison/index.js +9 -44
  35. package/dist/components/ConsumptionComparison/styles.module.scss +0 -5
  36. package/dist/components/ConsumptionEnergyDetails/components/ConsumptionEnergyComparison/index.js +13 -38
  37. package/dist/components/ConsumptionEnergyDetails/components/ConsumptionInDaysLabel/index.js +9 -20
  38. package/dist/components/ConsumptionEnergyDetails/components/EnergyTotalConsumption/index.js +14 -26
  39. package/dist/components/ConsumptionEnergyDetails/components/EnergyTotalConsumption/styles.module.scss +0 -6
  40. package/dist/components/ConsumptionEnergyDetails/components/PercentageComparison/index.js +10 -24
  41. package/dist/components/ConsumptionEnergyDetails/components/PercentageComparison/utils.js +0 -6
  42. package/dist/components/ConsumptionEnergyDetails/index.js +14 -41
  43. package/dist/components/ConsumptionEnergyDetails/styles.module.scss +2 -6
  44. package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/index.js +39 -55
  45. package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/styles.module.scss +2 -8
  46. package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/utils.js +0 -3
  47. package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderConsumption/index.js +7 -23
  48. package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderConsumption/styles.module.scss +0 -4
  49. package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderSettlement/index.js +4 -15
  50. package/dist/components/ConsumptionIncluded/components/TimelineRow/index.js +16 -33
  51. package/dist/components/ConsumptionIncluded/index.js +1 -18
  52. package/dist/components/ConsumptionIncluded/utils.js +2 -30
  53. package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/components/ReadingRow/index.js +7 -19
  54. package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/index.js +12 -27
  55. package/dist/components/ConsumptionPeriod/components/HistoryGraph/index.js +6 -30
  56. package/dist/components/ConsumptionPeriod/components/Reading/index.js +15 -33
  57. package/dist/components/ConsumptionPeriod/components/Reading/styles.module.scss +0 -1
  58. package/dist/components/ConsumptionPeriod/index.js +1 -20
  59. package/dist/components/ConsumptionPeriod/utils.js +0 -6
  60. package/dist/components/Date/index.js +6 -17
  61. package/dist/components/Date/styles.module.scss +2 -4
  62. package/dist/components/DebtState/index.js +6 -16
  63. package/dist/components/DebtState/styles.module.scss +2 -11
  64. package/dist/components/IconAndDetails/index.js +13 -26
  65. package/dist/components/Magnitude/index.js +18 -39
  66. package/dist/components/Magnitude/utils.js +0 -29
  67. package/dist/components/MainBillData/components/BillAlert/components/BillParticularConditions/index.js +6 -17
  68. package/dist/components/MainBillData/components/BillAlert/index.js +12 -39
  69. package/dist/components/MainBillData/components/BillAlert/styles.module.scss +4 -1
  70. package/dist/components/MainBillData/components/BillBody/components/ClientData/index.js +5 -19
  71. package/dist/components/MainBillData/components/BillBody/components/ClientData/styles.module.scss +1 -3
  72. package/dist/components/MainBillData/components/BillBody/components/Consumption/index.js +4 -20
  73. package/dist/components/MainBillData/components/BillBody/components/Consumption/utils.js +0 -2
  74. package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/index.js +16 -30
  75. package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/utils.js +0 -5
  76. package/dist/components/MainBillData/components/BillBody/index.js +3 -35
  77. package/dist/components/MainBillData/components/BillHeader/components/TypeAndNumber/index.js +7 -19
  78. package/dist/components/MainBillData/components/BillHeader/index.js +4 -27
  79. package/dist/components/MainBillData/index.js +1 -16
  80. package/dist/components/MainBillData/theme.js +0 -3
  81. package/dist/components/MainBillData/utils.js +0 -3
  82. package/dist/components/Period/index.js +18 -44
  83. package/dist/components/Period/styles.module.scss +9 -9
  84. package/dist/components/PowerProgresBar/components/PowerConsumption/index.js +21 -28
  85. package/dist/components/PowerProgresBar/components/PowerConsumption/styles.module.scss +0 -7
  86. package/dist/components/PowerProgresBar/index.js +8 -29
  87. package/dist/components/PowerProgresBar/styles.module.scss +5 -9
  88. package/dist/components/RateAndCategory/index.js +8 -26
  89. package/dist/components/RateAndCategory/styles.module.scss +1 -4
  90. package/dist/components/RatesDefinition/components/BillRate/components/RatePrices/index.js +11 -23
  91. package/dist/components/RatesDefinition/components/BillRate/components/RatePrices/styles.module.scss +0 -1
  92. package/dist/components/RatesDefinition/components/BillRate/index.js +8 -20
  93. package/dist/components/RatesDefinition/components/BillRate/styles.module.scss +1 -2
  94. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/Category/index.js +5 -17
  95. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/Category/styles.module.scss +2 -4
  96. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/components/IndicatorLabel/index.js +8 -22
  97. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/index.js +4 -18
  98. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/utils.js +0 -7
  99. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Legend/index.js +4 -14
  100. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Legend/styles.module.scss +1 -9
  101. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Stages/index.js +8 -16
  102. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Stages/styles.module.scss +0 -4
  103. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/constants.js +0 -1
  104. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/index.js +12 -39
  105. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/utils.js +14 -24
  106. package/dist/components/RatesDefinition/components/CategoryByConsumption/index.js +11 -38
  107. package/dist/components/RatesDefinition/components/CategoryByConsumption/utils.js +0 -3
  108. package/dist/components/RatesDefinition/components/PurchasedRate/index.js +11 -23
  109. package/dist/components/RatesDefinition/components/PurchasedRate/styles.module.scss +5 -4
  110. package/dist/components/RatesDefinition/index.js +4 -25
  111. package/dist/components/SmartBillProvider/index.js +5 -26
  112. package/dist/components/StyledAmount/constants.js +0 -3
  113. package/dist/components/StyledAmount/index.js +18 -38
  114. package/dist/components/StyledAmount/styles.module.scss +2 -3
  115. package/dist/components/WithContextApi/index.js +4 -15
  116. package/dist/components/WithContextApi/layout.js +0 -9
  117. package/dist/components/WithSeason/index.js +0 -6
  118. package/dist/constants/deviceSizes.js +4 -16
  119. package/dist/index.js +0 -18
  120. package/dist/scss/variables/_colors.scss +0 -6
  121. package/dist/scss/variables/_colorsExport.scss +0 -6
  122. package/dist/shared/Context/index.js +1 -5
  123. package/dist/shared/constants/aliases.js +84 -82
  124. package/dist/shared/types/assetsTypes.js +0 -3
  125. package/dist/shared/types/billDataTypes.js +13 -13
  126. package/dist/shared/types/componentsTypes.js +4 -10
  127. package/dist/shared/types/formattersTypes.js +0 -2
  128. package/dist/shared/types/rateStagesTypes.js +0 -2
  129. package/dist/shared/types/smartBillTypes.js +4 -10
  130. package/dist/shared/types/textsTypes.js +0 -2
  131. package/dist/shared/utils/billCalculation.js +0 -6
  132. package/dist/shared/utils/consumptions.js +1 -32
  133. package/dist/shared/utils/context.js +0 -6
  134. package/dist/shared/utils/expirations.js +0 -3
  135. package/dist/shared/utils/periods.js +0 -15
  136. package/dist/shared/utils/rates.js +0 -4
  137. package/dist/shared/utils/readings.js +0 -7
  138. package/dist/shared/utils/season.js +0 -3
  139. package/dist/shared/utils/stagesGraph.js +0 -11
  140. package/dist/utils/hooks.js +0 -2
  141. package/dist/utils.js +0 -8
  142. package/package.json +1 -1
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getSeasonProps = void 0;
7
-
8
7
  var _seasons = require("../../../../shared/constants/seasons");
9
-
10
8
  var getSeasonProps = function getSeasonProps(season, texts) {
11
9
  switch (season) {
12
10
  case _seasons.SEASONS.AUTUMN:
@@ -14,28 +12,23 @@ var getSeasonProps = function getSeasonProps(season, texts) {
14
12
  title: texts.consumptionComparison.autumnAdviceTitle,
15
13
  adviceText: texts.consumptionComparison.autumnAdviceText
16
14
  };
17
-
18
15
  case _seasons.SEASONS.WINTER:
19
16
  return {
20
17
  title: texts.consumptionComparison.winterAdviceTitle,
21
18
  adviceText: texts.consumptionComparison.winterAdviceText
22
19
  };
23
-
24
20
  case _seasons.SEASONS.SPRING:
25
21
  return {
26
22
  title: texts.consumptionComparison.springAdviceTitle,
27
23
  adviceText: texts.consumptionComparison.springAdviceText
28
24
  };
29
-
30
25
  case _seasons.SEASONS.SUMMER:
31
26
  return {
32
27
  title: texts.consumptionComparison.summerAdviceTitle,
33
28
  adviceText: texts.consumptionComparison.summerAdviceText
34
29
  };
35
-
36
30
  default:
37
31
  return {};
38
32
  }
39
33
  };
40
-
41
34
  exports.getSeasonProps = getSeasonProps;
@@ -4,39 +4,28 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _propTypes = require("prop-types");
11
-
12
9
  var _smartBillTypes = require("../../../../shared/types/smartBillTypes");
13
-
14
10
  var _WithContextApi = _interopRequireDefault(require("../../../WithContextApi"));
15
-
16
11
  var _aliases = require("../../../../shared/constants/aliases");
17
-
18
12
  var _utils = require("./utils");
19
-
20
13
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
21
-
22
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
-
24
15
  var PercentageComparison = function PercentageComparison(_ref) {
25
16
  var contextApiInfo = _ref.contextApiInfo,
26
- savingsPercentage = _ref.savingsPercentage,
27
- multipleSettlements = _ref.multipleSettlements;
17
+ savingsPercentage = _ref.savingsPercentage,
18
+ multipleSettlements = _ref.multipleSettlements;
28
19
  var assets = contextApiInfo.assets,
29
- config = contextApiInfo.config,
30
- Label = contextApiInfo.Label;
20
+ config = contextApiInfo.config,
21
+ Label = contextApiInfo.Label;
31
22
  var texts = config.texts;
32
-
33
23
  var _getProps = (0, _utils.getProps)(savingsPercentage, assets, texts, multipleSettlements),
34
- Icon = _getProps.Icon,
35
- sign = _getProps.sign,
36
- value = _getProps.value,
37
- background = _getProps.background,
38
- text = _getProps.text;
39
-
24
+ Icon = _getProps.Icon,
25
+ sign = _getProps.sign,
26
+ value = _getProps.value,
27
+ background = _getProps.background,
28
+ text = _getProps.text;
40
29
  return /*#__PURE__*/_react.default.createElement("div", {
41
30
  className: "".concat(_stylesModule.default.container, " ").concat(background)
42
31
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -45,19 +34,17 @@ var PercentageComparison = function PercentageComparison(_ref) {
45
34
  className: _stylesModule.default.icon
46
35
  }), /*#__PURE__*/_react.default.createElement(Label, {
47
36
  alias: _aliases.PERCENTAGE_COMPARISON_TITLE,
48
- className: _stylesModule.default.title
37
+ colorTheme: "light"
49
38
  }, "".concat(sign).concat(value, "%"))), /*#__PURE__*/_react.default.createElement(Label, {
50
39
  alias: _aliases.PERCENTAGE_COMPARISON_SUBTITLE,
51
- className: _stylesModule.default.subtitle
40
+ className: _stylesModule.default.subtitle,
41
+ colorTheme: "light"
52
42
  }, text));
53
43
  };
54
-
55
44
  PercentageComparison.propTypes = {
56
45
  contextApiInfo: _smartBillTypes.contextApiInfoTypes,
57
46
  savingsPercentage: _propTypes.number,
58
47
  multipleSettlements: _propTypes.bool
59
48
  };
60
-
61
49
  var _default = (0, _WithContextApi.default)()(PercentageComparison);
62
-
63
50
  exports.default = _default;
@@ -5,10 +5,6 @@
5
5
 
6
6
  $icon-size: 25px;
7
7
 
8
- %label-color {
9
- color: $white;
10
- }
11
-
12
8
  .container {
13
9
  align-items: center;
14
10
  border-radius: $default-container-border-radius;
@@ -43,11 +39,6 @@ $icon-size: 25px;
43
39
  width: $icon-size;
44
40
  }
45
41
 
46
- .title {
47
- @extend %label-color;
48
- font-size: $title;
49
- }
50
-
51
42
  .consumptionReductionBackground {
52
43
  background-color: $consumption-reduction;
53
44
  }
@@ -61,7 +52,6 @@ $icon-size: 25px;
61
52
  }
62
53
 
63
54
  .subtitle {
64
- @extend %label-color;
65
55
  @media #{$desktop} {
66
56
  text-align: center;
67
57
  }
@@ -4,21 +4,17 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getProps = void 0;
7
-
8
7
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
9
-
10
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
12
9
  var getProps = function getProps(savingsPercentage, assets, texts, multipleSettlements) {
13
10
  var consumptionComparison = texts.consumptionComparison;
14
11
  var lastYearBimesterPercentageComparisonDescended = consumptionComparison.lastYearBimesterPercentageComparisonDescended,
15
- lastYearPercentageComparisonDescended = consumptionComparison.lastYearPercentageComparisonDescended,
16
- lastYearBimesterPercentageComparisonRise = consumptionComparison.lastYearBimesterPercentageComparisonRise,
17
- lastYearPercentageComparisonRise = consumptionComparison.lastYearPercentageComparisonRise,
18
- lastYearPercentageStatic = consumptionComparison.lastYearPercentageStatic;
12
+ lastYearPercentageComparisonDescended = consumptionComparison.lastYearPercentageComparisonDescended,
13
+ lastYearBimesterPercentageComparisonRise = consumptionComparison.lastYearBimesterPercentageComparisonRise,
14
+ lastYearPercentageComparisonRise = consumptionComparison.lastYearPercentageComparisonRise,
15
+ lastYearPercentageStatic = consumptionComparison.lastYearPercentageStatic;
19
16
  var reductionText = multipleSettlements ? lastYearBimesterPercentageComparisonDescended : lastYearPercentageComparisonDescended;
20
17
  var incrementText = multipleSettlements ? lastYearBimesterPercentageComparisonRise : lastYearPercentageComparisonRise;
21
-
22
18
  if (savingsPercentage > 0) {
23
19
  return {
24
20
  Icon: assets.ConsumptionReductionIcon,
@@ -28,7 +24,6 @@ var getProps = function getProps(savingsPercentage, assets, texts, multipleSettl
28
24
  text: reductionText(savingsPercentage)
29
25
  };
30
26
  }
31
-
32
27
  if (savingsPercentage < 0) {
33
28
  return {
34
29
  Icon: assets.ConsumptionIncrementIcon,
@@ -38,7 +33,6 @@ var getProps = function getProps(savingsPercentage, assets, texts, multipleSettl
38
33
  text: incrementText(-savingsPercentage)
39
34
  };
40
35
  }
41
-
42
36
  return {
43
37
  Icon: assets.ConsumptionInvariantIcon,
44
38
  sign: '',
@@ -47,5 +41,4 @@ var getProps = function getProps(savingsPercentage, assets, texts, multipleSettl
47
41
  text: lastYearPercentageStatic
48
42
  };
49
43
  };
50
-
51
44
  exports.getProps = getProps;
@@ -1,84 +1,54 @@
1
1
  "use strict";
2
2
 
3
3
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _react = _interopRequireWildcard(require("react"));
11
-
12
9
  var _browser = require("@widergy/web-utils/lib/browser");
13
-
14
10
  var _reactPerfectScrollbar = _interopRequireDefault(require("react-perfect-scrollbar"));
15
-
16
11
  require("react-perfect-scrollbar/dist/css/styles.css");
17
-
18
12
  var _aliases = require("../../shared/constants/aliases");
19
-
20
13
  var _smartBillTypes = require("../../shared/types/smartBillTypes");
21
-
22
14
  var _periods = require("../../shared/utils/periods");
23
-
24
15
  var _billDataTypes = require("../../shared/types/billDataTypes");
25
-
26
16
  var _WithContextApi = _interopRequireDefault(require("../WithContextApi"));
27
-
28
17
  var _deviceSizes = require("../../constants/deviceSizes");
29
-
30
18
  var _Banner = _interopRequireDefault(require("../Banner"));
31
-
32
19
  var _ComparisonTable = _interopRequireDefault(require("./components/ComparisonTable"));
33
-
34
20
  var _ConsumptionAdvice = _interopRequireDefault(require("./components/ConsumptionAdvice"));
35
-
36
21
  var _PercentageComparison = _interopRequireDefault(require("./components/PercentageComparison"));
37
-
38
22
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
39
-
40
23
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
41
-
42
24
  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); }
43
-
44
25
  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; }
45
-
46
26
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
47
-
48
27
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
49
-
50
28
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
51
-
52
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
53
-
54
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
55
-
29
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
30
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
56
31
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
57
-
58
32
  var ConsumptionComparison = function ConsumptionComparison(_ref) {
59
33
  var _currentPeriod$settle;
60
-
61
34
  var billData = _ref.billData,
62
- contextApiInfo = _ref.contextApiInfo;
35
+ contextApiInfo = _ref.contextApiInfo;
63
36
  var Label = contextApiInfo.Label,
64
- config = contextApiInfo.config,
65
- assets = contextApiInfo.assets;
37
+ config = contextApiInfo.config,
38
+ assets = contextApiInfo.assets;
66
39
  var consumptionSimulatorFromBanner = config.externalLinks.consumptionSimulatorFromBanner;
67
40
  var texts = config.texts;
68
41
  var currentPeriod = (0, _periods.getCurrentPeriod)(billData);
69
42
  var SimulatorBannerIcon = assets.SimulatorBannerIcon,
70
- SimulatorBannerResponsiveIcon = assets.SimulatorBannerResponsiveIcon;
43
+ SimulatorBannerResponsiveIcon = assets.SimulatorBannerResponsiveIcon;
71
44
  var withBanner = SimulatorBannerIcon && SimulatorBannerResponsiveIcon;
72
-
73
45
  var _useState = (0, _react.useState)((0, _browser.isDesktop)(_deviceSizes.TabletBreakpoint)),
74
- _useState2 = _slicedToArray(_useState, 2),
75
- isDesktopSize = _useState2[0],
76
- setIsDesktopSize = _useState2[1];
77
-
46
+ _useState2 = _slicedToArray(_useState, 2),
47
+ isDesktopSize = _useState2[0],
48
+ setIsDesktopSize = _useState2[1];
78
49
  var handleResizeScreen = function handleResizeScreen() {
79
50
  return setIsDesktopSize((0, _browser.isDesktop)(_deviceSizes.TabletBreakpoint));
80
51
  };
81
-
82
52
  (0, _react.useEffect)(function () {
83
53
  window.addEventListener(_browser.RESIZE_EVENT, handleResizeScreen);
84
54
  handleResizeScreen();
@@ -89,7 +59,6 @@ var ConsumptionComparison = function ConsumptionComparison(_ref) {
89
59
  var savingsPercentage = (0, _periods.getSavingsPercentage)(currentPeriod);
90
60
  var showTemp = billData.previous_period_avg_temperature && billData.current_period_avg_temperature;
91
61
  var multipleSettlements = (currentPeriod === null || currentPeriod === void 0 ? void 0 : (_currentPeriod$settle = currentPeriod.settlements) === null || _currentPeriod$settle === void 0 ? void 0 : _currentPeriod$settle.total_settlements) > 1;
92
-
93
62
  var ComparisonTableRender = function ComparisonTableRender() {
94
63
  return /*#__PURE__*/_react.default.createElement(_ComparisonTable.default, {
95
64
  billData: billData,
@@ -97,7 +66,6 @@ var ConsumptionComparison = function ConsumptionComparison(_ref) {
97
66
  isDesktopSize: isDesktopSize
98
67
  });
99
68
  };
100
-
101
69
  var scrollbarRef = (0, _react.useRef)();
102
70
  (0, _react.useEffect)(function () {
103
71
  if (scrollbarRef.current) scrollbarRef.current.updateScroll();
@@ -123,12 +91,9 @@ var ConsumptionComparison = function ConsumptionComparison(_ref) {
123
91
  className: _stylesModule.default.label
124
92
  }, texts.consumptionComparison.weatherInformationLabel));
125
93
  };
126
-
127
94
  ConsumptionComparison.propTypes = {
128
95
  billData: _billDataTypes.billDataTypes,
129
96
  contextApiInfo: _smartBillTypes.contextApiInfoTypes
130
97
  };
131
-
132
98
  var _default = (0, _WithContextApi.default)()(ConsumptionComparison);
133
-
134
99
  exports.default = _default;
@@ -8,7 +8,6 @@
8
8
  flex-flow: column;
9
9
  }
10
10
 
11
-
12
11
  .ConsumptionBannerIcon {
13
12
  border-radius: $default-container-border-radius;
14
13
  width: 100%;
@@ -25,10 +24,6 @@
25
24
 
26
25
  .label {
27
26
  margin-top: 8px;
28
-
29
- > a {
30
- color: $primary;
31
- }
32
27
  }
33
28
 
34
29
  .comparisonTable {
@@ -1,63 +1,44 @@
1
1
  "use strict";
2
2
 
3
3
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _react = _interopRequireWildcard(require("react"));
11
-
12
9
  var _dayjs = _interopRequireDefault(require("dayjs"));
13
-
14
10
  var _string = require("@widergy/web-utils/lib/string");
15
-
16
11
  var _propTypes = require("prop-types");
17
-
18
12
  var _aliases = require("../../../../shared/constants/aliases");
19
-
20
13
  var _WithContextApi = _interopRequireDefault(require("../../../WithContextApi"));
21
-
22
14
  var _periodicities = require("../../../../shared/constants/periodicities");
23
-
24
15
  var _PercentageComparison = _interopRequireDefault(require("../PercentageComparison"));
25
-
26
16
  var _ConsumptionInDaysLabel = _interopRequireDefault(require("../ConsumptionInDaysLabel"));
27
-
28
17
  var _smartBillTypes = require("../../../../shared/types/smartBillTypes");
29
-
30
18
  var _billDataTypes = require("../../../../shared/types/billDataTypes");
31
-
32
19
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
33
-
34
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
35
-
36
21
  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
-
38
22
  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
-
40
23
  var ConsumptionEnergyComparison = function ConsumptionEnergyComparison(_ref) {
41
24
  var contextApiInfo = _ref.contextApiInfo,
42
- multipleSettlements = _ref.multipleSettlements,
43
- withPercentage = _ref.withPercentage,
44
- dataValidation = _ref.dataValidation,
45
- currentConsumption = _ref.currentConsumption,
46
- remainingConsumption = _ref.remainingConsumption,
47
- totalConsumption = _ref.totalConsumption,
48
- settlements = _ref.settlements,
49
- periodicity = _ref.periodicity,
50
- periodNumber = _ref.periodNumber,
51
- year = _ref.year,
52
- savingsPercentage = _ref.savingsPercentage,
53
- currentIsFirstSettlement = _ref.currentIsFirstSettlement;
25
+ multipleSettlements = _ref.multipleSettlements,
26
+ withPercentage = _ref.withPercentage,
27
+ dataValidation = _ref.dataValidation,
28
+ currentConsumption = _ref.currentConsumption,
29
+ remainingConsumption = _ref.remainingConsumption,
30
+ totalConsumption = _ref.totalConsumption,
31
+ settlements = _ref.settlements,
32
+ periodicity = _ref.periodicity,
33
+ periodNumber = _ref.periodNumber,
34
+ year = _ref.year,
35
+ savingsPercentage = _ref.savingsPercentage,
36
+ currentIsFirstSettlement = _ref.currentIsFirstSettlement;
54
37
  var config = contextApiInfo.config,
55
- Label = contextApiInfo.Label;
38
+ Label = contextApiInfo.Label;
56
39
  var texts = config.texts;
57
-
58
40
  var CurrentSettlement = function CurrentSettlement() {
59
41
  var _settlements$current;
60
-
61
42
  return /*#__PURE__*/_react.default.createElement("div", {
62
43
  className: _stylesModule.default.currentConsumptionContainer
63
44
  }, /*#__PURE__*/_react.default.createElement(_ConsumptionInDaysLabel.default, {
@@ -74,10 +55,8 @@ var ConsumptionEnergyComparison = function ConsumptionEnergyComparison(_ref) {
74
55
  alias: _aliases.CONSUMPTION_ACTUAL_DETAIL
75
56
  }, texts.mainBillData.currentConsumption));
76
57
  };
77
-
78
58
  var RemainingSettlement = function RemainingSettlement() {
79
59
  var _settlements$remainin;
80
-
81
60
  return /*#__PURE__*/_react.default.createElement("div", {
82
61
  className: _stylesModule.default.remainingConsumptionContainer
83
62
  }, /*#__PURE__*/_react.default.createElement(_ConsumptionInDaysLabel.default, {
@@ -94,7 +73,6 @@ var ConsumptionEnergyComparison = function ConsumptionEnergyComparison(_ref) {
94
73
  alias: _aliases.CONSUMPTION_NEXT_DETAIL
95
74
  }, currentIsFirstSettlement ? texts.mainBillData.remainingConsumption : texts.mainBillData.firstSettlementRemainingConsumption));
96
75
  };
97
-
98
76
  return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(Label, {
99
77
  alias: _aliases.TITLE,
100
78
  className: _stylesModule.default.title
@@ -120,7 +98,6 @@ var ConsumptionEnergyComparison = function ConsumptionEnergyComparison(_ref) {
120
98
  multipleSettlements: multipleSettlements
121
99
  }));
122
100
  };
123
-
124
101
  ConsumptionEnergyComparison.propTypes = {
125
102
  contextApiInfo: _smartBillTypes.contextApiInfoTypes,
126
103
  multipleSettlements: _propTypes.bool,
@@ -136,7 +113,5 @@ ConsumptionEnergyComparison.propTypes = {
136
113
  savingsPercentage: _propTypes.number,
137
114
  currentIsFirstSettlement: _propTypes.bool
138
115
  };
139
-
140
116
  var _default = (0, _WithContextApi.default)()(ConsumptionEnergyComparison);
141
-
142
117
  exports.default = _default;
@@ -4,33 +4,25 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _propTypes = require("prop-types");
11
-
12
9
  var _smartBillTypes = require("../../../../shared/types/smartBillTypes");
13
-
14
10
  var _WithContextApi = _interopRequireDefault(require("../../../WithContextApi"));
15
-
16
11
  var _utils = require("../../../../utils");
17
-
18
12
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
19
-
20
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
-
22
14
  var ConsumptionInDaysLabel = function ConsumptionInDaysLabel(_ref) {
23
15
  var contextApiInfo = _ref.contextApiInfo,
24
- consumption = _ref.consumption,
25
- unit = _ref.unit,
26
- totalDays = _ref.totalDays,
27
- _ref$classes = _ref.classes,
28
- classes = _ref$classes === void 0 ? {} : _ref$classes,
29
- numberAlias = _ref.numberAlias,
30
- unitAlias = _ref.unitAlias,
31
- daysAlias = _ref.daysAlias;
16
+ consumption = _ref.consumption,
17
+ unit = _ref.unit,
18
+ totalDays = _ref.totalDays,
19
+ _ref$classes = _ref.classes,
20
+ classes = _ref$classes === void 0 ? {} : _ref$classes,
21
+ numberAlias = _ref.numberAlias,
22
+ unitAlias = _ref.unitAlias,
23
+ daysAlias = _ref.daysAlias;
32
24
  var config = contextApiInfo.config,
33
- Label = contextApiInfo.Label;
25
+ Label = contextApiInfo.Label;
34
26
  var texts = config.texts;
35
27
  return /*#__PURE__*/_react.default.createElement("div", {
36
28
  className: "".concat(classes.container)
@@ -44,7 +36,6 @@ var ConsumptionInDaysLabel = function ConsumptionInDaysLabel(_ref) {
44
36
  alias: daysAlias
45
37
  }, "".concat(texts.commons.inPreposition, " ").concat((0, _utils.stringOrDash)(totalDays), " ").concat(texts.commons.days)));
46
38
  };
47
-
48
39
  ConsumptionInDaysLabel.propTypes = {
49
40
  contextApiInfo: _smartBillTypes.contextApiInfoTypes,
50
41
  consumption: _propTypes.string,
@@ -57,7 +48,5 @@ ConsumptionInDaysLabel.propTypes = {
57
48
  unitAlias: _propTypes.string,
58
49
  daysAlias: _propTypes.string
59
50
  };
60
-
61
51
  var _default = (0, _WithContextApi.default)()(ConsumptionInDaysLabel);
62
-
63
52
  exports.default = _default;
@@ -1,54 +1,44 @@
1
1
  "use strict";
2
2
 
3
3
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _react = _interopRequireWildcard(require("react"));
11
-
12
9
  var _propTypes = require("prop-types");
13
-
14
10
  var _smartBillTypes = require("../../../../shared/types/smartBillTypes");
15
-
16
11
  var _WithContextApi = _interopRequireDefault(require("../../../WithContextApi"));
17
-
18
12
  var _utils = require("../../../../utils");
19
-
20
13
  var _aliases = require("../../../../shared/constants/aliases");
21
-
22
14
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
23
-
24
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
-
26
16
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
27
-
28
17
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
29
-
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); }
30
19
  var EnergyTotalConsumption = function EnergyTotalConsumption(_ref) {
31
20
  var contextApiInfo = _ref.contextApiInfo,
32
- consumption = _ref.consumption,
33
- unit = _ref.unit,
34
- text = _ref.text,
35
- exceededReactiveEnergy = _ref.exceededReactiveEnergy;
21
+ consumption = _ref.consumption,
22
+ unit = _ref.unit,
23
+ text = _ref.text,
24
+ exceededReactiveEnergy = _ref.exceededReactiveEnergy;
36
25
  var Label = contextApiInfo.Label;
37
26
  var alias = exceededReactiveEnergy ? _aliases.ENERGY_TOTAL_CONSUMPTION_EXCEEDED : _aliases.ENERGY_TOTAL_CONSUMPTION;
38
27
  var unitAlias = exceededReactiveEnergy ? _aliases.ENERGY_TOTAL_CONSUMPTION_EXCEEDED_UNIT : _aliases.ENERGY_TOTAL_CONSUMPTION_UNIT;
39
28
  return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
40
29
  className: _stylesModule.default.energyConsumotionLabel
41
- }, /*#__PURE__*/_react.default.createElement(Label, {
42
- alias: alias,
43
- className: exceededReactiveEnergy && _stylesModule.default.exceededReactiveEnergyLabel
44
- }, "".concat((0, _utils.stringOrDash)(consumption), "\xA0")), /*#__PURE__*/_react.default.createElement(Label, {
45
- alias: unitAlias,
46
- className: exceededReactiveEnergy && _stylesModule.default.exceededReactiveEnergyLabel
47
- }, (0, _utils.stringOrDash)(unit))), /*#__PURE__*/_react.default.createElement(Label, {
30
+ }, /*#__PURE__*/_react.default.createElement(Label, _extends({
31
+ alias: alias
32
+ }, exceededReactiveEnergy ? {
33
+ colorTheme: 'error'
34
+ } : {}), "".concat((0, _utils.stringOrDash)(consumption), "\xA0")), /*#__PURE__*/_react.default.createElement(Label, _extends({
35
+ alias: unitAlias
36
+ }, exceededReactiveEnergy ? {
37
+ colorTheme: 'error'
38
+ } : {}), (0, _utils.stringOrDash)(unit))), /*#__PURE__*/_react.default.createElement(Label, {
48
39
  alias: _aliases.ENERGY_TOTAL_CONSUMPTION_DETAIL
49
40
  }, text));
50
41
  };
51
-
52
42
  EnergyTotalConsumption.propTypes = {
53
43
  contextApiInfo: _smartBillTypes.contextApiInfoTypes,
54
44
  consumption: _propTypes.string,
@@ -56,7 +46,5 @@ EnergyTotalConsumption.propTypes = {
56
46
  text: _propTypes.string,
57
47
  exceededReactiveEnergy: _propTypes.bool
58
48
  };
59
-
60
49
  var _default = (0, _WithContextApi.default)()(EnergyTotalConsumption);
61
-
62
50
  exports.default = _default;
@@ -1,12 +1,6 @@
1
- @import '../../../../scss/variables/_colorsExport.scss';
2
-
3
1
  .energyConsumotionLabel {
4
2
  align-items: baseline;
5
3
  display: flex;
6
4
  justify-content: center;
7
5
  margin-bottom: 10px;
8
6
  }
9
-
10
- .exceededReactiveEnergyLabel {
11
- color: $exceeded-power;
12
- }