@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
@@ -10,4 +10,5 @@ exports.TOUCHABLE = 'Components::Touchable';
10
10
  exports.CARD = 'Components::Card';
11
11
  exports.MARKDOWN = 'Components::Markdown';
12
12
  exports.TOGGLE = 'Components::Toggle';
13
- exports.BAR_CHART = 'Components::BarChart';
13
+ exports.BAR_CHART = 'Components::BarChart';
14
+ exports.PIE_CHART = 'Components::PieChart';
@@ -4,23 +4,23 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.POWER_TYPES = exports.POWER_FACTORS = exports.ENERGY_TYPES = exports.CONSUMPTION_TYPES = void 0;
7
- const CONSUMPTION_TYPES = {
7
+ var CONSUMPTION_TYPES = {
8
8
  TOTAL: 'total',
9
9
  DAILY: 'diario'
10
10
  };
11
11
  exports.CONSUMPTION_TYPES = CONSUMPTION_TYPES;
12
- const ENERGY_TYPES = {
12
+ var ENERGY_TYPES = {
13
13
  ACTIVE: 'Energía activa',
14
14
  REACTIVE: 'Energía reactiva'
15
15
  };
16
16
  exports.ENERGY_TYPES = ENERGY_TYPES;
17
- const POWER_TYPES = {
17
+ var POWER_TYPES = {
18
18
  REGISTERED: 'Potencia registrada',
19
19
  PURCHASED: 'Potencia convenida',
20
20
  EXCEEDED: 'Potencia excedida'
21
21
  };
22
22
  exports.POWER_TYPES = POWER_TYPES;
23
- const POWER_FACTORS = {
23
+ var POWER_FACTORS = {
24
24
  COSINE_PHI: 'Coseno fi',
25
25
  TANGENT_PHI: 'Tangente fi'
26
26
  };
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.PERIODICITY = void 0;
7
- const PERIODICITY = {
7
+ var PERIODICITY = {
8
8
  MONTHLY: 'MENSUAL',
9
9
  BIMONTHLY: 'BIMESTRAL'
10
10
  };
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.CHARGE_TYPES = void 0;
7
- const CHARGE_TYPES = {
7
+ var CHARGE_TYPES = {
8
8
  FIXED: 'cargo fijo',
9
9
  VARIABLE: 'cargo variable'
10
10
  };
@@ -4,13 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.READING_TYPES = exports.READING_MOMENTS = void 0;
7
- const READING_TYPES = {
7
+ var READING_TYPES = {
8
8
  FACE_TO_FACE: 'Real',
9
9
  ESTIMATED: 'Est',
10
10
  TELEMEDITION: 'Telemedición'
11
11
  };
12
12
  exports.READING_TYPES = READING_TYPES;
13
- const READING_MOMENTS = {
13
+ var READING_MOMENTS = {
14
14
  INITIAL: 'inicio',
15
15
  FINAL: 'fin'
16
16
  };
@@ -4,14 +4,14 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.SEASON_PERIODS = exports.SEASONS = void 0;
7
- const SEASONS = {
7
+ var SEASONS = {
8
8
  SPRING: 'spring',
9
9
  SUMMER: 'summer',
10
10
  AUTUMN: 'autumn',
11
11
  WINTER: 'winter'
12
12
  };
13
13
  exports.SEASONS = SEASONS;
14
- const SEASON_PERIODS = [{
14
+ var SEASON_PERIODS = [{
15
15
  initMonth: 1,
16
16
  endingMonth: 2,
17
17
  season: SEASONS.SUMMER
@@ -4,11 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.MIN_VALUE = exports.MAX_VALUE = exports.INFINITE = exports.DEFAULT_INFINITE_SUB_STAGE_RANGE_WIDTH = void 0;
7
- const INFINITE = null;
7
+ var INFINITE = null;
8
8
  exports.INFINITE = INFINITE;
9
- const MAX_VALUE = 1;
9
+ var MAX_VALUE = 1;
10
10
  exports.MAX_VALUE = MAX_VALUE;
11
- const MIN_VALUE = 0;
11
+ var MIN_VALUE = 0;
12
12
  exports.MIN_VALUE = MIN_VALUE;
13
- const DEFAULT_INFINITE_SUB_STAGE_RANGE_WIDTH = 200;
13
+ var DEFAULT_INFINITE_SUB_STAGE_RANGE_WIDTH = 200;
14
14
  exports.DEFAULT_INFINITE_SUB_STAGE_RANGE_WIDTH = DEFAULT_INFINITE_SUB_STAGE_RANGE_WIDTH;
@@ -9,5 +9,5 @@ var _propTypes = require("prop-types");
9
9
 
10
10
  var _componentsTypes = require("./componentsTypes");
11
11
 
12
- const assetsTypes = (0, _propTypes.objectOf)(_componentsTypes.componentTypes);
12
+ var assetsTypes = (0, _propTypes.objectOf)(_componentsTypes.componentTypes);
13
13
  exports.assetsTypes = assetsTypes;
@@ -7,14 +7,14 @@ exports.settlementsTypes = exports.periodTypes = exports.consumptionTypes = expo
7
7
 
8
8
  var _propTypes = require("prop-types");
9
9
 
10
- const consumptionTypes = (0, _propTypes.arrayOf)((0, _propTypes.shape)({
10
+ var consumptionTypes = (0, _propTypes.arrayOf)((0, _propTypes.shape)({
11
11
  magnitude: _propTypes.string,
12
12
  type: _propTypes.string,
13
13
  unit: _propTypes.string,
14
14
  value: _propTypes.number
15
15
  }));
16
16
  exports.consumptionTypes = consumptionTypes;
17
- const settlementsTypes = (0, _propTypes.shape)({
17
+ var settlementsTypes = (0, _propTypes.shape)({
18
18
  periodicity: _propTypes.string,
19
19
  total_settlements: _propTypes.number,
20
20
  total_settlements_days: _propTypes.number,
@@ -41,7 +41,7 @@ const settlementsTypes = (0, _propTypes.shape)({
41
41
  }))
42
42
  });
43
43
  exports.settlementsTypes = settlementsTypes;
44
- const periodTypes = (0, _propTypes.arrayOf)((0, _propTypes.shape)({
44
+ var periodTypes = (0, _propTypes.arrayOf)((0, _propTypes.shape)({
45
45
  current: _propTypes.bool,
46
46
  number: _propTypes.string,
47
47
  year: _propTypes.string,
@@ -49,7 +49,7 @@ const periodTypes = (0, _propTypes.arrayOf)((0, _propTypes.shape)({
49
49
  consumptions: consumptionTypes
50
50
  }));
51
51
  exports.periodTypes = periodTypes;
52
- const billDataTypes = (0, _propTypes.shape)({
52
+ var billDataTypes = (0, _propTypes.shape)({
53
53
  bill_type: _propTypes.string,
54
54
  bill_number: _propTypes.string,
55
55
  pending_debt: _propTypes.bool,
@@ -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
  });
@@ -9,27 +11,19 @@ var _propTypes = require("prop-types");
9
11
 
10
12
  var COMPONENTS = _interopRequireWildcard(require("../constants/components"));
11
13
 
12
- 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); }
14
+ var _shape;
15
+
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); }
13
17
 
14
- 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; }
18
+ 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; }
15
19
 
16
- const componentTypes = (0, _propTypes.oneOfType)([_propTypes.element, _propTypes.node, _propTypes.func, _propTypes.any]);
20
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
21
+
22
+ var componentTypes = (0, _propTypes.oneOfType)([_propTypes.element, _propTypes.node, _propTypes.func, _propTypes.any]);
17
23
  exports.componentTypes = componentTypes;
18
- const componentsTypes = (0, _propTypes.shape)({
19
- [COMPONENTS.BUTTON]: componentTypes,
20
- [COMPONENTS.DIALOG]: componentTypes,
21
- [COMPONENTS.EXTERNAL_LINK]: componentTypes,
22
- [COMPONENTS.LABEL]: componentTypes,
23
- [COMPONENTS.PROGRESS_BAR]: componentTypes,
24
- [COMPONENTS.TOOLTIP]: componentTypes,
25
- [COMPONENTS.TOUCHABLE]: componentTypes,
26
- [COMPONENTS.CARD]: componentTypes,
27
- [COMPONENTS.MARKDOWN]: componentTypes,
28
- [COMPONENTS.TOGGLE]: componentTypes,
29
- [COMPONENTS.BAR_CHART]: componentTypes
30
- });
24
+ var componentsTypes = (0, _propTypes.shape)((_shape = {}, _defineProperty(_shape, COMPONENTS.BUTTON, componentTypes), _defineProperty(_shape, COMPONENTS.DIALOG, componentTypes), _defineProperty(_shape, COMPONENTS.EXTERNAL_LINK, componentTypes), _defineProperty(_shape, COMPONENTS.LABEL, componentTypes), _defineProperty(_shape, COMPONENTS.PROGRESS_BAR, componentTypes), _defineProperty(_shape, COMPONENTS.TOOLTIP, componentTypes), _defineProperty(_shape, COMPONENTS.TOUCHABLE, componentTypes), _defineProperty(_shape, COMPONENTS.CARD, componentTypes), _defineProperty(_shape, COMPONENTS.MARKDOWN, componentTypes), _defineProperty(_shape, COMPONENTS.TOGGLE, componentTypes), _defineProperty(_shape, COMPONENTS.BAR_CHART, componentTypes), _shape));
31
25
  exports.componentsTypes = componentsTypes;
32
- const unpackedComponentsTypes = {
26
+ var unpackedComponentsTypes = {
33
27
  Button: componentTypes,
34
28
  Dialog: componentTypes,
35
29
  Label: componentTypes,
@@ -39,6 +33,7 @@ const unpackedComponentsTypes = {
39
33
  Card: componentTypes,
40
34
  Markdown: componentTypes,
41
35
  Toggle: componentTypes,
42
- BarChart: componentTypes
36
+ BarChart: componentTypes,
37
+ PieChart: componentTypes
43
38
  };
44
39
  exports.unpackedComponentsTypes = unpackedComponentsTypes;
@@ -7,7 +7,7 @@ exports.formattersTypes = void 0;
7
7
 
8
8
  var _propTypes = require("prop-types");
9
9
 
10
- const formattersTypes = (0, _propTypes.shape)({
10
+ var formattersTypes = (0, _propTypes.shape)({
11
11
  billNumberFormatter: _propTypes.func,
12
12
  clientNumberFormatter: _propTypes.func
13
13
  });
@@ -7,19 +7,19 @@ exports.subStageType = exports.stageType = exports.rateStagesTypes = void 0;
7
7
 
8
8
  var _propTypes = require("prop-types");
9
9
 
10
- const subStageType = (0, _propTypes.shape)({
10
+ var subStageType = (0, _propTypes.shape)({
11
11
  category: _propTypes.number,
12
12
  name: _propTypes.string,
13
13
  color: _propTypes.string,
14
14
  range: (0, _propTypes.arrayOf)(_propTypes.number)
15
15
  });
16
16
  exports.subStageType = subStageType;
17
- const stageType = (0, _propTypes.shape)({
18
- group: _propTypes.number,
17
+ var stageType = (0, _propTypes.shape)({
18
+ group: (0, _propTypes.oneOfType)([_propTypes.number, _propTypes.string]),
19
19
  range: (0, _propTypes.arrayOf)(_propTypes.number),
20
20
  unit: _propTypes.string,
21
21
  sub_rate_stages: (0, _propTypes.arrayOf)(subStageType)
22
22
  });
23
23
  exports.stageType = stageType;
24
- const rateStagesTypes = (0, _propTypes.arrayOf)(stageType);
24
+ var rateStagesTypes = (0, _propTypes.arrayOf)(stageType);
25
25
  exports.rateStagesTypes = rateStagesTypes;
@@ -15,15 +15,20 @@ var _formattersTypes = require("./formattersTypes");
15
15
 
16
16
  var _componentsTypes = require("./componentsTypes");
17
17
 
18
- const configTypes = (0, _propTypes.shape)({
18
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
19
+
20
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
21
+
22
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23
+
24
+ var configTypes = (0, _propTypes.shape)({
19
25
  texts: _textsTypes.textsTypes,
20
26
  formatters: _formattersTypes.formattersTypes
21
27
  });
22
- const contextApiInfoTypes = (0, _propTypes.shape)({
28
+ var contextApiInfoTypes = (0, _propTypes.shape)(_objectSpread({
23
29
  assets: _assetsTypes.assetsTypes,
24
30
  components: _componentsTypes.componentsTypes,
25
31
  config: configTypes,
26
- theme: _propTypes.any,
27
- ..._componentsTypes.unpackedComponentsTypes
28
- });
32
+ theme: _propTypes.any
33
+ }, _componentsTypes.unpackedComponentsTypes));
29
34
  exports.contextApiInfoTypes = contextApiInfoTypes;
@@ -7,7 +7,7 @@ exports.textsTypes = void 0;
7
7
 
8
8
  var _propTypes = require("prop-types");
9
9
 
10
- const textsTypes = (0, _propTypes.shape)({
10
+ var textsTypes = (0, _propTypes.shape)({
11
11
  commons: (0, _propTypes.shape)({
12
12
  accept: _propTypes.string,
13
13
  bimester: _propTypes.string,
@@ -11,20 +11,20 @@ var _periodicities = require("../constants/periodicities");
11
11
 
12
12
  var _periods = require("./periods");
13
13
 
14
- const titleMapper = (billData, texts) => {
14
+ var titleMapper = function titleMapper(billData, texts) {
15
15
  var _currentPeriod$settle, _currentPeriod$settle2, _currentPeriod$settle3, _currentPeriod$settle4;
16
16
 
17
- const currentPeriod = (0, _periods.getCurrentPeriod)(billData);
18
- const periodicity = currentPeriod === null || currentPeriod === void 0 ? void 0 : (_currentPeriod$settle = currentPeriod.settlements) === null || _currentPeriod$settle === void 0 ? void 0 : _currentPeriod$settle.periodicity;
19
- const currentSettlement = (currentPeriod === null || currentPeriod === void 0 ? void 0 : (_currentPeriod$settle2 = currentPeriod.settlements) === null || _currentPeriod$settle2 === void 0 ? void 0 : (_currentPeriod$settle3 = _currentPeriod$settle2.current) === null || _currentPeriod$settle3 === void 0 ? void 0 : _currentPeriod$settle3.number) || '-';
20
- const totalSettlements = (currentPeriod === null || currentPeriod === void 0 ? void 0 : (_currentPeriod$settle4 = currentPeriod.settlements) === null || _currentPeriod$settle4 === void 0 ? void 0 : _currentPeriod$settle4.total_settlements) || '-';
21
- const periodYear = (currentPeriod === null || currentPeriod === void 0 ? void 0 : currentPeriod.year) || '-';
17
+ var currentPeriod = (0, _periods.getCurrentPeriod)(billData);
18
+ var periodicity = currentPeriod === null || currentPeriod === void 0 ? void 0 : (_currentPeriod$settle = currentPeriod.settlements) === null || _currentPeriod$settle === void 0 ? void 0 : _currentPeriod$settle.periodicity;
19
+ var currentSettlement = (currentPeriod === null || currentPeriod === void 0 ? void 0 : (_currentPeriod$settle2 = currentPeriod.settlements) === null || _currentPeriod$settle2 === void 0 ? void 0 : (_currentPeriod$settle3 = _currentPeriod$settle2.current) === null || _currentPeriod$settle3 === void 0 ? void 0 : _currentPeriod$settle3.number) || '-';
20
+ var totalSettlements = (currentPeriod === null || currentPeriod === void 0 ? void 0 : (_currentPeriod$settle4 = currentPeriod.settlements) === null || _currentPeriod$settle4 === void 0 ? void 0 : _currentPeriod$settle4.total_settlements) || '-';
21
+ var periodYear = (currentPeriod === null || currentPeriod === void 0 ? void 0 : currentPeriod.year) || '-';
22
22
  return {
23
23
  periodicity: (0, _string.stringToCompareWithoutAccentsInclusive)(periodicity, _periodicities.PERIODICITY.BIMONTHLY) ? texts.commons.bimester : '-',
24
- currentSettlement,
25
- totalSettlements,
24
+ currentSettlement: currentSettlement,
25
+ totalSettlements: totalSettlements,
26
26
  periodNumber: (currentPeriod === null || currentPeriod === void 0 ? void 0 : currentPeriod.number) || '-',
27
- periodYear
27
+ periodYear: periodYear
28
28
  };
29
29
  };
30
30
 
@@ -17,56 +17,84 @@ var _periods = require("./periods");
17
17
 
18
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
19
 
20
- const getCurrentConsumption = (period, energyType) => {
20
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
21
+
22
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
23
+
24
+ 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); }
25
+
26
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
27
+
28
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
29
+
30
+ 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; }
31
+
32
+ var getCurrentConsumption = function getCurrentConsumption(period, energyType) {
21
33
  var _period$settlements, _period$settlements$c, _period$settlements$c2;
22
34
 
23
- return (period === null || period === void 0 ? void 0 : (_period$settlements = period.settlements) === null || _period$settlements === void 0 ? void 0 : (_period$settlements$c = _period$settlements.current) === null || _period$settlements$c === void 0 ? void 0 : (_period$settlements$c2 = _period$settlements$c.consumptions) === null || _period$settlements$c2 === void 0 ? void 0 : _period$settlements$c2.find(consumption => (0, _string.stringToCompareWithoutAccentsInclusive)(consumption.magnitude, energyType))) || {};
35
+ return (period === null || period === void 0 ? void 0 : (_period$settlements = period.settlements) === null || _period$settlements === void 0 ? void 0 : (_period$settlements$c = _period$settlements.current) === null || _period$settlements$c === void 0 ? void 0 : (_period$settlements$c2 = _period$settlements$c.consumptions) === null || _period$settlements$c2 === void 0 ? void 0 : _period$settlements$c2.find(function (consumption) {
36
+ return (0, _string.stringToCompareWithoutAccentsInclusive)(consumption.magnitude, energyType);
37
+ })) || {};
24
38
  };
25
39
 
26
40
  exports.getCurrentConsumption = getCurrentConsumption;
27
41
 
28
- const getRemainingConsumption = (period, energyType) => {
42
+ var getRemainingConsumption = function getRemainingConsumption(period, energyType) {
29
43
  var _period$settlements2, _period$settlements2$, _period$settlements2$2;
30
44
 
31
- const remaining = (period === null || period === void 0 ? void 0 : (_period$settlements2 = period.settlements) === null || _period$settlements2 === void 0 ? void 0 : (_period$settlements2$ = _period$settlements2.remaining) === null || _period$settlements2$ === void 0 ? void 0 : (_period$settlements2$2 = _period$settlements2$[0]) === null || _period$settlements2$2 === void 0 ? void 0 : _period$settlements2$2.consumptions) || [];
32
- return remaining.find(item => (0, _string.stringToCompareWithoutAccentsInclusive)(item.magnitude, energyType)) || {};
45
+ var remaining = (period === null || period === void 0 ? void 0 : (_period$settlements2 = period.settlements) === null || _period$settlements2 === void 0 ? void 0 : (_period$settlements2$ = _period$settlements2.remaining) === null || _period$settlements2$ === void 0 ? void 0 : (_period$settlements2$2 = _period$settlements2$[0]) === null || _period$settlements2$2 === void 0 ? void 0 : _period$settlements2$2.consumptions) || [];
46
+ return remaining.find(function (item) {
47
+ return (0, _string.stringToCompareWithoutAccentsInclusive)(item.magnitude, energyType);
48
+ }) || {};
33
49
  };
34
50
 
35
51
  exports.getRemainingConsumption = getRemainingConsumption;
36
52
 
37
- const getTotalConsumption = (period, energyOrPowerType) => {
53
+ var getTotalConsumption = function getTotalConsumption(period, energyOrPowerType) {
38
54
  var _period$consumptions;
39
55
 
40
- return (period === null || period === void 0 ? void 0 : (_period$consumptions = period.consumptions) === null || _period$consumptions === void 0 ? void 0 : _period$consumptions.find(consumption => (0, _string.stringToCompareWithoutAccentsInclusive)(consumption.type, _consumptions.CONSUMPTION_TYPES.TOTAL) && (0, _string.stringToCompareWithoutAccentsInclusive)(consumption.magnitude, energyOrPowerType))) || {};
56
+ return (period === null || period === void 0 ? void 0 : (_period$consumptions = period.consumptions) === null || _period$consumptions === void 0 ? void 0 : _period$consumptions.find(function (consumption) {
57
+ return (0, _string.stringToCompareWithoutAccentsInclusive)(consumption.type, _consumptions.CONSUMPTION_TYPES.TOTAL) && (0, _string.stringToCompareWithoutAccentsInclusive)(consumption.magnitude, energyOrPowerType);
58
+ })) || {};
41
59
  };
42
60
 
43
61
  exports.getTotalConsumption = getTotalConsumption;
44
62
 
45
- const getDailyConsumption = (period, energyType) => {
63
+ var getDailyConsumption = function getDailyConsumption(period, energyType) {
46
64
  var _period$consumptions2;
47
65
 
48
- return (period === null || period === void 0 ? void 0 : (_period$consumptions2 = period.consumptions) === null || _period$consumptions2 === void 0 ? void 0 : _period$consumptions2.find(consumption => (0, _string.stringToCompareWithoutAccentsInclusive)(consumption.type, _consumptions.CONSUMPTION_TYPES.DAILY) && (0, _string.stringToCompareWithoutAccentsInclusive)(consumption.magnitude, energyType))) || {};
66
+ return (period === null || period === void 0 ? void 0 : (_period$consumptions2 = period.consumptions) === null || _period$consumptions2 === void 0 ? void 0 : _period$consumptions2.find(function (consumption) {
67
+ return (0, _string.stringToCompareWithoutAccentsInclusive)(consumption.type, _consumptions.CONSUMPTION_TYPES.DAILY) && (0, _string.stringToCompareWithoutAccentsInclusive)(consumption.magnitude, energyType);
68
+ })) || {};
49
69
  };
50
70
 
51
71
  exports.getDailyConsumption = getDailyConsumption;
52
72
 
53
- const formatPeriod = period => period.number && period.year && "".concat(period.number, "/").concat((0, _dayjs.default)(period.year, 'YYYY').format('YY'));
73
+ var formatPeriod = function formatPeriod(period) {
74
+ return period.number && period.year && "".concat(period.number, "/").concat((0, _dayjs.default)(period.year, 'YYYY').format('YY'));
75
+ };
54
76
 
55
- const getConsumptionHistoryData = (billDataParameter, energyType, showPeriodsInChronologicalOrder) => {
77
+ var getConsumptionHistoryData = function getConsumptionHistoryData(billDataParameter, energyType, showPeriodsInChronologicalOrder) {
56
78
  var _billData$periods;
57
79
 
58
- const billData = _lodash.default.cloneDeep(billDataParameter);
59
-
60
- const currentPeriod = (0, _periods.getCurrentPeriod)(billData);
61
- const lastYearPeriod = (0, _periods.getLastYearPeriod)(billData);
62
- const otherPeriods = billData === null || billData === void 0 ? void 0 : (_billData$periods = billData.periods) === null || _billData$periods === void 0 ? void 0 : _billData$periods.filter(period => !(0, _periods.areSamePeriods)(period, currentPeriod) && !(0, _periods.areSamePeriods)(period, lastYearPeriod) && period.consumptions).sort(_periods.comparePeriods);
63
- const periods = [...(lastYearPeriod.consumptions && showPeriodsInChronologicalOrder ? [lastYearPeriod] : []), ...otherPeriods, ...(currentPeriod.consumptions ? [currentPeriod] : []), ...(lastYearPeriod.consumptions && !showPeriodsInChronologicalOrder ? [lastYearPeriod] : [])].filter(period => getTotalConsumption(period, energyType).value === 0 || getTotalConsumption(period, energyType).value).map(period => ({
64
- period: formatPeriod(period),
65
- consumption: getTotalConsumption(period, energyType).value,
66
- unit: getTotalConsumption(period, energyType).unit
67
- }));
80
+ var billData = _lodash.default.cloneDeep(billDataParameter);
81
+
82
+ var currentPeriod = (0, _periods.getCurrentPeriod)(billData);
83
+ var lastYearPeriod = (0, _periods.getLastYearPeriod)(billData);
84
+ var otherPeriods = billData === null || billData === void 0 ? void 0 : (_billData$periods = billData.periods) === null || _billData$periods === void 0 ? void 0 : _billData$periods.filter(function (period) {
85
+ return !(0, _periods.areSamePeriods)(period, currentPeriod) && !(0, _periods.areSamePeriods)(period, lastYearPeriod) && period.consumptions;
86
+ }).sort(_periods.comparePeriods);
87
+ var periods = [].concat(_toConsumableArray(lastYearPeriod.consumptions && showPeriodsInChronologicalOrder ? [lastYearPeriod] : []), _toConsumableArray(otherPeriods), _toConsumableArray(currentPeriod.consumptions ? [currentPeriod] : []), _toConsumableArray(lastYearPeriod.consumptions && !showPeriodsInChronologicalOrder ? [lastYearPeriod] : [])).filter(function (period) {
88
+ return getTotalConsumption(period, energyType).value === 0 || getTotalConsumption(period, energyType).value;
89
+ }).map(function (period) {
90
+ return {
91
+ period: formatPeriod(period),
92
+ consumption: getTotalConsumption(period, energyType).value,
93
+ unit: getTotalConsumption(period, energyType).unit
94
+ };
95
+ });
68
96
  return {
69
- periods,
97
+ periods: periods,
70
98
  currentPeriod: formatPeriod(currentPeriod),
71
99
  lastYearPeriod: formatPeriod(lastYearPeriod),
72
100
  unit: getTotalConsumption(currentPeriod, energyType).unit
@@ -75,13 +103,19 @@ const getConsumptionHistoryData = (billDataParameter, energyType, showPeriodsInC
75
103
 
76
104
  exports.getConsumptionHistoryData = getConsumptionHistoryData;
77
105
 
78
- const consumptionDataMapper = function () {
79
- let periods = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
80
- let texts = arguments.length > 1 ? arguments[1] : undefined;
81
- let dataMappers = arguments.length > 2 ? arguments[2] : undefined;
82
- const currentPeriod = periods.find(item => item.current);
106
+ var consumptionDataMapper = function consumptionDataMapper() {
107
+ var periods = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
108
+ var texts = arguments.length > 1 ? arguments[1] : undefined;
109
+ var dataMappers = arguments.length > 2 ? arguments[2] : undefined;
110
+ var currentPeriod = periods.find(function (item) {
111
+ return item.current;
112
+ });
83
113
  if (!currentPeriod) return [];
84
- return dataMappers.map(dataMapper => dataMapper(currentPeriod, texts)).sort((a, b) => a.order - b.order);
114
+ return dataMappers.map(function (dataMapper) {
115
+ return dataMapper(currentPeriod, texts);
116
+ }).sort(function (a, b) {
117
+ return a.order - b.order;
118
+ });
85
119
  };
86
120
 
87
121
  exports.consumptionDataMapper = consumptionDataMapper;
@@ -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
  });
@@ -7,14 +9,12 @@ exports.unpackComponents = void 0;
7
9
 
8
10
  var COMPONENTS = _interopRequireWildcard(require("../constants/components"));
9
11
 
10
- 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); }
12
+ 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); }
11
13
 
12
- 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; }
14
+ 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; }
13
15
 
14
- const unpackComponents = contextApiInfo => {
15
- const {
16
- components
17
- } = contextApiInfo;
16
+ var unpackComponents = function unpackComponents(contextApiInfo) {
17
+ var components = contextApiInfo.components;
18
18
  return {
19
19
  Button: components[COMPONENTS.BUTTON],
20
20
  Dialog: components[COMPONENTS.DIALOG],
@@ -26,7 +26,8 @@ const unpackComponents = contextApiInfo => {
26
26
  Card: components[COMPONENTS.CARD],
27
27
  Markdown: components[COMPONENTS.MARKDOWN],
28
28
  Toggle: components[COMPONENTS.TOGGLE],
29
- BarChart: components[COMPONENTS.BAR_CHART]
29
+ BarChart: components[COMPONENTS.BAR_CHART],
30
+ PieChart: components[COMPONENTS.PIE_CHART]
30
31
  };
31
32
  };
32
33
 
@@ -7,6 +7,10 @@ exports.getExpiration = void 0;
7
7
 
8
8
  var _seamlessImmutable = require("seamless-immutable");
9
9
 
10
- const getExpiration = (billData, number) => (0, _seamlessImmutable.getIn)(billData, ['expirations'], []).find(expiration => expiration.number === number) || {};
10
+ var getExpiration = function getExpiration(billData, number) {
11
+ return (0, _seamlessImmutable.getIn)(billData, ['expirations'], []).find(function (expiration) {
12
+ return expiration.number === number;
13
+ }) || {};
14
+ };
11
15
 
12
16
  exports.getExpiration = getExpiration;
@@ -7,21 +7,27 @@ exports.getSavingsPercentage = exports.getLastYearPeriod = exports.getCurrentPer
7
7
 
8
8
  var _seamlessImmutable = require("seamless-immutable");
9
9
 
10
- const getCurrentPeriod = billData => (0, _seamlessImmutable.getIn)(billData, ['periods'], []).find(period => period.current) || {};
10
+ var getCurrentPeriod = function getCurrentPeriod(billData) {
11
+ return (0, _seamlessImmutable.getIn)(billData, ['periods'], []).find(function (period) {
12
+ return period.current;
13
+ }) || {};
14
+ };
11
15
 
12
16
  exports.getCurrentPeriod = getCurrentPeriod;
13
17
 
14
- const getLastYearPeriod = billData => {
15
- const currentPeriod = getCurrentPeriod(billData);
16
- const lastYear = "".concat(parseInt(currentPeriod.year, 10) - 1);
17
- return (0, _seamlessImmutable.getIn)(billData, ['periods'], []).find(period => period.number === currentPeriod.number && period.year === lastYear) || {};
18
+ var getLastYearPeriod = function getLastYearPeriod(billData) {
19
+ var currentPeriod = getCurrentPeriod(billData);
20
+ var lastYear = "".concat(parseInt(currentPeriod.year, 10) - 1);
21
+ return (0, _seamlessImmutable.getIn)(billData, ['periods'], []).find(function (period) {
22
+ return period.number === currentPeriod.number && period.year === lastYear;
23
+ }) || {};
18
24
  };
19
25
 
20
26
  exports.getLastYearPeriod = getLastYearPeriod;
21
27
 
22
- const areSamePeriods = function () {
23
- let period1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
24
- let period2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
28
+ var areSamePeriods = function areSamePeriods() {
29
+ var period1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
30
+ var period2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
25
31
 
26
32
  if (period1.number && period1.year && period2.number && period2.year) {
27
33
  return period1.number === period2.number && period1.year === period2.year;
@@ -32,12 +38,12 @@ const areSamePeriods = function () {
32
38
 
33
39
  exports.areSamePeriods = areSamePeriods;
34
40
 
35
- const comparePeriods = (period1, period2) => {
41
+ var comparePeriods = function comparePeriods(period1, period2) {
36
42
  if (period1 && period1.number && period1.year && period2 && period2.number && period2.year) {
37
- const number1 = parseInt(period1.number, 10);
38
- const number2 = parseInt(period2.number, 10);
39
- const year1 = parseInt(period1.year, 10);
40
- const year2 = parseInt(period2.year, 10);
43
+ var number1 = parseInt(period1.number, 10);
44
+ var number2 = parseInt(period2.number, 10);
45
+ var year1 = parseInt(period1.year, 10);
46
+ var year2 = parseInt(period2.year, 10);
41
47
  if (year1 > year2) return 1;
42
48
  if (year1 === year2 && number1 > number2) return 1;
43
49
  return -1;
@@ -48,7 +54,7 @@ const comparePeriods = (period1, period2) => {
48
54
 
49
55
  exports.comparePeriods = comparePeriods;
50
56
 
51
- const getSavingsPercentage = period => {
57
+ var getSavingsPercentage = function getSavingsPercentage(period) {
52
58
  var _period$additional_in;
53
59
 
54
60
  return period === null || period === void 0 ? void 0 : (_period$additional_in = period.additional_information) === null || _period$additional_in === void 0 ? void 0 : _period$additional_in.savings_percentage;
@@ -9,6 +9,10 @@ var _seamlessImmutable = require("seamless-immutable");
9
9
 
10
10
  var _string = require("@widergy/web-utils/lib/string");
11
11
 
12
- const getCharge = (billData, concept) => (0, _seamlessImmutable.getIn)(billData, ['client', 'rate', 'charges'], []).find(charge => (0, _string.stringCompare)(charge.concept, concept)) || {};
12
+ var getCharge = function getCharge(billData, concept) {
13
+ return (0, _seamlessImmutable.getIn)(billData, ['client', 'rate', 'charges'], []).find(function (charge) {
14
+ return (0, _string.stringCompare)(charge.concept, concept);
15
+ }) || {};
16
+ };
13
17
 
14
18
  exports.getCharge = getCharge;
@@ -11,10 +11,18 @@ var _string = require("@widergy/web-utils/lib/string");
11
11
 
12
12
  var _consumptions = require("../constants/consumptions");
13
13
 
14
- const getReadingPeriod = (billData, moment) => (0, _seamlessImmutable.getIn)(billData, ['reading_periods'], []).find(readingPeriod => (0, _string.stringCompare)(readingPeriod.moment, moment)) || {};
14
+ var getReadingPeriod = function getReadingPeriod(billData, moment) {
15
+ return (0, _seamlessImmutable.getIn)(billData, ['reading_periods'], []).find(function (readingPeriod) {
16
+ return (0, _string.stringCompare)(readingPeriod.moment, moment);
17
+ }) || {};
18
+ };
15
19
 
16
20
  exports.getReadingPeriod = getReadingPeriod;
17
21
 
18
- const getActiveEnergyRecord = readingPeriod => (0, _seamlessImmutable.getIn)(readingPeriod, ['records'], []).find(record => (0, _string.stringToCompareWithoutAccentsInclusive)(record.magnitude, _consumptions.ENERGY_TYPES.ACTIVE)) || {};
22
+ var getActiveEnergyRecord = function getActiveEnergyRecord(readingPeriod) {
23
+ return (0, _seamlessImmutable.getIn)(readingPeriod, ['records'], []).find(function (record) {
24
+ return (0, _string.stringToCompareWithoutAccentsInclusive)(record.magnitude, _consumptions.ENERGY_TYPES.ACTIVE);
25
+ }) || {};
26
+ };
19
27
 
20
28
  exports.getActiveEnergyRecord = getActiveEnergyRecord;
@@ -7,6 +7,10 @@ exports.getSeason = void 0;
7
7
 
8
8
  var _seasons = require("../constants/seasons");
9
9
 
10
- const getSeason = monthNumber => (_seasons.SEASON_PERIODS.find(seasonPeriod => seasonPeriod.initMonth <= monthNumber && seasonPeriod.endingMonth >= monthNumber) || {}).season;
10
+ var getSeason = function getSeason(monthNumber) {
11
+ return (_seasons.SEASON_PERIODS.find(function (seasonPeriod) {
12
+ return seasonPeriod.initMonth <= monthNumber && seasonPeriod.endingMonth >= monthNumber;
13
+ }) || {}).season;
14
+ };
11
15
 
12
16
  exports.getSeason = getSeason;