@widergy/utilitygo-smart-bill-web 2.2.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/components/Advice/index.js +11 -8
- package/dist/components/Amount/index.js +27 -23
- package/dist/components/Amount/utils.js +1 -5
- package/dist/components/Banner/index.js +11 -8
- package/dist/components/BarChart/constants.js +3 -6
- package/dist/components/BarChart/index.js +29 -24
- package/dist/components/BarChart/utils.js +15 -15
- package/dist/components/BillCalculation/components/ConceptCard/index.js +53 -47
- package/dist/components/BillCalculation/components/Glossary/index.js +49 -66
- package/dist/components/BillCalculation/components/Glossary/styles.module.scss +1 -0
- package/dist/components/BillCalculation/constants.js +1 -2
- package/dist/components/BillCalculation/index.js +49 -53
- package/dist/components/BillCalculation/utils.js +19 -22
- package/dist/components/BillSummary/components/BilledConcepts/components/Concept/index.js +26 -24
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/constants.js +2 -3
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/index.js +16 -17
- package/dist/components/BillSummary/components/BilledConcepts/components/PieChartContainer/styles.module.scss +3 -3
- package/dist/components/BillSummary/components/BilledConcepts/constants.js +12 -17
- package/dist/components/BillSummary/components/BilledConcepts/index.js +30 -41
- package/dist/components/BillSummary/components/BilledConcepts/utils.js +44 -68
- package/dist/components/BillSummary/index.js +71 -71
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/DataLine/index.js +9 -10
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/index.js +18 -12
- package/dist/components/ConsumptionComparison/components/ComparisonTable/components/Season/utils.js +1 -1
- package/dist/components/ConsumptionComparison/components/ComparisonTable/constants.js +144 -143
- package/dist/components/ConsumptionComparison/components/ComparisonTable/index.js +17 -16
- package/dist/components/ConsumptionComparison/components/ComparisonTable/utils.js +84 -88
- package/dist/components/ConsumptionComparison/components/ConsumptionAdvice/index.js +22 -13
- package/dist/components/ConsumptionComparison/components/ConsumptionAdvice/utils.js +1 -1
- package/dist/components/ConsumptionComparison/components/PercentageComparison/index.js +22 -16
- package/dist/components/ConsumptionComparison/components/PercentageComparison/utils.js +13 -9
- package/dist/components/ConsumptionComparison/index.js +42 -47
- package/dist/components/ConsumptionEnergyDetails/components/ConsumptionEnergyComparison/index.js +28 -24
- package/dist/components/ConsumptionEnergyDetails/components/ConsumptionEnergyComparison/styles.module.scss +1 -1
- package/dist/components/ConsumptionEnergyDetails/components/ConsumptionInDaysLabel/index.js +19 -15
- package/dist/components/ConsumptionEnergyDetails/components/EnergyTotalConsumption/index.js +16 -14
- package/dist/components/ConsumptionEnergyDetails/components/PercentageComparison/index.js +22 -17
- package/dist/components/ConsumptionEnergyDetails/components/PercentageComparison/utils.js +1 -1
- package/dist/components/ConsumptionEnergyDetails/index.js +47 -43
- package/dist/components/ConsumptionEnergyDetails/styles.module.scss +2 -2
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/index.js +65 -62
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/Card/utils.js +11 -13
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderConsumption/index.js +21 -19
- package/dist/components/ConsumptionIncluded/components/TimelineRow/components/HeaderSettlement/index.js +17 -12
- package/dist/components/ConsumptionIncluded/components/TimelineRow/index.js +43 -39
- package/dist/components/ConsumptionIncluded/components/TimelineRow/styles.module.scss +2 -2
- package/dist/components/ConsumptionIncluded/index.js +32 -34
- package/dist/components/ConsumptionIncluded/utils.js +29 -33
- package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/components/ReadingRow/index.js +15 -12
- package/dist/components/ConsumptionPeriod/components/ConsumptionSummary/index.js +24 -22
- package/dist/components/ConsumptionPeriod/components/HistoryGraph/index.js +19 -28
- package/dist/components/ConsumptionPeriod/components/Reading/index.js +36 -34
- package/dist/components/ConsumptionPeriod/index.js +13 -10
- package/dist/components/ConsumptionPeriod/utils.js +13 -15
- package/dist/components/Date/index.js +13 -11
- package/dist/components/DebtState/index.js +15 -10
- package/dist/components/IconAndDetails/index.js +20 -19
- package/dist/components/Magnitude/index.js +16 -14
- package/dist/components/Magnitude/utils.js +2 -8
- package/dist/components/MainBillData/components/BillAlert/components/BillParticularConditions/index.js +19 -16
- package/dist/components/MainBillData/components/BillAlert/index.js +25 -33
- package/dist/components/MainBillData/components/BillBody/components/ClientData/index.js +20 -13
- package/dist/components/MainBillData/components/BillBody/components/Consumption/index.js +15 -13
- package/dist/components/MainBillData/components/BillBody/components/Consumption/utils.js +1 -3
- package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/index.js +24 -17
- package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/styles.module.scss +2 -2
- package/dist/components/MainBillData/components/BillBody/components/ReadingDetails/utils.js +1 -1
- package/dist/components/MainBillData/components/BillBody/index.js +43 -46
- package/dist/components/MainBillData/components/BillHeader/components/TypeAndNumber/index.js +17 -13
- package/dist/components/MainBillData/components/BillHeader/index.js +30 -26
- package/dist/components/MainBillData/components/BillHeader/styles.module.scss +1 -1
- package/dist/components/MainBillData/index.js +8 -7
- package/dist/components/MainBillData/theme.js +7 -9
- package/dist/components/MainBillData/utils.js +1 -5
- package/dist/components/Period/index.js +55 -45
- package/dist/components/PowerProgresBar/components/PowerConsumption/index.js +16 -13
- package/dist/components/PowerProgresBar/index.js +32 -32
- package/dist/components/RateAndCategory/index.js +26 -29
- package/dist/components/RatesDefinition/components/BillRate/components/RatePrices/index.js +21 -15
- package/dist/components/RatesDefinition/components/BillRate/index.js +25 -16
- package/dist/components/RatesDefinition/components/BillRate/styles.module.scss +1 -1
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/Category/index.js +15 -11
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/components/IndicatorLabel/index.js +27 -23
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/index.js +12 -9
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/styles.module.scss +1 -1
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Indicator/utils.js +9 -9
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Legend/index.js +22 -21
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Stages/index.js +35 -38
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/components/Stages/styles.module.scss +0 -1
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/constants.js +2 -4
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/index.js +18 -32
- package/dist/components/RatesDefinition/components/CategoryByConsumption/components/RateStagesGraph/utils.js +35 -47
- package/dist/components/RatesDefinition/components/CategoryByConsumption/constants.js +18 -36
- package/dist/components/RatesDefinition/components/CategoryByConsumption/index.js +24 -33
- package/dist/components/RatesDefinition/components/CategoryByConsumption/utils.js +1 -5
- package/dist/components/RatesDefinition/components/PurchasedRate/index.js +20 -15
- package/dist/components/RatesDefinition/index.js +21 -17
- package/dist/components/RatesDefinition/styles.module.scss +1 -1
- package/dist/components/SmartBillProvider/index.js +13 -36
- package/dist/components/StyledAmount/constants.js +2 -3
- package/dist/components/StyledAmount/index.js +20 -29
- package/dist/components/WithContextApi/index.js +19 -27
- package/dist/components/WithContextApi/layout.js +3 -4
- package/dist/components/WithSeason/index.js +7 -11
- package/dist/constants/deviceSizes.js +27 -24
- package/dist/constants/seasons.js +3 -5
- package/dist/index.js +19 -19
- package/dist/scss/variables/commonColors.module.scss +1 -1
- package/dist/shared/Context/index.js +5 -3
- package/dist/shared/constants/aliases.js +691 -694
- package/dist/shared/constants/consumptions.js +5 -9
- package/dist/shared/constants/periodicities.js +2 -3
- package/dist/shared/constants/rates.js +2 -3
- package/dist/shared/constants/readings.js +3 -5
- package/dist/shared/constants/seasons.js +3 -5
- package/dist/shared/constants/stagesGraph.js +4 -8
- package/dist/shared/types/assetsTypes.js +1 -2
- package/dist/shared/types/billDataTypes.js +6 -11
- package/dist/shared/types/componentsTypes.js +19 -14
- package/dist/shared/types/formattersTypes.js +2 -3
- package/dist/shared/types/rateStagesTypes.js +3 -6
- package/dist/shared/types/smartBillTypes.js +5 -11
- package/dist/shared/types/textsTypes.js +2 -3
- package/dist/shared/utils/billCalculation.js +9 -9
- package/dist/shared/utils/consumptions.js +27 -55
- package/dist/shared/utils/context.js +6 -5
- package/dist/shared/utils/expirations.js +1 -5
- package/dist/shared/utils/periods.js +14 -20
- package/dist/shared/utils/rates.js +1 -5
- package/dist/shared/utils/readings.js +2 -10
- package/dist/shared/utils/season.js +1 -5
- package/dist/shared/utils/stagesGraph.js +11 -15
- package/dist/utils/hooks.js +2 -3
- package/dist/utils.js +4 -8
- package/package.json +26 -63
|
@@ -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
|
});
|
|
@@ -16,39 +15,32 @@ var _RateStagesGraph = _interopRequireDefault(require("./components/RateStagesGr
|
|
|
16
15
|
var _Category = _interopRequireDefault(require("./components/Category"));
|
|
17
16
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
18
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
function _getRequireWildcardCache(
|
|
20
|
-
function _interopRequireWildcard(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
setIsDesktopSize = _useState2[1];
|
|
41
|
-
var handleResizeScreen = function handleResizeScreen() {
|
|
42
|
-
return setIsDesktopSize((0, _browser.isDesktop)(_deviceSizes.TabletBreakpoint));
|
|
43
|
-
};
|
|
44
|
-
(0, _react.useEffect)(function () {
|
|
18
|
+
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); }
|
|
19
|
+
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; }
|
|
20
|
+
const CategoryByConsumption = _ref => {
|
|
21
|
+
let {
|
|
22
|
+
contextApiInfo,
|
|
23
|
+
value,
|
|
24
|
+
unit,
|
|
25
|
+
category
|
|
26
|
+
} = _ref;
|
|
27
|
+
const {
|
|
28
|
+
config,
|
|
29
|
+
Label
|
|
30
|
+
} = contextApiInfo;
|
|
31
|
+
const {
|
|
32
|
+
rateStages,
|
|
33
|
+
texts,
|
|
34
|
+
getStageColor
|
|
35
|
+
} = config;
|
|
36
|
+
const [isDesktopSize, setIsDesktopSize] = (0, _react.useState)((0, _browser.isDesktop)(_deviceSizes.TabletBreakpoint));
|
|
37
|
+
const handleResizeScreen = () => setIsDesktopSize((0, _browser.isDesktop)(_deviceSizes.TabletBreakpoint));
|
|
38
|
+
(0, _react.useEffect)(() => {
|
|
45
39
|
window.addEventListener(_browser.RESIZE_EVENT, handleResizeScreen);
|
|
46
40
|
handleResizeScreen();
|
|
47
|
-
return
|
|
48
|
-
return window.removeEventListener(_browser.RESIZE_EVENT, handleResizeScreen);
|
|
49
|
-
};
|
|
41
|
+
return () => window.removeEventListener(_browser.RESIZE_EVENT, handleResizeScreen);
|
|
50
42
|
}, []);
|
|
51
|
-
|
|
43
|
+
const valueCorrected = value < 0 ? 0 : value && Math.round(value);
|
|
52
44
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
53
45
|
className: _stylesModule.default.container
|
|
54
46
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -75,5 +67,4 @@ CategoryByConsumption.propTypes = {
|
|
|
75
67
|
unit: _propTypes.string,
|
|
76
68
|
category: _propTypes.string
|
|
77
69
|
};
|
|
78
|
-
var _default = (0, _WithContextApi.default)()(CategoryByConsumption);
|
|
79
|
-
exports.default = _default;
|
|
70
|
+
var _default = exports.default = (0, _WithContextApi.default)()(CategoryByConsumption);
|
|
@@ -5,9 +5,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getCurrentStage = void 0;
|
|
7
7
|
var _constants = require("./constants");
|
|
8
|
-
|
|
9
|
-
return rateStages.find(function (stage) {
|
|
10
|
-
return stage.range[_constants.MIN_VALUE] <= value && (value <= stage.range[_constants.MAX_VALUE] || stage.range[_constants.MAX_VALUE] === _constants.INFINITE);
|
|
11
|
-
});
|
|
12
|
-
};
|
|
8
|
+
const getCurrentStage = (value, rateStages) => rateStages.find(stage => stage.range[_constants.MIN_VALUE] <= value && (value <= stage.range[_constants.MAX_VALUE] || stage.range[_constants.MAX_VALUE] === _constants.INFINITE));
|
|
13
9
|
exports.getCurrentStage = getCurrentStage;
|
|
@@ -12,19 +12,25 @@ var _aliases = require("../../../../shared/constants/aliases");
|
|
|
12
12
|
var _RateAndCategory = _interopRequireDefault(require("../../../RateAndCategory"));
|
|
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
|
-
classes =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
const PurchasedRate = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
contextApiInfo,
|
|
18
|
+
rate,
|
|
19
|
+
category,
|
|
20
|
+
classes = {}
|
|
21
|
+
} = _ref;
|
|
22
|
+
const {
|
|
23
|
+
config,
|
|
24
|
+
ExternalLink,
|
|
25
|
+
Label
|
|
26
|
+
} = contextApiInfo;
|
|
27
|
+
const {
|
|
28
|
+
purchasedRateErrorLink
|
|
29
|
+
} = config.externalLinks;
|
|
30
|
+
const {
|
|
31
|
+
purchasedRateTitle,
|
|
32
|
+
purchasedRateError
|
|
33
|
+
} = config.texts.ratesDefinition;
|
|
28
34
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
29
35
|
className: "".concat(_stylesModule.default.container, " ").concat(classes.container)
|
|
30
36
|
}, /*#__PURE__*/_react.default.createElement(Label, {
|
|
@@ -52,5 +58,4 @@ PurchasedRate.propTypes = {
|
|
|
52
58
|
container: _propTypes.string
|
|
53
59
|
})
|
|
54
60
|
};
|
|
55
|
-
var _default = (0, _WithContextApi.default)()(PurchasedRate);
|
|
56
|
-
exports.default = _default;
|
|
61
|
+
var _default = exports.default = (0, _WithContextApi.default)()(PurchasedRate);
|
|
@@ -21,21 +21,26 @@ var _PurchasedRate = _interopRequireDefault(require("./components/PurchasedRate"
|
|
|
21
21
|
var _BillRate = _interopRequireDefault(require("./components/BillRate"));
|
|
22
22
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
23
23
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
24
|
+
const RatesDefinition = _ref => {
|
|
25
|
+
let {
|
|
26
|
+
contextApiInfo,
|
|
27
|
+
billData
|
|
28
|
+
} = _ref;
|
|
29
|
+
const rate = (0, _seamlessImmutable.getIn)(billData, ['client', 'rate', 'purchased']);
|
|
30
|
+
const category = (0, _seamlessImmutable.getIn)(billData, ['client', 'rate', 'category']);
|
|
31
|
+
const description = (0, _seamlessImmutable.getIn)(billData, ['client', 'rate', 'description']);
|
|
32
|
+
const fixedCharge = (0, _rates.getCharge)(billData, _rates2.CHARGE_TYPES.FIXED).amount;
|
|
33
|
+
const variableCharge = (0, _rates.getCharge)(billData, _rates2.CHARGE_TYPES.VARIABLE).amount;
|
|
34
|
+
const {
|
|
35
|
+
Label
|
|
36
|
+
} = contextApiInfo;
|
|
37
|
+
const currentPeriod = (0, _periods.getCurrentPeriod)(billData);
|
|
38
|
+
const currentConsumption = (0, _consumptions.getCurrentConsumption)(currentPeriod, _consumptions2.ENERGY_TYPES.ACTIVE);
|
|
39
|
+
const {
|
|
40
|
+
adviceTitle,
|
|
41
|
+
adviceText,
|
|
42
|
+
rateDataTitle
|
|
43
|
+
} = contextApiInfo.config.texts.ratesDefinition;
|
|
39
44
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
40
45
|
className: _stylesModule.default.container
|
|
41
46
|
}, /*#__PURE__*/_react.default.createElement(_CategoryByConsumption.default, {
|
|
@@ -71,5 +76,4 @@ RatesDefinition.propTypes = {
|
|
|
71
76
|
contextApiInfo: _smartBillTypes.contextApiInfoTypes,
|
|
72
77
|
billData: _billDataTypes.billDataTypes
|
|
73
78
|
};
|
|
74
|
-
var _default = (0, _WithContextApi.default)()(RatesDefinition);
|
|
75
|
-
exports.default = _default;
|
|
79
|
+
var _default = exports.default = (0, _WithContextApi.default)()(RatesDefinition);
|
|
@@ -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
|
});
|
|
@@ -8,42 +7,20 @@ exports.default = void 0;
|
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
8
|
var _Context = require("../../shared/Context");
|
|
10
9
|
var _smartBillTypes = require("../../shared/types/smartBillTypes");
|
|
11
|
-
function _getRequireWildcardCache(
|
|
12
|
-
function _interopRequireWildcard(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
23
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
24
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
25
|
-
var SmartBillProvider = /*#__PURE__*/function (_PureComponent) {
|
|
26
|
-
_inherits(SmartBillProvider, _PureComponent);
|
|
27
|
-
var _super = _createSuper(SmartBillProvider);
|
|
28
|
-
function SmartBillProvider() {
|
|
29
|
-
_classCallCheck(this, SmartBillProvider);
|
|
30
|
-
return _super.apply(this, arguments);
|
|
10
|
+
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); }
|
|
11
|
+
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; }
|
|
12
|
+
class SmartBillProvider extends _react.PureComponent {
|
|
13
|
+
render() {
|
|
14
|
+
const {
|
|
15
|
+
children,
|
|
16
|
+
contextApiInfo
|
|
17
|
+
} = this.props;
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement(_Context.SmartBillProvider, {
|
|
19
|
+
value: contextApiInfo
|
|
20
|
+
}, children);
|
|
31
21
|
}
|
|
32
|
-
|
|
33
|
-
key: "render",
|
|
34
|
-
value: function render() {
|
|
35
|
-
var _this$props = this.props,
|
|
36
|
-
children = _this$props.children,
|
|
37
|
-
contextApiInfo = _this$props.contextApiInfo;
|
|
38
|
-
return /*#__PURE__*/_react.default.createElement(_Context.SmartBillProvider, {
|
|
39
|
-
value: contextApiInfo
|
|
40
|
-
}, children);
|
|
41
|
-
}
|
|
42
|
-
}]);
|
|
43
|
-
return SmartBillProvider;
|
|
44
|
-
}(_react.PureComponent);
|
|
22
|
+
}
|
|
45
23
|
SmartBillProvider.propTypes = {
|
|
46
24
|
contextApiInfo: _smartBillTypes.contextApiInfoTypes
|
|
47
25
|
};
|
|
48
|
-
var _default = SmartBillProvider;
|
|
49
|
-
exports.default = _default;
|
|
26
|
+
var _default = exports.default = SmartBillProvider;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.VARIANTS = 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 = exports.VARIANTS = {
|
|
10
10
|
small: {
|
|
11
11
|
currencyLabelStyle: _stylesModule.default.smallCurrency,
|
|
12
12
|
decimalLabelStyle: _stylesModule.default.smallDecimalPart
|
|
@@ -27,5 +27,4 @@ var VARIANTS = {
|
|
|
27
27
|
currencyLabelStyle: _stylesModule.default.titleCurrency,
|
|
28
28
|
decimalLabelStyle: _stylesModule.default.titleDecimalPart
|
|
29
29
|
}
|
|
30
|
-
};
|
|
31
|
-
exports.VARIANTS = VARIANTS;
|
|
30
|
+
};
|
|
@@ -12,33 +12,25 @@ var _WithContextApi = _interopRequireDefault(require("../WithContextApi"));
|
|
|
12
12
|
var _constants = require("./constants");
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
var Label = contextApiInfo.Label;
|
|
35
|
-
var _VARIANTS$variant = _constants.VARIANTS[variant],
|
|
36
|
-
currencyLabelStyle = _VARIANTS$variant.currencyLabelStyle,
|
|
37
|
-
decimalLabelStyle = _VARIANTS$variant.decimalLabelStyle;
|
|
38
|
-
var _ref2 = amount !== null && amount !== undefined && (0, _numeral.default)(amount).format(amountFormat).split(splitChar) || ['-', '-'],
|
|
39
|
-
_ref3 = _slicedToArray(_ref2, 2),
|
|
40
|
-
integerPart = _ref3[0],
|
|
41
|
-
decimalPart = _ref3[1];
|
|
15
|
+
const StyledAmount = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
contextApiInfo,
|
|
18
|
+
currency = '$',
|
|
19
|
+
amount,
|
|
20
|
+
amountFormat = '0,0.00',
|
|
21
|
+
splitChar = ',',
|
|
22
|
+
variant = 'medium',
|
|
23
|
+
alias,
|
|
24
|
+
aliasDecimal
|
|
25
|
+
} = _ref;
|
|
26
|
+
const {
|
|
27
|
+
Label
|
|
28
|
+
} = contextApiInfo;
|
|
29
|
+
const {
|
|
30
|
+
currencyLabelStyle,
|
|
31
|
+
decimalLabelStyle
|
|
32
|
+
} = _constants.VARIANTS[variant];
|
|
33
|
+
const [integerPart, decimalPart] = amount !== null && amount !== undefined && (0, _numeral.default)(amount).format(amountFormat).split(splitChar) || ['-', '-'];
|
|
42
34
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
43
35
|
className: _stylesModule.default.container
|
|
44
36
|
}, /*#__PURE__*/_react.default.createElement(Label, {
|
|
@@ -61,5 +53,4 @@ StyledAmount.propTypes = {
|
|
|
61
53
|
aliasDecimal: _propTypes.string,
|
|
62
54
|
variant: _propTypes.string
|
|
63
55
|
};
|
|
64
|
-
var _default = (0, _WithContextApi.default)()(StyledAmount);
|
|
65
|
-
exports.default = _default;
|
|
56
|
+
var _default = exports.default = (0, _WithContextApi.default)()(StyledAmount);
|
|
@@ -10,32 +10,24 @@ var _Context = require("../../shared/Context");
|
|
|
10
10
|
var _context = require("../../shared/utils/context");
|
|
11
11
|
var _layout = _interopRequireDefault(require("./layout"));
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
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); }
|
|
14
13
|
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); }
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
20
|
-
var withContextApi = function withContextApi(retrieveStyle) {
|
|
21
|
-
return function (Component) {
|
|
22
|
-
return function (props) {
|
|
23
|
-
return /*#__PURE__*/_react.default.createElement(_Context.SmartBillConsumer, null, function (contextApiInfo) {
|
|
24
|
-
var infoWithUnpackedComponents = _objectSpread(_objectSpread({}, contextApiInfo), (0, _context.unpackComponents)(contextApiInfo));
|
|
25
|
-
var infoWithDefaultColors = _objectSpread(_objectSpread({}, infoWithUnpackedComponents), {}, {
|
|
26
|
-
config: _objectSpread({
|
|
27
|
-
colors: contextApiInfo.colors || _aliases.DEFAULT_COLORS
|
|
28
|
-
}, contextApiInfo.config)
|
|
29
|
-
});
|
|
30
|
-
delete infoWithUnpackedComponents.components;
|
|
31
|
-
return /*#__PURE__*/_react.default.createElement(_layout.default, _extends({}, props, {
|
|
32
|
-
Component: Component,
|
|
33
|
-
contextApiInfo: infoWithDefaultColors,
|
|
34
|
-
retrieveStyle: retrieveStyle
|
|
35
|
-
}));
|
|
36
|
-
});
|
|
37
|
-
};
|
|
14
|
+
const withContextApi = retrieveStyle => Component => props => /*#__PURE__*/_react.default.createElement(_Context.SmartBillConsumer, null, contextApiInfo => {
|
|
15
|
+
const infoWithUnpackedComponents = {
|
|
16
|
+
...contextApiInfo,
|
|
17
|
+
...(0, _context.unpackComponents)(contextApiInfo)
|
|
38
18
|
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
19
|
+
const infoWithDefaultColors = {
|
|
20
|
+
...infoWithUnpackedComponents,
|
|
21
|
+
config: {
|
|
22
|
+
colors: contextApiInfo.colors || _aliases.DEFAULT_COLORS,
|
|
23
|
+
...contextApiInfo.config
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
delete infoWithUnpackedComponents.components;
|
|
27
|
+
return /*#__PURE__*/_react.default.createElement(_layout.default, _extends({}, props, {
|
|
28
|
+
Component: Component,
|
|
29
|
+
contextApiInfo: infoWithDefaultColors,
|
|
30
|
+
retrieveStyle: retrieveStyle
|
|
31
|
+
}));
|
|
32
|
+
});
|
|
33
|
+
var _default = exports.default = withContextApi;
|
|
@@ -10,9 +10,9 @@ var _reactJss = _interopRequireDefault(require("react-jss"));
|
|
|
10
10
|
var _componentsTypes = require("../../shared/types/componentsTypes");
|
|
11
11
|
var _smartBillTypes = require("../../shared/types/smartBillTypes");
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
13
|
+
const ThemedComponent = props => {
|
|
14
14
|
var _props$contextApiInfo;
|
|
15
|
-
|
|
15
|
+
const StyledComponent = props.retrieveStyle && (_props$contextApiInfo = props.contextApiInfo) !== null && _props$contextApiInfo !== void 0 && _props$contextApiInfo.theme ? (0, _reactJss.default)(props.retrieveStyle(props.contextApiInfo.theme))(props.Component) : props.Component;
|
|
16
16
|
return /*#__PURE__*/_react.default.createElement(StyledComponent, props);
|
|
17
17
|
};
|
|
18
18
|
ThemedComponent.propTypes = {
|
|
@@ -20,5 +20,4 @@ ThemedComponent.propTypes = {
|
|
|
20
20
|
retrieveStyle: _propTypes.func,
|
|
21
21
|
contextApiInfo: _smartBillTypes.contextApiInfoTypes
|
|
22
22
|
};
|
|
23
|
-
var _default = ThemedComponent;
|
|
24
|
-
exports.default = _default;
|
|
23
|
+
var _default = exports.default = ThemedComponent;
|
|
@@ -8,15 +8,11 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _season = require("../../shared/utils/season");
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
10
|
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); }
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}, props));
|
|
18
|
-
};
|
|
19
|
-
};
|
|
11
|
+
const withSeason = () => Component => props => {
|
|
12
|
+
// eslint-disable-next-line react/prop-types
|
|
13
|
+
const season = (0, _season.getSeason)(props.monthNumber);
|
|
14
|
+
return /*#__PURE__*/_react.default.createElement(Component, _extends({
|
|
15
|
+
season: season
|
|
16
|
+
}, props));
|
|
20
17
|
};
|
|
21
|
-
var _default = withSeason;
|
|
22
|
-
exports.default = _default;
|
|
18
|
+
var _default = exports.default = withSeason;
|
|
@@ -7,39 +7,38 @@ exports.TabletViewport = exports.TabletMobileViewport = exports.TabletBreakpoint
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactResponsive = _interopRequireDefault(require("react-responsive"));
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
|
|
11
|
-
exports.
|
|
12
|
-
|
|
13
|
-
exports.
|
|
14
|
-
|
|
15
|
-
exports.
|
|
16
|
-
|
|
17
|
-
exports.HDBreakpoint = HDBreakpoint;
|
|
18
|
-
var DESKTOP = 'desktop';
|
|
19
|
-
exports.DESKTOP = DESKTOP;
|
|
20
|
-
var MOBILE = 'mobile';
|
|
21
|
-
exports.MOBILE = MOBILE;
|
|
22
|
-
var TABLET = 'tablet';
|
|
10
|
+
const TabletBreakpoint = exports.TabletBreakpoint = 1024;
|
|
11
|
+
const MobileBreakpoint = exports.MobileBreakpoint = 768;
|
|
12
|
+
const FullHDBreakpoint = exports.FullHDBreakpoint = 1920;
|
|
13
|
+
const HDBreakpoint = exports.HDBreakpoint = 1380;
|
|
14
|
+
const DESKTOP = exports.DESKTOP = 'desktop';
|
|
15
|
+
const MOBILE = exports.MOBILE = 'mobile';
|
|
16
|
+
const TABLET = exports.TABLET = 'tablet';
|
|
23
17
|
|
|
24
18
|
// For conditional rendering
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
const DesktopViewport = _ref => {
|
|
20
|
+
let {
|
|
21
|
+
children
|
|
22
|
+
} = _ref;
|
|
28
23
|
return /*#__PURE__*/_react.default.createElement(_reactResponsive.default, {
|
|
29
24
|
minWidth: TabletBreakpoint
|
|
30
25
|
}, children);
|
|
31
26
|
};
|
|
32
27
|
exports.DesktopViewport = DesktopViewport;
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
const TabletViewport = _ref2 => {
|
|
29
|
+
let {
|
|
30
|
+
children
|
|
31
|
+
} = _ref2;
|
|
35
32
|
return /*#__PURE__*/_react.default.createElement(_reactResponsive.default, {
|
|
36
33
|
minWidth: MobileBreakpoint,
|
|
37
34
|
maxWidth: TabletBreakpoint - 1
|
|
38
35
|
}, children);
|
|
39
36
|
};
|
|
40
37
|
exports.TabletViewport = TabletViewport;
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
const MobileViewport = _ref3 => {
|
|
39
|
+
let {
|
|
40
|
+
children
|
|
41
|
+
} = _ref3;
|
|
43
42
|
return /*#__PURE__*/_react.default.createElement(_reactResponsive.default, {
|
|
44
43
|
maxWidth: MobileBreakpoint - 1
|
|
45
44
|
}, children);
|
|
@@ -47,15 +46,19 @@ var MobileViewport = function MobileViewport(_ref3) {
|
|
|
47
46
|
|
|
48
47
|
// Group tablet & desktop viewport
|
|
49
48
|
exports.MobileViewport = MobileViewport;
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
const DefaultViewport = _ref4 => {
|
|
50
|
+
let {
|
|
51
|
+
children
|
|
52
|
+
} = _ref4;
|
|
52
53
|
return /*#__PURE__*/_react.default.createElement(_reactResponsive.default, {
|
|
53
54
|
minWidth: MobileBreakpoint
|
|
54
55
|
}, children);
|
|
55
56
|
};
|
|
56
57
|
exports.DefaultViewport = DefaultViewport;
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
const TabletMobileViewport = _ref5 => {
|
|
59
|
+
let {
|
|
60
|
+
children
|
|
61
|
+
} = _ref5;
|
|
59
62
|
return /*#__PURE__*/_react.default.createElement(_reactResponsive.default, {
|
|
60
63
|
maxWidth: TabletBreakpoint - 1
|
|
61
64
|
}, children);
|
|
@@ -4,14 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.SEASON_PERIODS = exports.SEASONS = void 0;
|
|
7
|
-
|
|
7
|
+
const SEASONS = exports.SEASONS = {
|
|
8
8
|
SPRING: 'spring',
|
|
9
9
|
SUMMER: 'summer',
|
|
10
10
|
AUTUMN: 'autumn',
|
|
11
11
|
WINTER: 'winter'
|
|
12
12
|
};
|
|
13
|
-
exports.
|
|
14
|
-
var SEASON_PERIODS = [{
|
|
13
|
+
const SEASON_PERIODS = exports.SEASON_PERIODS = [{
|
|
15
14
|
initMonth: 1,
|
|
16
15
|
endingMonth: 2,
|
|
17
16
|
season: SEASONS.SUMMER
|
|
@@ -31,5 +30,4 @@ var SEASON_PERIODS = [{
|
|
|
31
30
|
initMonth: 12,
|
|
32
31
|
endingMonth: 12,
|
|
33
32
|
season: SEASONS.SUMMER
|
|
34
|
-
}];
|
|
35
|
-
exports.SEASON_PERIODS = SEASON_PERIODS;
|
|
33
|
+
}];
|