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