@widergy/utilitygo-smart-bill-web 1.10.0 → 1.10.1

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 (128) hide show
  1. package/CHANGELOG.md +7 -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/Bars/components/Stage/components/LimitsLine/index.js +7 -5
  77. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/components/Stage/components/SubStage/index.js +12 -18
  78. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/components/Stage/components/SubStage/utils.js +3 -1
  79. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/components/Stage/index.js +18 -18
  80. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/index.js +19 -19
  81. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/components/IndicatorLabel/index.js +21 -26
  82. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/index.js +12 -15
  83. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/utils.js +37 -35
  84. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/LegendItem/index.js +23 -26
  85. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/constants.js +18 -18
  86. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/index.js +32 -12
  87. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/utils.js +20 -12
  88. package/dist/components/RatesDefinition/components/CategoryByConsumption/index.js +50 -32
  89. package/dist/components/RatesDefinition/components/PurchasedRate/index.js +13 -19
  90. package/dist/components/RatesDefinition/index.js +15 -20
  91. package/dist/components/SmartBillProvider/index.js +47 -12
  92. package/dist/components/StyledAmount/constants.js +1 -1
  93. package/dist/components/StyledAmount/index.js +35 -19
  94. package/dist/components/WithContextApi/index.js +27 -16
  95. package/dist/components/WithContextApi/layout.js +2 -2
  96. package/dist/components/WithSeason/index.js +9 -5
  97. package/dist/constants/deviceSizes.js +17 -27
  98. package/dist/constants/seasons.js +2 -2
  99. package/dist/index.js +16 -14
  100. package/dist/shared/Context/index.js +3 -5
  101. package/dist/shared/constants/aliases.js +550 -683
  102. package/dist/shared/constants/components.js +2 -1
  103. package/dist/shared/constants/consumptions.js +4 -4
  104. package/dist/shared/constants/periodicities.js +1 -1
  105. package/dist/shared/constants/rates.js +1 -1
  106. package/dist/shared/constants/readings.js +2 -2
  107. package/dist/shared/constants/seasons.js +2 -2
  108. package/dist/shared/constants/stagesGraph.js +4 -4
  109. package/dist/shared/types/assetsTypes.js +1 -1
  110. package/dist/shared/types/billDataTypes.js +4 -4
  111. package/dist/shared/types/componentsTypes.js +13 -18
  112. package/dist/shared/types/formattersTypes.js +1 -1
  113. package/dist/shared/types/rateStagesTypes.js +3 -3
  114. package/dist/shared/types/smartBillTypes.js +10 -5
  115. package/dist/shared/types/textsTypes.js +1 -1
  116. package/dist/shared/utils/billCalculation.js +9 -9
  117. package/dist/shared/utils/consumptions.js +62 -28
  118. package/dist/shared/utils/context.js +8 -7
  119. package/dist/shared/utils/expirations.js +5 -1
  120. package/dist/shared/utils/periods.js +20 -14
  121. package/dist/shared/utils/rates.js +5 -1
  122. package/dist/shared/utils/readings.js +10 -2
  123. package/dist/shared/utils/season.js +5 -1
  124. package/dist/shared/utils/stagesGraph.js +15 -11
  125. package/dist/utils/hooks.js +58 -19
  126. package/dist/utils.js +8 -4
  127. package/package.json +1 -2
  128. package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/utils.js +0 -27
@@ -25,21 +25,18 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
25
25
 
26
26
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
27
27
 
28
- const Magnitude = props => {
29
- const {
30
- contextApiInfo,
31
- numberAlias,
32
- unitAlias,
33
- value,
34
- unit,
35
- disableUnit,
36
- Icon,
37
- classes = {}
38
- } = props;
39
- const {
40
- Label
41
- } = contextApiInfo;
42
- const variantProps = (0, _utils2.getVariantProps)(props);
28
+ var Magnitude = function Magnitude(props) {
29
+ var contextApiInfo = props.contextApiInfo,
30
+ numberAlias = props.numberAlias,
31
+ unitAlias = props.unitAlias,
32
+ value = props.value,
33
+ unit = props.unit,
34
+ disableUnit = props.disableUnit,
35
+ Icon = props.Icon,
36
+ _props$classes = props.classes,
37
+ classes = _props$classes === void 0 ? {} : _props$classes;
38
+ var Label = contextApiInfo.Label;
39
+ var variantProps = (0, _utils2.getVariantProps)(props);
43
40
  return /*#__PURE__*/_react.default.createElement("div", {
44
41
  className: "".concat(_stylesModule.default.container, " ").concat(classes.container)
45
42
  }, Icon && /*#__PURE__*/_react.default.createElement(Icon, {
@@ -9,7 +9,7 @@ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
9
9
 
10
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
11
 
12
- const variants = [{
12
+ var variants = [{
13
13
  id: 'small',
14
14
  valueLabel: {
15
15
  small: true
@@ -47,6 +47,12 @@ const variants = [{
47
47
  unitLabelStyles: _stylesModule.default.unitxxxLarge
48
48
  }];
49
49
 
50
- const getVariantProps = props => variants.find(variant => props[variant.id]) || variants.find(variant => variant.id === 'medium');
50
+ var getVariantProps = function getVariantProps(props) {
51
+ return variants.find(function (variant) {
52
+ return props[variant.id];
53
+ }) || variants.find(function (variant) {
54
+ return variant.id === 'medium';
55
+ });
56
+ };
51
57
 
52
58
  exports.getVariantProps = getVariantProps;
@@ -19,21 +19,15 @@ 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 BillParticularConditions = _ref => {
23
- let {
24
- contextApiInfo,
25
- particularConditions,
26
- onAcceptPress
27
- } = _ref;
28
- const {
29
- assets,
30
- config,
31
- Button,
32
- Label
33
- } = contextApiInfo;
34
- const {
35
- texts
36
- } = config;
22
+ var BillParticularConditions = function BillParticularConditions(_ref) {
23
+ var contextApiInfo = _ref.contextApiInfo,
24
+ particularConditions = _ref.particularConditions,
25
+ onAcceptPress = _ref.onAcceptPress;
26
+ var assets = contextApiInfo.assets,
27
+ config = contextApiInfo.config,
28
+ Button = contextApiInfo.Button,
29
+ Label = contextApiInfo.Label;
30
+ var texts = config.texts;
37
31
  return /*#__PURE__*/_react.default.createElement("div", {
38
32
  className: _stylesModule.default.container
39
33
  }, /*#__PURE__*/_react.default.createElement(assets.ParticularConditionsIcon, {
@@ -46,11 +40,13 @@ const BillParticularConditions = _ref => {
46
40
  }, /*#__PURE__*/_react.default.createElement(Label, {
47
41
  alias: _aliases.PARTICULAR_CONDITIONS_LIST_TITLE,
48
42
  className: _stylesModule.default.marginBottom
49
- }, texts.mainBillData.particularConditionsListTitle), particularConditions.map(particularCondition => /*#__PURE__*/_react.default.createElement(Label, {
50
- alias: _aliases.PARTICULAR_CONDITION,
51
- key: particularCondition,
52
- className: _stylesModule.default.item
53
- }, "* ".concat(particularCondition)))), /*#__PURE__*/_react.default.createElement(Button, {
43
+ }, texts.mainBillData.particularConditionsListTitle), particularConditions.map(function (particularCondition) {
44
+ return /*#__PURE__*/_react.default.createElement(Label, {
45
+ alias: _aliases.PARTICULAR_CONDITION,
46
+ key: particularCondition,
47
+ className: _stylesModule.default.item
48
+ }, "* ".concat(particularCondition));
49
+ })), /*#__PURE__*/_react.default.createElement(Button, {
54
50
  onPress: onAcceptPress
55
51
  }, texts.commons.accept));
56
52
  };
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -21,34 +23,49 @@ 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 BillAlert = _ref => {
29
- let {
30
- contextApiInfo,
31
- particularConditions,
32
- isDesktopSize
33
- } = _ref;
34
- const {
35
- assets,
36
- config,
37
- Dialog,
38
- Label,
39
- Touchable
40
- } = contextApiInfo;
41
- const {
42
- billAlertContainer
43
- } = (config === null || config === void 0 ? void 0 : config.stylesConfig) || {};
44
- const {
45
- texts
46
- } = config;
47
- const [dialogOpened, setDialogOpened] = (0, _react.useState)(false);
48
-
49
- const handleAlertClick = () => setDialogOpened(true);
50
-
51
- const handleCloseDialog = () => setDialogOpened(false);
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
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
31
+
32
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
33
+
34
+ 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); }
35
+
36
+ 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; }
37
+
38
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
39
+
40
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
41
+
42
+ var BillAlert = function BillAlert(_ref) {
43
+ var contextApiInfo = _ref.contextApiInfo,
44
+ particularConditions = _ref.particularConditions,
45
+ isDesktopSize = _ref.isDesktopSize;
46
+ var assets = contextApiInfo.assets,
47
+ config = contextApiInfo.config,
48
+ Dialog = contextApiInfo.Dialog,
49
+ Label = contextApiInfo.Label,
50
+ Touchable = contextApiInfo.Touchable;
51
+
52
+ var _ref2 = (config === null || config === void 0 ? void 0 : config.stylesConfig) || {},
53
+ billAlertContainer = _ref2.billAlertContainer;
54
+
55
+ var texts = config.texts;
56
+
57
+ var _useState = (0, _react.useState)(false),
58
+ _useState2 = _slicedToArray(_useState, 2),
59
+ dialogOpened = _useState2[0],
60
+ setDialogOpened = _useState2[1];
61
+
62
+ var handleAlertClick = function handleAlertClick() {
63
+ return setDialogOpened(true);
64
+ };
65
+
66
+ var handleCloseDialog = function handleCloseDialog() {
67
+ return setDialogOpened(false);
68
+ };
52
69
 
53
70
  return /*#__PURE__*/_react.default.createElement("div", {
54
71
  className: "".concat(_stylesModule.default.container, " ").concat(billAlertContainer)
@@ -25,25 +25,17 @@ 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 ClientData = _ref => {
29
- let {
30
- contextApiInfo,
31
- billData,
32
- multipleSettlements
33
- } = _ref;
34
- const {
35
- assets,
36
- config,
37
- Label
38
- } = contextApiInfo;
39
- const {
40
- texts,
41
- formatters
42
- } = config;
43
- const {
44
- AdheredToServiceIcon
45
- } = assets;
46
- const client = (0, _seamlessImmutable.getIn)(billData, ['client'], {});
28
+ var ClientData = function ClientData(_ref) {
29
+ var contextApiInfo = _ref.contextApiInfo,
30
+ billData = _ref.billData,
31
+ multipleSettlements = _ref.multipleSettlements;
32
+ var assets = contextApiInfo.assets,
33
+ config = contextApiInfo.config,
34
+ Label = contextApiInfo.Label;
35
+ var texts = config.texts,
36
+ formatters = config.formatters;
37
+ var AdheredToServiceIcon = assets.AdheredToServiceIcon;
38
+ var client = (0, _seamlessImmutable.getIn)(billData, ['client'], {});
47
39
  return /*#__PURE__*/_react.default.createElement("div", {
48
40
  className: "".concat(_stylesModule.default.container, " ").concat(multipleSettlements ? _stylesModule.default.withOutAlertContainer : _stylesModule.default.withAlertContainer)
49
41
  }, /*#__PURE__*/_react.default.createElement(Label, {
@@ -29,20 +29,17 @@ var _utils = require("./utils");
29
29
 
30
30
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31
31
 
32
- const Consumption = _ref => {
33
- let {
34
- billData,
35
- multipleSettlements,
36
- contextApiInfo
37
- } = _ref;
38
- const {
39
- showPower,
40
- showActiveReactiveComparison
41
- } = contextApiInfo.config.validations;
42
- const currentPeriod = (0, _periods.getCurrentPeriod)(billData);
43
- const hiredPowerConsumption = (0, _consumptions.getTotalConsumption)(currentPeriod, _consumptions2.POWER_TYPES.PURCHASED);
44
- const registeredPowerConsumption = (0, _consumptions.getTotalConsumption)(currentPeriod, _consumptions2.POWER_TYPES.REGISTERED);
45
- const exceededPower = (0, _consumptions.getTotalConsumption)(currentPeriod, _consumptions2.POWER_TYPES.EXCEEDED);
32
+ var Consumption = function Consumption(_ref) {
33
+ var billData = _ref.billData,
34
+ multipleSettlements = _ref.multipleSettlements,
35
+ contextApiInfo = _ref.contextApiInfo;
36
+ var _contextApiInfo$confi = contextApiInfo.config.validations,
37
+ showPower = _contextApiInfo$confi.showPower,
38
+ showActiveReactiveComparison = _contextApiInfo$confi.showActiveReactiveComparison;
39
+ var currentPeriod = (0, _periods.getCurrentPeriod)(billData);
40
+ var hiredPowerConsumption = (0, _consumptions.getTotalConsumption)(currentPeriod, _consumptions2.POWER_TYPES.PURCHASED);
41
+ var registeredPowerConsumption = (0, _consumptions.getTotalConsumption)(currentPeriod, _consumptions2.POWER_TYPES.REGISTERED);
42
+ var exceededPower = (0, _consumptions.getTotalConsumption)(currentPeriod, _consumptions2.POWER_TYPES.EXCEEDED);
46
43
  return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_ConsumptionEnergyDetails.default, {
47
44
  currentPeriod: currentPeriod,
48
45
  multipleSettlements: multipleSettlements,
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.validateConsumptions = void 0;
7
7
 
8
- const validateConsumptions = (registeredPowerConsumption, hiredPowerConsumption) => registeredPowerConsumption !== null && registeredPowerConsumption !== undefined && hiredPowerConsumption !== null && hiredPowerConsumption !== undefined;
8
+ var validateConsumptions = function validateConsumptions(registeredPowerConsumption, hiredPowerConsumption) {
9
+ return registeredPowerConsumption !== null && registeredPowerConsumption !== undefined && hiredPowerConsumption !== null && hiredPowerConsumption !== undefined;
10
+ };
9
11
 
10
12
  exports.validateConsumptions = validateConsumptions;
@@ -25,29 +25,21 @@ 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 ReadingDetails = _ref => {
29
- let {
30
- contextApiInfo,
31
- meterNumber,
32
- readingType,
33
- withParticularConditions,
34
- transformationCenter,
35
- feederLine,
36
- billData
37
- } = _ref;
38
- const {
39
- assets,
40
- config,
41
- Label
42
- } = contextApiInfo;
43
- const {
44
- texts,
45
- validations
46
- } = config;
47
- const {
48
- showFeederLine
49
- } = validations;
50
- const longMeterNumber = (meterNumber === null || meterNumber === void 0 ? void 0 : meterNumber.length) > 6;
28
+ var ReadingDetails = function ReadingDetails(_ref) {
29
+ var contextApiInfo = _ref.contextApiInfo,
30
+ meterNumber = _ref.meterNumber,
31
+ readingType = _ref.readingType,
32
+ withParticularConditions = _ref.withParticularConditions,
33
+ transformationCenter = _ref.transformationCenter,
34
+ feederLine = _ref.feederLine,
35
+ billData = _ref.billData;
36
+ var assets = contextApiInfo.assets,
37
+ config = contextApiInfo.config,
38
+ Label = contextApiInfo.Label;
39
+ var texts = config.texts,
40
+ validations = config.validations;
41
+ var showFeederLine = validations.showFeederLine;
42
+ var longMeterNumber = (meterNumber === null || meterNumber === void 0 ? void 0 : meterNumber.length) > 6;
51
43
  return /*#__PURE__*/_react.default.createElement("div", {
52
44
  className: "".concat(_stylesModule.default.container, " ").concat(withParticularConditions && _stylesModule.default.withParticularConditions)
53
45
  }, /*#__PURE__*/_react.default.createElement(Label, {
@@ -7,7 +7,7 @@ exports.mainText = void 0;
7
7
 
8
8
  var _readings = require("../../../../../../shared/constants/readings");
9
9
 
10
- const mainText = (readingType, texts) => {
10
+ var mainText = function mainText(readingType, texts) {
11
11
  switch (readingType.type) {
12
12
  case _readings.READING_TYPES.FACE_TO_FACE:
13
13
  return readingType.subtype === _readings.READING_TYPES.TELEMEDITION ? texts.commons.telemeditionReading : texts.commons.faceToFaceReading;
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -41,55 +43,58 @@ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
41
43
 
42
44
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
43
45
 
44
- 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); }
46
+ 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); }
45
47
 
46
- 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; }
48
+ 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; }
47
49
 
48
- const BillBody = _ref => {
50
+ var BillBody = function BillBody(_ref) {
49
51
  var _billData$client, _billData$client2;
50
52
 
51
- let {
52
- billData,
53
- multipleSettlements,
54
- contextApiInfo
55
- } = _ref;
56
- const {
57
- isDesktopSize
58
- } = (0, _hooks.useScreenSize)();
59
- const currentPeriod = (0, _periods.getCurrentPeriod)(billData);
60
- const {
61
- showAlternativeMainBillDataLayout
62
- } = contextApiInfo.config.validations;
63
- const withParticularConditions = !(0, _array.isEmpty)(billData.particular_conditions);
64
- const showAlternativeLayout = showAlternativeMainBillDataLayout(billData);
65
- const transformationCenter = (_billData$client = billData.client) === null || _billData$client === void 0 ? void 0 : _billData$client.transformation_center;
66
- const feederLine = (_billData$client2 = billData.client) === null || _billData$client2 === void 0 ? void 0 : _billData$client2.feeder_line;
67
- const readingType = (0, _readings.getReadingPeriod)(billData, _readings2.READING_MOMENTS.FINAL);
68
-
69
- const RenderClientData = () => /*#__PURE__*/_react.default.createElement(_ClientData.default, {
70
- billData: billData,
71
- multipleSettlements: multipleSettlements
72
- });
73
-
74
- const RenderReadingDetails = () => /*#__PURE__*/_react.default.createElement(_ReadingDetails.default, {
75
- meterNumber: billData.meter_number,
76
- readingType: readingType,
77
- withParticularConditions: withParticularConditions,
78
- transformationCenter: transformationCenter,
79
- feederLine: feederLine,
80
- billData: billData
81
- });
82
-
83
- const AmountAndonsumptionRender = () => /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_Amount.default, {
84
- billData: billData,
85
- containerClassName: _stylesModule.default.amount
86
- }), withParticularConditions && /*#__PURE__*/_react.default.createElement(_BillAlert.default, {
87
- particularConditions: billData.particular_conditions,
88
- isDesktopSize: isDesktopSize
89
- }), /*#__PURE__*/_react.default.createElement(_Consumption.default, {
90
- billData: billData,
91
- multipleSettlements: multipleSettlements
92
- }));
53
+ var billData = _ref.billData,
54
+ multipleSettlements = _ref.multipleSettlements,
55
+ contextApiInfo = _ref.contextApiInfo;
56
+
57
+ var _useScreenSize = (0, _hooks.useScreenSize)(),
58
+ isDesktopSize = _useScreenSize.isDesktopSize;
59
+
60
+ var currentPeriod = (0, _periods.getCurrentPeriod)(billData);
61
+ var showAlternativeMainBillDataLayout = contextApiInfo.config.validations.showAlternativeMainBillDataLayout;
62
+ var withParticularConditions = !(0, _array.isEmpty)(billData.particular_conditions);
63
+ var showAlternativeLayout = showAlternativeMainBillDataLayout(billData);
64
+ var transformationCenter = (_billData$client = billData.client) === null || _billData$client === void 0 ? void 0 : _billData$client.transformation_center;
65
+ var feederLine = (_billData$client2 = billData.client) === null || _billData$client2 === void 0 ? void 0 : _billData$client2.feeder_line;
66
+ var readingType = (0, _readings.getReadingPeriod)(billData, _readings2.READING_MOMENTS.FINAL);
67
+
68
+ var RenderClientData = function RenderClientData() {
69
+ return /*#__PURE__*/_react.default.createElement(_ClientData.default, {
70
+ billData: billData,
71
+ multipleSettlements: multipleSettlements
72
+ });
73
+ };
74
+
75
+ var RenderReadingDetails = function RenderReadingDetails() {
76
+ return /*#__PURE__*/_react.default.createElement(_ReadingDetails.default, {
77
+ meterNumber: billData.meter_number,
78
+ readingType: readingType,
79
+ withParticularConditions: withParticularConditions,
80
+ transformationCenter: transformationCenter,
81
+ feederLine: feederLine,
82
+ billData: billData
83
+ });
84
+ };
85
+
86
+ var AmountAndonsumptionRender = function AmountAndonsumptionRender() {
87
+ return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_Amount.default, {
88
+ billData: billData,
89
+ containerClassName: _stylesModule.default.amount
90
+ }), withParticularConditions && /*#__PURE__*/_react.default.createElement(_BillAlert.default, {
91
+ particularConditions: billData.particular_conditions,
92
+ isDesktopSize: isDesktopSize
93
+ }), /*#__PURE__*/_react.default.createElement(_Consumption.default, {
94
+ billData: billData,
95
+ multipleSettlements: multipleSettlements
96
+ }));
97
+ };
93
98
 
94
99
  return /*#__PURE__*/_react.default.createElement("div", {
95
100
  className: _stylesModule.default.container
@@ -21,21 +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 TypeAndNumber = _ref => {
25
- let {
26
- contextApiInfo,
27
- billType,
28
- billNumber,
29
- mainAlias,
30
- detailAlias
31
- } = _ref;
32
- const {
33
- config,
34
- Label
35
- } = contextApiInfo;
36
- const {
37
- texts
38
- } = config;
24
+ var TypeAndNumber = function TypeAndNumber(_ref) {
25
+ var contextApiInfo = _ref.contextApiInfo,
26
+ billType = _ref.billType,
27
+ billNumber = _ref.billNumber,
28
+ mainAlias = _ref.mainAlias,
29
+ detailAlias = _ref.detailAlias;
30
+ var config = contextApiInfo.config,
31
+ Label = contextApiInfo.Label;
32
+ var texts = config.texts;
39
33
  return /*#__PURE__*/_react.default.createElement("div", {
40
34
  className: _stylesModule.default.container
41
35
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -33,41 +33,38 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
33
33
 
34
34
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
35
35
 
36
- const BillHeader = _ref => {
36
+ var BillHeader = function BillHeader(_ref) {
37
37
  var _currentPeriod$settle, _currentPeriod$settle2, _currentPeriod$settle3;
38
38
 
39
- let {
40
- contextApiInfo,
41
- billData
42
- } = _ref;
43
- const {
44
- assets,
45
- config
46
- } = contextApiInfo;
47
- const {
48
- texts
49
- } = config;
50
- const {
51
- isDesktopSize,
52
- isMobileOrTablet
53
- } = (0, _hooks.useScreenSize)();
54
- const currentPeriod = (0, _periods.getCurrentPeriod)(billData);
55
- const issuedOnDate = currentPeriod === null || currentPeriod === void 0 ? void 0 : (_currentPeriod$settle = currentPeriod.settlements) === null || _currentPeriod$settle === void 0 ? void 0 : (_currentPeriod$settle2 = _currentPeriod$settle.current) === null || _currentPeriod$settle2 === void 0 ? void 0 : _currentPeriod$settle2.issued_on;
56
- const totalSettlements = currentPeriod === null || currentPeriod === void 0 ? void 0 : (_currentPeriod$settle3 = currentPeriod.settlements) === null || _currentPeriod$settle3 === void 0 ? void 0 : _currentPeriod$settle3.total_settlements;
57
- const debtStatusLabel = billData.debt_status_label;
58
- const debtStatusValidation = debtStatusLabel !== null;
59
- const multipleSettlements = totalSettlements > 1;
60
- const aliases = {
39
+ var contextApiInfo = _ref.contextApiInfo,
40
+ billData = _ref.billData;
41
+ var assets = contextApiInfo.assets,
42
+ config = contextApiInfo.config;
43
+ var texts = config.texts;
44
+
45
+ var _useScreenSize = (0, _hooks.useScreenSize)(),
46
+ isDesktopSize = _useScreenSize.isDesktopSize,
47
+ isMobileOrTablet = _useScreenSize.isMobileOrTablet;
48
+
49
+ var currentPeriod = (0, _periods.getCurrentPeriod)(billData);
50
+ var issuedOnDate = currentPeriod === null || currentPeriod === void 0 ? void 0 : (_currentPeriod$settle = currentPeriod.settlements) === null || _currentPeriod$settle === void 0 ? void 0 : (_currentPeriod$settle2 = _currentPeriod$settle.current) === null || _currentPeriod$settle2 === void 0 ? void 0 : _currentPeriod$settle2.issued_on;
51
+ var totalSettlements = currentPeriod === null || currentPeriod === void 0 ? void 0 : (_currentPeriod$settle3 = currentPeriod.settlements) === null || _currentPeriod$settle3 === void 0 ? void 0 : _currentPeriod$settle3.total_settlements;
52
+ var debtStatusLabel = billData.debt_status_label;
53
+ var debtStatusValidation = debtStatusLabel !== null;
54
+ var multipleSettlements = totalSettlements > 1;
55
+ var aliases = {
61
56
  mainAlias: _aliases.MAIN_LIGHT,
62
57
  detailAlias: _aliases.DETAIL
63
58
  };
64
59
 
65
- const DebtStatusLabel = () => /*#__PURE__*/_react.default.createElement("div", {
66
- className: "".concat(billData.warning ? _stylesModule.default.pendingDebtLabelContainer : _stylesModule.default.adheredToAutomaticDebtContainer)
67
- }, /*#__PURE__*/_react.default.createElement(_DebtState.default, {
68
- debtStatusLabel: debtStatusLabel,
69
- isWarning: billData.warning
70
- }));
60
+ var DebtStatusLabel = function DebtStatusLabel() {
61
+ return /*#__PURE__*/_react.default.createElement("div", {
62
+ className: "".concat(billData.warning ? _stylesModule.default.pendingDebtLabelContainer : _stylesModule.default.adheredToAutomaticDebtContainer)
63
+ }, /*#__PURE__*/_react.default.createElement(_DebtState.default, {
64
+ debtStatusLabel: debtStatusLabel,
65
+ isWarning: billData.warning
66
+ }));
67
+ };
71
68
 
72
69
  return /*#__PURE__*/_react.default.createElement("div", {
73
70
  className: _stylesModule.default.container
@@ -25,15 +25,13 @@ 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 MainBillData = _ref => {
28
+ var MainBillData = function MainBillData(_ref) {
29
29
  var _currentPeriod$settle;
30
30
 
31
- let {
32
- billData,
33
- classes
34
- } = _ref;
35
- const currentPeriod = (0, _periods.getCurrentPeriod)(billData);
36
- const multipleSettlements = (currentPeriod === null || currentPeriod === void 0 ? void 0 : (_currentPeriod$settle = currentPeriod.settlements) === null || _currentPeriod$settle === void 0 ? void 0 : _currentPeriod$settle.total_settlements) > 1;
31
+ var billData = _ref.billData,
32
+ classes = _ref.classes;
33
+ var currentPeriod = (0, _periods.getCurrentPeriod)(billData);
34
+ var multipleSettlements = (currentPeriod === null || currentPeriod === void 0 ? void 0 : (_currentPeriod$settle = currentPeriod.settlements) === null || _currentPeriod$settle === void 0 ? void 0 : _currentPeriod$settle.total_settlements) > 1;
37
35
  return /*#__PURE__*/_react.default.createElement("div", {
38
36
  className: "".concat(_stylesModule.default.container, " ").concat(classes.container)
39
37
  }, /*#__PURE__*/_react.default.createElement(_BillHeader.default, {
@@ -7,12 +7,14 @@ exports.retrieveStyle = void 0;
7
7
 
8
8
  var _seamlessImmutable = require("seamless-immutable");
9
9
 
10
- const retrieveStyle = theme => ({
11
- container: {
12
- backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['Container', 'backgroundColor']),
13
- border: (0, _seamlessImmutable.getIn)(theme, ['Container', 'border']),
14
- borderRadius: (0, _seamlessImmutable.getIn)(theme, ['Container', 'borderRadius'])
15
- }
16
- });
10
+ var retrieveStyle = function retrieveStyle(theme) {
11
+ return {
12
+ container: {
13
+ backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['Container', 'backgroundColor']),
14
+ border: (0, _seamlessImmutable.getIn)(theme, ['Container', 'border']),
15
+ borderRadius: (0, _seamlessImmutable.getIn)(theme, ['Container', 'borderRadius'])
16
+ }
17
+ };
18
+ };
17
19
 
18
20
  exports.retrieveStyle = retrieveStyle;
@@ -7,6 +7,10 @@ exports.getCurrentPeriod = void 0;
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;