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