@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.
- package/CHANGELOG.md +20 -0
- package/dist/components/Advice/index.js +11 -8
- package/dist/components/Amount/index.js +27 -23
- package/dist/components/Amount/utils.js +1 -5
- package/dist/components/Banner/index.js +11 -8
- package/dist/components/BarChart/constants.js +3 -6
- package/dist/components/BarChart/index.js +29 -24
- package/dist/components/BarChart/utils.js +15 -15
- package/dist/components/BillCalculation/components/ConceptCard/index.js +53 -47
- package/dist/components/BillCalculation/components/Glossary/index.js +49 -66
- package/dist/components/BillCalculation/components/Glossary/styles.module.scss +1 -0
- package/dist/components/BillCalculation/constants.js +1 -2
- package/dist/components/BillCalculation/index.js +49 -53
- package/dist/components/BillCalculation/utils.js +19 -22
- package/dist/components/BillSummary/components/BilledConcepts/components/Concept/index.js +26 -24
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/constants.js +2 -3
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/index.js +16 -17
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/styles.module.scss +3 -3
- package/dist/components/BillSummary/components/BilledConcepts/constants.js +12 -17
- package/dist/components/BillSummary/components/BilledConcepts/index.js +30 -41
- package/dist/components/BillSummary/components/BilledConcepts/utils.js +44 -68
- package/dist/components/BillSummary/index.js +71 -71
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/DataLine/index.js +9 -10
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/index.js +18 -12
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/utils.js +1 -1
- package/dist/components/ConsumptionComparison/components/ComparisonTable/constants.js +144 -143
- package/dist/components/ConsumptionComparison/components/ComparisonTable/index.js +17 -16
- package/dist/components/ConsumptionComparison/components/ComparisonTable/utils.js +84 -88
- package/dist/components/ConsumptionComparison/components/ConsumptionAdvice/index.js +22 -13
- package/dist/components/ConsumptionComparison/components/ConsumptionAdvice/utils.js +1 -1
- package/dist/components/ConsumptionComparison/components/PercentageComparison/index.js +22 -16
- package/dist/components/ConsumptionComparison/components/PercentageComparison/utils.js +13 -9
- package/dist/components/ConsumptionComparison/index.js +42 -47
- package/dist/components/ConsumptionEnergyDetails/components/ConsumptionEnergyComparison/index.js +28 -24
- package/dist/components/ConsumptionEnergyDetails/components/ConsumptionEnergyComparison/styles.module.scss +1 -1
- package/dist/components/ConsumptionEnergyDetails/components/ConsumptionInDaysLabel/index.js +19 -15
- package/dist/components/ConsumptionEnergyDetails/components/EnergyTotalConsumption/index.js +16 -14
- package/dist/components/ConsumptionEnergyDetails/components/PercentageComparison/index.js +22 -17
- package/dist/components/ConsumptionEnergyDetails/components/PercentageComparison/utils.js +1 -1
- package/dist/components/ConsumptionEnergyDetails/index.js +47 -43
- package/dist/components/ConsumptionEnergyDetails/styles.module.scss +2 -2
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/index.js +65 -62
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/utils.js +11 -13
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderConsumption/index.js +21 -19
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderSettlement/index.js +17 -12
- package/dist/components/ConsumptionIncluded/components/TimelineRow/index.js +43 -39
- package/dist/components/ConsumptionIncluded/components/TimelineRow/styles.module.scss +2 -2
- package/dist/components/ConsumptionIncluded/index.js +32 -34
- package/dist/components/ConsumptionIncluded/utils.js +29 -33
- package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/components/ReadingRow/index.js +15 -12
- package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/index.js +24 -22
- package/dist/components/ConsumptionPeriod/components/HistoryGraph/index.js +19 -28
- package/dist/components/ConsumptionPeriod/components/Reading/index.js +36 -34
- package/dist/components/ConsumptionPeriod/index.js +13 -10
- package/dist/components/ConsumptionPeriod/utils.js +13 -15
- package/dist/components/Date/index.js +13 -11
- package/dist/components/DebtState/index.js +15 -10
- package/dist/components/IconAndDetails/index.js +20 -19
- package/dist/components/Magnitude/index.js +16 -14
- package/dist/components/Magnitude/utils.js +2 -8
- package/dist/components/MainBillData/components/BillAlert/components/BillParticularConditions/index.js +19 -16
- package/dist/components/MainBillData/components/BillAlert/index.js +25 -33
- package/dist/components/MainBillData/components/BillBody/components/ClientData/index.js +20 -13
- package/dist/components/MainBillData/components/BillBody/components/Consumption/index.js +15 -13
- package/dist/components/MainBillData/components/BillBody/components/Consumption/utils.js +1 -3
- package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/index.js +24 -17
- package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/styles.module.scss +2 -2
- package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/utils.js +1 -1
- package/dist/components/MainBillData/components/BillBody/index.js +43 -46
- package/dist/components/MainBillData/components/BillHeader/components/TypeAndNumber/index.js +17 -13
- package/dist/components/MainBillData/components/BillHeader/index.js +30 -26
- package/dist/components/MainBillData/components/BillHeader/styles.module.scss +1 -1
- package/dist/components/MainBillData/index.js +8 -7
- package/dist/components/MainBillData/theme.js +7 -9
- package/dist/components/MainBillData/utils.js +1 -5
- package/dist/components/Period/index.js +55 -45
- package/dist/components/PowerProgresBar/components/PowerConsumption/index.js +16 -13
- package/dist/components/PowerProgresBar/index.js +32 -32
- package/dist/components/RateAndCategory/index.js +26 -29
- package/dist/components/RatesDefinition/components/BillRate/components/RatePrices/index.js +21 -15
- package/dist/components/RatesDefinition/components/BillRate/index.js +25 -16
- package/dist/components/RatesDefinition/components/BillRate/styles.module.scss +1 -1
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/Category/index.js +15 -11
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/components/IndicatorLabel/index.js +27 -23
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/index.js +12 -9
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/styles.module.scss +1 -1
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/utils.js +9 -9
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Legend/index.js +22 -21
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Stages/index.js +35 -38
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Stages/styles.module.scss +0 -1
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/constants.js +2 -4
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/index.js +18 -32
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/utils.js +35 -47
- package/dist/components/RatesDefinition/components/CategoryByConsumption/constants.js +18 -36
- package/dist/components/RatesDefinition/components/CategoryByConsumption/index.js +24 -33
- package/dist/components/RatesDefinition/components/CategoryByConsumption/utils.js +1 -5
- package/dist/components/RatesDefinition/components/PurchasedRate/index.js +20 -15
- package/dist/components/RatesDefinition/index.js +21 -17
- package/dist/components/RatesDefinition/styles.module.scss +1 -1
- package/dist/components/SmartBillProvider/index.js +13 -36
- package/dist/components/StyledAmount/constants.js +2 -3
- package/dist/components/StyledAmount/index.js +20 -29
- package/dist/components/WithContextApi/index.js +19 -27
- package/dist/components/WithContextApi/layout.js +3 -4
- package/dist/components/WithSeason/index.js +7 -11
- package/dist/constants/deviceSizes.js +27 -24
- package/dist/constants/seasons.js +3 -5
- package/dist/index.js +19 -19
- package/dist/scss/variables/commonColors.module.scss +1 -1
- package/dist/shared/Context/index.js +5 -3
- package/dist/shared/constants/aliases.js +691 -694
- package/dist/shared/constants/consumptions.js +5 -9
- package/dist/shared/constants/periodicities.js +2 -3
- package/dist/shared/constants/rates.js +2 -3
- package/dist/shared/constants/readings.js +3 -5
- package/dist/shared/constants/seasons.js +3 -5
- package/dist/shared/constants/stagesGraph.js +4 -8
- package/dist/shared/types/assetsTypes.js +1 -2
- package/dist/shared/types/billDataTypes.js +6 -11
- package/dist/shared/types/componentsTypes.js +19 -14
- package/dist/shared/types/formattersTypes.js +2 -3
- package/dist/shared/types/rateStagesTypes.js +3 -6
- package/dist/shared/types/smartBillTypes.js +5 -11
- package/dist/shared/types/textsTypes.js +2 -3
- package/dist/shared/utils/billCalculation.js +9 -9
- package/dist/shared/utils/consumptions.js +27 -55
- package/dist/shared/utils/context.js +6 -5
- package/dist/shared/utils/expirations.js +1 -5
- package/dist/shared/utils/periods.js +14 -20
- package/dist/shared/utils/rates.js +1 -5
- package/dist/shared/utils/readings.js +2 -10
- package/dist/shared/utils/season.js +1 -5
- package/dist/shared/utils/stagesGraph.js +11 -15
- package/dist/utils/hooks.js +2 -3
- package/dist/utils.js +4 -8
- 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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
tertiaryAlias =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
classes =
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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(
|
|
17
|
-
function _interopRequireWildcard(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
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(
|
|
27
|
-
function _interopRequireWildcard(
|
|
28
|
-
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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);
|
package/dist/components/MainBillData/components/BillHeader/components/TypeAndNumber/index.js
CHANGED
|
@@ -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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
classes =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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);
|