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