@pibit.ai/cure-design-system 0.3.23 → 0.3.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +157 -140
- package/dist/patterns/table/TableWrapper.d.ts.map +1 -1
- package/dist/patterns/table/TableWrapper.js +376 -369
- package/dist/patterns/table/index.d.ts +4 -1
- package/dist/patterns/table/index.d.ts.map +1 -1
- package/dist/patterns/table/integrateTableUndoRedo.d.ts +41 -0
- package/dist/patterns/table/integrateTableUndoRedo.d.ts.map +1 -0
- package/dist/patterns/table/integrateTableUndoRedo.js +63 -0
- package/dist/patterns/table/storyHelpers/useMockTableState.d.ts +3 -1
- package/dist/patterns/table/storyHelpers/useMockTableState.d.ts.map +1 -1
- package/dist/patterns/table/table.d.ts +2 -1
- package/dist/patterns/table/table.d.ts.map +1 -1
- package/dist/patterns/table/table.js +181 -155
- package/dist/patterns/table/tableUndoRedo.d.ts +38 -0
- package/dist/patterns/table/tableUndoRedo.d.ts.map +1 -0
- package/dist/patterns/table/tableUndoRedo.js +147 -0
- package/dist/patterns/table/toolbar/ColumnHeaderMenu.d.ts +4 -0
- package/dist/patterns/table/toolbar/ColumnHeaderMenu.d.ts.map +1 -1
- package/dist/patterns/table/toolbar/ColumnHeaderMenu.js +81 -77
- package/dist/patterns/table/toolbar/TableToolbar.d.ts +11 -2
- package/dist/patterns/table/toolbar/TableToolbar.d.ts.map +1 -1
- package/dist/patterns/table/toolbar/TableToolbar.js +163 -114
- package/dist/patterns/table/toolbar/index.d.ts +1 -1
- package/dist/patterns/table/toolbar/index.d.ts.map +1 -1
- package/dist/patterns/table/toolbar/useUndoRedoShortcuts.d.ts +9 -0
- package/dist/patterns/table/toolbar/useUndoRedoShortcuts.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/useUndoRedoShortcuts.js +21 -0
- package/dist/patterns/table/types.d.ts +5 -1
- package/dist/patterns/table/types.d.ts.map +1 -1
- package/dist/patterns/table/useTableUndoRedo.d.ts +41 -0
- package/dist/patterns/table/useTableUndoRedo.d.ts.map +1 -0
- package/dist/patterns/table/useTableUndoRedo.js +168 -0
- package/dist/primitives/badge/badge.js +5 -5
- 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 +63 -62
- package/dist/primitives/select/ExpandableSearchInput.d.ts +1 -1
- package/dist/primitives/select/ExpandableSearchInput.d.ts.map +1 -1
- package/dist/primitives/select/SearchInput.d.ts +2 -2
- package/dist/primitives/select/SearchInput.d.ts.map +1 -1
- package/dist/primitives/select/SearchInput.js +38 -37
- package/dist/primitives/select/combobox.d.ts.map +1 -1
- package/dist/primitives/select/combobox.js +48 -47
- package/dist/primitives/select/multi-select.d.ts.map +1 -1
- package/dist/primitives/select/multi-select.js +50 -49
- package/dist/styles/components.css +1 -1
- package/dist/utils/keyboard-shortcut.d.ts +4 -0
- package/dist/utils/keyboard-shortcut.d.ts.map +1 -0
- package/dist/utils/keyboard-shortcut.js +29 -0
- package/package.json +1 -1
|
@@ -1,235 +1,243 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { ChevronRight as
|
|
1
|
+
import { jsx as s, jsxs as S } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Jt, useState as B, useMemo as u, useCallback as J, useRef as Vt, useEffect as Xt, useLayoutEffect as Yt } from "react";
|
|
3
|
+
import { ChevronRight as Ht } from "@untitledui/icons";
|
|
4
4
|
import { cx as c } from "../../utils/cn.js";
|
|
5
5
|
import { TableCard as Qt, Table as d } from "./table.js";
|
|
6
6
|
import { TablePagination as Zt } from "./TablePagination.js";
|
|
7
|
-
import { getEffectiveAlignment as
|
|
8
|
-
import { findGridCell as
|
|
9
|
-
import { BulkActionBar as
|
|
10
|
-
import { TableToolbar as
|
|
11
|
-
import { Checkbox as
|
|
12
|
-
import { ColumnHeaderMenu as
|
|
13
|
-
import { Button as
|
|
14
|
-
import { SummaryFooterRow as
|
|
15
|
-
import { RowActionsMenu as
|
|
16
|
-
import { Icon as
|
|
17
|
-
import { ShimmerLine as
|
|
18
|
-
const
|
|
7
|
+
import { getEffectiveAlignment as dt, resolveColumnLabel as Kt, alignmentClass as er } from "./toolbar/tableToolbarHelpers.js";
|
|
8
|
+
import { findGridCell as tr, isWithinCellEditor as rr, getGridNeighbor as nr, getGridTabNeighbor as ir, focusGridCell as sr, GridNavProvider as ar } from "./useGridKeyboardNavigation.js";
|
|
9
|
+
import { BulkActionBar as lr } from "./toolbar/BulkActionBar.js";
|
|
10
|
+
import { TableToolbar as or } from "./toolbar/TableToolbar.js";
|
|
11
|
+
import { Checkbox as it } from "../../primitives/checkbox/checkbox.js";
|
|
12
|
+
import { ColumnHeaderMenu as dr } from "./toolbar/ColumnHeaderMenu.js";
|
|
13
|
+
import { Button as cr } from "../../primitives/button/button.js";
|
|
14
|
+
import { SummaryFooterRow as fr } from "./toolbar/SummaryFooter.js";
|
|
15
|
+
import { RowActionsMenu as hr } from "./toolbar/RowActionsMenu.js";
|
|
16
|
+
import { Icon as ur } from "../../primitives/icon/icon.js";
|
|
17
|
+
import { ShimmerLine as yr } from "../../primitives/shimmer/shimmer.js";
|
|
18
|
+
const wr = 5, pr = "__all__", st = {
|
|
19
19
|
ArrowUp: "up",
|
|
20
20
|
ArrowDown: "down",
|
|
21
21
|
ArrowLeft: "left",
|
|
22
22
|
ArrowRight: "right"
|
|
23
|
-
},
|
|
24
|
-
function
|
|
25
|
-
return t === "all" ? new Set(
|
|
23
|
+
}, V = (t) => t.__rowId ?? t.id ?? t.rule_id ?? String(t);
|
|
24
|
+
function at(t, i) {
|
|
25
|
+
return t === "all" ? new Set(i) : t ?? /* @__PURE__ */ new Set();
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
return t ? t === "all" ? l.includes(
|
|
27
|
+
function xr(t, i, l) {
|
|
28
|
+
return t ? t === "all" ? l.includes(i) : t.has(i) : !1;
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
return t ? t === "all" ?
|
|
30
|
+
function gr(t, i) {
|
|
31
|
+
return t ? t === "all" ? i.length : t.size : 0;
|
|
32
32
|
}
|
|
33
|
-
function br(t,
|
|
34
|
-
return
|
|
33
|
+
function br(t, i) {
|
|
34
|
+
return i.length === 0 ? !1 : t === "all" ? !0 : i.every((l) => (t == null ? void 0 : t.has(l)) ?? !1);
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
return t === "all" ?
|
|
36
|
+
function mr(t, i) {
|
|
37
|
+
return t === "all" ? i.length > 0 : i.some((l) => (t == null ? void 0 : t.has(l)) ?? !1);
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function Nr(t) {
|
|
40
40
|
if (t)
|
|
41
|
-
return (
|
|
42
|
-
t(
|
|
41
|
+
return (i) => {
|
|
42
|
+
t(i === "all" ? "all" : new Set([...i].map(String)));
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
var
|
|
47
|
-
return t != null && t.length ? t.length > 1 ? !0 : ((
|
|
45
|
+
function kr(t) {
|
|
46
|
+
var i;
|
|
47
|
+
return t != null && t.length ? t.length > 1 ? !0 : ((i = t[0]) == null ? void 0 : i.key) !== pr : !1;
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
return l ?
|
|
49
|
+
function lt(t, i, l) {
|
|
50
|
+
return l ? dt(l, i ?? /* @__PURE__ */ new Map()) : (i == null ? void 0 : i.get(t)) ?? "left";
|
|
51
51
|
}
|
|
52
|
-
const
|
|
52
|
+
const Le = "300px", Te = (t) => {
|
|
53
53
|
if (!t) return 0;
|
|
54
|
-
const
|
|
55
|
-
return
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
54
|
+
const i = t.match(/^(\d+(?:\.\d+)?)px$/);
|
|
55
|
+
return i ? Number(i[1]) : 0;
|
|
56
|
+
}, X = (t) => !!t.width || !!(t.maxWidth && t.sticky === "right"), Oe = (t) => t.width ?? (t.maxWidth && t.sticky === "right" ? t.maxWidth : void 0), Cr = (t) => ({
|
|
57
|
+
width: t.width,
|
|
58
|
+
maxWidth: t.maxWidth ?? Le,
|
|
59
|
+
minWidth: t.minWidth ?? t.width
|
|
60
|
+
}), ot = (t) => {
|
|
61
|
+
const i = Oe(t);
|
|
62
|
+
return i ? {
|
|
63
|
+
minWidth: i,
|
|
64
|
+
width: i,
|
|
65
|
+
maxWidth: t.maxWidth ?? i
|
|
66
|
+
} : {
|
|
67
|
+
minWidth: t.minWidth,
|
|
68
|
+
maxWidth: t.maxWidth ?? Le
|
|
69
|
+
};
|
|
70
|
+
}, Dr = Jt(
|
|
67
71
|
function({
|
|
68
|
-
data:
|
|
72
|
+
data: i,
|
|
69
73
|
columns: l,
|
|
70
|
-
renderRowCell:
|
|
74
|
+
renderRowCell: ze,
|
|
71
75
|
onRowClick: Y,
|
|
72
|
-
onRowHover:
|
|
73
|
-
arialabel:
|
|
74
|
-
size:
|
|
75
|
-
allowDefaultRowClass:
|
|
76
|
-
centeredHeaders:
|
|
77
|
-
rootClassName:
|
|
78
|
-
removeBorders:
|
|
79
|
-
headerClassName:
|
|
80
|
-
isRowExpandable:
|
|
81
|
-
renderExpandedContent:
|
|
76
|
+
onRowHover: O,
|
|
77
|
+
arialabel: ct,
|
|
78
|
+
size: Ae = "sm",
|
|
79
|
+
allowDefaultRowClass: ft = !1,
|
|
80
|
+
centeredHeaders: ht = [],
|
|
81
|
+
rootClassName: ut,
|
|
82
|
+
removeBorders: Ge,
|
|
83
|
+
headerClassName: yt,
|
|
84
|
+
isRowExpandable: $e,
|
|
85
|
+
renderExpandedContent: wt,
|
|
82
86
|
loading: P = !1,
|
|
83
|
-
loadingRowCount:
|
|
87
|
+
loadingRowCount: je = wr,
|
|
84
88
|
renderHeaderCell: ce,
|
|
85
89
|
tableClassName: pt,
|
|
86
90
|
getRowClassName: fe,
|
|
87
|
-
selectionMode:
|
|
88
|
-
selectedKeys:
|
|
91
|
+
selectionMode: G = "none",
|
|
92
|
+
selectedKeys: k,
|
|
89
93
|
onSelectionChange: p,
|
|
90
94
|
inlineSelection: he = !1,
|
|
91
|
-
toolbar:
|
|
92
|
-
showToolbar:
|
|
93
|
-
toolbarTitle:
|
|
94
|
-
toolbarTrailing:
|
|
95
|
-
disableExtendedTools:
|
|
95
|
+
toolbar: h,
|
|
96
|
+
showToolbar: xt,
|
|
97
|
+
toolbarTitle: Fe,
|
|
98
|
+
toolbarTrailing: Me,
|
|
99
|
+
disableExtendedTools: ue,
|
|
96
100
|
pagination: x,
|
|
97
|
-
showBorders:
|
|
98
|
-
emptyState:
|
|
101
|
+
showBorders: H,
|
|
102
|
+
emptyState: De,
|
|
99
103
|
editChrome: v,
|
|
100
|
-
showEditActions:
|
|
104
|
+
showEditActions: gt = !1,
|
|
101
105
|
searchCollapsible: Ue,
|
|
102
106
|
isEditable: bt,
|
|
103
|
-
toolbarSlot:
|
|
104
|
-
rowHeightClass:
|
|
105
|
-
groupedData:
|
|
106
|
-
showSummaryFooter:
|
|
107
|
-
summaryFooterProps:
|
|
108
|
-
bulkActionBar:
|
|
109
|
-
renderBulkActionBar:
|
|
107
|
+
toolbarSlot: ye,
|
|
108
|
+
rowHeightClass: qe,
|
|
109
|
+
groupedData: L,
|
|
110
|
+
showSummaryFooter: mt,
|
|
111
|
+
summaryFooterProps: we,
|
|
112
|
+
bulkActionBar: Q,
|
|
113
|
+
renderBulkActionBar: Z,
|
|
110
114
|
onBulkDuplicate: K,
|
|
111
115
|
onBulkDelete: ee,
|
|
112
116
|
bulkActionBusy: te,
|
|
113
117
|
columnAlignments: z,
|
|
114
118
|
onColumnHeaderAction: re,
|
|
115
|
-
showColumnHeaderMenu:
|
|
116
|
-
columnMenuCapabilities:
|
|
117
|
-
renderGroupHeader:
|
|
118
|
-
columnMenuSchema:
|
|
119
|
-
columnSchema:
|
|
120
|
-
labelMeta:
|
|
121
|
-
renderColumnHeaderMenuExtraItems:
|
|
122
|
-
fillWidth:
|
|
119
|
+
showColumnHeaderMenu: Nt,
|
|
120
|
+
columnMenuCapabilities: kt,
|
|
121
|
+
renderGroupHeader: Be,
|
|
122
|
+
columnMenuSchema: $,
|
|
123
|
+
columnSchema: j,
|
|
124
|
+
labelMeta: Ct,
|
|
125
|
+
renderColumnHeaderMenuExtraItems: St,
|
|
126
|
+
fillWidth: w = !1,
|
|
123
127
|
rowActions: pe,
|
|
124
|
-
onCellActivate:
|
|
125
|
-
},
|
|
126
|
-
const [ne,
|
|
128
|
+
onCellActivate: xe
|
|
129
|
+
}, F) {
|
|
130
|
+
const [ne, vt] = B(
|
|
127
131
|
() => /* @__PURE__ */ new Set()
|
|
128
|
-
), [
|
|
132
|
+
), [Wt, Rt] = B(
|
|
129
133
|
null
|
|
130
|
-
), [
|
|
134
|
+
), [b, ge] = B(null), [A, It] = B(null), ie = G === "single" || G === "multiple", be = !!pe, W = ie && !he, me = kr(L), _t = u(() => $ != null && $.length ? new Map($.map((e) => [e.key, e])) : /* @__PURE__ */ new Map(), [$]), Je = u(() => j != null && j.length ? new Map(j.map((e) => [e.value, e])) : /* @__PURE__ */ new Map(), [j]), se = u(
|
|
131
135
|
() => l.map((e) => e.key),
|
|
132
136
|
[l]
|
|
133
|
-
), Et =
|
|
134
|
-
|
|
137
|
+
), Et = J((e) => {
|
|
138
|
+
vt((r) => {
|
|
135
139
|
const n = new Set(r);
|
|
136
140
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
137
141
|
});
|
|
138
|
-
}, []), ae =
|
|
142
|
+
}, []), ae = u(() => P ? Array.from({ length: je }, (e, r) => ({
|
|
139
143
|
id: `loading-${r}`
|
|
140
|
-
})) :
|
|
144
|
+
})) : i.map((e) => {
|
|
141
145
|
const r = e;
|
|
142
146
|
if (r.__rowId != null)
|
|
143
147
|
return r;
|
|
144
|
-
const n =
|
|
148
|
+
const n = V(r);
|
|
145
149
|
return r.id != null && String(r.id) === n ? r : { ...r, id: n };
|
|
146
|
-
}), [P,
|
|
147
|
-
(e) => ne.has(e.key) ? [] : e.rows.map((r) =>
|
|
148
|
-
) : ae.map((e) =>
|
|
149
|
-
() =>
|
|
150
|
-
[
|
|
151
|
-
),
|
|
152
|
-
if (!
|
|
153
|
-
const e =
|
|
154
|
-
(r) =>
|
|
150
|
+
}), [P, i, je]), g = u(() => P ? [] : me && L ? L.flatMap(
|
|
151
|
+
(e) => ne.has(e.key) ? [] : e.rows.map((r) => V(r))
|
|
152
|
+
) : ae.map((e) => V(e)), [P, me, L, ne, ae]), Ne = u(
|
|
153
|
+
() => at(k, g),
|
|
154
|
+
[k, g]
|
|
155
|
+
), ke = gr(k, g), Ce = ke > 0, Ve = Ce && !!(Q ?? Z ?? K ?? ee), M = u(() => {
|
|
156
|
+
if (!Ce) return;
|
|
157
|
+
const e = i.filter(
|
|
158
|
+
(r) => Ne.has(V(r))
|
|
155
159
|
);
|
|
156
160
|
return {
|
|
157
|
-
selectedKeys:
|
|
161
|
+
selectedKeys: Ne,
|
|
158
162
|
selectedRows: e,
|
|
159
163
|
clearSelection: () => p == null ? void 0 : p(/* @__PURE__ */ new Set()),
|
|
160
164
|
busy: te
|
|
161
165
|
};
|
|
162
166
|
}, [
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
167
|
+
Ce,
|
|
168
|
+
Ne,
|
|
169
|
+
i,
|
|
166
170
|
p,
|
|
167
171
|
te
|
|
168
|
-
]),
|
|
169
|
-
if (
|
|
170
|
-
if (
|
|
171
|
-
if (
|
|
172
|
-
if (
|
|
173
|
-
return
|
|
174
|
-
if (
|
|
175
|
-
return /* @__PURE__ */
|
|
176
|
-
|
|
172
|
+
]), Xe = u(() => {
|
|
173
|
+
if (ye != null) return ye;
|
|
174
|
+
if (Ve) {
|
|
175
|
+
if (Q != null) return Q;
|
|
176
|
+
if (Z && M)
|
|
177
|
+
return Z(M);
|
|
178
|
+
if (M && (K || ee))
|
|
179
|
+
return /* @__PURE__ */ s(
|
|
180
|
+
lr,
|
|
177
181
|
{
|
|
178
|
-
count:
|
|
182
|
+
count: ke,
|
|
179
183
|
onDuplicate: K,
|
|
180
184
|
onDelete: ee,
|
|
181
|
-
onClearSelection:
|
|
185
|
+
onClearSelection: M.clearSelection,
|
|
182
186
|
busy: te
|
|
183
187
|
}
|
|
184
188
|
);
|
|
185
189
|
}
|
|
186
|
-
return
|
|
187
|
-
|
|
190
|
+
return h ? /* @__PURE__ */ s(
|
|
191
|
+
or,
|
|
188
192
|
{
|
|
189
|
-
sort:
|
|
190
|
-
filter:
|
|
191
|
-
search:
|
|
192
|
-
rowHeight:
|
|
193
|
-
hideFields:
|
|
194
|
-
align:
|
|
195
|
-
groupBy:
|
|
196
|
-
summary:
|
|
197
|
-
sortContent:
|
|
198
|
-
filterContent:
|
|
199
|
-
fallbackTitle:
|
|
200
|
-
trailing:
|
|
193
|
+
sort: h.sort,
|
|
194
|
+
filter: h.filter,
|
|
195
|
+
search: h.search,
|
|
196
|
+
rowHeight: h.rowHeight,
|
|
197
|
+
hideFields: h.hideFields,
|
|
198
|
+
align: h.align,
|
|
199
|
+
groupBy: h.groupBy,
|
|
200
|
+
summary: h.summary,
|
|
201
|
+
sortContent: h.sortContent,
|
|
202
|
+
filterContent: h.filterContent,
|
|
203
|
+
fallbackTitle: Fe,
|
|
204
|
+
trailing: Me,
|
|
201
205
|
searchCollapsible: Ue,
|
|
202
|
-
disableExtendedTools:
|
|
206
|
+
disableExtendedTools: ue,
|
|
207
|
+
undoRedo: h.undoRedo ? {
|
|
208
|
+
...h.undoRedo,
|
|
209
|
+
isDisabled: h.undoRedo.isDisabled ?? ue
|
|
210
|
+
} : void 0
|
|
203
211
|
}
|
|
204
212
|
) : null;
|
|
205
213
|
}, [
|
|
206
|
-
|
|
207
|
-
|
|
214
|
+
ye,
|
|
215
|
+
Ve,
|
|
216
|
+
Q,
|
|
208
217
|
Z,
|
|
209
|
-
|
|
210
|
-
U,
|
|
218
|
+
M,
|
|
211
219
|
K,
|
|
212
220
|
ee,
|
|
213
221
|
te,
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
222
|
+
ke,
|
|
223
|
+
h,
|
|
224
|
+
Fe,
|
|
225
|
+
Me,
|
|
218
226
|
Ue,
|
|
219
|
-
|
|
220
|
-
]),
|
|
221
|
-
if (!
|
|
227
|
+
ue
|
|
228
|
+
]), Ye = Xe != null && xt !== !1, He = !!x && (x == null ? void 0 : x.showPagination) !== !1, Pt = Ye || He, Qe = !P && i.length === 0 && De != null, m = !!(gt && v), Se = !!(v != null && v.showFooterRow), T = bt ?? (m || Se || be), Tt = Qe && !(Se && v), D = l.length + (W ? 1 : 0) + (m ? 1 : 0), Ot = !!(mt && we), y = H ? "border-r border-secondary last:border-r-0" : void 0, I = u(() => {
|
|
229
|
+
if (!w) return null;
|
|
222
230
|
const e = l.reduce(
|
|
223
|
-
(
|
|
231
|
+
(a, f) => X(f) ? a + Te(Oe(f)) : a,
|
|
224
232
|
0
|
|
225
233
|
);
|
|
226
234
|
return { minTableWidth: l.filter(
|
|
227
|
-
(
|
|
235
|
+
(a) => !X(a)
|
|
228
236
|
).reduce(
|
|
229
|
-
(
|
|
237
|
+
(a, f) => a + Te(f.minWidth),
|
|
230
238
|
0
|
|
231
239
|
) + e };
|
|
232
|
-
}, [l,
|
|
240
|
+
}, [l, w]), Lt = u(() => {
|
|
233
241
|
const e = /* @__PURE__ */ new Map();
|
|
234
242
|
return re && l.forEach((r) => {
|
|
235
243
|
e.set(
|
|
@@ -237,114 +245,114 @@ const Te = "300px", Pe = (t) => {
|
|
|
237
245
|
(n) => re(r.key, n)
|
|
238
246
|
);
|
|
239
247
|
}), e;
|
|
240
|
-
}, [l, re]), R =
|
|
248
|
+
}, [l, re]), R = Vt(null), [U, Ze] = B(null), ve = J(
|
|
241
249
|
(e, r, n) => {
|
|
242
250
|
var f;
|
|
243
|
-
let
|
|
244
|
-
if (
|
|
245
|
-
const N = (f =
|
|
251
|
+
let a = n ?? null;
|
|
252
|
+
if (a == null) {
|
|
253
|
+
const N = (f = tr(
|
|
246
254
|
R.current,
|
|
247
255
|
e,
|
|
248
256
|
r
|
|
249
|
-
)) == null ? void 0 : f.getAttribute("data-grid-source-index"),
|
|
250
|
-
|
|
257
|
+
)) == null ? void 0 : f.getAttribute("data-grid-source-index"), _ = N != null && N !== "" ? Number(N) : NaN;
|
|
258
|
+
a = Number.isNaN(_) ? null : _;
|
|
251
259
|
}
|
|
252
|
-
|
|
260
|
+
ge({ rowId: e, columnKey: r, sourceIndex: a });
|
|
253
261
|
},
|
|
254
262
|
[]
|
|
255
|
-
),
|
|
263
|
+
), zt = J(
|
|
256
264
|
(e) => {
|
|
257
265
|
var le, oe, de;
|
|
258
|
-
const r = e.key in
|
|
259
|
-
if (e.key !== "Enter" && e.key !== "Tab" && e.key !== "Escape" && !r ||
|
|
266
|
+
const r = e.key in st;
|
|
267
|
+
if (e.key !== "Enter" && e.key !== "Tab" && e.key !== "Escape" && !r || rr(e.target)) return;
|
|
260
268
|
if (e.key === "Escape") {
|
|
261
|
-
if (!
|
|
262
|
-
e.preventDefault(), e.stopPropagation(),
|
|
269
|
+
if (!b) return;
|
|
270
|
+
e.preventDefault(), e.stopPropagation(), ge(null), (le = R.current) != null && le.contains(document.activeElement) && document.activeElement.blur();
|
|
263
271
|
return;
|
|
264
272
|
}
|
|
265
273
|
const n = (de = (oe = e.target).closest) == null ? void 0 : de.call(
|
|
266
274
|
oe,
|
|
267
275
|
"[data-grid-cell]"
|
|
268
|
-
),
|
|
276
|
+
), a = n == null ? void 0 : n.getAttribute("data-grid-row-id"), f = n == null ? void 0 : n.getAttribute("data-grid-col-key"), N = n == null ? void 0 : n.getAttribute(
|
|
269
277
|
"data-grid-source-index"
|
|
270
|
-
),
|
|
271
|
-
rowId:
|
|
278
|
+
), _ = N != null && N !== "" ? Number(N) : NaN, o = Number.isNaN(_) ? null : _, C = b ?? (a && f ? {
|
|
279
|
+
rowId: a,
|
|
272
280
|
columnKey: f,
|
|
273
281
|
sourceIndex: o
|
|
274
282
|
} : null);
|
|
275
|
-
if (!
|
|
283
|
+
if (!C) return;
|
|
276
284
|
if (e.key === "Enter") {
|
|
277
|
-
if (!
|
|
278
|
-
e.preventDefault(), e.stopPropagation(),
|
|
279
|
-
rowId:
|
|
280
|
-
columnKey:
|
|
281
|
-
sourceIndex:
|
|
285
|
+
if (!xe) return;
|
|
286
|
+
e.preventDefault(), e.stopPropagation(), xe({
|
|
287
|
+
rowId: C.rowId,
|
|
288
|
+
columnKey: C.columnKey,
|
|
289
|
+
sourceIndex: C.sourceIndex
|
|
282
290
|
});
|
|
283
291
|
return;
|
|
284
292
|
}
|
|
285
|
-
const
|
|
293
|
+
const E = r ? nr(
|
|
286
294
|
R.current,
|
|
287
|
-
|
|
295
|
+
g,
|
|
288
296
|
se,
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
) :
|
|
297
|
+
C.rowId,
|
|
298
|
+
C.columnKey,
|
|
299
|
+
st[e.key]
|
|
300
|
+
) : ir(
|
|
293
301
|
R.current,
|
|
294
|
-
|
|
302
|
+
g,
|
|
295
303
|
se,
|
|
296
|
-
|
|
297
|
-
|
|
304
|
+
C.rowId,
|
|
305
|
+
C.columnKey,
|
|
298
306
|
!e.shiftKey
|
|
299
307
|
);
|
|
300
|
-
if (!
|
|
308
|
+
if (!E) {
|
|
301
309
|
r && (e.preventDefault(), e.stopPropagation());
|
|
302
310
|
return;
|
|
303
311
|
}
|
|
304
|
-
e.preventDefault(), e.stopPropagation(),
|
|
305
|
-
() =>
|
|
312
|
+
e.preventDefault(), e.stopPropagation(), ve(E.rowId, E.columnKey, E.sourceIndex), requestAnimationFrame(
|
|
313
|
+
() => sr(
|
|
306
314
|
R.current,
|
|
307
|
-
|
|
308
|
-
|
|
315
|
+
E.rowId,
|
|
316
|
+
E.columnKey
|
|
309
317
|
)
|
|
310
318
|
);
|
|
311
319
|
},
|
|
312
|
-
[
|
|
320
|
+
[b, g, se, xe, ve]
|
|
313
321
|
);
|
|
314
|
-
|
|
315
|
-
if (!T || !
|
|
322
|
+
Xt(() => {
|
|
323
|
+
if (!T || !b) return;
|
|
316
324
|
const e = (r) => {
|
|
317
325
|
const n = R.current;
|
|
318
|
-
n && !n.contains(r.target) &&
|
|
326
|
+
n && !n.contains(r.target) && ge(null);
|
|
319
327
|
};
|
|
320
328
|
return document.addEventListener("pointerdown", e, !0), () => document.removeEventListener("pointerdown", e, !0);
|
|
321
|
-
}, [T,
|
|
322
|
-
const
|
|
329
|
+
}, [T, b]);
|
|
330
|
+
const Ke = u(() => {
|
|
323
331
|
let e = 0;
|
|
324
332
|
return W && (e += 40), m && (e += 56), l.forEach((r) => {
|
|
325
|
-
|
|
333
|
+
X(r) && (e += Te(Oe(r)));
|
|
326
334
|
}), e;
|
|
327
|
-
}, [l, m, W]),
|
|
328
|
-
() => l.filter((e) => !
|
|
335
|
+
}, [l, m, W]), We = u(
|
|
336
|
+
() => l.filter((e) => !X(e)).length,
|
|
329
337
|
[l]
|
|
330
|
-
),
|
|
331
|
-
if (!
|
|
338
|
+
), Re = u(() => {
|
|
339
|
+
if (!w || !I) return null;
|
|
332
340
|
const { minTableWidth: e } = I;
|
|
333
|
-
return
|
|
334
|
-
}, [
|
|
341
|
+
return U ? Math.max(U, e) : e;
|
|
342
|
+
}, [U, w, I]), Ie = !!(w && I && U && U < I.minTableWidth), _e = u(() => !Re || We === 0 ? null : Math.max(
|
|
335
343
|
0,
|
|
336
|
-
(
|
|
337
|
-
), [
|
|
338
|
-
|
|
339
|
-
if (!
|
|
344
|
+
(Re - Ke) / We
|
|
345
|
+
), [Re, Ke, We]);
|
|
346
|
+
Yt(() => {
|
|
347
|
+
if (!w) {
|
|
340
348
|
Ze(null);
|
|
341
349
|
return;
|
|
342
350
|
}
|
|
343
351
|
const e = R.current;
|
|
344
352
|
if (!e) return;
|
|
345
353
|
const r = () => {
|
|
346
|
-
const
|
|
347
|
-
|
|
354
|
+
const a = e.clientWidth;
|
|
355
|
+
a > 0 && Ze((f) => f === a ? f : a);
|
|
348
356
|
};
|
|
349
357
|
r();
|
|
350
358
|
const n = new ResizeObserver(r);
|
|
@@ -353,79 +361,79 @@ const Te = "300px", Pe = (t) => {
|
|
|
353
361
|
};
|
|
354
362
|
}, [
|
|
355
363
|
l.length,
|
|
356
|
-
|
|
357
|
-
|
|
364
|
+
i.length,
|
|
365
|
+
w,
|
|
358
366
|
P,
|
|
359
367
|
m,
|
|
360
368
|
W
|
|
361
369
|
]);
|
|
362
|
-
const Ee =
|
|
363
|
-
(e) =>
|
|
364
|
-
width: `${
|
|
370
|
+
const Ee = J(
|
|
371
|
+
(e) => w ? X(e) ? ot(e) : _e != null ? {
|
|
372
|
+
width: `${_e}px`,
|
|
365
373
|
minWidth: e.minWidth,
|
|
366
|
-
maxWidth: e.maxWidth ??
|
|
367
|
-
} :
|
|
368
|
-
[
|
|
369
|
-
),
|
|
370
|
-
if (!(!
|
|
371
|
-
return
|
|
374
|
+
maxWidth: e.maxWidth ?? Le
|
|
375
|
+
} : ot(e) : Cr(e),
|
|
376
|
+
[w, _e]
|
|
377
|
+
), At = u(() => {
|
|
378
|
+
if (!(!w || !I))
|
|
379
|
+
return Ie ? {
|
|
372
380
|
width: `${I.minTableWidth}px`,
|
|
373
381
|
tableLayout: "fixed"
|
|
374
382
|
} : {
|
|
375
383
|
width: "100%",
|
|
376
384
|
tableLayout: "fixed"
|
|
377
385
|
};
|
|
378
|
-
}, [
|
|
386
|
+
}, [w, I, Ie]), Gt = J(
|
|
379
387
|
(e) => {
|
|
380
|
-
R.current = e, typeof
|
|
388
|
+
R.current = e, typeof F == "function" ? F(e) : F && (F.current = e);
|
|
381
389
|
},
|
|
382
|
-
[
|
|
383
|
-
),
|
|
384
|
-
selectionMode:
|
|
385
|
-
selectedKeys:
|
|
386
|
-
onSelectionChange:
|
|
387
|
-
} : {},
|
|
390
|
+
[F]
|
|
391
|
+
), $t = ie ? {
|
|
392
|
+
selectionMode: G,
|
|
393
|
+
selectedKeys: k === "all" ? "all" : k,
|
|
394
|
+
onSelectionChange: Nr(p)
|
|
395
|
+
} : {}, jt = (e) => {
|
|
388
396
|
const r = e.__sourceIndex;
|
|
389
397
|
return typeof r == "number" ? r : 0;
|
|
390
|
-
},
|
|
398
|
+
}, Pe = ie && br(k, g), Ft = ie && mr(k, g), Mt = () => {
|
|
391
399
|
if (p) {
|
|
392
|
-
if (
|
|
400
|
+
if (Pe) {
|
|
393
401
|
p(/* @__PURE__ */ new Set());
|
|
394
402
|
return;
|
|
395
403
|
}
|
|
396
404
|
p("all");
|
|
397
405
|
}
|
|
398
|
-
},
|
|
406
|
+
}, Dt = (e, r) => {
|
|
399
407
|
if (!p) return;
|
|
400
|
-
if (
|
|
408
|
+
if (G === "single") {
|
|
401
409
|
p(r ? /* @__PURE__ */ new Set([e]) : /* @__PURE__ */ new Set());
|
|
402
410
|
return;
|
|
403
411
|
}
|
|
404
|
-
const n =
|
|
412
|
+
const n = k === "all" ? new Set(g) : new Set(at(k, g));
|
|
405
413
|
r ? n.add(e) : n.delete(e), p(n);
|
|
406
414
|
}, Ut = (e) => {
|
|
407
415
|
const r = ne.has(e.key);
|
|
408
|
-
return
|
|
416
|
+
return Be ? /* @__PURE__ */ s(
|
|
409
417
|
d.Row,
|
|
410
418
|
{
|
|
411
419
|
id: `group-${e.key}`,
|
|
412
420
|
highlightSelectedRow: !1,
|
|
413
421
|
className: "bg-secondary_subtle hover:bg-secondary_subtle",
|
|
414
|
-
children: /* @__PURE__ */
|
|
422
|
+
children: /* @__PURE__ */ s(d.Cell, { colSpan: D, className: c(y), children: Be(e) })
|
|
415
423
|
},
|
|
416
424
|
`group-${e.key}`
|
|
417
|
-
) : /* @__PURE__ */
|
|
425
|
+
) : /* @__PURE__ */ s(
|
|
418
426
|
d.Row,
|
|
419
427
|
{
|
|
420
428
|
id: `group-${e.key}`,
|
|
421
429
|
highlightSelectedRow: !1,
|
|
422
430
|
className: "bg-secondary_subtle hover:bg-secondary_subtle",
|
|
423
|
-
children: /* @__PURE__ */
|
|
431
|
+
children: /* @__PURE__ */ s(
|
|
424
432
|
d.Cell,
|
|
425
433
|
{
|
|
426
434
|
colSpan: D,
|
|
427
|
-
className: c("py-1.5",
|
|
428
|
-
children: /* @__PURE__ */
|
|
435
|
+
className: c("py-1.5", y),
|
|
436
|
+
children: /* @__PURE__ */ S(
|
|
429
437
|
"button",
|
|
430
438
|
{
|
|
431
439
|
type: "button",
|
|
@@ -433,8 +441,8 @@ const Te = "300px", Pe = (t) => {
|
|
|
433
441
|
onClick: () => Et(e.key),
|
|
434
442
|
"aria-expanded": !r,
|
|
435
443
|
children: [
|
|
436
|
-
/* @__PURE__ */
|
|
437
|
-
|
|
444
|
+
/* @__PURE__ */ s(
|
|
445
|
+
Ht,
|
|
438
446
|
{
|
|
439
447
|
className: c(
|
|
440
448
|
"size-4 shrink-0 text-fg-quaternary transition-transform",
|
|
@@ -442,8 +450,8 @@ const Te = "300px", Pe = (t) => {
|
|
|
442
450
|
)
|
|
443
451
|
}
|
|
444
452
|
),
|
|
445
|
-
/* @__PURE__ */
|
|
446
|
-
/* @__PURE__ */
|
|
453
|
+
/* @__PURE__ */ s("span", { className: "truncate", children: e.label || "(Empty)" }),
|
|
454
|
+
/* @__PURE__ */ S("span", { className: "text-tertiary", children: [
|
|
447
455
|
"(",
|
|
448
456
|
e.rows.length,
|
|
449
457
|
")"
|
|
@@ -456,48 +464,48 @@ const Te = "300px", Pe = (t) => {
|
|
|
456
464
|
},
|
|
457
465
|
`group-${e.key}`
|
|
458
466
|
);
|
|
459
|
-
},
|
|
460
|
-
const n =
|
|
461
|
-
return /* @__PURE__ */
|
|
467
|
+
}, et = (e, r) => {
|
|
468
|
+
const n = $e ? $e(e) : !1, a = V(e), f = jt(e), N = xr(k, a, g), _ = Wt === a;
|
|
469
|
+
return /* @__PURE__ */ S(
|
|
462
470
|
d.Row,
|
|
463
471
|
{
|
|
464
472
|
onAction: () => Y == null ? void 0 : Y(e),
|
|
465
|
-
onMouseEnter: () =>
|
|
466
|
-
onMouseLeave: () =>
|
|
467
|
-
id:
|
|
473
|
+
onMouseEnter: () => O == null ? void 0 : O(e, !0),
|
|
474
|
+
onMouseLeave: () => O == null ? void 0 : O(e, !1),
|
|
475
|
+
id: a,
|
|
468
476
|
value: e,
|
|
469
477
|
columns: l,
|
|
470
478
|
expandedColSpan: D,
|
|
471
479
|
isExpandable: n,
|
|
472
480
|
highlightSelectedRow: !he,
|
|
473
|
-
renderExpandedContent: n ?
|
|
481
|
+
renderExpandedContent: n ? wt : void 0,
|
|
474
482
|
className: c(
|
|
475
483
|
Y && "cursor-pointer",
|
|
476
|
-
|
|
477
|
-
|
|
484
|
+
ft ? "prose" : "",
|
|
485
|
+
Ge && "[&>td]:after:hidden",
|
|
478
486
|
be && "group/rowactions",
|
|
479
|
-
|
|
480
|
-
|
|
487
|
+
_ && "bg-utility-brand-25 hover:bg-utility-brand-25",
|
|
488
|
+
qe,
|
|
481
489
|
fe == null ? void 0 : fe(e)
|
|
482
490
|
),
|
|
483
491
|
children: [
|
|
484
|
-
W && /* @__PURE__ */
|
|
492
|
+
W && /* @__PURE__ */ s(
|
|
485
493
|
d.Cell,
|
|
486
494
|
{
|
|
487
|
-
className: c("relative w-10 text-center",
|
|
495
|
+
className: c("relative w-10 text-center", y),
|
|
488
496
|
style: { minWidth: "40px", width: "40px" },
|
|
489
|
-
children: /* @__PURE__ */
|
|
497
|
+
children: /* @__PURE__ */ s(
|
|
490
498
|
"div",
|
|
491
499
|
{
|
|
492
500
|
className: "flex items-center justify-center",
|
|
493
501
|
onClick: (o) => o.stopPropagation(),
|
|
494
502
|
onKeyDown: (o) => o.stopPropagation(),
|
|
495
|
-
children: /* @__PURE__ */
|
|
496
|
-
|
|
503
|
+
children: /* @__PURE__ */ s(
|
|
504
|
+
it,
|
|
497
505
|
{
|
|
498
506
|
checked: N,
|
|
499
|
-
onCheckedChange: (o) =>
|
|
500
|
-
"aria-label": `Select row ${
|
|
507
|
+
onCheckedChange: (o) => Dt(a, o === !0),
|
|
508
|
+
"aria-label": `Select row ${a}`,
|
|
501
509
|
className: "items-center justify-center"
|
|
502
510
|
}
|
|
503
511
|
)
|
|
@@ -505,20 +513,20 @@ const Te = "300px", Pe = (t) => {
|
|
|
505
513
|
)
|
|
506
514
|
}
|
|
507
515
|
),
|
|
508
|
-
l.map((o,
|
|
509
|
-
const
|
|
516
|
+
l.map((o, C) => {
|
|
517
|
+
const E = Je.get(o.key), le = lt(
|
|
510
518
|
o.key,
|
|
511
519
|
z,
|
|
512
|
-
|
|
513
|
-
), oe = (
|
|
514
|
-
return /* @__PURE__ */
|
|
520
|
+
E
|
|
521
|
+
), oe = (A == null ? void 0 : A.rowId) === a && (A == null ? void 0 : A.columnKey) === o.key, de = T && !oe && (b == null ? void 0 : b.rowId) === a && (b == null ? void 0 : b.columnKey) === o.key;
|
|
522
|
+
return /* @__PURE__ */ s(
|
|
515
523
|
d.Cell,
|
|
516
524
|
{
|
|
517
525
|
sticky: o.sticky,
|
|
518
526
|
stickyOffset: o.stickyOffset,
|
|
519
527
|
style: Ee(o),
|
|
520
528
|
"data-grid-cell": "",
|
|
521
|
-
"data-grid-row-id":
|
|
529
|
+
"data-grid-row-id": a,
|
|
522
530
|
"data-grid-col-key": o.key,
|
|
523
531
|
"data-grid-source-index": f,
|
|
524
532
|
className: c(
|
|
@@ -529,54 +537,54 @@ const Te = "300px", Pe = (t) => {
|
|
|
529
537
|
// border pseudo-element so it doesn't overlap the ring's bottom edge.
|
|
530
538
|
de && "z-1 outline-hidden ring-2 ring-inset ring-brand after:opacity-0",
|
|
531
539
|
o.cellClassName,
|
|
532
|
-
|
|
533
|
-
|
|
540
|
+
er(le),
|
|
541
|
+
y
|
|
534
542
|
),
|
|
535
543
|
children: (() => {
|
|
536
|
-
const
|
|
537
|
-
pe && /* @__PURE__ */
|
|
544
|
+
const nt = C === 0 && (n || be) ? /* @__PURE__ */ S("div", { className: "flex items-center", children: [
|
|
545
|
+
pe && /* @__PURE__ */ s(
|
|
538
546
|
"div",
|
|
539
547
|
{
|
|
540
548
|
className: "flex items-center justify-center",
|
|
541
|
-
onClick: (
|
|
542
|
-
onKeyDown: (
|
|
543
|
-
children: /* @__PURE__ */
|
|
544
|
-
|
|
549
|
+
onClick: (q) => q.stopPropagation(),
|
|
550
|
+
onKeyDown: (q) => q.stopPropagation(),
|
|
551
|
+
children: /* @__PURE__ */ s(
|
|
552
|
+
hr,
|
|
545
553
|
{
|
|
546
554
|
config: pe,
|
|
547
555
|
sourceRowIndex: f,
|
|
548
556
|
item: e,
|
|
549
557
|
triggerClassName: c(
|
|
550
558
|
"transition-opacity group-hover/rowactions:opacity-100 focus-visible:opacity-100",
|
|
551
|
-
|
|
559
|
+
_ ? "opacity-100" : "opacity-0"
|
|
552
560
|
),
|
|
553
|
-
onOpenChange: (
|
|
561
|
+
onOpenChange: (q) => Rt(q ? a : null)
|
|
554
562
|
}
|
|
555
563
|
)
|
|
556
564
|
}
|
|
557
565
|
),
|
|
558
|
-
/* @__PURE__ */
|
|
559
|
-
] }) :
|
|
560
|
-
return T ? /* @__PURE__ */
|
|
566
|
+
/* @__PURE__ */ s("div", { className: "flex-1 min-w-0", children: ze(o.key, e[o.key], e) })
|
|
567
|
+
] }) : ze(o.key, e[o.key], e);
|
|
568
|
+
return T ? /* @__PURE__ */ s(
|
|
561
569
|
"div",
|
|
562
570
|
{
|
|
563
571
|
"data-grid-focus": !0,
|
|
564
572
|
tabIndex: -1,
|
|
565
573
|
className: "outline-hidden",
|
|
566
|
-
children:
|
|
574
|
+
children: nt
|
|
567
575
|
}
|
|
568
|
-
) :
|
|
576
|
+
) : nt;
|
|
569
577
|
})()
|
|
570
578
|
},
|
|
571
579
|
o.key
|
|
572
580
|
);
|
|
573
581
|
}),
|
|
574
|
-
m && v && /* @__PURE__ */
|
|
582
|
+
m && v && /* @__PURE__ */ s(
|
|
575
583
|
d.Cell,
|
|
576
584
|
{
|
|
577
|
-
className: c("relative w-14 text-center",
|
|
585
|
+
className: c("relative w-14 text-center", y),
|
|
578
586
|
style: { minWidth: "56px", width: "56px" },
|
|
579
|
-
children: /* @__PURE__ */
|
|
587
|
+
children: /* @__PURE__ */ s(
|
|
580
588
|
"button",
|
|
581
589
|
{
|
|
582
590
|
type: "button",
|
|
@@ -586,30 +594,30 @@ const Te = "300px", Pe = (t) => {
|
|
|
586
594
|
onClick: (o) => {
|
|
587
595
|
o.stopPropagation(), v.onDeleteRow(f);
|
|
588
596
|
},
|
|
589
|
-
children: /* @__PURE__ */
|
|
597
|
+
children: /* @__PURE__ */ s(ur, { name: "Trash02", className: "size-3" })
|
|
590
598
|
}
|
|
591
599
|
)
|
|
592
600
|
}
|
|
593
601
|
)
|
|
594
602
|
]
|
|
595
603
|
},
|
|
596
|
-
|
|
604
|
+
a
|
|
597
605
|
);
|
|
598
|
-
},
|
|
606
|
+
}, qt = (e) => /* @__PURE__ */ S(
|
|
599
607
|
d.Row,
|
|
600
608
|
{
|
|
601
609
|
id: String(e.id),
|
|
602
610
|
isExpandable: !1,
|
|
603
|
-
className: c(
|
|
611
|
+
className: c(Ge && "[&>td]:after:hidden", qe),
|
|
604
612
|
children: [
|
|
605
|
-
W && /* @__PURE__ */
|
|
613
|
+
W && /* @__PURE__ */ s(
|
|
606
614
|
d.Cell,
|
|
607
615
|
{
|
|
608
|
-
className: c("relative w-10",
|
|
616
|
+
className: c("relative w-10", y),
|
|
609
617
|
style: { minWidth: "40px", width: "40px" }
|
|
610
618
|
}
|
|
611
619
|
),
|
|
612
|
-
l.map((r) => /* @__PURE__ */
|
|
620
|
+
l.map((r) => /* @__PURE__ */ s(
|
|
613
621
|
d.Cell,
|
|
614
622
|
{
|
|
615
623
|
sticky: r.sticky,
|
|
@@ -618,75 +626,75 @@ const Te = "300px", Pe = (t) => {
|
|
|
618
626
|
className: c(
|
|
619
627
|
"overflow-x-hidden text-left",
|
|
620
628
|
r.cellClassName,
|
|
621
|
-
|
|
629
|
+
y
|
|
622
630
|
),
|
|
623
|
-
children: /* @__PURE__ */
|
|
631
|
+
children: /* @__PURE__ */ s(yr, { height: "14px", width: "75%", className: "rounded" })
|
|
624
632
|
},
|
|
625
633
|
r.key
|
|
626
634
|
)),
|
|
627
|
-
m && /* @__PURE__ */
|
|
635
|
+
m && /* @__PURE__ */ s(
|
|
628
636
|
d.Cell,
|
|
629
637
|
{
|
|
630
|
-
className: c("w-14",
|
|
638
|
+
className: c("w-14", y),
|
|
631
639
|
style: { minWidth: "56px", width: "56px" }
|
|
632
640
|
}
|
|
633
641
|
)
|
|
634
642
|
]
|
|
635
643
|
},
|
|
636
644
|
String(e.id)
|
|
637
|
-
),
|
|
645
|
+
), Bt = () => P ? ae.map((e) => qt(e)) : me && L ? L.flatMap((e) => {
|
|
638
646
|
const r = ne.has(e.key);
|
|
639
647
|
return [
|
|
640
648
|
Ut(e),
|
|
641
|
-
...r ? [] : e.rows.map((n) =>
|
|
649
|
+
...r ? [] : e.rows.map((n) => et(n))
|
|
642
650
|
];
|
|
643
|
-
}) : ae.map((e) =>
|
|
651
|
+
}) : ae.map((e) => et(e)), tt = /* @__PURE__ */ s(
|
|
644
652
|
Qt.Root,
|
|
645
653
|
{
|
|
646
654
|
ref: Gt,
|
|
647
|
-
onKeyDownCapture: T ?
|
|
655
|
+
onKeyDownCapture: T ? zt : void 0,
|
|
648
656
|
className: c(
|
|
649
657
|
"w-full",
|
|
650
|
-
!
|
|
651
|
-
|
|
658
|
+
!w || Ie ? "overflow-x-auto" : "overflow-x-hidden",
|
|
659
|
+
H && "border border-secondary rounded-xl",
|
|
652
660
|
"[&_tr:hover>td]:!bg-secondary_subtle",
|
|
653
|
-
|
|
661
|
+
ut
|
|
654
662
|
),
|
|
655
|
-
size:
|
|
656
|
-
children: /* @__PURE__ */
|
|
663
|
+
size: Ae,
|
|
664
|
+
children: /* @__PURE__ */ S(
|
|
657
665
|
d,
|
|
658
666
|
{
|
|
659
|
-
"aria-label":
|
|
660
|
-
size:
|
|
667
|
+
"aria-label": ct,
|
|
668
|
+
size: Ae,
|
|
661
669
|
isEditable: T,
|
|
662
670
|
inlineSelection: he,
|
|
663
|
-
className: c(
|
|
664
|
-
style:
|
|
665
|
-
|
|
671
|
+
className: c(w && "min-w-full", pt),
|
|
672
|
+
style: At,
|
|
673
|
+
...$t,
|
|
666
674
|
children: [
|
|
667
|
-
/* @__PURE__ */
|
|
675
|
+
/* @__PURE__ */ S(
|
|
668
676
|
d.Header,
|
|
669
677
|
{
|
|
670
678
|
className: c(
|
|
671
679
|
"sticky top-0",
|
|
672
|
-
|
|
673
|
-
|
|
680
|
+
H && "[&>tr>th:first-child]:rounded-bl-none [&>tr>th:last-child]:rounded-br-none z-1",
|
|
681
|
+
yt
|
|
674
682
|
),
|
|
675
683
|
children: [
|
|
676
|
-
W && /* @__PURE__ */
|
|
684
|
+
W && /* @__PURE__ */ s(
|
|
677
685
|
d.Head,
|
|
678
686
|
{
|
|
679
687
|
label: "",
|
|
680
688
|
allowsSorting: !1,
|
|
681
689
|
isRowHeader: !1,
|
|
682
690
|
style: { minWidth: "40px", width: "40px" },
|
|
683
|
-
className: c(
|
|
691
|
+
className: c(y),
|
|
684
692
|
headerCellClass: "justify-center",
|
|
685
|
-
children:
|
|
686
|
-
|
|
693
|
+
children: G === "multiple" && p && /* @__PURE__ */ s("div", { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ s(
|
|
694
|
+
it,
|
|
687
695
|
{
|
|
688
|
-
checked:
|
|
689
|
-
onCheckedChange: () =>
|
|
696
|
+
checked: Pe ? !0 : Ft && !Pe ? "indeterminate" : !1,
|
|
697
|
+
onCheckedChange: () => Mt(),
|
|
690
698
|
"aria-label": "Select all rows",
|
|
691
699
|
className: "items-center justify-center"
|
|
692
700
|
}
|
|
@@ -695,12 +703,12 @@ const Te = "300px", Pe = (t) => {
|
|
|
695
703
|
"selection"
|
|
696
704
|
),
|
|
697
705
|
l.map((e, r) => {
|
|
698
|
-
const n =
|
|
706
|
+
const n = Nt ? _t.get(e.key) : void 0, a = Je.get(e.key), f = lt(
|
|
699
707
|
e.key,
|
|
700
708
|
z,
|
|
701
|
-
|
|
702
|
-
), N =
|
|
703
|
-
return /* @__PURE__ */
|
|
709
|
+
a
|
|
710
|
+
), N = ht.includes(e.key) || f === "center" ? "justify-center" : f === "right" ? "justify-end" : "";
|
|
711
|
+
return /* @__PURE__ */ s(
|
|
704
712
|
d.Head,
|
|
705
713
|
{
|
|
706
714
|
sticky: e.sticky,
|
|
@@ -714,78 +722,77 @@ const Te = "300px", Pe = (t) => {
|
|
|
714
722
|
className: c(
|
|
715
723
|
"overflow-hidden",
|
|
716
724
|
e.headClassName,
|
|
717
|
-
|
|
725
|
+
y
|
|
718
726
|
),
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
]
|
|
727
|
+
headerAction: n && re ? /* @__PURE__ */ s(
|
|
728
|
+
dr,
|
|
729
|
+
{
|
|
730
|
+
column: n,
|
|
731
|
+
columnLabel: n.label ?? (a ? Kt(a, Ct) : e.label),
|
|
732
|
+
currentAlignment: a ? dt(
|
|
733
|
+
a,
|
|
734
|
+
z ?? /* @__PURE__ */ new Map()
|
|
735
|
+
) : (z == null ? void 0 : z.get(e.key)) ?? "left",
|
|
736
|
+
capabilities: kt,
|
|
737
|
+
hideDisabled: l.length <= 1,
|
|
738
|
+
onAction: Lt.get(e.key),
|
|
739
|
+
renderExtraItems: St,
|
|
740
|
+
showOnHeaderHover: !0
|
|
741
|
+
}
|
|
742
|
+
) : void 0,
|
|
743
|
+
children: (ce == null ? void 0 : ce(e.key)) ?? null
|
|
737
744
|
},
|
|
738
745
|
e.key
|
|
739
746
|
);
|
|
740
747
|
}),
|
|
741
|
-
m && /* @__PURE__ */
|
|
748
|
+
m && /* @__PURE__ */ s(
|
|
742
749
|
d.Head,
|
|
743
750
|
{
|
|
744
751
|
label: "",
|
|
745
752
|
allowsSorting: !1,
|
|
746
753
|
isRowHeader: !1,
|
|
747
754
|
style: { minWidth: "56px", width: "56px" },
|
|
748
|
-
className: c(
|
|
755
|
+
className: c(y)
|
|
749
756
|
},
|
|
750
757
|
"actions"
|
|
751
758
|
)
|
|
752
759
|
]
|
|
753
760
|
}
|
|
754
761
|
),
|
|
755
|
-
/* @__PURE__ */
|
|
756
|
-
!Qe &&
|
|
757
|
-
|
|
762
|
+
/* @__PURE__ */ S(d.Body, { children: [
|
|
763
|
+
!Qe && Bt(),
|
|
764
|
+
Tt && /* @__PURE__ */ s(
|
|
758
765
|
d.Row,
|
|
759
766
|
{
|
|
760
767
|
id: "empty-state",
|
|
761
768
|
highlightSelectedRow: !1,
|
|
762
|
-
children: /* @__PURE__ */
|
|
769
|
+
children: /* @__PURE__ */ s(
|
|
763
770
|
d.Cell,
|
|
764
771
|
{
|
|
765
772
|
colSpan: D,
|
|
766
773
|
className: c(
|
|
767
774
|
"text-left text-placeholder_subtle border-b border-secondary py-3",
|
|
768
|
-
|
|
775
|
+
y
|
|
769
776
|
),
|
|
770
|
-
children:
|
|
777
|
+
children: De
|
|
771
778
|
}
|
|
772
779
|
)
|
|
773
780
|
},
|
|
774
781
|
"empty-state"
|
|
775
782
|
),
|
|
776
|
-
|
|
783
|
+
Se && v && /* @__PURE__ */ S(
|
|
777
784
|
d.Row,
|
|
778
785
|
{
|
|
779
786
|
id: "add-row-footer",
|
|
780
787
|
highlightSelectedRow: !1,
|
|
781
788
|
children: [
|
|
782
|
-
/* @__PURE__ */
|
|
789
|
+
/* @__PURE__ */ s(
|
|
783
790
|
d.Cell,
|
|
784
791
|
{
|
|
785
792
|
colSpan: D - (m ? 1 : 0),
|
|
786
|
-
className: c(
|
|
787
|
-
children: /* @__PURE__ */
|
|
788
|
-
|
|
793
|
+
className: c(y),
|
|
794
|
+
children: /* @__PURE__ */ s(
|
|
795
|
+
cr,
|
|
789
796
|
{
|
|
790
797
|
color: "tertiary",
|
|
791
798
|
className: "bg-secondary text-primary",
|
|
@@ -796,10 +803,10 @@ const Te = "300px", Pe = (t) => {
|
|
|
796
803
|
)
|
|
797
804
|
}
|
|
798
805
|
),
|
|
799
|
-
m && /* @__PURE__ */
|
|
806
|
+
m && /* @__PURE__ */ s(
|
|
800
807
|
d.Cell,
|
|
801
808
|
{
|
|
802
|
-
className: c("w-14",
|
|
809
|
+
className: c("w-14", y),
|
|
803
810
|
style: { minWidth: "56px", width: "56px" }
|
|
804
811
|
}
|
|
805
812
|
)
|
|
@@ -807,13 +814,13 @@ const Te = "300px", Pe = (t) => {
|
|
|
807
814
|
},
|
|
808
815
|
"add-row-footer"
|
|
809
816
|
),
|
|
810
|
-
|
|
811
|
-
|
|
817
|
+
Ot && we && /* @__PURE__ */ s(
|
|
818
|
+
fr,
|
|
812
819
|
{
|
|
813
|
-
...
|
|
820
|
+
...we,
|
|
814
821
|
hasActionsColumn: m,
|
|
815
822
|
hasSelectionColumn: W,
|
|
816
|
-
showBorders: !!
|
|
823
|
+
showBorders: !!H
|
|
817
824
|
}
|
|
818
825
|
)
|
|
819
826
|
] })
|
|
@@ -821,21 +828,21 @@ const Te = "300px", Pe = (t) => {
|
|
|
821
828
|
}
|
|
822
829
|
)
|
|
823
830
|
}
|
|
824
|
-
),
|
|
825
|
-
|
|
831
|
+
), rt = T ? /* @__PURE__ */ s(
|
|
832
|
+
ar,
|
|
826
833
|
{
|
|
827
|
-
rowIds:
|
|
834
|
+
rowIds: g,
|
|
828
835
|
columnKeys: se,
|
|
829
836
|
containerRef: R,
|
|
830
|
-
onSelectCell:
|
|
831
|
-
onEditingCellChange:
|
|
832
|
-
children:
|
|
837
|
+
onSelectCell: ve,
|
|
838
|
+
onEditingCellChange: It,
|
|
839
|
+
children: tt
|
|
833
840
|
}
|
|
834
|
-
) :
|
|
835
|
-
return
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
841
|
+
) : tt;
|
|
842
|
+
return Pt ? /* @__PURE__ */ S("div", { className: "flex flex-col gap-3", children: [
|
|
843
|
+
Ye && Xe,
|
|
844
|
+
rt,
|
|
845
|
+
He && x && /* @__PURE__ */ s(
|
|
839
846
|
Zt,
|
|
840
847
|
{
|
|
841
848
|
currentPage: x.currentPage,
|
|
@@ -847,9 +854,9 @@ const Te = "300px", Pe = (t) => {
|
|
|
847
854
|
showPagination: x.showPagination
|
|
848
855
|
}
|
|
849
856
|
)
|
|
850
|
-
] }) :
|
|
857
|
+
] }) : rt;
|
|
851
858
|
}
|
|
852
859
|
);
|
|
853
860
|
export {
|
|
854
|
-
|
|
861
|
+
Dr as TableWrapper
|
|
855
862
|
};
|