@harpercollins/harpercollins-design-system 1.33.0 → 1.34.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/Table/Table.cjs +1 -1
- package/dist/cjs/components/data-display/Table/Table.styles.cjs +2 -2
- package/dist/cjs/components/data-display/Table/TableHeader.cjs +1 -0
- package/dist/cjs/components/data-display/Table/TableToolbar.cjs +1 -1
- package/dist/cjs/components/data-display/Table/tableUrlUtils.cjs +1 -0
- package/dist/cjs/hooks/useServerSideTableState.cjs +1 -0
- package/dist/cjs/index.cjs +1 -1
- package/dist/esm/components/data-display/Table/Table.js +225 -276
- package/dist/esm/components/data-display/Table/Table.styles.js +4 -5
- package/dist/esm/components/data-display/Table/TableHeader.js +92 -0
- package/dist/esm/components/data-display/Table/TableToolbar.js +10 -8
- package/dist/esm/components/data-display/Table/tableUrlUtils.js +108 -0
- package/dist/esm/hooks/useServerSideTableState.js +47 -0
- package/dist/esm/index.js +93 -89
- package/dist/index.d.ts +125 -1
- package/package.json +1 -1
|
@@ -1,329 +1,278 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return /* @__PURE__ */ o(
|
|
26
|
-
E,
|
|
1
|
+
import { jsxs as h, Fragment as Se, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useReactTable as he, flexRender as pe } 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
|
+
import r from "react";
|
|
4
|
+
import { useLocalStorage as Re } from "../../../hooks/useLocalStorage.js";
|
|
5
|
+
import Ce from "../../feedback/Alert/Alert.js";
|
|
6
|
+
import L from "../../feedback/CircularProgress/CircularProgress.js";
|
|
7
|
+
import j from "../../inputs/Checkbox/Checkbox.js";
|
|
8
|
+
import we from "../Typography/Typography.js";
|
|
9
|
+
import Fe from "./StickyHorizontalScrollbar.js";
|
|
10
|
+
import { LoadingOverlay as ze, TableWrapper as xe, getTableStyles as ye } from "./Table.styles.js";
|
|
11
|
+
import { TableBody as Me } from "./TableBody.js";
|
|
12
|
+
import be from "./TableHeader.js";
|
|
13
|
+
import ve from "./TableToolbar.js";
|
|
14
|
+
import { multiSelectFilter as ke, selectFilter as He, dateFilter as Ee, numericFilter as Ie, textFilter as Be } from "./filters/filterFunctions.js";
|
|
15
|
+
import { useInfiniteScroll as Ne } from "./hooks/useInfiniteScroll.js";
|
|
16
|
+
import { useStickyHeader as Te } from "./hooks/useStickyHeader.js";
|
|
17
|
+
import { useStickyScrollbar as $e } from "./hooks/useStickyScrollbar.js";
|
|
18
|
+
import { extractColumnFilterTypes as P, parseSortingFromUrl as Ae, parseFiltersFromUrl as Le, syncStateToUrl as Pe } from "./tableUrlUtils.js";
|
|
19
|
+
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/Box/Box.js";
|
|
20
|
+
import De 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";
|
|
21
|
+
import { getFilteredRowModel as je, getSortedRowModel as Ge, getCoreRowModel as Ve } from "../../../node_modules/.pnpm/@tanstack_table-core@8.21.3/node_modules/@tanstack/table-core/build/lib/index.js";
|
|
22
|
+
function We({ table: s }) {
|
|
23
|
+
return /* @__PURE__ */ i(
|
|
24
|
+
j,
|
|
27
25
|
{
|
|
28
|
-
checked:
|
|
29
|
-
indeterminate:
|
|
30
|
-
onChange: (
|
|
26
|
+
checked: s.getIsAllRowsSelected(),
|
|
27
|
+
indeterminate: s.getIsSomeRowsSelected(),
|
|
28
|
+
onChange: (a) => s.toggleAllRowsSelected(a.target.checked),
|
|
31
29
|
size: "md"
|
|
32
30
|
}
|
|
33
31
|
);
|
|
34
32
|
}
|
|
35
|
-
function
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
-
|
|
33
|
+
function _e({ row: s }) {
|
|
34
|
+
return /* @__PURE__ */ i(
|
|
35
|
+
j,
|
|
38
36
|
{
|
|
39
|
-
checked:
|
|
40
|
-
disabled: !
|
|
41
|
-
onChange: (
|
|
37
|
+
checked: s.getIsSelected(),
|
|
38
|
+
disabled: !s.getCanSelect(),
|
|
39
|
+
onChange: (a) => s.toggleSelected(a.target.checked),
|
|
42
40
|
size: "md"
|
|
43
41
|
}
|
|
44
42
|
);
|
|
45
43
|
}
|
|
46
|
-
function
|
|
47
|
-
id:
|
|
48
|
-
loading:
|
|
49
|
-
maxHeight:
|
|
50
|
-
wrapText:
|
|
51
|
-
rowRender:
|
|
52
|
-
reactTableOptions:
|
|
53
|
-
gridCheckboxes:
|
|
54
|
-
allSelected:
|
|
55
|
-
onSelectionChange:
|
|
56
|
-
showStickyScrollbar:
|
|
57
|
-
enableStickyHeader:
|
|
58
|
-
stickyHeaderOffset:
|
|
59
|
-
infiniteScroll:
|
|
60
|
-
toolbar:
|
|
61
|
-
footer:
|
|
62
|
-
isError:
|
|
63
|
-
errorMessage:
|
|
44
|
+
function dt({
|
|
45
|
+
id: s,
|
|
46
|
+
loading: a = !1,
|
|
47
|
+
maxHeight: w = !1,
|
|
48
|
+
wrapText: G = !1,
|
|
49
|
+
rowRender: V,
|
|
50
|
+
reactTableOptions: o,
|
|
51
|
+
gridCheckboxes: p = !1,
|
|
52
|
+
allSelected: F = !1,
|
|
53
|
+
onSelectionChange: z,
|
|
54
|
+
showStickyScrollbar: W = !1,
|
|
55
|
+
enableStickyHeader: _ = !1,
|
|
56
|
+
stickyHeaderOffset: U = 0,
|
|
57
|
+
infiniteScroll: c,
|
|
58
|
+
toolbar: x,
|
|
59
|
+
footer: q,
|
|
60
|
+
isError: J = !1,
|
|
61
|
+
errorMessage: K = "An error occurred while loading data. Please try again.",
|
|
62
|
+
syncUrl: f = !1,
|
|
63
|
+
urlParamPrefix: S = ""
|
|
64
64
|
}) {
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
), [
|
|
68
|
-
|
|
65
|
+
const { columns: m } = o, Q = r.useRef(
|
|
66
|
+
P(m)
|
|
67
|
+
), [y, X] = r.useState(() => {
|
|
68
|
+
if (f && typeof window < "u") {
|
|
69
|
+
const e = new URLSearchParams(window.location.search);
|
|
70
|
+
return Ae(e, S);
|
|
71
|
+
}
|
|
72
|
+
return [];
|
|
73
|
+
}), [M, Y] = r.useState(
|
|
74
|
+
() => {
|
|
75
|
+
if (f && typeof window < "u") {
|
|
76
|
+
const e = new URLSearchParams(window.location.search);
|
|
77
|
+
return Le(
|
|
78
|
+
e,
|
|
79
|
+
S,
|
|
80
|
+
Q.current
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
return [];
|
|
84
|
+
}
|
|
85
|
+
), [Z, O] = Re(
|
|
86
|
+
`table.${s}.columnSizing`,
|
|
69
87
|
{}
|
|
70
|
-
), [
|
|
71
|
-
(
|
|
72
|
-
|
|
73
|
-
const n = typeof
|
|
74
|
-
return
|
|
88
|
+
), [ee, te] = r.useState({}), oe = r.useCallback(
|
|
89
|
+
(e) => {
|
|
90
|
+
te((t) => {
|
|
91
|
+
const n = typeof e == "function" ? e(t) : e;
|
|
92
|
+
return z?.(n), n;
|
|
75
93
|
});
|
|
76
94
|
},
|
|
77
|
-
[
|
|
78
|
-
),
|
|
79
|
-
|
|
80
|
-
!
|
|
81
|
-
}, [
|
|
82
|
-
const d =
|
|
83
|
-
enabled:
|
|
84
|
-
stickyHeaderOffset:
|
|
95
|
+
[z]
|
|
96
|
+
), b = r.useRef(null), R = r.useRef(o.data), ne = a && R.current.length > 0 ? R.current : o.data;
|
|
97
|
+
r.useEffect(() => {
|
|
98
|
+
!a && o.data.length > 0 && (R.current = o.data);
|
|
99
|
+
}, [a, o.data]);
|
|
100
|
+
const d = r.useRef(null), v = r.useRef(null), k = r.useRef(null), re = $e(d), le = Te({
|
|
101
|
+
enabled: _,
|
|
102
|
+
stickyHeaderOffset: U,
|
|
85
103
|
tableWrapperRef: d,
|
|
86
|
-
theadRef:
|
|
87
|
-
toolbarRef:
|
|
88
|
-
}),
|
|
89
|
-
const
|
|
90
|
-
return
|
|
91
|
-
n.meta?.pinned === "left" && n.id ?
|
|
92
|
-
}), { left:
|
|
93
|
-
}, [
|
|
94
|
-
let
|
|
95
|
-
return
|
|
96
|
-
const n =
|
|
97
|
-
return n && !
|
|
98
|
-
...
|
|
104
|
+
theadRef: v,
|
|
105
|
+
toolbarRef: k
|
|
106
|
+
}), ie = r.useMemo(() => {
|
|
107
|
+
const e = [], t = [];
|
|
108
|
+
return m.forEach((n) => {
|
|
109
|
+
n.meta?.pinned === "left" && n.id ? e.push(n.id) : n.meta?.pinned === "right" && n.id && t.push(n.id);
|
|
110
|
+
}), { left: e, right: t };
|
|
111
|
+
}, [m]), se = r.useMemo(() => {
|
|
112
|
+
let e = [...m];
|
|
113
|
+
return e = e.map((t) => {
|
|
114
|
+
const n = t.meta?.filterType;
|
|
115
|
+
return n && !t.filterFn ? {
|
|
116
|
+
...t,
|
|
99
117
|
filterFn: {
|
|
100
|
-
text:
|
|
101
|
-
number:
|
|
102
|
-
date:
|
|
103
|
-
select:
|
|
104
|
-
multiselect:
|
|
118
|
+
text: Be,
|
|
119
|
+
number: Ie,
|
|
120
|
+
date: Ee,
|
|
121
|
+
select: He,
|
|
122
|
+
multiselect: ke
|
|
105
123
|
}[n]
|
|
106
|
-
} :
|
|
107
|
-
}),
|
|
124
|
+
} : t;
|
|
125
|
+
}), p && (e = [{
|
|
108
126
|
id: "select",
|
|
109
127
|
size: 26,
|
|
110
128
|
enableSorting: !1,
|
|
111
129
|
enableResizing: !1,
|
|
112
130
|
meta: { noSortButton: !0 },
|
|
113
|
-
header:
|
|
114
|
-
cell:
|
|
115
|
-
}, ...
|
|
116
|
-
}, [
|
|
131
|
+
header: We,
|
|
132
|
+
cell: _e
|
|
133
|
+
}, ...e]), e;
|
|
134
|
+
}, [p, m]), l = he({
|
|
117
135
|
// Overridable defaults
|
|
118
136
|
columnResizeDirection: "ltr",
|
|
119
137
|
defaultColumn: { size: 200, minSize: 20, maxSize: 500 },
|
|
120
138
|
// Consumer customisation
|
|
121
|
-
...
|
|
139
|
+
...o,
|
|
122
140
|
// Values always controlled by this component
|
|
123
|
-
getCoreRowModel:
|
|
124
|
-
getSortedRowModel:
|
|
125
|
-
getFilteredRowModel:
|
|
126
|
-
columns:
|
|
127
|
-
data:
|
|
128
|
-
enableSorting:
|
|
129
|
-
enableColumnResizing:
|
|
130
|
-
columnResizeMode:
|
|
131
|
-
onColumnSizingChange:
|
|
132
|
-
onSortingChange:
|
|
133
|
-
onColumnFiltersChange:
|
|
134
|
-
enableRowSelection:
|
|
135
|
-
onRowSelectionChange:
|
|
141
|
+
getCoreRowModel: Ve(),
|
|
142
|
+
getSortedRowModel: Ge(),
|
|
143
|
+
getFilteredRowModel: je(),
|
|
144
|
+
columns: se,
|
|
145
|
+
data: ne,
|
|
146
|
+
enableSorting: o.enableSorting ?? !0,
|
|
147
|
+
enableColumnResizing: o.enableColumnResizing ?? !0,
|
|
148
|
+
columnResizeMode: o.columnResizeMode ?? "onChange",
|
|
149
|
+
onColumnSizingChange: o.onColumnSizingChange ?? O,
|
|
150
|
+
onSortingChange: o.onSortingChange ?? X,
|
|
151
|
+
onColumnFiltersChange: o.onColumnFiltersChange ?? Y,
|
|
152
|
+
enableRowSelection: p,
|
|
153
|
+
onRowSelectionChange: o.onRowSelectionChange ?? oe,
|
|
136
154
|
state: {
|
|
137
|
-
...
|
|
138
|
-
rowSelection:
|
|
139
|
-
sorting:
|
|
140
|
-
columnFilters:
|
|
141
|
-
columnSizing:
|
|
142
|
-
columnPinning:
|
|
155
|
+
...o.state,
|
|
156
|
+
rowSelection: o.state?.rowSelection ?? ee,
|
|
157
|
+
sorting: o.state?.sorting ?? y,
|
|
158
|
+
columnFilters: o.state?.columnFilters ?? M,
|
|
159
|
+
columnSizing: Z,
|
|
160
|
+
columnPinning: ie
|
|
143
161
|
}
|
|
144
|
-
}), { rows: H } =
|
|
162
|
+
}), { rows: H } = l.getRowModel(), {
|
|
145
163
|
enabled: g,
|
|
146
|
-
virtualItems:
|
|
164
|
+
virtualItems: ae,
|
|
147
165
|
paddingTop: ce,
|
|
148
|
-
paddingBottom:
|
|
149
|
-
measureElement:
|
|
150
|
-
} =
|
|
151
|
-
(
|
|
152
|
-
if (!
|
|
153
|
-
const { scrollHeight:
|
|
154
|
-
|
|
166
|
+
paddingBottom: me,
|
|
167
|
+
measureElement: ue
|
|
168
|
+
} = Ne(H.length, c, d), E = c?.enabled, I = c?.hasNextPage, B = c?.isFetchingNextPage, N = c?.fetchNextPage, de = 200, C = r.useCallback(
|
|
169
|
+
(e) => {
|
|
170
|
+
if (!e || !E) return;
|
|
171
|
+
const { scrollHeight: t, scrollTop: n, clientHeight: u } = e;
|
|
172
|
+
t - n - u < de && !B && I && N?.();
|
|
155
173
|
},
|
|
156
|
-
[
|
|
174
|
+
[E, I, B, N]
|
|
175
|
+
);
|
|
176
|
+
r.useEffect(() => {
|
|
177
|
+
C(d.current);
|
|
178
|
+
}, [C]), b.current = l, r.useEffect(() => {
|
|
179
|
+
b.current?.toggleAllRowsSelected(F);
|
|
180
|
+
}, [F]);
|
|
181
|
+
const T = o.state?.sorting ?? y, $ = o.state?.columnFilters ?? M, A = r.useMemo(
|
|
182
|
+
() => P(
|
|
183
|
+
m
|
|
184
|
+
),
|
|
185
|
+
[m]
|
|
157
186
|
);
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
187
|
+
r.useEffect(() => {
|
|
188
|
+
!f || typeof window > "u" || Pe(
|
|
189
|
+
T,
|
|
190
|
+
$,
|
|
191
|
+
S,
|
|
192
|
+
A
|
|
193
|
+
);
|
|
194
|
+
}, [
|
|
195
|
+
f,
|
|
196
|
+
T,
|
|
197
|
+
$,
|
|
198
|
+
S,
|
|
199
|
+
A
|
|
200
|
+
]);
|
|
201
|
+
const ge = r.useMemo(() => {
|
|
202
|
+
const e = l.getFlatHeaders(), t = {};
|
|
203
|
+
for (let n = 0; n < e.length; n += 1) {
|
|
204
|
+
const u = e[n];
|
|
205
|
+
t[`--${s}-header-${u.id}-size`] = u.getSize(), t[`--${s}-col-${u.column.id}-size`] = u.column.getSize();
|
|
168
206
|
}
|
|
169
|
-
return
|
|
170
|
-
},
|
|
171
|
-
return /* @__PURE__ */
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
207
|
+
return t;
|
|
208
|
+
}, [s, l.getState().columnSizingInfo, l.getState().columnSizing]), fe = r.useMemo(() => l.getFlatHeaders().reduce((t, n) => t + n.getSize(), 0), [l.getState().columnSizingInfo, l.getState().columnSizing]);
|
|
209
|
+
return /* @__PURE__ */ h(Se, { children: [
|
|
210
|
+
J && /* @__PURE__ */ i(Ce, { color: "danger", sx: { marginBottom: 1 }, children: K }),
|
|
211
|
+
x?.enabled && /* @__PURE__ */ i(
|
|
212
|
+
ve,
|
|
175
213
|
{
|
|
176
|
-
ref:
|
|
177
|
-
toolbar:
|
|
178
|
-
columnFilters:
|
|
179
|
-
table:
|
|
214
|
+
ref: k,
|
|
215
|
+
toolbar: x,
|
|
216
|
+
columnFilters: l.getState().columnFilters,
|
|
217
|
+
table: l
|
|
180
218
|
}
|
|
181
219
|
),
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
sx: {
|
|
187
|
-
position: "absolute",
|
|
188
|
-
top: 0,
|
|
189
|
-
left: 0,
|
|
190
|
-
width: "100%",
|
|
191
|
-
height: "100%",
|
|
192
|
-
backgroundColor: "rgba(255, 255, 255, 0.7)",
|
|
193
|
-
display: "flex",
|
|
194
|
-
justifyContent: "center",
|
|
195
|
-
alignItems: "flex-start",
|
|
196
|
-
zIndex: 1,
|
|
197
|
-
paddingTop: "10%"
|
|
198
|
-
},
|
|
199
|
-
children: /* @__PURE__ */ o(T, {})
|
|
200
|
-
}
|
|
201
|
-
),
|
|
202
|
-
/* @__PURE__ */ o(
|
|
203
|
-
ze,
|
|
220
|
+
/* @__PURE__ */ h(D, { sx: { position: "relative" }, children: [
|
|
221
|
+
a && /* @__PURE__ */ i(ze, { children: /* @__PURE__ */ i(L, {}) }),
|
|
222
|
+
/* @__PURE__ */ i(
|
|
223
|
+
xe,
|
|
204
224
|
{
|
|
205
225
|
ref: d,
|
|
206
226
|
"data-testid": "table-wrapper",
|
|
207
|
-
$maxHeight:
|
|
208
|
-
onScroll: (
|
|
209
|
-
children: /* @__PURE__ */
|
|
210
|
-
|
|
227
|
+
$maxHeight: w,
|
|
228
|
+
onScroll: (e) => C(e.currentTarget),
|
|
229
|
+
children: /* @__PURE__ */ h(
|
|
230
|
+
De,
|
|
211
231
|
{
|
|
212
232
|
hoverRow: !0,
|
|
213
|
-
"data-testid":
|
|
214
|
-
sx:
|
|
215
|
-
de(),
|
|
233
|
+
"data-testid": s,
|
|
234
|
+
sx: ye(
|
|
216
235
|
ge,
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
236
|
+
fe,
|
|
237
|
+
G,
|
|
238
|
+
le,
|
|
239
|
+
w
|
|
220
240
|
),
|
|
221
241
|
children: [
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
children: [
|
|
233
|
-
e.isPlaceholder ? null : /* @__PURE__ */ u(xe, { children: [
|
|
234
|
-
e.column.columnDef.meta?.noSortButton ? S(
|
|
235
|
-
e.column.columnDef.header,
|
|
236
|
-
e.getContext()
|
|
237
|
-
) : e.column.getCanSort() ? /* @__PURE__ */ u(
|
|
238
|
-
we,
|
|
239
|
-
{
|
|
240
|
-
type: "button",
|
|
241
|
-
"aria-label": `Sort ${e.id} column`,
|
|
242
|
-
onClick: e.column.getToggleSortingHandler(),
|
|
243
|
-
title: (
|
|
244
|
-
// eslint-disable-next-line no-nested-ternary
|
|
245
|
-
e.column.getNextSortingOrder() === A.ASC ? "Sort ascending" : e.column.getNextSortingOrder() === A.DESC ? "Sort descending" : "Clear sort"
|
|
246
|
-
),
|
|
247
|
-
children: [
|
|
248
|
-
S(
|
|
249
|
-
e.column.columnDef.header,
|
|
250
|
-
e.getContext()
|
|
251
|
-
),
|
|
252
|
-
{
|
|
253
|
-
asc: /* @__PURE__ */ o(p, { icon: B, size: "sm" }),
|
|
254
|
-
desc: /* @__PURE__ */ o(p, { icon: $, size: "sm" })
|
|
255
|
-
}[e.column.getIsSorted()] ?? (e.column.getNextSortingOrder() === "desc" ? /* @__PURE__ */ o(
|
|
256
|
-
p,
|
|
257
|
-
{
|
|
258
|
-
icon: $,
|
|
259
|
-
size: "sm",
|
|
260
|
-
className: "fade"
|
|
261
|
-
}
|
|
262
|
-
) : /* @__PURE__ */ o(
|
|
263
|
-
p,
|
|
264
|
-
{
|
|
265
|
-
icon: B,
|
|
266
|
-
size: "sm",
|
|
267
|
-
className: "fade"
|
|
268
|
-
}
|
|
269
|
-
))
|
|
270
|
-
]
|
|
271
|
-
}
|
|
272
|
-
) : /* @__PURE__ */ o(Fe, { children: S(
|
|
273
|
-
e.column.columnDef.header,
|
|
274
|
-
e.getContext()
|
|
275
|
-
) }),
|
|
276
|
-
e.column.getCanFilter() && e.column.columnDef.meta?.filterType && /* @__PURE__ */ o(
|
|
277
|
-
De,
|
|
278
|
-
{
|
|
279
|
-
column: e.column,
|
|
280
|
-
filterType: e.column.columnDef.meta.filterType,
|
|
281
|
-
filterOptions: e.column.columnDef.meta?.filterOptions,
|
|
282
|
-
filterSearchable: e.column.columnDef.meta?.filterSearchable
|
|
283
|
-
}
|
|
284
|
-
)
|
|
285
|
-
] }),
|
|
286
|
-
e.column.getCanResize() && /* @__PURE__ */ o(
|
|
287
|
-
"button",
|
|
288
|
-
{
|
|
289
|
-
type: "button",
|
|
290
|
-
"aria-label": `Resize ${e.id} column`,
|
|
291
|
-
onMouseDown: e.getResizeHandler(),
|
|
292
|
-
onTouchStart: e.getResizeHandler(),
|
|
293
|
-
className: `resizer ${e.column.getIsResizing() ? "isResizing" : ""}`
|
|
294
|
-
}
|
|
295
|
-
)
|
|
296
|
-
]
|
|
297
|
-
},
|
|
298
|
-
e.id
|
|
299
|
-
);
|
|
300
|
-
}) }) }, t.id)),
|
|
301
|
-
/* @__PURE__ */ o(
|
|
302
|
-
ye,
|
|
242
|
+
/* @__PURE__ */ i(
|
|
243
|
+
be,
|
|
244
|
+
{
|
|
245
|
+
headerGroups: l.getHeaderGroups(),
|
|
246
|
+
id: s,
|
|
247
|
+
theadRef: v
|
|
248
|
+
}
|
|
249
|
+
),
|
|
250
|
+
/* @__PURE__ */ i(
|
|
251
|
+
Me,
|
|
303
252
|
{
|
|
304
253
|
rows: H,
|
|
305
|
-
columns:
|
|
306
|
-
rowRender:
|
|
307
|
-
loading:
|
|
308
|
-
rowSelectionState:
|
|
309
|
-
virtualItems: g ?
|
|
254
|
+
columns: l.getAllColumns(),
|
|
255
|
+
rowRender: V,
|
|
256
|
+
loading: a,
|
|
257
|
+
rowSelectionState: l.getState().rowSelection,
|
|
258
|
+
virtualItems: g ? ae : void 0,
|
|
310
259
|
paddingTop: g ? ce : void 0,
|
|
311
|
-
paddingBottom: g ?
|
|
312
|
-
measureElement: g ?
|
|
260
|
+
paddingBottom: g ? me : void 0,
|
|
261
|
+
measureElement: g ? ue : void 0
|
|
313
262
|
}
|
|
314
263
|
),
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
) },
|
|
264
|
+
q && l.getFooterGroups().length > 0 && /* @__PURE__ */ i("tfoot", { children: l.getFooterGroups().map((e) => /* @__PURE__ */ i("tr", { children: e.headers.map((t) => /* @__PURE__ */ i("td", { colSpan: t.colSpan, children: pe(
|
|
265
|
+
t.column.columnDef.footer,
|
|
266
|
+
t.getContext()
|
|
267
|
+
) }, t.id)) }, e.id)) })
|
|
319
268
|
]
|
|
320
269
|
}
|
|
321
270
|
)
|
|
322
271
|
}
|
|
323
272
|
)
|
|
324
273
|
] }),
|
|
325
|
-
g &&
|
|
326
|
-
|
|
274
|
+
g && c?.isFetchingNextPage && /* @__PURE__ */ h(
|
|
275
|
+
D,
|
|
327
276
|
{
|
|
328
277
|
sx: {
|
|
329
278
|
display: "flex",
|
|
@@ -333,21 +282,21 @@ function ut({
|
|
|
333
282
|
padding: 1
|
|
334
283
|
},
|
|
335
284
|
children: [
|
|
336
|
-
/* @__PURE__ */
|
|
337
|
-
/* @__PURE__ */
|
|
285
|
+
/* @__PURE__ */ i(L, { size: "sm" }),
|
|
286
|
+
/* @__PURE__ */ i(we, { children: c.loadingText ?? "Loading more..." })
|
|
338
287
|
]
|
|
339
288
|
}
|
|
340
289
|
),
|
|
341
|
-
|
|
342
|
-
|
|
290
|
+
W && /* @__PURE__ */ i(
|
|
291
|
+
Fe,
|
|
343
292
|
{
|
|
344
293
|
scrollContainerRef: d,
|
|
345
|
-
visible:
|
|
294
|
+
visible: re,
|
|
346
295
|
constrainToContainer: "main"
|
|
347
296
|
}
|
|
348
297
|
)
|
|
349
298
|
] });
|
|
350
299
|
}
|
|
351
300
|
export {
|
|
352
|
-
|
|
301
|
+
dt as default
|
|
353
302
|
};
|
|
@@ -54,8 +54,7 @@ const l = e.div`
|
|
|
54
54
|
gap: 2px;
|
|
55
55
|
width: 100%;
|
|
56
56
|
height: 100%;
|
|
57
|
-
|
|
58
|
-
e(r)`
|
|
57
|
+
`, g = e(r)`
|
|
59
58
|
position: absolute;
|
|
60
59
|
top: 0;
|
|
61
60
|
left: 0;
|
|
@@ -67,8 +66,7 @@ e(r)`
|
|
|
67
66
|
align-items: flex-start;
|
|
68
67
|
z-index: 1;
|
|
69
68
|
padding-top: 10%;
|
|
70
|
-
|
|
71
|
-
const g = (t, i, o, a, n) => ({
|
|
69
|
+
`, f = (t, i, o, a, n) => ({
|
|
72
70
|
...t,
|
|
73
71
|
tableLayout: "fixed",
|
|
74
72
|
width: "100%",
|
|
@@ -191,7 +189,8 @@ const g = (t, i, o, a, n) => ({
|
|
|
191
189
|
export {
|
|
192
190
|
h as ColumnHeaderContainer,
|
|
193
191
|
c as HeaderContent,
|
|
192
|
+
g as LoadingOverlay,
|
|
194
193
|
s as SortButton,
|
|
195
194
|
l as TableWrapper,
|
|
196
|
-
|
|
195
|
+
f as getTableStyles
|
|
197
196
|
};
|