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