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