@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,26 +1,28 @@
|
|
|
1
|
-
import { jsx as c, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { ChevronRight as
|
|
1
|
+
import { jsx as c, jsxs as S, Fragment as Jt } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Qr, useRef as se, useState as K, useMemo as k, useCallback as E, useEffect as Z, useLayoutEffect as Qt } from "react";
|
|
3
|
+
import { ChevronRight as en } from "@untitledui/icons";
|
|
4
4
|
import { cx as x } from "../../utils/cn.js";
|
|
5
|
-
import { TableCard as
|
|
6
|
-
import { TablePagination as
|
|
7
|
-
import { TableZoomControl as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
5
|
+
import { TableCard as tn, Table as m } from "./table.js";
|
|
6
|
+
import { TablePagination as rn } from "./TablePagination.js";
|
|
7
|
+
import { TableZoomControl as nn } from "./TableZoomControl.js";
|
|
8
|
+
import { useFitTableToViewport as sn } from "./useFitTableToViewport.js";
|
|
9
|
+
import { useTableZoomState as on } from "./useTableZoomState.js";
|
|
10
|
+
import { getEffectiveAlignment as dr, resolveColumnLabel as an, alignmentClass as cn } from "./toolbar/tableToolbarHelpers.js";
|
|
11
|
+
import { parsePxValue as ht, DEFAULT_ZOOMABLE_COLUMN_MIN_WIDTH as er, supportsCssZoom as dn, DEFAULT_TABLE_ZOOM_MIN as ln, computeFillBaseWidth as un, computeEffectiveTableWidth as fn, computeFlexColumnWidth as pn, DEFAULT_COLUMN_MAX_WIDTH as lr, getTableZoomFontSize as hn, computeNeedsHorizontalScroll as yn } from "./tableZoomLayout.js";
|
|
12
|
+
import { findGridCell as tr, isWithinCellEditor as Ae, getGridNeighbor as wn, getGridTabNeighbor as mn, focusGridCell as rr, GridNavProvider as gn } from "./useGridKeyboardNavigation.js";
|
|
13
|
+
import { scrollGridCellIntoView as xn } from "./scrollCellIntoView.js";
|
|
14
|
+
import { ROW_DRAG_THRESHOLD_PX as Rn, computeDropTarget as vn, clipDropLineToScrollport as kn, ROW_REORDER_ATTR as nr, measureRowPreview as En, cloneRowForPreview as In, FloatingRowPreview as Ln, DropIndicatorLine as bn, getRowDragScrollDelta as Nn, ROW_DRAG_SOURCE_STYLE as Wn, ROW_SOURCE_INDEX_ATTR as Dn } from "./rowReorderDrag.js";
|
|
15
|
+
import { selectionFromSingleCell as yt, resolveCellCoordFromElement as Be, resolveRowAnchorCoordFromTarget as _n, buildCellRangeRect as wt, nextKeyboardCellSelection as Pn, CELL_RANGE_DRAG_THRESHOLD_PX as Sn, hitTestGridCell as Tn, canStartCellRangeFromTarget as ir, getDragScrollDeltas as Cn, getCellRangeVisualState as Fn, cellRangeEdgeBoxShadow as On } from "./cellRangeSelection.js";
|
|
16
|
+
import { BulkActionBar as zn } from "./toolbar/BulkActionBar.js";
|
|
15
17
|
import { TableToolbar as Gn } from "./toolbar/TableToolbar.js";
|
|
16
18
|
import { Checkbox as sr } from "../../primitives/checkbox/checkbox.js";
|
|
17
19
|
import { ColumnHeaderMenu as Mn } from "./toolbar/ColumnHeaderMenu.js";
|
|
18
|
-
import { Button as
|
|
19
|
-
import { SummaryFooterRow as
|
|
20
|
+
import { Button as Un } from "../../primitives/button/button.js";
|
|
21
|
+
import { SummaryFooterRow as Yn } from "./toolbar/SummaryFooter.js";
|
|
20
22
|
import { RowActionsMenu as An } from "./toolbar/RowActionsMenu.js";
|
|
21
|
-
import { Icon as
|
|
22
|
-
import { ShimmerLine as
|
|
23
|
-
const
|
|
23
|
+
import { Icon as Bn } from "../../primitives/icon/icon.js";
|
|
24
|
+
import { ShimmerLine as Xn } from "../../primitives/shimmer/shimmer.js";
|
|
25
|
+
const $n = dn(), jn = 5, Zn = "__all__", or = {
|
|
24
26
|
ArrowUp: "up",
|
|
25
27
|
ArrowDown: "down",
|
|
26
28
|
ArrowLeft: "left",
|
|
@@ -38,132 +40,127 @@ function Kn(s, u) {
|
|
|
38
40
|
function Hn(s, u) {
|
|
39
41
|
return u.length === 0 ? !1 : s === "all" ? !0 : u.every((f) => (s == null ? void 0 : s.has(f)) ?? !1);
|
|
40
42
|
}
|
|
41
|
-
function
|
|
43
|
+
function Vn(s, u) {
|
|
42
44
|
return s === "all" ? u.length > 0 : u.some((f) => (s == null ? void 0 : s.has(f)) ?? !1);
|
|
43
45
|
}
|
|
44
|
-
function
|
|
46
|
+
function Jn(s) {
|
|
45
47
|
if (s)
|
|
46
48
|
return (u) => {
|
|
47
49
|
s(u === "all" ? "all" : new Set([...u].map(String)));
|
|
48
50
|
};
|
|
49
51
|
}
|
|
50
|
-
function
|
|
52
|
+
function Qn(s) {
|
|
51
53
|
var u;
|
|
52
|
-
return s != null && s.length ? s.length > 1 ? !0 : ((u = s[0]) == null ? void 0 : u.key) !==
|
|
54
|
+
return s != null && s.length ? s.length > 1 ? !0 : ((u = s[0]) == null ? void 0 : u.key) !== Zn : !1;
|
|
53
55
|
}
|
|
54
56
|
function cr(s, u, f) {
|
|
55
57
|
return f ? dr(f, u ?? /* @__PURE__ */ new Map()) : (u == null ? void 0 : u.get(s)) ?? "left";
|
|
56
58
|
}
|
|
57
|
-
const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"),
|
|
59
|
+
const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), mt = (s) => s.width ?? (s.maxWidth && s.sticky === "right" ? s.maxWidth : void 0), ei = (s) => ({
|
|
58
60
|
width: s.width,
|
|
59
61
|
maxWidth: s.maxWidth ?? lr,
|
|
60
62
|
minWidth: s.minWidth ?? s.width
|
|
61
|
-
}),
|
|
63
|
+
}), bi = Qr(
|
|
62
64
|
function({
|
|
63
65
|
data: u,
|
|
64
66
|
columns: f,
|
|
65
|
-
renderRowCell:
|
|
67
|
+
renderRowCell: gt,
|
|
66
68
|
onRowClick: ve,
|
|
67
|
-
onRowHover:
|
|
69
|
+
onRowHover: H,
|
|
68
70
|
arialabel: ur,
|
|
69
|
-
size:
|
|
71
|
+
size: xt = "sm",
|
|
70
72
|
allowDefaultRowClass: fr = !1,
|
|
71
73
|
centeredHeaders: pr = [],
|
|
72
74
|
rootClassName: hr,
|
|
73
|
-
removeBorders:
|
|
75
|
+
removeBorders: Rt,
|
|
74
76
|
headerClassName: yr,
|
|
75
|
-
isRowExpandable:
|
|
77
|
+
isRowExpandable: vt,
|
|
76
78
|
renderExpandedContent: wr,
|
|
77
|
-
loading:
|
|
78
|
-
loadingRowCount: kt =
|
|
79
|
-
renderHeaderCell:
|
|
79
|
+
loading: X = !1,
|
|
80
|
+
loadingRowCount: kt = jn,
|
|
81
|
+
renderHeaderCell: Xe,
|
|
80
82
|
tableClassName: mr,
|
|
81
|
-
getRowClassName:
|
|
82
|
-
selectionMode:
|
|
83
|
-
selectedKeys:
|
|
84
|
-
onSelectionChange:
|
|
85
|
-
inlineSelection:
|
|
83
|
+
getRowClassName: $e,
|
|
84
|
+
selectionMode: oe = "none",
|
|
85
|
+
selectedKeys: C,
|
|
86
|
+
onSelectionChange: D,
|
|
87
|
+
inlineSelection: ke = !1,
|
|
86
88
|
toolbar: d,
|
|
87
89
|
showToolbar: gr,
|
|
88
|
-
toolbarTitle:
|
|
89
|
-
toolbarTrailing:
|
|
90
|
-
disableExtendedTools:
|
|
91
|
-
pagination:
|
|
90
|
+
toolbarTitle: Et,
|
|
91
|
+
toolbarTrailing: It,
|
|
92
|
+
disableExtendedTools: Ee,
|
|
93
|
+
pagination: _,
|
|
92
94
|
showBorders: Ie,
|
|
93
|
-
emptyState:
|
|
94
|
-
editChrome:
|
|
95
|
+
emptyState: Lt,
|
|
96
|
+
editChrome: z,
|
|
95
97
|
showEditActions: xr = !1,
|
|
96
|
-
searchCollapsible:
|
|
98
|
+
searchCollapsible: bt,
|
|
97
99
|
isEditable: Rr,
|
|
98
|
-
|
|
100
|
+
isEditMode: Nt = !0,
|
|
101
|
+
toolbarSlot: je,
|
|
99
102
|
rowHeightClass: Wt,
|
|
100
|
-
groupedData:
|
|
103
|
+
groupedData: V,
|
|
101
104
|
showSummaryFooter: vr,
|
|
102
|
-
summaryFooterProps:
|
|
105
|
+
summaryFooterProps: Ze,
|
|
103
106
|
bulkActionBar: Le,
|
|
104
107
|
renderBulkActionBar: be,
|
|
105
108
|
onBulkDuplicate: Ne,
|
|
106
109
|
onBulkDelete: We,
|
|
107
110
|
bulkActionBusy: De,
|
|
108
|
-
columnAlignments:
|
|
111
|
+
columnAlignments: J,
|
|
109
112
|
onColumnHeaderAction: _e,
|
|
110
|
-
showColumnHeaderMenu:
|
|
111
|
-
columnMenuCapabilities:
|
|
113
|
+
showColumnHeaderMenu: kr,
|
|
114
|
+
columnMenuCapabilities: Er,
|
|
112
115
|
renderGroupHeader: Dt,
|
|
113
|
-
columnMenuSchema:
|
|
114
|
-
columnSchema:
|
|
116
|
+
columnMenuSchema: ae,
|
|
117
|
+
columnSchema: ce,
|
|
115
118
|
labelMeta: Ir,
|
|
116
119
|
renderColumnHeaderMenuExtraItems: Lr,
|
|
117
120
|
fillWidth: br = !1,
|
|
118
|
-
zoom:
|
|
119
|
-
rowActions:
|
|
120
|
-
onCellActivate:
|
|
121
|
+
zoom: Nr,
|
|
122
|
+
rowActions: I,
|
|
123
|
+
onCellActivate: Q,
|
|
121
124
|
cellSelection: w = null,
|
|
122
|
-
onCellSelectionChange:
|
|
123
|
-
onCopyCells:
|
|
124
|
-
onPasteCells:
|
|
125
|
-
onClearCells:
|
|
126
|
-
},
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
),
|
|
133
|
-
if (!
|
|
125
|
+
onCellSelectionChange: N,
|
|
126
|
+
onCopyCells: qe,
|
|
127
|
+
onPasteCells: Ke,
|
|
128
|
+
onClearCells: He
|
|
129
|
+
}, de) {
|
|
130
|
+
const { zoomConfig: G, zoomPercent: le, setZoomPercent: _t } = on(Nr), F = G !== null && $n, ue = le / 100, Pe = F ? hn(le) : void 0, W = br, g = se(null), [fe, Pt] = K(null), Wr = sn({
|
|
131
|
+
containerRef: g,
|
|
132
|
+
zoomConfig: G,
|
|
133
|
+
zoomPercent: le,
|
|
134
|
+
setZoomPercent: _t
|
|
135
|
+
}), ee = k(() => {
|
|
136
|
+
if (!W) return null;
|
|
134
137
|
const e = f.reduce(
|
|
135
|
-
(i, n) => Re(n) ? i +
|
|
138
|
+
(i, n) => Re(n) ? i + ht(mt(n)) : i,
|
|
136
139
|
0
|
|
137
140
|
);
|
|
138
141
|
return { minTableWidth: f.filter(
|
|
139
142
|
(i) => !Re(i)
|
|
140
143
|
).reduce(
|
|
141
|
-
(i, n) => i +
|
|
142
|
-
n.minWidth ?? (
|
|
144
|
+
(i, n) => i + ht(
|
|
145
|
+
n.minWidth ?? (F ? er : void 0)
|
|
143
146
|
),
|
|
144
147
|
0
|
|
145
148
|
) + e };
|
|
146
|
-
}, [f,
|
|
147
|
-
$(() => {
|
|
148
|
-
E && _t(
|
|
149
|
-
(e) => dn(e, E.minZoom, E.maxZoom)
|
|
150
|
-
);
|
|
151
|
-
}, [E]);
|
|
152
|
-
const [Te, Nr] = H(
|
|
149
|
+
}, [f, W, F]), St = (G == null ? void 0 : G.minZoom) ?? ln, [Se, Dr] = K(
|
|
153
150
|
() => /* @__PURE__ */ new Set()
|
|
154
|
-
), [
|
|
151
|
+
), [_r, Tt] = K(
|
|
155
152
|
null
|
|
156
|
-
), [p,
|
|
157
|
-
|
|
158
|
-
}, []), [
|
|
153
|
+
), [p, Pr] = K(null), M = se(null), Ve = se({ x: 0, y: 0 }), te = E((e) => {
|
|
154
|
+
M.current = e, Pr(e);
|
|
155
|
+
}, []), [q, Ct] = K(null), [re, Sr] = K(null), y = typeof N == "function", $ = se(null), Je = se({ x: 0, y: 0 }), [ne, Ft] = K(!1), Qe = se(null), Te = oe === "single" || oe === "multiple", et = !!I, U = Te && !ke, Ce = Qn(V), tt = !!(I != null && I.onReorderRows) && (I == null ? void 0 : I.enableRowReorder) !== !1 && !Ce && !X, Tr = k(() => ae != null && ae.length ? new Map(ae.map((e) => [e.key, e])) : /* @__PURE__ */ new Map(), [ae]), Ot = k(() => ce != null && ce.length ? new Map(ce.map((e) => [e.value, e])) : /* @__PURE__ */ new Map(), [ce]), Y = k(
|
|
159
156
|
() => f.map((e) => e.key),
|
|
160
157
|
[f]
|
|
161
|
-
),
|
|
162
|
-
|
|
158
|
+
), Cr = E((e) => {
|
|
159
|
+
Dr((t) => {
|
|
163
160
|
const r = new Set(t);
|
|
164
161
|
return r.has(e) ? r.delete(e) : r.add(e), r;
|
|
165
162
|
});
|
|
166
|
-
}, []), Fe =
|
|
163
|
+
}, []), Fe = k(() => X ? Array.from({ length: kt }, (e, t) => ({
|
|
167
164
|
id: `loading-${t}`
|
|
168
165
|
})) : u.map((e) => {
|
|
169
166
|
const t = e;
|
|
@@ -171,39 +168,39 @@ const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), gt = (s)
|
|
|
171
168
|
return t;
|
|
172
169
|
const r = xe(t);
|
|
173
170
|
return t.id != null && String(t.id) === r ? t : { ...t, id: r };
|
|
174
|
-
}), [
|
|
175
|
-
(e) =>
|
|
176
|
-
) : Fe.map((e) => xe(e)), [
|
|
177
|
-
() => ar(
|
|
178
|
-
[
|
|
179
|
-
),
|
|
180
|
-
if (!
|
|
171
|
+
}), [X, u, kt]), R = k(() => X ? [] : Ce && V ? V.flatMap(
|
|
172
|
+
(e) => Se.has(e.key) ? [] : e.rows.map((t) => xe(t))
|
|
173
|
+
) : Fe.map((e) => xe(e)), [X, Ce, V, Se, Fe]), pe = k(
|
|
174
|
+
() => ar(C, R),
|
|
175
|
+
[C, R]
|
|
176
|
+
), rt = Kn(C, R), nt = rt > 0, zt = nt && !!(Le ?? be ?? Ne ?? We), he = k(() => {
|
|
177
|
+
if (!nt) return;
|
|
181
178
|
const e = u.filter(
|
|
182
179
|
(t) => pe.has(xe(t))
|
|
183
180
|
);
|
|
184
181
|
return {
|
|
185
182
|
selectedKeys: pe,
|
|
186
183
|
selectedRows: e,
|
|
187
|
-
clearSelection: () =>
|
|
184
|
+
clearSelection: () => D == null ? void 0 : D(/* @__PURE__ */ new Set()),
|
|
188
185
|
busy: De
|
|
189
186
|
};
|
|
190
187
|
}, [
|
|
191
|
-
|
|
188
|
+
nt,
|
|
192
189
|
pe,
|
|
193
190
|
u,
|
|
194
|
-
|
|
191
|
+
D,
|
|
195
192
|
De
|
|
196
|
-
]),
|
|
197
|
-
if (
|
|
198
|
-
if (
|
|
193
|
+
]), Gt = k(() => {
|
|
194
|
+
if (je != null) return je;
|
|
195
|
+
if (zt) {
|
|
199
196
|
if (Le != null) return Le;
|
|
200
197
|
if (be && he)
|
|
201
198
|
return be(he);
|
|
202
199
|
if (he && (Ne || We))
|
|
203
200
|
return /* @__PURE__ */ c(
|
|
204
|
-
|
|
201
|
+
zn,
|
|
205
202
|
{
|
|
206
|
-
count:
|
|
203
|
+
count: rt,
|
|
207
204
|
onDuplicate: Ne,
|
|
208
205
|
onDelete: We,
|
|
209
206
|
onClearSelection: he.clearSelection,
|
|
@@ -211,18 +208,18 @@ const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), gt = (s)
|
|
|
211
208
|
}
|
|
212
209
|
);
|
|
213
210
|
}
|
|
214
|
-
const e =
|
|
215
|
-
|
|
211
|
+
const e = F && G ? /* @__PURE__ */ c(
|
|
212
|
+
nn,
|
|
216
213
|
{
|
|
217
|
-
value:
|
|
218
|
-
defaultValue: E.defaultZoom,
|
|
214
|
+
value: le,
|
|
219
215
|
minValue: St,
|
|
220
|
-
maxValue:
|
|
221
|
-
step:
|
|
216
|
+
maxValue: G.maxZoom,
|
|
217
|
+
step: G.step,
|
|
222
218
|
onChange: _t,
|
|
223
|
-
|
|
219
|
+
onFitToViewport: Wr,
|
|
220
|
+
isDisabled: Ee
|
|
224
221
|
}
|
|
225
|
-
) : null, t =
|
|
222
|
+
) : null, t = It;
|
|
226
223
|
return !d && !t && !e ? null : /* @__PURE__ */ c(
|
|
227
224
|
Gn,
|
|
228
225
|
{
|
|
@@ -236,37 +233,40 @@ const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), gt = (s)
|
|
|
236
233
|
summary: d == null ? void 0 : d.summary,
|
|
237
234
|
sortContent: d == null ? void 0 : d.sortContent,
|
|
238
235
|
filterContent: d == null ? void 0 : d.filterContent,
|
|
239
|
-
|
|
236
|
+
views: d == null ? void 0 : d.views,
|
|
237
|
+
fallbackTitle: Et,
|
|
240
238
|
beforeSearch: e,
|
|
241
239
|
trailing: t,
|
|
242
|
-
searchCollapsible:
|
|
243
|
-
disableExtendedTools:
|
|
240
|
+
searchCollapsible: bt,
|
|
241
|
+
disableExtendedTools: Ee,
|
|
242
|
+
isEditMode: Nt,
|
|
244
243
|
undoRedo: d != null && d.undoRedo ? {
|
|
245
244
|
...d.undoRedo,
|
|
246
|
-
isDisabled: d.undoRedo.isDisabled ??
|
|
245
|
+
isDisabled: d.undoRedo.isDisabled ?? Ee
|
|
247
246
|
} : void 0
|
|
248
247
|
}
|
|
249
248
|
);
|
|
250
249
|
}, [
|
|
251
|
-
|
|
252
|
-
|
|
250
|
+
je,
|
|
251
|
+
zt,
|
|
253
252
|
Le,
|
|
254
253
|
be,
|
|
255
254
|
he,
|
|
256
255
|
Ne,
|
|
257
256
|
We,
|
|
258
257
|
De,
|
|
259
|
-
|
|
258
|
+
rt,
|
|
260
259
|
d,
|
|
260
|
+
Et,
|
|
261
261
|
It,
|
|
262
|
-
|
|
262
|
+
bt,
|
|
263
263
|
Nt,
|
|
264
|
-
|
|
265
|
-
E,
|
|
264
|
+
Ee,
|
|
266
265
|
G,
|
|
267
|
-
|
|
266
|
+
F,
|
|
267
|
+
le,
|
|
268
268
|
St
|
|
269
|
-
]),
|
|
269
|
+
]), Mt = Gt != null && gr !== !1, Ut = !!_ && (_ == null ? void 0 : _.showPagination) !== !1, Fr = Mt || Ut, Yt = !X && u.length === 0 && Lt != null, T = !!(xr && z), it = !!(z != null && z.showFooterRow), L = Rr ?? (T || it || et), Or = Yt && !(it && z), ye = f.length + (U ? 1 : 0) + (T ? 1 : 0), zr = !!(vr && Ze), b = Ie ? "border-r border-secondary last:border-r-0" : void 0, Gr = k(() => {
|
|
270
270
|
const e = /* @__PURE__ */ new Map();
|
|
271
271
|
return _e && f.forEach((t) => {
|
|
272
272
|
e.set(
|
|
@@ -274,7 +274,7 @@ const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), gt = (s)
|
|
|
274
274
|
(r) => _e(t.key, r)
|
|
275
275
|
);
|
|
276
276
|
}), e;
|
|
277
|
-
}, [f, _e]),
|
|
277
|
+
}, [f, _e]), st = E(
|
|
278
278
|
(e, t, r) => {
|
|
279
279
|
var a;
|
|
280
280
|
let i = r ?? null;
|
|
@@ -292,70 +292,70 @@ const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), gt = (s)
|
|
|
292
292
|
sourceIndex: i
|
|
293
293
|
};
|
|
294
294
|
if (y) {
|
|
295
|
-
|
|
295
|
+
N == null || N(yt(n));
|
|
296
296
|
return;
|
|
297
297
|
}
|
|
298
298
|
Ct(n);
|
|
299
299
|
},
|
|
300
|
-
[y,
|
|
301
|
-
),
|
|
300
|
+
[y, N]
|
|
301
|
+
), Oe = E(() => {
|
|
302
302
|
if (y) {
|
|
303
|
-
|
|
303
|
+
N == null || N(null);
|
|
304
304
|
return;
|
|
305
305
|
}
|
|
306
306
|
Ct(null);
|
|
307
|
-
}, [y,
|
|
307
|
+
}, [y, N]), P = y ? (w == null ? void 0 : w.focus) ?? null : q, A = E(
|
|
308
308
|
(e) => {
|
|
309
|
-
y && (
|
|
309
|
+
y && (N == null || N(e));
|
|
310
310
|
},
|
|
311
|
-
[y,
|
|
312
|
-
),
|
|
311
|
+
[y, N]
|
|
312
|
+
), Mr = E(
|
|
313
313
|
(e) => {
|
|
314
|
-
var Ye,
|
|
314
|
+
var Ye, ie, ge;
|
|
315
315
|
const t = e.key in or;
|
|
316
|
-
if (e.key !== "Enter" && e.key !== "Tab" && e.key !== "Escape" && e.key !== "Delete" && e.key !== "Backspace" && !t ||
|
|
316
|
+
if (e.key !== "Enter" && e.key !== "Tab" && e.key !== "Escape" && e.key !== "Delete" && e.key !== "Backspace" && !t || Ae(e.target)) return;
|
|
317
317
|
if (e.key === "Escape") {
|
|
318
|
-
if (!
|
|
319
|
-
e.preventDefault(), e.stopPropagation(),
|
|
318
|
+
if (!P && !w) return;
|
|
319
|
+
e.preventDefault(), e.stopPropagation(), Oe(), (Ye = g.current) != null && Ye.contains(document.activeElement) && document.activeElement.blur();
|
|
320
320
|
return;
|
|
321
321
|
}
|
|
322
|
-
const r = (ge = (
|
|
323
|
-
|
|
322
|
+
const r = (ge = (ie = e.target).closest) == null ? void 0 : ge.call(
|
|
323
|
+
ie,
|
|
324
324
|
"[data-grid-cell]"
|
|
325
|
-
), i = r ?
|
|
325
|
+
), i = r ? Be(r) : null, n = y && t && e.shiftKey && !P && !i ? _n(e.target, g.current) : null, a = n != null && pe.has(n.rowId), l = P ?? i ?? (a ? n : null);
|
|
326
326
|
if (!l) return;
|
|
327
327
|
if (e.key === "Delete" || e.key === "Backspace") {
|
|
328
|
-
if (!y || !w || !
|
|
329
|
-
const
|
|
328
|
+
if (!y || !w || !He) return;
|
|
329
|
+
const j = wt(
|
|
330
330
|
w,
|
|
331
331
|
R,
|
|
332
332
|
Y
|
|
333
333
|
);
|
|
334
|
-
if (!
|
|
335
|
-
e.preventDefault(), e.stopPropagation(),
|
|
334
|
+
if (!j) return;
|
|
335
|
+
e.preventDefault(), e.stopPropagation(), He({
|
|
336
336
|
selection: w,
|
|
337
|
-
rect:
|
|
337
|
+
rect: j,
|
|
338
338
|
event: e.nativeEvent
|
|
339
339
|
});
|
|
340
340
|
return;
|
|
341
341
|
}
|
|
342
342
|
if (e.key === "Enter") {
|
|
343
|
-
if (!
|
|
344
|
-
e.preventDefault(), e.stopPropagation(),
|
|
343
|
+
if (!Q) return;
|
|
344
|
+
e.preventDefault(), e.stopPropagation(), Q({
|
|
345
345
|
rowId: l.rowId,
|
|
346
346
|
columnKey: l.columnKey,
|
|
347
347
|
sourceIndex: l.sourceIndex
|
|
348
348
|
});
|
|
349
349
|
return;
|
|
350
350
|
}
|
|
351
|
-
const h = y && e.shiftKey && t,
|
|
351
|
+
const h = y && e.shiftKey && t, v = t ? or[e.key] : e.shiftKey ? "left" : "right", o = t ? wn(
|
|
352
352
|
g.current,
|
|
353
353
|
R,
|
|
354
354
|
Y,
|
|
355
355
|
l.rowId,
|
|
356
356
|
l.columnKey,
|
|
357
|
-
|
|
358
|
-
) :
|
|
357
|
+
v
|
|
358
|
+
) : mn(
|
|
359
359
|
g.current,
|
|
360
360
|
R,
|
|
361
361
|
Y,
|
|
@@ -368,86 +368,86 @@ const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), gt = (s)
|
|
|
368
368
|
return;
|
|
369
369
|
}
|
|
370
370
|
e.preventDefault(), e.stopPropagation();
|
|
371
|
-
const
|
|
371
|
+
const pt = o ? {
|
|
372
372
|
rowId: o.rowId,
|
|
373
373
|
columnKey: o.columnKey,
|
|
374
374
|
sourceIndex: o.sourceIndex
|
|
375
|
-
} : null, we = a ? null :
|
|
376
|
-
if (
|
|
377
|
-
const
|
|
375
|
+
} : null, we = a ? null : pt, me = we ? v : null;
|
|
376
|
+
if (Qe.current = me, y) {
|
|
377
|
+
const j = Pn(
|
|
378
378
|
l,
|
|
379
379
|
we,
|
|
380
380
|
w,
|
|
381
381
|
h
|
|
382
382
|
);
|
|
383
|
-
|
|
384
|
-
} else o &&
|
|
385
|
-
const
|
|
383
|
+
j && j !== w && A(j);
|
|
384
|
+
} else o && st(o.rowId, o.columnKey, o.sourceIndex);
|
|
385
|
+
const O = we ?? l;
|
|
386
386
|
requestAnimationFrame(
|
|
387
387
|
() => rr(
|
|
388
388
|
g.current,
|
|
389
|
-
|
|
390
|
-
|
|
389
|
+
O.rowId,
|
|
390
|
+
O.columnKey,
|
|
391
391
|
{ dir: me }
|
|
392
392
|
)
|
|
393
393
|
);
|
|
394
394
|
},
|
|
395
395
|
[
|
|
396
|
-
|
|
396
|
+
P,
|
|
397
397
|
R,
|
|
398
398
|
y,
|
|
399
399
|
w,
|
|
400
|
-
|
|
400
|
+
Oe,
|
|
401
401
|
Y,
|
|
402
|
-
|
|
402
|
+
A,
|
|
403
403
|
pe,
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
404
|
+
Q,
|
|
405
|
+
He,
|
|
406
|
+
st
|
|
407
407
|
]
|
|
408
408
|
);
|
|
409
|
-
|
|
410
|
-
if (!
|
|
409
|
+
Z(() => {
|
|
410
|
+
if (!L || !P && !w) return;
|
|
411
411
|
const e = (t) => {
|
|
412
412
|
const r = g.current;
|
|
413
|
-
r && !r.contains(t.target) &&
|
|
413
|
+
r && !r.contains(t.target) && Oe();
|
|
414
414
|
};
|
|
415
415
|
return document.addEventListener("pointerdown", e, !0), () => document.removeEventListener("pointerdown", e, !0);
|
|
416
|
-
}, [
|
|
417
|
-
const
|
|
416
|
+
}, [L, P, w, Oe]);
|
|
417
|
+
const ot = (P == null ? void 0 : P.rowId) ?? null, at = (P == null ? void 0 : P.columnKey) ?? null;
|
|
418
418
|
Qt(() => {
|
|
419
|
-
if (!
|
|
419
|
+
if (!L || ne || !ot || !at) return;
|
|
420
420
|
const e = tr(
|
|
421
421
|
g.current,
|
|
422
|
-
|
|
423
|
-
|
|
422
|
+
ot,
|
|
423
|
+
at
|
|
424
424
|
);
|
|
425
|
-
e &&
|
|
426
|
-
}, [
|
|
427
|
-
const
|
|
425
|
+
e && xn(e, { dir: Qe.current });
|
|
426
|
+
}, [L, ne, ot, at]);
|
|
427
|
+
const At = k(() => {
|
|
428
428
|
let e = 0;
|
|
429
|
-
return
|
|
430
|
-
Re(t) && (e +=
|
|
429
|
+
return U && (e += 40), T && (e += 56), f.forEach((t) => {
|
|
430
|
+
Re(t) && (e += ht(mt(t)));
|
|
431
431
|
}), e;
|
|
432
|
-
}, [f,
|
|
432
|
+
}, [f, T, U]), Bt = k(
|
|
433
433
|
() => f.filter((e) => !Re(e)).length,
|
|
434
434
|
[f]
|
|
435
|
-
),
|
|
436
|
-
() =>
|
|
437
|
-
[fe,
|
|
438
|
-
), Xt =
|
|
439
|
-
() =>
|
|
440
|
-
[
|
|
441
|
-
),
|
|
442
|
-
() =>
|
|
443
|
-
|
|
444
|
-
|
|
435
|
+
), ct = k(
|
|
436
|
+
() => W && ee ? un(fe, ee.minTableWidth) : null,
|
|
437
|
+
[fe, W, ee]
|
|
438
|
+
), Xt = W && yn(ct, fe, ue), ze = k(
|
|
439
|
+
() => fn(ct, fe, ue),
|
|
440
|
+
[ct, fe, ue]
|
|
441
|
+
), dt = k(
|
|
442
|
+
() => pn(
|
|
443
|
+
ze,
|
|
444
|
+
At,
|
|
445
445
|
Bt
|
|
446
446
|
),
|
|
447
|
-
[
|
|
447
|
+
[ze, At, Bt]
|
|
448
448
|
);
|
|
449
449
|
Qt(() => {
|
|
450
|
-
if (!
|
|
450
|
+
if (!W) {
|
|
451
451
|
Pt(null);
|
|
452
452
|
return;
|
|
453
453
|
}
|
|
@@ -465,72 +465,72 @@ const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), gt = (s)
|
|
|
465
465
|
}, [
|
|
466
466
|
f.length,
|
|
467
467
|
u.length,
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
468
|
+
W,
|
|
469
|
+
X,
|
|
470
|
+
T,
|
|
471
|
+
U
|
|
472
472
|
]);
|
|
473
|
-
const
|
|
473
|
+
const lt = E(
|
|
474
474
|
(e) => {
|
|
475
|
-
if (!
|
|
476
|
-
return
|
|
477
|
-
const t = e.minWidth ?? (
|
|
475
|
+
if (!W)
|
|
476
|
+
return ei(e);
|
|
477
|
+
const t = e.minWidth ?? (F ? er : void 0), r = mt(e), i = r, n = e.maxWidth ?? r ?? lr;
|
|
478
478
|
return Re(e) && i ? {
|
|
479
479
|
minWidth: i,
|
|
480
480
|
width: i,
|
|
481
481
|
maxWidth: n ?? i
|
|
482
|
-
} :
|
|
483
|
-
width: `${
|
|
482
|
+
} : dt != null ? {
|
|
483
|
+
width: `${dt}px`,
|
|
484
484
|
minWidth: t
|
|
485
485
|
} : { minWidth: t, maxWidth: n };
|
|
486
486
|
},
|
|
487
|
-
[
|
|
488
|
-
),
|
|
489
|
-
const e =
|
|
487
|
+
[W, dt, F]
|
|
488
|
+
), Ur = k(() => {
|
|
489
|
+
const e = F ? {
|
|
490
490
|
zoom: ue,
|
|
491
|
-
"--table-zoom-font-size":
|
|
491
|
+
"--table-zoom-font-size": Pe ? `${Pe}px` : void 0
|
|
492
492
|
} : void 0;
|
|
493
|
-
return !
|
|
493
|
+
return !W || !ee ? F ? { ...e, width: "max-content", minWidth: "100%" } : void 0 : {
|
|
494
494
|
...e,
|
|
495
495
|
// The zoom-independent base, so the painted width tracks the zoom and overflows by
|
|
496
496
|
// more as you zoom in — matching the widths `getColumnStyle` hands the columns.
|
|
497
|
-
width: `${
|
|
497
|
+
width: `${ze ?? ee.minTableWidth}px`,
|
|
498
498
|
tableLayout: "fixed"
|
|
499
499
|
};
|
|
500
500
|
}, [
|
|
501
|
-
|
|
502
|
-
|
|
501
|
+
W,
|
|
502
|
+
ee,
|
|
503
503
|
Xt,
|
|
504
|
-
|
|
505
|
-
|
|
504
|
+
ze,
|
|
505
|
+
F,
|
|
506
506
|
ue,
|
|
507
|
-
|
|
508
|
-
]),
|
|
507
|
+
Pe
|
|
508
|
+
]), Yr = E(
|
|
509
509
|
(e) => {
|
|
510
|
-
g.current = e, typeof
|
|
510
|
+
g.current = e, typeof de == "function" ? de(e) : de && (de.current = e);
|
|
511
511
|
},
|
|
512
|
-
[
|
|
513
|
-
),
|
|
514
|
-
selectionMode:
|
|
515
|
-
selectedKeys:
|
|
516
|
-
onSelectionChange:
|
|
517
|
-
} : {},
|
|
512
|
+
[de]
|
|
513
|
+
), Ar = Te && ke ? {
|
|
514
|
+
selectionMode: oe,
|
|
515
|
+
selectedKeys: C === "all" ? "all" : C,
|
|
516
|
+
onSelectionChange: Jn(D)
|
|
517
|
+
} : {}, Br = (e, t = 0) => {
|
|
518
518
|
const r = e.__sourceIndex;
|
|
519
519
|
return typeof r == "number" ? r : t;
|
|
520
|
-
},
|
|
520
|
+
}, Ge = E(
|
|
521
521
|
(e) => {
|
|
522
|
-
const t =
|
|
522
|
+
const t = M.current;
|
|
523
523
|
if (!t) return;
|
|
524
524
|
const { fromSourceIndex: r, toSourceIndex: i, item: n, active: a } = t;
|
|
525
|
-
|
|
525
|
+
te(null), e && a && r !== i && (I != null && I.onReorderRows) && I.onReorderRows(r, i, n);
|
|
526
526
|
},
|
|
527
|
-
[
|
|
528
|
-
),
|
|
527
|
+
[I, te]
|
|
528
|
+
), Me = E(
|
|
529
529
|
(e, t) => {
|
|
530
|
-
const r =
|
|
530
|
+
const r = M.current;
|
|
531
531
|
if (!r) return;
|
|
532
|
-
|
|
533
|
-
const i = e - r.startX, n = t - r.startY, a = Math.hypot(i, n), l = r.active || a >=
|
|
532
|
+
Ve.current = { x: e, y: t };
|
|
533
|
+
const i = e - r.startX, n = t - r.startY, a = Math.hypot(i, n), l = r.active || a >= Rn;
|
|
534
534
|
let h = {
|
|
535
535
|
...r,
|
|
536
536
|
currentX: e,
|
|
@@ -539,10 +539,10 @@ const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), gt = (s)
|
|
|
539
539
|
};
|
|
540
540
|
if (l) {
|
|
541
541
|
r.active || Tt(null);
|
|
542
|
-
const
|
|
543
|
-
if (
|
|
544
|
-
const o =
|
|
545
|
-
|
|
542
|
+
const v = g.current;
|
|
543
|
+
if (v) {
|
|
544
|
+
const o = vn(
|
|
545
|
+
v,
|
|
546
546
|
t,
|
|
547
547
|
r.fromSourceIndex,
|
|
548
548
|
r.rowId
|
|
@@ -551,23 +551,23 @@ const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), gt = (s)
|
|
|
551
551
|
...h,
|
|
552
552
|
toSourceIndex: o.toSourceIndex,
|
|
553
553
|
// Clip to scrollport so the line never draws over the header / outside the card.
|
|
554
|
-
dropLineY:
|
|
554
|
+
dropLineY: kn(
|
|
555
555
|
o.dropLineY,
|
|
556
|
-
|
|
556
|
+
v
|
|
557
557
|
),
|
|
558
558
|
dropLineLeft: o.dropLineLeft,
|
|
559
559
|
dropLineWidth: o.dropLineWidth
|
|
560
560
|
});
|
|
561
561
|
}
|
|
562
562
|
}
|
|
563
|
-
|
|
563
|
+
te(h);
|
|
564
564
|
},
|
|
565
|
-
[
|
|
566
|
-
),
|
|
565
|
+
[te]
|
|
566
|
+
), Xr = E(
|
|
567
567
|
(e, t, r, i) => {
|
|
568
|
-
var
|
|
569
|
-
if (!
|
|
570
|
-
const n = (
|
|
568
|
+
var v, o;
|
|
569
|
+
if (!tt || e.button !== 0) return;
|
|
570
|
+
const n = (v = g.current) == null ? void 0 : v.querySelector(
|
|
571
571
|
`tr[${nr}="${CSS.escape(t)}"]`
|
|
572
572
|
);
|
|
573
573
|
if (!n) return;
|
|
@@ -576,8 +576,8 @@ const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), gt = (s)
|
|
|
576
576
|
e.currentTarget.setPointerCapture(e.pointerId);
|
|
577
577
|
} catch {
|
|
578
578
|
}
|
|
579
|
-
const a = En(n), l =
|
|
580
|
-
|
|
579
|
+
const a = En(n), l = In(n), h = ((o = n.closest("table")) == null ? void 0 : o.getBoundingClientRect()) ?? n.getBoundingClientRect();
|
|
580
|
+
Ve.current = { x: e.clientX, y: e.clientY }, te({
|
|
581
581
|
rowId: t,
|
|
582
582
|
fromSourceIndex: r,
|
|
583
583
|
item: i,
|
|
@@ -595,93 +595,93 @@ const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), gt = (s)
|
|
|
595
595
|
rowClone: l
|
|
596
596
|
});
|
|
597
597
|
},
|
|
598
|
-
[
|
|
598
|
+
[tt, te]
|
|
599
599
|
), $t = p != null;
|
|
600
|
-
|
|
600
|
+
Z(() => {
|
|
601
601
|
if (!$t) return;
|
|
602
602
|
const e = (n) => {
|
|
603
603
|
var a;
|
|
604
|
-
n.pointerId === ((a =
|
|
604
|
+
n.pointerId === ((a = M.current) == null ? void 0 : a.pointerId) && Me(n.clientX, n.clientY);
|
|
605
605
|
}, t = (n) => {
|
|
606
606
|
var a;
|
|
607
|
-
n.pointerId === ((a =
|
|
607
|
+
n.pointerId === ((a = M.current) == null ? void 0 : a.pointerId) && Ge(!0);
|
|
608
608
|
}, r = (n) => {
|
|
609
609
|
var a;
|
|
610
|
-
n.pointerId === ((a =
|
|
610
|
+
n.pointerId === ((a = M.current) == null ? void 0 : a.pointerId) && Ge(!1);
|
|
611
611
|
}, i = (n) => {
|
|
612
|
-
n.key === "Escape" && (n.preventDefault(),
|
|
612
|
+
n.key === "Escape" && (n.preventDefault(), Ge(!1));
|
|
613
613
|
};
|
|
614
614
|
return window.addEventListener("pointermove", e), window.addEventListener("pointerup", t), window.addEventListener("pointercancel", r), window.addEventListener("keydown", i), () => {
|
|
615
615
|
window.removeEventListener("pointermove", e), window.removeEventListener("pointerup", t), window.removeEventListener("pointercancel", r), window.removeEventListener("keydown", i);
|
|
616
616
|
};
|
|
617
|
-
}, [$t,
|
|
617
|
+
}, [$t, Ge, Me]), Z(() => {
|
|
618
618
|
if (!(p != null && p.active)) return;
|
|
619
619
|
const e = document.body.style.userSelect, t = document.body.style.cursor;
|
|
620
620
|
return document.body.style.userSelect = "none", document.body.style.cursor = "grabbing", () => {
|
|
621
621
|
document.body.style.userSelect = e, document.body.style.cursor = t;
|
|
622
622
|
};
|
|
623
|
-
}, [p == null ? void 0 : p.active]),
|
|
623
|
+
}, [p == null ? void 0 : p.active]), Z(() => {
|
|
624
624
|
if (!(p != null && p.active)) return;
|
|
625
625
|
let e = 0;
|
|
626
626
|
const t = () => {
|
|
627
|
-
const r =
|
|
627
|
+
const r = M.current, i = g.current;
|
|
628
628
|
if (!(r != null && r.active) || !i) return;
|
|
629
|
-
const { x: n, y: a } =
|
|
630
|
-
l !== 0 && (i.scrollTop += l,
|
|
629
|
+
const { x: n, y: a } = Ve.current, l = Nn(i, a);
|
|
630
|
+
l !== 0 && (i.scrollTop += l, Me(n, a)), e = requestAnimationFrame(t);
|
|
631
631
|
};
|
|
632
632
|
return e = requestAnimationFrame(t), () => cancelAnimationFrame(e);
|
|
633
|
-
}, [p == null ? void 0 : p.active,
|
|
634
|
-
const
|
|
633
|
+
}, [p == null ? void 0 : p.active, Me]);
|
|
634
|
+
const Ue = E(
|
|
635
635
|
(e, t) => {
|
|
636
|
-
const r =
|
|
636
|
+
const r = $.current, i = g.current;
|
|
637
637
|
if (!r || !i) return;
|
|
638
|
-
|
|
639
|
-
const n = e - r.startX, a = t - r.startY, l = Math.hypot(n, a), h = r.active || l >=
|
|
640
|
-
if (h && !r.active && (r.active = !0,
|
|
641
|
-
const
|
|
642
|
-
o && (r.focus = o,
|
|
638
|
+
Je.current = { x: e, y: t };
|
|
639
|
+
const n = e - r.startX, a = t - r.startY, l = Math.hypot(n, a), h = r.active || l >= Sn;
|
|
640
|
+
if (h && !r.active && (r.active = !0, Ft(!0)), !h) return;
|
|
641
|
+
const v = Tn(i, e, t), o = v ? Be(v) : null;
|
|
642
|
+
o && (r.focus = o, A({
|
|
643
643
|
anchor: r.anchor,
|
|
644
644
|
focus: o
|
|
645
645
|
}));
|
|
646
646
|
},
|
|
647
|
-
[
|
|
648
|
-
),
|
|
649
|
-
const t =
|
|
650
|
-
|
|
647
|
+
[A]
|
|
648
|
+
), ut = E((e) => {
|
|
649
|
+
const t = $.current;
|
|
650
|
+
$.current = null, Ft(!1), t && requestAnimationFrame(
|
|
651
651
|
() => rr(
|
|
652
652
|
g.current,
|
|
653
653
|
t.focus.rowId,
|
|
654
654
|
t.focus.columnKey
|
|
655
655
|
)
|
|
656
656
|
);
|
|
657
|
-
}, []),
|
|
657
|
+
}, []), $r = E(
|
|
658
658
|
(e) => {
|
|
659
|
-
if (!y || !
|
|
659
|
+
if (!y || !L || !Q || Ae(e.target)) return;
|
|
660
660
|
const t = ir(
|
|
661
661
|
e.target,
|
|
662
662
|
g.current
|
|
663
663
|
);
|
|
664
664
|
if (!t) return;
|
|
665
|
-
const r =
|
|
666
|
-
r && (e.preventDefault(), e.stopPropagation(),
|
|
665
|
+
const r = Be(t);
|
|
666
|
+
r && (e.preventDefault(), e.stopPropagation(), A(yt(r)), Q({
|
|
667
667
|
rowId: r.rowId,
|
|
668
668
|
columnKey: r.columnKey,
|
|
669
669
|
sourceIndex: r.sourceIndex
|
|
670
670
|
}));
|
|
671
671
|
},
|
|
672
|
-
[y,
|
|
673
|
-
),
|
|
672
|
+
[y, A, L, Q]
|
|
673
|
+
), jr = E(
|
|
674
674
|
(e) => {
|
|
675
|
-
if (!y || !
|
|
675
|
+
if (!y || !L || e.button !== 0 || M.current) return;
|
|
676
676
|
const t = ir(
|
|
677
677
|
e.target,
|
|
678
678
|
g.current
|
|
679
679
|
);
|
|
680
680
|
if (!t) return;
|
|
681
|
-
const r =
|
|
681
|
+
const r = Be(t);
|
|
682
682
|
if (!r) return;
|
|
683
683
|
const i = e.shiftKey && w != null, n = i ? w.anchor : r;
|
|
684
|
-
|
|
684
|
+
Qe.current = null, Je.current = { x: e.clientX, y: e.clientY }, $.current = {
|
|
685
685
|
pointerId: e.pointerId,
|
|
686
686
|
startX: e.clientX,
|
|
687
687
|
startY: e.clientY,
|
|
@@ -690,72 +690,72 @@ const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), gt = (s)
|
|
|
690
690
|
origin: r,
|
|
691
691
|
focus: r,
|
|
692
692
|
extend: i
|
|
693
|
-
},
|
|
693
|
+
}, A(i ? { anchor: n, focus: r } : yt(r));
|
|
694
694
|
},
|
|
695
|
-
[y, w,
|
|
695
|
+
[y, w, A, L]
|
|
696
696
|
);
|
|
697
|
-
|
|
697
|
+
Z(() => {
|
|
698
698
|
if (!y) return;
|
|
699
699
|
const e = (i) => {
|
|
700
|
-
const n =
|
|
701
|
-
!n || i.pointerId !== n.pointerId || (i.preventDefault(),
|
|
700
|
+
const n = $.current;
|
|
701
|
+
!n || i.pointerId !== n.pointerId || (i.preventDefault(), Ue(i.clientX, i.clientY));
|
|
702
702
|
}, t = (i) => {
|
|
703
|
-
const n =
|
|
704
|
-
!n || i.pointerId !== n.pointerId ||
|
|
703
|
+
const n = $.current;
|
|
704
|
+
!n || i.pointerId !== n.pointerId || ut(!0);
|
|
705
705
|
}, r = (i) => {
|
|
706
|
-
const n =
|
|
707
|
-
!n || i.pointerId !== n.pointerId ||
|
|
706
|
+
const n = $.current;
|
|
707
|
+
!n || i.pointerId !== n.pointerId || ut(!1);
|
|
708
708
|
};
|
|
709
709
|
return window.addEventListener("pointermove", e), window.addEventListener("pointerup", t), window.addEventListener("pointercancel", r), () => {
|
|
710
710
|
window.removeEventListener("pointermove", e), window.removeEventListener("pointerup", t), window.removeEventListener("pointercancel", r);
|
|
711
711
|
};
|
|
712
|
-
}, [y,
|
|
713
|
-
if (!
|
|
712
|
+
}, [y, ut, Ue]), Z(() => {
|
|
713
|
+
if (!ne) return;
|
|
714
714
|
const e = document.body.style.userSelect;
|
|
715
715
|
return document.body.style.userSelect = "none", () => {
|
|
716
716
|
document.body.style.userSelect = e;
|
|
717
717
|
};
|
|
718
|
-
}, [
|
|
719
|
-
if (!
|
|
718
|
+
}, [ne]), Z(() => {
|
|
719
|
+
if (!ne) return;
|
|
720
720
|
let e = 0;
|
|
721
721
|
const t = () => {
|
|
722
|
-
const r =
|
|
722
|
+
const r = $.current, i = g.current;
|
|
723
723
|
if (!(r != null && r.active) || !i) return;
|
|
724
|
-
const { x: n, y: a } =
|
|
725
|
-
(l !== 0 || h !== 0) && (l !== 0 && (i.scrollLeft += l), h !== 0 && (i.scrollTop += h),
|
|
724
|
+
const { x: n, y: a } = Je.current, { dx: l, dy: h } = Cn(i, n, a);
|
|
725
|
+
(l !== 0 || h !== 0) && (l !== 0 && (i.scrollLeft += l), h !== 0 && (i.scrollTop += h), Ue(n, a)), e = requestAnimationFrame(t);
|
|
726
726
|
};
|
|
727
727
|
return e = requestAnimationFrame(t), () => cancelAnimationFrame(e);
|
|
728
|
-
}, [
|
|
728
|
+
}, [ne, Ue]), Z(() => {
|
|
729
729
|
if (!y || !w) return;
|
|
730
730
|
const e = (r) => {
|
|
731
|
-
if (
|
|
731
|
+
if (Ae(r.target)) return;
|
|
732
732
|
const i = g.current;
|
|
733
733
|
if (!i) return;
|
|
734
734
|
const n = document.activeElement;
|
|
735
735
|
if (n && !i.contains(n) && r.target instanceof Node && !i.contains(r.target))
|
|
736
736
|
return;
|
|
737
|
-
const a =
|
|
737
|
+
const a = wt(
|
|
738
738
|
w,
|
|
739
739
|
R,
|
|
740
740
|
Y
|
|
741
741
|
);
|
|
742
|
-
!a || !
|
|
742
|
+
!a || !qe || (r.preventDefault(), qe({ selection: w, rect: a, event: r }));
|
|
743
743
|
}, t = (r) => {
|
|
744
744
|
var h;
|
|
745
|
-
if (
|
|
745
|
+
if (Ae(r.target)) return;
|
|
746
746
|
const i = g.current;
|
|
747
747
|
if (!i) return;
|
|
748
748
|
const n = document.activeElement;
|
|
749
749
|
if (n && !i.contains(n) && r.target instanceof Node && !i.contains(r.target))
|
|
750
750
|
return;
|
|
751
|
-
const a =
|
|
751
|
+
const a = wt(
|
|
752
752
|
w,
|
|
753
753
|
R,
|
|
754
754
|
Y
|
|
755
755
|
);
|
|
756
|
-
if (!a || !
|
|
756
|
+
if (!a || !Ke) return;
|
|
757
757
|
const l = ((h = r.clipboardData) == null ? void 0 : h.getData("text/plain")) ?? "";
|
|
758
|
-
r.preventDefault(),
|
|
758
|
+
r.preventDefault(), Ke({ selection: w, rect: a, text: l, event: r });
|
|
759
759
|
};
|
|
760
760
|
return document.addEventListener("copy", e), document.addEventListener("paste", t), () => {
|
|
761
761
|
document.removeEventListener("copy", e), document.removeEventListener("paste", t);
|
|
@@ -765,34 +765,34 @@ const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), gt = (s)
|
|
|
765
765
|
y,
|
|
766
766
|
w,
|
|
767
767
|
Y,
|
|
768
|
-
|
|
769
|
-
|
|
768
|
+
qe,
|
|
769
|
+
Ke
|
|
770
770
|
]);
|
|
771
|
-
const
|
|
772
|
-
if (
|
|
773
|
-
if (
|
|
774
|
-
|
|
771
|
+
const ft = Te && Hn(C, R), Zr = Te && Vn(C, R), qr = () => {
|
|
772
|
+
if (D) {
|
|
773
|
+
if (ft) {
|
|
774
|
+
D(/* @__PURE__ */ new Set());
|
|
775
775
|
return;
|
|
776
776
|
}
|
|
777
|
-
|
|
777
|
+
D("all");
|
|
778
778
|
}
|
|
779
|
-
},
|
|
780
|
-
if (!
|
|
781
|
-
if (
|
|
782
|
-
|
|
779
|
+
}, Kr = (e, t) => {
|
|
780
|
+
if (!D) return;
|
|
781
|
+
if (oe === "single") {
|
|
782
|
+
D(t ? /* @__PURE__ */ new Set([e]) : /* @__PURE__ */ new Set());
|
|
783
783
|
return;
|
|
784
784
|
}
|
|
785
|
-
const r =
|
|
786
|
-
t ? r.add(e) : r.delete(e),
|
|
787
|
-
},
|
|
788
|
-
const t =
|
|
785
|
+
const r = C === "all" ? new Set(R) : new Set(ar(C, R));
|
|
786
|
+
t ? r.add(e) : r.delete(e), D(r);
|
|
787
|
+
}, Hr = (e) => {
|
|
788
|
+
const t = Se.has(e.key);
|
|
789
789
|
return Dt ? /* @__PURE__ */ c(
|
|
790
790
|
m.Row,
|
|
791
791
|
{
|
|
792
792
|
id: `group-${e.key}`,
|
|
793
793
|
highlightSelectedRow: !1,
|
|
794
794
|
className: "bg-secondary_subtle hover:bg-secondary_subtle",
|
|
795
|
-
children: /* @__PURE__ */ c(m.Cell, { colSpan: ye, className: x(
|
|
795
|
+
children: /* @__PURE__ */ c(m.Cell, { colSpan: ye, className: x(b), children: Dt(e) })
|
|
796
796
|
},
|
|
797
797
|
`group-${e.key}`
|
|
798
798
|
) : /* @__PURE__ */ c(
|
|
@@ -805,17 +805,17 @@ const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), gt = (s)
|
|
|
805
805
|
m.Cell,
|
|
806
806
|
{
|
|
807
807
|
colSpan: ye,
|
|
808
|
-
className: x("py-1.5",
|
|
809
|
-
children: /* @__PURE__ */
|
|
808
|
+
className: x("py-1.5", b),
|
|
809
|
+
children: /* @__PURE__ */ S(
|
|
810
810
|
"button",
|
|
811
811
|
{
|
|
812
812
|
type: "button",
|
|
813
813
|
className: "flex w-full items-center gap-2 px-2 text-left text-xs font-medium text-secondary",
|
|
814
|
-
onClick: () =>
|
|
814
|
+
onClick: () => Cr(e.key),
|
|
815
815
|
"aria-expanded": !t,
|
|
816
816
|
children: [
|
|
817
817
|
/* @__PURE__ */ c(
|
|
818
|
-
|
|
818
|
+
en,
|
|
819
819
|
{
|
|
820
820
|
className: x(
|
|
821
821
|
"size-4 shrink-0 text-fg-quaternary transition-transform",
|
|
@@ -824,7 +824,7 @@ const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), gt = (s)
|
|
|
824
824
|
}
|
|
825
825
|
),
|
|
826
826
|
/* @__PURE__ */ c("span", { className: "truncate", children: e.label || "(Empty)" }),
|
|
827
|
-
/* @__PURE__ */
|
|
827
|
+
/* @__PURE__ */ S("span", { className: "text-tertiary", children: [
|
|
828
828
|
"(",
|
|
829
829
|
e.rows.length,
|
|
830
830
|
")"
|
|
@@ -838,42 +838,42 @@ const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), gt = (s)
|
|
|
838
838
|
`group-${e.key}`
|
|
839
839
|
);
|
|
840
840
|
}, jt = (e, t, r = 0) => {
|
|
841
|
-
const i =
|
|
842
|
-
return /* @__PURE__ */
|
|
841
|
+
const i = vt ? vt(e) : !1, n = xe(e), a = Br(e, r), l = qn(C, n, R), h = _r === n, v = (p == null ? void 0 : p.active) === !0 && p.rowId === n;
|
|
842
|
+
return /* @__PURE__ */ S(
|
|
843
843
|
m.Row,
|
|
844
844
|
{
|
|
845
845
|
onAction: () => {
|
|
846
846
|
var o;
|
|
847
|
-
(o =
|
|
847
|
+
(o = M.current) != null && o.active || ve == null || ve(e);
|
|
848
848
|
},
|
|
849
|
-
onMouseEnter: () =>
|
|
850
|
-
onMouseLeave: () =>
|
|
849
|
+
onMouseEnter: () => H == null ? void 0 : H(e, !0),
|
|
850
|
+
onMouseLeave: () => H == null ? void 0 : H(e, !1),
|
|
851
851
|
id: n,
|
|
852
852
|
value: e,
|
|
853
853
|
columns: f,
|
|
854
854
|
expandedColSpan: ye,
|
|
855
855
|
isExpandable: i,
|
|
856
|
-
highlightSelectedRow:
|
|
856
|
+
highlightSelectedRow: ke,
|
|
857
857
|
renderExpandedContent: i ? wr : void 0,
|
|
858
858
|
[nr]: n,
|
|
859
|
-
[
|
|
859
|
+
[Dn]: String(a),
|
|
860
860
|
className: x(
|
|
861
861
|
ve && "cursor-pointer",
|
|
862
862
|
fr ? "prose" : "",
|
|
863
|
-
|
|
864
|
-
|
|
863
|
+
Rt && "[&>td]:after:hidden",
|
|
864
|
+
et && "group/rowactions",
|
|
865
865
|
h && "bg-utility-brand-25 hover:bg-utility-brand-25",
|
|
866
|
-
|
|
866
|
+
U && l && "bg-secondary",
|
|
867
867
|
Wt,
|
|
868
|
-
|
|
868
|
+
$e == null ? void 0 : $e(e)
|
|
869
869
|
),
|
|
870
|
-
style:
|
|
870
|
+
style: v ? Wn : void 0,
|
|
871
871
|
children: [
|
|
872
|
-
|
|
872
|
+
U && /* @__PURE__ */ c(
|
|
873
873
|
m.Cell,
|
|
874
874
|
{
|
|
875
875
|
"data-grid-no-range": "",
|
|
876
|
-
className: x("relative w-10 text-center",
|
|
876
|
+
className: x("relative w-10 text-center", b),
|
|
877
877
|
style: { minWidth: "40px", width: "40px" },
|
|
878
878
|
children: /* @__PURE__ */ c(
|
|
879
879
|
"div",
|
|
@@ -885,7 +885,7 @@ const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), gt = (s)
|
|
|
885
885
|
sr,
|
|
886
886
|
{
|
|
887
887
|
checked: l,
|
|
888
|
-
onCheckedChange: (o) =>
|
|
888
|
+
onCheckedChange: (o) => Kr(n, o === !0),
|
|
889
889
|
"aria-label": `Select row ${n}`,
|
|
890
890
|
className: "items-center justify-center"
|
|
891
891
|
}
|
|
@@ -894,25 +894,25 @@ const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), gt = (s)
|
|
|
894
894
|
)
|
|
895
895
|
}
|
|
896
896
|
),
|
|
897
|
-
f.map((o,
|
|
898
|
-
const
|
|
897
|
+
f.map((o, Ht) => {
|
|
898
|
+
const pt = Ot.get(o.key), we = cr(
|
|
899
899
|
o.key,
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
), me = (
|
|
900
|
+
J,
|
|
901
|
+
pt
|
|
902
|
+
), me = (re == null ? void 0 : re.rowId) === n && (re == null ? void 0 : re.columnKey) === o.key, O = y ? Fn(
|
|
903
903
|
w,
|
|
904
904
|
n,
|
|
905
905
|
o.key,
|
|
906
906
|
R,
|
|
907
907
|
Y
|
|
908
|
-
) : null, Ye = !y &&
|
|
908
|
+
) : null, Ye = !y && L && !me && (q == null ? void 0 : q.rowId) === n && (q == null ? void 0 : q.columnKey) === o.key, ie = !!(O != null && O.inRange) && L && !me, ge = ie && O ? On(O.edges) : void 0, j = lt(o);
|
|
909
909
|
return /* @__PURE__ */ c(
|
|
910
910
|
m.Cell,
|
|
911
911
|
{
|
|
912
912
|
sticky: o.sticky,
|
|
913
913
|
stickyOffset: o.stickyOffset,
|
|
914
914
|
style: {
|
|
915
|
-
...
|
|
915
|
+
...j,
|
|
916
916
|
...ge ? { boxShadow: ge } : null
|
|
917
917
|
},
|
|
918
918
|
"data-grid-cell": "",
|
|
@@ -924,32 +924,32 @@ const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), gt = (s)
|
|
|
924
924
|
// Uncontrolled single-cell highlight (legacy).
|
|
925
925
|
Ye && "z-1 outline-hidden ring-2 ring-inset ring-brand after:opacity-0",
|
|
926
926
|
// Controlled range: fill all selected cells except the anchor; perimeter via boxShadow.
|
|
927
|
-
|
|
928
|
-
|
|
927
|
+
ie && "z-1 outline-hidden after:opacity-0",
|
|
928
|
+
ie && O && !O.isAnchor && "bg-utility-brand-25",
|
|
929
929
|
o.cellClassName,
|
|
930
|
-
|
|
931
|
-
|
|
930
|
+
cn(we),
|
|
931
|
+
b
|
|
932
932
|
),
|
|
933
933
|
children: (() => {
|
|
934
|
-
const Vt =
|
|
935
|
-
|
|
934
|
+
const Vt = Ht === 0 && (i || et) ? /* @__PURE__ */ S("div", { className: "flex items-center", children: [
|
|
935
|
+
I && /* @__PURE__ */ c(
|
|
936
936
|
"div",
|
|
937
937
|
{
|
|
938
938
|
"data-grid-no-range": "",
|
|
939
939
|
className: "flex items-center justify-center",
|
|
940
|
-
onClick: (
|
|
941
|
-
onContextMenu: (
|
|
942
|
-
onKeyDown: (
|
|
940
|
+
onClick: (B) => B.stopPropagation(),
|
|
941
|
+
onContextMenu: (B) => B.stopPropagation(),
|
|
942
|
+
onKeyDown: (B) => B.stopPropagation(),
|
|
943
943
|
children: /* @__PURE__ */ c(
|
|
944
944
|
An,
|
|
945
945
|
{
|
|
946
|
-
config:
|
|
946
|
+
config: I,
|
|
947
947
|
sourceRowIndex: a,
|
|
948
948
|
item: e,
|
|
949
|
-
enableDrag:
|
|
950
|
-
isDragging:
|
|
951
|
-
onDragHandlePointerDown: (
|
|
952
|
-
|
|
949
|
+
enableDrag: tt,
|
|
950
|
+
isDragging: v,
|
|
951
|
+
onDragHandlePointerDown: (B) => Xr(
|
|
952
|
+
B,
|
|
953
953
|
n,
|
|
954
954
|
a,
|
|
955
955
|
e
|
|
@@ -958,16 +958,16 @@ const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), gt = (s)
|
|
|
958
958
|
// Hover-reveal: hidden until row hover / focus / menu open / this row is the drag source.
|
|
959
959
|
// Do not force all handles visible while another row is dragging.
|
|
960
960
|
"transition-opacity group-hover/rowactions:opacity-100 focus-visible:opacity-100",
|
|
961
|
-
h ||
|
|
961
|
+
h || v ? "opacity-100" : "opacity-0"
|
|
962
962
|
),
|
|
963
|
-
onOpenChange: (
|
|
963
|
+
onOpenChange: (B) => Tt(B ? n : null)
|
|
964
964
|
}
|
|
965
965
|
)
|
|
966
966
|
}
|
|
967
967
|
),
|
|
968
|
-
/* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children:
|
|
969
|
-
] }) :
|
|
970
|
-
return
|
|
968
|
+
/* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: gt(o.key, e[o.key], e) })
|
|
969
|
+
] }) : gt(o.key, e[o.key], e);
|
|
970
|
+
return L ? /* @__PURE__ */ c(
|
|
971
971
|
"div",
|
|
972
972
|
{
|
|
973
973
|
"data-grid-focus": !0,
|
|
@@ -981,11 +981,11 @@ const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), gt = (s)
|
|
|
981
981
|
o.key
|
|
982
982
|
);
|
|
983
983
|
}),
|
|
984
|
-
|
|
984
|
+
T && z && /* @__PURE__ */ c(
|
|
985
985
|
m.Cell,
|
|
986
986
|
{
|
|
987
987
|
"data-grid-no-range": "",
|
|
988
|
-
className: x("relative w-14 text-center",
|
|
988
|
+
className: x("relative w-14 text-center", b),
|
|
989
989
|
style: { minWidth: "56px", width: "56px" },
|
|
990
990
|
children: /* @__PURE__ */ c(
|
|
991
991
|
"button",
|
|
@@ -995,9 +995,9 @@ const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), gt = (s)
|
|
|
995
995
|
"aria-label": "Delete row",
|
|
996
996
|
className: "inline-flex items-center justify-center rounded p-1 text-fg-quaternary hover:bg-secondary_subtle hover:text-fg-secondary",
|
|
997
997
|
onClick: (o) => {
|
|
998
|
-
o.stopPropagation(),
|
|
998
|
+
o.stopPropagation(), z.onDeleteRow(a);
|
|
999
999
|
},
|
|
1000
|
-
children: /* @__PURE__ */ c(
|
|
1000
|
+
children: /* @__PURE__ */ c(Bn, { name: "Trash02", className: "size-3" })
|
|
1001
1001
|
}
|
|
1002
1002
|
)
|
|
1003
1003
|
}
|
|
@@ -1006,17 +1006,17 @@ const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), gt = (s)
|
|
|
1006
1006
|
},
|
|
1007
1007
|
n
|
|
1008
1008
|
);
|
|
1009
|
-
},
|
|
1009
|
+
}, Vr = (e) => /* @__PURE__ */ S(
|
|
1010
1010
|
m.Row,
|
|
1011
1011
|
{
|
|
1012
1012
|
id: String(e.id),
|
|
1013
1013
|
isExpandable: !1,
|
|
1014
|
-
className: x(
|
|
1014
|
+
className: x(Rt && "[&>td]:after:hidden", Wt),
|
|
1015
1015
|
children: [
|
|
1016
|
-
|
|
1016
|
+
U && /* @__PURE__ */ c(
|
|
1017
1017
|
m.Cell,
|
|
1018
1018
|
{
|
|
1019
|
-
className: x("relative w-10",
|
|
1019
|
+
className: x("relative w-10", b),
|
|
1020
1020
|
style: { minWidth: "40px", width: "40px" }
|
|
1021
1021
|
}
|
|
1022
1022
|
),
|
|
@@ -1025,67 +1025,67 @@ const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), gt = (s)
|
|
|
1025
1025
|
{
|
|
1026
1026
|
sticky: t.sticky,
|
|
1027
1027
|
stickyOffset: t.stickyOffset,
|
|
1028
|
-
style:
|
|
1028
|
+
style: lt(t),
|
|
1029
1029
|
className: x(
|
|
1030
1030
|
"overflow-x-hidden text-left",
|
|
1031
1031
|
t.cellClassName,
|
|
1032
|
-
|
|
1032
|
+
b
|
|
1033
1033
|
),
|
|
1034
|
-
children: /* @__PURE__ */ c(
|
|
1034
|
+
children: /* @__PURE__ */ c(Xn, { height: "14px", width: "75%", className: "rounded" })
|
|
1035
1035
|
},
|
|
1036
1036
|
t.key
|
|
1037
1037
|
)),
|
|
1038
|
-
|
|
1038
|
+
T && /* @__PURE__ */ c(
|
|
1039
1039
|
m.Cell,
|
|
1040
1040
|
{
|
|
1041
|
-
className: x("w-14",
|
|
1041
|
+
className: x("w-14", b),
|
|
1042
1042
|
style: { minWidth: "56px", width: "56px" }
|
|
1043
1043
|
}
|
|
1044
1044
|
)
|
|
1045
1045
|
]
|
|
1046
1046
|
},
|
|
1047
1047
|
String(e.id)
|
|
1048
|
-
),
|
|
1049
|
-
const t =
|
|
1048
|
+
), Jr = () => X ? Fe.map((e) => Vr(e)) : Ce && V ? V.flatMap((e) => {
|
|
1049
|
+
const t = Se.has(e.key);
|
|
1050
1050
|
return [
|
|
1051
|
-
|
|
1051
|
+
Hr(e),
|
|
1052
1052
|
...t ? [] : e.rows.map(
|
|
1053
1053
|
(r, i) => jt(r, void 0, i)
|
|
1054
1054
|
)
|
|
1055
1055
|
];
|
|
1056
1056
|
}) : Fe.map(
|
|
1057
1057
|
(e, t) => jt(e, void 0, t)
|
|
1058
|
-
),
|
|
1059
|
-
|
|
1058
|
+
), Zt = /* @__PURE__ */ c(
|
|
1059
|
+
tn.Root,
|
|
1060
1060
|
{
|
|
1061
|
-
ref:
|
|
1062
|
-
onKeyDownCapture:
|
|
1063
|
-
onPointerDownCapture: y ?
|
|
1064
|
-
onDoubleClickCapture: y ?
|
|
1061
|
+
ref: Yr,
|
|
1062
|
+
onKeyDownCapture: L ? Mr : void 0,
|
|
1063
|
+
onPointerDownCapture: y ? jr : void 0,
|
|
1064
|
+
onDoubleClickCapture: y ? $r : void 0,
|
|
1065
1065
|
className: x(
|
|
1066
1066
|
"w-full",
|
|
1067
|
-
!
|
|
1067
|
+
!W || Xt ? "overflow-x-auto" : "overflow-x-hidden",
|
|
1068
1068
|
Ie && "border border-secondary rounded-xl",
|
|
1069
1069
|
"[&_tr:hover>td]:!bg-secondary_subtle",
|
|
1070
1070
|
hr
|
|
1071
1071
|
),
|
|
1072
|
-
size:
|
|
1073
|
-
children: /* @__PURE__ */
|
|
1072
|
+
size: xt,
|
|
1073
|
+
children: /* @__PURE__ */ S(
|
|
1074
1074
|
m,
|
|
1075
1075
|
{
|
|
1076
|
-
"data-table-zoom-typography":
|
|
1076
|
+
"data-table-zoom-typography": Pe !== void 0 ? "" : void 0,
|
|
1077
1077
|
"aria-label": ur,
|
|
1078
|
-
size:
|
|
1079
|
-
isEditable:
|
|
1080
|
-
inlineSelection:
|
|
1078
|
+
size: xt,
|
|
1079
|
+
isEditable: L,
|
|
1080
|
+
inlineSelection: ke,
|
|
1081
1081
|
className: x(
|
|
1082
|
-
|
|
1082
|
+
W && "min-w-full",
|
|
1083
1083
|
mr
|
|
1084
1084
|
),
|
|
1085
|
-
style:
|
|
1086
|
-
...
|
|
1085
|
+
style: Ur,
|
|
1086
|
+
...Ar,
|
|
1087
1087
|
children: [
|
|
1088
|
-
/* @__PURE__ */
|
|
1088
|
+
/* @__PURE__ */ S(
|
|
1089
1089
|
m.Header,
|
|
1090
1090
|
{
|
|
1091
1091
|
className: x(
|
|
@@ -1094,20 +1094,20 @@ const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), gt = (s)
|
|
|
1094
1094
|
yr
|
|
1095
1095
|
),
|
|
1096
1096
|
children: [
|
|
1097
|
-
|
|
1097
|
+
U && /* @__PURE__ */ c(
|
|
1098
1098
|
m.Head,
|
|
1099
1099
|
{
|
|
1100
1100
|
label: "",
|
|
1101
1101
|
allowsSorting: !1,
|
|
1102
1102
|
isRowHeader: !1,
|
|
1103
1103
|
style: { minWidth: "40px", width: "40px" },
|
|
1104
|
-
className: x(
|
|
1104
|
+
className: x(b),
|
|
1105
1105
|
headerCellClass: "justify-center",
|
|
1106
|
-
children:
|
|
1106
|
+
children: oe === "multiple" && D && /* @__PURE__ */ c("div", { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ c(
|
|
1107
1107
|
sr,
|
|
1108
1108
|
{
|
|
1109
|
-
checked:
|
|
1110
|
-
onCheckedChange: () =>
|
|
1109
|
+
checked: ft ? !0 : Zr && !ft ? "indeterminate" : !1,
|
|
1110
|
+
onCheckedChange: () => qr(),
|
|
1111
1111
|
"aria-label": "Select all rows",
|
|
1112
1112
|
className: "items-center justify-center"
|
|
1113
1113
|
}
|
|
@@ -1116,9 +1116,9 @@ const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), gt = (s)
|
|
|
1116
1116
|
"selection"
|
|
1117
1117
|
),
|
|
1118
1118
|
f.map((e, t) => {
|
|
1119
|
-
const r =
|
|
1119
|
+
const r = kr ? Tr.get(e.key) : void 0, i = Ot.get(e.key), n = cr(
|
|
1120
1120
|
e.key,
|
|
1121
|
-
|
|
1121
|
+
J,
|
|
1122
1122
|
i
|
|
1123
1123
|
), a = pr.includes(e.key) || n === "center" ? "justify-center" : n === "right" ? "justify-end" : "";
|
|
1124
1124
|
return /* @__PURE__ */ c(
|
|
@@ -1131,50 +1131,50 @@ const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), gt = (s)
|
|
|
1131
1131
|
isRowHeader: t === 0,
|
|
1132
1132
|
allowsSorting: e.allowsSorting,
|
|
1133
1133
|
headerCellClass: `${e.headerCellClass} ${a}`,
|
|
1134
|
-
style:
|
|
1134
|
+
style: lt(e),
|
|
1135
1135
|
className: x(
|
|
1136
1136
|
"overflow-hidden",
|
|
1137
1137
|
e.headClassName,
|
|
1138
|
-
|
|
1138
|
+
b
|
|
1139
1139
|
),
|
|
1140
1140
|
headerAction: r && _e ? /* @__PURE__ */ c(
|
|
1141
1141
|
Mn,
|
|
1142
1142
|
{
|
|
1143
1143
|
column: r,
|
|
1144
|
-
columnLabel: r.label ?? (i ?
|
|
1144
|
+
columnLabel: r.label ?? (i ? an(i, Ir) : e.label),
|
|
1145
1145
|
currentAlignment: i ? dr(
|
|
1146
1146
|
i,
|
|
1147
|
-
|
|
1148
|
-
) : (
|
|
1149
|
-
capabilities:
|
|
1147
|
+
J ?? /* @__PURE__ */ new Map()
|
|
1148
|
+
) : (J == null ? void 0 : J.get(e.key)) ?? "left",
|
|
1149
|
+
capabilities: Er,
|
|
1150
1150
|
hideDisabled: f.length <= 1,
|
|
1151
|
-
onAction:
|
|
1151
|
+
onAction: Gr.get(e.key),
|
|
1152
1152
|
renderExtraItems: Lr,
|
|
1153
1153
|
showOnHeaderHover: !0
|
|
1154
1154
|
}
|
|
1155
1155
|
) : void 0,
|
|
1156
|
-
children: (
|
|
1156
|
+
children: (Xe == null ? void 0 : Xe(e.key)) ?? null
|
|
1157
1157
|
},
|
|
1158
1158
|
e.key
|
|
1159
1159
|
);
|
|
1160
1160
|
}),
|
|
1161
|
-
|
|
1161
|
+
T && /* @__PURE__ */ c(
|
|
1162
1162
|
m.Head,
|
|
1163
1163
|
{
|
|
1164
1164
|
label: "",
|
|
1165
1165
|
allowsSorting: !1,
|
|
1166
1166
|
isRowHeader: !1,
|
|
1167
1167
|
style: { minWidth: "56px", width: "56px" },
|
|
1168
|
-
className: x(
|
|
1168
|
+
className: x(b)
|
|
1169
1169
|
},
|
|
1170
1170
|
"actions"
|
|
1171
1171
|
)
|
|
1172
1172
|
]
|
|
1173
1173
|
}
|
|
1174
1174
|
),
|
|
1175
|
-
/* @__PURE__ */
|
|
1176
|
-
!
|
|
1177
|
-
|
|
1175
|
+
/* @__PURE__ */ S(m.Body, { children: [
|
|
1176
|
+
!Yt && Jr(),
|
|
1177
|
+
Or && /* @__PURE__ */ c(
|
|
1178
1178
|
m.Row,
|
|
1179
1179
|
{
|
|
1180
1180
|
id: "empty-state",
|
|
@@ -1185,15 +1185,15 @@ const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), gt = (s)
|
|
|
1185
1185
|
colSpan: ye,
|
|
1186
1186
|
className: x(
|
|
1187
1187
|
"text-left text-placeholder_subtle border-b border-secondary py-3",
|
|
1188
|
-
|
|
1188
|
+
b
|
|
1189
1189
|
),
|
|
1190
|
-
children:
|
|
1190
|
+
children: Lt
|
|
1191
1191
|
}
|
|
1192
1192
|
)
|
|
1193
1193
|
},
|
|
1194
1194
|
"empty-state"
|
|
1195
1195
|
),
|
|
1196
|
-
|
|
1196
|
+
it && z && /* @__PURE__ */ S(
|
|
1197
1197
|
m.Row,
|
|
1198
1198
|
{
|
|
1199
1199
|
id: "add-row-footer",
|
|
@@ -1202,24 +1202,24 @@ const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), gt = (s)
|
|
|
1202
1202
|
/* @__PURE__ */ c(
|
|
1203
1203
|
m.Cell,
|
|
1204
1204
|
{
|
|
1205
|
-
colSpan: ye - (
|
|
1206
|
-
className: x(
|
|
1205
|
+
colSpan: ye - (T ? 1 : 0),
|
|
1206
|
+
className: x(b),
|
|
1207
1207
|
children: /* @__PURE__ */ c(
|
|
1208
|
-
|
|
1208
|
+
Un,
|
|
1209
1209
|
{
|
|
1210
1210
|
color: "tertiary",
|
|
1211
1211
|
className: "bg-secondary text-primary",
|
|
1212
1212
|
size: "xs",
|
|
1213
|
-
onClick:
|
|
1213
|
+
onClick: z.onAddRow,
|
|
1214
1214
|
children: "+ Add Row"
|
|
1215
1215
|
}
|
|
1216
1216
|
)
|
|
1217
1217
|
}
|
|
1218
1218
|
),
|
|
1219
|
-
|
|
1219
|
+
T && /* @__PURE__ */ c(
|
|
1220
1220
|
m.Cell,
|
|
1221
1221
|
{
|
|
1222
|
-
className: x("w-14",
|
|
1222
|
+
className: x("w-14", b),
|
|
1223
1223
|
style: { minWidth: "56px", width: "56px" }
|
|
1224
1224
|
}
|
|
1225
1225
|
)
|
|
@@ -1227,12 +1227,12 @@ const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), gt = (s)
|
|
|
1227
1227
|
},
|
|
1228
1228
|
"add-row-footer"
|
|
1229
1229
|
),
|
|
1230
|
-
|
|
1231
|
-
|
|
1230
|
+
zr && Ze && /* @__PURE__ */ c(
|
|
1231
|
+
Yn,
|
|
1232
1232
|
{
|
|
1233
|
-
...
|
|
1234
|
-
hasActionsColumn:
|
|
1235
|
-
hasSelectionColumn:
|
|
1233
|
+
...Ze,
|
|
1234
|
+
hasActionsColumn: T,
|
|
1235
|
+
hasSelectionColumn: U,
|
|
1236
1236
|
showBorders: !!Ie
|
|
1237
1237
|
}
|
|
1238
1238
|
)
|
|
@@ -1241,20 +1241,20 @@ const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), gt = (s)
|
|
|
1241
1241
|
}
|
|
1242
1242
|
)
|
|
1243
1243
|
}
|
|
1244
|
-
),
|
|
1245
|
-
|
|
1244
|
+
), qt = L ? /* @__PURE__ */ c(
|
|
1245
|
+
gn,
|
|
1246
1246
|
{
|
|
1247
1247
|
rowIds: R,
|
|
1248
1248
|
columnKeys: Y,
|
|
1249
1249
|
containerRef: g,
|
|
1250
|
-
onSelectCell:
|
|
1251
|
-
onEditingCellChange:
|
|
1252
|
-
children:
|
|
1250
|
+
onSelectCell: st,
|
|
1251
|
+
onEditingCellChange: Sr,
|
|
1252
|
+
children: Zt
|
|
1253
1253
|
}
|
|
1254
|
-
) :
|
|
1255
|
-
/* @__PURE__ */ c(
|
|
1254
|
+
) : Zt, Kt = p != null && p.active ? /* @__PURE__ */ S(Jt, { children: [
|
|
1255
|
+
/* @__PURE__ */ c(Ln, { session: p }),
|
|
1256
1256
|
p.dropLineY != null && /* @__PURE__ */ c(
|
|
1257
|
-
|
|
1257
|
+
bn,
|
|
1258
1258
|
{
|
|
1259
1259
|
y: p.dropLineY,
|
|
1260
1260
|
left: p.dropLineLeft,
|
|
@@ -1262,28 +1262,28 @@ const Re = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), gt = (s)
|
|
|
1262
1262
|
}
|
|
1263
1263
|
)
|
|
1264
1264
|
] }) : null;
|
|
1265
|
-
return
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
Ut &&
|
|
1269
|
-
|
|
1265
|
+
return Fr ? /* @__PURE__ */ S("div", { className: "flex flex-col gap-3", children: [
|
|
1266
|
+
Mt && Gt,
|
|
1267
|
+
qt,
|
|
1268
|
+
Ut && _ && /* @__PURE__ */ c(
|
|
1269
|
+
rn,
|
|
1270
1270
|
{
|
|
1271
|
-
currentPage:
|
|
1272
|
-
pageSize:
|
|
1273
|
-
totalPages:
|
|
1274
|
-
totalItems:
|
|
1275
|
-
onPageChange:
|
|
1276
|
-
onPageSizeChange:
|
|
1277
|
-
showPagination:
|
|
1271
|
+
currentPage: _.currentPage,
|
|
1272
|
+
pageSize: _.pageSize,
|
|
1273
|
+
totalPages: _.totalPages,
|
|
1274
|
+
totalItems: _.totalItems,
|
|
1275
|
+
onPageChange: _.onPageChange,
|
|
1276
|
+
onPageSizeChange: _.onPageSizeChange,
|
|
1277
|
+
showPagination: _.showPagination
|
|
1278
1278
|
}
|
|
1279
1279
|
),
|
|
1280
|
-
|
|
1281
|
-
] }) : /* @__PURE__ */
|
|
1282
|
-
|
|
1283
|
-
|
|
1280
|
+
Kt
|
|
1281
|
+
] }) : /* @__PURE__ */ S(Jt, { children: [
|
|
1282
|
+
qt,
|
|
1283
|
+
Kt
|
|
1284
1284
|
] });
|
|
1285
1285
|
}
|
|
1286
1286
|
);
|
|
1287
1287
|
export {
|
|
1288
|
-
|
|
1288
|
+
bi as TableWrapper
|
|
1289
1289
|
};
|