@canyonjs/report-component 1.0.26 → 1.0.28

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.
Files changed (2) hide show
  1. package/dist/index.js +8 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -793,7 +793,7 @@ const SummaryNav = ({ value, onClick, reportName }) => {
793
793
  })
794
794
  });
795
795
  };
796
- const SummaryMetric = ({ data, onlyChange }) => {
796
+ const SummaryMetric = ({ data, onlyChange, showChangeMetrics }) => {
797
797
  const t$1 = (v) => v;
798
798
  const summaryTreeItem = { summary: data };
799
799
  return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("div", {
@@ -813,12 +813,12 @@ const SummaryMetric = ({ data, onlyChange }) => {
813
813
  "changestatements"
814
814
  ];
815
815
  return order.indexOf(key1) - order.indexOf(key2);
816
- }).filter(([key]) => (onlyChange ? ["changestatements"] : [
816
+ }).filter(([key]) => (onlyChange ? showChangeMetrics ? ["changestatements"] : [] : [
817
817
  "statements",
818
818
  "branches",
819
819
  "functions",
820
820
  "lines",
821
- "changestatements"
821
+ ...showChangeMetrics ? ["changestatements"] : []
822
822
  ]).includes(key)).map(([key, value]) => {
823
823
  return /* @__PURE__ */ jsxs("div", {
824
824
  style: {
@@ -860,7 +860,7 @@ const SummaryBar = ({ pct }) => {
860
860
  backgroundColor: getColor(pct)
861
861
  } });
862
862
  };
863
- const SummaryHeader = ({ value, onSelect, data, reportName, onlyChange }) => {
863
+ const SummaryHeader = ({ value, onSelect, data, reportName, onlyChange, showChangeMetrics }) => {
864
864
  return /* @__PURE__ */ jsxs("div", { children: [
865
865
  /* @__PURE__ */ jsx(SummaryNav, {
866
866
  reportName,
@@ -869,7 +869,8 @@ const SummaryHeader = ({ value, onSelect, data, reportName, onlyChange }) => {
869
869
  }),
870
870
  /* @__PURE__ */ jsx(SummaryMetric, {
871
871
  data,
872
- onlyChange
872
+ onlyChange,
873
+ showChangeMetrics
873
874
  }),
874
875
  /* @__PURE__ */ jsx(SummaryBar, { pct: data.statements.pct })
875
876
  ] });
@@ -1323,7 +1324,8 @@ const CanyonReport = ({ value, name, dataSource, onSelect, defaultOnlyChange = f
1323
1324
  data: rootDataSource,
1324
1325
  value,
1325
1326
  onSelect: newOnSelect,
1326
- onlyChange
1327
+ onlyChange,
1328
+ showChangeMetrics: hasAnyFileChange
1327
1329
  }),
1328
1330
  /* @__PURE__ */ jsx(RIf_default, {
1329
1331
  condition: mode === "file",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canyonjs/report-component",
3
- "version": "1.0.26",
3
+ "version": "1.0.28",
4
4
  "homepage": "https://github.com/canyon-project/canyon#readme",
5
5
  "bugs": {
6
6
  "url": "https://github.com/canyon-project/canyon/issues"