@aclymatepackages/modules 1.0.22 → 1.0.23
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/dist/components/{EmissionsScopeSummarySentence.js → EmissionsSummarySentence.js} +2 -2
- package/dist/components/EmissionsSummaryTable.js +19 -2
- package/dist/components/ReportSummaryBlock.js +4 -5
- package/dist/index.js +3 -3
- package/package.json +1 -1
- package/src/components/{EmissionsScopeSummarySentence.js → EmissionsSummarySentence.js} +2 -2
- package/src/components/EmissionsSummaryTable.js +19 -2
- package/src/components/ReportSummaryBlock.js +9 -6
- package/src/index.js +2 -2
|
@@ -9,7 +9,7 @@ var _material = require("@mui/material");
|
|
|
9
9
|
var _atoms = require("@aclymatepackages/atoms");
|
|
10
10
|
var _otherHelpers = require("@aclymatepackages/other-helpers");
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
const
|
|
12
|
+
const EmissionsSummarySentence = _ref => {
|
|
13
13
|
let {
|
|
14
14
|
label,
|
|
15
15
|
emissions,
|
|
@@ -37,4 +37,4 @@ const EmissionsScopeSummarySentence = _ref => {
|
|
|
37
37
|
emissions
|
|
38
38
|
}))));
|
|
39
39
|
};
|
|
40
|
-
var _default = exports.default =
|
|
40
|
+
var _default = exports.default = EmissionsSummarySentence;
|
|
@@ -8,13 +8,29 @@ require("core-js/modules/web.dom-collections.iterator.js");
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _material = require("@mui/material");
|
|
10
10
|
var _chartHelpers = require("@aclymatepackages/chart-helpers");
|
|
11
|
+
var _atoms = require("@aclymatepackages/atoms");
|
|
11
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
13
|
const SummaryTableRow = _ref => {
|
|
13
14
|
let {
|
|
14
15
|
name,
|
|
15
|
-
data
|
|
16
|
+
data,
|
|
17
|
+
rowType,
|
|
18
|
+
scope,
|
|
19
|
+
subcategory
|
|
16
20
|
} = _ref;
|
|
17
|
-
return /*#__PURE__*/_react.default.createElement(_material.TableRow, null, /*#__PURE__*/_react.default.createElement(_material.TableCell, null,
|
|
21
|
+
return /*#__PURE__*/_react.default.createElement(_material.TableRow, null, /*#__PURE__*/_react.default.createElement(_material.TableCell, null, /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
22
|
+
container: true,
|
|
23
|
+
alignItems: "center",
|
|
24
|
+
spacing: 1
|
|
25
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
26
|
+
item: true
|
|
27
|
+
}, /*#__PURE__*/_react.default.createElement(_atoms.CategoriesAvatar, {
|
|
28
|
+
viewMode: rowType,
|
|
29
|
+
scope: scope,
|
|
30
|
+
subcategory: subcategory
|
|
31
|
+
})), /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
32
|
+
item: true
|
|
33
|
+
}, name))), data.map((value, idx) => /*#__PURE__*/_react.default.createElement(_material.TableCell, {
|
|
18
34
|
key: "table-row-cell-".concat(idx)
|
|
19
35
|
}, value)));
|
|
20
36
|
};
|
|
@@ -43,6 +59,7 @@ const EmissionsSummaryTable = _ref2 => {
|
|
|
43
59
|
subcategory
|
|
44
60
|
} = _ref3;
|
|
45
61
|
return /*#__PURE__*/_react.default.createElement(SummaryTableRow, {
|
|
62
|
+
rowType: rowType,
|
|
46
63
|
name: name,
|
|
47
64
|
data: summaryTableData.map(dataRow => dataRow[subcategory]),
|
|
48
65
|
key: "summary-table-row-".concat(idx)
|
|
@@ -10,10 +10,9 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
10
10
|
var _material = require("@mui/material");
|
|
11
11
|
var _otherHelpers = require("@aclymatepackages/other-helpers");
|
|
12
12
|
var _emissionsCalcs = require("@aclymatepackages/emissions-calcs");
|
|
13
|
-
var _subcategories = require("@aclymatepackages/subcategories");
|
|
14
13
|
var _ReportGraphContentLayout = _interopRequireDefault(require("./ReportGraphContentLayout"));
|
|
15
14
|
var _EmissionsPieChart = _interopRequireDefault(require("./EmissionsPieChart"));
|
|
16
|
-
var
|
|
15
|
+
var _EmissionsSummarySentence = _interopRequireDefault(require("./EmissionsSummarySentence"));
|
|
17
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
17
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
19
18
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -25,9 +24,9 @@ const ReportSummaryBlock = _ref => {
|
|
|
25
24
|
emissions,
|
|
26
25
|
interval,
|
|
27
26
|
branding,
|
|
28
|
-
showTooltip
|
|
27
|
+
showTooltip,
|
|
28
|
+
scopesWithColors
|
|
29
29
|
} = _ref;
|
|
30
|
-
const scopesWithColors = (0, _subcategories.buildScopesWithColors)(branding);
|
|
31
30
|
const scopesWithEmissions = scopesWithColors.map(scopeObj => {
|
|
32
31
|
const {
|
|
33
32
|
scope
|
|
@@ -59,7 +58,7 @@ const ReportSummaryBlock = _ref => {
|
|
|
59
58
|
emissions,
|
|
60
59
|
color
|
|
61
60
|
} = _ref2;
|
|
62
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
61
|
+
return /*#__PURE__*/_react.default.createElement(_EmissionsSummarySentence.default, {
|
|
63
62
|
key: "summary-sentence-".concat(idx),
|
|
64
63
|
label: "Total Scope ".concat(scope),
|
|
65
64
|
emissions: emissions,
|
package/dist/index.js
CHANGED
|
@@ -51,10 +51,10 @@ Object.defineProperty(exports, "EmissionsReductionGraph", {
|
|
|
51
51
|
return _EmissionsReductionGraph.default;
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
|
-
Object.defineProperty(exports, "
|
|
54
|
+
Object.defineProperty(exports, "EmissionsSummarySentence", {
|
|
55
55
|
enumerable: true,
|
|
56
56
|
get: function get() {
|
|
57
|
-
return
|
|
57
|
+
return _EmissionsSummarySentence.default;
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
Object.defineProperty(exports, "EmissionsSummaryTable", {
|
|
@@ -142,5 +142,5 @@ var _useChartWarningLabels = _interopRequireDefault(require("./components/useCha
|
|
|
142
142
|
var _EmissionsSummaryTable = _interopRequireDefault(require("./components/EmissionsSummaryTable"));
|
|
143
143
|
var _ReportSummaryBlock = _interopRequireDefault(require("./components/ReportSummaryBlock"));
|
|
144
144
|
var _ReportGraphContentLayout = _interopRequireDefault(require("./components/ReportGraphContentLayout"));
|
|
145
|
-
var
|
|
145
|
+
var _EmissionsSummarySentence = _interopRequireDefault(require("./components/EmissionsSummarySentence"));
|
|
146
146
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ import { Typography, Grid } from "@mui/material";
|
|
|
5
5
|
import { CategoriesAvatar } from "@aclymatepackages/atoms";
|
|
6
6
|
import { buildEmissionsSummarySentence } from "@aclymatepackages/other-helpers";
|
|
7
7
|
|
|
8
|
-
const
|
|
8
|
+
const EmissionsSummarySentence = ({ label, emissions, color, scope }) => (
|
|
9
9
|
<Grid container spacing={1} alignItems="center" wrap="nowrap">
|
|
10
10
|
<Grid item>
|
|
11
11
|
<CategoriesAvatar
|
|
@@ -22,4 +22,4 @@ const EmissionsScopeSummarySentence = ({ label, emissions, color, scope }) => (
|
|
|
22
22
|
</Grid>
|
|
23
23
|
</Grid>
|
|
24
24
|
);
|
|
25
|
-
export default
|
|
25
|
+
export default EmissionsSummarySentence;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
|
|
2
3
|
import {
|
|
3
4
|
Box,
|
|
5
|
+
Grid,
|
|
4
6
|
Table,
|
|
5
7
|
TableBody,
|
|
6
8
|
TableCell,
|
|
@@ -9,15 +11,29 @@ import {
|
|
|
9
11
|
TableRow,
|
|
10
12
|
Typography,
|
|
11
13
|
} from "@mui/material";
|
|
14
|
+
|
|
12
15
|
import {
|
|
13
16
|
buildScopesRealDataObj,
|
|
14
17
|
buildSubcategoriesDataObj,
|
|
15
18
|
buildEmissionGroupData,
|
|
16
19
|
} from "@aclymatepackages/chart-helpers";
|
|
17
20
|
|
|
18
|
-
|
|
21
|
+
import { CategoriesAvatar } from "@aclymatepackages/atoms";
|
|
22
|
+
|
|
23
|
+
const SummaryTableRow = ({ name, data, rowType, scope, subcategory }) => (
|
|
19
24
|
<TableRow>
|
|
20
|
-
<TableCell>
|
|
25
|
+
<TableCell>
|
|
26
|
+
<Grid container alignItems="center" spacing={1}>
|
|
27
|
+
<Grid item>
|
|
28
|
+
<CategoriesAvatar
|
|
29
|
+
viewMode={rowType}
|
|
30
|
+
scope={scope}
|
|
31
|
+
subcategory={subcategory}
|
|
32
|
+
/>
|
|
33
|
+
</Grid>
|
|
34
|
+
<Grid item>{name}</Grid>
|
|
35
|
+
</Grid>
|
|
36
|
+
</TableCell>
|
|
21
37
|
{data.map((value, idx) => (
|
|
22
38
|
<TableCell key={`table-row-cell-${idx}`}>{value}</TableCell>
|
|
23
39
|
))}
|
|
@@ -60,6 +76,7 @@ const EmissionsSummaryTable = ({
|
|
|
60
76
|
<TableBody>
|
|
61
77
|
{rows.map(({ name, subcategory }, idx) => (
|
|
62
78
|
<SummaryTableRow
|
|
79
|
+
rowType={rowType}
|
|
63
80
|
name={name}
|
|
64
81
|
data={summaryTableData.map((dataRow) => dataRow[subcategory])}
|
|
65
82
|
key={`summary-table-row-${idx}`}
|
|
@@ -4,15 +4,18 @@ import { Typography } from "@mui/material";
|
|
|
4
4
|
|
|
5
5
|
import { buildEmissionsSummarySentence } from "@aclymatepackages/other-helpers";
|
|
6
6
|
import { filterEmissionsByScope } from "@aclymatepackages/emissions-calcs";
|
|
7
|
-
import { buildScopesWithColors } from "@aclymatepackages/subcategories";
|
|
8
7
|
|
|
9
8
|
import ReportGraphContentLayout from "./ReportGraphContentLayout";
|
|
10
9
|
import EmissionsPieChart from "./EmissionsPieChart";
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
const ReportSummaryBlock = ({ emissions, interval, branding, showTooltip }) => {
|
|
14
|
-
const scopesWithColors = buildScopesWithColors(branding);
|
|
10
|
+
import EmissionsSummarySentence from "./EmissionsSummarySentence";
|
|
15
11
|
|
|
12
|
+
const ReportSummaryBlock = ({
|
|
13
|
+
emissions,
|
|
14
|
+
interval,
|
|
15
|
+
branding,
|
|
16
|
+
showTooltip,
|
|
17
|
+
scopesWithColors,
|
|
18
|
+
}) => {
|
|
16
19
|
const scopesWithEmissions = scopesWithColors.map((scopeObj) => {
|
|
17
20
|
const { scope } = scopeObj;
|
|
18
21
|
const scopeEmissions = filterEmissionsByScope(emissions, scope);
|
|
@@ -38,7 +41,7 @@ const ReportSummaryBlock = ({ emissions, interval, branding, showTooltip }) => {
|
|
|
38
41
|
/>,
|
|
39
42
|
<Typography variant="subtitle1">Emissions Scope Breakdown</Typography>,
|
|
40
43
|
...scopesWithEmissions.map(({ scope, emissions, color }, idx) => (
|
|
41
|
-
<
|
|
44
|
+
<EmissionsSummarySentence
|
|
42
45
|
key={`summary-sentence-${idx}`}
|
|
43
46
|
label={`Total Scope ${scope}`}
|
|
44
47
|
emissions={emissions}
|
package/src/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import useChartWarningLabels from "./components/useChartWarningLabels";
|
|
|
17
17
|
import EmissionsSummaryTable from "./components/EmissionsSummaryTable";
|
|
18
18
|
import ReportSummaryBlock from "./components/ReportSummaryBlock";
|
|
19
19
|
import ReportGraphContentLayout from "./components/ReportGraphContentLayout";
|
|
20
|
-
import
|
|
20
|
+
import EmissionsSummarySentence from "./components/EmissionsSummarySentence";
|
|
21
21
|
|
|
22
22
|
export {
|
|
23
23
|
FootprintVideo,
|
|
@@ -39,5 +39,5 @@ export {
|
|
|
39
39
|
EmissionsSummaryTable,
|
|
40
40
|
ReportSummaryBlock,
|
|
41
41
|
ReportGraphContentLayout,
|
|
42
|
-
|
|
42
|
+
EmissionsSummarySentence,
|
|
43
43
|
};
|