@bloomneo/uikit 1.5.0 → 1.5.1
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/CHANGELOG.md +85 -0
- package/README.md +1 -1
- package/bin/templates/fbca/src/web/lib/page-router.tsx.template +223 -109
- package/dist/combobox.js +119 -0
- package/dist/combobox.js.map +1 -0
- package/dist/data-table.js +94 -93
- package/dist/data-table.js.map +1 -1
- package/dist/hooks.js +7 -6
- package/dist/index.js +100 -93
- package/dist/index.js.map +1 -1
- package/dist/llms.txt +146 -1
- package/dist/permission-gate.js +28 -0
- package/dist/permission-gate.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/types/components/ui/combobox.d.ts +57 -0
- package/dist/types/components/ui/combobox.d.ts.map +1 -0
- package/dist/types/components/ui/data-table.d.ts +17 -3
- package/dist/types/components/ui/data-table.d.ts.map +1 -1
- package/dist/types/components/ui/permission-gate.d.ts +70 -0
- package/dist/types/components/ui/permission-gate.d.ts.map +1 -0
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/hooks/index.d.ts.map +1 -1
- package/dist/types/hooks/usePagination.d.ts +67 -0
- package/dist/types/hooks/usePagination.d.ts.map +1 -0
- package/dist/types/index.d.ts +6 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/uikit.css +1 -1
- package/dist/usePagination-CmeREbKO.js +294 -0
- package/dist/usePagination-CmeREbKO.js.map +1 -0
- package/examples/combobox.tsx +37 -0
- package/examples/permission-gate.tsx +29 -0
- package/examples/use-pagination.tsx +46 -0
- package/llms.txt +146 -1
- package/package.json +9 -1
- package/dist/useDataTable-CPiBpEg-.js +0 -254
- package/dist/useDataTable-CPiBpEg-.js.map +0 -1
package/dist/data-table.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { jsxs as l, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import { forwardRef as
|
|
2
|
+
import * as Ve from "react";
|
|
3
|
+
import { forwardRef as Ee, useState as L, useMemo as R, useCallback as j } from "react";
|
|
4
4
|
import { c as ee } from "./index-Bke1qZdk.js";
|
|
5
5
|
import { c as o } from "./utils-CwJPJKOE.js";
|
|
6
6
|
import { Button as b } from "./button.js";
|
|
7
|
-
import { Input as
|
|
8
|
-
import { Badge as
|
|
7
|
+
import { Input as Fe } from "./input.js";
|
|
8
|
+
import { Badge as Ke } from "./badge.js";
|
|
9
9
|
import { Checkbox as G } from "./checkbox.js";
|
|
10
|
-
import { Select as
|
|
10
|
+
import { Select as Re, SelectTrigger as qe, SelectValue as Ie, SelectContent as Pe, SelectItem as A } from "./select.js";
|
|
11
11
|
import { DropdownMenu as J, DropdownMenuTrigger as Q, DropdownMenuContent as X, DropdownMenuItem as Y } from "./dropdown-menu.js";
|
|
12
|
-
import { requireArrayProp as Z, warnInDev as
|
|
13
|
-
import { S as
|
|
12
|
+
import { requireArrayProp as Z, warnInDev as Ue } from "./errors.js";
|
|
13
|
+
import { S as He } from "./search-CpUwRnG-.js";
|
|
14
14
|
import { c as C } from "./createLucideIcon-B45kRl5r.js";
|
|
15
|
-
import { E as
|
|
15
|
+
import { E as Be } from "./ellipsis-BhAoKPVk.js";
|
|
16
16
|
/**
|
|
17
17
|
* @license lucide-react v0.468.0 - ISC
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the ISC license.
|
|
20
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
21
21
|
*/
|
|
22
|
-
const
|
|
22
|
+
const Oe = C("ArrowDownWideNarrow", [
|
|
23
23
|
["path", { d: "m3 16 4 4 4-4", key: "1co6wj" }],
|
|
24
24
|
["path", { d: "M7 20V4", key: "1yoxec" }],
|
|
25
25
|
["path", { d: "M11 4h10", key: "1w87gc" }],
|
|
@@ -32,7 +32,7 @@ const Be = C("ArrowDownWideNarrow", [
|
|
|
32
32
|
* This source code is licensed under the ISC license.
|
|
33
33
|
* See the LICENSE file in the root directory of this source tree.
|
|
34
34
|
*/
|
|
35
|
-
const
|
|
35
|
+
const _e = C("ArrowUpDown", [
|
|
36
36
|
["path", { d: "m21 16-4 4-4-4", key: "f6ql7i" }],
|
|
37
37
|
["path", { d: "M17 20V4", key: "1ejh1v" }],
|
|
38
38
|
["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
|
|
@@ -44,7 +44,7 @@ const Oe = C("ArrowUpDown", [
|
|
|
44
44
|
* This source code is licensed under the ISC license.
|
|
45
45
|
* See the LICENSE file in the root directory of this source tree.
|
|
46
46
|
*/
|
|
47
|
-
const
|
|
47
|
+
const Ge = C("ArrowUpNarrowWide", [
|
|
48
48
|
["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
|
|
49
49
|
["path", { d: "M7 4v16", key: "1glfcx" }],
|
|
50
50
|
["path", { d: "M11 12h4", key: "q8tih4" }],
|
|
@@ -57,7 +57,7 @@ const _e = C("ArrowUpNarrowWide", [
|
|
|
57
57
|
* This source code is licensed under the ISC license.
|
|
58
58
|
* See the LICENSE file in the root directory of this source tree.
|
|
59
59
|
*/
|
|
60
|
-
const
|
|
60
|
+
const Je = C("Download", [
|
|
61
61
|
["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
|
|
62
62
|
["polyline", { points: "7 10 12 15 17 10", key: "2ggqvy" }],
|
|
63
63
|
["line", { x1: "12", x2: "12", y1: "15", y2: "3", key: "1vk2je" }]
|
|
@@ -68,7 +68,7 @@ const Ge = C("Download", [
|
|
|
68
68
|
* This source code is licensed under the ISC license.
|
|
69
69
|
* See the LICENSE file in the root directory of this source tree.
|
|
70
70
|
*/
|
|
71
|
-
const
|
|
71
|
+
const Qe = C("Filter", [
|
|
72
72
|
["polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3", key: "1yg77f" }]
|
|
73
73
|
]);
|
|
74
74
|
/**
|
|
@@ -82,7 +82,7 @@ const $ = C("RefreshCw", [
|
|
|
82
82
|
["path", { d: "M21 3v5h-5", key: "1q7to0" }],
|
|
83
83
|
["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
|
|
84
84
|
["path", { d: "M8 16H3v5", key: "1cv678" }]
|
|
85
|
-
]),
|
|
85
|
+
]), Xe = ee(
|
|
86
86
|
"w-full border-collapse",
|
|
87
87
|
{
|
|
88
88
|
variants: {
|
|
@@ -121,7 +121,7 @@ const $ = C("RefreshCw", [
|
|
|
121
121
|
pinned: "none"
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
),
|
|
124
|
+
), te = Ee((S, ae) => {
|
|
125
125
|
Z(
|
|
126
126
|
"DataTable",
|
|
127
127
|
"data",
|
|
@@ -132,7 +132,7 @@ const $ = C("RefreshCw", [
|
|
|
132
132
|
"columns",
|
|
133
133
|
S.columns,
|
|
134
134
|
"Pass an array of DataTableColumn definitions."
|
|
135
|
-
), S.columns && S.columns.some((e) => !e.id) &&
|
|
135
|
+
), S.columns && S.columns.some((e) => !e.id) && Ue(
|
|
136
136
|
"DataTable",
|
|
137
137
|
"Every column needs a unique `id` (used for sort/filter/render keys)."
|
|
138
138
|
);
|
|
@@ -141,56 +141,56 @@ const $ = C("RefreshCw", [
|
|
|
141
141
|
columns: h = [],
|
|
142
142
|
virtualized: Ye = !1,
|
|
143
143
|
rowHeight: Ze = 40,
|
|
144
|
-
height:
|
|
144
|
+
height: re,
|
|
145
145
|
selectable: d = !1,
|
|
146
146
|
selectionMode: V = "multiple",
|
|
147
|
-
selectedRows:
|
|
148
|
-
onSelectionChange:
|
|
149
|
-
getRowId:
|
|
147
|
+
selectedRows: ne = [],
|
|
148
|
+
onSelectionChange: D,
|
|
149
|
+
getRowId: M = (e, n) => n.toString(),
|
|
150
150
|
sortable: q = !0,
|
|
151
|
-
sortConfig:
|
|
151
|
+
sortConfig: se = [],
|
|
152
152
|
onSortChange: I,
|
|
153
153
|
filterable: $e = !0,
|
|
154
|
-
filterConfig:
|
|
154
|
+
filterConfig: ie = {},
|
|
155
155
|
onFilterChange: P,
|
|
156
|
-
searchable:
|
|
157
|
-
searchPlaceholder:
|
|
158
|
-
searchValue:
|
|
159
|
-
onSearchChange:
|
|
156
|
+
searchable: le = !0,
|
|
157
|
+
searchPlaceholder: ce = "Search...",
|
|
158
|
+
searchValue: oe = "",
|
|
159
|
+
onSearchChange: de,
|
|
160
160
|
pagination: E = !0,
|
|
161
161
|
currentPage: c = 0,
|
|
162
162
|
pageSize: y = 10,
|
|
163
163
|
totalRows: F,
|
|
164
164
|
onPageChange: K,
|
|
165
|
-
onPageSizeChange:
|
|
165
|
+
onPageSizeChange: he,
|
|
166
166
|
actions: v = [],
|
|
167
167
|
bulkActions: U = [],
|
|
168
|
-
expandable:
|
|
169
|
-
expandedRows:
|
|
168
|
+
expandable: me = !1,
|
|
169
|
+
expandedRows: ue = [],
|
|
170
170
|
onExpandChange: et,
|
|
171
171
|
renderExpanded: H,
|
|
172
|
-
loading:
|
|
173
|
-
emptyState:
|
|
172
|
+
loading: pe = !1,
|
|
173
|
+
emptyState: ge,
|
|
174
174
|
error: B,
|
|
175
|
-
exportable:
|
|
176
|
-
exportFormats:
|
|
177
|
-
onExport:
|
|
178
|
-
size:
|
|
175
|
+
exportable: fe = !1,
|
|
176
|
+
exportFormats: be = ["csv", "json"],
|
|
177
|
+
onExport: ye,
|
|
178
|
+
size: ve = "md",
|
|
179
179
|
density: N = "normal",
|
|
180
|
-
striped:
|
|
181
|
-
bordered:
|
|
182
|
-
hoverable:
|
|
183
|
-
className:
|
|
184
|
-
style:
|
|
185
|
-
} = S, [k,
|
|
180
|
+
striped: we = !1,
|
|
181
|
+
bordered: Ne = !0,
|
|
182
|
+
hoverable: ke = !0,
|
|
183
|
+
className: xe,
|
|
184
|
+
style: Ce
|
|
185
|
+
} = S, [k, Se] = L(se), [z, De] = L(ie), [W, Me] = L(oe), [m, O] = L(ne), p = R(
|
|
186
186
|
() => h.filter((e) => !e.hidden),
|
|
187
187
|
[h]
|
|
188
|
-
),
|
|
188
|
+
), ze = j((e) => {
|
|
189
189
|
if (!q || !h.find((i) => i.id === e)?.sortable) return;
|
|
190
190
|
const t = [...k], s = t.findIndex((i) => i.key === e);
|
|
191
|
-
s >= 0 ? t[s].direction === "asc" ? t[s].direction = "desc" : t.splice(s, 1) : t.push({ key: e, direction: "asc" }),
|
|
191
|
+
s >= 0 ? t[s].direction === "asc" ? t[s].direction = "desc" : t.splice(s, 1) : t.push({ key: e, direction: "asc" }), Se(t), I?.(t);
|
|
192
192
|
}, [q, h, k, I]);
|
|
193
|
-
|
|
193
|
+
j((e, n, t = "contains") => {
|
|
194
194
|
const s = { ...z };
|
|
195
195
|
if (n === "" || n == null)
|
|
196
196
|
delete s[e];
|
|
@@ -202,17 +202,17 @@ const $ = C("RefreshCw", [
|
|
|
202
202
|
operator: t
|
|
203
203
|
};
|
|
204
204
|
}
|
|
205
|
-
|
|
205
|
+
De(s), P?.(s);
|
|
206
206
|
}, [h, z, P]);
|
|
207
|
-
const
|
|
207
|
+
const We = j((e) => {
|
|
208
208
|
if (!d) return;
|
|
209
|
-
const n = e ? u.map((t, s) =>
|
|
210
|
-
O(n),
|
|
211
|
-
}, [d, u,
|
|
209
|
+
const n = e ? u.map((t, s) => M(t, s)) : [];
|
|
210
|
+
O(n), D?.(n);
|
|
211
|
+
}, [d, u, M, D]), Te = j((e, n) => {
|
|
212
212
|
if (!d) return;
|
|
213
213
|
let t = [...m];
|
|
214
|
-
V === "single" ? t = n ? [e] : [] : n ? t.push(e) : t = t.filter((s) => s !== e), O(t),
|
|
215
|
-
}, [d, V, m,
|
|
214
|
+
V === "single" ? t = n ? [e] : [] : n ? t.push(e) : t = t.filter((s) => s !== e), O(t), D?.(t);
|
|
215
|
+
}, [d, V, m, D]), w = R(() => {
|
|
216
216
|
let e = [...u];
|
|
217
217
|
return W && (e = e.filter((n) => p.some((t) => {
|
|
218
218
|
const s = t.accessor ? t.accessor(n) : t.accessorKey ? n[t.accessorKey] : "";
|
|
@@ -244,7 +244,7 @@ const $ = C("RefreshCw", [
|
|
|
244
244
|
}));
|
|
245
245
|
}), k.length > 0 && e.sort((n, t) => {
|
|
246
246
|
for (const s of k) {
|
|
247
|
-
const i = h.find((
|
|
247
|
+
const i = h.find((Ae) => Ae.id === s.key);
|
|
248
248
|
if (!i) continue;
|
|
249
249
|
const r = i.accessor ? i.accessor(n) : i.accessorKey ? n[i.accessorKey] : "", g = i.accessor ? i.accessor(t) : i.accessorKey ? t[i.accessorKey] : "";
|
|
250
250
|
let f = 0;
|
|
@@ -273,7 +273,7 @@ const $ = C("RefreshCw", [
|
|
|
273
273
|
if (!E) return w;
|
|
274
274
|
const e = c * y, n = e + y;
|
|
275
275
|
return w.slice(e, n);
|
|
276
|
-
}, [w, E, c, y]),
|
|
276
|
+
}, [w, E, c, y]), T = Math.ceil((F || w.length) / y), Le = (e) => {
|
|
277
277
|
const n = k.find((i) => i.key === e.id), t = !!n, s = n?.direction;
|
|
278
278
|
return /* @__PURE__ */ a(
|
|
279
279
|
"th",
|
|
@@ -292,13 +292,13 @@ const $ = C("RefreshCw", [
|
|
|
292
292
|
minWidth: e.minWidth,
|
|
293
293
|
maxWidth: e.maxWidth
|
|
294
294
|
},
|
|
295
|
-
onClick: () => e.sortable &&
|
|
295
|
+
onClick: () => e.sortable && ze(e.id),
|
|
296
296
|
children: /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
|
|
297
297
|
/* @__PURE__ */ a("span", { children: e.header }),
|
|
298
298
|
e.sortable && /* @__PURE__ */ l("div", { className: "flex flex-col", children: [
|
|
299
|
-
!t && /* @__PURE__ */ a(
|
|
300
|
-
t && s === "asc" && /* @__PURE__ */ a(
|
|
301
|
-
t && s === "desc" && /* @__PURE__ */ a(
|
|
299
|
+
!t && /* @__PURE__ */ a(_e, { className: "h-3 w-3" }),
|
|
300
|
+
t && s === "asc" && /* @__PURE__ */ a(Ge, { className: "h-3 w-3" }),
|
|
301
|
+
t && s === "desc" && /* @__PURE__ */ a(Oe, { className: "h-3 w-3" })
|
|
302
302
|
] }),
|
|
303
303
|
e.filterable && /* @__PURE__ */ a(
|
|
304
304
|
b,
|
|
@@ -309,7 +309,7 @@ const $ = C("RefreshCw", [
|
|
|
309
309
|
onClick: (i) => {
|
|
310
310
|
i.stopPropagation();
|
|
311
311
|
},
|
|
312
|
-
children: /* @__PURE__ */ a(
|
|
312
|
+
children: /* @__PURE__ */ a(Qe, { className: "h-3 w-3" })
|
|
313
313
|
}
|
|
314
314
|
)
|
|
315
315
|
] })
|
|
@@ -317,15 +317,15 @@ const $ = C("RefreshCw", [
|
|
|
317
317
|
e.id
|
|
318
318
|
);
|
|
319
319
|
}, je = (e, n) => {
|
|
320
|
-
const t =
|
|
321
|
-
return /* @__PURE__ */ l(
|
|
320
|
+
const t = M(e, n), s = m.includes(t), i = ue.includes(t);
|
|
321
|
+
return /* @__PURE__ */ l(Ve.Fragment, { children: [
|
|
322
322
|
/* @__PURE__ */ l(
|
|
323
323
|
"tr",
|
|
324
324
|
{
|
|
325
325
|
className: o(
|
|
326
326
|
"transition-colors",
|
|
327
|
-
|
|
328
|
-
|
|
327
|
+
ke && "hover:bg-muted/50",
|
|
328
|
+
we && n % 2 === 0 && "bg-muted/20",
|
|
329
329
|
s && "bg-primary/10"
|
|
330
330
|
),
|
|
331
331
|
children: [
|
|
@@ -333,7 +333,7 @@ const $ = C("RefreshCw", [
|
|
|
333
333
|
G,
|
|
334
334
|
{
|
|
335
335
|
checked: s,
|
|
336
|
-
onCheckedChange: (r) =>
|
|
336
|
+
onCheckedChange: (r) => Te(t, r)
|
|
337
337
|
}
|
|
338
338
|
) }),
|
|
339
339
|
p.map((r) => {
|
|
@@ -359,7 +359,7 @@ const $ = C("RefreshCw", [
|
|
|
359
359
|
);
|
|
360
360
|
}),
|
|
361
361
|
v.length > 0 && /* @__PURE__ */ a("td", { className: o(x({ density: N })), children: /* @__PURE__ */ l(J, { children: [
|
|
362
|
-
/* @__PURE__ */ a(Q, { asChild: !0, children: /* @__PURE__ */ a(b, { variant: "ghost", size: "sm", children: /* @__PURE__ */ a(
|
|
362
|
+
/* @__PURE__ */ a(Q, { asChild: !0, children: /* @__PURE__ */ a(b, { variant: "ghost", size: "sm", children: /* @__PURE__ */ a(Be, { className: "h-4 w-4" }) }) }),
|
|
363
363
|
/* @__PURE__ */ a(X, { align: "end", children: v.filter((r) => !r.visible || r.visible(e, n)).map((r) => /* @__PURE__ */ l(
|
|
364
364
|
Y,
|
|
365
365
|
{
|
|
@@ -378,28 +378,28 @@ const $ = C("RefreshCw", [
|
|
|
378
378
|
]
|
|
379
379
|
}
|
|
380
380
|
),
|
|
381
|
-
|
|
381
|
+
me && i && H && /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { colSpan: p.length + (d ? 1 : 0) + (v.length > 0 ? 1 : 0), children: H(e, n) }) })
|
|
382
382
|
] }, t);
|
|
383
383
|
};
|
|
384
|
-
return /* @__PURE__ */ l("div", { className: o("space-y-4",
|
|
384
|
+
return /* @__PURE__ */ l("div", { className: o("space-y-4", xe), style: Ce, children: [
|
|
385
385
|
/* @__PURE__ */ l("div", { className: "flex items-center justify-between gap-4", children: [
|
|
386
386
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
|
|
387
|
-
|
|
388
|
-
/* @__PURE__ */ a(
|
|
387
|
+
le && /* @__PURE__ */ l("div", { className: "relative", children: [
|
|
388
|
+
/* @__PURE__ */ a(He, { className: "absolute left-2 top-2.5 h-4 w-4 text-muted-foreground" }),
|
|
389
389
|
/* @__PURE__ */ a(
|
|
390
|
-
|
|
390
|
+
Fe,
|
|
391
391
|
{
|
|
392
|
-
placeholder:
|
|
392
|
+
placeholder: ce,
|
|
393
393
|
value: W,
|
|
394
394
|
onChange: (e) => {
|
|
395
|
-
Me(e.target.value),
|
|
395
|
+
Me(e.target.value), de?.(e.target.value);
|
|
396
396
|
},
|
|
397
397
|
className: "pl-8 w-64"
|
|
398
398
|
}
|
|
399
399
|
)
|
|
400
400
|
] }),
|
|
401
401
|
U.length > 0 && m.length > 0 && /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
|
|
402
|
-
/* @__PURE__ */ l(
|
|
402
|
+
/* @__PURE__ */ l(Ke, { variant: "secondary", children: [
|
|
403
403
|
m.length,
|
|
404
404
|
" selected"
|
|
405
405
|
] }),
|
|
@@ -410,7 +410,7 @@ const $ = C("RefreshCw", [
|
|
|
410
410
|
size: "sm",
|
|
411
411
|
onClick: () => {
|
|
412
412
|
const n = u.filter(
|
|
413
|
-
(t, s) => m.includes(
|
|
413
|
+
(t, s) => m.includes(M(t, s))
|
|
414
414
|
);
|
|
415
415
|
e.onClick(n);
|
|
416
416
|
},
|
|
@@ -424,15 +424,15 @@ const $ = C("RefreshCw", [
|
|
|
424
424
|
] })
|
|
425
425
|
] }),
|
|
426
426
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
|
|
427
|
-
|
|
427
|
+
fe && /* @__PURE__ */ l(J, { children: [
|
|
428
428
|
/* @__PURE__ */ a(Q, { asChild: !0, children: /* @__PURE__ */ l(b, { variant: "outline", size: "sm", children: [
|
|
429
|
-
/* @__PURE__ */ a(
|
|
429
|
+
/* @__PURE__ */ a(Je, { className: "h-4 w-4 mr-2" }),
|
|
430
430
|
"Export"
|
|
431
431
|
] }) }),
|
|
432
|
-
/* @__PURE__ */ a(X, { children:
|
|
432
|
+
/* @__PURE__ */ a(X, { children: be.map((e) => /* @__PURE__ */ l(
|
|
433
433
|
Y,
|
|
434
434
|
{
|
|
435
|
-
onClick: () =>
|
|
435
|
+
onClick: () => ye?.(e, w),
|
|
436
436
|
children: [
|
|
437
437
|
"Export as ",
|
|
438
438
|
e.toUpperCase()
|
|
@@ -448,12 +448,12 @@ const $ = C("RefreshCw", [
|
|
|
448
448
|
"div",
|
|
449
449
|
{
|
|
450
450
|
className: "border border-border rounded-lg overflow-auto",
|
|
451
|
-
style: { height:
|
|
451
|
+
style: { height: re },
|
|
452
452
|
children: /* @__PURE__ */ l(
|
|
453
453
|
"table",
|
|
454
454
|
{
|
|
455
|
-
ref:
|
|
456
|
-
className: o(
|
|
455
|
+
ref: ae,
|
|
456
|
+
className: o(Xe({ size: ve, bordered: Ne })),
|
|
457
457
|
children: [
|
|
458
458
|
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ l("tr", { children: [
|
|
459
459
|
d && /* @__PURE__ */ a("th", { className: o(x({ density: N }), "bg-muted/50"), children: V === "multiple" && /* @__PURE__ */ a(
|
|
@@ -463,13 +463,13 @@ const $ = C("RefreshCw", [
|
|
|
463
463
|
className: o(
|
|
464
464
|
m.length > 0 && m.length < u.length && "data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground [&>svg]:opacity-50"
|
|
465
465
|
),
|
|
466
|
-
onCheckedChange:
|
|
466
|
+
onCheckedChange: We
|
|
467
467
|
}
|
|
468
468
|
) }),
|
|
469
469
|
p.map(Le),
|
|
470
470
|
v.length > 0 && /* @__PURE__ */ a("th", { className: o(x({ density: N }), "bg-muted/50 w-16"), children: "Actions" })
|
|
471
471
|
] }) }),
|
|
472
|
-
/* @__PURE__ */ a("tbody", { children:
|
|
472
|
+
/* @__PURE__ */ a("tbody", { children: pe ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a(
|
|
473
473
|
"td",
|
|
474
474
|
{
|
|
475
475
|
colSpan: p.length + (d ? 1 : 0) + (v.length > 0 ? 1 : 0),
|
|
@@ -491,7 +491,7 @@ const $ = C("RefreshCw", [
|
|
|
491
491
|
{
|
|
492
492
|
colSpan: p.length + (d ? 1 : 0) + (v.length > 0 ? 1 : 0),
|
|
493
493
|
className: "text-center py-8",
|
|
494
|
-
children:
|
|
494
|
+
children: ge || /* @__PURE__ */ a("div", { className: "text-muted-foreground", children: "No data available" })
|
|
495
495
|
}
|
|
496
496
|
) }) : _.map(je) })
|
|
497
497
|
]
|
|
@@ -499,7 +499,7 @@ const $ = C("RefreshCw", [
|
|
|
499
499
|
)
|
|
500
500
|
}
|
|
501
501
|
),
|
|
502
|
-
E &&
|
|
502
|
+
E && T > 1 && /* @__PURE__ */ l("div", { className: "flex items-center justify-between", children: [
|
|
503
503
|
/* @__PURE__ */ l("div", { className: "text-sm text-muted-foreground", children: [
|
|
504
504
|
"Showing ",
|
|
505
505
|
c * y + 1,
|
|
@@ -513,13 +513,13 @@ const $ = C("RefreshCw", [
|
|
|
513
513
|
] }),
|
|
514
514
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
|
|
515
515
|
/* @__PURE__ */ l(
|
|
516
|
-
|
|
516
|
+
Re,
|
|
517
517
|
{
|
|
518
518
|
value: y.toString(),
|
|
519
|
-
onValueChange: (e) =>
|
|
519
|
+
onValueChange: (e) => he?.(Number(e)),
|
|
520
520
|
children: [
|
|
521
|
-
/* @__PURE__ */ a(
|
|
522
|
-
/* @__PURE__ */ l(
|
|
521
|
+
/* @__PURE__ */ a(qe, { className: "w-20", children: /* @__PURE__ */ a(Ie, {}) }),
|
|
522
|
+
/* @__PURE__ */ l(Pe, { children: [
|
|
523
523
|
/* @__PURE__ */ a(A, { value: "10", children: "10" }),
|
|
524
524
|
/* @__PURE__ */ a(A, { value: "25", children: "25" }),
|
|
525
525
|
/* @__PURE__ */ a(A, { value: "50", children: "50" }),
|
|
@@ -539,9 +539,9 @@ const $ = C("RefreshCw", [
|
|
|
539
539
|
children: "Previous"
|
|
540
540
|
}
|
|
541
541
|
),
|
|
542
|
-
Array.from({ length: Math.min(5,
|
|
542
|
+
Array.from({ length: Math.min(5, T) }, (e, n) => {
|
|
543
543
|
const t = c < 3 ? n : c - 2 + n;
|
|
544
|
-
return t >=
|
|
544
|
+
return t >= T ? null : /* @__PURE__ */ a(
|
|
545
545
|
b,
|
|
546
546
|
{
|
|
547
547
|
variant: t === c ? "default" : "outline",
|
|
@@ -557,7 +557,7 @@ const $ = C("RefreshCw", [
|
|
|
557
557
|
{
|
|
558
558
|
variant: "outline",
|
|
559
559
|
size: "sm",
|
|
560
|
-
disabled: c ===
|
|
560
|
+
disabled: c === T - 1,
|
|
561
561
|
onClick: () => K?.(c + 1),
|
|
562
562
|
children: "Next"
|
|
563
563
|
}
|
|
@@ -567,8 +567,9 @@ const $ = C("RefreshCw", [
|
|
|
567
567
|
] })
|
|
568
568
|
] });
|
|
569
569
|
});
|
|
570
|
-
|
|
570
|
+
te.displayName = "DataTable";
|
|
571
|
+
const gt = te;
|
|
571
572
|
export {
|
|
572
|
-
|
|
573
|
+
gt as DataTable
|
|
573
574
|
};
|
|
574
575
|
//# sourceMappingURL=data-table.js.map
|