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