@aclymatepackages/modules 1.0.23 → 1.0.24
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/ReportGraphContentLayout.js +0 -1
- package/dist/index.js +0 -7
- package/package.json +1 -1
- package/src/components/ReportGraphContentLayout.js +1 -1
- package/src/index.js +0 -2
- package/dist/components/EmissionsSummaryTable.js +0 -69
- package/src/components/EmissionsSummaryTable.js +0 -92
package/dist/index.js
CHANGED
|
@@ -57,12 +57,6 @@ Object.defineProperty(exports, "EmissionsSummarySentence", {
|
|
|
57
57
|
return _EmissionsSummarySentence.default;
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
|
-
Object.defineProperty(exports, "EmissionsSummaryTable", {
|
|
61
|
-
enumerable: true,
|
|
62
|
-
get: function get() {
|
|
63
|
-
return _EmissionsSummaryTable.default;
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
60
|
Object.defineProperty(exports, "FootprintEquivalencies", {
|
|
67
61
|
enumerable: true,
|
|
68
62
|
get: function get() {
|
|
@@ -139,7 +133,6 @@ var _EmissionsChart = _interopRequireDefault(require("./components/EmissionsChar
|
|
|
139
133
|
var _EmissionsCustomTooltip = _interopRequireDefault(require("./components/EmissionsCustomTooltip"));
|
|
140
134
|
var _EmissionsPieChart = _interopRequireDefault(require("./components/EmissionsPieChart"));
|
|
141
135
|
var _useChartWarningLabels = _interopRequireDefault(require("./components/useChartWarningLabels"));
|
|
142
|
-
var _EmissionsSummaryTable = _interopRequireDefault(require("./components/EmissionsSummaryTable"));
|
|
143
136
|
var _ReportSummaryBlock = _interopRequireDefault(require("./components/ReportSummaryBlock"));
|
|
144
137
|
var _ReportGraphContentLayout = _interopRequireDefault(require("./components/ReportGraphContentLayout"));
|
|
145
138
|
var _EmissionsSummarySentence = _interopRequireDefault(require("./components/EmissionsSummarySentence"));
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@ const ReportGraphContentLayout = ({
|
|
|
17
17
|
showTooltip,
|
|
18
18
|
}) => {
|
|
19
19
|
return (
|
|
20
|
-
<Box
|
|
20
|
+
<Box style={{ height: height || "auto" }}>
|
|
21
21
|
<Grid container spacing={2}>
|
|
22
22
|
<Grid item sm={4} container direction="column" spacing={2}>
|
|
23
23
|
<Grid item>
|
package/src/index.js
CHANGED
|
@@ -14,7 +14,6 @@ import EmissionsChart from "./components/EmissionsChart";
|
|
|
14
14
|
import EmissionsCustomTooltip from "./components/EmissionsCustomTooltip";
|
|
15
15
|
import EmissionsPieChart from "./components/EmissionsPieChart";
|
|
16
16
|
import useChartWarningLabels from "./components/useChartWarningLabels";
|
|
17
|
-
import EmissionsSummaryTable from "./components/EmissionsSummaryTable";
|
|
18
17
|
import ReportSummaryBlock from "./components/ReportSummaryBlock";
|
|
19
18
|
import ReportGraphContentLayout from "./components/ReportGraphContentLayout";
|
|
20
19
|
import EmissionsSummarySentence from "./components/EmissionsSummarySentence";
|
|
@@ -36,7 +35,6 @@ export {
|
|
|
36
35
|
EmissionsCustomTooltip,
|
|
37
36
|
EmissionsPieChart,
|
|
38
37
|
useChartWarningLabels,
|
|
39
|
-
EmissionsSummaryTable,
|
|
40
38
|
ReportSummaryBlock,
|
|
41
39
|
ReportGraphContentLayout,
|
|
42
40
|
EmissionsSummarySentence,
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _material = require("@mui/material");
|
|
10
|
-
var _chartHelpers = require("@aclymatepackages/chart-helpers");
|
|
11
|
-
var _atoms = require("@aclymatepackages/atoms");
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
const SummaryTableRow = _ref => {
|
|
14
|
-
let {
|
|
15
|
-
name,
|
|
16
|
-
data,
|
|
17
|
-
rowType,
|
|
18
|
-
scope,
|
|
19
|
-
subcategory
|
|
20
|
-
} = _ref;
|
|
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, {
|
|
34
|
-
key: "table-row-cell-".concat(idx)
|
|
35
|
-
}, value)));
|
|
36
|
-
};
|
|
37
|
-
const EmissionsSummaryTable = _ref2 => {
|
|
38
|
-
let {
|
|
39
|
-
emissions,
|
|
40
|
-
rows,
|
|
41
|
-
interval,
|
|
42
|
-
blockTitle,
|
|
43
|
-
tableTitle = "",
|
|
44
|
-
rowType,
|
|
45
|
-
startDate
|
|
46
|
-
} = _ref2;
|
|
47
|
-
const {
|
|
48
|
-
groupedEmissions,
|
|
49
|
-
chartLabelsArray
|
|
50
|
-
} = (0, _chartHelpers.buildEmissionGroupData)(emissions, interval, startDate);
|
|
51
|
-
const summaryTableData = groupedEmissions.map(emission => rowType === "scopes" ? (0, _chartHelpers.buildScopesRealDataObj)(emission) : (0, _chartHelpers.buildSubcategoriesDataObj)(emission));
|
|
52
|
-
return /*#__PURE__*/_react.default.createElement(_material.Box, null, /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
53
|
-
variant: "h6"
|
|
54
|
-
}, blockTitle), /*#__PURE__*/_react.default.createElement(_material.TableContainer, null, /*#__PURE__*/_react.default.createElement(_material.Table, null, /*#__PURE__*/_react.default.createElement(_material.TableHead, null, /*#__PURE__*/_react.default.createElement(_material.TableRow, null, [tableTitle, ...chartLabelsArray].map((label, idx) => /*#__PURE__*/_react.default.createElement(_material.TableCell, {
|
|
55
|
-
key: "table-head-cell-".concat(idx)
|
|
56
|
-
}, label)))), /*#__PURE__*/_react.default.createElement(_material.TableBody, null, rows.map((_ref3, idx) => {
|
|
57
|
-
let {
|
|
58
|
-
name,
|
|
59
|
-
subcategory
|
|
60
|
-
} = _ref3;
|
|
61
|
-
return /*#__PURE__*/_react.default.createElement(SummaryTableRow, {
|
|
62
|
-
rowType: rowType,
|
|
63
|
-
name: name,
|
|
64
|
-
data: summaryTableData.map(dataRow => dataRow[subcategory]),
|
|
65
|
-
key: "summary-table-row-".concat(idx)
|
|
66
|
-
});
|
|
67
|
-
})))));
|
|
68
|
-
};
|
|
69
|
-
var _default = exports.default = EmissionsSummaryTable;
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
Box,
|
|
5
|
-
Grid,
|
|
6
|
-
Table,
|
|
7
|
-
TableBody,
|
|
8
|
-
TableCell,
|
|
9
|
-
TableContainer,
|
|
10
|
-
TableHead,
|
|
11
|
-
TableRow,
|
|
12
|
-
Typography,
|
|
13
|
-
} from "@mui/material";
|
|
14
|
-
|
|
15
|
-
import {
|
|
16
|
-
buildScopesRealDataObj,
|
|
17
|
-
buildSubcategoriesDataObj,
|
|
18
|
-
buildEmissionGroupData,
|
|
19
|
-
} from "@aclymatepackages/chart-helpers";
|
|
20
|
-
|
|
21
|
-
import { CategoriesAvatar } from "@aclymatepackages/atoms";
|
|
22
|
-
|
|
23
|
-
const SummaryTableRow = ({ name, data, rowType, scope, subcategory }) => (
|
|
24
|
-
<TableRow>
|
|
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>
|
|
37
|
-
{data.map((value, idx) => (
|
|
38
|
-
<TableCell key={`table-row-cell-${idx}`}>{value}</TableCell>
|
|
39
|
-
))}
|
|
40
|
-
</TableRow>
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
const EmissionsSummaryTable = ({
|
|
44
|
-
emissions,
|
|
45
|
-
rows,
|
|
46
|
-
interval,
|
|
47
|
-
blockTitle,
|
|
48
|
-
tableTitle = "",
|
|
49
|
-
rowType,
|
|
50
|
-
startDate,
|
|
51
|
-
}) => {
|
|
52
|
-
const { groupedEmissions, chartLabelsArray } = buildEmissionGroupData(
|
|
53
|
-
emissions,
|
|
54
|
-
interval,
|
|
55
|
-
startDate
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
const summaryTableData = groupedEmissions.map((emission) =>
|
|
59
|
-
rowType === "scopes"
|
|
60
|
-
? buildScopesRealDataObj(emission)
|
|
61
|
-
: buildSubcategoriesDataObj(emission)
|
|
62
|
-
);
|
|
63
|
-
|
|
64
|
-
return (
|
|
65
|
-
<Box>
|
|
66
|
-
<Typography variant="h6">{blockTitle}</Typography>
|
|
67
|
-
<TableContainer>
|
|
68
|
-
<Table>
|
|
69
|
-
<TableHead>
|
|
70
|
-
<TableRow>
|
|
71
|
-
{[tableTitle, ...chartLabelsArray].map((label, idx) => (
|
|
72
|
-
<TableCell key={`table-head-cell-${idx}`}>{label}</TableCell>
|
|
73
|
-
))}
|
|
74
|
-
</TableRow>
|
|
75
|
-
</TableHead>
|
|
76
|
-
<TableBody>
|
|
77
|
-
{rows.map(({ name, subcategory }, idx) => (
|
|
78
|
-
<SummaryTableRow
|
|
79
|
-
rowType={rowType}
|
|
80
|
-
name={name}
|
|
81
|
-
data={summaryTableData.map((dataRow) => dataRow[subcategory])}
|
|
82
|
-
key={`summary-table-row-${idx}`}
|
|
83
|
-
/>
|
|
84
|
-
))}
|
|
85
|
-
</TableBody>
|
|
86
|
-
</Table>
|
|
87
|
-
</TableContainer>
|
|
88
|
-
</Box>
|
|
89
|
-
);
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
export default EmissionsSummaryTable;
|