@harpercollins/harpercollins-design-system 1.35.2 → 1.36.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/dist/cjs/components/data-display/DataGrid/DataGrid.cjs +1 -1
- package/dist/cjs/components/data-display/DataGrid/ManageColumnsDropdown.cjs +1 -0
- package/dist/cjs/components/data-display/DataGrid/TableToolbar.cjs +3 -3
- package/dist/cjs/components/data-display/DataGrid/hooks/useDataGrid.cjs +1 -1
- package/dist/cjs/components/data-display/Table/TableBody.cjs +1 -1
- package/dist/cjs/components/data-display/Table/TableLayout.cjs +1 -1
- package/dist/cjs/components/global/Layout/Layout.cjs +3 -3
- package/dist/cjs/components/global/Sidebar/Sidebar.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/node_modules/.pnpm/@fortawesome_free-solid-svg-icons@6.7.2/node_modules/@fortawesome/free-solid-svg-icons/index.cjs +1 -1
- package/dist/esm/components/data-display/DataGrid/DataGrid.js +25 -24
- package/dist/esm/components/data-display/DataGrid/ManageColumnsDropdown.js +121 -0
- package/dist/esm/components/data-display/DataGrid/TableToolbar.js +25 -12
- package/dist/esm/components/data-display/DataGrid/hooks/useDataGrid.js +141 -120
- package/dist/esm/components/data-display/Table/TableBody.js +53 -47
- package/dist/esm/components/data-display/Table/TableLayout.js +46 -45
- package/dist/esm/components/global/Layout/Layout.js +28 -26
- package/dist/esm/components/global/Sidebar/Sidebar.js +1 -3
- package/dist/esm/index.js +192 -190
- package/dist/esm/node_modules/.pnpm/@fortawesome_free-solid-svg-icons@6.7.2/node_modules/@fortawesome/free-solid-svg-icons/index.js +38 -27
- package/dist/esm/node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Divider/dividerClasses.js +3 -3
- package/dist/index.d.ts +35 -1
- package/package.json +1 -1
|
@@ -1,94 +1,95 @@
|
|
|
1
|
-
import { jsxs as u, Fragment as
|
|
2
|
-
import { flexRender as
|
|
1
|
+
import { jsxs as u, Fragment as C, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { flexRender as I } from "../../../node_modules/.pnpm/@tanstack_react-table@8.21.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@tanstack/react-table/build/lib/index.js";
|
|
3
3
|
import c from "react";
|
|
4
|
-
import
|
|
5
|
-
import { TableWrapper as
|
|
4
|
+
import G from "./StickyHorizontalScrollbar.js";
|
|
5
|
+
import { TableWrapper as M, getTableStyles as W } from "./Table.styles.js";
|
|
6
6
|
import { TableBody as j } from "./TableBody.js";
|
|
7
7
|
import E from "./TableHeader.js";
|
|
8
|
-
import { useStickyHeader as
|
|
9
|
-
import { useStickyScrollbar as
|
|
8
|
+
import { useStickyHeader as L } from "./hooks/useStickyHeader.js";
|
|
9
|
+
import { useStickyScrollbar as _ } from "./hooks/useStickyScrollbar.js";
|
|
10
10
|
import D from "../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Table/Table.js";
|
|
11
11
|
function Y({
|
|
12
|
-
ctx:
|
|
13
|
-
maxHeight:
|
|
14
|
-
wrapText:
|
|
12
|
+
ctx: f,
|
|
13
|
+
maxHeight: m = !1,
|
|
14
|
+
wrapText: p = !1,
|
|
15
15
|
rowRender: g,
|
|
16
16
|
showStickyScrollbar: S = !1,
|
|
17
|
-
enableStickyHeader:
|
|
18
|
-
stickyHeaderOffset:
|
|
17
|
+
enableStickyHeader: b = !1,
|
|
18
|
+
stickyHeaderOffset: h = 0,
|
|
19
19
|
footer: z
|
|
20
20
|
}) {
|
|
21
21
|
const {
|
|
22
|
-
id:
|
|
22
|
+
id: i,
|
|
23
23
|
table: e,
|
|
24
24
|
rows: T,
|
|
25
|
-
isVirtual:
|
|
26
|
-
virtualItems:
|
|
27
|
-
paddingTop:
|
|
28
|
-
paddingBottom:
|
|
25
|
+
isVirtual: l,
|
|
26
|
+
virtualItems: y,
|
|
27
|
+
paddingTop: R,
|
|
28
|
+
paddingBottom: v,
|
|
29
29
|
measureElement: w,
|
|
30
30
|
wrapperRef: n,
|
|
31
31
|
toolbarRef: x,
|
|
32
32
|
loading: H,
|
|
33
|
-
fetchMoreOnBottomReached:
|
|
34
|
-
} =
|
|
35
|
-
enabled:
|
|
36
|
-
stickyHeaderOffset:
|
|
33
|
+
fetchMoreOnBottomReached: V
|
|
34
|
+
} = f, d = c.useRef(null), k = _(n), F = L({
|
|
35
|
+
enabled: b,
|
|
36
|
+
stickyHeaderOffset: h,
|
|
37
37
|
tableWrapperRef: n,
|
|
38
|
-
theadRef:
|
|
38
|
+
theadRef: d,
|
|
39
39
|
toolbarRef: x
|
|
40
|
-
}),
|
|
40
|
+
}), $ = c.useMemo(() => {
|
|
41
41
|
const o = e.getFlatHeaders(), t = {};
|
|
42
|
-
for (let
|
|
43
|
-
const s = o[
|
|
44
|
-
t[`--${
|
|
42
|
+
for (let a = 0; a < o.length; a += 1) {
|
|
43
|
+
const s = o[a];
|
|
44
|
+
t[`--${i}-header-${s.id}-size`] = s.getSize(), t[`--${i}-col-${s.column.id}-size`] = s.column.getSize();
|
|
45
45
|
}
|
|
46
46
|
return t;
|
|
47
|
-
}, [
|
|
48
|
-
return /* @__PURE__ */ u(
|
|
47
|
+
}, [i, e.getState().columnSizingInfo, e.getState().columnSizing]), B = c.useMemo(() => e.getFlatHeaders().reduce((t, a) => t + a.getSize(), 0), [e.getState().columnSizingInfo, e.getState().columnSizing]);
|
|
48
|
+
return /* @__PURE__ */ u(C, { children: [
|
|
49
49
|
/* @__PURE__ */ r(
|
|
50
|
-
|
|
50
|
+
M,
|
|
51
51
|
{
|
|
52
52
|
ref: n,
|
|
53
53
|
"data-testid": "table-wrapper",
|
|
54
|
-
$maxHeight:
|
|
55
|
-
onScroll: (o) =>
|
|
54
|
+
$maxHeight: m,
|
|
55
|
+
onScroll: (o) => V(o.currentTarget),
|
|
56
56
|
children: /* @__PURE__ */ u(
|
|
57
57
|
D,
|
|
58
58
|
{
|
|
59
59
|
hoverRow: !0,
|
|
60
|
-
"data-testid":
|
|
60
|
+
"data-testid": i,
|
|
61
61
|
sx: W(
|
|
62
|
-
B,
|
|
63
|
-
C,
|
|
64
|
-
f,
|
|
65
62
|
$,
|
|
66
|
-
|
|
63
|
+
B,
|
|
64
|
+
p,
|
|
65
|
+
F,
|
|
66
|
+
m
|
|
67
67
|
),
|
|
68
68
|
children: [
|
|
69
69
|
/* @__PURE__ */ r(
|
|
70
70
|
E,
|
|
71
71
|
{
|
|
72
72
|
headerGroups: e.getHeaderGroups(),
|
|
73
|
-
id:
|
|
74
|
-
theadRef:
|
|
73
|
+
id: i,
|
|
74
|
+
theadRef: d
|
|
75
75
|
}
|
|
76
76
|
),
|
|
77
77
|
/* @__PURE__ */ r(
|
|
78
78
|
j,
|
|
79
79
|
{
|
|
80
80
|
rows: T,
|
|
81
|
-
columns: e.
|
|
81
|
+
columns: e.getVisibleLeafColumns(),
|
|
82
|
+
columnVisibility: e.getState().columnVisibility,
|
|
82
83
|
rowRender: g,
|
|
83
84
|
loading: H,
|
|
84
85
|
rowSelectionState: e.getState().rowSelection,
|
|
85
|
-
virtualItems:
|
|
86
|
-
paddingTop:
|
|
87
|
-
paddingBottom:
|
|
88
|
-
measureElement:
|
|
86
|
+
virtualItems: l ? y : void 0,
|
|
87
|
+
paddingTop: l ? R : void 0,
|
|
88
|
+
paddingBottom: l ? v : void 0,
|
|
89
|
+
measureElement: l ? w : void 0
|
|
89
90
|
}
|
|
90
91
|
),
|
|
91
|
-
z && e.getFooterGroups().length > 0 && /* @__PURE__ */ r("tfoot", { children: e.getFooterGroups().map((o) => /* @__PURE__ */ r("tr", { children: o.headers.map((t) => /* @__PURE__ */ r("td", { colSpan: t.colSpan, children:
|
|
92
|
+
z && e.getFooterGroups().length > 0 && /* @__PURE__ */ r("tfoot", { children: e.getFooterGroups().map((o) => /* @__PURE__ */ r("tr", { children: o.headers.map((t) => /* @__PURE__ */ r("td", { colSpan: t.colSpan, children: I(
|
|
92
93
|
t.column.columnDef.footer,
|
|
93
94
|
t.getContext()
|
|
94
95
|
) }, t.id)) }, o.id)) })
|
|
@@ -98,10 +99,10 @@ function Y({
|
|
|
98
99
|
}
|
|
99
100
|
),
|
|
100
101
|
S && /* @__PURE__ */ r(
|
|
101
|
-
|
|
102
|
+
G,
|
|
102
103
|
{
|
|
103
104
|
scrollContainerRef: n,
|
|
104
|
-
visible:
|
|
105
|
+
visible: k,
|
|
105
106
|
constrainToContainer: "main"
|
|
106
107
|
}
|
|
107
108
|
)
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { useLocalStorage as
|
|
1
|
+
import { jsx as o, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import i from "styled-components";
|
|
3
|
+
import { useLocalStorage as h } from "../../../hooks/useLocalStorage.js";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
const
|
|
5
|
+
import u from "../Footer/Footer.js";
|
|
6
|
+
import b from "../Sidebar/Sidebar.js";
|
|
7
|
+
import y from "../ThemeProvider/ThemeProvider.js";
|
|
8
|
+
import S from "../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Box/Box.js";
|
|
9
|
+
import k from "../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Sheet/Sheet.js";
|
|
10
|
+
const v = i.div`
|
|
11
11
|
display: flex;
|
|
12
12
|
flex-direction: column;
|
|
13
13
|
height: 100vh;
|
|
14
14
|
width: 100%;
|
|
15
|
-
`,
|
|
15
|
+
`, L = i.a`
|
|
16
16
|
position: absolute;
|
|
17
17
|
top: -100%;
|
|
18
18
|
left: 0;
|
|
@@ -28,7 +28,7 @@ const k = n.div`
|
|
|
28
28
|
top: 0;
|
|
29
29
|
}
|
|
30
30
|
`;
|
|
31
|
-
function
|
|
31
|
+
function I({
|
|
32
32
|
children: a,
|
|
33
33
|
header: l,
|
|
34
34
|
theme: m = "light_internal",
|
|
@@ -37,32 +37,34 @@ function F({
|
|
|
37
37
|
sidebarWidth: r = 240,
|
|
38
38
|
collapsedSidebarWidth: t = 60,
|
|
39
39
|
sidebarHeaderContent: c,
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
sidebarFooterContent: f,
|
|
41
|
+
footerReleaseName: s,
|
|
42
|
+
footerCopyright: x
|
|
42
43
|
}) {
|
|
43
|
-
const [e,
|
|
44
|
+
const [e, g] = h(
|
|
44
45
|
"sidebarOpen",
|
|
45
46
|
!0
|
|
46
47
|
);
|
|
47
|
-
return /* @__PURE__ */ o(
|
|
48
|
-
/* @__PURE__ */ o(
|
|
48
|
+
return /* @__PURE__ */ o(y, { theme: m, children: /* @__PURE__ */ n(v, { children: [
|
|
49
|
+
/* @__PURE__ */ o(L, { href: "#main", children: "Skip to content" }),
|
|
49
50
|
l,
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
+
/* @__PURE__ */ n(S, { sx: { display: "flex", flex: 1 }, children: [
|
|
51
52
|
p ? /* @__PURE__ */ o(
|
|
52
|
-
|
|
53
|
+
b,
|
|
53
54
|
{
|
|
54
55
|
sidebarOpen: e,
|
|
55
56
|
onSidebarToggle: () => {
|
|
56
|
-
|
|
57
|
+
g(!e);
|
|
57
58
|
},
|
|
58
59
|
sidebarContent: d,
|
|
59
60
|
sidebarWidth: r,
|
|
60
61
|
collapsedSidebarWidth: t,
|
|
61
|
-
headerContent: c
|
|
62
|
+
headerContent: c,
|
|
63
|
+
footerContent: f
|
|
62
64
|
}
|
|
63
65
|
) : null,
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
-
|
|
66
|
+
/* @__PURE__ */ n(
|
|
67
|
+
k,
|
|
66
68
|
{
|
|
67
69
|
component: "main",
|
|
68
70
|
id: "main",
|
|
@@ -83,10 +85,10 @@ function F({
|
|
|
83
85
|
children: [
|
|
84
86
|
a,
|
|
85
87
|
/* @__PURE__ */ o(
|
|
86
|
-
|
|
88
|
+
u,
|
|
87
89
|
{
|
|
88
|
-
releaseName:
|
|
89
|
-
copyright:
|
|
90
|
+
releaseName: s,
|
|
91
|
+
copyright: x
|
|
90
92
|
}
|
|
91
93
|
)
|
|
92
94
|
]
|
|
@@ -96,5 +98,5 @@ function F({
|
|
|
96
98
|
] }) });
|
|
97
99
|
}
|
|
98
100
|
export {
|
|
99
|
-
|
|
101
|
+
I as default
|
|
100
102
|
};
|