@pibit.ai/cure-design-system 0.3.48 → 0.3.50
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/assets/icons/filtered-view.svg.js +4 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +103 -92
- package/dist/patterns/table/TableWrapper.d.ts.map +1 -1
- package/dist/patterns/table/TableWrapper.js +447 -447
- package/dist/patterns/table/TableZoomControl.d.ts +2 -2
- package/dist/patterns/table/TableZoomControl.d.ts.map +1 -1
- package/dist/patterns/table/TableZoomControl.js +124 -46
- package/dist/patterns/table/index.d.ts +2 -2
- package/dist/patterns/table/index.d.ts.map +1 -1
- package/dist/patterns/table/storyHelpers/mockTableViewsApi.d.ts +25 -0
- package/dist/patterns/table/storyHelpers/mockTableViewsApi.d.ts.map +1 -0
- package/dist/patterns/table/tableZoomLayout.d.ts +6 -0
- package/dist/patterns/table/tableZoomLayout.d.ts.map +1 -1
- package/dist/patterns/table/tableZoomLayout.js +39 -33
- package/dist/patterns/table/toolbar/SummaryFooter.d.ts +10 -3
- package/dist/patterns/table/toolbar/SummaryFooter.d.ts.map +1 -1
- package/dist/patterns/table/toolbar/SummaryFooter.js +61 -71
- package/dist/patterns/table/toolbar/TableToolbar.d.ts +8 -0
- package/dist/patterns/table/toolbar/TableToolbar.d.ts.map +1 -1
- package/dist/patterns/table/toolbar/TableToolbar.js +200 -159
- package/dist/patterns/table/toolbar/TableViewDirtyActions.d.ts +7 -0
- package/dist/patterns/table/toolbar/TableViewDirtyActions.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/TableViewDirtyActions.js +39 -0
- package/dist/patterns/table/toolbar/TableViewsDropdown.d.ts +8 -0
- package/dist/patterns/table/toolbar/TableViewsDropdown.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/TableViewsDropdown.js +171 -0
- package/dist/patterns/table/toolbar/index.d.ts +4 -0
- package/dist/patterns/table/toolbar/index.d.ts.map +1 -1
- package/dist/patterns/table/toolbar/tableViewSnapshot.d.ts +18 -0
- package/dist/patterns/table/toolbar/tableViewSnapshot.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/tableViewSnapshot.js +168 -0
- package/dist/patterns/table/toolbar/tableViewSnapshot.test.d.ts +2 -0
- package/dist/patterns/table/toolbar/tableViewSnapshot.test.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/tableViewTypes.d.ts +73 -0
- package/dist/patterns/table/toolbar/tableViewTypes.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/tableViewTypes.js +4 -0
- package/dist/patterns/table/types.d.ts +24 -1
- package/dist/patterns/table/types.d.ts.map +1 -1
- package/dist/patterns/table/useFitTableToViewport.d.ts +15 -0
- package/dist/patterns/table/useFitTableToViewport.d.ts.map +1 -0
- package/dist/patterns/table/useFitTableToViewport.js +47 -0
- package/dist/patterns/table/useTableZoomState.d.ts +20 -0
- package/dist/patterns/table/useTableZoomState.d.ts.map +1 -0
- package/dist/patterns/table/useTableZoomState.js +30 -0
- package/dist/patterns/table-component/TableComponent.d.ts.map +1 -1
- package/dist/patterns/table-component/TableComponent.js +331 -335
- package/dist/styles/components.css +1 -1
- package/package.json +1 -1
|
@@ -1,38 +1,40 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { functionalUpdate as
|
|
1
|
+
import { jsx as i, jsxs as m, Fragment as sn } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as ln, useCallback as A, useMemo as v, useRef as oe, useState as Ne, useLayoutEffect as an, Fragment as dn } from "react";
|
|
3
|
+
import { functionalUpdate as Ye, useTable as cn } from "@tanstack/react-table";
|
|
4
4
|
import { ArrowDown as un, ChevronSelectorVertical as mn, ChevronRight as $e } from "@untitledui/icons";
|
|
5
|
-
import { Checkbox as
|
|
5
|
+
import { Checkbox as Ue } from "../../primitives/checkbox/checkbox.js";
|
|
6
6
|
import { ShimmerLine as fn } from "../../primitives/shimmer/shimmer.js";
|
|
7
7
|
import { cn as d } from "../../utils/cn.js";
|
|
8
|
-
import { selectionFromSingleCell as pn, getCellRangeVisualState as
|
|
8
|
+
import { selectionFromSingleCell as pn, getCellRangeVisualState as bn, cellRangeEdgeBoxShadow as hn } from "../table/cellRangeSelection.js";
|
|
9
9
|
import { useCellRangeSelection as gn } from "./useCellRangeSelection.js";
|
|
10
10
|
import { useRowReorderDrag as xn } from "./useRowReorderDrag.js";
|
|
11
11
|
import { GridNavProvider as yn } from "../table/useGridKeyboardNavigation.js";
|
|
12
12
|
import { ROW_DRAG_SOURCE_STYLE as wn, ROW_SOURCE_INDEX_ATTR as vn, ROW_REORDER_ATTR as Cn, FloatingRowPreview as Sn, DropIndicatorLine as In } from "../table/rowReorderDrag.js";
|
|
13
13
|
import { buildTableComponentColumns as Nn } from "./buildTableColumns.js";
|
|
14
|
-
import { HEADER_PADDING_CLASS as En, ROW_HEIGHT_CLASS as
|
|
15
|
-
import { tableComponentFeatures as
|
|
16
|
-
import { TableZoomControl as
|
|
17
|
-
import {
|
|
18
|
-
|
|
14
|
+
import { HEADER_PADDING_CLASS as En, ROW_HEIGHT_CLASS as Ze, CELL_PADDING_CLASS as He } from "./rowMetrics.js";
|
|
15
|
+
import { tableComponentFeatures as Tn } from "./tableFeatures.js";
|
|
16
|
+
import { TableZoomControl as _n } from "../table/TableZoomControl.js";
|
|
17
|
+
import { useFitTableToViewport as Ln } from "../table/useFitTableToViewport.js";
|
|
18
|
+
import { useTableZoomState as Rn } from "../table/useTableZoomState.js";
|
|
19
|
+
import { DEFAULT_TABLE_ZOOM_MIN as Wn, parsePxValue as Ee, DEFAULT_ZOOMABLE_COLUMN_MIN_WIDTH as qe, supportsCssZoom as Dn, computeFillBaseWidth as kn, computeEffectiveTableWidth as On, computeFlexColumnWidth as zn, getTableZoomFontSize as An, computeNeedsHorizontalScroll as Fn, DEFAULT_COLUMN_MAX_WIDTH as Pn } from "../table/tableZoomLayout.js";
|
|
20
|
+
const Vn = 5, jn = Dn(), Mn = (r) => r === "center" ? "text-center" : r === "right" ? "text-right" : "text-left", Ge = (r) => r === "center" ? "justify-center" : r === "right" ? "justify-end" : "justify-start", ne = (r, l) => {
|
|
19
21
|
const c = r.__sourceIndex;
|
|
20
22
|
return typeof c == "number" ? c : Number.isFinite(l) ? l : null;
|
|
21
|
-
},
|
|
23
|
+
}, Be = (r) => r instanceof HTMLElement && !!r.closest(
|
|
22
24
|
'button,a,input,textarea,select,[contenteditable]:not([contenteditable="false"]),[role="button"],[role="menuitem"]'
|
|
23
|
-
),
|
|
24
|
-
const [
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
(
|
|
28
|
-
var
|
|
29
|
-
const
|
|
30
|
-
|
|
25
|
+
), z = (r, l, c) => {
|
|
26
|
+
const [L, R] = Ne(l), f = r ?? L, C = oe(f), p = oe(c);
|
|
27
|
+
C.current = f, p.current = c;
|
|
28
|
+
const ie = A(
|
|
29
|
+
(g) => {
|
|
30
|
+
var x;
|
|
31
|
+
const I = Ye(g, C.current);
|
|
32
|
+
C.current = I, r === void 0 && R(I), (x = p.current) == null || x.call(p, I);
|
|
31
33
|
},
|
|
32
34
|
[r]
|
|
33
35
|
);
|
|
34
|
-
return [
|
|
35
|
-
},
|
|
36
|
+
return [f, ie];
|
|
37
|
+
}, Kn = (r, l) => {
|
|
36
38
|
if (!r) return;
|
|
37
39
|
const c = r.sticky ? {
|
|
38
40
|
position: "sticky",
|
|
@@ -43,50 +45,50 @@ const Vn = 5, jn = kn(), Kn = (r) => r === "center" ? "text-center" : r === "rig
|
|
|
43
45
|
} : {};
|
|
44
46
|
return {
|
|
45
47
|
width: r.width,
|
|
46
|
-
minWidth: r.minWidth ?? r.width ?? `${
|
|
47
|
-
maxWidth: r.maxWidth ??
|
|
48
|
+
minWidth: r.minWidth ?? r.width ?? `${re}px`,
|
|
49
|
+
maxWidth: r.maxWidth ?? Pn,
|
|
48
50
|
...c
|
|
49
51
|
};
|
|
50
|
-
},
|
|
52
|
+
}, re = 120, Ie = (r) => !!(r.maxWidth && r.sticky === "right"), $n = (r, l = re) => Ee(r.minWidth) || l, Xe = (r, l, c, L) => {
|
|
51
53
|
if (l === "multiple") return r;
|
|
52
|
-
if (r === !0) return
|
|
53
|
-
const
|
|
54
|
-
Object.keys(c).filter((
|
|
55
|
-
) : /* @__PURE__ */ new Set(),
|
|
56
|
-
return
|
|
54
|
+
if (r === !0) return L ? { [L]: !0 } : {};
|
|
55
|
+
const R = c && c !== !0 ? new Set(
|
|
56
|
+
Object.keys(c).filter((p) => c[p])
|
|
57
|
+
) : /* @__PURE__ */ new Set(), f = Object.keys(r).filter((p) => r[p]), C = f.find((p) => !R.has(p)) ?? f[0];
|
|
58
|
+
return C ? { [C]: !0 } : {};
|
|
57
59
|
};
|
|
58
|
-
function
|
|
60
|
+
function Un({
|
|
59
61
|
data: r,
|
|
60
62
|
columns: l,
|
|
61
63
|
getRowId: c,
|
|
62
|
-
ariaLabel:
|
|
63
|
-
headerGroups:
|
|
64
|
-
size:
|
|
65
|
-
loading:
|
|
66
|
-
loadingRowCount:
|
|
67
|
-
emptyState:
|
|
68
|
-
showBorders:
|
|
69
|
-
removeRowBorders:
|
|
70
|
-
fillWidth:
|
|
71
|
-
zoom:
|
|
64
|
+
ariaLabel: L,
|
|
65
|
+
headerGroups: R,
|
|
66
|
+
size: f = "xs",
|
|
67
|
+
loading: C = !1,
|
|
68
|
+
loadingRowCount: p = Vn,
|
|
69
|
+
emptyState: ie = "No data found",
|
|
70
|
+
showBorders: g = !1,
|
|
71
|
+
removeRowBorders: I = !1,
|
|
72
|
+
fillWidth: x = !1,
|
|
73
|
+
zoom: Je,
|
|
72
74
|
zoomDisabled: Qe = !1,
|
|
73
|
-
className:
|
|
75
|
+
className: Te,
|
|
74
76
|
rootClassName: et,
|
|
75
77
|
tableClassName: tt,
|
|
76
78
|
headerClassName: nt,
|
|
77
|
-
getRowClassName:
|
|
78
|
-
onRowClick:
|
|
79
|
-
onRowHover:
|
|
79
|
+
getRowClassName: se,
|
|
80
|
+
onRowClick: le,
|
|
81
|
+
onRowHover: $,
|
|
80
82
|
toolbar: ot,
|
|
81
|
-
renderToolbar:
|
|
82
|
-
pagination:
|
|
83
|
+
renderToolbar: ae,
|
|
84
|
+
pagination: _e,
|
|
83
85
|
summaryRow: rt,
|
|
84
|
-
rowGroups:
|
|
85
|
-
renderGroupHeader:
|
|
86
|
+
rowGroups: F,
|
|
87
|
+
renderGroupHeader: de,
|
|
86
88
|
collapsedGroupIds: it,
|
|
87
89
|
defaultCollapsedGroupIds: st = [],
|
|
88
90
|
onCollapsedGroupIdsChange: lt,
|
|
89
|
-
enableSorting:
|
|
91
|
+
enableSorting: Le = !1,
|
|
90
92
|
sorting: at,
|
|
91
93
|
defaultSorting: dt = [],
|
|
92
94
|
onSortingChange: ct,
|
|
@@ -94,217 +96,211 @@ function Hn({
|
|
|
94
96
|
defaultColumnVisibility: mt = {},
|
|
95
97
|
onColumnVisibilityChange: ft,
|
|
96
98
|
columnOrder: pt,
|
|
97
|
-
defaultColumnOrder:
|
|
98
|
-
onColumnOrderChange:
|
|
99
|
-
selectionMode:
|
|
99
|
+
defaultColumnOrder: bt = [],
|
|
100
|
+
onColumnOrderChange: ht,
|
|
101
|
+
selectionMode: U = "none",
|
|
100
102
|
rowSelection: gt,
|
|
101
103
|
defaultRowSelection: xt = {},
|
|
102
104
|
onRowSelectionChange: yt,
|
|
103
105
|
expanded: wt,
|
|
104
106
|
defaultExpanded: vt = {},
|
|
105
107
|
onExpandedChange: Ct,
|
|
106
|
-
expansionMode:
|
|
107
|
-
getRowCanExpand:
|
|
108
|
-
renderExpandedContent:
|
|
109
|
-
onCellClick:
|
|
110
|
-
onCellDoubleClick:
|
|
111
|
-
onCellActivate:
|
|
112
|
-
cellSelection:
|
|
108
|
+
expansionMode: ce = "multiple",
|
|
109
|
+
getRowCanExpand: ue,
|
|
110
|
+
renderExpandedContent: Z,
|
|
111
|
+
onCellClick: me,
|
|
112
|
+
onCellDoubleClick: fe,
|
|
113
|
+
onCellActivate: W,
|
|
114
|
+
cellSelection: H,
|
|
113
115
|
onCellSelectionChange: P,
|
|
114
116
|
onCopyCells: St,
|
|
115
117
|
onPasteCells: It,
|
|
116
118
|
onClearCells: Nt,
|
|
117
|
-
onReorderRows:
|
|
119
|
+
onReorderRows: Re,
|
|
118
120
|
enableRowReorder: Et,
|
|
119
|
-
activateOnSingleClick:
|
|
120
|
-
},
|
|
121
|
-
var
|
|
122
|
-
const
|
|
123
|
-
() => m ? Rn(m) : null,
|
|
124
|
-
[m == null ? void 0 : m.defaultZoom, m == null ? void 0 : m.minZoom, m == null ? void 0 : m.maxZoom, m == null ? void 0 : m.step]
|
|
125
|
-
), [G, De] = re(
|
|
126
|
-
() => (u == null ? void 0 : u.defaultZoom) ?? Tn
|
|
127
|
-
), C = u !== null && jn, M = C ? G / 100 : 1, X = C ? Zn(G) : void 0, Lt = (u == null ? void 0 : u.minZoom) ?? Wn;
|
|
128
|
-
ln(() => {
|
|
129
|
-
u && De(
|
|
130
|
-
(e) => Dn(e, u.minZoom, u.maxZoom)
|
|
131
|
-
);
|
|
132
|
-
}, [u]);
|
|
133
|
-
const [Rt, Tt] = A(
|
|
121
|
+
activateOnSingleClick: Tt
|
|
122
|
+
}, q) {
|
|
123
|
+
var Me;
|
|
124
|
+
const { zoomConfig: N, zoomPercent: V, setZoomPercent: We } = Rn(Je), y = N !== null && jn, j = y ? V / 100 : 1, G = y ? An(V) : void 0, _t = (N == null ? void 0 : N.minZoom) ?? Wn, [Lt, Rt] = z(
|
|
134
125
|
at,
|
|
135
126
|
dt,
|
|
136
127
|
ct
|
|
137
|
-
), [Wt, Dt] =
|
|
128
|
+
), [Wt, Dt] = z(
|
|
138
129
|
ut,
|
|
139
130
|
mt,
|
|
140
131
|
ft
|
|
141
|
-
), [kt, Ot] =
|
|
132
|
+
), [kt, Ot] = z(
|
|
142
133
|
pt,
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
), [
|
|
134
|
+
bt,
|
|
135
|
+
ht
|
|
136
|
+
), [zt, At] = z(
|
|
146
137
|
gt,
|
|
147
138
|
xt,
|
|
148
139
|
yt
|
|
149
|
-
), [
|
|
140
|
+
), [Ft, De] = z(
|
|
150
141
|
wt,
|
|
151
142
|
vt,
|
|
152
143
|
Ct
|
|
153
|
-
),
|
|
154
|
-
|
|
155
|
-
|
|
144
|
+
), pe = r.length > 0 ? c(r[0], 0) : void 0, Pt = Xe(
|
|
145
|
+
Ft,
|
|
146
|
+
ce,
|
|
156
147
|
void 0,
|
|
157
|
-
|
|
158
|
-
),
|
|
148
|
+
pe
|
|
149
|
+
), Vt = A(
|
|
159
150
|
(e) => {
|
|
160
|
-
|
|
161
|
-
(t) =>
|
|
162
|
-
|
|
163
|
-
|
|
151
|
+
De(
|
|
152
|
+
(t) => Xe(
|
|
153
|
+
Ye(e, t),
|
|
154
|
+
ce,
|
|
164
155
|
t,
|
|
165
|
-
|
|
156
|
+
pe
|
|
166
157
|
)
|
|
167
158
|
);
|
|
168
159
|
},
|
|
169
|
-
[
|
|
170
|
-
), [
|
|
160
|
+
[ce, pe, De]
|
|
161
|
+
), [ke, Oe] = z(
|
|
171
162
|
it,
|
|
172
163
|
st,
|
|
173
164
|
lt
|
|
174
|
-
),
|
|
175
|
-
() => new Set(
|
|
176
|
-
[
|
|
177
|
-
),
|
|
178
|
-
(e) =>
|
|
165
|
+
), be = v(
|
|
166
|
+
() => new Set(ke),
|
|
167
|
+
[ke]
|
|
168
|
+
), jt = A(
|
|
169
|
+
(e) => Oe(
|
|
179
170
|
(t) => t.includes(e) ? t.filter((o) => o !== e) : [...t, e]
|
|
180
171
|
),
|
|
181
|
-
[
|
|
182
|
-
),
|
|
172
|
+
[Oe]
|
|
173
|
+
), D = oe(null), [M, ze] = Ne(null), Mt = Ln({
|
|
174
|
+
containerRef: D,
|
|
175
|
+
zoomConfig: N,
|
|
176
|
+
zoomPercent: V,
|
|
177
|
+
setZoomPercent: We
|
|
178
|
+
});
|
|
183
179
|
an(() => {
|
|
184
|
-
if (!
|
|
185
|
-
|
|
180
|
+
if (!x) {
|
|
181
|
+
ze(null);
|
|
186
182
|
return;
|
|
187
183
|
}
|
|
188
|
-
const e =
|
|
184
|
+
const e = D.current;
|
|
189
185
|
if (!e || typeof ResizeObserver > "u") return;
|
|
190
186
|
const t = () => {
|
|
191
187
|
const n = e.clientWidth;
|
|
192
|
-
n > 0 &&
|
|
188
|
+
n > 0 && ze(
|
|
193
189
|
(s) => s === n ? s : n
|
|
194
190
|
);
|
|
195
191
|
};
|
|
196
192
|
t();
|
|
197
193
|
const o = new ResizeObserver(t);
|
|
198
194
|
return o.observe(e), () => o.disconnect();
|
|
199
|
-
}, [
|
|
200
|
-
const
|
|
201
|
-
if (!
|
|
195
|
+
}, [x, l.length, r.length, C]);
|
|
196
|
+
const b = v(() => {
|
|
197
|
+
if (!x) return null;
|
|
202
198
|
const e = l.reduce(
|
|
203
|
-
(n, s) =>
|
|
199
|
+
(n, s) => Ie(s) ? n + Ee(s.maxWidth) : n,
|
|
204
200
|
0
|
|
205
|
-
), t = l.filter((n) => !
|
|
201
|
+
), t = l.filter((n) => !Ie(n));
|
|
206
202
|
return { minTableWidth: t.reduce(
|
|
207
203
|
(n, s) => n + $n(
|
|
208
204
|
s,
|
|
209
|
-
|
|
205
|
+
y ? Ee(qe) : re
|
|
210
206
|
),
|
|
211
207
|
0
|
|
212
208
|
) + e, fixedTotal: e, flexibleCount: t.length };
|
|
213
|
-
}, [
|
|
214
|
-
() =>
|
|
215
|
-
[
|
|
216
|
-
),
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
),
|
|
221
|
-
() =>
|
|
222
|
-
[
|
|
223
|
-
),
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
), [
|
|
228
|
-
const o =
|
|
229
|
-
return !
|
|
209
|
+
}, [x, l, y]), he = v(
|
|
210
|
+
() => b ? kn(M, b.minTableWidth) : null,
|
|
211
|
+
[M, b]
|
|
212
|
+
), ge = Fn(
|
|
213
|
+
he,
|
|
214
|
+
M,
|
|
215
|
+
j
|
|
216
|
+
), B = v(
|
|
217
|
+
() => On(he, M, j),
|
|
218
|
+
[he, M, j]
|
|
219
|
+
), Ae = v(() => !b || b.flexibleCount === 0 ? null : zn(
|
|
220
|
+
B,
|
|
221
|
+
b.fixedTotal,
|
|
222
|
+
b.flexibleCount
|
|
223
|
+
), [b, B]), X = (e, t) => {
|
|
224
|
+
const o = Kn(e, t);
|
|
225
|
+
return !x || !e ? o : Ie(e) ? {
|
|
230
226
|
...o,
|
|
231
227
|
width: e.maxWidth,
|
|
232
228
|
minWidth: e.maxWidth,
|
|
233
229
|
maxWidth: e.maxWidth
|
|
234
|
-
} :
|
|
230
|
+
} : Ae == null ? o : {
|
|
235
231
|
...o,
|
|
236
|
-
width: `${
|
|
237
|
-
minWidth: e.minWidth ?? (
|
|
232
|
+
width: `${Ae}px`,
|
|
233
|
+
minWidth: e.minWidth ?? (y ? qe : `${re}px`)
|
|
238
234
|
};
|
|
239
|
-
},
|
|
235
|
+
}, xe = v(
|
|
240
236
|
() => new Map(l.map((e) => [e.id, e])),
|
|
241
237
|
[l]
|
|
242
|
-
),
|
|
243
|
-
() => Nn(l,
|
|
244
|
-
[l,
|
|
245
|
-
),
|
|
246
|
-
features:
|
|
238
|
+
), Kt = v(
|
|
239
|
+
() => Nn(l, R),
|
|
240
|
+
[l, R]
|
|
241
|
+
), S = cn({
|
|
242
|
+
features: Tn,
|
|
247
243
|
data: r,
|
|
248
|
-
columns:
|
|
244
|
+
columns: Kt,
|
|
249
245
|
getRowId: c,
|
|
250
|
-
enableSorting:
|
|
246
|
+
enableSorting: Le,
|
|
251
247
|
enableCellSpanning: !0,
|
|
252
|
-
enableRowSelection:
|
|
253
|
-
enableMultiRowSelection:
|
|
254
|
-
getRowCanExpand:
|
|
248
|
+
enableRowSelection: U !== "none",
|
|
249
|
+
enableMultiRowSelection: U === "multiple",
|
|
250
|
+
getRowCanExpand: ue && Z ? (e) => ue(e.original) : () => !1,
|
|
255
251
|
state: {
|
|
256
|
-
sorting:
|
|
252
|
+
sorting: Lt,
|
|
257
253
|
columnVisibility: Wt,
|
|
258
254
|
columnOrder: kt,
|
|
259
|
-
rowSelection:
|
|
255
|
+
rowSelection: zt,
|
|
260
256
|
expanded: Pt
|
|
261
257
|
},
|
|
262
|
-
onSortingChange:
|
|
258
|
+
onSortingChange: Rt,
|
|
263
259
|
onColumnVisibilityChange: Dt,
|
|
264
260
|
onColumnOrderChange: Ot,
|
|
265
|
-
onRowSelectionChange:
|
|
266
|
-
onExpandedChange:
|
|
267
|
-
}),
|
|
268
|
-
|
|
261
|
+
onRowSelectionChange: At,
|
|
262
|
+
onExpandedChange: Vt
|
|
263
|
+
}), Y = U !== "none", $t = !!(ue && Z), Ut = Y ? 1 : 0, Zt = S.getVisibleLeafColumns().length, J = Math.max(
|
|
264
|
+
Zt + Ut,
|
|
269
265
|
1
|
|
270
|
-
), Ht = Math.max(
|
|
271
|
-
|
|
266
|
+
), Ht = Math.max(S.getHeaderGroups().length, 1), T = S.getRowModel().rows, ye = y && N ? /* @__PURE__ */ i(
|
|
267
|
+
_n,
|
|
272
268
|
{
|
|
273
|
-
value:
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
269
|
+
value: V,
|
|
270
|
+
minValue: _t,
|
|
271
|
+
maxValue: N.maxZoom,
|
|
272
|
+
step: N.step,
|
|
273
|
+
onChange: We,
|
|
274
|
+
onFitToViewport: Mt,
|
|
279
275
|
isDisabled: Qe
|
|
280
276
|
}
|
|
281
|
-
) : null,
|
|
282
|
-
const e =
|
|
283
|
-
zoom:
|
|
284
|
-
"--table-zoom-font-size":
|
|
277
|
+
) : null, Fe = ae ? ae({ zoomControl: ye, zoomPercent: V }) : ot, Pe = !ae && ye ? /* @__PURE__ */ i("div", { className: "flex justify-end", children: ye }) : null, qt = !!(Fe || Pe || _e), Gt = v(() => {
|
|
278
|
+
const e = y ? {
|
|
279
|
+
zoom: j,
|
|
280
|
+
"--table-zoom-font-size": G ? `${G}px` : void 0
|
|
285
281
|
} : void 0;
|
|
286
|
-
return !
|
|
282
|
+
return !x || !b ? y ? { ...e, width: "max-content", minWidth: "100%" } : void 0 : y ? {
|
|
287
283
|
...e,
|
|
288
284
|
tableLayout: "fixed",
|
|
289
|
-
width: `${
|
|
285
|
+
width: `${B ?? b.minTableWidth}px`
|
|
290
286
|
} : {
|
|
291
287
|
tableLayout: "fixed",
|
|
292
|
-
width:
|
|
288
|
+
width: ge ? `${b.minTableWidth}px` : "100%"
|
|
293
289
|
};
|
|
294
290
|
}, [
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
]),
|
|
291
|
+
B,
|
|
292
|
+
x,
|
|
293
|
+
b,
|
|
294
|
+
ge,
|
|
295
|
+
y,
|
|
296
|
+
j,
|
|
297
|
+
G
|
|
298
|
+
]), Bt = oe(
|
|
303
299
|
null
|
|
304
|
-
), [k, Xt] =
|
|
300
|
+
), [k, Xt] = Ne(null), Yt = !!W, Jt = A(
|
|
305
301
|
(e, t, o) => {
|
|
306
|
-
if (
|
|
307
|
-
const n =
|
|
302
|
+
if (Bt.current = { rowId: e, columnKey: t }, !P) return;
|
|
303
|
+
const n = H;
|
|
308
304
|
n != null && n.anchor.rowId === e && n.anchor.columnKey === t && n.focus.rowId === e && n.focus.columnKey === t || P(
|
|
309
305
|
pn({
|
|
310
306
|
rowId: e,
|
|
@@ -313,17 +309,17 @@ function Hn({
|
|
|
313
309
|
})
|
|
314
310
|
);
|
|
315
311
|
},
|
|
316
|
-
[P,
|
|
317
|
-
),
|
|
312
|
+
[P, H]
|
|
313
|
+
), Qt = A(
|
|
318
314
|
(e) => {
|
|
319
315
|
Xt((t) => t === e || t && e && t.rowId === e.rowId && t.columnKey === e.columnKey ? t : e);
|
|
320
316
|
},
|
|
321
317
|
[]
|
|
322
|
-
),
|
|
323
|
-
enabled:
|
|
324
|
-
onReorderRows:
|
|
325
|
-
containerRef:
|
|
326
|
-
}),
|
|
318
|
+
), Q = !!Re && Et !== !1, u = xn({
|
|
319
|
+
enabled: Q,
|
|
320
|
+
onReorderRows: Re,
|
|
321
|
+
containerRef: D
|
|
322
|
+
}), en = A(
|
|
327
323
|
(e, t, o) => {
|
|
328
324
|
var n;
|
|
329
325
|
return {
|
|
@@ -332,76 +328,76 @@ function Hn({
|
|
|
332
328
|
columnId: t,
|
|
333
329
|
value: o,
|
|
334
330
|
rowIndex: e.index,
|
|
335
|
-
sourceIndex:
|
|
336
|
-
isRowDragging: ((n =
|
|
337
|
-
startRowDrag:
|
|
331
|
+
sourceIndex: ne(e.original, e.index),
|
|
332
|
+
isRowDragging: ((n = u.session) == null ? void 0 : n.active) === !0 && u.session.rowId === e.id,
|
|
333
|
+
startRowDrag: Q ? (s) => u.startDrag(
|
|
338
334
|
s,
|
|
339
335
|
e.id,
|
|
340
|
-
|
|
336
|
+
ne(e.original, e.index) ?? e.index,
|
|
341
337
|
e.original
|
|
342
338
|
) : void 0
|
|
343
339
|
};
|
|
344
340
|
},
|
|
345
341
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
346
|
-
[
|
|
347
|
-
),
|
|
342
|
+
[Q, u.startDrag, u.session]
|
|
343
|
+
), we = T.map((e) => e.id).join("\0"), ve = v(
|
|
344
|
+
() => we ? we.split("\0") : [],
|
|
345
|
+
[we]
|
|
346
|
+
), Ce = S.getVisibleLeafColumns().map((e) => e.id).join("\0"), Se = v(
|
|
348
347
|
() => Ce ? Ce.split("\0") : [],
|
|
349
348
|
[Ce]
|
|
350
|
-
),
|
|
351
|
-
() => Ie ? Ie.split("\0") : [],
|
|
352
|
-
[Ie]
|
|
353
|
-
), O = typeof P == "function", te = gn({
|
|
349
|
+
), O = typeof P == "function", ee = gn({
|
|
354
350
|
enabled: O,
|
|
355
|
-
selection:
|
|
351
|
+
selection: H,
|
|
356
352
|
onSelectionChange: P,
|
|
357
353
|
onCopyCells: St,
|
|
358
354
|
onPasteCells: It,
|
|
359
355
|
onClearCells: Nt,
|
|
360
|
-
onActivateCell:
|
|
361
|
-
const t =
|
|
362
|
-
t &&
|
|
356
|
+
onActivateCell: W ? (e) => {
|
|
357
|
+
const t = T.find((o) => o.id === e.rowId);
|
|
358
|
+
t && W({
|
|
363
359
|
row: t.original,
|
|
364
360
|
rowId: e.rowId,
|
|
365
361
|
columnId: e.columnKey,
|
|
366
362
|
value: void 0,
|
|
367
363
|
rowIndex: t.index,
|
|
368
|
-
sourceIndex: e.sourceIndex ??
|
|
364
|
+
sourceIndex: e.sourceIndex ?? ne(t.original, t.index)
|
|
369
365
|
});
|
|
370
366
|
} : void 0,
|
|
371
|
-
activateOnSingleClick:
|
|
372
|
-
containerRef:
|
|
373
|
-
rowIds:
|
|
374
|
-
columnKeys:
|
|
375
|
-
}),
|
|
376
|
-
if (!(
|
|
377
|
-
const e = new Map(
|
|
378
|
-
for (const n of
|
|
379
|
-
const s = n.rowIds.map((
|
|
367
|
+
activateOnSingleClick: Tt,
|
|
368
|
+
containerRef: D,
|
|
369
|
+
rowIds: ve,
|
|
370
|
+
columnKeys: Se
|
|
371
|
+
}), tn = v(() => {
|
|
372
|
+
if (!(F != null && F.length)) return T.map((n) => ({ kind: "row", row: n }));
|
|
373
|
+
const e = new Map(T.map((n) => [n.id, n])), t = /* @__PURE__ */ new Set(), o = [];
|
|
374
|
+
for (const n of F) {
|
|
375
|
+
const s = n.rowIds.map((h) => e.get(h)).filter((h) => h !== void 0);
|
|
380
376
|
s.length !== 0 && (o.push({
|
|
381
377
|
kind: "group",
|
|
382
378
|
group: { id: n.id, label: n.label, rowCount: s.length }
|
|
383
|
-
}), s.forEach((
|
|
379
|
+
}), s.forEach((h) => t.add(h.id)), !be.has(n.id) && s.forEach((h) => o.push({ kind: "row", row: h })));
|
|
384
380
|
}
|
|
385
|
-
for (const n of
|
|
381
|
+
for (const n of T)
|
|
386
382
|
t.has(n.id) || o.push({ kind: "row", row: n });
|
|
387
383
|
return o;
|
|
388
|
-
}, [
|
|
389
|
-
const t =
|
|
384
|
+
}, [F, T, be]), nn = (e) => {
|
|
385
|
+
const t = be.has(e.id), o = () => jt(e.id);
|
|
390
386
|
return /* @__PURE__ */ i("tr", { className: "bg-secondary_subtle", children: /* @__PURE__ */ i(
|
|
391
387
|
"td",
|
|
392
388
|
{
|
|
393
|
-
colSpan:
|
|
389
|
+
colSpan: J,
|
|
394
390
|
className: d(
|
|
395
|
-
!
|
|
396
|
-
|
|
391
|
+
!de && "py-1.5",
|
|
392
|
+
g && "border-r border-secondary last:border-r-0"
|
|
397
393
|
),
|
|
398
|
-
children:
|
|
394
|
+
children: de ? de({
|
|
399
395
|
id: e.id,
|
|
400
396
|
label: e.label,
|
|
401
397
|
rowCount: e.rowCount,
|
|
402
398
|
isCollapsed: t,
|
|
403
399
|
toggle: o
|
|
404
|
-
}) : /* @__PURE__ */
|
|
400
|
+
}) : /* @__PURE__ */ m(
|
|
405
401
|
"button",
|
|
406
402
|
{
|
|
407
403
|
type: "button",
|
|
@@ -419,7 +415,7 @@ function Hn({
|
|
|
419
415
|
}
|
|
420
416
|
),
|
|
421
417
|
/* @__PURE__ */ i("span", { className: "truncate", children: e.label || "(Empty)" }),
|
|
422
|
-
/* @__PURE__ */
|
|
418
|
+
/* @__PURE__ */ m("span", { className: "text-tertiary", children: [
|
|
423
419
|
"(",
|
|
424
420
|
e.rowCount,
|
|
425
421
|
")"
|
|
@@ -429,61 +425,61 @@ function Hn({
|
|
|
429
425
|
)
|
|
430
426
|
}
|
|
431
427
|
) }, `group-${e.id}`);
|
|
432
|
-
}, Ve = /* @__PURE__ */
|
|
428
|
+
}, Ve = /* @__PURE__ */ m(
|
|
433
429
|
"div",
|
|
434
430
|
{
|
|
435
431
|
ref: (e) => {
|
|
436
|
-
|
|
432
|
+
D.current = e, typeof q == "function" ? q(e) : q && (q.current = e);
|
|
437
433
|
},
|
|
438
|
-
onPointerDownCapture: O ?
|
|
439
|
-
onKeyDownCapture: O ?
|
|
440
|
-
onClickCapture: O ?
|
|
441
|
-
onDoubleClickCapture: O ?
|
|
434
|
+
onPointerDownCapture: O ? ee.onPointerDownCapture : void 0,
|
|
435
|
+
onKeyDownCapture: O ? ee.onKeyDownCapture : void 0,
|
|
436
|
+
onClickCapture: O ? ee.onClickCapture : void 0,
|
|
437
|
+
onDoubleClickCapture: O ? ee.onDoubleClickCapture : void 0,
|
|
442
438
|
className: d(
|
|
443
439
|
"w-full rounded-lg bg-primary",
|
|
444
|
-
|
|
445
|
-
|
|
440
|
+
y || !x || ge ? "overflow-x-auto" : "overflow-x-hidden",
|
|
441
|
+
g && "rounded-xl border border-secondary",
|
|
446
442
|
et
|
|
447
443
|
),
|
|
448
444
|
children: [
|
|
449
|
-
/* @__PURE__ */
|
|
445
|
+
/* @__PURE__ */ m(
|
|
450
446
|
"table",
|
|
451
447
|
{
|
|
452
|
-
"aria-label":
|
|
453
|
-
"data-table-zoom-typography":
|
|
448
|
+
"aria-label": L,
|
|
449
|
+
"data-table-zoom-typography": G !== void 0 ? "" : void 0,
|
|
454
450
|
className: d(
|
|
455
451
|
"w-full border-separate border-spacing-0 overflow-x-hidden",
|
|
456
452
|
tt
|
|
457
453
|
),
|
|
458
|
-
style:
|
|
454
|
+
style: Gt,
|
|
459
455
|
children: [
|
|
460
456
|
/* @__PURE__ */ i(
|
|
461
457
|
"thead",
|
|
462
458
|
{
|
|
463
459
|
className: d(
|
|
464
460
|
"sticky top-0 z-30 rounded-t-lg bg-secondary_subtle [&>tr>th]:h-9 [&>tr>th:first-child]:rounded-tl-lg [&>tr>th:last-child]:rounded-tr-lg",
|
|
465
|
-
|
|
461
|
+
g && "[&>tr>th]:border-b [&>tr>th]:border-secondary [&>tr>th:first-child]:rounded-bl-none [&>tr>th:last-child]:rounded-br-none",
|
|
466
462
|
nt
|
|
467
463
|
),
|
|
468
|
-
children:
|
|
469
|
-
|
|
464
|
+
children: S.getHeaderGroups().map((e, t) => /* @__PURE__ */ m("tr", { children: [
|
|
465
|
+
Y && t === 0 ? /* @__PURE__ */ i(
|
|
470
466
|
"th",
|
|
471
467
|
{
|
|
472
468
|
rowSpan: Ht,
|
|
473
469
|
className: d(
|
|
474
470
|
"relative w-10 min-w-10 p-0 align-middle",
|
|
475
|
-
|
|
471
|
+
g && "border-r border-secondary"
|
|
476
472
|
),
|
|
477
|
-
children:
|
|
473
|
+
children: U === "multiple" ? /* @__PURE__ */ i(
|
|
478
474
|
"div",
|
|
479
475
|
{
|
|
480
476
|
className: "flex items-center justify-center",
|
|
481
477
|
onClick: (o) => o.stopPropagation(),
|
|
482
478
|
children: /* @__PURE__ */ i(
|
|
483
|
-
|
|
479
|
+
Ue,
|
|
484
480
|
{
|
|
485
|
-
checked:
|
|
486
|
-
onCheckedChange: (o) =>
|
|
481
|
+
checked: S.getIsAllRowsSelected() ? !0 : S.getIsSomeRowsSelected() ? "indeterminate" : !1,
|
|
482
|
+
onCheckedChange: (o) => S.toggleAllRowsSelected(o === !0),
|
|
487
483
|
"aria-label": "Select all rows",
|
|
488
484
|
className: "items-center justify-center"
|
|
489
485
|
}
|
|
@@ -494,10 +490,10 @@ function Hn({
|
|
|
494
490
|
) : null,
|
|
495
491
|
e.headers.map((o) => {
|
|
496
492
|
if (o.rowSpan === 0) return null;
|
|
497
|
-
const n =
|
|
493
|
+
const n = xe.get(o.column.id), s = o.column.getIsSorted(), h = Le && !o.isPlaceholder && o.column.getCanSort(), a = n != null && n.renderHeader ? n.renderHeader({
|
|
498
494
|
columnId: n.id,
|
|
499
495
|
label: n.header
|
|
500
|
-
}) : o.isPlaceholder ? null :
|
|
496
|
+
}) : o.isPlaceholder ? null : S.FlexRender({ header: o });
|
|
501
497
|
return /* @__PURE__ */ i(
|
|
502
498
|
"th",
|
|
503
499
|
{
|
|
@@ -505,20 +501,20 @@ function Hn({
|
|
|
505
501
|
rowSpan: o.rowSpan,
|
|
506
502
|
scope: o.colSpan > 1 ? "colgroup" : "col",
|
|
507
503
|
"aria-sort": s === "asc" ? "ascending" : s === "desc" ? "descending" : void 0,
|
|
508
|
-
style:
|
|
504
|
+
style: X(n, !0),
|
|
509
505
|
className: d(
|
|
510
506
|
"relative overflow-hidden p-0 outline-hidden focus-within:z-1 focus-within:ring-2 focus-within:ring-focus-ring focus-within:ring-inset",
|
|
511
|
-
En[
|
|
512
|
-
|
|
507
|
+
En[f],
|
|
508
|
+
g && "border-r border-secondary last:border-r-0",
|
|
513
509
|
n == null ? void 0 : n.headerClassName
|
|
514
510
|
),
|
|
515
|
-
children:
|
|
511
|
+
children: h ? /* @__PURE__ */ m(
|
|
516
512
|
"button",
|
|
517
513
|
{
|
|
518
514
|
type: "button",
|
|
519
515
|
className: d(
|
|
520
516
|
"flex w-full items-center gap-1 overflow-hidden rounded outline-none",
|
|
521
|
-
|
|
517
|
+
Ge(n == null ? void 0 : n.align)
|
|
522
518
|
),
|
|
523
519
|
onClick: o.column.getToggleSortingHandler(),
|
|
524
520
|
"aria-label": `Sort by ${String((n == null ? void 0 : n.header) ?? o.column.id)}`,
|
|
@@ -547,7 +543,7 @@ function Hn({
|
|
|
547
543
|
{
|
|
548
544
|
className: d(
|
|
549
545
|
"flex items-center gap-1 overflow-hidden",
|
|
550
|
-
|
|
546
|
+
Ge(n == null ? void 0 : n.align)
|
|
551
547
|
),
|
|
552
548
|
children: /* @__PURE__ */ i("div", { className: "flex items-center overflow-hidden text-ellipsis whitespace-nowrap text-xs font-medium text-secondary", children: a })
|
|
553
549
|
}
|
|
@@ -559,34 +555,34 @@ function Hn({
|
|
|
559
555
|
] }, e.id))
|
|
560
556
|
}
|
|
561
557
|
),
|
|
562
|
-
/* @__PURE__ */
|
|
563
|
-
|
|
558
|
+
/* @__PURE__ */ m("tbody", { children: [
|
|
559
|
+
C ? Array.from({ length: p }, (e, t) => /* @__PURE__ */ m(
|
|
564
560
|
"tr",
|
|
565
561
|
{
|
|
566
|
-
className:
|
|
562
|
+
className: Ze[f],
|
|
567
563
|
"aria-hidden": "true",
|
|
568
564
|
children: [
|
|
569
|
-
|
|
565
|
+
Y ? /* @__PURE__ */ i(
|
|
570
566
|
"td",
|
|
571
567
|
{
|
|
572
568
|
className: d(
|
|
573
569
|
"w-10 min-w-10",
|
|
574
|
-
|
|
575
|
-
!
|
|
570
|
+
g && "border-r border-secondary",
|
|
571
|
+
!I && "border-b border-tertiary"
|
|
576
572
|
)
|
|
577
573
|
}
|
|
578
574
|
) : null,
|
|
579
|
-
|
|
580
|
-
const n =
|
|
575
|
+
S.getVisibleLeafColumns().map((o) => {
|
|
576
|
+
const n = xe.get(o.id);
|
|
581
577
|
return /* @__PURE__ */ i(
|
|
582
578
|
"td",
|
|
583
579
|
{
|
|
584
|
-
style:
|
|
580
|
+
style: X(n, !1),
|
|
585
581
|
className: d(
|
|
586
582
|
"relative overflow-hidden text-secondary",
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
!
|
|
583
|
+
He[f],
|
|
584
|
+
g && "border-r border-secondary last:border-r-0",
|
|
585
|
+
!I && "border-b border-tertiary",
|
|
590
586
|
n == null ? void 0 : n.cellClassName
|
|
591
587
|
),
|
|
592
588
|
children: /* @__PURE__ */ i(
|
|
@@ -604,54 +600,54 @@ function Hn({
|
|
|
604
600
|
]
|
|
605
601
|
},
|
|
606
602
|
`loading-${t}`
|
|
607
|
-
)) :
|
|
603
|
+
)) : T.length === 0 ? /* @__PURE__ */ i("tr", { children: /* @__PURE__ */ i(
|
|
608
604
|
"td",
|
|
609
605
|
{
|
|
610
|
-
colSpan:
|
|
606
|
+
colSpan: J,
|
|
611
607
|
className: "border-b border-secondary px-3 py-3 text-left text-xs text-placeholder_subtle",
|
|
612
|
-
children:
|
|
608
|
+
children: ie
|
|
613
609
|
}
|
|
614
|
-
) }) :
|
|
615
|
-
var
|
|
610
|
+
) }) : tn.map((e) => {
|
|
611
|
+
var h;
|
|
616
612
|
if (e.kind === "group")
|
|
617
|
-
return
|
|
618
|
-
const t = e.row, o =
|
|
619
|
-
return /* @__PURE__ */
|
|
620
|
-
/* @__PURE__ */
|
|
613
|
+
return nn(e.group);
|
|
614
|
+
const t = e.row, o = $t && t.getCanExpand(), n = o && t.getIsExpanded(), s = t.getVisibleCells();
|
|
615
|
+
return /* @__PURE__ */ m(dn, { children: [
|
|
616
|
+
/* @__PURE__ */ m(
|
|
621
617
|
"tr",
|
|
622
618
|
{
|
|
623
|
-
...
|
|
619
|
+
...Q ? {
|
|
624
620
|
[Cn]: t.id,
|
|
625
621
|
[vn]: String(
|
|
626
|
-
|
|
622
|
+
ne(t.original, t.index) ?? t.index
|
|
627
623
|
)
|
|
628
624
|
} : {},
|
|
629
|
-
style: (
|
|
625
|
+
style: (h = u.session) != null && h.active && u.session.rowId === t.id ? wn : void 0,
|
|
630
626
|
className: d(
|
|
631
627
|
// `focus-visible`, not `focus-within`: the ring marks the row itself being keyboard-focused.
|
|
632
628
|
// `focus-within` also fires for anything inside it, so an open cell
|
|
633
629
|
// editor outlined the entire row.
|
|
634
630
|
"relative outline-focus-ring transition-colors hover:bg-secondary_subtle focus-visible:outline-2 focus-visible:-outline-offset-2",
|
|
635
|
-
|
|
631
|
+
Ze[f],
|
|
636
632
|
t.getIsSelected() && "bg-secondary",
|
|
637
|
-
|
|
638
|
-
|
|
633
|
+
le && "cursor-pointer",
|
|
634
|
+
se == null ? void 0 : se(t.original)
|
|
639
635
|
),
|
|
640
636
|
onClick: (a) => {
|
|
641
|
-
!
|
|
637
|
+
!le || Be(a.target) || le(t.original);
|
|
642
638
|
},
|
|
643
|
-
onMouseEnter:
|
|
644
|
-
onMouseLeave:
|
|
639
|
+
onMouseEnter: $ ? () => $(t.original, !0) : void 0,
|
|
640
|
+
onMouseLeave: $ ? () => $(t.original, !1) : void 0,
|
|
645
641
|
children: [
|
|
646
|
-
|
|
642
|
+
Y ? /* @__PURE__ */ i(
|
|
647
643
|
"td",
|
|
648
644
|
{
|
|
649
645
|
className: d(
|
|
650
646
|
"relative w-10 min-w-10 p-0 text-center",
|
|
651
|
-
|
|
647
|
+
g && "border-r border-secondary",
|
|
652
648
|
// Matches the data cells, so the row separator
|
|
653
649
|
// runs the full width of the table.
|
|
654
|
-
!
|
|
650
|
+
!I && !n && "border-b border-tertiary"
|
|
655
651
|
),
|
|
656
652
|
children: /* @__PURE__ */ i(
|
|
657
653
|
"div",
|
|
@@ -660,7 +656,7 @@ function Hn({
|
|
|
660
656
|
onClick: (a) => a.stopPropagation(),
|
|
661
657
|
onKeyDown: (a) => a.stopPropagation(),
|
|
662
658
|
children: /* @__PURE__ */ i(
|
|
663
|
-
|
|
659
|
+
Ue,
|
|
664
660
|
{
|
|
665
661
|
checked: t.getIsSelected(),
|
|
666
662
|
onCheckedChange: (a) => t.toggleSelected(a === !0),
|
|
@@ -672,38 +668,38 @@ function Hn({
|
|
|
672
668
|
)
|
|
673
669
|
}
|
|
674
670
|
) : null,
|
|
675
|
-
s.map((a,
|
|
671
|
+
s.map((a, Ke) => {
|
|
676
672
|
if (a.getIsCovered()) return null;
|
|
677
|
-
const
|
|
678
|
-
if (!
|
|
679
|
-
const K =
|
|
673
|
+
const w = xe.get(a.column.id);
|
|
674
|
+
if (!w) return null;
|
|
675
|
+
const K = en(
|
|
680
676
|
t,
|
|
681
|
-
|
|
677
|
+
w.id,
|
|
682
678
|
a.getValue()
|
|
683
|
-
),
|
|
684
|
-
|
|
679
|
+
), on = w.renderCell ? w.renderCell(K) : String(a.getValue() ?? ""), E = O ? bn(
|
|
680
|
+
H,
|
|
685
681
|
t.id,
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
) : null,
|
|
682
|
+
w.id,
|
|
683
|
+
ve,
|
|
684
|
+
Se
|
|
685
|
+
) : null, te = !!(E != null && E.inRange), rn = (k == null ? void 0 : k.rowId) === t.id && (k == null ? void 0 : k.columnKey) === w.id;
|
|
690
686
|
return /* @__PURE__ */ i(
|
|
691
687
|
"td",
|
|
692
688
|
{
|
|
693
689
|
colSpan: a.getColSpan(),
|
|
694
690
|
rowSpan: a.getRowSpan(),
|
|
695
|
-
style:
|
|
696
|
-
...
|
|
697
|
-
boxShadow:
|
|
698
|
-
|
|
691
|
+
style: te && E ? {
|
|
692
|
+
...X(w, !1),
|
|
693
|
+
boxShadow: hn(
|
|
694
|
+
E.edges
|
|
699
695
|
)
|
|
700
|
-
} :
|
|
696
|
+
} : X(w, !1),
|
|
701
697
|
"data-table-component-cell": "",
|
|
702
698
|
"data-grid-cell": "",
|
|
703
699
|
"data-grid-row-id": t.id,
|
|
704
|
-
"data-grid-col-key":
|
|
700
|
+
"data-grid-col-key": w.id,
|
|
705
701
|
"data-grid-source-index": K.sourceIndex ?? void 0,
|
|
706
|
-
tabIndex:
|
|
702
|
+
tabIndex: W ? 0 : void 0,
|
|
707
703
|
className: d(
|
|
708
704
|
// `overflow-hidden`, never `overflow-x-hidden`: when `overflow-x` is not
|
|
709
705
|
// `visible` the browser computes `overflow-y` to `auto`, turning
|
|
@@ -713,24 +709,24 @@ function Hn({
|
|
|
713
709
|
// The cell holding an open editor must not clip it: a wrapped
|
|
714
710
|
// multi-line value has to be visible, and the row only grows
|
|
715
711
|
// around content the cell is allowed to show.
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
!
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
712
|
+
rn ? "z-1 overflow-visible" : "overflow-hidden",
|
|
713
|
+
He[f],
|
|
714
|
+
Mn(w.align),
|
|
715
|
+
g && "border-r border-secondary last:border-r-0",
|
|
716
|
+
!I && !n && !te && "border-b border-tertiary",
|
|
717
|
+
te && "z-1 outline-hidden",
|
|
718
|
+
te && !(E != null && E.isAnchor) && "bg-utility-brand-25",
|
|
719
|
+
w.cellClassName
|
|
724
720
|
),
|
|
725
|
-
onClick: (
|
|
726
|
-
|
|
721
|
+
onClick: (_) => {
|
|
722
|
+
me == null || me(K), Ke === 0 && o && Be(_.target) && _.stopPropagation();
|
|
727
723
|
},
|
|
728
|
-
onDoubleClick: () =>
|
|
729
|
-
onKeyDown: (
|
|
730
|
-
|
|
724
|
+
onDoubleClick: () => fe == null ? void 0 : fe(K),
|
|
725
|
+
onKeyDown: (_) => {
|
|
726
|
+
_.key !== "Enter" || !W || (_.preventDefault(), W(K));
|
|
731
727
|
},
|
|
732
|
-
children: /* @__PURE__ */
|
|
733
|
-
|
|
728
|
+
children: /* @__PURE__ */ m("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
729
|
+
Ke === 0 && o ? /* @__PURE__ */ i(
|
|
734
730
|
"button",
|
|
735
731
|
{
|
|
736
732
|
type: "button",
|
|
@@ -741,13 +737,13 @@ function Hn({
|
|
|
741
737
|
"aria-label": n ? "Collapse row" : "Expand row",
|
|
742
738
|
"aria-expanded": n,
|
|
743
739
|
"aria-controls": `${t.id}-detail`,
|
|
744
|
-
onClick: (
|
|
745
|
-
|
|
740
|
+
onClick: (_) => {
|
|
741
|
+
_.stopPropagation(), t.toggleExpanded();
|
|
746
742
|
},
|
|
747
743
|
children: /* @__PURE__ */ i($e, { className: "size-4 text-fg-quaternary" })
|
|
748
744
|
}
|
|
749
745
|
) : null,
|
|
750
|
-
/* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children:
|
|
746
|
+
/* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: on })
|
|
751
747
|
] })
|
|
752
748
|
},
|
|
753
749
|
a.id
|
|
@@ -756,59 +752,59 @@ function Hn({
|
|
|
756
752
|
]
|
|
757
753
|
}
|
|
758
754
|
),
|
|
759
|
-
n &&
|
|
755
|
+
n && Z ? /* @__PURE__ */ i(
|
|
760
756
|
"tr",
|
|
761
757
|
{
|
|
762
758
|
id: `${t.id}-detail`,
|
|
763
759
|
className: "relative bg-secondary_subtle",
|
|
764
|
-
children: /* @__PURE__ */ i("td", { colSpan:
|
|
760
|
+
children: /* @__PURE__ */ i("td", { colSpan: J, className: "p-0", children: Z({
|
|
765
761
|
row: t.original,
|
|
766
762
|
rowId: t.id,
|
|
767
|
-
colSpan:
|
|
763
|
+
colSpan: J,
|
|
768
764
|
collapse: () => t.toggleExpanded(!1)
|
|
769
765
|
}) })
|
|
770
766
|
}
|
|
771
767
|
) : null
|
|
772
768
|
] }, t.id);
|
|
773
769
|
}),
|
|
774
|
-
!
|
|
770
|
+
!C && rt
|
|
775
771
|
] })
|
|
776
772
|
]
|
|
777
773
|
}
|
|
778
774
|
),
|
|
779
|
-
((
|
|
780
|
-
/* @__PURE__ */ i(Sn, { session:
|
|
781
|
-
|
|
775
|
+
((Me = u.session) == null ? void 0 : Me.active) && /* @__PURE__ */ m(sn, { children: [
|
|
776
|
+
/* @__PURE__ */ i(Sn, { session: u.session }),
|
|
777
|
+
u.session.dropLineY !== null && /* @__PURE__ */ i(
|
|
782
778
|
In,
|
|
783
779
|
{
|
|
784
|
-
y:
|
|
785
|
-
left:
|
|
786
|
-
width:
|
|
780
|
+
y: u.session.dropLineY,
|
|
781
|
+
left: u.session.dropLineLeft,
|
|
782
|
+
width: u.session.dropLineWidth
|
|
787
783
|
}
|
|
788
784
|
)
|
|
789
785
|
] })
|
|
790
786
|
]
|
|
791
787
|
}
|
|
792
|
-
), je = qt ? /* @__PURE__ */
|
|
788
|
+
), je = qt ? /* @__PURE__ */ m("div", { className: d("flex flex-col gap-3", Te), children: [
|
|
789
|
+
Fe,
|
|
793
790
|
Pe,
|
|
794
|
-
Me,
|
|
795
791
|
Ve,
|
|
796
|
-
|
|
797
|
-
] }) : /* @__PURE__ */ i("div", { className:
|
|
792
|
+
_e
|
|
793
|
+
] }) : /* @__PURE__ */ i("div", { className: Te, children: Ve });
|
|
798
794
|
return Yt ? /* @__PURE__ */ i(
|
|
799
795
|
yn,
|
|
800
796
|
{
|
|
801
|
-
rowIds:
|
|
802
|
-
columnKeys:
|
|
803
|
-
containerRef:
|
|
804
|
-
onSelectCell:
|
|
805
|
-
onEditingCellChange:
|
|
797
|
+
rowIds: ve,
|
|
798
|
+
columnKeys: Se,
|
|
799
|
+
containerRef: D,
|
|
800
|
+
onSelectCell: Jt,
|
|
801
|
+
onEditingCellChange: Qt,
|
|
806
802
|
children: je
|
|
807
803
|
}
|
|
808
804
|
) : je;
|
|
809
805
|
}
|
|
810
|
-
const
|
|
806
|
+
const uo = ln(Un);
|
|
811
807
|
export {
|
|
812
|
-
|
|
813
|
-
|
|
808
|
+
uo as TableComponent,
|
|
809
|
+
uo as default
|
|
814
810
|
};
|