@widergy/utilitygo-smart-bill-web 1.9.0 → 1.11.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 (129) 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 +55 -52
  38. package/dist/components/ConsumptionEnergyDetails/styles.module.scss +12 -0
  39. package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/index.js +65 -66
  40. package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/utils.js +13 -11
  41. package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderConsumption/index.js +19 -22
  42. package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderSettlement/index.js +10 -16
  43. package/dist/components/ConsumptionIncluded/components/TimelineRow/index.js +39 -43
  44. package/dist/components/ConsumptionIncluded/index.js +36 -34
  45. package/dist/components/ConsumptionIncluded/utils.js +33 -29
  46. package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/components/ReadingRow/index.js +10 -14
  47. package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/index.js +22 -25
  48. package/dist/components/ConsumptionPeriod/components/HistoryGraph/index.js +34 -18
  49. package/dist/components/ConsumptionPeriod/components/Reading/index.js +34 -37
  50. package/dist/components/ConsumptionPeriod/index.js +8 -12
  51. package/dist/components/ConsumptionPeriod/utils.js +15 -13
  52. package/dist/components/Date/index.js +9 -12
  53. package/dist/components/DebtState/index.js +8 -14
  54. package/dist/components/IconAndDetails/index.js +17 -19
  55. package/dist/components/Magnitude/index.js +12 -15
  56. package/dist/components/Magnitude/utils.js +8 -2
  57. package/dist/components/MainBillData/components/BillAlert/components/BillParticularConditions/index.js +16 -20
  58. package/dist/components/MainBillData/components/BillAlert/index.js +45 -28
  59. package/dist/components/MainBillData/components/BillBody/components/ClientData/index.js +11 -19
  60. package/dist/components/MainBillData/components/BillBody/components/Consumption/index.js +11 -14
  61. package/dist/components/MainBillData/components/BillBody/components/Consumption/utils.js +3 -1
  62. package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/index.js +15 -23
  63. package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/utils.js +1 -1
  64. package/dist/components/MainBillData/components/BillBody/index.js +50 -45
  65. package/dist/components/MainBillData/components/BillHeader/components/TypeAndNumber/index.js +9 -15
  66. package/dist/components/MainBillData/components/BillHeader/index.js +26 -29
  67. package/dist/components/MainBillData/index.js +5 -7
  68. package/dist/components/MainBillData/theme.js +9 -7
  69. package/dist/components/MainBillData/utils.js +5 -1
  70. package/dist/components/Period/index.js +47 -55
  71. package/dist/components/PowerProgresBar/components/PowerConsumption/index.js +11 -15
  72. package/dist/components/PowerProgresBar/index.js +36 -36
  73. package/dist/components/RateAndCategory/index.js +31 -30
  74. package/dist/components/RatesDefinition/components/BillRate/components/RatePrices/index.js +13 -20
  75. package/dist/components/RatesDefinition/components/BillRate/index.js +14 -24
  76. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/Category/index.js +9 -14
  77. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/components/Stage/components/LimitsLine/index.js +7 -5
  78. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/components/Stage/components/SubStage/index.js +13 -19
  79. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/components/Stage/components/SubStage/utils.js +3 -1
  80. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/components/Stage/index.js +18 -18
  81. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/index.js +19 -19
  82. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/components/IndicatorLabel/index.js +21 -26
  83. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/index.js +12 -15
  84. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/utils.js +37 -35
  85. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/LegendItem/index.js +25 -25
  86. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/constants.js +18 -18
  87. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/index.js +32 -12
  88. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/utils.js +20 -12
  89. package/dist/components/RatesDefinition/components/CategoryByConsumption/index.js +50 -32
  90. package/dist/components/RatesDefinition/components/PurchasedRate/index.js +13 -19
  91. package/dist/components/RatesDefinition/index.js +15 -20
  92. package/dist/components/SmartBillProvider/index.js +47 -12
  93. package/dist/components/StyledAmount/constants.js +1 -1
  94. package/dist/components/StyledAmount/index.js +35 -19
  95. package/dist/components/WithContextApi/index.js +27 -16
  96. package/dist/components/WithContextApi/layout.js +2 -2
  97. package/dist/components/WithSeason/index.js +9 -5
  98. package/dist/constants/deviceSizes.js +17 -27
  99. package/dist/constants/seasons.js +2 -2
  100. package/dist/index.js +16 -14
  101. package/dist/shared/Context/index.js +3 -5
  102. package/dist/shared/constants/aliases.js +550 -682
  103. package/dist/shared/constants/components.js +2 -1
  104. package/dist/shared/constants/consumptions.js +4 -4
  105. package/dist/shared/constants/periodicities.js +1 -1
  106. package/dist/shared/constants/rates.js +1 -1
  107. package/dist/shared/constants/readings.js +2 -2
  108. package/dist/shared/constants/seasons.js +2 -2
  109. package/dist/shared/constants/stagesGraph.js +4 -4
  110. package/dist/shared/types/assetsTypes.js +1 -1
  111. package/dist/shared/types/billDataTypes.js +4 -4
  112. package/dist/shared/types/componentsTypes.js +13 -18
  113. package/dist/shared/types/formattersTypes.js +1 -1
  114. package/dist/shared/types/rateStagesTypes.js +3 -3
  115. package/dist/shared/types/smartBillTypes.js +10 -5
  116. package/dist/shared/types/textsTypes.js +1 -1
  117. package/dist/shared/utils/billCalculation.js +9 -9
  118. package/dist/shared/utils/consumptions.js +62 -28
  119. package/dist/shared/utils/context.js +8 -7
  120. package/dist/shared/utils/expirations.js +5 -1
  121. package/dist/shared/utils/periods.js +20 -14
  122. package/dist/shared/utils/rates.js +5 -1
  123. package/dist/shared/utils/readings.js +10 -2
  124. package/dist/shared/utils/season.js +5 -1
  125. package/dist/shared/utils/stagesGraph.js +15 -11
  126. package/dist/utils/hooks.js +5 -37
  127. package/dist/utils.js +8 -4
  128. package/package.json +2 -2
  129. package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/utils.js +0 -27
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -33,63 +35,53 @@ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
33
35
 
34
36
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
35
37
 
36
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
38
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
37
39
 
38
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
40
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
39
41
 
40
- const Period = _ref => {
42
+ var Period = function Period(_ref) {
41
43
  var _settlements$current;
42
44
 
43
- let {
44
- contextApiInfo,
45
- billData,
46
- currentPeriod,
47
- multipleSettlements,
48
- issueedDate,
49
- alias
50
- } = _ref;
51
- const {
52
- assets,
53
- config,
54
- Label,
55
- Tooltip
56
- } = contextApiInfo;
57
- const {
58
- texts,
59
- formatters,
60
- colors
61
- } = config;
62
- const {
63
- periodFormatter
64
- } = formatters;
65
- const {
66
- bimester,
67
- ofPreposition,
68
- settlement,
69
- period,
70
- issuedOnDate
71
- } = texts.commons;
72
- const desktopAlias = alias || _aliases.PERIOD;
73
- const {
74
- isDesktopSize
75
- } = (0, _hooks.useScreenSize)();
76
- const debtStatusLabel = billData === null || billData === void 0 ? void 0 : billData.debt_status_label;
77
- const debtStatusValidation = !!debtStatusLabel;
78
- const settlements = currentPeriod === null || currentPeriod === void 0 ? void 0 : currentPeriod.settlements;
79
- const periodicity = settlements === null || settlements === void 0 ? void 0 : settlements.periodicity;
80
- const {
81
- number: periodNumber,
82
- year
83
- } = currentPeriod;
84
- const currentSettlement = settlements === null || settlements === void 0 ? void 0 : (_settlements$current = settlements.current) === null || _settlements$current === void 0 ? void 0 : _settlements$current.number;
85
- const totalSettlements = settlements === null || settlements === void 0 ? void 0 : settlements.total_settlements;
86
- const startDate = (0, _dayjs.default)(settlements === null || settlements === void 0 ? void 0 : settlements.start_date).format('DD/MM');
87
- const endDate = (0, _dayjs.default)(settlements === null || settlements === void 0 ? void 0 : settlements.end_date).format('DD/MM');
88
- const periodicityLabel = "".concat(multipleSettlements ? (0, _string.stringToCompareWithoutAccentsInclusive)(periodicity, _periodicities.PERIODICITY.BIMONTHLY) ? bimester : '-' : period, " ").concat((0, _utils.stringOrDash)(periodNumber));
89
- const settlementLabel = "".concat(settlement, " ").concat((0, _utils.numberOrDash)(currentSettlement), " ").concat(ofPreposition, " ").concat((0, _utils.numberOrDash)(totalSettlements));
90
- const issuedDateLabel = "".concat((0, _dayjs.default)(issueedDate, 'YYYY-MM-DD').format('DD/MM/YYYY'));
91
-
92
- const issuedOnDateLabel = /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
45
+ var contextApiInfo = _ref.contextApiInfo,
46
+ billData = _ref.billData,
47
+ currentPeriod = _ref.currentPeriod,
48
+ multipleSettlements = _ref.multipleSettlements,
49
+ issueedDate = _ref.issueedDate,
50
+ alias = _ref.alias;
51
+ var assets = contextApiInfo.assets,
52
+ config = contextApiInfo.config,
53
+ Label = contextApiInfo.Label,
54
+ Tooltip = contextApiInfo.Tooltip;
55
+ var texts = config.texts,
56
+ formatters = config.formatters,
57
+ colors = config.colors;
58
+ var periodFormatter = formatters.periodFormatter;
59
+ var _texts$commons = texts.commons,
60
+ bimester = _texts$commons.bimester,
61
+ ofPreposition = _texts$commons.ofPreposition,
62
+ settlement = _texts$commons.settlement,
63
+ period = _texts$commons.period,
64
+ issuedOnDate = _texts$commons.issuedOnDate;
65
+ var desktopAlias = alias || _aliases.PERIOD;
66
+
67
+ var _useScreenSize = (0, _hooks.useScreenSize)(),
68
+ isDesktopSize = _useScreenSize.isDesktopSize;
69
+
70
+ var debtStatusLabel = billData === null || billData === void 0 ? void 0 : billData.debt_status_label;
71
+ var debtStatusValidation = !!debtStatusLabel;
72
+ var settlements = currentPeriod === null || currentPeriod === void 0 ? void 0 : currentPeriod.settlements;
73
+ var periodicity = settlements === null || settlements === void 0 ? void 0 : settlements.periodicity;
74
+ var periodNumber = currentPeriod.number,
75
+ year = currentPeriod.year;
76
+ var currentSettlement = settlements === null || settlements === void 0 ? void 0 : (_settlements$current = settlements.current) === null || _settlements$current === void 0 ? void 0 : _settlements$current.number;
77
+ var totalSettlements = settlements === null || settlements === void 0 ? void 0 : settlements.total_settlements;
78
+ var startDate = (0, _dayjs.default)(settlements === null || settlements === void 0 ? void 0 : settlements.start_date).format('DD/MM');
79
+ var endDate = (0, _dayjs.default)(settlements === null || settlements === void 0 ? void 0 : settlements.end_date).format('DD/MM');
80
+ var periodicityLabel = "".concat(multipleSettlements ? (0, _string.stringToCompareWithoutAccentsInclusive)(periodicity, _periodicities.PERIODICITY.BIMONTHLY) ? bimester : '-' : period, " ").concat((0, _utils.stringOrDash)(periodNumber));
81
+ var settlementLabel = "".concat(settlement, " ").concat((0, _utils.numberOrDash)(currentSettlement), " ").concat(ofPreposition, " ").concat((0, _utils.numberOrDash)(totalSettlements));
82
+ var issuedDateLabel = "".concat((0, _dayjs.default)(issueedDate, 'YYYY-MM-DD').format('DD/MM/YYYY'));
83
+
84
+ var issuedOnDateLabel = /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
93
85
  className: _stylesModule.default.issueDateContainer
94
86
  }, /*#__PURE__*/_react.default.createElement(Label, {
95
87
  className: _stylesModule.default.issueDate,
@@ -98,8 +90,8 @@ const Period = _ref => {
98
90
  alias: _aliases.PERIOD_ISSUED_DATE
99
91
  }, issuedDateLabel)));
100
92
 
101
- const yearAndPeriodicityLabel = "".concat((0, _utils.stringOrDash)(year), " - ").concat(periodicityLabel);
102
- const bimesterOfYearLabel = "".concat(periodicityLabel, " ").concat(ofPreposition, " ").concat((0, _utils.stringOrDash)(year));
93
+ var yearAndPeriodicityLabel = "".concat((0, _utils.stringOrDash)(year), " - ").concat(periodicityLabel);
94
+ var bimesterOfYearLabel = "".concat(periodicityLabel, " ").concat(ofPreposition, " ").concat((0, _utils.stringOrDash)(year));
103
95
  return periodFormatter ? /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
104
96
  className: issueedDate ? _stylesModule.default.withIssuedDateContainer : _stylesModule.default.withOutIssuedDateContainer
105
97
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -19,21 +19,17 @@ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
19
19
 
20
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
21
 
22
- const PowerConsumption = _ref => {
23
- let {
24
- contextApiInfo,
25
- consumption,
26
- unit,
27
- text,
28
- isHired,
29
- powerExceeded
30
- } = _ref;
31
- const {
32
- Label
33
- } = contextApiInfo;
34
- const alias = !isHired ? _aliases.POWER_CONSUMPTION : _aliases.POWER_CONSUMPTION_GRAY;
35
- const unitAlias = !isHired ? _aliases.POWER_CONSUMPTION_UNIT : _aliases.POWER_CONSUMPTION_UNIT_GRAY;
36
- const textAlias = !isHired ? _aliases.POWER_CONSUMPTION_TEXT : _aliases.POWER_CONSUMPTION_TEXT_GRAY;
22
+ var PowerConsumption = function PowerConsumption(_ref) {
23
+ var contextApiInfo = _ref.contextApiInfo,
24
+ consumption = _ref.consumption,
25
+ unit = _ref.unit,
26
+ text = _ref.text,
27
+ isHired = _ref.isHired,
28
+ powerExceeded = _ref.powerExceeded;
29
+ var Label = contextApiInfo.Label;
30
+ var alias = !isHired ? _aliases.POWER_CONSUMPTION : _aliases.POWER_CONSUMPTION_GRAY;
31
+ var unitAlias = !isHired ? _aliases.POWER_CONSUMPTION_UNIT : _aliases.POWER_CONSUMPTION_UNIT_GRAY;
32
+ var textAlias = !isHired ? _aliases.POWER_CONSUMPTION_TEXT : _aliases.POWER_CONSUMPTION_TEXT_GRAY;
37
33
  return /*#__PURE__*/_react.default.createElement("div", {
38
34
  className: _stylesModule.default.powerLabel
39
35
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -23,42 +25,40 @@ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
23
25
 
24
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
27
 
26
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
27
-
28
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
29
-
30
- const PowerProgresBar = _ref => {
31
- let {
32
- contextApiInfo,
33
- hiredPowerConsumption,
34
- registeredPowerConsumption,
35
- exceededPower
36
- } = _ref;
37
- const {
38
- ProgressBar,
39
- config,
40
- Label,
41
- assets
42
- } = contextApiInfo;
43
- const {
44
- texts
45
- } = config;
46
- const {
47
- RedAlertIcon
48
- } = assets;
49
- const powerExceeded = exceededPower.alert_message;
50
-
51
- const powerConsumption = (consumption, unit, text, isHired) => /*#__PURE__*/_react.default.createElement(_PowerConsumption.default, {
52
- consumption: consumption,
53
- unit: unit,
54
- text: text,
55
- isHired: isHired,
56
- powerExceeded: powerExceeded
57
- });
58
-
59
- const HiredPowerLabel = () => powerConsumption(hiredPowerConsumption.value, hiredPowerConsumption.unit, texts.commons.hired, true);
60
-
61
- const RegisteredPowerLabel = () => powerConsumption(registeredPowerConsumption.value, registeredPowerConsumption.unit, texts.commons.registered);
28
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
29
+
30
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
31
+
32
+ var PowerProgresBar = function PowerProgresBar(_ref) {
33
+ var contextApiInfo = _ref.contextApiInfo,
34
+ hiredPowerConsumption = _ref.hiredPowerConsumption,
35
+ registeredPowerConsumption = _ref.registeredPowerConsumption,
36
+ exceededPower = _ref.exceededPower;
37
+ var ProgressBar = contextApiInfo.ProgressBar,
38
+ config = contextApiInfo.config,
39
+ Label = contextApiInfo.Label,
40
+ assets = contextApiInfo.assets;
41
+ var texts = config.texts;
42
+ var RedAlertIcon = assets.RedAlertIcon;
43
+ var powerExceeded = exceededPower.alert_message;
44
+
45
+ var powerConsumption = function powerConsumption(consumption, unit, text, isHired) {
46
+ return /*#__PURE__*/_react.default.createElement(_PowerConsumption.default, {
47
+ consumption: consumption,
48
+ unit: unit,
49
+ text: text,
50
+ isHired: isHired,
51
+ powerExceeded: powerExceeded
52
+ });
53
+ };
54
+
55
+ var HiredPowerLabel = function HiredPowerLabel() {
56
+ return powerConsumption(hiredPowerConsumption.value, hiredPowerConsumption.unit, texts.commons.hired, true);
57
+ };
58
+
59
+ var RegisteredPowerLabel = function RegisteredPowerLabel() {
60
+ return powerConsumption(registeredPowerConsumption.value, registeredPowerConsumption.unit, texts.commons.registered);
61
+ };
62
62
 
63
63
  return /*#__PURE__*/_react.default.createElement("div", {
64
64
  className: _stylesModule.default.container
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -21,36 +23,35 @@ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
21
23
 
22
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
25
 
24
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
25
-
26
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
-
28
- const RatePrices = _ref => {
29
- let {
30
- contextApiInfo,
31
- rate,
32
- category,
33
- title,
34
- classes = {},
35
- showCategory
36
- } = _ref;
37
- const {
38
- config,
39
- Label
40
- } = contextApiInfo;
41
- const {
42
- commons
43
- } = config.texts;
44
-
45
- const Title = () => /*#__PURE__*/_react.default.createElement(Label, {
46
- alias: _aliases.TITLE,
47
- className: "".concat(_stylesModule.default.title, " ").concat(classes.title)
48
- }, title);
49
-
50
- const Category = () => /*#__PURE__*/_react.default.createElement(Label, {
51
- alias: _aliases.CATEGORY,
52
- className: "".concat(_stylesModule.default.category, " ").concat(classes.category)
53
- }, "".concat(commons.category, " ").concat((0, _utils.stringOrDash)(category)));
26
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
27
+
28
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
29
+
30
+ var RatePrices = function RatePrices(_ref) {
31
+ var contextApiInfo = _ref.contextApiInfo,
32
+ rate = _ref.rate,
33
+ category = _ref.category,
34
+ title = _ref.title,
35
+ _ref$classes = _ref.classes,
36
+ classes = _ref$classes === void 0 ? {} : _ref$classes,
37
+ showCategory = _ref.showCategory;
38
+ var config = contextApiInfo.config,
39
+ Label = contextApiInfo.Label;
40
+ var commons = config.texts.commons;
41
+
42
+ var Title = function Title() {
43
+ return /*#__PURE__*/_react.default.createElement(Label, {
44
+ alias: _aliases.TITLE,
45
+ className: "".concat(_stylesModule.default.title, " ").concat(classes.title)
46
+ }, title);
47
+ };
48
+
49
+ var Category = function Category() {
50
+ return /*#__PURE__*/_react.default.createElement(Label, {
51
+ alias: _aliases.CATEGORY,
52
+ className: "".concat(_stylesModule.default.category, " ").concat(classes.category)
53
+ }, "".concat(commons.category, " ").concat((0, _utils.stringOrDash)(category)));
54
+ };
54
55
 
55
56
  return /*#__PURE__*/_react.default.createElement("div", {
56
57
  className: "".concat(_stylesModule.default.container, " ").concat(classes.container)
@@ -21,26 +21,19 @@ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
21
21
 
22
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
23
 
24
- const RateAndCategory = _ref => {
25
- let {
26
- contextApiInfo,
27
- fixedChargeValue,
28
- variableChargeValue
29
- } = _ref;
30
- const {
31
- config,
32
- ExternalLink,
33
- Label
34
- } = contextApiInfo;
35
- const {
36
- ratesTableLink
37
- } = config.externalLinks;
38
- const {
39
- fixedCharge,
40
- variableCharge,
41
- currency,
42
- seeRatesTable
43
- } = config.texts.ratesDefinition;
24
+ var RateAndCategory = function RateAndCategory(_ref) {
25
+ var contextApiInfo = _ref.contextApiInfo,
26
+ fixedChargeValue = _ref.fixedChargeValue,
27
+ variableChargeValue = _ref.variableChargeValue;
28
+ var config = contextApiInfo.config,
29
+ ExternalLink = contextApiInfo.ExternalLink,
30
+ Label = contextApiInfo.Label;
31
+ var ratesTableLink = config.externalLinks.ratesTableLink;
32
+ var _config$texts$ratesDe = config.texts.ratesDefinition,
33
+ fixedCharge = _config$texts$ratesDe.fixedCharge,
34
+ variableCharge = _config$texts$ratesDe.variableCharge,
35
+ currency = _config$texts$ratesDe.currency,
36
+ seeRatesTable = _config$texts$ratesDe.seeRatesTable;
44
37
  return /*#__PURE__*/_react.default.createElement("div", {
45
38
  className: _stylesModule.default.container
46
39
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -21,30 +21,20 @@ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
21
21
 
22
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
23
 
24
- const BillRate = _ref => {
25
- let {
26
- contextApiInfo,
27
- rate,
28
- category,
29
- fixedCharge,
30
- variableCharge
31
- } = _ref;
32
- const {
33
- assets,
34
- config,
35
- Label,
36
- Tooltip
37
- } = contextApiInfo;
38
- const {
39
- texts,
40
- colors
41
- } = config;
42
- const {
43
- rateFormatter
44
- } = config.formatters;
45
- const {
46
- billRatePrices
47
- } = config.texts.ratesDefinition;
24
+ var BillRate = function BillRate(_ref) {
25
+ var contextApiInfo = _ref.contextApiInfo,
26
+ rate = _ref.rate,
27
+ category = _ref.category,
28
+ fixedCharge = _ref.fixedCharge,
29
+ variableCharge = _ref.variableCharge;
30
+ var assets = contextApiInfo.assets,
31
+ config = contextApiInfo.config,
32
+ Label = contextApiInfo.Label,
33
+ Tooltip = contextApiInfo.Tooltip;
34
+ var texts = config.texts,
35
+ colors = config.colors;
36
+ var rateFormatter = config.formatters.rateFormatter;
37
+ var billRatePrices = config.texts.ratesDefinition.billRatePrices;
48
38
  return /*#__PURE__*/_react.default.createElement("div", {
49
39
  className: _stylesModule.default.container
50
40
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -21,20 +21,15 @@ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
21
21
 
22
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
23
 
24
- const Category = _ref => {
25
- let {
26
- contextApiInfo,
27
- category,
28
- wrap
29
- } = _ref;
30
- const {
31
- config,
32
- Label
33
- } = contextApiInfo;
34
- const {
35
- commons,
36
- ratesDefinition
37
- } = config.texts;
24
+ var Category = function Category(_ref) {
25
+ var contextApiInfo = _ref.contextApiInfo,
26
+ category = _ref.category,
27
+ wrap = _ref.wrap;
28
+ var config = contextApiInfo.config,
29
+ Label = contextApiInfo.Label;
30
+ var _config$texts = config.texts,
31
+ commons = _config$texts.commons,
32
+ ratesDefinition = _config$texts.ratesDefinition;
38
33
  return /*#__PURE__*/_react.default.createElement("div", {
39
34
  className: wrap ? _stylesModule.default.containerWrap : _stylesModule.default.container
40
35
  }, /*#__PURE__*/_react.default.createElement(Label, {
@@ -11,11 +11,13 @@ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
11
11
 
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
13
 
14
- const LimitsLine = () => /*#__PURE__*/_react.default.createElement("div", {
15
- className: _stylesModule.default.lateralLines
16
- }, /*#__PURE__*/_react.default.createElement("div", {
17
- className: _stylesModule.default.middleLine
18
- }));
14
+ var LimitsLine = function LimitsLine() {
15
+ return /*#__PURE__*/_react.default.createElement("div", {
16
+ className: _stylesModule.default.lateralLines
17
+ }, /*#__PURE__*/_react.default.createElement("div", {
18
+ className: _stylesModule.default.middleLine
19
+ }));
20
+ };
19
21
 
20
22
  var _default = LimitsLine;
21
23
  exports.default = _default;
@@ -25,28 +25,22 @@ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
25
25
 
26
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
27
 
28
- const SubStage = _ref => {
29
- let {
30
- contextApiInfo,
31
- stage,
32
- subStage,
33
- isLast,
34
- isDesktop,
35
- index,
36
- totalSubStages
37
- } = _ref;
38
- const {
39
- Label
40
- } = contextApiInfo;
41
- const {
42
- getStageColor
43
- } = contextApiInfo.config;
44
- const width = isDesktop ? "calc(".concat((0, _utils.getSubStageWidth)(stage, subStage), "%)") : "calc(100% / ".concat(stage.sub_rate_stages.length || 1, ")");
28
+ var SubStage = function SubStage(_ref) {
29
+ var contextApiInfo = _ref.contextApiInfo,
30
+ stage = _ref.stage,
31
+ subStage = _ref.subStage,
32
+ isLast = _ref.isLast,
33
+ isDesktop = _ref.isDesktop,
34
+ index = _ref.index,
35
+ totalSubStages = _ref.totalSubStages;
36
+ var Label = contextApiInfo.Label;
37
+ var getStageColor = contextApiInfo.config.getStageColor;
38
+ var width = isDesktop ? "calc(".concat((0, _utils.getSubStageWidth)(stage, subStage), "%)") : "calc(100% / ".concat(stage.sub_rate_stages.length || 1, ")");
45
39
  return /*#__PURE__*/_react.default.createElement("div", {
46
40
  style: {
47
41
  marginRight: isLast ? _constants.LAST_SUB_STAGE_MARGIN : isDesktop ? _constants.SUB_STAGE_MARGIN_DESKTOP : _constants.SUB_STAGE_MARGIN_MOBILE,
48
- backgroundColor: getStageColor ? getStageColor(index, totalSubStages) : subStage.color,
49
- width
42
+ backgroundColor: subStage.color || getStageColor && getStageColor(index, totalSubStages),
43
+ width: width
50
44
  },
51
45
  className: _stylesModule.default.container
52
46
  }, /*#__PURE__*/_react.default.createElement(Label, {
@@ -7,6 +7,8 @@ exports.getSubStageWidth = void 0;
7
7
 
8
8
  var _utils = require("../../../../../../utils");
9
9
 
10
- const getSubStageWidth = (stage, subStage) => (0, _utils.getSubStageRangeWidth)(subStage) / (0, _utils.getStageRangeWidth)(stage) * 100;
10
+ var getSubStageWidth = function getSubStageWidth(stage, subStage) {
11
+ return (0, _utils.getSubStageRangeWidth)(subStage) / (0, _utils.getStageRangeWidth)(stage) * 100;
12
+ };
11
13
 
12
14
  exports.getSubStageWidth = getSubStageWidth;
@@ -23,15 +23,13 @@ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
23
23
 
24
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
25
 
26
- const Stage = _ref => {
27
- let {
28
- stage,
29
- isLast,
30
- totalStages,
31
- totalSubStages,
32
- legendNumber,
33
- isDesktop
34
- } = _ref;
26
+ var Stage = function Stage(_ref) {
27
+ var stage = _ref.stage,
28
+ isLast = _ref.isLast,
29
+ totalStages = _ref.totalStages,
30
+ totalSubStages = _ref.totalSubStages,
31
+ legendNumber = _ref.legendNumber,
32
+ isDesktop = _ref.isDesktop;
35
33
  return /*#__PURE__*/_react.default.createElement("div", {
36
34
  style: {
37
35
  marginRight: isLast ? _constants.LAST_STAGE_MARGIN : isDesktop ? _constants.STAGE_MARGIN_DESKTOP : _constants.STAGE_MARGIN_MOBILE,
@@ -45,15 +43,17 @@ const Stage = _ref => {
45
43
  showNumber: !isDesktop
46
44
  }), /*#__PURE__*/_react.default.createElement(_LimitsLine.default, null), /*#__PURE__*/_react.default.createElement("div", {
47
45
  className: _stylesModule.default.bars
48
- }, stage.sub_rate_stages.map((subStage, index) => /*#__PURE__*/_react.default.createElement(_SubStage.default, {
49
- key: subStage.category,
50
- index: subStage.category,
51
- stage: stage,
52
- totalSubStages: totalSubStages,
53
- subStage: subStage,
54
- isLast: index === stage.sub_rate_stages.length - 1,
55
- isDesktop: isDesktop
56
- }))));
46
+ }, stage.sub_rate_stages.map(function (subStage, index) {
47
+ return /*#__PURE__*/_react.default.createElement(_SubStage.default, {
48
+ key: subStage.category,
49
+ index: subStage.category,
50
+ stage: stage,
51
+ totalSubStages: totalSubStages,
52
+ subStage: subStage,
53
+ isLast: index === stage.sub_rate_stages.length - 1,
54
+ isDesktop: isDesktop
55
+ });
56
+ })));
57
57
  };
58
58
 
59
59
  Stage.propTypes = {
@@ -19,36 +19,36 @@ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
19
19
 
20
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
21
 
22
- const Bars = _ref => {
23
- let {
24
- rateStages,
25
- isDesktop
26
- } = _ref;
27
- const barsMargin = isDesktop ? _constants.BARS_MARGIN_DESKTOP : _constants.BARS_MARGIN_MOBILE;
28
-
29
- const accumSubStages = (count, currStage) => {
22
+ var Bars = function Bars(_ref) {
23
+ var rateStages = _ref.rateStages,
24
+ isDesktop = _ref.isDesktop;
25
+ var barsMargin = isDesktop ? _constants.BARS_MARGIN_DESKTOP : _constants.BARS_MARGIN_MOBILE;
26
+
27
+ var accumSubStages = function accumSubStages(count, currStage) {
30
28
  var _currStage$sub_rate_s;
31
29
 
32
30
  return count + ((_currStage$sub_rate_s = currStage.sub_rate_stages) === null || _currStage$sub_rate_s === void 0 ? void 0 : _currStage$sub_rate_s.length) || 1;
33
31
  };
34
32
 
35
- const totalSubStages = rateStages.reduce(accumSubStages, 0);
33
+ var totalSubStages = rateStages.reduce(accumSubStages, 0);
36
34
  return /*#__PURE__*/_react.default.createElement("div", {
37
35
  style: {
38
36
  margin: "0 ".concat(barsMargin),
39
37
  width: "calc(100% - 2 * ".concat(barsMargin, ")")
40
38
  },
41
39
  className: _stylesModule.default.container
42
- }, rateStages.map((stage, index) => /*#__PURE__*/_react.default.createElement(_Stage.default, {
43
- key: stage.group,
44
- stage: stage,
45
- isFirst: index === 0,
46
- legendNumber: index + 1,
47
- isLast: index === rateStages.length - 1,
48
- totalStages: rateStages.length,
49
- totalSubStages: totalSubStages,
50
- isDesktop: isDesktop
51
- })));
40
+ }, rateStages.map(function (stage, index) {
41
+ return /*#__PURE__*/_react.default.createElement(_Stage.default, {
42
+ key: stage.group,
43
+ stage: stage,
44
+ isFirst: index === 0,
45
+ legendNumber: index + 1,
46
+ isLast: index === rateStages.length - 1,
47
+ totalStages: rateStages.length,
48
+ totalSubStages: totalSubStages,
49
+ isDesktop: isDesktop
50
+ });
51
+ }));
52
52
  };
53
53
 
54
54
  Bars.propTypes = {