@pibit.ai/cure-design-system 0.3.43 → 0.3.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/applications/loading-indicator/index.d.ts +2 -0
- package/dist/applications/loading-indicator/index.d.ts.map +1 -0
- package/dist/applications/loading-indicator/loading-indicator.d.ts +1 -2
- package/dist/applications/loading-indicator/loading-indicator.d.ts.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +175 -162
- package/dist/patterns/table/TableWrapper.d.ts.map +1 -1
- package/dist/patterns/table/TableWrapper.js +538 -564
- 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 +814 -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 +207 -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/hint-text.d.ts +1 -2
- package/dist/primitives/input/hint-text.d.ts.map +1 -1
- package/dist/primitives/input/index.d.ts +3 -1
- package/dist/primitives/input/index.d.ts.map +1 -1
- package/dist/primitives/input/input.d.ts +1 -1
- package/dist/primitives/input/input.d.ts.map +1 -1
- package/dist/primitives/input/input.js +135 -129
- package/dist/primitives/input/label.d.ts +1 -2
- package/dist/primitives/input/label.d.ts.map +1 -1
- package/dist/primitives/select/index.d.ts +1 -0
- package/dist/primitives/select/index.d.ts.map +1 -1
- package/dist/primitives/select/select-item.d.ts +1 -2
- package/dist/primitives/select/select-item.d.ts.map +1 -1
- package/dist/styles/components.css +1 -1
- package/dist/styles/theme.css +1 -1
- package/package.json +6 -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,200 +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
|
-
const e =
|
|
521
|
-
|
|
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 : {
|
|
522
494
|
...e,
|
|
523
495
|
// The zoom-independent base, so the painted width tracks the zoom and overflows by
|
|
524
496
|
// more as you zoom in — matching the widths `getColumnStyle` hands the columns.
|
|
525
|
-
width: `${
|
|
497
|
+
width: `${Me ?? te.minTableWidth}px`,
|
|
526
498
|
tableLayout: "fixed"
|
|
527
499
|
};
|
|
528
500
|
}, [
|
|
529
|
-
|
|
501
|
+
_,
|
|
530
502
|
te,
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
503
|
+
Xt,
|
|
504
|
+
Me,
|
|
505
|
+
G,
|
|
506
|
+
ue,
|
|
507
|
+
Se
|
|
508
|
+
]), Zr = I(
|
|
536
509
|
(e) => {
|
|
537
|
-
g.current = e, typeof
|
|
510
|
+
g.current = e, typeof le == "function" ? le(e) : le && (le.current = e);
|
|
538
511
|
},
|
|
539
|
-
[
|
|
540
|
-
),
|
|
512
|
+
[le]
|
|
513
|
+
), Ur = Ce && Ee ? {
|
|
541
514
|
selectionMode: ae,
|
|
542
515
|
selectedKeys: F === "all" ? "all" : F,
|
|
543
|
-
onSelectionChange: Vn(
|
|
544
|
-
} : {},
|
|
545
|
-
const
|
|
546
|
-
return typeof
|
|
547
|
-
},
|
|
516
|
+
onSelectionChange: Vn(P)
|
|
517
|
+
} : {}, Ar = (e, t = 0) => {
|
|
518
|
+
const r = e.__sourceIndex;
|
|
519
|
+
return typeof r == "number" ? r : t;
|
|
520
|
+
}, Ze = I(
|
|
548
521
|
(e) => {
|
|
549
|
-
const
|
|
550
|
-
if (!r) return;
|
|
551
|
-
const { fromSourceIndex: t, toSourceIndex: i, item: n, active: c } = r;
|
|
552
|
-
re(null), e && c && t !== i && (L != null && L.onReorderRows) && L.onReorderRows(t, i, n);
|
|
553
|
-
},
|
|
554
|
-
[L, re]
|
|
555
|
-
), Ae = I(
|
|
556
|
-
(e, r) => {
|
|
557
|
-
const t = A.current;
|
|
522
|
+
const t = U.current;
|
|
558
523
|
if (!t) return;
|
|
559
|
-
|
|
560
|
-
|
|
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;
|
|
561
534
|
let h = {
|
|
562
|
-
...
|
|
535
|
+
...r,
|
|
563
536
|
currentX: e,
|
|
564
|
-
currentY:
|
|
537
|
+
currentY: t,
|
|
565
538
|
active: l
|
|
566
539
|
};
|
|
567
540
|
if (l) {
|
|
568
|
-
|
|
541
|
+
r.active || Tt(null);
|
|
569
542
|
const k = g.current;
|
|
570
543
|
if (k) {
|
|
571
544
|
const o = Rn(
|
|
572
545
|
k,
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
546
|
+
t,
|
|
547
|
+
r.fromSourceIndex,
|
|
548
|
+
r.rowId
|
|
576
549
|
);
|
|
577
550
|
o && (h = {
|
|
578
551
|
...h,
|
|
@@ -591,11 +564,11 @@ const be = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), Rt = (s)
|
|
|
591
564
|
},
|
|
592
565
|
[re]
|
|
593
566
|
), Yr = I(
|
|
594
|
-
(e,
|
|
567
|
+
(e, t, r, i) => {
|
|
595
568
|
var k, o;
|
|
596
|
-
if (!
|
|
569
|
+
if (!rt || e.button !== 0) return;
|
|
597
570
|
const n = (k = g.current) == null ? void 0 : k.querySelector(
|
|
598
|
-
`tr[${nr}="${CSS.escape(
|
|
571
|
+
`tr[${nr}="${CSS.escape(t)}"]`
|
|
599
572
|
);
|
|
600
573
|
if (!n) return;
|
|
601
574
|
e.preventDefault();
|
|
@@ -603,10 +576,10 @@ const be = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), Rt = (s)
|
|
|
603
576
|
e.currentTarget.setPointerCapture(e.pointerId);
|
|
604
577
|
} catch {
|
|
605
578
|
}
|
|
606
|
-
const
|
|
607
|
-
|
|
608
|
-
rowId:
|
|
609
|
-
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,
|
|
610
583
|
item: i,
|
|
611
584
|
pointerId: e.pointerId,
|
|
612
585
|
startX: e.clientX,
|
|
@@ -614,244 +587,244 @@ const be = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), Rt = (s)
|
|
|
614
587
|
currentX: e.clientX,
|
|
615
588
|
currentY: e.clientY,
|
|
616
589
|
active: !1,
|
|
617
|
-
preview:
|
|
618
|
-
toSourceIndex:
|
|
590
|
+
preview: a,
|
|
591
|
+
toSourceIndex: r,
|
|
619
592
|
dropLineY: null,
|
|
620
593
|
dropLineLeft: h.left,
|
|
621
594
|
dropLineWidth: h.width,
|
|
622
595
|
rowClone: l
|
|
623
596
|
});
|
|
624
597
|
},
|
|
625
|
-
[
|
|
626
|
-
),
|
|
627
|
-
|
|
628
|
-
if (
|
|
598
|
+
[rt, re]
|
|
599
|
+
), $t = p != null;
|
|
600
|
+
$(() => {
|
|
601
|
+
if (!$t) return;
|
|
629
602
|
const e = (n) => {
|
|
630
|
-
var
|
|
631
|
-
n.pointerId === ((
|
|
632
|
-
}, r = (n) => {
|
|
633
|
-
var c;
|
|
634
|
-
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);
|
|
635
605
|
}, t = (n) => {
|
|
636
|
-
var
|
|
637
|
-
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);
|
|
638
611
|
}, i = (n) => {
|
|
639
|
-
n.key === "Escape" && (n.preventDefault(),
|
|
612
|
+
n.key === "Escape" && (n.preventDefault(), Ze(!1));
|
|
640
613
|
};
|
|
641
|
-
return window.addEventListener("pointermove", e), window.addEventListener("pointerup",
|
|
642
|
-
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);
|
|
643
616
|
};
|
|
644
|
-
}, [
|
|
617
|
+
}, [$t, Ze, Ue]), $(() => {
|
|
645
618
|
if (!(p != null && p.active)) return;
|
|
646
|
-
const e = document.body.style.userSelect,
|
|
619
|
+
const e = document.body.style.userSelect, t = document.body.style.cursor;
|
|
647
620
|
return document.body.style.userSelect = "none", document.body.style.cursor = "grabbing", () => {
|
|
648
|
-
document.body.style.userSelect = e, document.body.style.cursor =
|
|
621
|
+
document.body.style.userSelect = e, document.body.style.cursor = t;
|
|
649
622
|
};
|
|
650
|
-
}, [p == null ? void 0 : p.active]),
|
|
623
|
+
}, [p == null ? void 0 : p.active]), $(() => {
|
|
651
624
|
if (!(p != null && p.active)) return;
|
|
652
625
|
let e = 0;
|
|
653
|
-
const
|
|
654
|
-
const
|
|
655
|
-
if (!(
|
|
656
|
-
const { x: n, y:
|
|
657
|
-
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);
|
|
658
631
|
};
|
|
659
|
-
return e = requestAnimationFrame(
|
|
660
|
-
}, [p == null ? void 0 : p.active,
|
|
661
|
-
const
|
|
662
|
-
(e,
|
|
663
|
-
const
|
|
664
|
-
if (!
|
|
665
|
-
|
|
666
|
-
const n = e -
|
|
667
|
-
if (h && !
|
|
668
|
-
const k = Sn(i, e,
|
|
669
|
-
o && (
|
|
670
|
-
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,
|
|
671
644
|
focus: o
|
|
672
645
|
}));
|
|
673
646
|
},
|
|
674
647
|
[B]
|
|
675
|
-
),
|
|
676
|
-
const
|
|
677
|
-
q.current = null, Ot(!1),
|
|
648
|
+
), ft = I((e) => {
|
|
649
|
+
const t = q.current;
|
|
650
|
+
q.current = null, Ot(!1), t && requestAnimationFrame(
|
|
678
651
|
() => rr(
|
|
679
652
|
g.current,
|
|
680
|
-
|
|
681
|
-
|
|
653
|
+
t.focus.rowId,
|
|
654
|
+
t.focus.columnKey
|
|
682
655
|
)
|
|
683
656
|
);
|
|
684
657
|
}, []), Br = I(
|
|
685
658
|
(e) => {
|
|
686
|
-
if (!y || !
|
|
687
|
-
const
|
|
659
|
+
if (!y || !N || !ee || Be(e.target)) return;
|
|
660
|
+
const t = ir(
|
|
688
661
|
e.target,
|
|
689
662
|
g.current
|
|
690
663
|
);
|
|
691
|
-
if (!
|
|
692
|
-
const
|
|
693
|
-
|
|
694
|
-
rowId:
|
|
695
|
-
columnKey:
|
|
696
|
-
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
|
|
697
670
|
}));
|
|
698
671
|
},
|
|
699
|
-
[y, B,
|
|
700
|
-
),
|
|
672
|
+
[y, B, N, ee]
|
|
673
|
+
), Xr = I(
|
|
701
674
|
(e) => {
|
|
702
|
-
if (!y || !
|
|
703
|
-
const
|
|
675
|
+
if (!y || !N || e.button !== 0 || U.current) return;
|
|
676
|
+
const t = ir(
|
|
704
677
|
e.target,
|
|
705
678
|
g.current
|
|
706
679
|
);
|
|
707
|
-
if (!r) return;
|
|
708
|
-
const t = $e(r);
|
|
709
680
|
if (!t) return;
|
|
710
|
-
const
|
|
711
|
-
|
|
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 = {
|
|
712
685
|
pointerId: e.pointerId,
|
|
713
686
|
startX: e.clientX,
|
|
714
687
|
startY: e.clientY,
|
|
715
688
|
active: !1,
|
|
716
689
|
anchor: n,
|
|
717
|
-
origin:
|
|
718
|
-
focus:
|
|
690
|
+
origin: r,
|
|
691
|
+
focus: r,
|
|
719
692
|
extend: i
|
|
720
|
-
}, B(i ? { anchor: n, focus:
|
|
693
|
+
}, B(i ? { anchor: n, focus: r } : wt(r));
|
|
721
694
|
},
|
|
722
|
-
[y, w, B,
|
|
695
|
+
[y, w, B, N]
|
|
723
696
|
);
|
|
724
|
-
|
|
697
|
+
$(() => {
|
|
725
698
|
if (!y) return;
|
|
726
699
|
const e = (i) => {
|
|
727
700
|
const n = q.current;
|
|
728
|
-
!n || i.pointerId !== n.pointerId || (i.preventDefault(),
|
|
729
|
-
}, r = (i) => {
|
|
730
|
-
const n = q.current;
|
|
731
|
-
!n || i.pointerId !== n.pointerId || pt(!0);
|
|
701
|
+
!n || i.pointerId !== n.pointerId || (i.preventDefault(), Ae(i.clientX, i.clientY));
|
|
732
702
|
}, t = (i) => {
|
|
733
703
|
const n = q.current;
|
|
734
|
-
!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);
|
|
735
708
|
};
|
|
736
|
-
return window.addEventListener("pointermove", e), window.addEventListener("pointerup",
|
|
737
|
-
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);
|
|
738
711
|
};
|
|
739
|
-
}, [y,
|
|
712
|
+
}, [y, ft, Ae]), $(() => {
|
|
740
713
|
if (!ie) return;
|
|
741
714
|
const e = document.body.style.userSelect;
|
|
742
715
|
return document.body.style.userSelect = "none", () => {
|
|
743
716
|
document.body.style.userSelect = e;
|
|
744
717
|
};
|
|
745
|
-
}, [ie]),
|
|
718
|
+
}, [ie]), $(() => {
|
|
746
719
|
if (!ie) return;
|
|
747
720
|
let e = 0;
|
|
748
|
-
const
|
|
749
|
-
const
|
|
750
|
-
if (!(
|
|
751
|
-
const { x: n, y:
|
|
752
|
-
(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);
|
|
753
726
|
};
|
|
754
|
-
return e = requestAnimationFrame(
|
|
755
|
-
}, [ie,
|
|
727
|
+
return e = requestAnimationFrame(t), () => cancelAnimationFrame(e);
|
|
728
|
+
}, [ie, Ae]), $(() => {
|
|
756
729
|
if (!y || !w) return;
|
|
757
|
-
const e = (
|
|
758
|
-
if (Be(
|
|
730
|
+
const e = (r) => {
|
|
731
|
+
if (Be(r.target)) return;
|
|
759
732
|
const i = g.current;
|
|
760
733
|
if (!i) return;
|
|
761
734
|
const n = document.activeElement;
|
|
762
|
-
if (n && !i.contains(n) &&
|
|
735
|
+
if (n && !i.contains(n) && r.target instanceof Node && !i.contains(r.target))
|
|
763
736
|
return;
|
|
764
|
-
const
|
|
737
|
+
const a = mt(
|
|
765
738
|
w,
|
|
766
|
-
|
|
739
|
+
R,
|
|
767
740
|
Y
|
|
768
741
|
);
|
|
769
|
-
!
|
|
770
|
-
},
|
|
742
|
+
!a || !He || (r.preventDefault(), He({ selection: w, rect: a, event: r }));
|
|
743
|
+
}, t = (r) => {
|
|
771
744
|
var h;
|
|
772
|
-
if (Be(
|
|
745
|
+
if (Be(r.target)) return;
|
|
773
746
|
const i = g.current;
|
|
774
747
|
if (!i) return;
|
|
775
748
|
const n = document.activeElement;
|
|
776
|
-
if (n && !i.contains(n) &&
|
|
749
|
+
if (n && !i.contains(n) && r.target instanceof Node && !i.contains(r.target))
|
|
777
750
|
return;
|
|
778
|
-
const
|
|
751
|
+
const a = mt(
|
|
779
752
|
w,
|
|
780
|
-
|
|
753
|
+
R,
|
|
781
754
|
Y
|
|
782
755
|
);
|
|
783
|
-
if (!
|
|
784
|
-
const l = ((h =
|
|
785
|
-
|
|
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 });
|
|
786
759
|
};
|
|
787
|
-
return document.addEventListener("copy", e), document.addEventListener("paste",
|
|
788
|
-
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);
|
|
789
762
|
};
|
|
790
763
|
}, [
|
|
791
|
-
|
|
764
|
+
R,
|
|
792
765
|
y,
|
|
793
766
|
w,
|
|
794
767
|
Y,
|
|
795
768
|
He,
|
|
796
769
|
ze
|
|
797
770
|
]);
|
|
798
|
-
const
|
|
799
|
-
if (
|
|
800
|
-
if (
|
|
801
|
-
|
|
771
|
+
const pt = Ce && Hn(F, R), $r = Ce && zn(F, R), jr = () => {
|
|
772
|
+
if (P) {
|
|
773
|
+
if (pt) {
|
|
774
|
+
P(/* @__PURE__ */ new Set());
|
|
802
775
|
return;
|
|
803
776
|
}
|
|
804
|
-
|
|
777
|
+
P("all");
|
|
805
778
|
}
|
|
806
|
-
}, qr = (e,
|
|
807
|
-
if (!
|
|
779
|
+
}, qr = (e, t) => {
|
|
780
|
+
if (!P) return;
|
|
808
781
|
if (ae === "single") {
|
|
809
|
-
|
|
782
|
+
P(t ? /* @__PURE__ */ new Set([e]) : /* @__PURE__ */ new Set());
|
|
810
783
|
return;
|
|
811
784
|
}
|
|
812
|
-
const
|
|
813
|
-
|
|
785
|
+
const r = F === "all" ? new Set(R) : new Set(ar(F, R));
|
|
786
|
+
t ? r.add(e) : r.delete(e), P(r);
|
|
814
787
|
}, Kr = (e) => {
|
|
815
|
-
const
|
|
816
|
-
return
|
|
788
|
+
const t = Te.has(e.key);
|
|
789
|
+
return Dt ? /* @__PURE__ */ c(
|
|
817
790
|
m.Row,
|
|
818
791
|
{
|
|
819
792
|
id: `group-${e.key}`,
|
|
820
793
|
highlightSelectedRow: !1,
|
|
821
794
|
className: "bg-secondary_subtle hover:bg-secondary_subtle",
|
|
822
|
-
children: /* @__PURE__ */
|
|
795
|
+
children: /* @__PURE__ */ c(m.Cell, { colSpan: ye, className: x(W), children: Dt(e) })
|
|
823
796
|
},
|
|
824
797
|
`group-${e.key}`
|
|
825
|
-
) : /* @__PURE__ */
|
|
798
|
+
) : /* @__PURE__ */ c(
|
|
826
799
|
m.Row,
|
|
827
800
|
{
|
|
828
801
|
id: `group-${e.key}`,
|
|
829
802
|
highlightSelectedRow: !1,
|
|
830
803
|
className: "bg-secondary_subtle hover:bg-secondary_subtle",
|
|
831
|
-
children: /* @__PURE__ */
|
|
804
|
+
children: /* @__PURE__ */ c(
|
|
832
805
|
m.Cell,
|
|
833
806
|
{
|
|
834
|
-
colSpan:
|
|
835
|
-
className: x("py-1.5",
|
|
836
|
-
children: /* @__PURE__ */
|
|
807
|
+
colSpan: ye,
|
|
808
|
+
className: x("py-1.5", W),
|
|
809
|
+
children: /* @__PURE__ */ C(
|
|
837
810
|
"button",
|
|
838
811
|
{
|
|
839
812
|
type: "button",
|
|
840
813
|
className: "flex w-full items-center gap-2 px-2 text-left text-xs font-medium text-secondary",
|
|
841
814
|
onClick: () => Sr(e.key),
|
|
842
|
-
"aria-expanded": !
|
|
815
|
+
"aria-expanded": !t,
|
|
843
816
|
children: [
|
|
844
|
-
/* @__PURE__ */
|
|
845
|
-
|
|
817
|
+
/* @__PURE__ */ c(
|
|
818
|
+
Jr,
|
|
846
819
|
{
|
|
847
820
|
className: x(
|
|
848
821
|
"size-4 shrink-0 text-fg-quaternary transition-transform",
|
|
849
|
-
!
|
|
822
|
+
!t && "rotate-90"
|
|
850
823
|
)
|
|
851
824
|
}
|
|
852
825
|
),
|
|
853
|
-
/* @__PURE__ */
|
|
854
|
-
/* @__PURE__ */
|
|
826
|
+
/* @__PURE__ */ c("span", { className: "truncate", children: e.label || "(Empty)" }),
|
|
827
|
+
/* @__PURE__ */ C("span", { className: "text-tertiary", children: [
|
|
855
828
|
"(",
|
|
856
829
|
e.rows.length,
|
|
857
830
|
")"
|
|
@@ -864,51 +837,51 @@ const be = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), Rt = (s)
|
|
|
864
837
|
},
|
|
865
838
|
`group-${e.key}`
|
|
866
839
|
);
|
|
867
|
-
}, jt = (e,
|
|
868
|
-
const i = Et ? Et(e) : !1, n =
|
|
869
|
-
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(
|
|
870
843
|
m.Row,
|
|
871
844
|
{
|
|
872
845
|
onAction: () => {
|
|
873
846
|
var o;
|
|
874
|
-
(o =
|
|
847
|
+
(o = U.current) != null && o.active || ve == null || ve(e);
|
|
875
848
|
},
|
|
876
849
|
onMouseEnter: () => V == null ? void 0 : V(e, !0),
|
|
877
850
|
onMouseLeave: () => V == null ? void 0 : V(e, !1),
|
|
878
851
|
id: n,
|
|
879
852
|
value: e,
|
|
880
853
|
columns: f,
|
|
881
|
-
expandedColSpan:
|
|
854
|
+
expandedColSpan: ye,
|
|
882
855
|
isExpandable: i,
|
|
883
856
|
highlightSelectedRow: Ee,
|
|
884
857
|
renderExpandedContent: i ? wr : void 0,
|
|
885
858
|
[nr]: n,
|
|
886
|
-
[Wn]: String(
|
|
859
|
+
[Wn]: String(a),
|
|
887
860
|
className: x(
|
|
888
|
-
|
|
861
|
+
ve && "cursor-pointer",
|
|
889
862
|
fr ? "prose" : "",
|
|
890
|
-
|
|
891
|
-
|
|
863
|
+
vt && "[&>td]:after:hidden",
|
|
864
|
+
tt && "group/rowactions",
|
|
892
865
|
h && "bg-utility-brand-25 hover:bg-utility-brand-25",
|
|
893
|
-
|
|
894
|
-
|
|
866
|
+
A && l && "bg-secondary",
|
|
867
|
+
Wt,
|
|
895
868
|
je == null ? void 0 : je(e)
|
|
896
869
|
),
|
|
897
|
-
style: k ?
|
|
870
|
+
style: k ? Nn : void 0,
|
|
898
871
|
children: [
|
|
899
|
-
|
|
872
|
+
A && /* @__PURE__ */ c(
|
|
900
873
|
m.Cell,
|
|
901
874
|
{
|
|
902
875
|
"data-grid-no-range": "",
|
|
903
|
-
className: x("relative w-10 text-center",
|
|
876
|
+
className: x("relative w-10 text-center", W),
|
|
904
877
|
style: { minWidth: "40px", width: "40px" },
|
|
905
|
-
children: /* @__PURE__ */
|
|
878
|
+
children: /* @__PURE__ */ c(
|
|
906
879
|
"div",
|
|
907
880
|
{
|
|
908
881
|
className: "flex items-center justify-center",
|
|
909
882
|
onClick: (o) => o.stopPropagation(),
|
|
910
883
|
onKeyDown: (o) => o.stopPropagation(),
|
|
911
|
-
children: /* @__PURE__ */
|
|
884
|
+
children: /* @__PURE__ */ c(
|
|
912
885
|
sr,
|
|
913
886
|
{
|
|
914
887
|
checked: l,
|
|
@@ -922,63 +895,63 @@ const be = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), Rt = (s)
|
|
|
922
895
|
}
|
|
923
896
|
),
|
|
924
897
|
f.map((o, zt) => {
|
|
925
|
-
const
|
|
898
|
+
const ht = Ft.get(o.key), we = cr(
|
|
926
899
|
o.key,
|
|
927
900
|
Q,
|
|
928
|
-
|
|
929
|
-
),
|
|
901
|
+
ht
|
|
902
|
+
), me = (ne == null ? void 0 : ne.rowId) === n && (ne == null ? void 0 : ne.columnKey) === o.key, M = y ? Cn(
|
|
930
903
|
w,
|
|
931
904
|
n,
|
|
932
905
|
o.key,
|
|
933
|
-
|
|
906
|
+
R,
|
|
934
907
|
Y
|
|
935
|
-
) : null, Ye = !y &&
|
|
936
|
-
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(
|
|
937
910
|
m.Cell,
|
|
938
911
|
{
|
|
939
912
|
sticky: o.sticky,
|
|
940
913
|
stickyOffset: o.stickyOffset,
|
|
941
914
|
style: {
|
|
942
915
|
...K,
|
|
943
|
-
...
|
|
916
|
+
...ge ? { boxShadow: ge } : null
|
|
944
917
|
},
|
|
945
918
|
"data-grid-cell": "",
|
|
946
919
|
"data-grid-row-id": n,
|
|
947
920
|
"data-grid-col-key": o.key,
|
|
948
|
-
"data-grid-source-index":
|
|
921
|
+
"data-grid-source-index": a,
|
|
949
922
|
className: x(
|
|
950
923
|
"relative overflow-x-hidden",
|
|
951
924
|
// Uncontrolled single-cell highlight (legacy).
|
|
952
925
|
Ye && "z-1 outline-hidden ring-2 ring-inset ring-brand after:opacity-0",
|
|
953
926
|
// Controlled range: fill all selected cells except the anchor; perimeter via boxShadow.
|
|
954
927
|
se && "z-1 outline-hidden after:opacity-0",
|
|
955
|
-
se &&
|
|
928
|
+
se && M && !M.isAnchor && "bg-utility-brand-25",
|
|
956
929
|
o.cellClassName,
|
|
957
|
-
|
|
958
|
-
|
|
930
|
+
nn(we),
|
|
931
|
+
W
|
|
959
932
|
),
|
|
960
933
|
children: (() => {
|
|
961
|
-
const Vt = zt === 0 && (i ||
|
|
962
|
-
|
|
934
|
+
const Vt = zt === 0 && (i || tt) ? /* @__PURE__ */ C("div", { className: "flex items-center", children: [
|
|
935
|
+
b && /* @__PURE__ */ c(
|
|
963
936
|
"div",
|
|
964
937
|
{
|
|
965
938
|
"data-grid-no-range": "",
|
|
966
939
|
className: "flex items-center justify-center",
|
|
967
|
-
onClick: (
|
|
968
|
-
onContextMenu: (
|
|
969
|
-
onKeyDown: (
|
|
970
|
-
children: /* @__PURE__ */
|
|
971
|
-
|
|
940
|
+
onClick: (X) => X.stopPropagation(),
|
|
941
|
+
onContextMenu: (X) => X.stopPropagation(),
|
|
942
|
+
onKeyDown: (X) => X.stopPropagation(),
|
|
943
|
+
children: /* @__PURE__ */ c(
|
|
944
|
+
An,
|
|
972
945
|
{
|
|
973
|
-
config:
|
|
974
|
-
sourceRowIndex:
|
|
946
|
+
config: b,
|
|
947
|
+
sourceRowIndex: a,
|
|
975
948
|
item: e,
|
|
976
|
-
enableDrag:
|
|
949
|
+
enableDrag: rt,
|
|
977
950
|
isDragging: k,
|
|
978
|
-
onDragHandlePointerDown: (
|
|
979
|
-
|
|
951
|
+
onDragHandlePointerDown: (X) => Yr(
|
|
952
|
+
X,
|
|
980
953
|
n,
|
|
981
|
-
|
|
954
|
+
a,
|
|
982
955
|
e
|
|
983
956
|
),
|
|
984
957
|
triggerClassName: x(
|
|
@@ -987,14 +960,14 @@ const be = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), Rt = (s)
|
|
|
987
960
|
"transition-opacity group-hover/rowactions:opacity-100 focus-visible:opacity-100",
|
|
988
961
|
h || k ? "opacity-100" : "opacity-0"
|
|
989
962
|
),
|
|
990
|
-
onOpenChange: (
|
|
963
|
+
onOpenChange: (X) => Tt(X ? n : null)
|
|
991
964
|
}
|
|
992
965
|
)
|
|
993
966
|
}
|
|
994
967
|
),
|
|
995
|
-
/* @__PURE__ */
|
|
996
|
-
] }) :
|
|
997
|
-
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(
|
|
998
971
|
"div",
|
|
999
972
|
{
|
|
1000
973
|
"data-grid-focus": !0,
|
|
@@ -1008,13 +981,13 @@ const be = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), Rt = (s)
|
|
|
1008
981
|
o.key
|
|
1009
982
|
);
|
|
1010
983
|
}),
|
|
1011
|
-
O &&
|
|
984
|
+
O && Z && /* @__PURE__ */ c(
|
|
1012
985
|
m.Cell,
|
|
1013
986
|
{
|
|
1014
987
|
"data-grid-no-range": "",
|
|
1015
|
-
className: x("relative w-14 text-center",
|
|
988
|
+
className: x("relative w-14 text-center", W),
|
|
1016
989
|
style: { minWidth: "56px", width: "56px" },
|
|
1017
|
-
children: /* @__PURE__ */
|
|
990
|
+
children: /* @__PURE__ */ c(
|
|
1018
991
|
"button",
|
|
1019
992
|
{
|
|
1020
993
|
type: "button",
|
|
@@ -1022,9 +995,9 @@ const be = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), Rt = (s)
|
|
|
1022
995
|
"aria-label": "Delete row",
|
|
1023
996
|
className: "inline-flex items-center justify-center rounded p-1 text-fg-quaternary hover:bg-secondary_subtle hover:text-fg-secondary",
|
|
1024
997
|
onClick: (o) => {
|
|
1025
|
-
o.stopPropagation(),
|
|
998
|
+
o.stopPropagation(), Z.onDeleteRow(a);
|
|
1026
999
|
},
|
|
1027
|
-
children: /* @__PURE__ */
|
|
1000
|
+
children: /* @__PURE__ */ c(Yn, { name: "Trash02", className: "size-3" })
|
|
1028
1001
|
}
|
|
1029
1002
|
)
|
|
1030
1003
|
}
|
|
@@ -1033,39 +1006,39 @@ const be = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), Rt = (s)
|
|
|
1033
1006
|
},
|
|
1034
1007
|
n
|
|
1035
1008
|
);
|
|
1036
|
-
}, Hr = (e) => /* @__PURE__ */
|
|
1009
|
+
}, Hr = (e) => /* @__PURE__ */ C(
|
|
1037
1010
|
m.Row,
|
|
1038
1011
|
{
|
|
1039
1012
|
id: String(e.id),
|
|
1040
1013
|
isExpandable: !1,
|
|
1041
|
-
className: x(
|
|
1014
|
+
className: x(vt && "[&>td]:after:hidden", Wt),
|
|
1042
1015
|
children: [
|
|
1043
|
-
|
|
1016
|
+
A && /* @__PURE__ */ c(
|
|
1044
1017
|
m.Cell,
|
|
1045
1018
|
{
|
|
1046
|
-
className: x("relative w-10",
|
|
1019
|
+
className: x("relative w-10", W),
|
|
1047
1020
|
style: { minWidth: "40px", width: "40px" }
|
|
1048
1021
|
}
|
|
1049
1022
|
),
|
|
1050
|
-
f.map((
|
|
1023
|
+
f.map((t) => /* @__PURE__ */ c(
|
|
1051
1024
|
m.Cell,
|
|
1052
1025
|
{
|
|
1053
|
-
sticky:
|
|
1054
|
-
stickyOffset:
|
|
1055
|
-
style:
|
|
1026
|
+
sticky: t.sticky,
|
|
1027
|
+
stickyOffset: t.stickyOffset,
|
|
1028
|
+
style: ut(t),
|
|
1056
1029
|
className: x(
|
|
1057
1030
|
"overflow-x-hidden text-left",
|
|
1058
|
-
|
|
1059
|
-
|
|
1031
|
+
t.cellClassName,
|
|
1032
|
+
W
|
|
1060
1033
|
),
|
|
1061
|
-
children: /* @__PURE__ */
|
|
1034
|
+
children: /* @__PURE__ */ c(Bn, { height: "14px", width: "75%", className: "rounded" })
|
|
1062
1035
|
},
|
|
1063
|
-
|
|
1036
|
+
t.key
|
|
1064
1037
|
)),
|
|
1065
|
-
O && /* @__PURE__ */
|
|
1038
|
+
O && /* @__PURE__ */ c(
|
|
1066
1039
|
m.Cell,
|
|
1067
1040
|
{
|
|
1068
|
-
className: x("w-14",
|
|
1041
|
+
className: x("w-14", W),
|
|
1069
1042
|
style: { minWidth: "56px", width: "56px" }
|
|
1070
1043
|
}
|
|
1071
1044
|
)
|
|
@@ -1073,45 +1046,46 @@ const be = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), Rt = (s)
|
|
|
1073
1046
|
},
|
|
1074
1047
|
String(e.id)
|
|
1075
1048
|
), zr = () => j ? Fe.map((e) => Hr(e)) : Oe && J ? J.flatMap((e) => {
|
|
1076
|
-
const
|
|
1049
|
+
const t = Te.has(e.key);
|
|
1077
1050
|
return [
|
|
1078
1051
|
Kr(e),
|
|
1079
|
-
...
|
|
1080
|
-
(
|
|
1052
|
+
...t ? [] : e.rows.map(
|
|
1053
|
+
(r, i) => jt(r, void 0, i)
|
|
1081
1054
|
)
|
|
1082
1055
|
];
|
|
1083
1056
|
}) : Fe.map(
|
|
1084
|
-
(e,
|
|
1085
|
-
), qt = /* @__PURE__ */
|
|
1086
|
-
|
|
1057
|
+
(e, t) => jt(e, void 0, t)
|
|
1058
|
+
), qt = /* @__PURE__ */ c(
|
|
1059
|
+
Qr.Root,
|
|
1087
1060
|
{
|
|
1088
|
-
ref:
|
|
1089
|
-
onKeyDownCapture:
|
|
1090
|
-
onPointerDownCapture: y ?
|
|
1061
|
+
ref: Zr,
|
|
1062
|
+
onKeyDownCapture: N ? Gr : void 0,
|
|
1063
|
+
onPointerDownCapture: y ? Xr : void 0,
|
|
1091
1064
|
onDoubleClickCapture: y ? Br : void 0,
|
|
1092
1065
|
className: x(
|
|
1093
1066
|
"w-full",
|
|
1094
|
-
!
|
|
1067
|
+
!_ || Xt ? "overflow-x-auto" : "overflow-x-hidden",
|
|
1095
1068
|
Ie && "border border-secondary rounded-xl",
|
|
1096
1069
|
"[&_tr:hover>td]:!bg-secondary_subtle",
|
|
1097
1070
|
hr
|
|
1098
1071
|
),
|
|
1099
|
-
size:
|
|
1100
|
-
children: /* @__PURE__ */
|
|
1072
|
+
size: Rt,
|
|
1073
|
+
children: /* @__PURE__ */ C(
|
|
1101
1074
|
m,
|
|
1102
1075
|
{
|
|
1076
|
+
"data-table-zoom-typography": Se !== void 0 ? "" : void 0,
|
|
1103
1077
|
"aria-label": ur,
|
|
1104
|
-
size:
|
|
1105
|
-
isEditable:
|
|
1078
|
+
size: Rt,
|
|
1079
|
+
isEditable: N,
|
|
1106
1080
|
inlineSelection: Ee,
|
|
1107
1081
|
className: x(
|
|
1108
|
-
|
|
1082
|
+
_ && "min-w-full",
|
|
1109
1083
|
mr
|
|
1110
1084
|
),
|
|
1111
|
-
style:
|
|
1112
|
-
...
|
|
1085
|
+
style: Mr,
|
|
1086
|
+
...Ur,
|
|
1113
1087
|
children: [
|
|
1114
|
-
/* @__PURE__ */
|
|
1088
|
+
/* @__PURE__ */ C(
|
|
1115
1089
|
m.Header,
|
|
1116
1090
|
{
|
|
1117
1091
|
className: x(
|
|
@@ -1120,19 +1094,19 @@ const be = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), Rt = (s)
|
|
|
1120
1094
|
yr
|
|
1121
1095
|
),
|
|
1122
1096
|
children: [
|
|
1123
|
-
|
|
1097
|
+
A && /* @__PURE__ */ c(
|
|
1124
1098
|
m.Head,
|
|
1125
1099
|
{
|
|
1126
1100
|
label: "",
|
|
1127
1101
|
allowsSorting: !1,
|
|
1128
1102
|
isRowHeader: !1,
|
|
1129
1103
|
style: { minWidth: "40px", width: "40px" },
|
|
1130
|
-
className: x(
|
|
1104
|
+
className: x(W),
|
|
1131
1105
|
headerCellClass: "justify-center",
|
|
1132
|
-
children: ae === "multiple" &&
|
|
1106
|
+
children: ae === "multiple" && P && /* @__PURE__ */ c("div", { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ c(
|
|
1133
1107
|
sr,
|
|
1134
1108
|
{
|
|
1135
|
-
checked:
|
|
1109
|
+
checked: pt ? !0 : $r && !pt ? "indeterminate" : !1,
|
|
1136
1110
|
onCheckedChange: () => jr(),
|
|
1137
1111
|
"aria-label": "Select all rows",
|
|
1138
1112
|
className: "items-center justify-center"
|
|
@@ -1141,33 +1115,33 @@ const be = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), Rt = (s)
|
|
|
1141
1115
|
},
|
|
1142
1116
|
"selection"
|
|
1143
1117
|
),
|
|
1144
|
-
f.map((e,
|
|
1145
|
-
const
|
|
1118
|
+
f.map((e, t) => {
|
|
1119
|
+
const r = Er ? Pr.get(e.key) : void 0, i = Ft.get(e.key), n = cr(
|
|
1146
1120
|
e.key,
|
|
1147
1121
|
Q,
|
|
1148
1122
|
i
|
|
1149
|
-
),
|
|
1150
|
-
return /* @__PURE__ */
|
|
1123
|
+
), a = pr.includes(e.key) || n === "center" ? "justify-center" : n === "right" ? "justify-end" : "";
|
|
1124
|
+
return /* @__PURE__ */ c(
|
|
1151
1125
|
m.Head,
|
|
1152
1126
|
{
|
|
1153
1127
|
sticky: e.sticky,
|
|
1154
1128
|
stickyOffset: e.stickyOffset,
|
|
1155
1129
|
id: e.key,
|
|
1156
1130
|
label: e.label,
|
|
1157
|
-
isRowHeader:
|
|
1131
|
+
isRowHeader: t === 0,
|
|
1158
1132
|
allowsSorting: e.allowsSorting,
|
|
1159
|
-
headerCellClass: `${e.headerCellClass} ${
|
|
1160
|
-
style:
|
|
1133
|
+
headerCellClass: `${e.headerCellClass} ${a}`,
|
|
1134
|
+
style: ut(e),
|
|
1161
1135
|
className: x(
|
|
1162
1136
|
"overflow-hidden",
|
|
1163
1137
|
e.headClassName,
|
|
1164
|
-
|
|
1138
|
+
W
|
|
1165
1139
|
),
|
|
1166
|
-
headerAction:
|
|
1167
|
-
|
|
1140
|
+
headerAction: r && _e ? /* @__PURE__ */ c(
|
|
1141
|
+
Mn,
|
|
1168
1142
|
{
|
|
1169
|
-
column:
|
|
1170
|
-
columnLabel:
|
|
1143
|
+
column: r,
|
|
1144
|
+
columnLabel: r.label ?? (i ? rn(i, Ir) : e.label),
|
|
1171
1145
|
currentAlignment: i ? dr(
|
|
1172
1146
|
i,
|
|
1173
1147
|
Q ?? /* @__PURE__ */ new Map()
|
|
@@ -1175,77 +1149,77 @@ const be = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), Rt = (s)
|
|
|
1175
1149
|
capabilities: kr,
|
|
1176
1150
|
hideDisabled: f.length <= 1,
|
|
1177
1151
|
onAction: Fr.get(e.key),
|
|
1178
|
-
renderExtraItems:
|
|
1152
|
+
renderExtraItems: Lr,
|
|
1179
1153
|
showOnHeaderHover: !0
|
|
1180
1154
|
}
|
|
1181
1155
|
) : void 0,
|
|
1182
|
-
children: (
|
|
1156
|
+
children: ($e == null ? void 0 : $e(e.key)) ?? null
|
|
1183
1157
|
},
|
|
1184
1158
|
e.key
|
|
1185
1159
|
);
|
|
1186
1160
|
}),
|
|
1187
|
-
O && /* @__PURE__ */
|
|
1161
|
+
O && /* @__PURE__ */ c(
|
|
1188
1162
|
m.Head,
|
|
1189
1163
|
{
|
|
1190
1164
|
label: "",
|
|
1191
1165
|
allowsSorting: !1,
|
|
1192
1166
|
isRowHeader: !1,
|
|
1193
1167
|
style: { minWidth: "56px", width: "56px" },
|
|
1194
|
-
className: x(
|
|
1168
|
+
className: x(W)
|
|
1195
1169
|
},
|
|
1196
1170
|
"actions"
|
|
1197
1171
|
)
|
|
1198
1172
|
]
|
|
1199
1173
|
}
|
|
1200
1174
|
),
|
|
1201
|
-
/* @__PURE__ */
|
|
1202
|
-
!
|
|
1203
|
-
Cr && /* @__PURE__ */
|
|
1175
|
+
/* @__PURE__ */ C(m.Body, { children: [
|
|
1176
|
+
!At && zr(),
|
|
1177
|
+
Cr && /* @__PURE__ */ c(
|
|
1204
1178
|
m.Row,
|
|
1205
1179
|
{
|
|
1206
1180
|
id: "empty-state",
|
|
1207
1181
|
highlightSelectedRow: !1,
|
|
1208
|
-
children: /* @__PURE__ */
|
|
1182
|
+
children: /* @__PURE__ */ c(
|
|
1209
1183
|
m.Cell,
|
|
1210
1184
|
{
|
|
1211
|
-
colSpan:
|
|
1185
|
+
colSpan: ye,
|
|
1212
1186
|
className: x(
|
|
1213
1187
|
"text-left text-placeholder_subtle border-b border-secondary py-3",
|
|
1214
|
-
|
|
1188
|
+
W
|
|
1215
1189
|
),
|
|
1216
|
-
children:
|
|
1190
|
+
children: bt
|
|
1217
1191
|
}
|
|
1218
1192
|
)
|
|
1219
1193
|
},
|
|
1220
1194
|
"empty-state"
|
|
1221
1195
|
),
|
|
1222
|
-
|
|
1196
|
+
st && Z && /* @__PURE__ */ C(
|
|
1223
1197
|
m.Row,
|
|
1224
1198
|
{
|
|
1225
1199
|
id: "add-row-footer",
|
|
1226
1200
|
highlightSelectedRow: !1,
|
|
1227
1201
|
children: [
|
|
1228
|
-
/* @__PURE__ */
|
|
1202
|
+
/* @__PURE__ */ c(
|
|
1229
1203
|
m.Cell,
|
|
1230
1204
|
{
|
|
1231
|
-
colSpan:
|
|
1232
|
-
className: x(
|
|
1233
|
-
children: /* @__PURE__ */
|
|
1234
|
-
|
|
1205
|
+
colSpan: ye - (O ? 1 : 0),
|
|
1206
|
+
className: x(W),
|
|
1207
|
+
children: /* @__PURE__ */ c(
|
|
1208
|
+
Zn,
|
|
1235
1209
|
{
|
|
1236
1210
|
color: "tertiary",
|
|
1237
1211
|
className: "bg-secondary text-primary",
|
|
1238
1212
|
size: "xs",
|
|
1239
|
-
onClick:
|
|
1213
|
+
onClick: Z.onAddRow,
|
|
1240
1214
|
children: "+ Add Row"
|
|
1241
1215
|
}
|
|
1242
1216
|
)
|
|
1243
1217
|
}
|
|
1244
1218
|
),
|
|
1245
|
-
O && /* @__PURE__ */
|
|
1219
|
+
O && /* @__PURE__ */ c(
|
|
1246
1220
|
m.Cell,
|
|
1247
1221
|
{
|
|
1248
|
-
className: x("w-14",
|
|
1222
|
+
className: x("w-14", W),
|
|
1249
1223
|
style: { minWidth: "56px", width: "56px" }
|
|
1250
1224
|
}
|
|
1251
1225
|
)
|
|
@@ -1253,12 +1227,12 @@ const be = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), Rt = (s)
|
|
|
1253
1227
|
},
|
|
1254
1228
|
"add-row-footer"
|
|
1255
1229
|
),
|
|
1256
|
-
Or && Ke && /* @__PURE__ */
|
|
1257
|
-
|
|
1230
|
+
Or && Ke && /* @__PURE__ */ c(
|
|
1231
|
+
Un,
|
|
1258
1232
|
{
|
|
1259
1233
|
...Ke,
|
|
1260
1234
|
hasActionsColumn: O,
|
|
1261
|
-
hasSelectionColumn:
|
|
1235
|
+
hasSelectionColumn: A,
|
|
1262
1236
|
showBorders: !!Ie
|
|
1263
1237
|
}
|
|
1264
1238
|
)
|
|
@@ -1267,20 +1241,20 @@ const be = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), Rt = (s)
|
|
|
1267
1241
|
}
|
|
1268
1242
|
)
|
|
1269
1243
|
}
|
|
1270
|
-
), Kt =
|
|
1244
|
+
), Kt = N ? /* @__PURE__ */ c(
|
|
1271
1245
|
mn,
|
|
1272
1246
|
{
|
|
1273
|
-
rowIds:
|
|
1247
|
+
rowIds: R,
|
|
1274
1248
|
columnKeys: Y,
|
|
1275
1249
|
containerRef: g,
|
|
1276
|
-
onSelectCell:
|
|
1250
|
+
onSelectCell: ot,
|
|
1277
1251
|
onEditingCellChange: _r,
|
|
1278
1252
|
children: qt
|
|
1279
1253
|
}
|
|
1280
|
-
) : qt, Ht = p != null && p.active ? /* @__PURE__ */
|
|
1281
|
-
/* @__PURE__ */
|
|
1282
|
-
p.dropLineY != null && /* @__PURE__ */
|
|
1283
|
-
|
|
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,
|
|
1284
1258
|
{
|
|
1285
1259
|
y: p.dropLineY,
|
|
1286
1260
|
left: p.dropLineLeft,
|
|
@@ -1288,23 +1262,23 @@ const be = (s) => !!s.width || !!(s.maxWidth && s.sticky === "right"), Rt = (s)
|
|
|
1288
1262
|
}
|
|
1289
1263
|
)
|
|
1290
1264
|
] }) : null;
|
|
1291
|
-
return Tr ? /* @__PURE__ */
|
|
1292
|
-
|
|
1265
|
+
return Tr ? /* @__PURE__ */ C("div", { className: "flex flex-col gap-3", children: [
|
|
1266
|
+
Zt && Mt,
|
|
1293
1267
|
Kt,
|
|
1294
|
-
|
|
1295
|
-
|
|
1268
|
+
Ut && S && /* @__PURE__ */ c(
|
|
1269
|
+
en,
|
|
1296
1270
|
{
|
|
1297
|
-
currentPage:
|
|
1298
|
-
pageSize:
|
|
1299
|
-
totalPages:
|
|
1300
|
-
totalItems:
|
|
1301
|
-
onPageChange:
|
|
1302
|
-
onPageSizeChange:
|
|
1303
|
-
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
|
|
1304
1278
|
}
|
|
1305
1279
|
),
|
|
1306
1280
|
Ht
|
|
1307
|
-
] }) : /* @__PURE__ */
|
|
1281
|
+
] }) : /* @__PURE__ */ C(Jt, { children: [
|
|
1308
1282
|
Kt,
|
|
1309
1283
|
Ht
|
|
1310
1284
|
] });
|