@widergy/utilitygo-smart-bill-web 1.10.0 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/dist/components/Advice/index.js +6 -10
- package/dist/components/Amount/index.js +21 -26
- package/dist/components/Amount/utils.js +5 -1
- package/dist/components/Banner/index.js +6 -10
- package/dist/components/BarChart/constants.js +3 -3
- package/dist/components/BarChart/index.js +25 -28
- package/dist/components/BarChart/utils.js +15 -15
- package/dist/components/BillCalculation/components/ConceptCard/index.js +48 -47
- package/dist/components/BillCalculation/constants.js +1 -1
- package/dist/components/BillCalculation/index.js +54 -44
- package/dist/components/BillCalculation/utils.js +14 -17
- package/dist/components/BillSummary/components/BilledConcepts/components/Concept/index.js +25 -26
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/constants.js +9 -3
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/index.js +31 -34
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/styles.module.scss +2 -2
- package/dist/components/BillSummary/components/BilledConcepts/constants.js +14 -12
- package/dist/components/BillSummary/components/BilledConcepts/index.js +49 -31
- package/dist/components/BillSummary/components/BilledConcepts/utils.js +76 -44
- package/dist/components/BillSummary/index.js +78 -76
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/DataLine/index.js +8 -8
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/index.js +12 -17
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/utils.js +1 -1
- package/dist/components/ConsumptionComparison/components/ComparisonTable/constants.js +135 -148
- package/dist/components/ConsumptionComparison/components/ComparisonTable/index.js +14 -16
- package/dist/components/ConsumptionComparison/components/ComparisonTable/utils.js +94 -89
- package/dist/components/ConsumptionComparison/components/ConsumptionAdvice/index.js +11 -21
- package/dist/components/ConsumptionComparison/components/ConsumptionAdvice/utils.js +1 -1
- package/dist/components/ConsumptionComparison/components/PercentageComparison/index.js +16 -21
- package/dist/components/ConsumptionComparison/components/PercentageComparison/utils.js +9 -13
- package/dist/components/ConsumptionComparison/index.js +56 -42
- package/dist/components/ConsumptionEnergyDetails/components/ConsumptionEnergyComparison/index.js +26 -30
- package/dist/components/ConsumptionEnergyDetails/components/ConsumptionInDaysLabel/index.js +13 -18
- package/dist/components/ConsumptionEnergyDetails/components/EnergyTotalConsumption/index.js +15 -17
- package/dist/components/ConsumptionEnergyDetails/components/PercentageComparison/index.js +17 -21
- package/dist/components/ConsumptionEnergyDetails/components/PercentageComparison/utils.js +1 -1
- package/dist/components/ConsumptionEnergyDetails/index.js +47 -51
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/index.js +65 -66
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/utils.js +13 -11
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderConsumption/index.js +19 -22
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderSettlement/index.js +10 -16
- package/dist/components/ConsumptionIncluded/components/TimelineRow/index.js +39 -43
- package/dist/components/ConsumptionIncluded/index.js +36 -34
- package/dist/components/ConsumptionIncluded/utils.js +33 -29
- package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/components/ReadingRow/index.js +10 -14
- package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/index.js +22 -25
- package/dist/components/ConsumptionPeriod/components/HistoryGraph/index.js +34 -18
- package/dist/components/ConsumptionPeriod/components/Reading/index.js +34 -37
- package/dist/components/ConsumptionPeriod/index.js +8 -12
- package/dist/components/ConsumptionPeriod/utils.js +15 -13
- package/dist/components/Date/index.js +9 -12
- package/dist/components/DebtState/index.js +8 -14
- package/dist/components/IconAndDetails/index.js +17 -19
- package/dist/components/Magnitude/index.js +12 -15
- package/dist/components/Magnitude/utils.js +8 -2
- package/dist/components/MainBillData/components/BillAlert/components/BillParticularConditions/index.js +16 -20
- package/dist/components/MainBillData/components/BillAlert/index.js +45 -28
- package/dist/components/MainBillData/components/BillBody/components/ClientData/index.js +11 -19
- package/dist/components/MainBillData/components/BillBody/components/Consumption/index.js +11 -14
- package/dist/components/MainBillData/components/BillBody/components/Consumption/utils.js +3 -1
- package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/index.js +15 -23
- package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/utils.js +1 -1
- package/dist/components/MainBillData/components/BillBody/index.js +50 -45
- package/dist/components/MainBillData/components/BillHeader/components/TypeAndNumber/index.js +9 -15
- package/dist/components/MainBillData/components/BillHeader/index.js +26 -29
- package/dist/components/MainBillData/index.js +5 -7
- package/dist/components/MainBillData/theme.js +9 -7
- package/dist/components/MainBillData/utils.js +5 -1
- package/dist/components/Period/index.js +47 -55
- package/dist/components/PowerProgresBar/components/PowerConsumption/index.js +11 -15
- package/dist/components/PowerProgresBar/index.js +36 -36
- package/dist/components/RateAndCategory/index.js +31 -30
- package/dist/components/RatesDefinition/components/BillRate/components/RatePrices/index.js +13 -20
- package/dist/components/RatesDefinition/components/BillRate/index.js +14 -24
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/Category/index.js +9 -14
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/components/IndicatorLabel/index.js +21 -26
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/index.js +13 -19
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/styles.module.scss +1 -4
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/utils.js +13 -56
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Legend/index.js +50 -0
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Legend/styles.module.scss +34 -0
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Stages/index.js +65 -0
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Stages/styles.module.scss +88 -0
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/constants.js +6 -37
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/index.js +51 -16
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/styles.module.scss +4 -1
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/utils.js +68 -23
- package/dist/components/RatesDefinition/components/CategoryByConsumption/constants.js +42 -0
- package/dist/components/RatesDefinition/components/CategoryByConsumption/index.js +45 -36
- package/dist/components/RatesDefinition/components/CategoryByConsumption/utils.js +16 -0
- package/dist/components/RatesDefinition/components/PurchasedRate/index.js +13 -19
- package/dist/components/RatesDefinition/index.js +15 -20
- package/dist/components/SmartBillProvider/index.js +47 -12
- package/dist/components/StyledAmount/constants.js +1 -1
- package/dist/components/StyledAmount/index.js +35 -19
- package/dist/components/WithContextApi/index.js +27 -16
- package/dist/components/WithContextApi/layout.js +2 -2
- package/dist/components/WithSeason/index.js +9 -5
- package/dist/constants/deviceSizes.js +17 -27
- package/dist/constants/seasons.js +2 -2
- package/dist/index.js +16 -14
- package/dist/shared/Context/index.js +3 -5
- package/dist/shared/constants/aliases.js +550 -683
- package/dist/shared/constants/components.js +2 -1
- package/dist/shared/constants/consumptions.js +4 -4
- package/dist/shared/constants/periodicities.js +1 -1
- package/dist/shared/constants/rates.js +1 -1
- package/dist/shared/constants/readings.js +2 -2
- package/dist/shared/constants/seasons.js +2 -2
- package/dist/shared/constants/stagesGraph.js +4 -4
- package/dist/shared/types/assetsTypes.js +1 -1
- package/dist/shared/types/billDataTypes.js +4 -4
- package/dist/shared/types/componentsTypes.js +13 -18
- package/dist/shared/types/formattersTypes.js +1 -1
- package/dist/shared/types/rateStagesTypes.js +4 -4
- package/dist/shared/types/smartBillTypes.js +10 -5
- package/dist/shared/types/textsTypes.js +1 -1
- package/dist/shared/utils/billCalculation.js +9 -9
- package/dist/shared/utils/consumptions.js +62 -28
- package/dist/shared/utils/context.js +8 -7
- package/dist/shared/utils/expirations.js +5 -1
- package/dist/shared/utils/periods.js +20 -14
- package/dist/shared/utils/rates.js +5 -1
- package/dist/shared/utils/readings.js +10 -2
- package/dist/shared/utils/season.js +5 -1
- package/dist/shared/utils/stagesGraph.js +15 -11
- package/dist/utils/hooks.js +5 -37
- package/dist/utils.js +8 -4
- package/package.json +2 -2
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/utils.js +0 -27
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/components/Stage/components/LimitsLine/index.js +0 -21
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/components/Stage/components/LimitsLine/styles.module.scss +0 -15
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/components/Stage/components/SubStage/index.js +0 -69
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/components/Stage/components/SubStage/styles.module.scss +0 -5
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/components/Stage/components/SubStage/utils.js +0 -12
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/components/Stage/index.js +0 -68
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/components/Stage/styles.module.scss +0 -32
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/index.js +0 -59
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Bars/styles.module.scss +0 -3
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/LegendItem/index.js +0 -83
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/LegendItem/styles.module.scss +0 -57
|
@@ -7,26 +7,28 @@ exports.getSubStageWidth = exports.getSubStageRangeWidth = exports.getStageRange
|
|
|
7
7
|
|
|
8
8
|
var _stagesGraph = require("../constants/stagesGraph");
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
var getCurrentStage = function getCurrentStage(value, rateStages) {
|
|
11
|
+
return rateStages.find(function (stage) {
|
|
12
|
+
return stage.range[_stagesGraph.MIN_VALUE] <= value && (value <= stage.range[_stagesGraph.MAX_VALUE] || stage.range[_stagesGraph.MAX_VALUE] === _stagesGraph.INFINITE);
|
|
13
|
+
});
|
|
14
|
+
};
|
|
11
15
|
|
|
12
16
|
exports.getCurrentStage = getCurrentStage;
|
|
13
17
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
range
|
|
17
|
-
} = subStage;
|
|
18
|
+
var getSubStageRangeWidth = function getSubStageRangeWidth(subStage) {
|
|
19
|
+
var range = subStage.range;
|
|
18
20
|
return range[_stagesGraph.MAX_VALUE] === _stagesGraph.INFINITE || !range[_stagesGraph.MAX_VALUE] ? _stagesGraph.DEFAULT_INFINITE_SUB_STAGE_RANGE_WIDTH : range[_stagesGraph.MAX_VALUE] - range[_stagesGraph.MIN_VALUE];
|
|
19
21
|
};
|
|
20
22
|
|
|
21
23
|
exports.getSubStageRangeWidth = getSubStageRangeWidth;
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
range
|
|
26
|
-
} = stage;
|
|
25
|
+
var getStageRangeWidth = function getStageRangeWidth(stage) {
|
|
26
|
+
var range = stage.range;
|
|
27
27
|
|
|
28
28
|
if (range[_stagesGraph.MAX_VALUE] === _stagesGraph.INFINITE || !range[_stagesGraph.MAX_VALUE]) {
|
|
29
|
-
return stage.sub_rate_stages.reduce((totalWidth, subStage)
|
|
29
|
+
return stage.sub_rate_stages.reduce(function (totalWidth, subStage) {
|
|
30
|
+
return totalWidth + getSubStageRangeWidth(subStage);
|
|
31
|
+
}, 0);
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
return range[_stagesGraph.MAX_VALUE] - range[_stagesGraph.MIN_VALUE];
|
|
@@ -34,6 +36,8 @@ const getStageRangeWidth = stage => {
|
|
|
34
36
|
|
|
35
37
|
exports.getStageRangeWidth = getStageRangeWidth;
|
|
36
38
|
|
|
37
|
-
|
|
39
|
+
var getSubStageWidth = function getSubStageWidth(stage, subStage) {
|
|
40
|
+
return getSubStageRangeWidth(subStage) / getStageRangeWidth(stage) * 100;
|
|
41
|
+
};
|
|
38
42
|
|
|
39
43
|
exports.getSubStageWidth = getSubStageWidth;
|
package/dist/utils/hooks.js
CHANGED
|
@@ -5,42 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.useScreenSize = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
var _browser = require("@widergy/web-utils/lib/browser");
|
|
11
|
-
|
|
12
|
-
var _function = require("@widergy/web-utils/lib/function");
|
|
13
|
-
|
|
14
|
-
const useScreenSize = function () {
|
|
15
|
-
let sizes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
16
|
-
const mobileBP = sizes.mobileBreakpoint || 767;
|
|
17
|
-
const tabletBP = sizes.tabletBreakpoint || 1023;
|
|
18
|
-
const [screenWidth, setScreenWidth] = (0, _react.useState)(_browser.retrieveWidth);
|
|
19
|
-
const [isMobileSize, setIsMobileSize] = (0, _react.useState)((0, _browser.isMobile)(mobileBP));
|
|
20
|
-
const [isTabletSize, setIsTabletSize] = (0, _react.useState)((0, _browser.isTablet)(mobileBP, tabletBP));
|
|
21
|
-
const [isDesktopSize, setIsDesktopSize] = (0, _react.useState)((0, _browser.isDesktop)(tabletBP));
|
|
22
|
-
const [isMobileOrTablet, setIsMobileOrTablet] = (0, _react.useState)((0, _browser.isMobile)(mobileBP) || (0, _browser.isTablet)(mobileBP, tabletBP));
|
|
23
|
-
const [isTabletOrDesktop, setIsTabletOrDesktop] = (0, _react.useState)((0, _browser.isTablet)(mobileBP, tabletBP) || (0, _browser.isDesktop)(tabletBP));
|
|
24
|
-
const handleUpdateScreen = (0, _react.useCallback)(() => {
|
|
25
|
-
setScreenWidth(_browser.retrieveWidth);
|
|
26
|
-
setIsMobileSize((0, _browser.isMobile)(mobileBP));
|
|
27
|
-
setIsTabletSize((0, _browser.isTablet)(mobileBP, tabletBP));
|
|
28
|
-
setIsDesktopSize((0, _browser.isDesktop)(tabletBP));
|
|
29
|
-
setIsMobileOrTablet((0, _browser.isMobile)(mobileBP) || (0, _browser.isTablet)(mobileBP, tabletBP));
|
|
30
|
-
setIsTabletOrDesktop((0, _browser.isTablet)(mobileBP, tabletBP) || (0, _browser.isDesktop)(tabletBP));
|
|
31
|
-
}, [mobileBP, tabletBP]);
|
|
32
|
-
(0, _react.useEffect)(() => {
|
|
33
|
-
window.addEventListener(_browser.RESIZE_EVENT, (0, _function.debounce)(handleUpdateScreen));
|
|
34
|
-
return () => window.removeEventListener(_browser.RESIZE_EVENT, (0, _function.debounce)(handleUpdateScreen));
|
|
35
|
-
}, [handleUpdateScreen]);
|
|
36
|
-
return {
|
|
37
|
-
isMobileSize,
|
|
38
|
-
isTabletSize,
|
|
39
|
-
isDesktopSize,
|
|
40
|
-
isMobileOrTablet,
|
|
41
|
-
isTabletOrDesktop,
|
|
42
|
-
screenWidth
|
|
43
|
-
};
|
|
44
|
-
};
|
|
8
|
+
var _energyHooks = require("@widergy/energy-hooks");
|
|
45
9
|
|
|
10
|
+
var useScreenSize = (0, _energyHooks.createUseScreenSize)({
|
|
11
|
+
mobileBP: 767,
|
|
12
|
+
tabletBP: 1024
|
|
13
|
+
});
|
|
46
14
|
exports.useScreenSize = useScreenSize;
|
package/dist/utils.js
CHANGED
|
@@ -9,17 +9,21 @@ var _numeral = _interopRequireDefault(require("config/numeral"));
|
|
|
9
9
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
var stringOrDash = function stringOrDash(str) {
|
|
13
|
+
return str || '-';
|
|
14
|
+
};
|
|
13
15
|
|
|
14
16
|
exports.stringOrDash = stringOrDash;
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
var numberOrDash = function numberOrDash(number) {
|
|
19
|
+
var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '0,0';
|
|
18
20
|
return number !== undefined && number !== null ? (0, _numeral.default)(number).format(format) : '-';
|
|
19
21
|
};
|
|
20
22
|
|
|
21
23
|
exports.numberOrDash = numberOrDash;
|
|
22
24
|
|
|
23
|
-
|
|
25
|
+
var formatNumber = function formatNumber(value) {
|
|
26
|
+
return (0, _numeral.default)(value).format('0.[00]');
|
|
27
|
+
};
|
|
24
28
|
|
|
25
29
|
exports.formatNumber = formatNumber;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@widergy/utilitygo-smart-bill-web",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.0",
|
|
4
4
|
"description": "UtilityGO SmartBill Web",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"not op_mini all"
|
|
52
52
|
],
|
|
53
53
|
"dependencies": {
|
|
54
|
+
"@widergy/energy-hooks": "^1.0.0",
|
|
54
55
|
"@widergy/web-utils": ">=0.4.1",
|
|
55
56
|
"dayjs": "^1.10.7",
|
|
56
57
|
"lodash": ">=4.17.4",
|
|
@@ -59,7 +60,6 @@
|
|
|
59
60
|
"react-jss": "^8.6.1",
|
|
60
61
|
"react-perfect-scrollbar": "^1.5.3",
|
|
61
62
|
"react-responsive": "^4.1.0",
|
|
62
|
-
"recharts": "github:widergy/recharts#master",
|
|
63
63
|
"sass-loader": "^7.1.0",
|
|
64
64
|
"seamless-immutable": "^7.1.4",
|
|
65
65
|
"yarn": "^1.22.10"
|
package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/utils.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.renderCustomizedLabel = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
var _constants = require("./constants");
|
|
11
|
-
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
|
-
const renderCustomizedLabel = (cx, cy, midAngle, innerRadius, outerRadius, percent) => {
|
|
15
|
-
const radius = innerRadius + (outerRadius - innerRadius) * 0.5;
|
|
16
|
-
const x = cx + radius * Math.cos(-midAngle * _constants.RADIAN);
|
|
17
|
-
const y = cy + radius * Math.sin(-midAngle * _constants.RADIAN);
|
|
18
|
-
return /*#__PURE__*/_react.default.createElement("text", {
|
|
19
|
-
x: x,
|
|
20
|
-
y: y,
|
|
21
|
-
fill: "white",
|
|
22
|
-
textAnchor: x > cx ? 'start' : 'end',
|
|
23
|
-
dominantBaseline: "central"
|
|
24
|
-
}, "".concat((percent * 100).toFixed(0), "%"));
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
exports.renderCustomizedLabel = renderCustomizedLabel;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
11
|
-
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
|
-
const LimitsLine = () => /*#__PURE__*/_react.default.createElement("div", {
|
|
15
|
-
className: _stylesModule.default.lateralLines
|
|
16
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
17
|
-
className: _stylesModule.default.middleLine
|
|
18
|
-
}));
|
|
19
|
-
|
|
20
|
-
var _default = LimitsLine;
|
|
21
|
-
exports.default = _default;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
@import '../../../../../../../../../../../../scss/variables/_colorsExport.scss';
|
|
2
|
-
|
|
3
|
-
$lines-color: $black;
|
|
4
|
-
|
|
5
|
-
.lateralLines {
|
|
6
|
-
border-left: 1px solid $lines-color;
|
|
7
|
-
border-right: 1px solid $lines-color;
|
|
8
|
-
min-height: 8px;
|
|
9
|
-
width: 100%;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.middleLine {
|
|
13
|
-
border-bottom: 1px solid $lines-color;
|
|
14
|
-
height: 50%;
|
|
15
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
var _propTypes = require("prop-types");
|
|
11
|
-
|
|
12
|
-
var _smartBillTypes = require("../../../../../../../../../../../../shared/types/smartBillTypes");
|
|
13
|
-
|
|
14
|
-
var _rateStagesTypes = require("../../../../../../../../../../../../shared/types/rateStagesTypes");
|
|
15
|
-
|
|
16
|
-
var _WithContextApi = _interopRequireDefault(require("../../../../../../../../../../../WithContextApi"));
|
|
17
|
-
|
|
18
|
-
var _constants = require("../../../../../../constants");
|
|
19
|
-
|
|
20
|
-
var _aliases = require("../../../../../../../../../../../../shared/constants/aliases");
|
|
21
|
-
|
|
22
|
-
var _utils = require("./utils");
|
|
23
|
-
|
|
24
|
-
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
25
|
-
|
|
26
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
|
-
|
|
28
|
-
const SubStage = _ref => {
|
|
29
|
-
let {
|
|
30
|
-
contextApiInfo,
|
|
31
|
-
stage,
|
|
32
|
-
subStage,
|
|
33
|
-
isLast,
|
|
34
|
-
isDesktop,
|
|
35
|
-
index,
|
|
36
|
-
totalSubStages
|
|
37
|
-
} = _ref;
|
|
38
|
-
const {
|
|
39
|
-
Label
|
|
40
|
-
} = contextApiInfo;
|
|
41
|
-
const {
|
|
42
|
-
getStageColor
|
|
43
|
-
} = contextApiInfo.config;
|
|
44
|
-
const width = isDesktop ? "calc(".concat((0, _utils.getSubStageWidth)(stage, subStage), "%)") : "calc(100% / ".concat(stage.sub_rate_stages.length || 1, ")");
|
|
45
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
46
|
-
style: {
|
|
47
|
-
marginRight: isLast ? _constants.LAST_SUB_STAGE_MARGIN : isDesktop ? _constants.SUB_STAGE_MARGIN_DESKTOP : _constants.SUB_STAGE_MARGIN_MOBILE,
|
|
48
|
-
backgroundColor: getStageColor ? getStageColor(index, totalSubStages) : subStage.color,
|
|
49
|
-
width
|
|
50
|
-
},
|
|
51
|
-
className: _stylesModule.default.container
|
|
52
|
-
}, /*#__PURE__*/_react.default.createElement(Label, {
|
|
53
|
-
alias: _aliases.SUBSTAGE
|
|
54
|
-
}, subStage.name));
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
SubStage.propTypes = {
|
|
58
|
-
contextApiInfo: _smartBillTypes.contextApiInfoTypes,
|
|
59
|
-
stage: _rateStagesTypes.stageType,
|
|
60
|
-
totalSubStages: _propTypes.number,
|
|
61
|
-
index: _propTypes.number,
|
|
62
|
-
subStage: _rateStagesTypes.subStageType,
|
|
63
|
-
isLast: _propTypes.bool,
|
|
64
|
-
isDesktop: _propTypes.bool
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
var _default = (0, _WithContextApi.default)()(SubStage);
|
|
68
|
-
|
|
69
|
-
exports.default = _default;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getSubStageWidth = void 0;
|
|
7
|
-
|
|
8
|
-
var _utils = require("../../../../../../utils");
|
|
9
|
-
|
|
10
|
-
const getSubStageWidth = (stage, subStage) => (0, _utils.getSubStageRangeWidth)(subStage) / (0, _utils.getStageRangeWidth)(stage) * 100;
|
|
11
|
-
|
|
12
|
-
exports.getSubStageWidth = getSubStageWidth;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
var _propTypes = require("prop-types");
|
|
11
|
-
|
|
12
|
-
var _rateStagesTypes = require("../../../../../../../../../../shared/types/rateStagesTypes");
|
|
13
|
-
|
|
14
|
-
var _constants = require("../../../../constants");
|
|
15
|
-
|
|
16
|
-
var _LegendItem = _interopRequireDefault(require("../../../LegendItem"));
|
|
17
|
-
|
|
18
|
-
var _LimitsLine = _interopRequireDefault(require("./components/LimitsLine"));
|
|
19
|
-
|
|
20
|
-
var _SubStage = _interopRequireDefault(require("./components/SubStage"));
|
|
21
|
-
|
|
22
|
-
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
23
|
-
|
|
24
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
-
|
|
26
|
-
const Stage = _ref => {
|
|
27
|
-
let {
|
|
28
|
-
stage,
|
|
29
|
-
isLast,
|
|
30
|
-
totalStages,
|
|
31
|
-
totalSubStages,
|
|
32
|
-
legendNumber,
|
|
33
|
-
isDesktop
|
|
34
|
-
} = _ref;
|
|
35
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
36
|
-
style: {
|
|
37
|
-
marginRight: isLast ? _constants.LAST_STAGE_MARGIN : isDesktop ? _constants.STAGE_MARGIN_DESKTOP : _constants.STAGE_MARGIN_MOBILE,
|
|
38
|
-
width: "calc(".concat(100 / totalStages, "%)")
|
|
39
|
-
},
|
|
40
|
-
className: _stylesModule.default.container
|
|
41
|
-
}, totalStages !== 1 && /*#__PURE__*/_react.default.createElement(_LegendItem.default, {
|
|
42
|
-
stage: isDesktop && stage,
|
|
43
|
-
stagesLength: totalStages,
|
|
44
|
-
legendNumber: legendNumber,
|
|
45
|
-
showNumber: !isDesktop
|
|
46
|
-
}), /*#__PURE__*/_react.default.createElement(_LimitsLine.default, null), /*#__PURE__*/_react.default.createElement("div", {
|
|
47
|
-
className: _stylesModule.default.bars
|
|
48
|
-
}, stage.sub_rate_stages.map((subStage, index) => /*#__PURE__*/_react.default.createElement(_SubStage.default, {
|
|
49
|
-
key: subStage.category,
|
|
50
|
-
index: subStage.category,
|
|
51
|
-
stage: stage,
|
|
52
|
-
totalSubStages: totalSubStages,
|
|
53
|
-
subStage: subStage,
|
|
54
|
-
isLast: index === stage.sub_rate_stages.length - 1,
|
|
55
|
-
isDesktop: isDesktop
|
|
56
|
-
}))));
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
Stage.propTypes = {
|
|
60
|
-
stage: _rateStagesTypes.stageType,
|
|
61
|
-
legendNumber: _propTypes.number,
|
|
62
|
-
isLast: _propTypes.bool,
|
|
63
|
-
totalStages: _propTypes.number,
|
|
64
|
-
totalSubStages: _propTypes.number,
|
|
65
|
-
isDesktop: _propTypes.bool
|
|
66
|
-
};
|
|
67
|
-
var _default = Stage;
|
|
68
|
-
exports.default = _default;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
@import '../../../../../../../../../../scss/variables/_mediaQueries';
|
|
2
|
-
@import '../../../../../../../../../../scss/variables/_colors';
|
|
3
|
-
|
|
4
|
-
$icon-size: 21px;
|
|
5
|
-
|
|
6
|
-
.container {
|
|
7
|
-
align-items: center;
|
|
8
|
-
display: flex;
|
|
9
|
-
flex-flow: column;
|
|
10
|
-
width: 100%;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.header {
|
|
14
|
-
display: flex;
|
|
15
|
-
white-space: nowrap;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.bars {
|
|
19
|
-
display: flex;
|
|
20
|
-
margin: 24px 0;
|
|
21
|
-
min-height: 33px;
|
|
22
|
-
width: 100%;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.icon {
|
|
26
|
-
height: $icon-size;
|
|
27
|
-
width: $icon-size;
|
|
28
|
-
|
|
29
|
-
> g {
|
|
30
|
-
fill: $black;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
var _propTypes = require("prop-types");
|
|
11
|
-
|
|
12
|
-
var _rateStagesTypes = require("../../../../../../../../shared/types/rateStagesTypes");
|
|
13
|
-
|
|
14
|
-
var _constants = require("../../constants");
|
|
15
|
-
|
|
16
|
-
var _Stage = _interopRequireDefault(require("./components/Stage"));
|
|
17
|
-
|
|
18
|
-
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
19
|
-
|
|
20
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
|
|
22
|
-
const Bars = _ref => {
|
|
23
|
-
let {
|
|
24
|
-
rateStages,
|
|
25
|
-
isDesktop
|
|
26
|
-
} = _ref;
|
|
27
|
-
const barsMargin = isDesktop ? _constants.BARS_MARGIN_DESKTOP : _constants.BARS_MARGIN_MOBILE;
|
|
28
|
-
|
|
29
|
-
const accumSubStages = (count, currStage) => {
|
|
30
|
-
var _currStage$sub_rate_s;
|
|
31
|
-
|
|
32
|
-
return count + ((_currStage$sub_rate_s = currStage.sub_rate_stages) === null || _currStage$sub_rate_s === void 0 ? void 0 : _currStage$sub_rate_s.length) || 1;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
const totalSubStages = rateStages.reduce(accumSubStages, 0);
|
|
36
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
37
|
-
style: {
|
|
38
|
-
margin: "0 ".concat(barsMargin),
|
|
39
|
-
width: "calc(100% - 2 * ".concat(barsMargin, ")")
|
|
40
|
-
},
|
|
41
|
-
className: _stylesModule.default.container
|
|
42
|
-
}, rateStages.map((stage, index) => /*#__PURE__*/_react.default.createElement(_Stage.default, {
|
|
43
|
-
key: stage.group,
|
|
44
|
-
stage: stage,
|
|
45
|
-
isFirst: index === 0,
|
|
46
|
-
legendNumber: index + 1,
|
|
47
|
-
isLast: index === rateStages.length - 1,
|
|
48
|
-
totalStages: rateStages.length,
|
|
49
|
-
totalSubStages: totalSubStages,
|
|
50
|
-
isDesktop: isDesktop
|
|
51
|
-
})));
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
Bars.propTypes = {
|
|
55
|
-
rateStages: _rateStagesTypes.rateStagesTypes,
|
|
56
|
-
isDesktop: _propTypes.bool
|
|
57
|
-
};
|
|
58
|
-
var _default = Bars;
|
|
59
|
-
exports.default = _default;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
var _propTypes = require("prop-types");
|
|
11
|
-
|
|
12
|
-
var _WithContextApi = _interopRequireDefault(require("../../../../../../../WithContextApi"));
|
|
13
|
-
|
|
14
|
-
var _smartBillTypes = require("../../../../../../../../shared/types/smartBillTypes");
|
|
15
|
-
|
|
16
|
-
var _Magnitude = _interopRequireDefault(require("../../../../../../../Magnitude"));
|
|
17
|
-
|
|
18
|
-
var _aliases = require("../../../../../../../../shared/constants/aliases");
|
|
19
|
-
|
|
20
|
-
var _rateStagesTypes = require("../../../../../../../../shared/types/rateStagesTypes");
|
|
21
|
-
|
|
22
|
-
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
23
|
-
|
|
24
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
-
|
|
26
|
-
const LegendItem = _ref => {
|
|
27
|
-
let {
|
|
28
|
-
contextApiInfo,
|
|
29
|
-
legendNumber,
|
|
30
|
-
stage,
|
|
31
|
-
showNumber,
|
|
32
|
-
stagesLength
|
|
33
|
-
} = _ref;
|
|
34
|
-
const {
|
|
35
|
-
Label,
|
|
36
|
-
config,
|
|
37
|
-
assets
|
|
38
|
-
} = contextApiInfo;
|
|
39
|
-
const {
|
|
40
|
-
texts
|
|
41
|
-
} = config;
|
|
42
|
-
const {
|
|
43
|
-
consumptionUpToDesktop,
|
|
44
|
-
consumptionMoreThanDesktop,
|
|
45
|
-
consumptionStartingFormDesktop
|
|
46
|
-
} = texts.ratesDefinition;
|
|
47
|
-
|
|
48
|
-
const format = text => text.toUpperCase();
|
|
49
|
-
|
|
50
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
51
|
-
className: stage ? _stylesModule.default.legendItemContainer : _stylesModule.default.numberItemContainer
|
|
52
|
-
}, showNumber && /*#__PURE__*/_react.default.createElement("div", {
|
|
53
|
-
className: _stylesModule.default.stageNumber
|
|
54
|
-
}, /*#__PURE__*/_react.default.createElement(Label, null, legendNumber)), stage && /*#__PURE__*/_react.default.createElement("div", {
|
|
55
|
-
className: showNumber ? _stylesModule.default.stageDataContainer : _stylesModule.default.noNumberStageDataContainer
|
|
56
|
-
}, /*#__PURE__*/_react.default.createElement(Label, {
|
|
57
|
-
alias: _aliases.STAGE_DETAIL,
|
|
58
|
-
className: _stylesModule.default.header
|
|
59
|
-
}, format(legendNumber === 1 ? consumptionUpToDesktop : legendNumber === stagesLength ? consumptionMoreThanDesktop : consumptionStartingFormDesktop)), /*#__PURE__*/_react.default.createElement(_Magnitude.default, {
|
|
60
|
-
numberAlias: _aliases.RATE_STAGE_MAGNITUDE,
|
|
61
|
-
unitAlias: _aliases.RATE_STAGE_MAGNITUDE,
|
|
62
|
-
value: legendNumber === 1 ? stage.range.at(-1) : stage.range.at(0),
|
|
63
|
-
unit: stage.unit,
|
|
64
|
-
Icon: () => /*#__PURE__*/_react.default.createElement(assets.EnergyIcon, {
|
|
65
|
-
className: _stylesModule.default.rateStagesEnergyIcon
|
|
66
|
-
}),
|
|
67
|
-
classes: {
|
|
68
|
-
container: _stylesModule.default.magnitudeContainer
|
|
69
|
-
}
|
|
70
|
-
})));
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
LegendItem.propTypes = {
|
|
74
|
-
stage: _rateStagesTypes.stageType,
|
|
75
|
-
showNumber: true,
|
|
76
|
-
stagesLength: _propTypes.number,
|
|
77
|
-
contextApiInfo: _smartBillTypes.contextApiInfoTypes,
|
|
78
|
-
legendNumber: _propTypes.number
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
var _default = (0, _WithContextApi.default)()(LegendItem);
|
|
82
|
-
|
|
83
|
-
exports.default = _default;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
@import '../../../../../../../../scss/variables/_colors';
|
|
2
|
-
|
|
3
|
-
$bubble-number-size: 24px;
|
|
4
|
-
|
|
5
|
-
.legendItemContainer {
|
|
6
|
-
align-items: center;
|
|
7
|
-
display: flex;
|
|
8
|
-
gap: 8px;
|
|
9
|
-
justify-content: space-between;
|
|
10
|
-
width: 100%;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.numberItemContainer {
|
|
14
|
-
display: flex;
|
|
15
|
-
justify-content: center;
|
|
16
|
-
padding-bottom: 8px;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.stageDataContainer {
|
|
20
|
-
align-items: center;
|
|
21
|
-
display: flex;
|
|
22
|
-
gap: 16px;
|
|
23
|
-
justify-content: space-between;
|
|
24
|
-
width: 100%;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.noNumberStageDataContainer {
|
|
28
|
-
align-items: center;
|
|
29
|
-
display: flex;
|
|
30
|
-
flex-direction: column;
|
|
31
|
-
gap: 24px;
|
|
32
|
-
padding-bottom: 16px;
|
|
33
|
-
width: 100%;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.magnitudeContainer {
|
|
37
|
-
gap: 8px;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.stageNumber {
|
|
41
|
-
align-items: center;
|
|
42
|
-
background-color: $black;
|
|
43
|
-
border-radius: 500px;
|
|
44
|
-
display: flex;
|
|
45
|
-
justify-content: center;
|
|
46
|
-
min-width: $bubble-number-size;
|
|
47
|
-
height: $bubble-number-size;
|
|
48
|
-
width: $bubble-number-size;
|
|
49
|
-
|
|
50
|
-
* {
|
|
51
|
-
color: $white;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.rateStagesEnergyIcon {
|
|
56
|
-
height: 18px;
|
|
57
|
-
}
|