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