@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.
- package/CHANGELOG.md +28 -0
- package/dist/components/Advice/index.js +6 -10
- package/dist/components/Amount/index.js +21 -26
- package/dist/components/Amount/utils.js +5 -1
- package/dist/components/Banner/index.js +6 -10
- package/dist/components/BarChart/constants.js +3 -3
- package/dist/components/BarChart/index.js +25 -28
- package/dist/components/BarChart/utils.js +15 -15
- package/dist/components/BillCalculation/components/ConceptCard/index.js +48 -47
- package/dist/components/BillCalculation/constants.js +1 -1
- package/dist/components/BillCalculation/index.js +54 -44
- package/dist/components/BillCalculation/utils.js +14 -17
- package/dist/components/BillSummary/components/BilledConcepts/components/Concept/index.js +25 -26
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/constants.js +9 -3
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/index.js +31 -34
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/styles.module.scss +2 -2
- package/dist/components/BillSummary/components/BilledConcepts/constants.js +14 -12
- package/dist/components/BillSummary/components/BilledConcepts/index.js +49 -31
- package/dist/components/BillSummary/components/BilledConcepts/utils.js +76 -44
- package/dist/components/BillSummary/index.js +78 -76
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/DataLine/index.js +8 -8
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/index.js +12 -17
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/utils.js +1 -1
- package/dist/components/ConsumptionComparison/components/ComparisonTable/constants.js +135 -148
- package/dist/components/ConsumptionComparison/components/ComparisonTable/index.js +14 -16
- package/dist/components/ConsumptionComparison/components/ComparisonTable/utils.js +94 -89
- package/dist/components/ConsumptionComparison/components/ConsumptionAdvice/index.js +11 -21
- package/dist/components/ConsumptionComparison/components/ConsumptionAdvice/utils.js +1 -1
- package/dist/components/ConsumptionComparison/components/PercentageComparison/index.js +16 -21
- package/dist/components/ConsumptionComparison/components/PercentageComparison/utils.js +9 -13
- package/dist/components/ConsumptionComparison/index.js +56 -42
- package/dist/components/ConsumptionEnergyDetails/components/ConsumptionEnergyComparison/index.js +26 -30
- package/dist/components/ConsumptionEnergyDetails/components/ConsumptionInDaysLabel/index.js +13 -18
- package/dist/components/ConsumptionEnergyDetails/components/EnergyTotalConsumption/index.js +15 -17
- package/dist/components/ConsumptionEnergyDetails/components/PercentageComparison/index.js +17 -21
- package/dist/components/ConsumptionEnergyDetails/components/PercentageComparison/utils.js +1 -1
- package/dist/components/ConsumptionEnergyDetails/index.js +55 -52
- package/dist/components/ConsumptionEnergyDetails/styles.module.scss +12 -0
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/index.js +65 -66
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/utils.js +13 -11
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderConsumption/index.js +19 -22
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderSettlement/index.js +10 -16
- package/dist/components/ConsumptionIncluded/components/TimelineRow/index.js +39 -43
- package/dist/components/ConsumptionIncluded/index.js +36 -34
- package/dist/components/ConsumptionIncluded/utils.js +33 -29
- package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/components/ReadingRow/index.js +10 -14
- package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/index.js +22 -25
- package/dist/components/ConsumptionPeriod/components/HistoryGraph/index.js +34 -18
- package/dist/components/ConsumptionPeriod/components/Reading/index.js +34 -37
- package/dist/components/ConsumptionPeriod/index.js +8 -12
- package/dist/components/ConsumptionPeriod/utils.js +15 -13
- package/dist/components/Date/index.js +9 -12
- package/dist/components/DebtState/index.js +8 -14
- package/dist/components/IconAndDetails/index.js +17 -19
- package/dist/components/Magnitude/index.js +12 -15
- package/dist/components/Magnitude/utils.js +8 -2
- package/dist/components/MainBillData/components/BillAlert/components/BillParticularConditions/index.js +16 -20
- package/dist/components/MainBillData/components/BillAlert/index.js +45 -28
- package/dist/components/MainBillData/components/BillBody/components/ClientData/index.js +11 -19
- package/dist/components/MainBillData/components/BillBody/components/Consumption/index.js +11 -14
- package/dist/components/MainBillData/components/BillBody/components/Consumption/utils.js +3 -1
- package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/index.js +15 -23
- package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/utils.js +1 -1
- package/dist/components/MainBillData/components/BillBody/index.js +50 -45
- package/dist/components/MainBillData/components/BillHeader/components/TypeAndNumber/index.js +9 -15
- package/dist/components/MainBillData/components/BillHeader/index.js +26 -29
- package/dist/components/MainBillData/index.js +5 -7
- package/dist/components/MainBillData/theme.js +9 -7
- package/dist/components/MainBillData/utils.js +5 -1
- package/dist/components/Period/index.js +47 -55
- package/dist/components/PowerProgresBar/components/PowerConsumption/index.js +11 -15
- package/dist/components/PowerProgresBar/index.js +36 -36
- package/dist/components/RateAndCategory/index.js +31 -30
- package/dist/components/RatesDefinition/components/BillRate/components/RatePrices/index.js +13 -20
- package/dist/components/RatesDefinition/components/BillRate/index.js +14 -24
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/Category/index.js +9 -14
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/components/Stage/components/LimitsLine/index.js +7 -5
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/components/Stage/components/SubStage/index.js +13 -19
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/components/Stage/components/SubStage/utils.js +3 -1
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/components/Stage/index.js +18 -18
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/index.js +19 -19
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/components/IndicatorLabel/index.js +21 -26
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/index.js +12 -15
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/utils.js +37 -35
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/LegendItem/index.js +25 -25
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/constants.js +18 -18
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/index.js +32 -12
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/utils.js +20 -12
- package/dist/components/RatesDefinition/components/CategoryByConsumption/index.js +50 -32
- package/dist/components/RatesDefinition/components/PurchasedRate/index.js +13 -19
- package/dist/components/RatesDefinition/index.js +15 -20
- package/dist/components/SmartBillProvider/index.js +47 -12
- package/dist/components/StyledAmount/constants.js +1 -1
- package/dist/components/StyledAmount/index.js +35 -19
- package/dist/components/WithContextApi/index.js +27 -16
- package/dist/components/WithContextApi/layout.js +2 -2
- package/dist/components/WithSeason/index.js +9 -5
- package/dist/constants/deviceSizes.js +17 -27
- package/dist/constants/seasons.js +2 -2
- package/dist/index.js +16 -14
- package/dist/shared/Context/index.js +3 -5
- package/dist/shared/constants/aliases.js +550 -682
- package/dist/shared/constants/components.js +2 -1
- package/dist/shared/constants/consumptions.js +4 -4
- package/dist/shared/constants/periodicities.js +1 -1
- package/dist/shared/constants/rates.js +1 -1
- package/dist/shared/constants/readings.js +2 -2
- package/dist/shared/constants/seasons.js +2 -2
- package/dist/shared/constants/stagesGraph.js +4 -4
- package/dist/shared/types/assetsTypes.js +1 -1
- package/dist/shared/types/billDataTypes.js +4 -4
- package/dist/shared/types/componentsTypes.js +13 -18
- package/dist/shared/types/formattersTypes.js +1 -1
- package/dist/shared/types/rateStagesTypes.js +3 -3
- package/dist/shared/types/smartBillTypes.js +10 -5
- package/dist/shared/types/textsTypes.js +1 -1
- package/dist/shared/utils/billCalculation.js +9 -9
- package/dist/shared/utils/consumptions.js +62 -28
- package/dist/shared/utils/context.js +8 -7
- package/dist/shared/utils/expirations.js +5 -1
- package/dist/shared/utils/periods.js +20 -14
- package/dist/shared/utils/rates.js +5 -1
- package/dist/shared/utils/readings.js +10 -2
- package/dist/shared/utils/season.js +5 -1
- package/dist/shared/utils/stagesGraph.js +15 -11
- package/dist/utils/hooks.js +5 -37
- package/dist/utils.js +8 -4
- package/package.json +2 -2
- 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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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"; 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,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 ||
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
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"; 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
|
});
|
|
@@ -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 ||
|
|
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
|
-
|
|
50
|
+
var BillBody = function BillBody(_ref) {
|
|
49
51
|
var _billData$client, _billData$client2;
|
|
50
52
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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
|
package/dist/components/MainBillData/components/BillHeader/components/TypeAndNumber/index.js
CHANGED
|
@@ -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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
36
|
+
var BillHeader = function BillHeader(_ref) {
|
|
37
37
|
var _currentPeriod$settle, _currentPeriod$settle2, _currentPeriod$settle3;
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
|
|
28
|
+
var MainBillData = function MainBillData(_ref) {
|
|
29
29
|
var _currentPeriod$settle;
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
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;
|