@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as l } from "react-i18next";
|
|
3
|
-
import { A as m } from "./AppTitle-
|
|
3
|
+
import { A as m } from "./AppTitle-eMxmvBxB.js";
|
|
4
4
|
function f({ titleKey: s, actions: t, className: o }) {
|
|
5
5
|
const { t: r } = l();
|
|
6
6
|
return /* @__PURE__ */ i("div", { className: "flex flex-col sm:flex-row sm:items-center justify-between gap-4", children: [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as n, jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import { ar as c, aF as b, at as f, aA as h, av as u } from "./toggle-group-
|
|
2
|
+
import { ar as c, aF as b, at as f, aA as h, av as u } from "./toggle-group-CrQymn4l.js";
|
|
3
3
|
import "./card-Bn3Y7DHQ.js";
|
|
4
4
|
import { c as m } from "./index-gWiv5-6R.js";
|
|
5
5
|
import { B as p } from "./tooltip-CAu4DEhc.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as n, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { C as v, f as g, c as y } from "./card-Bn3Y7DHQ.js";
|
|
3
|
-
import { a as N, A as w } from "./AppTitle-
|
|
4
|
-
import { bR as T, bT as b, bU as S, bS as C, bu as k } from "./toggle-group-
|
|
3
|
+
import { a as N, A as w } from "./AppTitle-eMxmvBxB.js";
|
|
4
|
+
import { bR as T, bT as b, bU as S, bS as C, bu as k } from "./toggle-group-CrQymn4l.js";
|
|
5
5
|
import { useTranslation as x } from "react-i18next";
|
|
6
6
|
import { useSearchParams as f } from "react-router-dom";
|
|
7
7
|
import { c as A } from "./index-gWiv5-6R.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e, jsxs as i, Fragment as U } from "react/jsx-runtime";
|
|
2
|
-
import { D as Y, b as Z, P as L, e as ee, h as re, c as le, aV as ie, aQ as ae, m as q, p as J, s as S, t as W, q as F, r as B, o as Q, u as te, n as ne } from "./toggle-group-
|
|
2
|
+
import { D as Y, b as Z, P as L, e as ee, h as re, c as le, aV as ie, aQ as ae, m as q, p as J, s as S, t as W, q as F, r as B, o as Q, u as te, n as ne } from "./toggle-group-CrQymn4l.js";
|
|
3
3
|
import { A as se, a as oe } from "./card-Bn3Y7DHQ.js";
|
|
4
4
|
import { B as k } from "./tooltip-CAu4DEhc.js";
|
|
5
5
|
import { X as $ } from "./select-zzSnHs9S.js";
|
|
@@ -0,0 +1,500 @@
|
|
|
1
|
+
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { u as X } from "./useDataTable-CQpx3zTg.js";
|
|
3
|
+
import { ar as A, aF as I, at as _, av as Y, U as $, cl as Z, cm as K, as as R } from "./toggle-group-CrQymn4l.js";
|
|
4
|
+
import "./card-Bn3Y7DHQ.js";
|
|
5
|
+
import { B as v } from "./tooltip-CAu4DEhc.js";
|
|
6
|
+
import "./select-zzSnHs9S.js";
|
|
7
|
+
import "next-themes";
|
|
8
|
+
import "react";
|
|
9
|
+
import { E as ee } from "./ellipsis-vertical-BVxSFNOa.js";
|
|
10
|
+
import { L as re } from "./loader-circle-GAYBtm3z.js";
|
|
11
|
+
import { G as ae } from "./grip-vertical-CJ07_87Y.js";
|
|
12
|
+
import { c as z } from "./index-DSyPHOLE.js";
|
|
13
|
+
/**
|
|
14
|
+
* @license lucide-react v1.16.0 - ISC
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the ISC license.
|
|
17
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/
|
|
19
|
+
const te = [
|
|
20
|
+
["path", { d: "M12 5v14", key: "s699le" }],
|
|
21
|
+
["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
|
|
22
|
+
], se = z("arrow-down", te);
|
|
23
|
+
/**
|
|
24
|
+
* @license lucide-react v1.16.0 - ISC
|
|
25
|
+
*
|
|
26
|
+
* This source code is licensed under the ISC license.
|
|
27
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
28
|
+
*/
|
|
29
|
+
const ne = [
|
|
30
|
+
["path", { d: "m21 16-4 4-4-4", key: "f6ql7i" }],
|
|
31
|
+
["path", { d: "M17 20V4", key: "1ejh1v" }],
|
|
32
|
+
["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
|
|
33
|
+
["path", { d: "M7 4v16", key: "1glfcx" }]
|
|
34
|
+
], ie = z("arrow-up-down", ne);
|
|
35
|
+
/**
|
|
36
|
+
* @license lucide-react v1.16.0 - ISC
|
|
37
|
+
*
|
|
38
|
+
* This source code is licensed under the ISC license.
|
|
39
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
40
|
+
*/
|
|
41
|
+
const de = [
|
|
42
|
+
["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
|
|
43
|
+
["path", { d: "M12 19V5", key: "x0mq9r" }]
|
|
44
|
+
], le = z("arrow-up", de);
|
|
45
|
+
/**
|
|
46
|
+
* @license lucide-react v1.16.0 - ISC
|
|
47
|
+
*
|
|
48
|
+
* This source code is licensed under the ISC license.
|
|
49
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
50
|
+
*/
|
|
51
|
+
const oe = [
|
|
52
|
+
[
|
|
53
|
+
"path",
|
|
54
|
+
{
|
|
55
|
+
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",
|
|
56
|
+
key: "1i5ecw"
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
60
|
+
], ce = z("settings", oe), P = [5, 10, 30, 50, 100], he = P[1];
|
|
61
|
+
function ge({ actions: d, row: n }) {
|
|
62
|
+
return /* @__PURE__ */ a(A, { children: [
|
|
63
|
+
/* @__PURE__ */ e(I, { asChild: !0, children: /* @__PURE__ */ e(v, { variant: "ghost", size: "icon", className: "h-8 w-8 text-muted-foreground hover:text-foreground", children: /* @__PURE__ */ e(ee, { className: "size-4" }) }) }),
|
|
64
|
+
/* @__PURE__ */ e(
|
|
65
|
+
_,
|
|
66
|
+
{
|
|
67
|
+
align: "end",
|
|
68
|
+
onClick: (t) => {
|
|
69
|
+
t.stopPropagation();
|
|
70
|
+
},
|
|
71
|
+
children: d.map((t, s) => {
|
|
72
|
+
const h = t.icon;
|
|
73
|
+
return /* @__PURE__ */ a(
|
|
74
|
+
Y,
|
|
75
|
+
{
|
|
76
|
+
onClick: () => {
|
|
77
|
+
t.onClick(n);
|
|
78
|
+
},
|
|
79
|
+
className: t.className,
|
|
80
|
+
children: [
|
|
81
|
+
h !== void 0 && /* @__PURE__ */ e("span", { className: "mr-2 size-4 flex items-center justify-center", children: /* @__PURE__ */ e(h, { className: "size-4" }) }),
|
|
82
|
+
t.label
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
s
|
|
86
|
+
);
|
|
87
|
+
})
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
] });
|
|
91
|
+
}
|
|
92
|
+
function me({
|
|
93
|
+
isLoading: d,
|
|
94
|
+
colSpanCount: n,
|
|
95
|
+
noDataMessage: t,
|
|
96
|
+
paginatedData: s,
|
|
97
|
+
getRowId: h,
|
|
98
|
+
onRowClick: i,
|
|
99
|
+
hasBulkActions: y,
|
|
100
|
+
selectedRows: x,
|
|
101
|
+
toggleRowSelection: g,
|
|
102
|
+
visibleColumnsArray: l,
|
|
103
|
+
columnWidths: b,
|
|
104
|
+
hasActions: N,
|
|
105
|
+
actions: f,
|
|
106
|
+
columns: k
|
|
107
|
+
}) {
|
|
108
|
+
const w = (c, m) => {
|
|
109
|
+
const o = k.find((r) => r.key === m);
|
|
110
|
+
if ((o == null ? void 0 : o.renderCell) !== void 0)
|
|
111
|
+
return o.renderCell(c);
|
|
112
|
+
const p = c[m];
|
|
113
|
+
return /* @__PURE__ */ e("span", { className: "text-sm truncate", children: p != null ? String(p) : "-" });
|
|
114
|
+
};
|
|
115
|
+
return d ? /* @__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__ */ a("div", { className: "flex flex-col items-center justify-center gap-2 text-muted-foreground", children: [
|
|
116
|
+
/* @__PURE__ */ e(re, { className: "h-6 w-6 animate-spin text-primary" }),
|
|
117
|
+
/* @__PURE__ */ e("span", { className: "text-sm", children: "Chargement..." })
|
|
118
|
+
] }) }) }) }) : s.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: t }) }) }) : /* @__PURE__ */ e("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-800", children: s.map((c) => {
|
|
119
|
+
const m = h(c);
|
|
120
|
+
return /* @__PURE__ */ a(
|
|
121
|
+
"tr",
|
|
122
|
+
{
|
|
123
|
+
className: `group hover:bg-muted/50 dark:hover:bg-gray-900/50 transition-colors ${i !== void 0 ? "cursor-pointer" : ""}`,
|
|
124
|
+
onClick: () => i == null ? void 0 : i(c),
|
|
125
|
+
children: [
|
|
126
|
+
y ? /* @__PURE__ */ e(
|
|
127
|
+
"td",
|
|
128
|
+
{
|
|
129
|
+
className: "px-4 py-2 w-12",
|
|
130
|
+
onClick: (o) => {
|
|
131
|
+
o.stopPropagation();
|
|
132
|
+
},
|
|
133
|
+
children: /* @__PURE__ */ e(
|
|
134
|
+
$,
|
|
135
|
+
{
|
|
136
|
+
checked: x.includes(m),
|
|
137
|
+
onCheckedChange: () => {
|
|
138
|
+
g(m);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
)
|
|
142
|
+
}
|
|
143
|
+
) : null,
|
|
144
|
+
l.map((o, p) => {
|
|
145
|
+
const r = p === l.length - 1;
|
|
146
|
+
return /* @__PURE__ */ e(
|
|
147
|
+
"td",
|
|
148
|
+
{
|
|
149
|
+
className: `px-2 py-2 border-r border-gray-100 dark:border-gray-800 relative ${r ? "border-r-0" : ""}`,
|
|
150
|
+
style: { width: b[o.key] },
|
|
151
|
+
children: /* @__PURE__ */ e("div", { className: "w-full h-full", children: w(c, o.key) })
|
|
152
|
+
},
|
|
153
|
+
o.key
|
|
154
|
+
);
|
|
155
|
+
}),
|
|
156
|
+
N && f !== void 0 && f.length > 0 ? /* @__PURE__ */ e(
|
|
157
|
+
"td",
|
|
158
|
+
{
|
|
159
|
+
className: "px-2 py-2 w-12 text-end",
|
|
160
|
+
onClick: (o) => {
|
|
161
|
+
o.stopPropagation();
|
|
162
|
+
},
|
|
163
|
+
children: /* @__PURE__ */ e(ge, { actions: f, row: c })
|
|
164
|
+
}
|
|
165
|
+
) : null
|
|
166
|
+
]
|
|
167
|
+
},
|
|
168
|
+
m
|
|
169
|
+
);
|
|
170
|
+
}) });
|
|
171
|
+
}
|
|
172
|
+
function ue({ selectedRows: d, setSelectedRows: n, bulkActions: t }) {
|
|
173
|
+
return /* @__PURE__ */ a("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: [
|
|
174
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-4", children: [
|
|
175
|
+
/* @__PURE__ */ a("span", { className: "text-sm font-medium text-primary ml-1", children: [
|
|
176
|
+
d.length,
|
|
177
|
+
" sélectionné(s)"
|
|
178
|
+
] }),
|
|
179
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: t.map((s, h) => {
|
|
180
|
+
const i = s.icon;
|
|
181
|
+
return /* @__PURE__ */ a(
|
|
182
|
+
v,
|
|
183
|
+
{
|
|
184
|
+
variant: "outline",
|
|
185
|
+
size: "sm",
|
|
186
|
+
onClick: () => {
|
|
187
|
+
s.onClick(d, () => {
|
|
188
|
+
n([]);
|
|
189
|
+
});
|
|
190
|
+
},
|
|
191
|
+
className: `h-7 bg-background shadow-sm text-xs px-2.5 ${s.variant === "destructive" ? "text-destructive border-destructive/30 hover:bg-destructive/10 hover:text-destructive" : "text-foreground"}`,
|
|
192
|
+
children: [
|
|
193
|
+
i !== void 0 && /* @__PURE__ */ e("span", { className: "mr-1.5 flex items-center justify-center", children: /* @__PURE__ */ e(i, { className: "h-3.5 w-3.5" }) }),
|
|
194
|
+
s.label
|
|
195
|
+
]
|
|
196
|
+
},
|
|
197
|
+
h
|
|
198
|
+
);
|
|
199
|
+
}) })
|
|
200
|
+
] }),
|
|
201
|
+
/* @__PURE__ */ e(
|
|
202
|
+
v,
|
|
203
|
+
{
|
|
204
|
+
variant: "ghost",
|
|
205
|
+
size: "sm",
|
|
206
|
+
onClick: () => {
|
|
207
|
+
n([]);
|
|
208
|
+
},
|
|
209
|
+
className: "text-xs text-muted-foreground hover:text-foreground h-7 px-2",
|
|
210
|
+
children: "Désélectionner"
|
|
211
|
+
}
|
|
212
|
+
)
|
|
213
|
+
] });
|
|
214
|
+
}
|
|
215
|
+
function pe({
|
|
216
|
+
hasBulkActions: d,
|
|
217
|
+
selectedRows: n,
|
|
218
|
+
totalItems: t,
|
|
219
|
+
toggleSelectAll: s,
|
|
220
|
+
visibleColumnsArray: h,
|
|
221
|
+
draggableColumns: i,
|
|
222
|
+
resizableColumns: y,
|
|
223
|
+
columnWidths: x,
|
|
224
|
+
sortColumn: g,
|
|
225
|
+
sortDirection: l,
|
|
226
|
+
handleSort: b,
|
|
227
|
+
handleDragStart: N,
|
|
228
|
+
handleDragOver: f,
|
|
229
|
+
handleDrop: k,
|
|
230
|
+
handleMouseDown: w,
|
|
231
|
+
hasActions: c,
|
|
232
|
+
settingsNode: m
|
|
233
|
+
}) {
|
|
234
|
+
const o = (r) => r.sortable !== !0 ? null : g === r.key ? l === "asc" ? /* @__PURE__ */ e(le, { className: "size-3.5 text-foreground" }) : /* @__PURE__ */ e(se, { className: "size-3.5 text-foreground" }) : /* @__PURE__ */ e(ie, { className: "size-3.5 text-muted-foreground/50 group-hover:text-muted-foreground transition-colors" }), p = (r, S) => {
|
|
235
|
+
const C = S !== !1, D = r.sortable === !0, M = g === r.key;
|
|
236
|
+
return /* @__PURE__ */ a(
|
|
237
|
+
"th",
|
|
238
|
+
{
|
|
239
|
+
className: [
|
|
240
|
+
"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",
|
|
241
|
+
D ? "cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800 select-none" : "",
|
|
242
|
+
M ? "bg-gray-100/80 dark:bg-gray-800/80" : ""
|
|
243
|
+
].filter(Boolean).join(" "),
|
|
244
|
+
style: { width: x[r.key] },
|
|
245
|
+
draggable: C,
|
|
246
|
+
onClick: () => {
|
|
247
|
+
b(r.key);
|
|
248
|
+
},
|
|
249
|
+
onDragStart: (u) => {
|
|
250
|
+
C ? N(u, r.key) : u.preventDefault();
|
|
251
|
+
},
|
|
252
|
+
onDragOver: (u) => {
|
|
253
|
+
f(u, r.key);
|
|
254
|
+
},
|
|
255
|
+
onDrop: (u) => {
|
|
256
|
+
k(u, r.key);
|
|
257
|
+
},
|
|
258
|
+
children: [
|
|
259
|
+
/* @__PURE__ */ a("div", { className: "flex items-center justify-between pr-2", children: [
|
|
260
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
|
|
261
|
+
C ? /* @__PURE__ */ e(ae, { className: "size-4 text-gray-400 cursor-grab dark:text-gray-300 shrink-0" }) : null,
|
|
262
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: r.label })
|
|
263
|
+
] }),
|
|
264
|
+
/* @__PURE__ */ e("div", { className: "ml-1 shrink-0", children: o(r) })
|
|
265
|
+
] }),
|
|
266
|
+
y ? /* @__PURE__ */ e(
|
|
267
|
+
"div",
|
|
268
|
+
{
|
|
269
|
+
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",
|
|
270
|
+
onMouseDown: (u) => {
|
|
271
|
+
w(u, r.key);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
) : null
|
|
275
|
+
]
|
|
276
|
+
},
|
|
277
|
+
r.key
|
|
278
|
+
);
|
|
279
|
+
};
|
|
280
|
+
return /* @__PURE__ */ e("thead", { className: "bg-muted/50 dark:bg-gray-900/50 border-b border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ a("tr", { children: [
|
|
281
|
+
d ? /* @__PURE__ */ e("th", { className: "px-4 py-2 w-12 flex-shrink-0 text-left", children: /* @__PURE__ */ e(
|
|
282
|
+
$,
|
|
283
|
+
{
|
|
284
|
+
checked: n.length === t && t > 0 ? !0 : n.length > 0 ? "indeterminate" : !1,
|
|
285
|
+
onCheckedChange: s
|
|
286
|
+
}
|
|
287
|
+
) }) : null,
|
|
288
|
+
h.map((r) => p(r, i)),
|
|
289
|
+
c || m !== void 0 ? /* @__PURE__ */ e("th", { className: "w-12 px-2 py-2 text-center align-middle", children: m }) : null
|
|
290
|
+
] }) });
|
|
291
|
+
}
|
|
292
|
+
function ye({
|
|
293
|
+
totalItems: d,
|
|
294
|
+
startIndex: n,
|
|
295
|
+
endIndex: t,
|
|
296
|
+
pageSize: s,
|
|
297
|
+
setPageSize: h,
|
|
298
|
+
currentPage: i,
|
|
299
|
+
setCurrentPage: y,
|
|
300
|
+
pageSizeOptions: x,
|
|
301
|
+
totalPages: g
|
|
302
|
+
}) {
|
|
303
|
+
return /* @__PURE__ */ a("div", { className: "px-4 py-2 border-t border-border flex items-center justify-between bg-card flex-wrap gap-2", children: [
|
|
304
|
+
/* @__PURE__ */ a("div", { className: "text-sm text-muted-foreground", children: [
|
|
305
|
+
d === 0 ? "0" : `${String(n + 1)} - ${String(t)}`,
|
|
306
|
+
" sur ",
|
|
307
|
+
d
|
|
308
|
+
] }),
|
|
309
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-4", children: [
|
|
310
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
311
|
+
/* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: "Lignes par page :" }),
|
|
312
|
+
/* @__PURE__ */ e(
|
|
313
|
+
"select",
|
|
314
|
+
{
|
|
315
|
+
value: s,
|
|
316
|
+
onChange: (l) => {
|
|
317
|
+
h(Number(l.target.value)), y(1);
|
|
318
|
+
},
|
|
319
|
+
className: "border border-input bg-background rounded px-2 py-1 text-sm text-foreground",
|
|
320
|
+
children: x.map((l) => /* @__PURE__ */ e("option", { value: l, children: l }, l))
|
|
321
|
+
}
|
|
322
|
+
)
|
|
323
|
+
] }),
|
|
324
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
325
|
+
/* @__PURE__ */ e(
|
|
326
|
+
v,
|
|
327
|
+
{
|
|
328
|
+
variant: "outline",
|
|
329
|
+
size: "sm",
|
|
330
|
+
className: "h-8 w-8 p-0",
|
|
331
|
+
onClick: () => {
|
|
332
|
+
y((l) => Math.max(1, l - 1));
|
|
333
|
+
},
|
|
334
|
+
disabled: i === 1,
|
|
335
|
+
children: /* @__PURE__ */ e(Z, { className: "size-4" })
|
|
336
|
+
}
|
|
337
|
+
),
|
|
338
|
+
/* @__PURE__ */ a("span", { className: "text-sm text-muted-foreground", children: [
|
|
339
|
+
"Page ",
|
|
340
|
+
i,
|
|
341
|
+
" sur ",
|
|
342
|
+
g
|
|
343
|
+
] }),
|
|
344
|
+
/* @__PURE__ */ e(
|
|
345
|
+
v,
|
|
346
|
+
{
|
|
347
|
+
variant: "outline",
|
|
348
|
+
size: "sm",
|
|
349
|
+
className: "h-8 w-8 p-0",
|
|
350
|
+
onClick: () => {
|
|
351
|
+
y((l) => Math.min(g, l + 1));
|
|
352
|
+
},
|
|
353
|
+
disabled: i === g,
|
|
354
|
+
children: /* @__PURE__ */ e(K, { className: "size-4" })
|
|
355
|
+
}
|
|
356
|
+
)
|
|
357
|
+
] })
|
|
358
|
+
] })
|
|
359
|
+
] });
|
|
360
|
+
}
|
|
361
|
+
function xe({ columns: d, visibleColumns: n, toggleColumnVisibility: t }) {
|
|
362
|
+
return /* @__PURE__ */ a(A, { children: [
|
|
363
|
+
/* @__PURE__ */ e(I, { asChild: !0, children: /* @__PURE__ */ e(v, { 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(ce, { className: "size-4 text-gray-600 dark:text-gray-300" }) }) }),
|
|
364
|
+
/* @__PURE__ */ e(_, { align: "end", className: "w-56", children: d.map((s) => /* @__PURE__ */ e(
|
|
365
|
+
R,
|
|
366
|
+
{
|
|
367
|
+
checked: n.has(s.key),
|
|
368
|
+
onCheckedChange: () => {
|
|
369
|
+
t(s.key);
|
|
370
|
+
},
|
|
371
|
+
children: s.label
|
|
372
|
+
},
|
|
373
|
+
s.key
|
|
374
|
+
)) })
|
|
375
|
+
] });
|
|
376
|
+
}
|
|
377
|
+
function Te({
|
|
378
|
+
data: d,
|
|
379
|
+
columns: n,
|
|
380
|
+
getRowId: t,
|
|
381
|
+
onRowClick: s,
|
|
382
|
+
actions: h,
|
|
383
|
+
bulkActions: i,
|
|
384
|
+
draggableColumns: y = !0,
|
|
385
|
+
resizableColumns: x = !0,
|
|
386
|
+
columnVisibility: g = !0,
|
|
387
|
+
isLoading: l = !1,
|
|
388
|
+
noDataMessage: b = "Aucun résultat",
|
|
389
|
+
defaultPageSize: N = he,
|
|
390
|
+
pageSizeOptions: f = P
|
|
391
|
+
}) {
|
|
392
|
+
const {
|
|
393
|
+
sortColumn: k,
|
|
394
|
+
sortDirection: w,
|
|
395
|
+
selectedRows: c,
|
|
396
|
+
setSelectedRows: m,
|
|
397
|
+
visibleColumns: o,
|
|
398
|
+
columnWidths: p,
|
|
399
|
+
safeCurrentPage: r,
|
|
400
|
+
totalPages: S,
|
|
401
|
+
startIndex: C,
|
|
402
|
+
endIndex: D,
|
|
403
|
+
tableRef: M,
|
|
404
|
+
hasActions: u,
|
|
405
|
+
hasBulkActions: j,
|
|
406
|
+
visibleColumnsArray: T,
|
|
407
|
+
colSpanCount: B,
|
|
408
|
+
paginatedData: L,
|
|
409
|
+
handleSort: V,
|
|
410
|
+
handleMouseDown: q,
|
|
411
|
+
handleDragStart: U,
|
|
412
|
+
handleDragOver: E,
|
|
413
|
+
handleDrop: G,
|
|
414
|
+
toggleColumnVisibility: H,
|
|
415
|
+
toggleRowSelection: O,
|
|
416
|
+
toggleSelectAll: F,
|
|
417
|
+
pageSize: W,
|
|
418
|
+
setPageSize: J,
|
|
419
|
+
setCurrentPage: Q
|
|
420
|
+
} = X({
|
|
421
|
+
data: d,
|
|
422
|
+
columns: n,
|
|
423
|
+
getRowId: t,
|
|
424
|
+
defaultPageSize: N,
|
|
425
|
+
actions: h,
|
|
426
|
+
bulkActions: i,
|
|
427
|
+
columnVisibility: g
|
|
428
|
+
});
|
|
429
|
+
return /* @__PURE__ */ a("div", { className: "space-y-4", children: [
|
|
430
|
+
c.length > 0 && i !== void 0 && i.length > 0 && /* @__PURE__ */ e(ue, { selectedRows: c, setSelectedRows: m, bulkActions: i }),
|
|
431
|
+
/* @__PURE__ */ a("div", { className: "w-full bg-card dark:bg-gray-950 rounded-md border border-gray-200 dark:border-gray-800 overflow-hidden", children: [
|
|
432
|
+
/* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */ a("table", { ref: M, className: "w-full", children: [
|
|
433
|
+
/* @__PURE__ */ e(
|
|
434
|
+
pe,
|
|
435
|
+
{
|
|
436
|
+
hasBulkActions: j,
|
|
437
|
+
selectedRows: c,
|
|
438
|
+
totalItems: d.length,
|
|
439
|
+
toggleSelectAll: F,
|
|
440
|
+
visibleColumnsArray: T,
|
|
441
|
+
draggableColumns: y,
|
|
442
|
+
resizableColumns: x,
|
|
443
|
+
columnWidths: p,
|
|
444
|
+
sortColumn: k,
|
|
445
|
+
sortDirection: w,
|
|
446
|
+
handleSort: V,
|
|
447
|
+
handleDragStart: U,
|
|
448
|
+
handleDragOver: E,
|
|
449
|
+
handleDrop: G,
|
|
450
|
+
handleMouseDown: q,
|
|
451
|
+
hasActions: u,
|
|
452
|
+
settingsNode: g ? /* @__PURE__ */ e(xe, { columns: n, visibleColumns: o, toggleColumnVisibility: H }) : void 0
|
|
453
|
+
}
|
|
454
|
+
),
|
|
455
|
+
/* @__PURE__ */ e(
|
|
456
|
+
me,
|
|
457
|
+
{
|
|
458
|
+
isLoading: l,
|
|
459
|
+
colSpanCount: B,
|
|
460
|
+
noDataMessage: b,
|
|
461
|
+
paginatedData: L,
|
|
462
|
+
getRowId: t,
|
|
463
|
+
onRowClick: s,
|
|
464
|
+
hasBulkActions: j,
|
|
465
|
+
selectedRows: c,
|
|
466
|
+
toggleRowSelection: O,
|
|
467
|
+
visibleColumnsArray: T,
|
|
468
|
+
columnWidths: p,
|
|
469
|
+
hasActions: u,
|
|
470
|
+
actions: h,
|
|
471
|
+
columns: n
|
|
472
|
+
}
|
|
473
|
+
)
|
|
474
|
+
] }) }),
|
|
475
|
+
/* @__PURE__ */ e(
|
|
476
|
+
ye,
|
|
477
|
+
{
|
|
478
|
+
totalItems: d.length,
|
|
479
|
+
startIndex: C,
|
|
480
|
+
endIndex: D,
|
|
481
|
+
pageSize: W,
|
|
482
|
+
setPageSize: J,
|
|
483
|
+
currentPage: r,
|
|
484
|
+
setCurrentPage: Q,
|
|
485
|
+
pageSizeOptions: f,
|
|
486
|
+
totalPages: S
|
|
487
|
+
}
|
|
488
|
+
)
|
|
489
|
+
] })
|
|
490
|
+
] });
|
|
491
|
+
}
|
|
492
|
+
export {
|
|
493
|
+
Te as D,
|
|
494
|
+
ge as T,
|
|
495
|
+
me as a,
|
|
496
|
+
ue as b,
|
|
497
|
+
pe as c,
|
|
498
|
+
ye as d,
|
|
499
|
+
xe as e
|
|
500
|
+
};
|
|
@@ -2,7 +2,7 @@ import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
|
2
2
|
import { formatNumber as h } from "@krosoft/core/helpers";
|
|
3
3
|
import { useTranslation as b } from "react-i18next";
|
|
4
4
|
import { c as d } from "./index-gWiv5-6R.js";
|
|
5
|
-
import "./toggle-group-
|
|
5
|
+
import "./toggle-group-CrQymn4l.js";
|
|
6
6
|
import { C as u, f as N, g as x, c as f } from "./card-Bn3Y7DHQ.js";
|
|
7
7
|
import "./tooltip-CAu4DEhc.js";
|
|
8
8
|
import "./select-zzSnHs9S.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as d, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import * as L from "react";
|
|
3
3
|
import { useState as P, useRef as j, useEffect as T, useMemo as z } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { cg as D, ch as C, ci as k, cj as q, ck as S, H as R, bp as F, br as X, bq as V, c8 as E, U as O, aQ as _ } from "./toggle-group-CrQymn4l.js";
|
|
5
5
|
import "./card-Bn3Y7DHQ.js";
|
|
6
6
|
import { c as b } from "./index-gWiv5-6R.js";
|
|
7
7
|
import { B as y, C as A } from "./tooltip-CAu4DEhc.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as p, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useState as k, useEffect as M, useMemo as A } from "react";
|
|
3
|
-
import { M as O, a as $, D as z, b as _, S as j } from "./SearchInput-
|
|
4
|
-
import { aQ as C, bx as B, bG as I, bz as Q, bC as R, bF as V, aV as H, bB as G, bp as U, br as X, bq as J, c8 as K, U as P } from "./toggle-group-
|
|
3
|
+
import { M as O, a as $, D as z, b as _, S as j } from "./SearchInput-Cez8b7gL.js";
|
|
4
|
+
import { aQ as C, bx as B, bG as I, bz as Q, bC as R, bF as V, aV as H, bB as G, bp as U, br as X, bq as J, c8 as K, U as P } from "./toggle-group-CrQymn4l.js";
|
|
5
5
|
import "./card-Bn3Y7DHQ.js";
|
|
6
6
|
import { B as w, C as W } from "./tooltip-CAu4DEhc.js";
|
|
7
7
|
import { X as E, S as Y, h as Z, i as q, a as ee, c as re } from "./select-zzSnHs9S.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as i, C as l, a as s, F as g } from "../../../ConfirmationDialog-
|
|
2
|
-
import { D as e, a as r, b as t, c as n, d as f, e as m, f as p, g as C, h as F, i as P, P as c } from "../../../toggle-group-
|
|
1
|
+
import { A as i, C as l, a as s, F as g } from "../../../ConfirmationDialog-D7W5xkwQ.js";
|
|
2
|
+
import { D as e, a as r, b as t, c as n, d as f, e as m, f as p, g as C, h as F, i as P, P as c } from "../../../toggle-group-CrQymn4l.js";
|
|
3
3
|
export {
|
|
4
4
|
i as AppDialog,
|
|
5
5
|
l as ConfirmDeleteDialog,
|