@widergy/utilitygo-smart-bill-web 2.2.2 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/components/Advice/index.js +10 -6
- package/dist/components/Amount/index.js +26 -21
- package/dist/components/Amount/utils.js +2 -5
- package/dist/components/Banner/index.js +10 -6
- package/dist/components/BarChart/constants.js +3 -3
- package/dist/components/BarChart/index.js +28 -22
- package/dist/components/BarChart/utils.js +17 -16
- package/dist/components/BillCalculation/components/ConceptCard/index.js +52 -45
- package/dist/components/BillCalculation/components/Glossary/index.js +48 -64
- package/dist/components/BillCalculation/components/Glossary/styles.module.scss +1 -0
- package/dist/components/BillCalculation/constants.js +1 -1
- package/dist/components/BillCalculation/index.js +48 -51
- package/dist/components/BillCalculation/utils.js +22 -22
- package/dist/components/BillSummary/components/BilledConcepts/components/Concept/index.js +25 -22
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/constants.js +1 -1
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/index.js +15 -15
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/styles.module.scss +3 -3
- package/dist/components/BillSummary/components/BilledConcepts/constants.js +13 -14
- package/dist/components/BillSummary/components/BilledConcepts/index.js +29 -39
- package/dist/components/BillSummary/components/BilledConcepts/utils.js +50 -69
- package/dist/components/BillSummary/index.js +70 -69
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/DataLine/index.js +8 -8
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/index.js +17 -10
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/utils.js +3 -2
- package/dist/components/ConsumptionComparison/components/ComparisonTable/constants.js +147 -133
- package/dist/components/ConsumptionComparison/components/ComparisonTable/index.js +16 -14
- package/dist/components/ConsumptionComparison/components/ComparisonTable/styles.module.scss +1 -0
- package/dist/components/ConsumptionComparison/components/ComparisonTable/utils.js +88 -89
- package/dist/components/ConsumptionComparison/components/ConsumptionAdvice/index.js +21 -11
- package/dist/components/ConsumptionComparison/components/ConsumptionAdvice/utils.js +3 -2
- package/dist/components/ConsumptionComparison/components/PercentageComparison/index.js +21 -14
- package/dist/components/ConsumptionComparison/components/PercentageComparison/styles.module.scss +1 -0
- package/dist/components/ConsumptionComparison/components/PercentageComparison/utils.js +15 -10
- package/dist/components/ConsumptionComparison/index.js +41 -45
- package/dist/components/ConsumptionEnergyDetails/components/ConsumptionEnergyComparison/index.js +27 -22
- package/dist/components/ConsumptionEnergyDetails/components/ConsumptionEnergyComparison/styles.module.scss +1 -1
- package/dist/components/ConsumptionEnergyDetails/components/ConsumptionInDaysLabel/index.js +18 -13
- package/dist/components/ConsumptionEnergyDetails/components/EnergyTotalConsumption/index.js +15 -12
- package/dist/components/ConsumptionEnergyDetails/components/PercentageComparison/index.js +21 -15
- package/dist/components/ConsumptionEnergyDetails/components/PercentageComparison/utils.js +3 -2
- package/dist/components/ConsumptionEnergyDetails/index.js +46 -41
- package/dist/components/ConsumptionEnergyDetails/styles.module.scss +2 -2
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/index.js +64 -60
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/utils.js +12 -13
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderConsumption/index.js +20 -17
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderSettlement/index.js +16 -10
- package/dist/components/ConsumptionIncluded/components/TimelineRow/index.js +42 -37
- package/dist/components/ConsumptionIncluded/components/TimelineRow/styles.module.scss +2 -2
- package/dist/components/ConsumptionIncluded/index.js +31 -32
- package/dist/components/ConsumptionIncluded/utils.js +32 -34
- package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/components/ReadingRow/index.js +14 -10
- package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/components/ReadingRow/styles.module.scss +1 -0
- package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/index.js +23 -20
- package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/styles.module.scss +1 -0
- package/dist/components/ConsumptionPeriod/components/HistoryGraph/index.js +18 -26
- package/dist/components/ConsumptionPeriod/components/Reading/index.js +35 -32
- package/dist/components/ConsumptionPeriod/index.js +12 -8
- package/dist/components/ConsumptionPeriod/styles.module.scss +1 -0
- package/dist/components/ConsumptionPeriod/utils.js +14 -15
- package/dist/components/Date/index.js +12 -9
- package/dist/components/DebtState/index.js +14 -8
- package/dist/components/IconAndDetails/index.js +19 -17
- package/dist/components/Magnitude/index.js +15 -12
- package/dist/components/Magnitude/utils.js +3 -8
- package/dist/components/MainBillData/components/BillAlert/components/BillParticularConditions/index.js +18 -14
- package/dist/components/MainBillData/components/BillAlert/index.js +24 -31
- package/dist/components/MainBillData/components/BillBody/components/ClientData/index.js +19 -11
- package/dist/components/MainBillData/components/BillBody/components/Consumption/index.js +14 -11
- package/dist/components/MainBillData/components/BillBody/components/Consumption/utils.js +2 -3
- package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/index.js +23 -15
- package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/styles.module.scss +3 -2
- package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/utils.js +3 -2
- package/dist/components/MainBillData/components/BillBody/index.js +42 -44
- package/dist/components/MainBillData/components/BillHeader/components/TypeAndNumber/index.js +16 -11
- package/dist/components/MainBillData/components/BillHeader/index.js +29 -24
- package/dist/components/MainBillData/components/BillHeader/styles.module.scss +1 -1
- package/dist/components/MainBillData/index.js +7 -5
- package/dist/components/MainBillData/theme.js +8 -9
- package/dist/components/MainBillData/utils.js +2 -5
- package/dist/components/Period/index.js +54 -43
- package/dist/components/Period/styles.module.scss +0 -6
- package/dist/components/PowerProgresBar/components/PowerConsumption/index.js +15 -11
- package/dist/components/PowerProgresBar/index.js +31 -30
- package/dist/components/RateAndCategory/index.js +25 -27
- package/dist/components/RatesDefinition/components/BillRate/components/RatePrices/index.js +20 -13
- package/dist/components/RatesDefinition/components/BillRate/index.js +24 -14
- package/dist/components/RatesDefinition/components/BillRate/styles.module.scss +1 -1
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/Category/index.js +14 -9
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/components/IndicatorLabel/index.js +26 -21
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/index.js +11 -7
- 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 +11 -10
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Legend/index.js +21 -19
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Stages/index.js +34 -36
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/constants.js +2 -2
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/index.js +17 -30
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/utils.js +37 -48
- package/dist/components/RatesDefinition/components/CategoryByConsumption/constants.js +18 -18
- package/dist/components/RatesDefinition/components/CategoryByConsumption/index.js +23 -31
- package/dist/components/RatesDefinition/components/CategoryByConsumption/utils.js +2 -5
- package/dist/components/RatesDefinition/components/PurchasedRate/index.js +19 -13
- package/dist/components/RatesDefinition/index.js +20 -15
- package/dist/components/RatesDefinition/styles.module.scss +1 -1
- package/dist/components/SmartBillProvider/index.js +12 -34
- package/dist/components/StyledAmount/constants.js +1 -1
- package/dist/components/StyledAmount/index.js +19 -27
- package/dist/components/WithContextApi/index.js +18 -25
- package/dist/components/WithContextApi/layout.js +2 -2
- package/dist/components/WithSeason/index.js +6 -9
- package/dist/constants/deviceSizes.js +33 -18
- package/dist/constants/seasons.js +2 -2
- package/dist/index.js +14 -15
- package/dist/scss/variables/commonColors.module.scss +1 -1
- package/dist/shared/Context/index.js +7 -3
- package/dist/shared/constants/aliases.js +691 -556
- 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 +5 -5
- package/dist/shared/types/componentsTypes.js +18 -10
- package/dist/shared/types/formattersTypes.js +1 -1
- package/dist/shared/types/rateStagesTypes.js +3 -3
- package/dist/shared/types/smartBillTypes.js +5 -10
- package/dist/shared/types/textsTypes.js +1 -1
- package/dist/shared/utils/billCalculation.js +11 -10
- package/dist/shared/utils/consumptions.js +34 -56
- package/dist/shared/utils/context.js +8 -6
- package/dist/shared/utils/expirations.js +2 -5
- package/dist/shared/utils/periods.js +20 -21
- package/dist/shared/utils/rates.js +2 -5
- package/dist/shared/utils/readings.js +4 -10
- package/dist/shared/utils/season.js +2 -5
- package/dist/shared/utils/stagesGraph.js +15 -15
- package/dist/utils/hooks.js +1 -1
- package/dist/utils.js +7 -8
- package/package.json +26 -63
|
@@ -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, {
|
|
@@ -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,10 +19,5 @@ var variants = [{
|
|
|
19
19
|
id: 'xxxlarge',
|
|
20
20
|
unitLabelStyles: _stylesModule.default.unitxxxLarge
|
|
21
21
|
}];
|
|
22
|
-
|
|
23
|
-
|
|
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');
|
|
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,13 +36,11 @@ 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,
|
|
@@ -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, {
|
|
@@ -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, {
|
|
@@ -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,
|
|
@@ -4,6 +4,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.validateConsumptions = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
7
|
+
const validateConsumptions = (registeredPowerConsumption, hiredPowerConsumption) => registeredPowerConsumption !== null && registeredPowerConsumption !== undefined && hiredPowerConsumption !== null && hiredPowerConsumption !== undefined;
|
|
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, {
|
|
@@ -13,13 +13,14 @@
|
|
|
13
13
|
background-color: $white;
|
|
14
14
|
border: 1px solid $borders-gray;
|
|
15
15
|
border-radius: $default-container-border-radius;
|
|
16
|
+
box-sizing: border-box;
|
|
16
17
|
padding: $default-container-padding;
|
|
17
18
|
width: 100%;
|
|
18
19
|
|
|
19
20
|
@media #{$tablet-mobile} {
|
|
20
|
-
place-content: space-between;
|
|
21
21
|
margin-bottom: $default-spacing;
|
|
22
22
|
padding: $default-container-padding;
|
|
23
|
+
place-content: space-between;
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
|
|
@@ -74,7 +75,7 @@
|
|
|
74
75
|
|
|
75
76
|
@media #{$tablet-mobile} {
|
|
76
77
|
flex-direction: column;
|
|
77
|
-
margin-top: 20px;
|
|
78
78
|
margin-bottom: 10px;
|
|
79
|
+
margin-top: 20px;
|
|
79
80
|
}
|
|
80
81
|
}
|
|
@@ -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;
|
|
@@ -14,4 +14,5 @@ var mainText = exports.mainText = function mainText(readingType, texts) {
|
|
|
14
14
|
default:
|
|
15
15
|
return undefined;
|
|
16
16
|
}
|
|
17
|
-
};
|
|
17
|
+
};
|
|
18
|
+
exports.mainText = mainText;
|
|
@@ -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", {
|
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", {
|
|
@@ -18,34 +18,39 @@ var _TypeAndNumber = _interopRequireDefault(require("./components/TypeAndNumber"
|
|
|
18
18
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
19
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
20
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
21
|
-
|
|
21
|
+
const BillHeader = _ref => {
|
|
22
22
|
var _currentPeriod$settle, _currentPeriod$settle2;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
23
|
+
let {
|
|
24
|
+
contextApiInfo,
|
|
25
|
+
billData
|
|
26
|
+
} = _ref;
|
|
27
|
+
const {
|
|
28
|
+
assets,
|
|
29
|
+
config
|
|
30
|
+
} = contextApiInfo;
|
|
31
|
+
const {
|
|
32
|
+
texts
|
|
33
|
+
} = config;
|
|
34
|
+
const {
|
|
35
|
+
isDesktopSize,
|
|
36
|
+
isMobileOrTablet
|
|
37
|
+
} = (0, _hooks.useScreenSize)();
|
|
38
|
+
const currentPeriod = (0, _periods.getCurrentPeriod)(billData);
|
|
39
|
+
const issuedOnDate = currentPeriod === null || currentPeriod === void 0 || (_currentPeriod$settle = currentPeriod.settlements) === null || _currentPeriod$settle === void 0 || (_currentPeriod$settle = _currentPeriod$settle.current) === null || _currentPeriod$settle === void 0 ? void 0 : _currentPeriod$settle.issued_on;
|
|
40
|
+
const totalSettlements = currentPeriod === null || currentPeriod === void 0 || (_currentPeriod$settle2 = currentPeriod.settlements) === null || _currentPeriod$settle2 === void 0 ? void 0 : _currentPeriod$settle2.total_settlements;
|
|
41
|
+
const debtStatusLabel = billData.debt_status_label;
|
|
42
|
+
const debtStatusValidation = debtStatusLabel !== null;
|
|
43
|
+
const multipleSettlements = totalSettlements > 1;
|
|
44
|
+
const aliases = {
|
|
38
45
|
mainAlias: _aliases.MAIN_LIGHT,
|
|
39
46
|
detailAlias: _aliases.DETAIL
|
|
40
47
|
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}));
|
|
48
|
-
};
|
|
48
|
+
const DebtStatusLabel = () => /*#__PURE__*/_react.default.createElement("div", {
|
|
49
|
+
className: "".concat(billData.warning ? _stylesModule.default.pendingDebtLabelContainer : _stylesModule.default.adheredToAutomaticDebtContainer)
|
|
50
|
+
}, /*#__PURE__*/_react.default.createElement(_DebtState.default, {
|
|
51
|
+
debtStatusLabel: debtStatusLabel,
|
|
52
|
+
isWarning: billData.warning
|
|
53
|
+
}));
|
|
49
54
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
50
55
|
className: _stylesModule.default.container
|
|
51
56
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -14,12 +14,14 @@ var _BillHeader = _interopRequireDefault(require("./components/BillHeader"));
|
|
|
14
14
|
var _BillBody = _interopRequireDefault(require("./components/BillBody"));
|
|
15
15
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
17
|
+
const MainBillData = _ref => {
|
|
18
18
|
var _currentPeriod$settle;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
let {
|
|
20
|
+
billData,
|
|
21
|
+
classes
|
|
22
|
+
} = _ref;
|
|
23
|
+
const currentPeriod = (0, _periods.getCurrentPeriod)(billData);
|
|
24
|
+
const multipleSettlements = (currentPeriod === null || currentPeriod === void 0 || (_currentPeriod$settle = currentPeriod.settlements) === null || _currentPeriod$settle === void 0 ? void 0 : _currentPeriod$settle.total_settlements) > 1;
|
|
23
25
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
24
26
|
className: "".concat(_stylesModule.default.container, " ").concat(classes.container)
|
|
25
27
|
}, /*#__PURE__*/_react.default.createElement(_BillHeader.default, {
|
|
@@ -5,12 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.retrieveStyle = void 0;
|
|
7
7
|
var _seamlessImmutable = require("seamless-immutable");
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
8
|
+
const retrieveStyle = theme => ({
|
|
9
|
+
container: {
|
|
10
|
+
backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['Container', 'backgroundColor']),
|
|
11
|
+
border: (0, _seamlessImmutable.getIn)(theme, ['Container', 'border']),
|
|
12
|
+
borderRadius: (0, _seamlessImmutable.getIn)(theme, ['Container', 'borderRadius'])
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
exports.retrieveStyle = retrieveStyle;
|
|
@@ -5,8 +5,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getCurrentPeriod = void 0;
|
|
7
7
|
var _seamlessImmutable = require("seamless-immutable");
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return period.current;
|
|
11
|
-
}) || {};
|
|
12
|
-
};
|
|
8
|
+
const getCurrentPeriod = billData => (0, _seamlessImmutable.getIn)(billData, ['periods'], []).find(period => period.current) || {};
|
|
9
|
+
exports.getCurrentPeriod = getCurrentPeriod;
|