@bundle-stats/ui 4.13.0-beta.6 → 4.13.0-beta.7
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/lib/components/bundle-assets/bundle-assets.js +7 -2
- package/lib/components/bundle-assets/bundle-assets.js.map +1 -1
- package/lib/components/bundle-assets-totals/bundle-assets-totals.js +13 -6
- package/lib/components/bundle-assets-totals/bundle-assets-totals.js.map +1 -1
- package/lib/components/bundle-modules/bundle-modules.js +6 -1
- package/lib/components/bundle-modules/bundle-modules.js.map +1 -1
- package/lib/components/bundle-packages/bundle-packages.js +6 -1
- package/lib/components/bundle-packages/bundle-packages.js.map +1 -1
- package/lib/components/index.js +1 -3
- package/lib/components/index.js.map +1 -1
- package/lib/components/metrics-table/metrics-table.i18n.js +1 -6
- package/lib/components/metrics-table/metrics-table.i18n.js.map +1 -1
- package/lib/components/metrics-table/metrics-table.js +4 -37
- package/lib/components/metrics-table/metrics-table.js.map +1 -1
- package/lib/components/metrics-table/metrics-table.module.css +1 -44
- package/lib/components/{total-size-type-title → metrics-table-header}/index.js +1 -1
- package/lib/components/metrics-table-header/index.js.map +1 -0
- package/lib/components/metrics-table-header/metrics-table-header.i18n.js +9 -0
- package/lib/components/metrics-table-header/metrics-table-header.i18n.js.map +1 -0
- package/lib/components/metrics-table-header/metrics-table-header.js +79 -0
- package/lib/components/metrics-table-header/metrics-table-header.js.map +1 -0
- package/lib/components/metrics-table-header/metrics-table-header.module.css +44 -0
- package/lib/components/metrics-table-title/metrics-table-title.js +1 -1
- package/lib/components/metrics-table-title/metrics-table-title.js.map +1 -1
- package/lib/components/metrics-table-title/metrics-table-title.module.css +3 -4
- package/lib/components/sort-button/sort-button.module.css +1 -0
- package/lib-esm/components/bundle-assets/bundle-assets.js +7 -2
- package/lib-esm/components/bundle-assets/bundle-assets.js.map +1 -1
- package/lib-esm/components/bundle-assets-totals/bundle-assets-totals.js +14 -7
- package/lib-esm/components/bundle-assets-totals/bundle-assets-totals.js.map +1 -1
- package/lib-esm/components/bundle-modules/bundle-modules.js +6 -1
- package/lib-esm/components/bundle-modules/bundle-modules.js.map +1 -1
- package/lib-esm/components/bundle-packages/bundle-packages.js +6 -1
- package/lib-esm/components/bundle-packages/bundle-packages.js.map +1 -1
- package/lib-esm/components/index.js +0 -1
- package/lib-esm/components/index.js.map +1 -1
- package/lib-esm/components/metrics-table/metrics-table.i18n.js +0 -5
- package/lib-esm/components/metrics-table/metrics-table.i18n.js.map +1 -1
- package/lib-esm/components/metrics-table/metrics-table.js +4 -37
- package/lib-esm/components/metrics-table/metrics-table.js.map +1 -1
- package/lib-esm/components/metrics-table/metrics-table.module.css +1 -44
- package/lib-esm/components/metrics-table-header/index.js +2 -0
- package/lib-esm/components/metrics-table-header/index.js.map +1 -0
- package/lib-esm/components/metrics-table-header/metrics-table-header.i18n.js +6 -0
- package/lib-esm/components/metrics-table-header/metrics-table-header.i18n.js.map +1 -0
- package/lib-esm/components/metrics-table-header/metrics-table-header.js +49 -0
- package/lib-esm/components/metrics-table-header/metrics-table-header.js.map +1 -0
- package/lib-esm/components/metrics-table-header/metrics-table-header.module.css +44 -0
- package/lib-esm/components/metrics-table-title/metrics-table-title.js +1 -1
- package/lib-esm/components/metrics-table-title/metrics-table-title.js.map +1 -1
- package/lib-esm/components/metrics-table-title/metrics-table-title.module.css +3 -4
- package/lib-esm/components/sort-button/sort-button.module.css +1 -0
- package/package.json +5 -5
- package/src/components/bundle-assets/bundle-assets.jsx +18 -2
- package/src/components/bundle-assets-totals/bundle-assets-totals.jsx +29 -10
- package/src/components/bundle-modules/bundle-modules.tsx +13 -1
- package/src/components/bundle-packages/bundle-packages.jsx +13 -1
- package/src/components/index.js +0 -1
- package/src/components/metrics-table/metrics-table.i18n.ts +0 -7
- package/src/components/metrics-table/metrics-table.module.css +1 -44
- package/src/components/metrics-table/metrics-table.tsx +17 -153
- package/src/components/metrics-table-header/index.ts +1 -0
- package/src/components/metrics-table-header/metrics-table-header.i18n.ts +6 -0
- package/src/components/metrics-table-header/metrics-table-header.module.css +44 -0
- package/src/components/metrics-table-header/metrics-table-header.tsx +172 -0
- package/src/components/metrics-table-title/metrics-table-title.jsx +1 -1
- package/src/components/metrics-table-title/metrics-table-title.module.css +3 -4
- package/src/components/sort-button/sort-button.module.css +1 -0
- package/types/components/index.d.ts +0 -1
- package/types/components/metrics-table/metrics-table.d.ts +4 -10
- package/types/components/metrics-table/metrics-table.i18n.d.ts +0 -5
- package/types/components/metrics-table-header/index.d.ts +1 -0
- package/types/components/metrics-table-header/metrics-table-header.d.ts +15 -0
- package/types/components/metrics-table-header/metrics-table-header.i18n.d.ts +5 -0
- package/lib/components/total-size-type-title/index.js.map +0 -1
- package/lib/components/total-size-type-title/total-size-type-title.js +0 -32
- package/lib/components/total-size-type-title/total-size-type-title.js.map +0 -1
- package/lib/components/total-size-type-title/total-size-type-title.module.css +0 -14
- package/lib-esm/components/total-size-type-title/index.js +0 -2
- package/lib-esm/components/total-size-type-title/index.js.map +0 -1
- package/lib-esm/components/total-size-type-title/total-size-type-title.js +0 -25
- package/lib-esm/components/total-size-type-title/total-size-type-title.js.map +0 -1
- package/lib-esm/components/total-size-type-title/total-size-type-title.module.css +0 -14
- package/src/components/total-size-type-title/index.js +0 -1
- package/src/components/total-size-type-title/total-size-type-title.jsx +0 -41
- package/src/components/total-size-type-title/total-size-type-title.module.css +0 -14
- package/types/components/total-size-type-title/index.d.ts +0 -1
- package/types/components/total-size-type-title/total-size-type-title.d.ts +0 -14
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import cx from 'classnames';
|
|
3
|
+
import sum from 'lodash/sum';
|
|
4
|
+
import { METRIC_TYPE_CONFIGS, MetricTypes, getMetricRunInfo, } from '@bundle-stats/utils';
|
|
5
|
+
import { Table } from '../../ui/table';
|
|
6
|
+
import { Delta } from '../delta';
|
|
7
|
+
import { JobName } from '../job-name';
|
|
8
|
+
import { Metric } from '../metric';
|
|
9
|
+
import { SortButton } from '../sort-button';
|
|
10
|
+
import * as I18N from './metrics-table-header.i18n';
|
|
11
|
+
import css from './metrics-table-header.module.css';
|
|
12
|
+
const METRIC_TYPE = METRIC_TYPE_CONFIGS[MetricTypes.FileSize];
|
|
13
|
+
const BASELINE_COLUMN_SPAN = 1;
|
|
14
|
+
const CURRENT_COLUMN_SPAN = 3;
|
|
15
|
+
const JobColumn = ({ job, isBaseline }) => {
|
|
16
|
+
const colSpan = isBaseline ? BASELINE_COLUMN_SPAN : CURRENT_COLUMN_SPAN;
|
|
17
|
+
const { label, internalBuildNumber } = job;
|
|
18
|
+
if (!job) {
|
|
19
|
+
return React.createElement(Table.Th, { colSpan: colSpan }, "-");
|
|
20
|
+
}
|
|
21
|
+
return (React.createElement(Table.Th, { className: css.job, colSpan: colSpan },
|
|
22
|
+
React.createElement(JobName, { title: isBaseline ? I18N.BASELINE_TITLE : I18N.CURRENT_TITLE, internalBuildNumber: internalBuildNumber, className: css.jobName }, label)));
|
|
23
|
+
};
|
|
24
|
+
const getRowsRunTotal = (rows, runIndex) => sum(rows.map((row) => { var _a, _b; return ((_b = (_a = row === null || row === void 0 ? void 0 : row.runs) === null || _a === void 0 ? void 0 : _a[runIndex]) === null || _b === void 0 ? void 0 : _b.value) || 0; }));
|
|
25
|
+
const SumColumn = ({ rows, isBaseline, runIndex, updateSort, sort }) => {
|
|
26
|
+
const currentRunTotal = getRowsRunTotal(rows, runIndex);
|
|
27
|
+
const baselineRunTotal = !isBaseline ? getRowsRunTotal(rows, runIndex + 1) : 0;
|
|
28
|
+
const total = getMetricRunInfo(METRIC_TYPE, currentRunTotal, baselineRunTotal);
|
|
29
|
+
const fieldPath = `runs[${runIndex}]`;
|
|
30
|
+
return (React.createElement(React.Fragment, null,
|
|
31
|
+
React.createElement(Table.Th, { className: cx(css.value, css.sum) },
|
|
32
|
+
React.createElement(SortButton, { fieldPath: fieldPath, fieldName: "value", label: I18N.SORT_VALUE, updateSort: updateSort, sort: sort },
|
|
33
|
+
React.createElement(Metric, { value: total.displayValue }))),
|
|
34
|
+
!isBaseline && (React.createElement(React.Fragment, null,
|
|
35
|
+
React.createElement(Table.Th, { className: cx(css.delta, css.sum) },
|
|
36
|
+
React.createElement(SortButton, { fieldPath: fieldPath, fieldName: "delta", label: I18N.SORT_CHANGE, updateSort: updateSort, sort: sort }, 'delta' in total && (React.createElement(Delta, { displayValue: total.displayDelta, deltaType: total.deltaType })))),
|
|
37
|
+
React.createElement(Table.Th, { className: cx(css.delta, css.deltaPercentage, css.sum) },
|
|
38
|
+
React.createElement(SortButton, { fieldPath: fieldPath, fieldName: "deltaPercentage", label: I18N.SORT_PERCENTUAL_CHANGE, updateSort: updateSort, sort: sort }, 'delta' in total && (React.createElement(Delta, { displayValue: total.displayDeltaPercentage, deltaType: total.deltaType }))))))));
|
|
39
|
+
};
|
|
40
|
+
export const MetricsTableHeader = (props) => {
|
|
41
|
+
const { className = '', metricTitle = '', showSum = false, jobs, rows, sort, updateSort } = props;
|
|
42
|
+
const rootClassName = cx(css.root, showSum && css.showHeaderSum, className);
|
|
43
|
+
return (React.createElement(Table.THead, { className: rootClassName },
|
|
44
|
+
React.createElement(Table.Tr, { className: css.headerRow },
|
|
45
|
+
React.createElement(Table.Th, { className: css.metricName, rowSpan: showSum ? 2 : 1 }, metricTitle || ' '),
|
|
46
|
+
jobs.map((job, runIndex) => (React.createElement(JobColumn, { job: job, isBaseline: runIndex === jobs.length - 1 })))),
|
|
47
|
+
showSum && (React.createElement(Table.Tr, { className: css.headerRow }, jobs.map((_, runIndex) => (React.createElement(SumColumn, { rows: rows, isBaseline: runIndex === jobs.length - 1, runIndex: runIndex, updateSort: updateSort, sort: sort })))))));
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=metrics-table-header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metrics-table-header.js","sourceRoot":"","sources":["../../../src/components/metrics-table-header/metrics-table-header.tsx"],"names":[],"mappings":"AAAA,OA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AAC,KAAK,IAAC,SAAS,EAAE,aAAa;QACnC,oBAAC,KAAK,CAAC,EAAE,IAAC,SAAS,EAAE,GAAG,CAAC,SAAS;YAChC,oBAAC,KAAK,CAAC,EAAE,IAAC,SAAS,EAAE,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAC1D,WAAW,IAAI,GAAG,CACV;YACV,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,CAAC,CAC3B,oBAAC,SAAS,IAAC,GAAG,EAAE,GAAG,EAAE,UAAU,EAAE,QAAQ,KAAK,IAAI,CAAC,MAAM,GAAG,CAAC,GAAI,CAClE,CAAC,CACO;QACV,OAAO,IAAI,CACV,oBAAC,KAAK,CAAC,EAAE,IAAC,SAAS,EAAE,GAAG,CAAC,SAAS,IAC/B,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,CAAC,CACzB,oBAAC,SAAS,IACR,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,QAAQ,KAAK,IAAI,CAAC,MAAM,GAAG,CAAC,EACxC,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,IAAI,GACV,CACH,CAAC,CACO,CACZ,CACW,CACf,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/* columns */
|
|
2
|
+
.root .metricName {
|
|
3
|
+
width: 55%;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.root .job {
|
|
7
|
+
text-align: right;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.root .value {
|
|
11
|
+
text-align: right;
|
|
12
|
+
vertical-align: baseline;
|
|
13
|
+
width: 15%;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.root .delta {
|
|
17
|
+
text-align: right;
|
|
18
|
+
font-size: var(--size-xsmall);
|
|
19
|
+
vertical-align: baseline;
|
|
20
|
+
width: 10%;
|
|
21
|
+
color: pink;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.root .deltaPercentage {
|
|
25
|
+
width: 5%;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.jobName {
|
|
29
|
+
white-space: nowrap;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* columns overrides for showHeaderSum */
|
|
33
|
+
.showHeaderSum .headerRow .job {
|
|
34
|
+
border-bottom: 0;
|
|
35
|
+
padding-bottom: 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.showHeaderSum .headerRow .sum {
|
|
39
|
+
padding-top: var(--space-xxxsmall);
|
|
40
|
+
font-size: var(--size-small);
|
|
41
|
+
vertical-align: middle;
|
|
42
|
+
text-transform: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
@@ -11,7 +11,7 @@ import css from './metrics-table-title.module.css';
|
|
|
11
11
|
export const MetricsTableTitle = (props) => {
|
|
12
12
|
const { className, title, info, popoverInfo, popoverHref } = props;
|
|
13
13
|
const rootClassName = cx(css.root, className);
|
|
14
|
-
return (React.createElement(Stack, { space: "
|
|
14
|
+
return (React.createElement(Stack, { space: "xxxsmall", className: rootClassName },
|
|
15
15
|
React.createElement(FlexStack, { space: "xxxsmall", alignItems: "center", as: "h3", className: css.title },
|
|
16
16
|
React.createElement("span", null, title),
|
|
17
17
|
(popoverInfo || popoverHref) && (React.createElement(HoverCard, { label: React.createElement(Icon, { glyph: Icon.ICONS.HELP, className: css.anchorIcon }), anchorClassName: css.anchor },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metrics-table-title.js","sourceRoot":"","sources":["../../../src/components/metrics-table-title/metrics-table-title.jsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,GAAG,MAAM,kCAAkC,CAAC;AAEnD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAE,EAAE;IACzC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IACnE,MAAM,aAAa,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAE9C,OAAO,CACL,oBAAC,KAAK,IAAC,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"metrics-table-title.js","sourceRoot":"","sources":["../../../src/components/metrics-table-title/metrics-table-title.jsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,GAAG,MAAM,kCAAkC,CAAC;AAEnD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAE,EAAE;IACzC,MAAM,EAAE,SAAS,EAAE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,CAAC,MAAM;CAC9B,CAAC;AAEF,iBAAiB,CAAC,YAAY,GAAG;IAC/B,SAAS,EAAE,EAAE;IACb,IAAI,EAAE,IAAI;IACV,WAAW,EAAE,EAAE;IACf,WAAW,EAAE,EAAE;CAChB,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
.root {
|
|
2
|
+
color: var(--color-text-ultra-light);
|
|
2
3
|
}
|
|
3
4
|
|
|
4
5
|
.title {
|
|
5
|
-
color:
|
|
6
|
+
color: inherit;
|
|
6
7
|
font-size: 1em;
|
|
7
8
|
font-weight: bold;
|
|
8
9
|
text-transform: uppercase;
|
|
@@ -18,8 +19,6 @@
|
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
.info {
|
|
21
|
-
color: var(--color-text-light);
|
|
22
22
|
font-family: var(--font-family-fixed);
|
|
23
|
-
font-
|
|
24
|
-
font-weight: bold;
|
|
23
|
+
font-weight: normal;
|
|
25
24
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bundle-stats/ui",
|
|
3
|
-
"version": "4.13.0-beta.
|
|
3
|
+
"version": "4.13.0-beta.7",
|
|
4
4
|
"description": "UI components for BundleStats projects.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-esm/index.js",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@storybook/react": "7.6.17",
|
|
44
44
|
"@storybook/react-webpack5": "7.6.17",
|
|
45
45
|
"@types/d3": "7.4.3",
|
|
46
|
-
"@types/react": "18.2.
|
|
46
|
+
"@types/react": "18.2.73",
|
|
47
47
|
"@types/react-router-dom": "5.3.3",
|
|
48
48
|
"babel-plugin-require-context-hook": "1.0.0",
|
|
49
49
|
"classnames": "2.5.1",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"hex-rgb": "5.0.0",
|
|
53
53
|
"identity-obj-proxy": "3.0.0",
|
|
54
54
|
"jest": "29.7.0",
|
|
55
|
-
"jest-date-mock": "1.0.
|
|
55
|
+
"jest-date-mock": "1.0.9",
|
|
56
56
|
"jest-environment-jsdom": "29.7.0",
|
|
57
57
|
"lodash": "4.17.21",
|
|
58
58
|
"prop-types": "15.8.1",
|
|
@@ -73,12 +73,12 @@
|
|
|
73
73
|
"react-router-dom": "^5.0.0"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@bundle-stats/utils": "4.13.0-beta.
|
|
76
|
+
"@bundle-stats/utils": "4.13.0-beta.7",
|
|
77
77
|
"ariakit": "2.0.0-next.44",
|
|
78
78
|
"d3": "^7.8.5",
|
|
79
79
|
"modern-css-reset": "1.4.0",
|
|
80
80
|
"react-use": "^17.5.0",
|
|
81
81
|
"use-query-params": "2.2.1"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "2e8127f2ba058719049ddd7323a5eb430fb4b5dd"
|
|
84
84
|
}
|
|
@@ -21,6 +21,7 @@ import { InputSearch } from '../../ui/input-search';
|
|
|
21
21
|
import { FileName } from '../../ui/file-name';
|
|
22
22
|
import { HoverCard } from '../../ui/hover-card';
|
|
23
23
|
import { Tag } from '../../ui/tag';
|
|
24
|
+
import { Table } from '../../ui/table';
|
|
24
25
|
import { Filters } from '../../ui/filters';
|
|
25
26
|
import { EmptySet } from '../../ui/empty-set';
|
|
26
27
|
import { Toolbar } from '../../ui/toolbar';
|
|
@@ -30,9 +31,10 @@ import { ComponentLink } from '../component-link';
|
|
|
30
31
|
import { MetricsTable } from '../metrics-table';
|
|
31
32
|
import { MetricsTableOptions } from '../metrics-table-options';
|
|
32
33
|
import { MetricsTableTitle } from '../metrics-table-title';
|
|
33
|
-
import { SEARCH_PLACEHOLDER } from './bundle-assets.i18n';
|
|
34
34
|
import { MetricsDisplaySelector } from '../metrics-display-selector';
|
|
35
|
+
import { MetricsTableHeader } from '../metrics-table-header';
|
|
35
36
|
import { MetricsTreemap } from '../metrics-treemap';
|
|
37
|
+
import { SEARCH_PLACEHOLDER } from './bundle-assets.i18n';
|
|
36
38
|
import css from './bundle-assets.module.css';
|
|
37
39
|
|
|
38
40
|
const RUN_TITLE_CURRENT = 'Current';
|
|
@@ -272,7 +274,21 @@ export const BundleAssets = (props) => {
|
|
|
272
274
|
/>
|
|
273
275
|
)}
|
|
274
276
|
{displayType === MetricsDisplayType.TREEMAP && (
|
|
275
|
-
|
|
277
|
+
<>
|
|
278
|
+
<Table compact>
|
|
279
|
+
<MetricsTableHeader
|
|
280
|
+
metricTitle={metricsTableTitle}
|
|
281
|
+
showSum
|
|
282
|
+
jobs={jobs}
|
|
283
|
+
rows={items}
|
|
284
|
+
/>
|
|
285
|
+
</Table>
|
|
286
|
+
<MetricsTreemap
|
|
287
|
+
emptyMessage={emptyMessage}
|
|
288
|
+
items={items}
|
|
289
|
+
onItemClick={showEntryInfo}
|
|
290
|
+
/>
|
|
291
|
+
</>
|
|
276
292
|
)}
|
|
277
293
|
</main>
|
|
278
294
|
</section>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useCallback } from 'react';
|
|
1
|
+
import React, { useCallback, useMemo } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { useHistory } from 'react-router-dom';
|
|
4
4
|
import {
|
|
@@ -7,13 +7,17 @@ import {
|
|
|
7
7
|
} from '@bundle-stats/utils';
|
|
8
8
|
import * as webpack from '@bundle-stats/utils/lib-esm/webpack';
|
|
9
9
|
|
|
10
|
+
import config from '../../config.json';
|
|
10
11
|
import { ASSETS_SIZES_FILE_TYPE_MAP, SECTION_URLS, MetricsDisplayType } from '../../constants';
|
|
11
12
|
import { useMetricsDisplayType } from '../../hooks/metrics-display-type';
|
|
13
|
+
import I18N from '../../i18n';
|
|
12
14
|
import { Toolbar } from '../../ui/toolbar';
|
|
13
|
-
import {
|
|
15
|
+
import { Table } from '../../ui/table';
|
|
14
16
|
import { MetricsDisplaySelector } from '../metrics-display-selector';
|
|
15
|
-
import { TotalSizeTypeTitle } from '../total-size-type-title';
|
|
16
17
|
import { MetricsTable } from '../metrics-table';
|
|
18
|
+
import { MetricsTableTitle } from '../metrics-table-title';
|
|
19
|
+
import { MetricsTableHeader } from '../metrics-table-header';
|
|
20
|
+
import { MetricsTreemap } from '../metrics-treemap';
|
|
17
21
|
import { ComponentLink } from '../component-link';
|
|
18
22
|
import css from './bundle-assets-totals.module.css';
|
|
19
23
|
|
|
@@ -52,6 +56,17 @@ export const BundleAssetsTotals = ({
|
|
|
52
56
|
[history],
|
|
53
57
|
);
|
|
54
58
|
|
|
59
|
+
const metricsTableTitle = useMemo(
|
|
60
|
+
() => (
|
|
61
|
+
<MetricsTableTitle
|
|
62
|
+
title={I18N.ASSET_TOTALS}
|
|
63
|
+
popoverInfo={I18N.ASSET_TOTALS_INFO}
|
|
64
|
+
popoverHref={config.documentation.assets}
|
|
65
|
+
/>
|
|
66
|
+
),
|
|
67
|
+
[],
|
|
68
|
+
);
|
|
69
|
+
|
|
55
70
|
return (
|
|
56
71
|
<div className={className}>
|
|
57
72
|
<Toolbar
|
|
@@ -59,11 +74,10 @@ export const BundleAssetsTotals = ({
|
|
|
59
74
|
renderActions={() => (
|
|
60
75
|
<MetricsDisplaySelector onSelect={setDisplayType} value={displayType} />
|
|
61
76
|
)}
|
|
62
|
-
|
|
63
|
-
<TotalSizeTypeTitle />
|
|
64
|
-
</Toolbar>
|
|
77
|
+
/>
|
|
65
78
|
{displayType === MetricsDisplayType.TABLE && (
|
|
66
79
|
<MetricsTable
|
|
80
|
+
title={metricsTableTitle}
|
|
67
81
|
runs={jobs}
|
|
68
82
|
items={items}
|
|
69
83
|
renderRowHeader={renderRowHeader}
|
|
@@ -72,10 +86,15 @@ export const BundleAssetsTotals = ({
|
|
|
72
86
|
/>
|
|
73
87
|
)}
|
|
74
88
|
{displayType === MetricsDisplayType.TREEMAP && (
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
89
|
+
<>
|
|
90
|
+
<Table compact>
|
|
91
|
+
<MetricsTableHeader metricTitle={metricsTableTitle} showSum jobs={jobs} rows={items} />
|
|
92
|
+
</Table>
|
|
93
|
+
<MetricsTreemap
|
|
94
|
+
items={items}
|
|
95
|
+
onItemClick={onTreemapItemClick || handleMetricsTreemapItemClick}
|
|
96
|
+
/>
|
|
97
|
+
</>
|
|
79
98
|
)}
|
|
80
99
|
</div>
|
|
81
100
|
);
|
|
@@ -14,10 +14,12 @@ import { FileName } from '../../ui/file-name';
|
|
|
14
14
|
import { Filters } from '../../ui/filters';
|
|
15
15
|
import { InputSearch } from '../../ui/input-search';
|
|
16
16
|
import { Tag } from '../../ui/tag';
|
|
17
|
+
import { Table } from '../../ui/table';
|
|
17
18
|
import { Toolbar } from '../../ui/toolbar';
|
|
18
19
|
import { Tooltip } from '../../ui/tooltip';
|
|
19
20
|
import { ComponentLink } from '../component-link';
|
|
20
21
|
import { MetricsTable } from '../metrics-table';
|
|
22
|
+
import { MetricsTableHeader } from '../metrics-table-header';
|
|
21
23
|
import { MetricsTreemap } from '../metrics-treemap';
|
|
22
24
|
import { MetricsTableOptions } from '../metrics-table-options';
|
|
23
25
|
import { MetricsDisplaySelector } from '../metrics-display-selector';
|
|
@@ -230,7 +232,17 @@ export const BundleModules = (props: BundleModulesProps) => {
|
|
|
230
232
|
/>
|
|
231
233
|
)}
|
|
232
234
|
{displayType === MetricsDisplayType.TREEMAP && (
|
|
233
|
-
|
|
235
|
+
<>
|
|
236
|
+
<Table compact>
|
|
237
|
+
<MetricsTableHeader
|
|
238
|
+
metricTitle={metricsTableTitle}
|
|
239
|
+
showSum
|
|
240
|
+
jobs={jobs}
|
|
241
|
+
rows={items}
|
|
242
|
+
/>
|
|
243
|
+
</Table>
|
|
244
|
+
<MetricsTreemap emptyMessage={emptyMessage} items={items} onItemClick={showEntryInfo} />
|
|
245
|
+
</>
|
|
234
246
|
)}
|
|
235
247
|
</div>
|
|
236
248
|
{entryItem && (
|
|
@@ -10,9 +10,11 @@ import { InputSearch } from '../../ui/input-search';
|
|
|
10
10
|
import { EmptySet } from '../../ui/empty-set';
|
|
11
11
|
import { Filters } from '../../ui/filters';
|
|
12
12
|
import { Tag } from '../../ui/tag';
|
|
13
|
+
import { Table } from '../../ui/table';
|
|
13
14
|
import { Toolbar } from '../../ui/toolbar';
|
|
14
15
|
import { ComponentLink } from '../component-link';
|
|
15
16
|
import { MetricsTable } from '../metrics-table';
|
|
17
|
+
import { MetricsTableHeader } from '../metrics-table-header';
|
|
16
18
|
import { MetricsTableOptions } from '../metrics-table-options';
|
|
17
19
|
import { MetricsTableTitle } from '../metrics-table-title';
|
|
18
20
|
import { PackageInfo } from '../package-info';
|
|
@@ -231,7 +233,17 @@ export const BundlePackages = (props) => {
|
|
|
231
233
|
/>
|
|
232
234
|
)}
|
|
233
235
|
{displayType === MetricsDisplayType.TREEMAP && (
|
|
234
|
-
|
|
236
|
+
<>
|
|
237
|
+
<Table compact>
|
|
238
|
+
<MetricsTableHeader
|
|
239
|
+
metricTitle={metricsTableTitle}
|
|
240
|
+
showSum
|
|
241
|
+
jobs={jobs}
|
|
242
|
+
rows={items}
|
|
243
|
+
/>
|
|
244
|
+
</Table>
|
|
245
|
+
<MetricsTreemap emptyMessage={emptyMessage} items={items} onItemClick={showEntryInfo} />
|
|
246
|
+
</>
|
|
235
247
|
)}
|
|
236
248
|
</main>
|
|
237
249
|
</section>
|
package/src/components/index.js
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
export const BASELINE_TITLE = 'Baseline';
|
|
2
|
-
export const CURRENT_TITLE = 'Current';
|
|
3
|
-
|
|
4
|
-
export const SORT_VALUE = 'value';
|
|
5
|
-
export const SORT_CHANGE = 'change';
|
|
6
|
-
export const SORT_PERCENTUAL_CHANGE = 'percentual change';
|
|
7
|
-
|
|
8
1
|
export const EMPTY_MESSAGE = 'No items found.';
|
|
9
2
|
export const SHOW_ALL = 'Show all';
|
|
10
3
|
export const SHOW_LESS = 'Show less';
|
|
@@ -10,52 +10,9 @@
|
|
|
10
10
|
text-decoration: underline;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
.metricName {
|
|
15
|
-
width: 55%;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.root .jobCol {
|
|
19
|
-
text-align: right;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.root .value {
|
|
23
|
-
text-align: right;
|
|
24
|
-
vertical-align: baseline;
|
|
25
|
-
width: 15%;
|
|
26
|
-
}
|
|
27
|
-
|
|
13
|
+
.root .value,
|
|
28
14
|
.root .delta {
|
|
29
15
|
text-align: right;
|
|
30
|
-
font-size: var(--size-xsmall);
|
|
31
|
-
vertical-align: baseline;
|
|
32
|
-
width: 10%;
|
|
33
|
-
color: pink;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.root .deltaPercentage {
|
|
37
|
-
width: 5%;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.root tbody .delta {
|
|
41
|
-
line-height: 1.6rem; /* baseline alignment with the column value */
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.jobName {
|
|
45
|
-
white-space: nowrap;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/* columns overrides for showHeaderSum */
|
|
49
|
-
.showHeaderSum .headerRow .jobCol {
|
|
50
|
-
border-bottom: 0;
|
|
51
|
-
padding-bottom: 0;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.showHeaderSum .headerRow .sum {
|
|
55
|
-
padding-top: var(--space-xxxsmall);
|
|
56
|
-
font-size: var(--size-small);
|
|
57
|
-
vertical-align: middle;
|
|
58
|
-
text-transform: none;
|
|
59
16
|
}
|
|
60
17
|
|
|
61
18
|
/** rows */
|