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