@widergy/utilitygo-smart-bill-web 2.2.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/components/Advice/index.js +11 -8
  3. package/dist/components/Amount/index.js +27 -23
  4. package/dist/components/Amount/utils.js +1 -5
  5. package/dist/components/Banner/index.js +11 -8
  6. package/dist/components/BarChart/constants.js +3 -6
  7. package/dist/components/BarChart/index.js +29 -24
  8. package/dist/components/BarChart/utils.js +15 -15
  9. package/dist/components/BillCalculation/components/ConceptCard/index.js +53 -47
  10. package/dist/components/BillCalculation/components/Glossary/index.js +49 -66
  11. package/dist/components/BillCalculation/components/Glossary/styles.module.scss +1 -0
  12. package/dist/components/BillCalculation/constants.js +1 -2
  13. package/dist/components/BillCalculation/index.js +49 -53
  14. package/dist/components/BillCalculation/utils.js +19 -22
  15. package/dist/components/BillSummary/components/BilledConcepts/components/Concept/index.js +26 -24
  16. package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/constants.js +2 -3
  17. package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/index.js +16 -17
  18. package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/styles.module.scss +3 -3
  19. package/dist/components/BillSummary/components/BilledConcepts/constants.js +12 -17
  20. package/dist/components/BillSummary/components/BilledConcepts/index.js +30 -41
  21. package/dist/components/BillSummary/components/BilledConcepts/utils.js +44 -68
  22. package/dist/components/BillSummary/index.js +71 -71
  23. package/dist/components/ConsumptionComparison/components/ComparisonTable/components/DataLine/index.js +9 -10
  24. package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/index.js +18 -12
  25. package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/utils.js +1 -1
  26. package/dist/components/ConsumptionComparison/components/ComparisonTable/constants.js +144 -143
  27. package/dist/components/ConsumptionComparison/components/ComparisonTable/index.js +17 -16
  28. package/dist/components/ConsumptionComparison/components/ComparisonTable/utils.js +84 -88
  29. package/dist/components/ConsumptionComparison/components/ConsumptionAdvice/index.js +22 -13
  30. package/dist/components/ConsumptionComparison/components/ConsumptionAdvice/utils.js +1 -1
  31. package/dist/components/ConsumptionComparison/components/PercentageComparison/index.js +22 -16
  32. package/dist/components/ConsumptionComparison/components/PercentageComparison/utils.js +13 -9
  33. package/dist/components/ConsumptionComparison/index.js +42 -47
  34. package/dist/components/ConsumptionEnergyDetails/components/ConsumptionEnergyComparison/index.js +28 -24
  35. package/dist/components/ConsumptionEnergyDetails/components/ConsumptionEnergyComparison/styles.module.scss +1 -1
  36. package/dist/components/ConsumptionEnergyDetails/components/ConsumptionInDaysLabel/index.js +19 -15
  37. package/dist/components/ConsumptionEnergyDetails/components/EnergyTotalConsumption/index.js +16 -14
  38. package/dist/components/ConsumptionEnergyDetails/components/PercentageComparison/index.js +22 -17
  39. package/dist/components/ConsumptionEnergyDetails/components/PercentageComparison/utils.js +1 -1
  40. package/dist/components/ConsumptionEnergyDetails/index.js +47 -43
  41. package/dist/components/ConsumptionEnergyDetails/styles.module.scss +2 -2
  42. package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/index.js +65 -62
  43. package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/utils.js +11 -13
  44. package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderConsumption/index.js +21 -19
  45. package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderSettlement/index.js +17 -12
  46. package/dist/components/ConsumptionIncluded/components/TimelineRow/index.js +43 -39
  47. package/dist/components/ConsumptionIncluded/components/TimelineRow/styles.module.scss +2 -2
  48. package/dist/components/ConsumptionIncluded/index.js +32 -34
  49. package/dist/components/ConsumptionIncluded/utils.js +29 -33
  50. package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/components/ReadingRow/index.js +15 -12
  51. package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/index.js +24 -22
  52. package/dist/components/ConsumptionPeriod/components/HistoryGraph/index.js +19 -28
  53. package/dist/components/ConsumptionPeriod/components/Reading/index.js +36 -34
  54. package/dist/components/ConsumptionPeriod/index.js +13 -10
  55. package/dist/components/ConsumptionPeriod/utils.js +13 -15
  56. package/dist/components/Date/index.js +13 -11
  57. package/dist/components/DebtState/index.js +15 -10
  58. package/dist/components/IconAndDetails/index.js +20 -19
  59. package/dist/components/Magnitude/index.js +16 -14
  60. package/dist/components/Magnitude/utils.js +2 -8
  61. package/dist/components/MainBillData/components/BillAlert/components/BillParticularConditions/index.js +19 -16
  62. package/dist/components/MainBillData/components/BillAlert/index.js +25 -33
  63. package/dist/components/MainBillData/components/BillBody/components/ClientData/index.js +20 -13
  64. package/dist/components/MainBillData/components/BillBody/components/Consumption/index.js +15 -13
  65. package/dist/components/MainBillData/components/BillBody/components/Consumption/utils.js +1 -3
  66. package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/index.js +24 -17
  67. package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/styles.module.scss +2 -2
  68. package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/utils.js +1 -1
  69. package/dist/components/MainBillData/components/BillBody/index.js +43 -46
  70. package/dist/components/MainBillData/components/BillHeader/components/TypeAndNumber/index.js +17 -13
  71. package/dist/components/MainBillData/components/BillHeader/index.js +30 -26
  72. package/dist/components/MainBillData/components/BillHeader/styles.module.scss +1 -1
  73. package/dist/components/MainBillData/index.js +8 -7
  74. package/dist/components/MainBillData/theme.js +7 -9
  75. package/dist/components/MainBillData/utils.js +1 -5
  76. package/dist/components/Period/index.js +55 -45
  77. package/dist/components/PowerProgresBar/components/PowerConsumption/index.js +16 -13
  78. package/dist/components/PowerProgresBar/index.js +32 -32
  79. package/dist/components/RateAndCategory/index.js +26 -29
  80. package/dist/components/RatesDefinition/components/BillRate/components/RatePrices/index.js +21 -15
  81. package/dist/components/RatesDefinition/components/BillRate/index.js +25 -16
  82. package/dist/components/RatesDefinition/components/BillRate/styles.module.scss +1 -1
  83. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/Category/index.js +15 -11
  84. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/components/IndicatorLabel/index.js +27 -23
  85. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/index.js +12 -9
  86. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/styles.module.scss +1 -1
  87. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/utils.js +9 -9
  88. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Legend/index.js +22 -21
  89. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Stages/index.js +35 -38
  90. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Stages/styles.module.scss +0 -1
  91. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/constants.js +2 -4
  92. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/index.js +18 -32
  93. package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/utils.js +35 -47
  94. package/dist/components/RatesDefinition/components/CategoryByConsumption/constants.js +18 -36
  95. package/dist/components/RatesDefinition/components/CategoryByConsumption/index.js +24 -33
  96. package/dist/components/RatesDefinition/components/CategoryByConsumption/utils.js +1 -5
  97. package/dist/components/RatesDefinition/components/PurchasedRate/index.js +20 -15
  98. package/dist/components/RatesDefinition/index.js +21 -17
  99. package/dist/components/RatesDefinition/styles.module.scss +1 -1
  100. package/dist/components/SmartBillProvider/index.js +13 -36
  101. package/dist/components/StyledAmount/constants.js +2 -3
  102. package/dist/components/StyledAmount/index.js +20 -29
  103. package/dist/components/WithContextApi/index.js +19 -27
  104. package/dist/components/WithContextApi/layout.js +3 -4
  105. package/dist/components/WithSeason/index.js +7 -11
  106. package/dist/constants/deviceSizes.js +27 -24
  107. package/dist/constants/seasons.js +3 -5
  108. package/dist/index.js +19 -19
  109. package/dist/scss/variables/commonColors.module.scss +1 -1
  110. package/dist/shared/Context/index.js +5 -3
  111. package/dist/shared/constants/aliases.js +691 -694
  112. package/dist/shared/constants/consumptions.js +5 -9
  113. package/dist/shared/constants/periodicities.js +2 -3
  114. package/dist/shared/constants/rates.js +2 -3
  115. package/dist/shared/constants/readings.js +3 -5
  116. package/dist/shared/constants/seasons.js +3 -5
  117. package/dist/shared/constants/stagesGraph.js +4 -8
  118. package/dist/shared/types/assetsTypes.js +1 -2
  119. package/dist/shared/types/billDataTypes.js +6 -11
  120. package/dist/shared/types/componentsTypes.js +19 -14
  121. package/dist/shared/types/formattersTypes.js +2 -3
  122. package/dist/shared/types/rateStagesTypes.js +3 -6
  123. package/dist/shared/types/smartBillTypes.js +5 -11
  124. package/dist/shared/types/textsTypes.js +2 -3
  125. package/dist/shared/utils/billCalculation.js +9 -9
  126. package/dist/shared/utils/consumptions.js +27 -55
  127. package/dist/shared/utils/context.js +6 -5
  128. package/dist/shared/utils/expirations.js +1 -5
  129. package/dist/shared/utils/periods.js +14 -20
  130. package/dist/shared/utils/rates.js +1 -5
  131. package/dist/shared/utils/readings.js +2 -10
  132. package/dist/shared/utils/season.js +1 -5
  133. package/dist/shared/utils/stagesGraph.js +11 -15
  134. package/dist/utils/hooks.js +2 -3
  135. package/dist/utils.js +4 -8
  136. package/package.json +26 -63
@@ -13,23 +13,25 @@ var _WithContextApi = _interopRequireDefault(require("../WithContextApi"));
13
13
  var _utils = require("../../utils");
14
14
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
15
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
- var IconAndDetails = function IconAndDetails(_ref) {
17
- var children = _ref.children,
18
- contextApiInfo = _ref.contextApiInfo,
19
- Icon = _ref.Icon,
20
- mainText = _ref.mainText,
21
- secondaryText = _ref.secondaryText,
22
- descriptionText = _ref.descriptionText,
23
- tooltip = _ref.tooltip,
24
- mainAlias = _ref.mainAlias,
25
- secondaryAlias = _ref.secondaryAlias,
26
- _ref$tertiaryAlias = _ref.tertiaryAlias,
27
- tertiaryAlias = _ref$tertiaryAlias === void 0 ? secondaryAlias : _ref$tertiaryAlias,
28
- _ref$classes = _ref.classes,
29
- classes = _ref$classes === void 0 ? {} : _ref$classes;
30
- var Label = contextApiInfo.Label,
31
- Tooltip = contextApiInfo.Tooltip;
32
- var repeatedData = mainText && secondaryText && (0, _string.stringCompare)(mainText, secondaryText);
16
+ const IconAndDetails = _ref => {
17
+ let {
18
+ children,
19
+ contextApiInfo,
20
+ Icon,
21
+ mainText,
22
+ secondaryText,
23
+ descriptionText,
24
+ tooltip,
25
+ mainAlias,
26
+ secondaryAlias,
27
+ tertiaryAlias = secondaryAlias,
28
+ classes = {}
29
+ } = _ref;
30
+ const {
31
+ Label,
32
+ Tooltip
33
+ } = contextApiInfo;
34
+ const repeatedData = mainText && secondaryText && (0, _string.stringCompare)(mainText, secondaryText);
33
35
  return /*#__PURE__*/_react.default.createElement("div", {
34
36
  className: "".concat(_stylesModule.default.container, " ").concat(classes.container)
35
37
  }, /*#__PURE__*/_react.default.createElement(Tooltip, {
@@ -62,5 +64,4 @@ IconAndDetails.propTypes = {
62
64
  container: _propTypes.string
63
65
  })
64
66
  };
65
- var _default = (0, _WithContextApi.default)()(IconAndDetails);
66
- exports.default = _default;
67
+ var _default = exports.default = (0, _WithContextApi.default)()(IconAndDetails);
@@ -13,18 +13,21 @@ var _utils = require("../../utils");
13
13
  var _utils2 = require("./utils");
14
14
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
15
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
- var Magnitude = function Magnitude(props) {
17
- var contextApiInfo = props.contextApiInfo,
18
- numberAlias = props.numberAlias,
19
- unitAlias = props.unitAlias,
20
- value = props.value,
21
- unit = props.unit,
22
- disableUnit = props.disableUnit,
23
- Icon = props.Icon,
24
- _props$classes = props.classes,
25
- classes = _props$classes === void 0 ? {} : _props$classes;
26
- var Label = contextApiInfo.Label;
27
- var variantProps = (0, _utils2.getVariantProps)(props);
16
+ const Magnitude = props => {
17
+ const {
18
+ contextApiInfo,
19
+ numberAlias,
20
+ unitAlias,
21
+ value,
22
+ unit,
23
+ disableUnit,
24
+ Icon,
25
+ classes = {}
26
+ } = props;
27
+ const {
28
+ Label
29
+ } = contextApiInfo;
30
+ const variantProps = (0, _utils2.getVariantProps)(props);
28
31
  return /*#__PURE__*/_react.default.createElement("div", {
29
32
  className: "".concat(_stylesModule.default.container, " ").concat(classes.container)
30
33
  }, Icon && /*#__PURE__*/_react.default.createElement(Icon, {
@@ -52,5 +55,4 @@ Magnitude.propTypes = {
52
55
  unitAlias: _propTypes.string,
53
56
  value: (0, _propTypes.oneOfType)([_propTypes.number, _propTypes.string])
54
57
  };
55
- var _default = (0, _WithContextApi.default)()(Magnitude);
56
- exports.default = _default;
58
+ var _default = exports.default = (0, _WithContextApi.default)()(Magnitude);
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.getVariantProps = void 0;
7
7
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
8
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
- var variants = [{
9
+ const variants = [{
10
10
  id: 'small',
11
11
  unitLabelStyles: _stylesModule.default.unitSmall
12
12
  }, {
@@ -19,11 +19,5 @@ var variants = [{
19
19
  id: 'xxxlarge',
20
20
  unitLabelStyles: _stylesModule.default.unitxxxLarge
21
21
  }];
22
- var getVariantProps = function getVariantProps(props) {
23
- return variants.find(function (variant) {
24
- return props[variant.id];
25
- }) || variants.find(function (variant) {
26
- return variant.id === 'medium';
27
- });
28
- };
22
+ const getVariantProps = props => variants.find(variant => props[variant.id]) || variants.find(variant => variant.id === 'medium');
29
23
  exports.getVariantProps = getVariantProps;
@@ -11,13 +11,19 @@ var _WithContextApi = _interopRequireDefault(require("../../../../../WithContext
11
11
  var _aliases = require("../../../../../../shared/constants/aliases");
12
12
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
- var BillParticularConditions = function BillParticularConditions(_ref) {
15
- var contextApiInfo = _ref.contextApiInfo,
16
- particularConditions = _ref.particularConditions;
17
- var assets = contextApiInfo.assets,
18
- config = contextApiInfo.config,
19
- Label = contextApiInfo.Label;
20
- var texts = config.texts;
14
+ const BillParticularConditions = _ref => {
15
+ let {
16
+ contextApiInfo,
17
+ particularConditions
18
+ } = _ref;
19
+ const {
20
+ assets,
21
+ config,
22
+ Label
23
+ } = contextApiInfo;
24
+ const {
25
+ texts
26
+ } = config;
21
27
  return /*#__PURE__*/_react.default.createElement("div", {
22
28
  className: _stylesModule.default.container
23
29
  }, /*#__PURE__*/_react.default.createElement(assets.ParticularConditionsIcon, {
@@ -30,17 +36,14 @@ var BillParticularConditions = function BillParticularConditions(_ref) {
30
36
  }, /*#__PURE__*/_react.default.createElement(Label, {
31
37
  alias: _aliases.PARTICULAR_CONDITIONS_LIST_TITLE,
32
38
  className: _stylesModule.default.marginBottom
33
- }, texts.mainBillData.particularConditionsListTitle), particularConditions.map(function (particularCondition) {
34
- return /*#__PURE__*/_react.default.createElement(Label, {
35
- alias: _aliases.PARTICULAR_CONDITION,
36
- key: particularCondition,
37
- className: _stylesModule.default.item
38
- }, "* ".concat(particularCondition));
39
- })));
39
+ }, texts.mainBillData.particularConditionsListTitle), particularConditions.map(particularCondition => /*#__PURE__*/_react.default.createElement(Label, {
40
+ alias: _aliases.PARTICULAR_CONDITION,
41
+ key: particularCondition,
42
+ className: _stylesModule.default.item
43
+ }, "* ".concat(particularCondition)))));
40
44
  };
41
45
  BillParticularConditions.propTypes = {
42
46
  contextApiInfo: _smartBillTypes.contextApiInfoTypes,
43
47
  particularConditions: (0, _propTypes.arrayOf)(_propTypes.string)
44
48
  };
45
- var _default = (0, _WithContextApi.default)()(BillParticularConditions);
46
- exports.default = _default;
49
+ var _default = exports.default = (0, _WithContextApi.default)()(BillParticularConditions);
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
@@ -13,36 +12,30 @@ var _aliases = require("../../../../shared/constants/aliases");
13
12
  var _BillParticularConditions = _interopRequireDefault(require("./components/BillParticularConditions"));
14
13
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
15
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
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); }
17
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
18
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
19
- 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."); }
20
- 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); }
21
- 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; }
22
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
23
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
24
- var BillAlert = function BillAlert(_ref) {
25
- var contextApiInfo = _ref.contextApiInfo,
26
- particularConditions = _ref.particularConditions,
27
- isDesktopSize = _ref.isDesktopSize;
28
- var assets = contextApiInfo.assets,
29
- config = contextApiInfo.config,
30
- Dialog = contextApiInfo.Dialog,
31
- Label = contextApiInfo.Label,
32
- Touchable = contextApiInfo.Touchable;
33
- var _ref2 = (config === null || config === void 0 ? void 0 : config.stylesConfig) || {},
34
- billAlertContainer = _ref2.billAlertContainer;
35
- var texts = config.texts;
36
- var _useState = (0, _react.useState)(false),
37
- _useState2 = _slicedToArray(_useState, 2),
38
- dialogOpened = _useState2[0],
39
- setDialogOpened = _useState2[1];
40
- var handleAlertClick = function handleAlertClick() {
41
- return setDialogOpened(true);
42
- };
43
- var handleCloseDialog = function handleCloseDialog() {
44
- return setDialogOpened(false);
45
- };
15
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
16
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17
+ const BillAlert = _ref => {
18
+ let {
19
+ contextApiInfo,
20
+ particularConditions,
21
+ isDesktopSize
22
+ } = _ref;
23
+ const {
24
+ assets,
25
+ config,
26
+ Dialog,
27
+ Label,
28
+ Touchable
29
+ } = contextApiInfo;
30
+ const {
31
+ billAlertContainer
32
+ } = (config === null || config === void 0 ? void 0 : config.stylesConfig) || {};
33
+ const {
34
+ texts
35
+ } = config;
36
+ const [dialogOpened, setDialogOpened] = (0, _react.useState)(false);
37
+ const handleAlertClick = () => setDialogOpened(true);
38
+ const handleCloseDialog = () => setDialogOpened(false);
46
39
  return /*#__PURE__*/_react.default.createElement("div", {
47
40
  className: "".concat(_stylesModule.default.container, " ").concat(billAlertContainer)
48
41
  }, /*#__PURE__*/_react.default.createElement(Dialog, {
@@ -74,5 +67,4 @@ BillAlert.propTypes = {
74
67
  particularConditions: (0, _propTypes.arrayOf)(_propTypes.string),
75
68
  isDesktopSize: _propTypes.bool
76
69
  };
77
- var _default = (0, _WithContextApi.default)()(BillAlert);
78
- exports.default = _default;
70
+ var _default = exports.default = (0, _WithContextApi.default)()(BillAlert);
@@ -14,17 +14,25 @@ var _WithContextApi = _interopRequireDefault(require("../../../../../WithContext
14
14
  var _IconAndDetails = _interopRequireDefault(require("../../../../../IconAndDetails"));
15
15
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
- var ClientData = function ClientData(_ref) {
18
- var contextApiInfo = _ref.contextApiInfo,
19
- billData = _ref.billData,
20
- multipleSettlements = _ref.multipleSettlements;
21
- var assets = contextApiInfo.assets,
22
- config = contextApiInfo.config,
23
- Label = contextApiInfo.Label;
24
- var texts = config.texts,
25
- formatters = config.formatters;
26
- var AdheredToServiceIcon = assets.AdheredToServiceIcon;
27
- var client = (0, _seamlessImmutable.getIn)(billData, ['client'], {});
17
+ const ClientData = _ref => {
18
+ let {
19
+ contextApiInfo,
20
+ billData,
21
+ multipleSettlements
22
+ } = _ref;
23
+ const {
24
+ assets,
25
+ config,
26
+ Label
27
+ } = contextApiInfo;
28
+ const {
29
+ texts,
30
+ formatters
31
+ } = config;
32
+ const {
33
+ AdheredToServiceIcon
34
+ } = assets;
35
+ const client = (0, _seamlessImmutable.getIn)(billData, ['client'], {});
28
36
  return /*#__PURE__*/_react.default.createElement("div", {
29
37
  className: "".concat(_stylesModule.default.container, " ").concat(multipleSettlements ? _stylesModule.default.withOutAlertContainer : _stylesModule.default.withAlertContainer)
30
38
  }, /*#__PURE__*/_react.default.createElement(Label, {
@@ -108,5 +116,4 @@ ClientData.propTypes = {
108
116
  billData: _billDataTypes.billDataTypes,
109
117
  multipleSettlements: _propTypes.bool
110
118
  };
111
- var _default = (0, _WithContextApi.default)()(ClientData);
112
- exports.default = _default;
119
+ var _default = exports.default = (0, _WithContextApi.default)()(ClientData);
@@ -16,17 +16,20 @@ var _PowerProgresBar = _interopRequireDefault(require("../../../../../PowerProgr
16
16
  var _ConsumptionEnergyDetails = _interopRequireDefault(require("../../../../../ConsumptionEnergyDetails"));
17
17
  var _utils = require("./utils");
18
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
- var Consumption = function Consumption(_ref) {
20
- var billData = _ref.billData,
21
- multipleSettlements = _ref.multipleSettlements,
22
- contextApiInfo = _ref.contextApiInfo;
23
- var _contextApiInfo$confi = contextApiInfo.config.validations,
24
- showPower = _contextApiInfo$confi.showPower,
25
- showActiveReactiveComparison = _contextApiInfo$confi.showActiveReactiveComparison;
26
- var currentPeriod = (0, _periods.getCurrentPeriod)(billData);
27
- var hiredPowerConsumption = (0, _consumptions.getTotalConsumption)(currentPeriod, _consumptions2.POWER_TYPES.PURCHASED);
28
- var registeredPowerConsumption = (0, _consumptions.getTotalConsumption)(currentPeriod, _consumptions2.POWER_TYPES.REGISTERED);
29
- var exceededPower = (0, _consumptions.getTotalConsumption)(currentPeriod, _consumptions2.POWER_TYPES.EXCEEDED);
19
+ const Consumption = _ref => {
20
+ let {
21
+ billData,
22
+ multipleSettlements,
23
+ contextApiInfo
24
+ } = _ref;
25
+ const {
26
+ showPower,
27
+ showActiveReactiveComparison
28
+ } = contextApiInfo.config.validations;
29
+ const currentPeriod = (0, _periods.getCurrentPeriod)(billData);
30
+ const hiredPowerConsumption = (0, _consumptions.getTotalConsumption)(currentPeriod, _consumptions2.POWER_TYPES.PURCHASED);
31
+ const registeredPowerConsumption = (0, _consumptions.getTotalConsumption)(currentPeriod, _consumptions2.POWER_TYPES.REGISTERED);
32
+ const exceededPower = (0, _consumptions.getTotalConsumption)(currentPeriod, _consumptions2.POWER_TYPES.EXCEEDED);
30
33
  return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_ConsumptionEnergyDetails.default, {
31
34
  currentPeriod: currentPeriod,
32
35
  multipleSettlements: multipleSettlements,
@@ -43,5 +46,4 @@ Consumption.propTypes = {
43
46
  contextApiInfo: _smartBillTypes.contextApiInfoTypes,
44
47
  multipleSettlements: _propTypes.bool
45
48
  };
46
- var _default = (0, _WithContextApi.default)()(Consumption);
47
- exports.default = _default;
49
+ var _default = exports.default = (0, _WithContextApi.default)()(Consumption);
@@ -4,7 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.validateConsumptions = void 0;
7
- var validateConsumptions = function validateConsumptions(registeredPowerConsumption, hiredPowerConsumption) {
8
- return registeredPowerConsumption !== null && registeredPowerConsumption !== undefined && hiredPowerConsumption !== null && hiredPowerConsumption !== undefined;
9
- };
7
+ const validateConsumptions = (registeredPowerConsumption, hiredPowerConsumption) => registeredPowerConsumption !== null && registeredPowerConsumption !== undefined && hiredPowerConsumption !== null && hiredPowerConsumption !== undefined;
10
8
  exports.validateConsumptions = validateConsumptions;
@@ -14,21 +14,29 @@ var _billDataTypes = require("../../../../../../shared/types/billDataTypes");
14
14
  var _utils = require("./utils");
15
15
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
- var ReadingDetails = function ReadingDetails(_ref) {
18
- var contextApiInfo = _ref.contextApiInfo,
19
- meterNumber = _ref.meterNumber,
20
- readingType = _ref.readingType,
21
- withParticularConditions = _ref.withParticularConditions,
22
- transformationCenter = _ref.transformationCenter,
23
- feederLine = _ref.feederLine,
24
- billData = _ref.billData;
25
- var assets = contextApiInfo.assets,
26
- config = contextApiInfo.config,
27
- Label = contextApiInfo.Label;
28
- var texts = config.texts,
29
- validations = config.validations;
30
- var showFeederLine = validations.showFeederLine;
31
- var longMeterNumber = (meterNumber === null || meterNumber === void 0 ? void 0 : meterNumber.length) > 6;
17
+ const ReadingDetails = _ref => {
18
+ let {
19
+ contextApiInfo,
20
+ meterNumber,
21
+ readingType,
22
+ withParticularConditions,
23
+ transformationCenter,
24
+ feederLine,
25
+ billData
26
+ } = _ref;
27
+ const {
28
+ assets,
29
+ config,
30
+ Label
31
+ } = contextApiInfo;
32
+ const {
33
+ texts,
34
+ validations
35
+ } = config;
36
+ const {
37
+ showFeederLine
38
+ } = validations;
39
+ const longMeterNumber = (meterNumber === null || meterNumber === void 0 ? void 0 : meterNumber.length) > 6;
32
40
  return /*#__PURE__*/_react.default.createElement("div", {
33
41
  className: "".concat(_stylesModule.default.container, " ").concat(withParticularConditions && _stylesModule.default.withParticularConditions)
34
42
  }, /*#__PURE__*/_react.default.createElement(Label, {
@@ -100,5 +108,4 @@ ReadingDetails.propTypes = {
100
108
  billData: _billDataTypes.billDataTypes,
101
109
  feederLine: _propTypes.string
102
110
  };
103
- var _default = (0, _WithContextApi.default)()(ReadingDetails);
104
- exports.default = _default;
111
+ var _default = exports.default = (0, _WithContextApi.default)()(ReadingDetails);
@@ -17,9 +17,9 @@
17
17
  width: 100%;
18
18
 
19
19
  @media #{$tablet-mobile} {
20
- place-content: space-between;
21
20
  margin-bottom: $default-spacing;
22
21
  padding: $default-container-padding;
22
+ place-content: space-between;
23
23
  }
24
24
  }
25
25
 
@@ -74,7 +74,7 @@
74
74
 
75
75
  @media #{$tablet-mobile} {
76
76
  flex-direction: column;
77
- margin-top: 20px;
78
77
  margin-bottom: 10px;
78
+ margin-top: 20px;
79
79
  }
80
80
  }
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.mainText = void 0;
7
7
  var _readings = require("../../../../../../shared/constants/readings");
8
- var mainText = function mainText(readingType, texts) {
8
+ const mainText = (readingType, texts) => {
9
9
  switch (readingType.type) {
10
10
  case _readings.READING_TYPES.FACE_TO_FACE:
11
11
  return readingType.subtype === _readings.READING_TYPES.TELEMEDITION ? texts.commons.telemeditionReading : texts.commons.faceToFaceReading;
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
@@ -23,50 +22,49 @@ var _Consumption = _interopRequireDefault(require("./components/Consumption"));
23
22
  var _ClientData = _interopRequireDefault(require("./components/ClientData"));
24
23
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
25
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
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
- 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; }
28
- var BillBody = function BillBody(_ref) {
25
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
26
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
27
+ const BillBody = _ref => {
29
28
  var _billData$client, _billData$client2;
30
- var billData = _ref.billData,
31
- multipleSettlements = _ref.multipleSettlements,
32
- contextApiInfo = _ref.contextApiInfo;
33
- var _useScreenSize = (0, _hooks.useScreenSize)(),
34
- isDesktopSize = _useScreenSize.isDesktopSize;
35
- var currentPeriod = (0, _periods.getCurrentPeriod)(billData);
36
- var showAlternativeMainBillDataLayout = contextApiInfo.config.validations.showAlternativeMainBillDataLayout;
37
- var withParticularConditions = !(0, _array.isEmpty)(billData.particular_conditions);
38
- var showAlternativeLayout = showAlternativeMainBillDataLayout(billData);
39
- var transformationCenter = (_billData$client = billData.client) === null || _billData$client === void 0 ? void 0 : _billData$client.transformation_center;
40
- var feederLine = (_billData$client2 = billData.client) === null || _billData$client2 === void 0 ? void 0 : _billData$client2.feeder_line;
41
- var readingType = (0, _readings.getReadingPeriod)(billData, _readings2.READING_MOMENTS.FINAL);
42
- var RenderClientData = function RenderClientData() {
43
- return /*#__PURE__*/_react.default.createElement(_ClientData.default, {
44
- billData: billData,
45
- multipleSettlements: multipleSettlements
46
- });
47
- };
48
- var RenderReadingDetails = function RenderReadingDetails() {
49
- return /*#__PURE__*/_react.default.createElement(_ReadingDetails.default, {
50
- meterNumber: billData.meter_number,
51
- readingType: readingType,
52
- withParticularConditions: withParticularConditions,
53
- transformationCenter: transformationCenter,
54
- feederLine: feederLine,
55
- billData: billData
56
- });
57
- };
58
- var AmountAndonsumptionRender = function AmountAndonsumptionRender() {
59
- return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_Amount.default, {
60
- billData: billData,
61
- containerClassName: _stylesModule.default.amount
62
- }), withParticularConditions && /*#__PURE__*/_react.default.createElement(_BillAlert.default, {
63
- particularConditions: billData.particular_conditions,
64
- isDesktopSize: isDesktopSize
65
- }), /*#__PURE__*/_react.default.createElement(_Consumption.default, {
66
- billData: billData,
67
- multipleSettlements: multipleSettlements
68
- }));
69
- };
29
+ let {
30
+ billData,
31
+ multipleSettlements,
32
+ contextApiInfo
33
+ } = _ref;
34
+ const {
35
+ isDesktopSize
36
+ } = (0, _hooks.useScreenSize)();
37
+ const currentPeriod = (0, _periods.getCurrentPeriod)(billData);
38
+ const {
39
+ showAlternativeMainBillDataLayout
40
+ } = contextApiInfo.config.validations;
41
+ const withParticularConditions = !(0, _array.isEmpty)(billData.particular_conditions);
42
+ const showAlternativeLayout = showAlternativeMainBillDataLayout(billData);
43
+ const transformationCenter = (_billData$client = billData.client) === null || _billData$client === void 0 ? void 0 : _billData$client.transformation_center;
44
+ const feederLine = (_billData$client2 = billData.client) === null || _billData$client2 === void 0 ? void 0 : _billData$client2.feeder_line;
45
+ const readingType = (0, _readings.getReadingPeriod)(billData, _readings2.READING_MOMENTS.FINAL);
46
+ const RenderClientData = () => /*#__PURE__*/_react.default.createElement(_ClientData.default, {
47
+ billData: billData,
48
+ multipleSettlements: multipleSettlements
49
+ });
50
+ const RenderReadingDetails = () => /*#__PURE__*/_react.default.createElement(_ReadingDetails.default, {
51
+ meterNumber: billData.meter_number,
52
+ readingType: readingType,
53
+ withParticularConditions: withParticularConditions,
54
+ transformationCenter: transformationCenter,
55
+ feederLine: feederLine,
56
+ billData: billData
57
+ });
58
+ const AmountAndonsumptionRender = () => /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_Amount.default, {
59
+ billData: billData,
60
+ containerClassName: _stylesModule.default.amount
61
+ }), withParticularConditions && /*#__PURE__*/_react.default.createElement(_BillAlert.default, {
62
+ particularConditions: billData.particular_conditions,
63
+ isDesktopSize: isDesktopSize
64
+ }), /*#__PURE__*/_react.default.createElement(_Consumption.default, {
65
+ billData: billData,
66
+ multipleSettlements: multipleSettlements
67
+ }));
70
68
  return /*#__PURE__*/_react.default.createElement("div", {
71
69
  className: _stylesModule.default.container
72
70
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -86,5 +84,4 @@ BillBody.propTypes = {
86
84
  contextApiInfo: _smartBillTypes.contextApiInfoTypes,
87
85
  multipleSettlements: _propTypes.bool
88
86
  };
89
- var _default = (0, _WithContextApi.default)()(BillBody);
90
- exports.default = _default;
87
+ var _default = exports.default = (0, _WithContextApi.default)()(BillBody);
@@ -12,17 +12,22 @@ var _utils = require("../../../../../../utils");
12
12
  var _aliases = require("../../../../../../shared/constants/aliases");
13
13
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
- var TypeAndNumber = function TypeAndNumber(_ref) {
16
- var contextApiInfo = _ref.contextApiInfo,
17
- billType = _ref.billType,
18
- billNumber = _ref.billNumber,
19
- mainAlias = _ref.mainAlias,
20
- detailAlias = _ref.detailAlias,
21
- _ref$classes = _ref.classes,
22
- classes = _ref$classes === void 0 ? {} : _ref$classes;
23
- var config = contextApiInfo.config,
24
- Label = contextApiInfo.Label;
25
- var texts = config.texts;
15
+ const TypeAndNumber = _ref => {
16
+ let {
17
+ contextApiInfo,
18
+ billType,
19
+ billNumber,
20
+ mainAlias,
21
+ detailAlias,
22
+ classes = {}
23
+ } = _ref;
24
+ const {
25
+ config,
26
+ Label
27
+ } = contextApiInfo;
28
+ const {
29
+ texts
30
+ } = config;
26
31
  return /*#__PURE__*/_react.default.createElement("div", {
27
32
  className: "".concat(_stylesModule.default.container, " ").concat(classes.container)
28
33
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -48,5 +53,4 @@ TypeAndNumber.propTypes = {
48
53
  }),
49
54
  detailAlias: _propTypes.string
50
55
  };
51
- var _default = (0, _WithContextApi.default)()(TypeAndNumber);
52
- exports.default = _default;
56
+ var _default = exports.default = (0, _WithContextApi.default)()(TypeAndNumber);