@krosoft/react 0.0.93 → 0.0.95
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/{AppSubTitle-CrQq4gjE.js → AppSubTitle-BpBamEcm.js} +1 -1
- package/dist/{AppTitle-Cdnl1Ep3.js → AppTitle-eMxmvBxB.js} +1 -1
- package/dist/{AppVerticalTabs-tg4OMyaw.js → AppVerticalTabs-CVukFn4d.js} +2 -2
- package/dist/{ConfirmationDialog-ClYOz40y.js → ConfirmationDialog-D7W5xkwQ.js} +1 -1
- package/dist/DataTable-C5t09hPv.js +500 -0
- package/dist/{MetricCard-mB38b3Mw.js → MetricCard-BkOvTc3_.js} +1 -1
- package/dist/{SearchInput-DaMu6Bni.js → SearchInput-Cez8b7gL.js} +1 -1
- package/dist/{TableFilter-Bq5bpUoa.js → TableFilter-ChclLTH1.js} +2 -2
- package/dist/components/core/cards/index.js +1 -1
- package/dist/components/core/dialogs/index.js +2 -2
- package/dist/components/core/filters/index.js +1 -1
- package/dist/components/core/index.js +63 -64
- package/dist/components/core/inputs/index.js +1 -1
- package/dist/components/core/layouts/index.js +2 -2
- package/dist/components/core/table/DataTable.d.ts +1 -1
- package/dist/components/core/table/DataTable.d.ts.map +1 -1
- package/dist/components/core/table/index.js +8 -9
- package/dist/components/core/tabs/index.js +1 -1
- package/dist/components/index.js +283 -284
- package/dist/components/ui/index.js +2 -2
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +4 -2
- package/dist/{toaster-Cjk453ai.js → toaster-DeSyPrhi.js} +1 -1
- package/dist/{toggle-group-5ImQF6h-.js → toggle-group-CrQymn4l.js} +8 -8
- package/dist/useDataTable-CQpx3zTg.js +91 -0
- package/package.json +1 -1
- package/dist/TableSettings-DbTxUWk3.js +0 -383
|
@@ -10525,7 +10525,7 @@ const Gb = f.forwardRef(
|
|
|
10525
10525
|
{
|
|
10526
10526
|
ref: r,
|
|
10527
10527
|
className: I(
|
|
10528
|
-
"fixed left-[50%] top-[50%] z-[70] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
10528
|
+
"fixed left-[50%] top-[50%] z-[70] grid w-full max-w-lg max-h-[95vh] overflow-y-auto translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
10529
10529
|
e
|
|
10530
10530
|
),
|
|
10531
10531
|
...n,
|
|
@@ -20202,13 +20202,13 @@ export {
|
|
|
20202
20202
|
vB as cd,
|
|
20203
20203
|
dB as ce,
|
|
20204
20204
|
Mz as cf,
|
|
20205
|
-
|
|
20206
|
-
|
|
20207
|
-
|
|
20208
|
-
|
|
20209
|
-
|
|
20210
|
-
|
|
20211
|
-
|
|
20205
|
+
Ga as cg,
|
|
20206
|
+
fr as ch,
|
|
20207
|
+
pr as ci,
|
|
20208
|
+
eP as cj,
|
|
20209
|
+
wr as ck,
|
|
20210
|
+
fg as cl,
|
|
20211
|
+
ir as cm,
|
|
20212
20212
|
tI as d,
|
|
20213
20213
|
eI as e,
|
|
20214
20214
|
Hb as f,
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { useState as l, useRef as d, useMemo as S, useCallback as O } from "react";
|
|
2
|
+
function ue({
|
|
3
|
+
data: i,
|
|
4
|
+
columns: o,
|
|
5
|
+
getRowId: j,
|
|
6
|
+
defaultPageSize: q,
|
|
7
|
+
actions: R,
|
|
8
|
+
bulkActions: y,
|
|
9
|
+
columnVisibility: G = !0
|
|
10
|
+
}) {
|
|
11
|
+
var F;
|
|
12
|
+
const [u, H] = l(((F = o.find((e) => e.sortable === !0)) == null ? void 0 : F.key) ?? null), [c, P] = l("asc"), [g, f] = l([]), [h, J] = l(new Set(o.filter((e) => e.defaultVisible !== !1).map((e) => e.key))), [b, N] = l(o.map((e) => e.key)), [w, Q] = l(o.reduce((e, t) => ({ ...e, [t.key]: t.minWidth ?? 100 }), {})), [V, A] = l(1), [m, Y] = l(q), Z = d(null), x = d(null), E = d(0), W = d(0), a = d(null), z = d(null), I = R !== void 0 && R.length > 0, L = y !== void 0 && y.length > 0, M = S(() => b.map((e) => o.find((t) => t.key === e)).filter((e) => e !== void 0), [b, o]), T = S(() => M.filter((e) => h.has(e.key)), [M, h]), _ = T.length + (L ? 1 : 0) + (I || G ? 1 : 0), k = Math.max(1, Math.ceil(i.length / m)), X = V > k ? k : V, p = i.length === 0 ? 0 : (X - 1) * m, D = Math.min(p + m, i.length), $ = (e) => {
|
|
13
|
+
const t = o.find((n) => n.key === e);
|
|
14
|
+
(t == null ? void 0 : t.sortable) === !0 && (u === e ? P(c === "asc" ? "desc" : "asc") : (H(e), P("asc")), A(1));
|
|
15
|
+
}, v = O((e) => {
|
|
16
|
+
const t = x.current;
|
|
17
|
+
if (t === null) return;
|
|
18
|
+
const n = e.clientX - E.current, r = Math.max(80, W.current + n);
|
|
19
|
+
Q((s) => ({
|
|
20
|
+
...s,
|
|
21
|
+
[t]: r
|
|
22
|
+
}));
|
|
23
|
+
}, []), U = O(
|
|
24
|
+
function e() {
|
|
25
|
+
x.current = null, document.removeEventListener("mousemove", v), document.removeEventListener("mouseup", e);
|
|
26
|
+
},
|
|
27
|
+
[v]
|
|
28
|
+
), K = O(
|
|
29
|
+
(e, t) => {
|
|
30
|
+
e.preventDefault(), e.stopPropagation(), x.current = t, E.current = e.clientX, W.current = w[t], document.addEventListener("mousemove", v), document.addEventListener("mouseup", U);
|
|
31
|
+
},
|
|
32
|
+
[w, v, U]
|
|
33
|
+
), ee = (e, t) => {
|
|
34
|
+
a.current = t, e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/html", t);
|
|
35
|
+
}, te = (e, t) => {
|
|
36
|
+
e.preventDefault(), e.dataTransfer.dropEffect = "move", z.current = t;
|
|
37
|
+
}, ne = (e, t) => {
|
|
38
|
+
if (e.preventDefault(), a.current === null || a.current === t) return;
|
|
39
|
+
const n = [...b], r = n.indexOf(a.current), s = n.indexOf(t);
|
|
40
|
+
n.splice(r, 1), n.splice(s, 0, a.current), N(n), a.current = null, z.current = null;
|
|
41
|
+
}, B = S(() => [...i].sort((e, t) => {
|
|
42
|
+
if (u === null) return 0;
|
|
43
|
+
const n = o.find((C) => C.key === u), r = (n == null ? void 0 : n.getSortValue) !== void 0 ? n.getSortValue(e) : e[u], s = (n == null ? void 0 : n.getSortValue) !== void 0 ? n.getSortValue(t) : t[u];
|
|
44
|
+
if (typeof r == "string" && typeof s == "string") {
|
|
45
|
+
const C = r.localeCompare(s);
|
|
46
|
+
return c === "asc" ? C : -C;
|
|
47
|
+
}
|
|
48
|
+
return r === s ? 0 : r == null ? 1 : s == null ? -1 : r < s ? c === "asc" ? -1 : 1 : r > s ? c === "asc" ? 1 : -1 : 0;
|
|
49
|
+
}), [i, u, c, o]), re = S(() => B.slice(p, D), [B, p, D]);
|
|
50
|
+
return {
|
|
51
|
+
sortColumn: u,
|
|
52
|
+
sortDirection: c,
|
|
53
|
+
selectedRows: g,
|
|
54
|
+
setSelectedRows: f,
|
|
55
|
+
visibleColumns: h,
|
|
56
|
+
columnWidths: w,
|
|
57
|
+
currentPage: V,
|
|
58
|
+
setCurrentPage: A,
|
|
59
|
+
pageSize: m,
|
|
60
|
+
setPageSize: Y,
|
|
61
|
+
totalPages: k,
|
|
62
|
+
safeCurrentPage: X,
|
|
63
|
+
startIndex: p,
|
|
64
|
+
endIndex: D,
|
|
65
|
+
tableRef: Z,
|
|
66
|
+
hasActions: I,
|
|
67
|
+
hasBulkActions: L,
|
|
68
|
+
orderedColumns: M,
|
|
69
|
+
visibleColumnsArray: T,
|
|
70
|
+
colSpanCount: _,
|
|
71
|
+
paginatedData: re,
|
|
72
|
+
handleSort: $,
|
|
73
|
+
handleMouseDown: K,
|
|
74
|
+
handleDragStart: ee,
|
|
75
|
+
handleDragOver: te,
|
|
76
|
+
handleDrop: ne,
|
|
77
|
+
toggleColumnVisibility: (e) => {
|
|
78
|
+
const t = new Set(h);
|
|
79
|
+
t.has(e) ? t.delete(e) : t.add(e), J(t);
|
|
80
|
+
},
|
|
81
|
+
toggleRowSelection: (e) => {
|
|
82
|
+
g.includes(e) ? f(g.filter((t) => t !== e)) : f([...g, e]);
|
|
83
|
+
},
|
|
84
|
+
toggleSelectAll: () => {
|
|
85
|
+
g.length === i.length ? f([]) : f(i.map((e) => j(e)));
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
export {
|
|
90
|
+
ue as u
|
|
91
|
+
};
|
package/package.json
CHANGED
|
@@ -1,383 +0,0 @@
|
|
|
1
|
-
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { ar as M, aF as j, at as D, av as A, U as S, cg as L, ch as B, as as I } from "./toggle-group-5ImQF6h-.js";
|
|
3
|
-
import "./card-Bn3Y7DHQ.js";
|
|
4
|
-
import { B as x } from "./tooltip-CAu4DEhc.js";
|
|
5
|
-
import "./select-zzSnHs9S.js";
|
|
6
|
-
import "next-themes";
|
|
7
|
-
import "react";
|
|
8
|
-
import { E as V } from "./ellipsis-vertical-BVxSFNOa.js";
|
|
9
|
-
import { L as q } from "./loader-circle-GAYBtm3z.js";
|
|
10
|
-
import { G as U } from "./grip-vertical-CJ07_87Y.js";
|
|
11
|
-
import { c as f } from "./index-DSyPHOLE.js";
|
|
12
|
-
/**
|
|
13
|
-
* @license lucide-react v1.16.0 - ISC
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the ISC license.
|
|
16
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/
|
|
18
|
-
const E = [
|
|
19
|
-
["path", { d: "M12 5v14", key: "s699le" }],
|
|
20
|
-
["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
|
|
21
|
-
], G = f("arrow-down", E);
|
|
22
|
-
/**
|
|
23
|
-
* @license lucide-react v1.16.0 - ISC
|
|
24
|
-
*
|
|
25
|
-
* This source code is licensed under the ISC license.
|
|
26
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/
|
|
28
|
-
const H = [
|
|
29
|
-
["path", { d: "m21 16-4 4-4-4", key: "f6ql7i" }],
|
|
30
|
-
["path", { d: "M17 20V4", key: "1ejh1v" }],
|
|
31
|
-
["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
|
|
32
|
-
["path", { d: "M7 4v16", key: "1glfcx" }]
|
|
33
|
-
], F = f("arrow-up-down", H);
|
|
34
|
-
/**
|
|
35
|
-
* @license lucide-react v1.16.0 - ISC
|
|
36
|
-
*
|
|
37
|
-
* This source code is licensed under the ISC license.
|
|
38
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
39
|
-
*/
|
|
40
|
-
const O = [
|
|
41
|
-
["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
|
|
42
|
-
["path", { d: "M12 19V5", key: "x0mq9r" }]
|
|
43
|
-
], J = f("arrow-up", O);
|
|
44
|
-
/**
|
|
45
|
-
* @license lucide-react v1.16.0 - ISC
|
|
46
|
-
*
|
|
47
|
-
* This source code is licensed under the ISC license.
|
|
48
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
49
|
-
*/
|
|
50
|
-
const Q = [
|
|
51
|
-
[
|
|
52
|
-
"path",
|
|
53
|
-
{
|
|
54
|
-
d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",
|
|
55
|
-
key: "1i5ecw"
|
|
56
|
-
}
|
|
57
|
-
],
|
|
58
|
-
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
59
|
-
], W = f("settings", Q);
|
|
60
|
-
function X({ actions: l, row: n }) {
|
|
61
|
-
return /* @__PURE__ */ t(M, { children: [
|
|
62
|
-
/* @__PURE__ */ e(j, { asChild: !0, children: /* @__PURE__ */ e(x, { variant: "ghost", size: "icon", className: "h-8 w-8 text-muted-foreground hover:text-foreground", children: /* @__PURE__ */ e(V, { className: "size-4" }) }) }),
|
|
63
|
-
/* @__PURE__ */ e(
|
|
64
|
-
D,
|
|
65
|
-
{
|
|
66
|
-
align: "end",
|
|
67
|
-
onClick: (s) => {
|
|
68
|
-
s.stopPropagation();
|
|
69
|
-
},
|
|
70
|
-
children: l.map((s, a) => {
|
|
71
|
-
const o = s.icon;
|
|
72
|
-
return /* @__PURE__ */ t(
|
|
73
|
-
A,
|
|
74
|
-
{
|
|
75
|
-
onClick: () => {
|
|
76
|
-
s.onClick(n);
|
|
77
|
-
},
|
|
78
|
-
className: s.className,
|
|
79
|
-
children: [
|
|
80
|
-
o !== void 0 && /* @__PURE__ */ e("span", { className: "mr-2 size-4 flex items-center justify-center", children: /* @__PURE__ */ e(o, { className: "size-4" }) }),
|
|
81
|
-
s.label
|
|
82
|
-
]
|
|
83
|
-
},
|
|
84
|
-
a
|
|
85
|
-
);
|
|
86
|
-
})
|
|
87
|
-
}
|
|
88
|
-
)
|
|
89
|
-
] });
|
|
90
|
-
}
|
|
91
|
-
function ie({
|
|
92
|
-
isLoading: l,
|
|
93
|
-
colSpanCount: n,
|
|
94
|
-
noDataMessage: s,
|
|
95
|
-
paginatedData: a,
|
|
96
|
-
getRowId: o,
|
|
97
|
-
onRowClick: c,
|
|
98
|
-
hasBulkActions: u,
|
|
99
|
-
selectedRows: b,
|
|
100
|
-
toggleRowSelection: g,
|
|
101
|
-
visibleColumnsArray: i,
|
|
102
|
-
columnWidths: k,
|
|
103
|
-
hasActions: N,
|
|
104
|
-
actions: v,
|
|
105
|
-
columns: w
|
|
106
|
-
}) {
|
|
107
|
-
const C = (h, m) => {
|
|
108
|
-
const d = w.find((r) => r.key === m);
|
|
109
|
-
if ((d == null ? void 0 : d.renderCell) !== void 0)
|
|
110
|
-
return d.renderCell(h);
|
|
111
|
-
const y = h[m];
|
|
112
|
-
return /* @__PURE__ */ e("span", { className: "text-sm truncate", children: y != null ? String(y) : "-" });
|
|
113
|
-
};
|
|
114
|
-
return l ? /* @__PURE__ */ e("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-800", children: /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: n, className: "py-8 text-center", children: /* @__PURE__ */ t("div", { className: "flex flex-col items-center justify-center gap-2 text-muted-foreground", children: [
|
|
115
|
-
/* @__PURE__ */ e(q, { className: "h-6 w-6 animate-spin text-primary" }),
|
|
116
|
-
/* @__PURE__ */ e("span", { className: "text-sm", children: "Chargement..." })
|
|
117
|
-
] }) }) }) }) : a.length === 0 ? /* @__PURE__ */ e("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-800", children: /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: n, className: "py-8 text-center text-sm text-muted-foreground", children: s }) }) }) : /* @__PURE__ */ e("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-800", children: a.map((h) => {
|
|
118
|
-
const m = o(h);
|
|
119
|
-
return /* @__PURE__ */ t(
|
|
120
|
-
"tr",
|
|
121
|
-
{
|
|
122
|
-
className: `group hover:bg-muted/50 dark:hover:bg-gray-900/50 transition-colors ${c !== void 0 ? "cursor-pointer" : ""}`,
|
|
123
|
-
onClick: () => c == null ? void 0 : c(h),
|
|
124
|
-
children: [
|
|
125
|
-
u ? /* @__PURE__ */ e(
|
|
126
|
-
"td",
|
|
127
|
-
{
|
|
128
|
-
className: "px-4 py-2 w-12",
|
|
129
|
-
onClick: (d) => {
|
|
130
|
-
d.stopPropagation();
|
|
131
|
-
},
|
|
132
|
-
children: /* @__PURE__ */ e(
|
|
133
|
-
S,
|
|
134
|
-
{
|
|
135
|
-
checked: b.includes(m),
|
|
136
|
-
onCheckedChange: () => {
|
|
137
|
-
g(m);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
)
|
|
141
|
-
}
|
|
142
|
-
) : null,
|
|
143
|
-
i.map((d, y) => {
|
|
144
|
-
const r = y === i.length - 1;
|
|
145
|
-
return /* @__PURE__ */ e(
|
|
146
|
-
"td",
|
|
147
|
-
{
|
|
148
|
-
className: `px-2 py-2 border-r border-gray-100 dark:border-gray-800 relative ${r ? "border-r-0" : ""}`,
|
|
149
|
-
style: { width: k[d.key] },
|
|
150
|
-
children: /* @__PURE__ */ e("div", { className: "w-full h-full", children: C(h, d.key) })
|
|
151
|
-
},
|
|
152
|
-
d.key
|
|
153
|
-
);
|
|
154
|
-
}),
|
|
155
|
-
N && v !== void 0 && v.length > 0 ? /* @__PURE__ */ e(
|
|
156
|
-
"td",
|
|
157
|
-
{
|
|
158
|
-
className: "px-2 py-2 w-12 text-end",
|
|
159
|
-
onClick: (d) => {
|
|
160
|
-
d.stopPropagation();
|
|
161
|
-
},
|
|
162
|
-
children: /* @__PURE__ */ e(X, { actions: v, row: h })
|
|
163
|
-
}
|
|
164
|
-
) : null
|
|
165
|
-
]
|
|
166
|
-
},
|
|
167
|
-
m
|
|
168
|
-
);
|
|
169
|
-
}) });
|
|
170
|
-
}
|
|
171
|
-
function de({ selectedRows: l, setSelectedRows: n, bulkActions: s }) {
|
|
172
|
-
return /* @__PURE__ */ t("div", { className: "bg-muted/60 dark:bg-gray-900/60 border border-border px-3 py-1.5 flex items-center justify-between rounded-lg", children: [
|
|
173
|
-
/* @__PURE__ */ t("div", { className: "flex items-center gap-4", children: [
|
|
174
|
-
/* @__PURE__ */ t("span", { className: "text-sm font-medium text-primary ml-1", children: [
|
|
175
|
-
l.length,
|
|
176
|
-
" sélectionné(s)"
|
|
177
|
-
] }),
|
|
178
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: s.map((a, o) => {
|
|
179
|
-
const c = a.icon;
|
|
180
|
-
return /* @__PURE__ */ t(
|
|
181
|
-
x,
|
|
182
|
-
{
|
|
183
|
-
variant: "outline",
|
|
184
|
-
size: "sm",
|
|
185
|
-
onClick: () => {
|
|
186
|
-
a.onClick(l, () => {
|
|
187
|
-
n([]);
|
|
188
|
-
});
|
|
189
|
-
},
|
|
190
|
-
className: `h-7 bg-background shadow-sm text-xs px-2.5 ${a.variant === "destructive" ? "text-destructive border-destructive/30 hover:bg-destructive/10 hover:text-destructive" : "text-foreground"}`,
|
|
191
|
-
children: [
|
|
192
|
-
c !== void 0 && /* @__PURE__ */ e("span", { className: "mr-1.5 flex items-center justify-center", children: /* @__PURE__ */ e(c, { className: "h-3.5 w-3.5" }) }),
|
|
193
|
-
a.label
|
|
194
|
-
]
|
|
195
|
-
},
|
|
196
|
-
o
|
|
197
|
-
);
|
|
198
|
-
}) })
|
|
199
|
-
] }),
|
|
200
|
-
/* @__PURE__ */ e(
|
|
201
|
-
x,
|
|
202
|
-
{
|
|
203
|
-
variant: "ghost",
|
|
204
|
-
size: "sm",
|
|
205
|
-
onClick: () => {
|
|
206
|
-
n([]);
|
|
207
|
-
},
|
|
208
|
-
className: "text-xs text-muted-foreground hover:text-foreground h-7 px-2",
|
|
209
|
-
children: "Désélectionner"
|
|
210
|
-
}
|
|
211
|
-
)
|
|
212
|
-
] });
|
|
213
|
-
}
|
|
214
|
-
function le({
|
|
215
|
-
hasBulkActions: l,
|
|
216
|
-
selectedRows: n,
|
|
217
|
-
totalItems: s,
|
|
218
|
-
toggleSelectAll: a,
|
|
219
|
-
visibleColumnsArray: o,
|
|
220
|
-
draggableColumns: c,
|
|
221
|
-
resizableColumns: u,
|
|
222
|
-
columnWidths: b,
|
|
223
|
-
sortColumn: g,
|
|
224
|
-
sortDirection: i,
|
|
225
|
-
handleSort: k,
|
|
226
|
-
handleDragStart: N,
|
|
227
|
-
handleDragOver: v,
|
|
228
|
-
handleDrop: w,
|
|
229
|
-
handleMouseDown: C,
|
|
230
|
-
hasActions: h,
|
|
231
|
-
settingsNode: m
|
|
232
|
-
}) {
|
|
233
|
-
const d = (r) => r.sortable !== !0 ? null : g === r.key ? i === "asc" ? /* @__PURE__ */ e(J, { className: "size-3.5 text-foreground" }) : /* @__PURE__ */ e(G, { className: "size-3.5 text-foreground" }) : /* @__PURE__ */ e(F, { className: "size-3.5 text-muted-foreground/50 group-hover:text-muted-foreground transition-colors" }), y = (r, T) => {
|
|
234
|
-
const z = T !== !1, _ = r.sortable === !0, $ = g === r.key;
|
|
235
|
-
return /* @__PURE__ */ t(
|
|
236
|
-
"th",
|
|
237
|
-
{
|
|
238
|
-
className: [
|
|
239
|
-
"px-2 py-2 text-left text-sm font-medium text-gray-900 dark:text-gray-100 relative group border-r border-gray-200 dark:border-gray-800",
|
|
240
|
-
_ ? "cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800 select-none" : "",
|
|
241
|
-
$ ? "bg-gray-100/80 dark:bg-gray-800/80" : ""
|
|
242
|
-
].filter(Boolean).join(" "),
|
|
243
|
-
style: { width: b[r.key] },
|
|
244
|
-
draggable: z,
|
|
245
|
-
onClick: () => {
|
|
246
|
-
k(r.key);
|
|
247
|
-
},
|
|
248
|
-
onDragStart: (p) => {
|
|
249
|
-
z ? N(p, r.key) : p.preventDefault();
|
|
250
|
-
},
|
|
251
|
-
onDragOver: (p) => {
|
|
252
|
-
v(p, r.key);
|
|
253
|
-
},
|
|
254
|
-
onDrop: (p) => {
|
|
255
|
-
w(p, r.key);
|
|
256
|
-
},
|
|
257
|
-
children: [
|
|
258
|
-
/* @__PURE__ */ t("div", { className: "flex items-center justify-between pr-2", children: [
|
|
259
|
-
/* @__PURE__ */ t("div", { className: "flex items-center gap-1", children: [
|
|
260
|
-
z ? /* @__PURE__ */ e(U, { className: "size-4 text-gray-400 cursor-grab dark:text-gray-300 shrink-0" }) : null,
|
|
261
|
-
/* @__PURE__ */ e("span", { className: "truncate", children: r.label })
|
|
262
|
-
] }),
|
|
263
|
-
/* @__PURE__ */ e("div", { className: "ml-1 shrink-0", children: d(r) })
|
|
264
|
-
] }),
|
|
265
|
-
u ? /* @__PURE__ */ e(
|
|
266
|
-
"div",
|
|
267
|
-
{
|
|
268
|
-
className: "absolute right-0 top-0 bottom-0 w-2 cursor-col-resize hover:bg-blue-500 opacity-0 group-hover:opacity-50 transition-opacity",
|
|
269
|
-
onMouseDown: (p) => {
|
|
270
|
-
C(p, r.key);
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
) : null
|
|
274
|
-
]
|
|
275
|
-
},
|
|
276
|
-
r.key
|
|
277
|
-
);
|
|
278
|
-
};
|
|
279
|
-
return /* @__PURE__ */ e("thead", { className: "bg-muted/50 dark:bg-gray-900/50 border-b border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ t("tr", { children: [
|
|
280
|
-
l ? /* @__PURE__ */ e("th", { className: "px-4 py-2 w-12 flex-shrink-0 text-left", children: /* @__PURE__ */ e(
|
|
281
|
-
S,
|
|
282
|
-
{
|
|
283
|
-
checked: n.length === s && s > 0 ? !0 : n.length > 0 ? "indeterminate" : !1,
|
|
284
|
-
onCheckedChange: a
|
|
285
|
-
}
|
|
286
|
-
) }) : null,
|
|
287
|
-
o.map((r) => y(r, c)),
|
|
288
|
-
h || m !== void 0 ? /* @__PURE__ */ e("th", { className: "w-12 px-2 py-2 text-center align-middle", children: m }) : null
|
|
289
|
-
] }) });
|
|
290
|
-
}
|
|
291
|
-
function ce({
|
|
292
|
-
totalItems: l,
|
|
293
|
-
startIndex: n,
|
|
294
|
-
endIndex: s,
|
|
295
|
-
pageSize: a,
|
|
296
|
-
setPageSize: o,
|
|
297
|
-
currentPage: c,
|
|
298
|
-
setCurrentPage: u,
|
|
299
|
-
pageSizeOptions: b,
|
|
300
|
-
totalPages: g
|
|
301
|
-
}) {
|
|
302
|
-
return /* @__PURE__ */ t("div", { className: "px-4 py-2 border-t border-border flex items-center justify-between bg-card flex-wrap gap-2", children: [
|
|
303
|
-
/* @__PURE__ */ t("div", { className: "text-sm text-muted-foreground", children: [
|
|
304
|
-
l === 0 ? "0" : `${String(n + 1)} - ${String(s)}`,
|
|
305
|
-
" sur ",
|
|
306
|
-
l
|
|
307
|
-
] }),
|
|
308
|
-
/* @__PURE__ */ t("div", { className: "flex items-center gap-4", children: [
|
|
309
|
-
/* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
|
|
310
|
-
/* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: "Lignes par page :" }),
|
|
311
|
-
/* @__PURE__ */ e(
|
|
312
|
-
"select",
|
|
313
|
-
{
|
|
314
|
-
value: a,
|
|
315
|
-
onChange: (i) => {
|
|
316
|
-
o(Number(i.target.value)), u(1);
|
|
317
|
-
},
|
|
318
|
-
className: "border border-input bg-background rounded px-2 py-1 text-sm text-foreground",
|
|
319
|
-
children: b.map((i) => /* @__PURE__ */ e("option", { value: i, children: i }, i))
|
|
320
|
-
}
|
|
321
|
-
)
|
|
322
|
-
] }),
|
|
323
|
-
/* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
|
|
324
|
-
/* @__PURE__ */ e(
|
|
325
|
-
x,
|
|
326
|
-
{
|
|
327
|
-
variant: "outline",
|
|
328
|
-
size: "sm",
|
|
329
|
-
className: "h-8 w-8 p-0",
|
|
330
|
-
onClick: () => {
|
|
331
|
-
u((i) => Math.max(1, i - 1));
|
|
332
|
-
},
|
|
333
|
-
disabled: c === 1,
|
|
334
|
-
children: /* @__PURE__ */ e(L, { className: "size-4" })
|
|
335
|
-
}
|
|
336
|
-
),
|
|
337
|
-
/* @__PURE__ */ t("span", { className: "text-sm text-muted-foreground", children: [
|
|
338
|
-
"Page ",
|
|
339
|
-
c,
|
|
340
|
-
" sur ",
|
|
341
|
-
g
|
|
342
|
-
] }),
|
|
343
|
-
/* @__PURE__ */ e(
|
|
344
|
-
x,
|
|
345
|
-
{
|
|
346
|
-
variant: "outline",
|
|
347
|
-
size: "sm",
|
|
348
|
-
className: "h-8 w-8 p-0",
|
|
349
|
-
onClick: () => {
|
|
350
|
-
u((i) => Math.min(g, i + 1));
|
|
351
|
-
},
|
|
352
|
-
disabled: c === g,
|
|
353
|
-
children: /* @__PURE__ */ e(B, { className: "size-4" })
|
|
354
|
-
}
|
|
355
|
-
)
|
|
356
|
-
] })
|
|
357
|
-
] })
|
|
358
|
-
] });
|
|
359
|
-
}
|
|
360
|
-
function oe({ columns: l, visibleColumns: n, toggleColumnVisibility: s }) {
|
|
361
|
-
return /* @__PURE__ */ t(M, { children: [
|
|
362
|
-
/* @__PURE__ */ e(j, { asChild: !0, children: /* @__PURE__ */ e(x, { variant: "outline", size: "sm", className: "size-8 p-0 bg-white hover:bg-gray-100 dark:bg-gray-900 shadow-sm border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ e(W, { className: "size-4 text-gray-600 dark:text-gray-300" }) }) }),
|
|
363
|
-
/* @__PURE__ */ e(D, { align: "end", className: "w-56", children: l.map((a) => /* @__PURE__ */ e(
|
|
364
|
-
I,
|
|
365
|
-
{
|
|
366
|
-
checked: n.has(a.key),
|
|
367
|
-
onCheckedChange: () => {
|
|
368
|
-
s(a.key);
|
|
369
|
-
},
|
|
370
|
-
children: a.label
|
|
371
|
-
},
|
|
372
|
-
a.key
|
|
373
|
-
)) })
|
|
374
|
-
] });
|
|
375
|
-
}
|
|
376
|
-
export {
|
|
377
|
-
X as T,
|
|
378
|
-
ie as a,
|
|
379
|
-
de as b,
|
|
380
|
-
le as c,
|
|
381
|
-
ce as d,
|
|
382
|
-
oe as e
|
|
383
|
-
};
|