@widergy/utilitygo-smart-bill-web 1.7.3 → 1.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/dist/components/Advice/index.js +1 -2
- package/dist/components/Advice/styles.module.scss +2 -1
- package/dist/components/Amount/index.js +2 -2
- package/dist/components/Amount/styles.module.scss +10 -2
- package/dist/components/BarChart/constants.js +19 -3
- package/dist/components/BarChart/index.js +70 -101
- package/dist/components/BarChart/styles.module.scss +71 -0
- package/dist/components/BarChart/utils.js +31 -15
- package/dist/components/BillCalculation/components/ConceptCard/index.js +28 -9
- package/dist/components/BillCalculation/components/ConceptCard/styles.module.scss +16 -6
- package/dist/components/BillCalculation/index.js +10 -5
- package/dist/components/BillCalculation/utils.js +14 -9
- package/dist/components/BillSummary/components/BilledConcepts/components/Concept/index.js +11 -18
- package/dist/components/BillSummary/components/BilledConcepts/components/Concept/styles.module.scss +1 -5
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/constants.js +9 -3
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/index.js +21 -28
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/styles.module.scss +2 -2
- package/dist/components/BillSummary/components/BilledConcepts/constants.js +1 -1
- package/dist/components/BillSummary/components/BilledConcepts/index.js +8 -3
- package/dist/components/BillSummary/components/BilledConcepts/styles.module.scss +1 -1
- package/dist/components/BillSummary/components/BilledConcepts/utils.js +20 -6
- package/dist/components/BillSummary/styles.module.scss +2 -3
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/DataLine/index.js +3 -3
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/DataLine/styles.module.scss +4 -2
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/index.js +3 -3
- package/dist/components/ConsumptionComparison/components/ComparisonTable/constants.js +61 -37
- package/dist/components/ConsumptionComparison/components/ComparisonTable/styles.module.scss +14 -6
- package/dist/components/ConsumptionComparison/components/ComparisonTable/utils.js +4 -2
- package/dist/components/ConsumptionComparison/components/ConsumptionAdvice/index.js +2 -5
- package/dist/components/ConsumptionComparison/components/ConsumptionAdvice/styles.module.scss +4 -5
- package/dist/components/ConsumptionComparison/components/PercentageComparison/index.js +4 -3
- package/dist/components/ConsumptionComparison/components/PercentageComparison/styles.module.scss +3 -12
- package/dist/components/ConsumptionComparison/index.js +9 -11
- package/dist/components/ConsumptionComparison/styles.module.scss +5 -4
- package/dist/components/ConsumptionEnergyDetails/components/ConsumptionEnergyComparison/index.js +26 -2
- package/dist/components/ConsumptionEnergyDetails/components/ConsumptionEnergyComparison/styles.module.scss +2 -0
- package/dist/components/ConsumptionEnergyDetails/components/PercentageComparison/styles.module.scss +1 -1
- package/dist/components/ConsumptionEnergyDetails/index.js +21 -11
- package/dist/components/ConsumptionEnergyDetails/styles.module.scss +13 -1
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/index.js +61 -42
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/styles.module.scss +33 -20
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/utils.js +24 -0
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderConsumption/index.js +13 -19
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderConsumption/styles.module.scss +3 -6
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderSettlement/index.js +7 -9
- package/dist/components/ConsumptionIncluded/components/TimelineRow/index.js +11 -3
- package/dist/components/ConsumptionIncluded/components/TimelineRow/styles.module.scss +10 -13
- package/dist/components/ConsumptionIncluded/styles.module.scss +5 -0
- package/dist/components/ConsumptionIncluded/utils.js +6 -6
- package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/components/ReadingRow/styles.module.scss +2 -0
- package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/index.js +8 -6
- package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/styles.module.scss +16 -4
- package/dist/components/ConsumptionPeriod/components/HistoryGraph/index.js +1 -7
- package/dist/components/ConsumptionPeriod/components/Reading/index.js +26 -9
- package/dist/components/ConsumptionPeriod/components/Reading/styles.module.scss +13 -8
- package/dist/components/ConsumptionPeriod/styles.module.scss +11 -10
- package/dist/components/Date/index.js +2 -2
- package/dist/components/Date/styles.module.scss +3 -0
- package/dist/components/DebtState/styles.module.scss +1 -1
- package/dist/components/IconAndDetails/index.js +4 -1
- package/dist/components/IconAndDetails/styles.module.scss +2 -2
- package/dist/components/Magnitude/index.js +6 -5
- package/dist/components/Magnitude/styles.module.scss +5 -5
- package/dist/components/MainBillData/components/BillAlert/components/BillParticularConditions/index.js +5 -5
- package/dist/components/MainBillData/components/BillAlert/styles.module.scss +5 -3
- package/dist/components/MainBillData/components/BillBody/components/ClientData/index.js +13 -13
- package/dist/components/MainBillData/components/BillBody/components/ClientData/styles.module.scss +3 -3
- package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/styles.module.scss +1 -1
- package/dist/components/MainBillData/components/BillBody/styles.module.scss +4 -3
- package/dist/components/MainBillData/components/BillHeader/components/TypeAndNumber/index.js +3 -2
- package/dist/components/MainBillData/components/BillHeader/components/TypeAndNumber/styles.module.scss +7 -3
- package/dist/components/MainBillData/components/BillHeader/index.js +2 -2
- package/dist/components/MainBillData/components/BillHeader/styles.module.scss +10 -9
- package/dist/components/MainBillData/styles.module.scss +0 -1
- package/dist/components/Period/index.js +39 -11
- package/dist/components/Period/styles.module.scss +13 -4
- package/dist/components/PowerProgresBar/components/PowerConsumption/index.js +2 -3
- package/dist/components/PowerProgresBar/index.js +3 -4
- package/dist/components/RatesDefinition/components/BillRate/components/RatePrices/index.js +6 -17
- package/dist/components/RatesDefinition/components/BillRate/components/RatePrices/styles.module.scss +8 -3
- package/dist/components/RatesDefinition/components/BillRate/index.js +10 -11
- package/dist/components/RatesDefinition/components/BillRate/styles.module.scss +8 -29
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/Category/index.js +9 -5
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/Category/styles.module.scss +12 -18
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/components/Stage/components/SubStage/index.js +4 -3
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/components/Stage/index.js +13 -62
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/components/Stage/styles.module.scss +2 -6
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/index.js +1 -0
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/components/IndicatorLabel/index.js +18 -12
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/components/IndicatorLabel/styles.module.scss +7 -3
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/index.js +23 -14
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/styles.module.scss +6 -19
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/utils.js +35 -1
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/LegendItem/index.js +80 -0
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/LegendItem/styles.module.scss +57 -0
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/constants.js +17 -9
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/styles.module.scss +2 -1
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/utils.js +1 -1
- package/dist/components/RatesDefinition/components/CategoryByConsumption/index.js +61 -7
- package/dist/components/RatesDefinition/components/CategoryByConsumption/styles.module.scss +20 -4
- package/dist/components/RatesDefinition/components/PurchasedRate/index.js +12 -22
- package/dist/components/RatesDefinition/components/PurchasedRate/styles.module.scss +14 -44
- package/dist/components/RatesDefinition/index.js +16 -12
- package/dist/components/RatesDefinition/styles.module.scss +38 -10
- package/dist/components/StyledAmount/constants.js +0 -45
- package/dist/components/StyledAmount/index.js +5 -14
- package/dist/components/StyledAmount/styles.module.scss +14 -8
- package/dist/components/WithContextApi/index.js +9 -1
- package/dist/constants/deviceSizes.js +1 -1
- package/dist/index.js +28 -15
- package/dist/shared/Context/index.js +1 -1
- package/dist/shared/constants/aliases.js +532 -10
- package/dist/shared/constants/components.js +3 -1
- package/dist/shared/constants/consumptions.js +1 -1
- package/dist/shared/constants/readings.js +1 -1
- package/dist/shared/constants/stagesGraph.js +1 -1
- package/dist/shared/types/assetsTypes.js +1 -30
- package/dist/shared/types/billDataTypes.js +1 -1
- package/dist/shared/types/componentsTypes.js +4 -2
- package/dist/shared/types/rateStagesTypes.js +1 -1
- package/dist/shared/utils/consumptions.js +3 -3
- package/dist/shared/utils/context.js +3 -1
- package/dist/shared/utils/periods.js +1 -1
- package/dist/shared/utils/readings.js +1 -1
- package/dist/shared/utils/stagesGraph.js +1 -1
- package/dist/utils.js +1 -1
- package/package.json +2 -3
- package/dist/components/BarChart/components/CustomBar/index.js +0 -111
- package/dist/components/BarChart/components/CustomLabelText/index.js +0 -48
- package/dist/components/BarChart/components/CustomXAxisLabel/index.js +0 -58
- package/dist/components/BarChart/styles.js +0 -90
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/utils.js +0 -27
- package/dist/components/BillSummary/components/Rate/index.js +0 -56
- package/dist/components/BillSummary/components/Rate/styles.module.scss +0 -43
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
## [1.10.1](https://github.com/widergy/UtilityGO-Smart-Bill-Web/compare/v1.10.0...v1.10.1) (2021-12-10)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* removed recharts ([#20](https://github.com/widergy/UtilityGO-Smart-Bill-Web/issues/20)) ([01a9e74](https://github.com/widergy/UtilityGO-Smart-Bill-Web/commit/01a9e74da24ae7788f92c20719690450559985a8))
|
|
7
|
+
|
|
8
|
+
# [1.10.0](https://github.com/widergy/UtilityGO-Smart-Bill-Web/compare/v1.9.0...v1.10.0) (2021-11-17)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* single settlement days and some fixes ([#19](https://github.com/widergy/UtilityGO-Smart-Bill-Web/issues/19)) ([4122d95](https://github.com/widergy/UtilityGO-Smart-Bill-Web/commit/4122d955e005e9c6631785dbf608ec68c9402e0a))
|
|
14
|
+
|
|
15
|
+
# [1.9.0](https://github.com/widergy/UtilityGO-Smart-Bill-Web/compare/v1.8.0...v1.9.0) (2021-11-08)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* added dayjs ([f1c9d68](https://github.com/widergy/UtilityGO-Smart-Bill-Web/commit/f1c9d68b5e967211e82a3ac892d554903c9aa4fb))
|
|
21
|
+
|
|
22
|
+
# [1.8.0](https://github.com/widergy/UtilityGO-Smart-Bill-Web/compare/v1.7.3...v1.8.0) (2021-10-26)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* nextgen design updates ([#16](https://github.com/widergy/UtilityGO-Smart-Bill-Web/issues/16)) ([6355edd](https://github.com/widergy/UtilityGO-Smart-Bill-Web/commit/6355edd755c239b55f8842fcf30278232028649d))
|
|
28
|
+
|
|
1
29
|
## [1.7.3](https://github.com/widergy/UtilityGO-Smart-Bill-Web/compare/v1.7.2...v1.7.3) (2021-10-01)
|
|
2
30
|
|
|
3
31
|
|
|
@@ -35,8 +35,7 @@ var Advice = function Advice(_ref) {
|
|
|
35
35
|
alias: _aliases.TITLE,
|
|
36
36
|
className: _stylesModule.default.title
|
|
37
37
|
}, title)), /*#__PURE__*/_react.default.createElement(Label, {
|
|
38
|
-
|
|
39
|
-
small: true
|
|
38
|
+
alias: _aliases.ADVICE_CONTENT
|
|
40
39
|
}, contentText));
|
|
41
40
|
};
|
|
42
41
|
|
|
@@ -7,7 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
11
11
|
|
|
12
12
|
var _propTypes = require("prop-types");
|
|
13
13
|
|
|
@@ -63,7 +63,7 @@ var Amount = function Amount(_ref) {
|
|
|
63
63
|
}, item.text), /*#__PURE__*/_react.default.createElement(Label, {
|
|
64
64
|
alias: _aliases.EXPIRATION,
|
|
65
65
|
className: _stylesModule.default.expiration
|
|
66
|
-
}, (0,
|
|
66
|
+
}, (0, _dayjs.default)(item.expiration.date, 'YYYY-MM-DD').format('DD/MM/YYYY')));
|
|
67
67
|
};
|
|
68
68
|
|
|
69
69
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -8,16 +8,18 @@
|
|
|
8
8
|
border-radius: $default-container-border-radius;
|
|
9
9
|
display: flex;
|
|
10
10
|
flex-direction: column;
|
|
11
|
+
gap: 16px;
|
|
11
12
|
margin-bottom: $default-spacing;
|
|
12
13
|
padding: $default-container-padding;
|
|
13
14
|
|
|
14
15
|
@media #{$tablet-mobile} {
|
|
15
16
|
flex-flow: column;
|
|
16
|
-
padding: $default-container-padding
|
|
17
|
+
padding: $default-container-padding;
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
.amountContainer {
|
|
22
|
+
align-items: center;
|
|
21
23
|
display: flex;
|
|
22
24
|
justify-content: space-between;
|
|
23
25
|
|
|
@@ -40,7 +42,7 @@
|
|
|
40
42
|
|
|
41
43
|
.withBottomMargin {
|
|
42
44
|
@media #{$desktop} {
|
|
43
|
-
margin-top:
|
|
45
|
+
margin-top: 26px;
|
|
44
46
|
}
|
|
45
47
|
}
|
|
46
48
|
|
|
@@ -51,5 +53,11 @@
|
|
|
51
53
|
.expirations{
|
|
52
54
|
display: flex;
|
|
53
55
|
flex-direction: row;
|
|
56
|
+
gap: 16px;
|
|
54
57
|
justify-content: space-between;
|
|
58
|
+
|
|
59
|
+
@media #{$mobile} {
|
|
60
|
+
flex-direction: column;
|
|
61
|
+
margin-top: 26px;
|
|
62
|
+
}
|
|
55
63
|
}
|
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
var
|
|
8
|
-
|
|
6
|
+
exports.RESPONSIVE_BAR_WIDTH = exports.DESKTOP_BAR_WIDTH = exports.BAR_CHART_CONFIG = void 0;
|
|
7
|
+
var BAR_CHART_CONFIG = {
|
|
8
|
+
spacingOptions: {
|
|
9
|
+
axisPadding: 10,
|
|
10
|
+
scrollPadding: 0,
|
|
11
|
+
marginTop: -12,
|
|
12
|
+
onTopLabelPadding: 16,
|
|
13
|
+
lateralMargin: -10
|
|
14
|
+
},
|
|
15
|
+
barPadding: 0.045,
|
|
16
|
+
valuesOnTop: true,
|
|
17
|
+
center: true,
|
|
18
|
+
hideYAxis: true
|
|
19
|
+
};
|
|
20
|
+
exports.BAR_CHART_CONFIG = BAR_CHART_CONFIG;
|
|
21
|
+
var DESKTOP_BAR_WIDTH = 40;
|
|
22
|
+
exports.DESKTOP_BAR_WIDTH = DESKTOP_BAR_WIDTH;
|
|
23
|
+
var RESPONSIVE_BAR_WIDTH = 90;
|
|
24
|
+
exports.RESPONSIVE_BAR_WIDTH = RESPONSIVE_BAR_WIDTH;
|
|
@@ -1,136 +1,105 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.default = void 0;
|
|
7
9
|
|
|
8
|
-
var _react =
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
11
|
|
|
10
12
|
var _propTypes = require("prop-types");
|
|
11
13
|
|
|
12
|
-
var _ResponsiveContainer = _interopRequireDefault(require("recharts/lib/component/ResponsiveContainer"));
|
|
13
|
-
|
|
14
|
-
var _ComposedChart = _interopRequireDefault(require("recharts/lib/chart/ComposedChart"));
|
|
15
|
-
|
|
16
|
-
var _XAxis = _interopRequireDefault(require("recharts/lib/cartesian/XAxis"));
|
|
17
|
-
|
|
18
|
-
var _YAxis = _interopRequireDefault(require("recharts/lib/cartesian/YAxis"));
|
|
19
|
-
|
|
20
|
-
var _Label = _interopRequireDefault(require("recharts/lib/component/Label"));
|
|
21
|
-
|
|
22
|
-
var _Bar = _interopRequireDefault(require("recharts/lib/cartesian/Bar"));
|
|
23
|
-
|
|
24
14
|
var _smartBillTypes = require("../../shared/types/smartBillTypes");
|
|
25
15
|
|
|
26
16
|
var _WithContextApi = _interopRequireDefault(require("../WithContextApi"));
|
|
27
17
|
|
|
28
|
-
var
|
|
18
|
+
var _aliases = require("../../shared/constants/aliases");
|
|
29
19
|
|
|
30
|
-
var
|
|
20
|
+
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
31
21
|
|
|
32
|
-
var
|
|
22
|
+
var _utils = require("./utils");
|
|
33
23
|
|
|
34
24
|
var _constants = require("./constants");
|
|
35
25
|
|
|
36
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
37
27
|
|
|
38
|
-
var
|
|
39
|
-
|
|
28
|
+
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); }
|
|
29
|
+
|
|
30
|
+
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; }
|
|
31
|
+
|
|
32
|
+
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); }
|
|
33
|
+
|
|
34
|
+
var BarChartSection = function BarChartSection(_ref) {
|
|
35
|
+
var _colors$barChart;
|
|
40
36
|
|
|
41
37
|
var contextApiInfo = _ref.contextApiInfo,
|
|
42
38
|
data = _ref.data,
|
|
43
|
-
|
|
44
|
-
unit = _ref.unit
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
var
|
|
50
|
-
|
|
51
|
-
var
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
var
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
var
|
|
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
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}, /*#__PURE__*/_react.default.createElement(_Label.default, {
|
|
96
|
-
value: texts.consumptionPeriod.bimesters,
|
|
97
|
-
fill: label.baseColor,
|
|
98
|
-
fontFamily: fontFamily,
|
|
99
|
-
fontSize: label.fontSize,
|
|
100
|
-
offset: label.x.axisLabelOffset,
|
|
101
|
-
opacity: label.opacity,
|
|
102
|
-
position: "bottom"
|
|
103
|
-
})), /*#__PURE__*/_react.default.createElement(_YAxis.default, {
|
|
104
|
-
axisLine: false,
|
|
105
|
-
tick: false
|
|
106
|
-
}, /*#__PURE__*/_react.default.createElement(_Label.default, {
|
|
107
|
-
angle: yAxis.labelAngle,
|
|
108
|
-
value: unit && "".concat(texts.consumptionPeriod.consumption, " (").concat(unit, ")"),
|
|
109
|
-
fill: label.baseColor,
|
|
110
|
-
fontFamily: fontFamily,
|
|
111
|
-
fontSize: label.fontSize,
|
|
112
|
-
offset: label.y.axisLabelOffset,
|
|
113
|
-
opacity: label.opacity,
|
|
114
|
-
position: "insideTopRight"
|
|
115
|
-
}))));
|
|
39
|
+
isDesktop = _ref.isDesktop,
|
|
40
|
+
unit = _ref.unit;
|
|
41
|
+
var BarChart = contextApiInfo.BarChart,
|
|
42
|
+
Label = contextApiInfo.Label,
|
|
43
|
+
config = contextApiInfo.config,
|
|
44
|
+
assets = contextApiInfo.assets;
|
|
45
|
+
var CalendarIcon = assets.CalendarIcon,
|
|
46
|
+
EnergyIcon = assets.EnergyIcon;
|
|
47
|
+
var texts = config.texts,
|
|
48
|
+
colors = config.colors;
|
|
49
|
+
|
|
50
|
+
var _useMemo = (0, _react.useMemo)(function () {
|
|
51
|
+
return (0, _utils.getProcessedData)(data, colors.barChart);
|
|
52
|
+
}, [data]),
|
|
53
|
+
processedData = _useMemo.processedData,
|
|
54
|
+
xAxisDefinition = _useMemo.xAxisDefinition;
|
|
55
|
+
|
|
56
|
+
var yAxisLabel = unit && "".concat(texts.consumptionPeriod.consumption, " (").concat(unit, ")");
|
|
57
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
58
|
+
className: _stylesModule.default.sectionContainer
|
|
59
|
+
}, /*#__PURE__*/_react.default.createElement(Label, {
|
|
60
|
+
alias: _aliases.TITLE,
|
|
61
|
+
className: _stylesModule.default.title
|
|
62
|
+
}, texts.consumptionPeriod.barChartTitle), /*#__PURE__*/_react.default.createElement("div", {
|
|
63
|
+
className: _stylesModule.default.barChartContainer
|
|
64
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
65
|
+
className: _stylesModule.default.yAxis
|
|
66
|
+
}, /*#__PURE__*/_react.default.createElement(EnergyIcon, {
|
|
67
|
+
style: {
|
|
68
|
+
fill: colors.primary
|
|
69
|
+
},
|
|
70
|
+
className: _stylesModule.default.energyIcon
|
|
71
|
+
}), /*#__PURE__*/_react.default.createElement(Label, {
|
|
72
|
+
alias: _aliases.DETAIL,
|
|
73
|
+
className: _stylesModule.default.yAxisLabel
|
|
74
|
+
}, yAxisLabel), /*#__PURE__*/_react.default.createElement(CalendarIcon, {
|
|
75
|
+
style: {
|
|
76
|
+
fill: (_colors$barChart = colors.barChart) === null || _colors$barChart === void 0 ? void 0 : _colors$barChart.calendar
|
|
77
|
+
}
|
|
78
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
79
|
+
className: _stylesModule.default.graphContainer
|
|
80
|
+
}, BarChart && /*#__PURE__*/_react.default.createElement(BarChart, _extends({}, _constants.BAR_CHART_CONFIG, {
|
|
81
|
+
classNames: {
|
|
82
|
+
onTopBarLabel: _stylesModule.default.graphLabels,
|
|
83
|
+
xAxisMainLabel: _stylesModule.default.graphLabels,
|
|
84
|
+
xAxis: _stylesModule.default.xAxis
|
|
85
|
+
},
|
|
86
|
+
className: _stylesModule.default.chart,
|
|
87
|
+
xAxisDefinition: xAxisDefinition,
|
|
88
|
+
barData: processedData,
|
|
89
|
+
minBarWidth: isDesktop ? _constants.DESKTOP_BAR_WIDTH : _constants.RESPONSIVE_BAR_WIDTH
|
|
90
|
+
})))));
|
|
116
91
|
};
|
|
117
92
|
|
|
118
|
-
|
|
93
|
+
BarChartSection.propTypes = {
|
|
119
94
|
contextApiInfo: _smartBillTypes.contextApiInfoTypes,
|
|
120
95
|
data: (0, _propTypes.arrayOf)((0, _propTypes.shape)({
|
|
121
96
|
period: _propTypes.string,
|
|
122
97
|
consumption: _propTypes.number
|
|
123
98
|
})).isRequired,
|
|
124
|
-
|
|
125
|
-
unit: _propTypes.string
|
|
126
|
-
bars: (0, _propTypes.arrayOf)((0, _propTypes.shape)({
|
|
127
|
-
key: _propTypes.string
|
|
128
|
-
})),
|
|
129
|
-
currentPeriod: _propTypes.string,
|
|
130
|
-
lastYearPeriod: _propTypes.string,
|
|
131
|
-
isDesktop: _propTypes.bool
|
|
99
|
+
isDesktop: _propTypes.bool,
|
|
100
|
+
unit: _propTypes.string
|
|
132
101
|
};
|
|
133
102
|
|
|
134
|
-
var _default = (0, _WithContextApi.default)()(
|
|
103
|
+
var _default = (0, _WithContextApi.default)()(BarChartSection);
|
|
135
104
|
|
|
136
105
|
exports.default = _default;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
@import '../../scss/variables/_mediaQueries';
|
|
2
|
+
@import '../../scss/variables/_colorsExport.scss';
|
|
3
|
+
|
|
4
|
+
.chart {
|
|
5
|
+
height: 198px;
|
|
6
|
+
margin: 16px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.sectionContainer {
|
|
10
|
+
align-items: center;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
margin-bottom: 16px;
|
|
14
|
+
width: 100%;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.barChartContainer {
|
|
18
|
+
align-items: flex-end;
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: row;
|
|
21
|
+
height: 100%;
|
|
22
|
+
width: 100%;
|
|
23
|
+
|
|
24
|
+
@media #{$tablet-mobile} {
|
|
25
|
+
width: 100%;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.graphLabels {
|
|
30
|
+
font-size: 14px;
|
|
31
|
+
font-weight: 400;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.yAxisLabel {
|
|
35
|
+
transform: rotate(-90deg);
|
|
36
|
+
transform-origin: left;
|
|
37
|
+
margin: 0px 0px 32px 12px;
|
|
38
|
+
width: max-content;
|
|
39
|
+
|
|
40
|
+
@media #{$tablet-mobile} {
|
|
41
|
+
margin: 0px 0px 16px 12px;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.yAxis {
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
margin: 0 0 16px 24px;
|
|
49
|
+
width: 24px !important;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.graphContainer {
|
|
53
|
+
display: block;
|
|
54
|
+
width: calc(100% - 60px);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.title {
|
|
58
|
+
padding: 24px 24px 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.xAxis {
|
|
62
|
+
stroke: $borders-gray;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.energyIcon {
|
|
66
|
+
margin: 0 0 128px 0;
|
|
67
|
+
|
|
68
|
+
@media #{$tablet-mobile} {
|
|
69
|
+
margin: 16px 0 116px 0;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -3,25 +3,41 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.getProcessedData = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var getProcessedData = function getProcessedData(data) {
|
|
9
|
+
var colors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
9
10
|
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
switch (period) {
|
|
15
|
-
case currentPeriod:
|
|
16
|
-
return label.currentPeriodColor;
|
|
11
|
+
var getBarColor = function getBarColor(index) {
|
|
12
|
+
return index === 0 ? colors.first : index === data.length - 1 ? colors.last : colors.main;
|
|
13
|
+
};
|
|
17
14
|
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
var getLabelColor = function getLabelColor(index) {
|
|
16
|
+
return index === 0 ? colors.valueFirst : index === data.length - 1 ? colors.last : colors.valueMain;
|
|
17
|
+
};
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
var processedData = data.map(function (_ref, index) {
|
|
20
|
+
var period = _ref.period,
|
|
21
|
+
consumption = _ref.consumption;
|
|
22
|
+
return {
|
|
23
|
+
value: consumption,
|
|
24
|
+
mainLabel: period,
|
|
25
|
+
key: period,
|
|
26
|
+
color: getBarColor(index),
|
|
27
|
+
onTopLabelColor: getLabelColor(index)
|
|
28
|
+
};
|
|
29
|
+
});
|
|
30
|
+
var xAxisDefinition = processedData.map(function (_ref2, index) {
|
|
31
|
+
var mainLabel = _ref2.mainLabel;
|
|
32
|
+
return {
|
|
33
|
+
mainLabel: mainLabel,
|
|
34
|
+
color: getLabelColor(index)
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
return {
|
|
38
|
+
processedData: [processedData],
|
|
39
|
+
xAxisDefinition: xAxisDefinition
|
|
24
40
|
};
|
|
25
41
|
};
|
|
26
42
|
|
|
27
|
-
exports.
|
|
43
|
+
exports.getProcessedData = getProcessedData;
|
|
@@ -34,8 +34,12 @@ var ConceptCard = function ConceptCard(_ref) {
|
|
|
34
34
|
lines = _ref$lines === void 0 ? [] : _ref$lines;
|
|
35
35
|
var Card = contextApiInfo.Card,
|
|
36
36
|
Label = contextApiInfo.Label,
|
|
37
|
-
config = contextApiInfo.config
|
|
38
|
-
|
|
37
|
+
config = contextApiInfo.config,
|
|
38
|
+
assets = contextApiInfo.assets;
|
|
39
|
+
var showZeroConcepts = config.showZeroConcepts,
|
|
40
|
+
colors = config.colors;
|
|
41
|
+
var ArrowDownwardIcon = assets.ArrowDownwardIcon,
|
|
42
|
+
ArrowUpwardIcon = assets.ArrowUpwardIcon;
|
|
39
43
|
|
|
40
44
|
var handleOnClick = function handleOnClick() {
|
|
41
45
|
return onClick(index);
|
|
@@ -56,29 +60,44 @@ var ConceptCard = function ConceptCard(_ref) {
|
|
|
56
60
|
return (list.amount !== 0 || showZeroConcepts) && /*#__PURE__*/_react.default.createElement("div", {
|
|
57
61
|
className: _stylesModule.default.lineContainer,
|
|
58
62
|
key: list.title
|
|
59
|
-
}, /*#__PURE__*/_react.default.createElement("div",
|
|
63
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
64
|
+
className: _stylesModule.default.conceptLineContainer
|
|
65
|
+
}, /*#__PURE__*/_react.default.createElement(Label, {
|
|
60
66
|
alias: _aliases.CONCEPT_TITLE
|
|
61
|
-
}, list.title),
|
|
62
|
-
alias: _aliases.LINE_DESCRIPTION,
|
|
63
|
-
className: _stylesModule.default.lineDescription
|
|
64
|
-
}, list.description)), /*#__PURE__*/_react.default.createElement(_StyledAmount.default, {
|
|
67
|
+
}, list.title), /*#__PURE__*/_react.default.createElement(_StyledAmount.default, {
|
|
65
68
|
alias: _aliases.CONCEPT_LIST_AMOUNT,
|
|
66
69
|
aliasDecimal: _aliases.CONCEPT_LIST_AMOUNT_DECIMAL,
|
|
67
70
|
amount: list.amount,
|
|
68
71
|
variant: "large"
|
|
69
|
-
}))
|
|
72
|
+
})), list.description && /*#__PURE__*/_react.default.createElement(Label, {
|
|
73
|
+
alias: _aliases.LINE_DESCRIPTION
|
|
74
|
+
}, list.description));
|
|
70
75
|
};
|
|
71
76
|
|
|
77
|
+
var iconsStyle = {
|
|
78
|
+
fill: colors.primary
|
|
79
|
+
};
|
|
72
80
|
return /*#__PURE__*/_react.default.createElement(Card, {
|
|
73
81
|
className: "".concat(_stylesModule.default.container, " ").concat((0, _array.isEmpty)(lines) && _stylesModule.default.containerWithoutLines),
|
|
74
82
|
expandableIconButtonClassName: _stylesModule.default.expandIcon,
|
|
83
|
+
ExpandedIcon: ArrowUpwardIcon && function () {
|
|
84
|
+
return /*#__PURE__*/_react.default.createElement(ArrowUpwardIcon, iconsStyle);
|
|
85
|
+
},
|
|
86
|
+
NonExpandedIcon: ArrowDownwardIcon && function () {
|
|
87
|
+
return /*#__PURE__*/_react.default.createElement(ArrowDownwardIcon, iconsStyle);
|
|
88
|
+
},
|
|
75
89
|
expandableContentClassName: "".concat(isOpen && _stylesModule.default.expandableContent),
|
|
76
90
|
header: Header,
|
|
77
91
|
horizontal: true,
|
|
92
|
+
style: {
|
|
93
|
+
color: 'black'
|
|
94
|
+
},
|
|
78
95
|
isCollapsible: !(0, _array.isEmpty)(lines),
|
|
79
96
|
isOpen: isOpen,
|
|
80
97
|
onClick: handleOnClick
|
|
81
|
-
},
|
|
98
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
99
|
+
className: _stylesModule.default.emptySpace
|
|
100
|
+
}), lines.map(handleRenderLines));
|
|
82
101
|
};
|
|
83
102
|
|
|
84
103
|
ConceptCard.propTypes = {
|
|
@@ -3,23 +3,33 @@
|
|
|
3
3
|
@import '../../../../scss/variables/_mediaQueries';
|
|
4
4
|
@import '../../../../scss/variables/_sizes';
|
|
5
5
|
|
|
6
|
+
|
|
6
7
|
.headerContainer {
|
|
7
8
|
align-items: center;
|
|
8
9
|
display: flex;
|
|
9
10
|
justify-content: space-between;
|
|
11
|
+
margin-right: 8px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.emptySpace {
|
|
15
|
+
height: 8px;
|
|
10
16
|
}
|
|
11
17
|
|
|
12
18
|
.lineContainer {
|
|
13
19
|
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
gap: 12px;
|
|
14
22
|
justify-content: space-between;
|
|
15
|
-
padding: $default-spacing
|
|
23
|
+
padding: $default-spacing 0 0;
|
|
16
24
|
@media #{$tablet-mobile} {
|
|
17
25
|
padding: $default-spacing 0 0;
|
|
18
26
|
}
|
|
19
27
|
}
|
|
20
28
|
|
|
21
|
-
.
|
|
22
|
-
|
|
29
|
+
.conceptLineContainer {
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: row;
|
|
32
|
+
justify-content: space-between;
|
|
23
33
|
}
|
|
24
34
|
|
|
25
35
|
.container {
|
|
@@ -28,7 +38,8 @@
|
|
|
28
38
|
border-bottom: 0;
|
|
29
39
|
border-radius: 0;
|
|
30
40
|
box-shadow: none;
|
|
31
|
-
padding: $default-spacing
|
|
41
|
+
padding: $default-spacing calc(2 * #{$default-spacing});
|
|
42
|
+
|
|
32
43
|
@media #{$tablet-mobile} {
|
|
33
44
|
padding: $default-spacing;
|
|
34
45
|
}
|
|
@@ -42,8 +53,7 @@
|
|
|
42
53
|
}
|
|
43
54
|
|
|
44
55
|
.expandIcon {
|
|
45
|
-
|
|
46
|
-
margin-left: 10px;
|
|
56
|
+
width: 24px;
|
|
47
57
|
padding: 0;
|
|
48
58
|
}
|
|
49
59
|
|
|
@@ -50,7 +50,10 @@ var BillCalculation = function BillCalculation(_ref) {
|
|
|
50
50
|
config = contextApiInfo.config;
|
|
51
51
|
var texts = config.texts,
|
|
52
52
|
showZeroConcepts = config.showZeroConcepts,
|
|
53
|
-
stylesConfig = config.stylesConfig
|
|
53
|
+
stylesConfig = config.stylesConfig,
|
|
54
|
+
formatters = config.formatters,
|
|
55
|
+
colors = config.colors;
|
|
56
|
+
var periodFormatter = formatters.periodFormatter;
|
|
54
57
|
var withBillCalcTitleDate = config.validations.withBillCalcTitleDate;
|
|
55
58
|
var detail = billData.detail;
|
|
56
59
|
|
|
@@ -63,7 +66,7 @@ var BillCalculation = function BillCalculation(_ref) {
|
|
|
63
66
|
return setOpenedConcept(openedConcept !== index ? index : null);
|
|
64
67
|
};
|
|
65
68
|
|
|
66
|
-
var title = (0, _utils.periodToTitleMapper)(billData, texts, withBillCalcTitleDate(billData));
|
|
69
|
+
var title = (0, _utils.periodToTitleMapper)(billData, texts, periodFormatter, withBillCalcTitleDate(billData));
|
|
67
70
|
|
|
68
71
|
var handleRenderConceptCard = function handleRenderConceptCard(concept, index) {
|
|
69
72
|
return (concept.total !== 0 || showZeroConcepts) && /*#__PURE__*/_react.default.createElement(_ConceptCard.default, {
|
|
@@ -83,10 +86,12 @@ var BillCalculation = function BillCalculation(_ref) {
|
|
|
83
86
|
alias: _aliases.BILL_CALC_CONCEPT_TITLE,
|
|
84
87
|
className: _stylesModule.default.title
|
|
85
88
|
}, title), detail.concepts.map(handleRenderConceptCard), /*#__PURE__*/_react.default.createElement("div", {
|
|
86
|
-
className: "".concat(_stylesModule.default.totalAmountContainer, " ").concat(stylesConfig === null || stylesConfig === void 0 ? void 0 : stylesConfig.paymentTotal)
|
|
89
|
+
className: "".concat(_stylesModule.default.totalAmountContainer, " ").concat(stylesConfig === null || stylesConfig === void 0 ? void 0 : stylesConfig.paymentTotal),
|
|
90
|
+
style: {
|
|
91
|
+
backgroundColor: colors.primary
|
|
92
|
+
}
|
|
87
93
|
}, /*#__PURE__*/_react.default.createElement(Label, {
|
|
88
|
-
alias: _aliases.BILL_CALC_TOTAL
|
|
89
|
-
white: true
|
|
94
|
+
alias: _aliases.BILL_CALC_TOTAL
|
|
90
95
|
}, texts.commons.totalAmount), /*#__PURE__*/_react.default.createElement(_StyledAmount.default, {
|
|
91
96
|
alias: _aliases.BILL_CALC_AMOUNT,
|
|
92
97
|
aliasDecimal: _aliases.BILL_CALC_AMOUNT_DECIMAL,
|