@dmsi/wedgekit-react 3.0.1 → 3.0.2
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.
|
@@ -1,158 +1,158 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as n, jsxs as a, Fragment as
|
|
3
|
-
import
|
|
4
|
-
import { useInfiniteScroll as
|
|
5
|
-
import { useTableLayout as
|
|
6
|
-
import { componentGap as
|
|
7
|
-
import { Button as
|
|
8
|
-
import { Checkbox as
|
|
9
|
-
import { DraggableCellHeader as
|
|
10
|
-
import { Icon as
|
|
11
|
-
import { Label as
|
|
12
|
-
import { Menu as
|
|
13
|
-
import { MenuOption as
|
|
14
|
-
import { Paragraph as
|
|
2
|
+
import { jsx as n, jsxs as a, Fragment as Dt } from "react/jsx-runtime";
|
|
3
|
+
import Tt, { useImperativeHandle as Et, useState as g, useCallback as P, useEffect as Z, useRef as B, useId as Mt, useLayoutEffect as We } from "react";
|
|
4
|
+
import { useInfiniteScroll as Wt } from "../../hooks/useInfiniteScroll.js";
|
|
5
|
+
import { useTableLayout as jt } from "../../hooks/useTableLayout/useTableLayout.js";
|
|
6
|
+
import { componentGap as je, componentPadding as Fe } from "../../classNames.js";
|
|
7
|
+
import { Button as _e } from "../Button.js";
|
|
8
|
+
import { Checkbox as Ft } from "../Checkbox.js";
|
|
9
|
+
import { DraggableCellHeader as _t, DataGridCell as At } from "../DataGridCell.js";
|
|
10
|
+
import { Icon as Ae } from "../Icon.js";
|
|
11
|
+
import { Label as Gt } from "../Label.js";
|
|
12
|
+
import { Menu as Ot } from "../Menu.js";
|
|
13
|
+
import { MenuOption as Vt } from "../MenuOption.js";
|
|
14
|
+
import { Paragraph as y } from "../Paragraph.js";
|
|
15
15
|
import { Select as Ht } from "../Select.js";
|
|
16
|
-
import { Subheader as
|
|
17
|
-
import { useReactTable as
|
|
18
|
-
import { useSensors as
|
|
19
|
-
import { SortableContext as
|
|
20
|
-
import { restrictToHorizontalAxis as
|
|
21
|
-
import { Notification as
|
|
22
|
-
import { useVirtualizer as
|
|
16
|
+
import { Subheader as L } from "../Subheader.js";
|
|
17
|
+
import { useReactTable as qt, flexRender as Kt } from "../../node_modules/@tanstack/react-table/build/lib/index.js";
|
|
18
|
+
import { useSensors as Zt, useSensor as fe, DndContext as Bt, closestCenter as Jt, KeyboardSensor as Qt, TouchSensor as Xt, MouseSensor as Yt } from "../../node_modules/@dnd-kit/core/dist/core.esm.js";
|
|
19
|
+
import { SortableContext as Ut, horizontalListSortingStrategy as eo, arrayMove as to } from "../../node_modules/@dnd-kit/sortable/dist/sortable.esm.js";
|
|
20
|
+
import { restrictToHorizontalAxis as oo } from "../../node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js";
|
|
21
|
+
import { Notification as no } from "../Notification.js";
|
|
22
|
+
import { useVirtualizer as ro } from "../../node_modules/@tanstack/react-virtual/dist/esm/index.js";
|
|
23
23
|
import { clsx as v } from "../../node_modules/clsx/dist/clsx.js";
|
|
24
|
-
import { PinnedColumns as
|
|
25
|
-
import { getSortIcon as
|
|
26
|
-
import { TableBody as
|
|
27
|
-
import { SummaryRow as
|
|
28
|
-
import { Spinner as
|
|
29
|
-
import { Tooltip as
|
|
24
|
+
import { PinnedColumns as Ge } from "./PinnedColumns.js";
|
|
25
|
+
import { getSortIcon as Oe } from "./utils.js";
|
|
26
|
+
import { TableBody as lo } from "./TableBody/index.js";
|
|
27
|
+
import { SummaryRow as so } from "./SummaryRow/index.js";
|
|
28
|
+
import { Spinner as ge } from "../Spinner.js";
|
|
29
|
+
import { Tooltip as Ve } from "../Tooltip.js";
|
|
30
30
|
import He from "../../static/no-results-image.png.js";
|
|
31
|
-
import { getExpandedRowModel as
|
|
32
|
-
const
|
|
31
|
+
import { getExpandedRowModel as io, getGroupedRowModel as co, getFilteredRowModel as ao, getSortedRowModel as mo, getCoreRowModel as uo } from "../../node_modules/@tanstack/table-core/build/lib/index.js";
|
|
32
|
+
const fo = [5, 10, 15, 20, 25, 30, 35], qe = "h-[185px]";
|
|
33
33
|
function Ho({
|
|
34
34
|
id: s,
|
|
35
35
|
rowIdAccessor: b,
|
|
36
36
|
testid: l,
|
|
37
|
-
data:
|
|
38
|
-
columns:
|
|
39
|
-
status:
|
|
40
|
-
isLoadingMore:
|
|
41
|
-
onLoadMore:
|
|
37
|
+
data: D,
|
|
38
|
+
columns: Ke,
|
|
39
|
+
status: T,
|
|
40
|
+
isLoadingMore: E = !1,
|
|
41
|
+
onLoadMore: Ze,
|
|
42
42
|
pagination: r,
|
|
43
|
-
showFilterRow:
|
|
44
|
-
hasMore:
|
|
45
|
-
sorting:
|
|
46
|
-
onSortingChange:
|
|
43
|
+
showFilterRow: J = !1,
|
|
44
|
+
hasMore: Q = !1,
|
|
45
|
+
sorting: he,
|
|
46
|
+
onSortingChange: Be,
|
|
47
47
|
columnFilters: pe,
|
|
48
|
-
onColumnFiltersChange:
|
|
49
|
-
rowSelection:
|
|
50
|
-
onRowSelectionChange:
|
|
48
|
+
onColumnFiltersChange: Je,
|
|
49
|
+
rowSelection: X,
|
|
50
|
+
onRowSelectionChange: M,
|
|
51
51
|
filteredSortedData: Se,
|
|
52
|
-
totalRowCount:
|
|
53
|
-
hideStatusBar:
|
|
54
|
-
centerHeader:
|
|
52
|
+
totalRowCount: W,
|
|
53
|
+
hideStatusBar: Qe,
|
|
54
|
+
centerHeader: Xe,
|
|
55
55
|
enableColumnSelector: ve,
|
|
56
|
-
predeterminedLeftPins:
|
|
57
|
-
predeterminedRightPins:
|
|
58
|
-
useMenuDefaultMinWidth:
|
|
59
|
-
rowDisabled:
|
|
60
|
-
rowDisabledAccessor:
|
|
61
|
-
isLoading:
|
|
62
|
-
loadingMessage:
|
|
56
|
+
predeterminedLeftPins: Ye = [],
|
|
57
|
+
predeterminedRightPins: Ue = [],
|
|
58
|
+
useMenuDefaultMinWidth: et,
|
|
59
|
+
rowDisabled: tt,
|
|
60
|
+
rowDisabledAccessor: ot,
|
|
61
|
+
isLoading: h = !1,
|
|
62
|
+
loadingMessage: nt = "Loading Results",
|
|
63
63
|
loadingDescription: be,
|
|
64
|
-
maxHeight:
|
|
65
|
-
fillHeight:
|
|
66
|
-
manualFiltering:
|
|
67
|
-
notifications:
|
|
64
|
+
maxHeight: j,
|
|
65
|
+
fillHeight: R = !1,
|
|
66
|
+
manualFiltering: Y = !1,
|
|
67
|
+
notifications: U,
|
|
68
68
|
summaryRow: we,
|
|
69
|
-
groupBy:
|
|
70
|
-
groupRowMode:
|
|
69
|
+
groupBy: F,
|
|
70
|
+
groupRowMode: ee = "spanning",
|
|
71
71
|
groupDefaultExpand: Ce = "none",
|
|
72
|
-
allowUserGrouping:
|
|
73
|
-
groupSelectionMode:
|
|
74
|
-
hideGroupedColumns:
|
|
75
|
-
grouping:
|
|
76
|
-
onGroupingChange:
|
|
77
|
-
expanded:
|
|
78
|
-
onExpandedChange:
|
|
79
|
-
ref:
|
|
72
|
+
allowUserGrouping: te,
|
|
73
|
+
groupSelectionMode: oe = "row",
|
|
74
|
+
hideGroupedColumns: rt,
|
|
75
|
+
grouping: z,
|
|
76
|
+
onGroupingChange: lt,
|
|
77
|
+
expanded: _,
|
|
78
|
+
onExpandedChange: st,
|
|
79
|
+
ref: it
|
|
80
80
|
}) {
|
|
81
|
-
|
|
82
|
-
getSavedLayout: () =>
|
|
81
|
+
Et(it, () => ({
|
|
82
|
+
getSavedLayout: () => dt()
|
|
83
83
|
}));
|
|
84
|
-
const [xe, ye] =
|
|
84
|
+
const [xe, ye] = g([]), [Re, ze] = g([]), [ct, Ie] = g({}), [ne, re] = g(null), {
|
|
85
85
|
columns: w,
|
|
86
|
-
setColumns:
|
|
87
|
-
getSavedLayout:
|
|
86
|
+
setColumns: le,
|
|
87
|
+
getSavedLayout: dt,
|
|
88
88
|
resetToDefaults: Ne
|
|
89
|
-
} =
|
|
89
|
+
} = jt(Ke, s ?? l), [$e, se] = g(
|
|
90
90
|
w.map((e) => e.id)
|
|
91
|
-
), [Pe,
|
|
91
|
+
), [Pe, at] = g(
|
|
92
92
|
Object.fromEntries(
|
|
93
93
|
w.filter((e) => !!e.id).map((e) => [e.id, e.meta?.visible ?? !0])
|
|
94
94
|
)
|
|
95
|
-
), Le =
|
|
95
|
+
), Le = P(
|
|
96
96
|
(e) => {
|
|
97
|
-
|
|
97
|
+
at(
|
|
98
98
|
Object.fromEntries(
|
|
99
99
|
w.filter((o) => !!o.id).map((o) => [o.id, o.meta?.visible ?? !0])
|
|
100
100
|
)
|
|
101
|
-
), e &&
|
|
101
|
+
), e && se(w.map((o) => o.id));
|
|
102
102
|
},
|
|
103
103
|
[w]
|
|
104
|
-
),
|
|
104
|
+
), mt = P(() => {
|
|
105
105
|
Ne();
|
|
106
106
|
}, [Ne]);
|
|
107
|
-
|
|
107
|
+
Z(() => {
|
|
108
108
|
Le(!0);
|
|
109
109
|
}, [Le]);
|
|
110
|
-
const
|
|
110
|
+
const ut = r ? he ?? xe : xe, ft = r ? (e) => {
|
|
111
111
|
const o = typeof e == "function" ? e(
|
|
112
|
-
|
|
112
|
+
he ?? []
|
|
113
113
|
) : e;
|
|
114
|
-
(
|
|
115
|
-
} : ye, ke = r != null ||
|
|
114
|
+
(Be ?? ye)(o);
|
|
115
|
+
} : ye, ke = r != null || Y, gt = ke ? pe ?? Re : Re, ht = ke ? (e) => {
|
|
116
116
|
const o = typeof e == "function" ? e(pe ?? []) : e;
|
|
117
|
-
(
|
|
118
|
-
} : ze,
|
|
119
|
-
|
|
120
|
-
const De =
|
|
117
|
+
(Je ?? ze)(o);
|
|
118
|
+
} : ze, I = X ?? ct, N = B(I);
|
|
119
|
+
N.current = I;
|
|
120
|
+
const De = P(
|
|
121
121
|
(e) => {
|
|
122
122
|
if (r) {
|
|
123
|
-
const o = typeof e == "function" ? e(
|
|
124
|
-
|
|
125
|
-
} else if (
|
|
126
|
-
const o = typeof e == "function" ? e(
|
|
127
|
-
|
|
123
|
+
const o = typeof e == "function" ? e(N.current) : e;
|
|
124
|
+
N.current = o, (M ?? Ie)(o);
|
|
125
|
+
} else if (X && M) {
|
|
126
|
+
const o = typeof e == "function" ? e(N.current) : e;
|
|
127
|
+
N.current = o, M(o);
|
|
128
128
|
} else
|
|
129
129
|
Ie(e);
|
|
130
130
|
},
|
|
131
|
-
[
|
|
132
|
-
), [
|
|
133
|
-
|
|
131
|
+
[X, M, r]
|
|
132
|
+
), [pt, Te] = g(
|
|
133
|
+
F ?? []
|
|
134
134
|
);
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}, [
|
|
138
|
-
const
|
|
135
|
+
Z(() => {
|
|
136
|
+
z === void 0 && F !== void 0 && Te(F);
|
|
137
|
+
}, [F, z]);
|
|
138
|
+
const ie = z ?? pt, St = z !== void 0 ? (e) => {
|
|
139
139
|
const o = typeof e == "function" ? e(
|
|
140
|
-
|
|
140
|
+
z
|
|
141
141
|
) : e;
|
|
142
|
-
|
|
143
|
-
} : Te, [
|
|
142
|
+
lt?.(o);
|
|
143
|
+
} : Te, [vt, Ee] = g(
|
|
144
144
|
() => Ce === "all" ? !0 : {}
|
|
145
|
-
),
|
|
145
|
+
), bt = _ ?? vt, wt = _ !== void 0 ? (e) => {
|
|
146
146
|
const o = typeof e == "function" ? e(
|
|
147
|
-
|
|
147
|
+
_
|
|
148
148
|
) : e;
|
|
149
|
-
|
|
150
|
-
} : Ee,
|
|
149
|
+
st?.(o);
|
|
150
|
+
} : Ee, Ct = rt ? {
|
|
151
151
|
...Pe,
|
|
152
|
-
...Object.fromEntries(
|
|
153
|
-
} : Pe,
|
|
152
|
+
...Object.fromEntries(ie.map((e) => [e, !1]))
|
|
153
|
+
} : Pe, xt = Mt(), f = B(null), Me = B(null), ce = B(null), yt = P(
|
|
154
154
|
(e, o) => {
|
|
155
|
-
|
|
155
|
+
le((t) => t.map((d) => d.id === e ? {
|
|
156
156
|
...d,
|
|
157
157
|
meta: {
|
|
158
158
|
...d.meta,
|
|
@@ -160,16 +160,16 @@ function Ho({
|
|
|
160
160
|
}
|
|
161
161
|
} : d));
|
|
162
162
|
},
|
|
163
|
-
[
|
|
164
|
-
), i =
|
|
163
|
+
[le]
|
|
164
|
+
), i = qt({
|
|
165
165
|
columns: w,
|
|
166
|
-
data:
|
|
166
|
+
data: D,
|
|
167
167
|
defaultColumn: { minSize: 50 },
|
|
168
|
-
getCoreRowModel:
|
|
169
|
-
getSortedRowModel:
|
|
170
|
-
getFilteredRowModel:
|
|
171
|
-
getGroupedRowModel:
|
|
172
|
-
getExpandedRowModel:
|
|
168
|
+
getCoreRowModel: uo(),
|
|
169
|
+
getSortedRowModel: mo(),
|
|
170
|
+
getFilteredRowModel: Y ? void 0 : ao(),
|
|
171
|
+
getGroupedRowModel: co(),
|
|
172
|
+
getExpandedRowModel: io(),
|
|
173
173
|
// Grouping only ever happens client-side in this grid — there is no
|
|
174
174
|
// server-side/manual grouping mode, unlike filtering.
|
|
175
175
|
groupedColumnMode: !1,
|
|
@@ -182,31 +182,31 @@ function Ho({
|
|
|
182
182
|
// internal state update on every grouping change.
|
|
183
183
|
autoResetPageIndex: !1,
|
|
184
184
|
autoResetExpanded: !1,
|
|
185
|
-
manualFiltering:
|
|
185
|
+
manualFiltering: Y,
|
|
186
186
|
columnResizeMode: "onChange",
|
|
187
187
|
getRowId: b ? (e) => String(e[b]) : (e, o) => String(e.id ?? o + 1),
|
|
188
188
|
state: {
|
|
189
189
|
columnOrder: $e,
|
|
190
|
-
sorting:
|
|
191
|
-
columnFilters:
|
|
192
|
-
rowSelection:
|
|
193
|
-
columnVisibility:
|
|
194
|
-
grouping:
|
|
195
|
-
expanded:
|
|
190
|
+
sorting: ut,
|
|
191
|
+
columnFilters: gt,
|
|
192
|
+
rowSelection: I,
|
|
193
|
+
columnVisibility: Ct,
|
|
194
|
+
grouping: ie,
|
|
195
|
+
expanded: bt
|
|
196
196
|
},
|
|
197
197
|
initialState: {
|
|
198
198
|
columnPinning: {
|
|
199
|
-
left:
|
|
200
|
-
right:
|
|
199
|
+
left: Ye,
|
|
200
|
+
right: Ue
|
|
201
201
|
}
|
|
202
202
|
},
|
|
203
203
|
enableColumnPinning: !0,
|
|
204
|
-
onColumnOrderChange:
|
|
205
|
-
onSortingChange:
|
|
206
|
-
onColumnFiltersChange:
|
|
207
|
-
onRowSelectionChange:
|
|
208
|
-
onGroupingChange:
|
|
209
|
-
onExpandedChange:
|
|
204
|
+
onColumnOrderChange: se,
|
|
205
|
+
onSortingChange: k(ft),
|
|
206
|
+
onColumnFiltersChange: k(ht),
|
|
207
|
+
onRowSelectionChange: k(De),
|
|
208
|
+
onGroupingChange: k(St),
|
|
209
|
+
onExpandedChange: k(wt),
|
|
210
210
|
filterFns: {
|
|
211
211
|
startsWith: (e, o, t) => {
|
|
212
212
|
const c = e?.getValue(o);
|
|
@@ -218,43 +218,43 @@ function Ho({
|
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
220
|
});
|
|
221
|
-
|
|
222
|
-
if (Ce !== "first" ||
|
|
221
|
+
Z(() => {
|
|
222
|
+
if (Ce !== "first" || _ !== void 0)
|
|
223
223
|
return;
|
|
224
224
|
const e = {};
|
|
225
225
|
let o = i.getGroupedRowModel().rows.find((t) => t.depth === 0 && t.getIsGrouped());
|
|
226
226
|
for (; o; )
|
|
227
227
|
e[o.id] = !0, o = o.subRows.find((t) => t.getIsGrouped());
|
|
228
228
|
Object.keys(e).length > 0 && Ee(e);
|
|
229
|
-
}, [
|
|
230
|
-
const
|
|
231
|
-
{ length:
|
|
229
|
+
}, [ie]);
|
|
230
|
+
const A = r ? Se?.map((e) => String(e.id)) ?? [] : Array.from(
|
|
231
|
+
{ length: W ?? D.length },
|
|
232
232
|
(e, o) => String(o + 1)
|
|
233
|
-
),
|
|
234
|
-
(e) =>
|
|
235
|
-
),
|
|
233
|
+
), de = A.every(
|
|
234
|
+
(e) => I[e]
|
|
235
|
+
), Rt = !de && A.some((e) => I[e]), zt = () => {
|
|
236
236
|
De((e) => {
|
|
237
|
-
if (!
|
|
237
|
+
if (!de) {
|
|
238
238
|
const t = {};
|
|
239
|
-
for (const c of
|
|
239
|
+
for (const c of A)
|
|
240
240
|
t[c] = !0;
|
|
241
241
|
return { ...e, ...t };
|
|
242
242
|
} else {
|
|
243
243
|
const t = { ...e };
|
|
244
|
-
for (const c of
|
|
244
|
+
for (const c of A)
|
|
245
245
|
delete t[c];
|
|
246
246
|
return t;
|
|
247
247
|
}
|
|
248
248
|
});
|
|
249
249
|
};
|
|
250
|
-
|
|
250
|
+
Wt({
|
|
251
251
|
containerRef: f,
|
|
252
|
-
onLoadMore:
|
|
252
|
+
onLoadMore: Ze ?? (() => {
|
|
253
253
|
}),
|
|
254
|
-
isLoading:
|
|
254
|
+
isLoading: E,
|
|
255
255
|
enabled: !r
|
|
256
256
|
});
|
|
257
|
-
const
|
|
257
|
+
const G = i.getCenterVisibleLeafColumns().map((e) => e.id).join(","), O = P(() => {
|
|
258
258
|
if (!f.current) return null;
|
|
259
259
|
const e = f.current.offsetWidth;
|
|
260
260
|
if (e === 0) return null;
|
|
@@ -263,69 +263,73 @@ function Ho({
|
|
|
263
263
|
const m = d.reduce(
|
|
264
264
|
(u, S) => u + S.getSize(),
|
|
265
265
|
0
|
|
266
|
-
),
|
|
266
|
+
), q = m > 0 ? c / m : 1, K = {};
|
|
267
267
|
return d.forEach((u) => {
|
|
268
|
-
|
|
269
|
-
}), i.setColumnSizing((u) => ({ ...u, ...
|
|
268
|
+
K[u.id] = Math.max(Math.floor(u.getSize() * q), 50);
|
|
269
|
+
}), i.setColumnSizing((u) => ({ ...u, ...K })), e;
|
|
270
270
|
}, [i]);
|
|
271
|
-
|
|
272
|
-
if (!f.current || Me.current ===
|
|
273
|
-
const e =
|
|
274
|
-
e !== null && (Me.current =
|
|
275
|
-
}, [
|
|
271
|
+
We(() => {
|
|
272
|
+
if (!f.current || Me.current === G) return;
|
|
273
|
+
const e = O();
|
|
274
|
+
e !== null && (Me.current = G, ce.current = e);
|
|
275
|
+
}, [G, O]), Z(() => {
|
|
276
276
|
const e = f.current;
|
|
277
277
|
if (!e) return;
|
|
278
278
|
const o = new ResizeObserver(() => {
|
|
279
|
-
if (e.offsetWidth ===
|
|
280
|
-
const t =
|
|
281
|
-
t !== null && (
|
|
279
|
+
if (e.offsetWidth === ce.current) return;
|
|
280
|
+
const t = O();
|
|
281
|
+
t !== null && (ce.current = t);
|
|
282
282
|
});
|
|
283
283
|
return o.observe(e), () => o.disconnect();
|
|
284
|
-
}, [
|
|
285
|
-
const
|
|
284
|
+
}, [O]);
|
|
285
|
+
const It = (e) => {
|
|
286
286
|
const { active: o, over: t } = e;
|
|
287
|
-
o && t && o.id !== t.id &&
|
|
288
|
-
const d = c.indexOf(o.id), m = c.indexOf(t.id),
|
|
289
|
-
return
|
|
287
|
+
o && t && o.id !== t.id && se((c) => {
|
|
288
|
+
const d = c.indexOf(o.id), m = c.indexOf(t.id), q = to(c, d, m);
|
|
289
|
+
return le((K) => q.map((S) => K.find((kt) => kt.id === S)).filter(Boolean)), q;
|
|
290
290
|
});
|
|
291
|
-
},
|
|
291
|
+
}, Nt = Zt(
|
|
292
|
+
fe(Yt),
|
|
292
293
|
fe(Xt),
|
|
293
|
-
fe(Qt)
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
), G = no({
|
|
294
|
+
fe(Qt)
|
|
295
|
+
), ae = i.getCenterVisibleLeafColumns(), $t = ae.map((e) => e.id), Pt = $e.filter(
|
|
296
|
+
(e) => $t.includes(e)
|
|
297
|
+
), C = ro({
|
|
298
298
|
count: ae.length,
|
|
299
299
|
estimateSize: (e) => ae[e].getSize(),
|
|
300
300
|
getScrollElement: () => f.current,
|
|
301
301
|
horizontal: !0,
|
|
302
302
|
overscan: 8
|
|
303
|
-
}),
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
303
|
+
}), Lt = i.getState().columnSizing;
|
|
304
|
+
We(() => {
|
|
305
|
+
C.measure();
|
|
306
|
+
}, [C, Lt, G]);
|
|
307
|
+
const p = C.getVirtualItems();
|
|
308
|
+
let V, $;
|
|
309
|
+
C && p?.length && (V = p[0]?.start ?? 0, $ = C.getTotalSize() - (p[p.length - 1]?.end ?? 0));
|
|
310
|
+
const H = i.getRowModel().rows.length === 0, x = we && !H ? we : void 0, me = x ? i.getFilteredRowModel().rows.map((e) => e.original) : [], ue = x ? r ? Se ?? D : D : [];
|
|
307
311
|
return /* @__PURE__ */ n(
|
|
308
|
-
|
|
312
|
+
Bt,
|
|
309
313
|
{
|
|
310
|
-
id:
|
|
311
|
-
collisionDetection:
|
|
312
|
-
modifiers: [
|
|
313
|
-
onDragEnd:
|
|
314
|
-
sensors:
|
|
314
|
+
id: xt,
|
|
315
|
+
collisionDetection: Jt,
|
|
316
|
+
modifiers: [oo],
|
|
317
|
+
onDragEnd: It,
|
|
318
|
+
sensors: Nt,
|
|
315
319
|
children: /* @__PURE__ */ n(
|
|
316
|
-
|
|
320
|
+
Ut,
|
|
317
321
|
{
|
|
318
|
-
items:
|
|
319
|
-
strategy:
|
|
322
|
+
items: Pt,
|
|
323
|
+
strategy: eo,
|
|
320
324
|
children: /* @__PURE__ */ a(
|
|
321
325
|
"div",
|
|
322
326
|
{
|
|
323
327
|
className: v(
|
|
324
328
|
"flex flex-col gap-2 w-full",
|
|
325
|
-
|
|
329
|
+
R ? "grow min-h-0" : "grow-0 h-fit"
|
|
326
330
|
),
|
|
327
331
|
children: [
|
|
328
|
-
|
|
332
|
+
U && U.length > 0 && /* @__PURE__ */ n("div", { className: "flex flex-col gap-2 shrink-0 [color:initial]", children: U.map((e, o) => /* @__PURE__ */ n(no, { ...e }, e.id ?? o)) }),
|
|
329
333
|
/* @__PURE__ */ a(
|
|
330
334
|
"div",
|
|
331
335
|
{
|
|
@@ -333,7 +337,7 @@ function Ho({
|
|
|
333
337
|
"data-testid": l,
|
|
334
338
|
className: v(
|
|
335
339
|
"flex flex-col rounded border border-border-primary-normal overflow-hidden text-text-primary-normal",
|
|
336
|
-
|
|
340
|
+
R ? "flex-1 min-h-0" : "grow-0 h-fit"
|
|
337
341
|
),
|
|
338
342
|
children: [
|
|
339
343
|
/* @__PURE__ */ a(
|
|
@@ -341,34 +345,34 @@ function Ho({
|
|
|
341
345
|
{
|
|
342
346
|
className: v(
|
|
343
347
|
"flex overflow-auto scrollbar-thin relative contain-paint will-change-transform",
|
|
344
|
-
H ? "overflow-y-hidden" : !
|
|
345
|
-
|
|
348
|
+
H ? "overflow-y-hidden" : !R && "min-h-[120px]",
|
|
349
|
+
R && "flex-1 min-h-0"
|
|
346
350
|
),
|
|
347
|
-
style:
|
|
351
|
+
style: j !== void 0 ? { maxHeight: typeof j == "number" ? `${j}px` : j } : void 0,
|
|
348
352
|
ref: f,
|
|
349
|
-
inert:
|
|
350
|
-
"aria-busy":
|
|
353
|
+
inert: h || void 0,
|
|
354
|
+
"aria-busy": h || void 0,
|
|
351
355
|
children: [
|
|
352
356
|
/* @__PURE__ */ n(
|
|
353
|
-
|
|
357
|
+
Ge,
|
|
354
358
|
{
|
|
355
359
|
testid: l,
|
|
356
360
|
pinDirection: "left",
|
|
357
361
|
table: i,
|
|
358
362
|
tableContainerRef: f,
|
|
359
363
|
pagination: r,
|
|
360
|
-
isLoadingMore:
|
|
361
|
-
hasMore:
|
|
362
|
-
showFilterRow:
|
|
363
|
-
groupRowMode:
|
|
364
|
-
groupSelectionMode:
|
|
365
|
-
allowUserGrouping:
|
|
366
|
-
hoveredRowId:
|
|
367
|
-
setHoveredRowId:
|
|
368
|
-
summaryRow:
|
|
364
|
+
isLoadingMore: E,
|
|
365
|
+
hasMore: Q,
|
|
366
|
+
showFilterRow: J,
|
|
367
|
+
groupRowMode: ee,
|
|
368
|
+
groupSelectionMode: oe,
|
|
369
|
+
allowUserGrouping: te,
|
|
370
|
+
hoveredRowId: ne,
|
|
371
|
+
setHoveredRowId: re,
|
|
372
|
+
summaryRow: x,
|
|
369
373
|
filteredRows: me,
|
|
370
374
|
allRows: ue,
|
|
371
|
-
totalRowCount:
|
|
375
|
+
totalRowCount: W
|
|
372
376
|
}
|
|
373
377
|
),
|
|
374
378
|
/* @__PURE__ */ a("table", { className: "flex-1 flex flex-col min-h-min", children: [
|
|
@@ -379,12 +383,12 @@ function Ho({
|
|
|
379
383
|
className: "flex w-full bg-background-primary-normal",
|
|
380
384
|
"data-theme": "brand",
|
|
381
385
|
children: [
|
|
382
|
-
|
|
386
|
+
V ? (
|
|
383
387
|
// fake empty column to the left for virtualization scroll padding
|
|
384
388
|
/* @__PURE__ */ n(
|
|
385
389
|
"th",
|
|
386
390
|
{
|
|
387
|
-
style: { display: "flex", width:
|
|
391
|
+
style: { display: "flex", width: V }
|
|
388
392
|
}
|
|
389
393
|
)
|
|
390
394
|
) : null,
|
|
@@ -394,16 +398,16 @@ function Ho({
|
|
|
394
398
|
if (typeof t.column.columnDef.header == "string") {
|
|
395
399
|
const c = i.getRowModel().rows[0]?.getValue(t.column.id), d = t.column.columnDef.meta?.align ?? (typeof c == "number" ? "right" : "left");
|
|
396
400
|
return /* @__PURE__ */ a(
|
|
397
|
-
|
|
401
|
+
_t,
|
|
398
402
|
{
|
|
399
403
|
width: `${t.column.getSize()}px`,
|
|
400
404
|
id: s ? `${s}-header-${t.id}` : void 0,
|
|
401
405
|
testid: l ? `${l}-header-${t.id}` : void 0,
|
|
402
406
|
header: t,
|
|
403
407
|
locked: t.column.columnDef.meta?.locked,
|
|
404
|
-
center:
|
|
405
|
-
allowUserGrouping:
|
|
406
|
-
isLast:
|
|
408
|
+
center: Xe,
|
|
409
|
+
allowUserGrouping: te,
|
|
410
|
+
isLast: !$ && o.index === p[p.length - 1]?.index,
|
|
407
411
|
className: v(
|
|
408
412
|
t.column.getCanSort() ? "cursor-pointer" : "cursor-grab",
|
|
409
413
|
"group",
|
|
@@ -412,30 +416,30 @@ function Ho({
|
|
|
412
416
|
"justify-end": d === "right"
|
|
413
417
|
}
|
|
414
418
|
),
|
|
415
|
-
useMenuDefaultMinWidth:
|
|
419
|
+
useMenuDefaultMinWidth: et,
|
|
416
420
|
children: [
|
|
417
421
|
d === "left" && /* @__PURE__ */ n(
|
|
418
|
-
|
|
422
|
+
Ve,
|
|
419
423
|
{
|
|
420
424
|
showOnTruncation: !0,
|
|
421
425
|
message: t.column.columnDef.header,
|
|
422
426
|
position: "bottom",
|
|
423
|
-
children: /* @__PURE__ */ n(
|
|
427
|
+
children: /* @__PURE__ */ n(L, { as: "p", addOverflow: !0, tall: !0, children: t.column.columnDef.header })
|
|
424
428
|
}
|
|
425
429
|
),
|
|
426
|
-
|
|
427
|
-
!t.column.getIsSorted() && t.column.getCanSort() && !i.getState().columnSizingInfo.isResizingColumn &&
|
|
430
|
+
Oe(t.column.getIsSorted()),
|
|
431
|
+
!t.column.getIsSorted() && t.column.getCanSort() && !i.getState().columnSizingInfo.isResizingColumn && Oe(
|
|
428
432
|
t.column.getNextSortingOrder(),
|
|
429
433
|
!0
|
|
430
434
|
),
|
|
431
|
-
t.column.getSortIndex() !== -1 && i.getState().sorting.length > 1 && /* @__PURE__ */ n(
|
|
435
|
+
t.column.getSortIndex() !== -1 && i.getState().sorting.length > 1 && /* @__PURE__ */ n(L, { tall: !0, children: t.column.getSortIndex() + 1 }),
|
|
432
436
|
d === "right" && /* @__PURE__ */ n(
|
|
433
|
-
|
|
437
|
+
Ve,
|
|
434
438
|
{
|
|
435
439
|
showOnTruncation: !0,
|
|
436
440
|
message: t.column.columnDef.header,
|
|
437
441
|
position: "bottom",
|
|
438
|
-
children: /* @__PURE__ */ n(
|
|
442
|
+
children: /* @__PURE__ */ n(L, { as: "p", addOverflow: !0, tall: !0, children: t.column.columnDef.header })
|
|
439
443
|
}
|
|
440
444
|
),
|
|
441
445
|
/* @__PURE__ */ n(
|
|
@@ -459,36 +463,36 @@ function Ho({
|
|
|
459
463
|
t.id
|
|
460
464
|
);
|
|
461
465
|
}
|
|
462
|
-
return /* @__PURE__ */ n(
|
|
463
|
-
|
|
466
|
+
return /* @__PURE__ */ n(Tt.Fragment, { children: t.column.columnDef.meta?.checkbox ? /* @__PURE__ */ n(
|
|
467
|
+
At,
|
|
464
468
|
{
|
|
465
469
|
id: s ? `${s}-header-${t.id}` : void 0,
|
|
466
470
|
testid: l ? `${l}-header-${t.id}` : void 0,
|
|
467
471
|
type: "header",
|
|
468
472
|
component: "checkbox",
|
|
469
473
|
children: /* @__PURE__ */ n(
|
|
470
|
-
|
|
474
|
+
Ft,
|
|
471
475
|
{
|
|
472
476
|
id: s ? `${s}-select-all-checkbox` : void 0,
|
|
473
477
|
testid: l ? `${l}-select-all-checkbox` : void 0,
|
|
474
|
-
checked:
|
|
475
|
-
indeterminate:
|
|
476
|
-
onChange:
|
|
478
|
+
checked: de,
|
|
479
|
+
indeterminate: Rt,
|
|
480
|
+
onChange: zt
|
|
477
481
|
}
|
|
478
482
|
)
|
|
479
483
|
}
|
|
480
|
-
) :
|
|
484
|
+
) : Kt(
|
|
481
485
|
t.column.columnDef.header,
|
|
482
486
|
t.getContext()
|
|
483
487
|
) }, t.id);
|
|
484
488
|
}
|
|
485
489
|
}),
|
|
486
|
-
|
|
490
|
+
$ ? (
|
|
487
491
|
//fake empty column to the right for virtualization scroll padding
|
|
488
492
|
/* @__PURE__ */ n(
|
|
489
493
|
"th",
|
|
490
494
|
{
|
|
491
|
-
style: { display: "flex", width:
|
|
495
|
+
style: { display: "flex", width: $ }
|
|
492
496
|
}
|
|
493
497
|
)
|
|
494
498
|
) : null
|
|
@@ -497,95 +501,95 @@ function Ho({
|
|
|
497
501
|
e.id
|
|
498
502
|
)) }),
|
|
499
503
|
/* @__PURE__ */ n(
|
|
500
|
-
|
|
504
|
+
lo,
|
|
501
505
|
{
|
|
502
506
|
id: s,
|
|
503
507
|
testid: l,
|
|
504
|
-
columnVirtualizer:
|
|
508
|
+
columnVirtualizer: C,
|
|
505
509
|
table: i,
|
|
506
510
|
tableContainerRef: f,
|
|
507
|
-
virtualPaddingLeft:
|
|
508
|
-
virtualPaddingRight:
|
|
511
|
+
virtualPaddingLeft: V,
|
|
512
|
+
virtualPaddingRight: $,
|
|
509
513
|
pagination: r,
|
|
510
|
-
isLoadingMore:
|
|
511
|
-
hasMore:
|
|
512
|
-
showFilterRow:
|
|
514
|
+
isLoadingMore: E,
|
|
515
|
+
hasMore: Q,
|
|
516
|
+
showFilterRow: J,
|
|
513
517
|
enableColumnSelector: ve,
|
|
514
|
-
groupRowMode:
|
|
515
|
-
groupSelectionMode:
|
|
516
|
-
rowDisabled:
|
|
517
|
-
rowDisabledAccessor:
|
|
518
|
-
hoveredRowId:
|
|
519
|
-
setHoveredRowId:
|
|
518
|
+
groupRowMode: ee,
|
|
519
|
+
groupSelectionMode: oe,
|
|
520
|
+
rowDisabled: tt,
|
|
521
|
+
rowDisabledAccessor: ot,
|
|
522
|
+
hoveredRowId: ne,
|
|
523
|
+
setHoveredRowId: re
|
|
520
524
|
}
|
|
521
525
|
),
|
|
522
|
-
|
|
523
|
-
|
|
526
|
+
x && /* @__PURE__ */ n(
|
|
527
|
+
so,
|
|
524
528
|
{
|
|
525
529
|
id: s,
|
|
526
530
|
testid: l,
|
|
527
531
|
table: i,
|
|
528
|
-
summaryConfig:
|
|
532
|
+
summaryConfig: x,
|
|
529
533
|
filteredRows: me,
|
|
530
534
|
allRows: ue,
|
|
531
|
-
totalRowCount:
|
|
535
|
+
totalRowCount: W,
|
|
532
536
|
locked: !1
|
|
533
537
|
}
|
|
534
538
|
)
|
|
535
539
|
] }),
|
|
536
540
|
/* @__PURE__ */ n(
|
|
537
|
-
|
|
541
|
+
Ge,
|
|
538
542
|
{
|
|
539
543
|
id: s,
|
|
540
544
|
enableColumnSelector: ve,
|
|
541
|
-
toggleColumnVisibility:
|
|
542
|
-
resetColumnVisibility:
|
|
545
|
+
toggleColumnVisibility: yt,
|
|
546
|
+
resetColumnVisibility: mt,
|
|
543
547
|
testid: l,
|
|
544
548
|
pinDirection: "right",
|
|
545
549
|
table: i,
|
|
546
550
|
tableContainerRef: f,
|
|
547
551
|
pagination: r,
|
|
548
|
-
isLoadingMore:
|
|
549
|
-
hasMore:
|
|
550
|
-
showFilterRow:
|
|
551
|
-
groupRowMode:
|
|
552
|
-
groupSelectionMode:
|
|
553
|
-
allowUserGrouping:
|
|
554
|
-
hoveredRowId:
|
|
555
|
-
setHoveredRowId:
|
|
556
|
-
summaryRow:
|
|
552
|
+
isLoadingMore: E,
|
|
553
|
+
hasMore: Q,
|
|
554
|
+
showFilterRow: J,
|
|
555
|
+
groupRowMode: ee,
|
|
556
|
+
groupSelectionMode: oe,
|
|
557
|
+
allowUserGrouping: te,
|
|
558
|
+
hoveredRowId: ne,
|
|
559
|
+
setHoveredRowId: re,
|
|
560
|
+
summaryRow: x,
|
|
557
561
|
filteredRows: me,
|
|
558
562
|
allRows: ue,
|
|
559
|
-
totalRowCount:
|
|
563
|
+
totalRowCount: W
|
|
560
564
|
}
|
|
561
565
|
)
|
|
562
566
|
]
|
|
563
567
|
}
|
|
564
568
|
),
|
|
565
|
-
|
|
569
|
+
h && H && /* @__PURE__ */ a(
|
|
566
570
|
"div",
|
|
567
571
|
{
|
|
568
572
|
className: v(
|
|
569
|
-
|
|
573
|
+
qe,
|
|
570
574
|
"flex flex-col items-center justify-center",
|
|
571
|
-
|
|
572
|
-
|
|
575
|
+
je,
|
|
576
|
+
Fe
|
|
573
577
|
),
|
|
574
578
|
children: [
|
|
575
|
-
/* @__PURE__ */ n(
|
|
576
|
-
/* @__PURE__ */ n(
|
|
577
|
-
be && /* @__PURE__ */ n(
|
|
579
|
+
/* @__PURE__ */ n(ge, { size: "large" }),
|
|
580
|
+
/* @__PURE__ */ n(L, { color: "text-secondary-normal", children: nt }),
|
|
581
|
+
be && /* @__PURE__ */ n(y, { color: "text-secondary-normal", children: be })
|
|
578
582
|
]
|
|
579
583
|
}
|
|
580
584
|
),
|
|
581
|
-
!
|
|
585
|
+
!h && H && /* @__PURE__ */ a(
|
|
582
586
|
"div",
|
|
583
587
|
{
|
|
584
588
|
className: v(
|
|
585
|
-
|
|
589
|
+
qe,
|
|
586
590
|
"flex flex-col items-center justify-center",
|
|
587
|
-
|
|
588
|
-
|
|
591
|
+
je,
|
|
592
|
+
Fe
|
|
589
593
|
),
|
|
590
594
|
"data-testid": l ? `${l}-no-results` : void 0,
|
|
591
595
|
children: [
|
|
@@ -599,17 +603,17 @@ function Ho({
|
|
|
599
603
|
height: 120
|
|
600
604
|
}
|
|
601
605
|
),
|
|
602
|
-
/* @__PURE__ */ n(
|
|
603
|
-
/* @__PURE__ */ n(
|
|
606
|
+
/* @__PURE__ */ n(L, { color: "text-secondary-normal", children: "No Results" }),
|
|
607
|
+
/* @__PURE__ */ n(y, { color: "text-secondary-normal", children: "To view results, enter or update your search criteria." })
|
|
604
608
|
]
|
|
605
609
|
}
|
|
606
610
|
),
|
|
607
|
-
!
|
|
611
|
+
!Qe && /* @__PURE__ */ a("div", { className: v("p-2 pt-[7px] border-t border-border-primary-normal min-h-[34px]", !R && "h-full"), children: [
|
|
608
612
|
r && /* @__PURE__ */ a("div", { className: "flex justify-between items-center", children: [
|
|
609
|
-
/* @__PURE__ */ n("div", { className: "flex items-center gap-1 w-min", children:
|
|
610
|
-
/* @__PURE__ */ n(
|
|
611
|
-
/* @__PURE__ */ n(
|
|
612
|
-
] }) : /* @__PURE__ */ a(
|
|
613
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-1 w-min", children: h ? /* @__PURE__ */ a("div", { className: "flex items-center gap-2 whitespace-nowrap", children: [
|
|
614
|
+
/* @__PURE__ */ n(ge, { size: "small" }),
|
|
615
|
+
/* @__PURE__ */ n(y, { children: T || "Loading..." })
|
|
616
|
+
] }) : /* @__PURE__ */ a(Dt, { children: [
|
|
613
617
|
/* @__PURE__ */ n(
|
|
614
618
|
Ht,
|
|
615
619
|
{
|
|
@@ -619,13 +623,13 @@ function Ho({
|
|
|
619
623
|
value: r.pageSize.toString(),
|
|
620
624
|
onChange: (e) => r.onPageSizeChange?.(Number(e.target.value)),
|
|
621
625
|
renderMenu: (e) => /* @__PURE__ */ n(
|
|
622
|
-
|
|
626
|
+
Ot,
|
|
623
627
|
{
|
|
624
628
|
...e,
|
|
625
629
|
id: s ? `${s}-pagesize-menu` : void 0,
|
|
626
630
|
testid: l ? `${l}-pagesize-menu` : void 0,
|
|
627
|
-
children:
|
|
628
|
-
|
|
631
|
+
children: fo.map((o) => /* @__PURE__ */ n(
|
|
632
|
+
Vt,
|
|
629
633
|
{
|
|
630
634
|
id: s ? `${s}-pagesize-option-${o}` : void 0,
|
|
631
635
|
selected: r.pageSize === o,
|
|
@@ -638,22 +642,22 @@ function Ho({
|
|
|
638
642
|
)
|
|
639
643
|
}
|
|
640
644
|
),
|
|
641
|
-
/* @__PURE__ */ n(
|
|
645
|
+
/* @__PURE__ */ n(Gt, { children: "Per Page" })
|
|
642
646
|
] }) }),
|
|
643
647
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
644
648
|
/* @__PURE__ */ n(
|
|
645
|
-
|
|
649
|
+
_e,
|
|
646
650
|
{
|
|
647
651
|
id: s ? `${s}-prev-page-button` : void 0,
|
|
648
652
|
testid: l ? `${l}-prev-page-button` : void 0,
|
|
649
653
|
iconOnly: !0,
|
|
650
|
-
leftIcon: /* @__PURE__ */ n(
|
|
654
|
+
leftIcon: /* @__PURE__ */ n(Ae, { name: "chevron_left" }),
|
|
651
655
|
onClick: () => r.onPageChange(r.pageIndex - 1),
|
|
652
656
|
variant: "tertiary",
|
|
653
657
|
disabled: r.pageIndex === 0
|
|
654
658
|
}
|
|
655
659
|
),
|
|
656
|
-
/* @__PURE__ */ a(
|
|
660
|
+
/* @__PURE__ */ a(y, { children: [
|
|
657
661
|
r.pageIndex * r.pageSize + 1,
|
|
658
662
|
" -",
|
|
659
663
|
" ",
|
|
@@ -666,12 +670,12 @@ function Ho({
|
|
|
666
670
|
r.total
|
|
667
671
|
] }),
|
|
668
672
|
/* @__PURE__ */ n(
|
|
669
|
-
|
|
673
|
+
_e,
|
|
670
674
|
{
|
|
671
675
|
id: s ? `${s}-next-page-button` : void 0,
|
|
672
676
|
testid: l ? `${l}-next-page-button` : void 0,
|
|
673
677
|
iconOnly: !0,
|
|
674
|
-
leftIcon: /* @__PURE__ */ n(
|
|
678
|
+
leftIcon: /* @__PURE__ */ n(Ae, { name: "chevron_right" }),
|
|
675
679
|
onClick: () => r.onPageChange(r.pageIndex + 1),
|
|
676
680
|
variant: "tertiary",
|
|
677
681
|
disabled: (r.pageIndex + 1) * r.pageSize >= r.total
|
|
@@ -679,15 +683,15 @@ function Ho({
|
|
|
679
683
|
)
|
|
680
684
|
] })
|
|
681
685
|
] }),
|
|
682
|
-
!r &&
|
|
683
|
-
/* @__PURE__ */ n(
|
|
684
|
-
/* @__PURE__ */ n(
|
|
686
|
+
!r && h && /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
687
|
+
/* @__PURE__ */ n(ge, { size: "small" }),
|
|
688
|
+
/* @__PURE__ */ n(y, { testid: l ? `${l}-status-text` : void 0, children: T || "Loading..." })
|
|
685
689
|
] }),
|
|
686
|
-
!r && !
|
|
687
|
-
|
|
690
|
+
!r && !h && T && /* @__PURE__ */ n(
|
|
691
|
+
y,
|
|
688
692
|
{
|
|
689
693
|
testid: l ? `${l}-status-text` : void 0,
|
|
690
|
-
children:
|
|
694
|
+
children: T
|
|
691
695
|
}
|
|
692
696
|
)
|
|
693
697
|
] })
|
|
@@ -702,7 +706,7 @@ function Ho({
|
|
|
702
706
|
}
|
|
703
707
|
);
|
|
704
708
|
}
|
|
705
|
-
function
|
|
709
|
+
function k(s) {
|
|
706
710
|
return (b) => {
|
|
707
711
|
s(
|
|
708
712
|
(l) => typeof b == "function" ? b(l) : b
|