@krosoft/react 0.0.97 → 0.0.98

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.
Files changed (57) hide show
  1. package/dist/{AppSubTitle-Bc8utqt7.js → AppSubTitle-Bt3_01sd.js} +1 -1
  2. package/dist/{AppTitle-QlMMlpbQ.js → AppTitle-cR9yMcWN.js} +6 -6
  3. package/dist/{AppVerticalTabs--Kb9OFa4.js → AppVerticalTabs-Br5Y27x2.js} +5 -5
  4. package/dist/{ConfirmationDialog-Bv-O4ui4.js → ConfirmationDialog-Bhboi93k.js} +6 -6
  5. package/dist/{DataTable-DWGao3TY.js → DataTable-7kgRjvT3.js} +229 -213
  6. package/dist/{ErrorAlert-DpOsMww8.js → ErrorAlert-D1laKrGq.js} +2 -2
  7. package/dist/{LoadingState-M_TV_5Ui.js → LoadingState-DiBl13bH.js} +1 -1
  8. package/dist/{MetricCard-BjTGW3b2.js → MetricCard-5xmlrXzH.js} +5 -5
  9. package/dist/{SearchInput-CKG1_3iS.js → SearchInput-CcCFcweT.js} +6 -6
  10. package/dist/{TableFilter-oBrNz-v_.js → TableFilter-Dd9SvVEF.js} +8 -8
  11. package/dist/{ThemeSelector-Bzxc7UEq.js → ThemeSelector-Cl2EWB-n.js} +3 -3
  12. package/dist/{Topbar-QKCJiWdO.js → Topbar-6UWKhkXJ.js} +3 -3
  13. package/dist/{alert-sHZy6NHC.js → alert-srKINZRG.js} +2 -2
  14. package/dist/{badge-C09fRxvd.js → badge-BmjaQmQ3.js} +2 -2
  15. package/dist/components/core/cards/index.js +1 -1
  16. package/dist/components/core/dialogs/index.js +2 -2
  17. package/dist/components/core/filters/index.js +1 -1
  18. package/dist/components/core/index.js +13 -13
  19. package/dist/components/core/inputs/index.js +1 -1
  20. package/dist/components/core/layouts/index.js +2 -2
  21. package/dist/components/core/navbar/index.js +1 -1
  22. package/dist/components/core/states/index.js +2 -2
  23. package/dist/components/core/table/DataTable.d.ts +9 -1
  24. package/dist/components/core/table/DataTable.d.ts.map +1 -1
  25. package/dist/components/core/table/index.js +1 -1
  26. package/dist/components/core/tabs/index.js +1 -1
  27. package/dist/components/core/theme/index.js +1 -1
  28. package/dist/components/index.js +18 -18
  29. package/dist/components/ui/button.d.ts +1 -1
  30. package/dist/components/ui/index.js +6 -6
  31. package/dist/{ellipsis-vertical-BVxSFNOa.js → ellipsis-vertical-DHhj4CGv.js} +1 -1
  32. package/dist/{grip-vertical-CJ07_87Y.js → grip-vertical-PGZER0-H.js} +1 -1
  33. package/dist/helpers/index.d.ts +1 -0
  34. package/dist/helpers/index.d.ts.map +1 -1
  35. package/dist/helpers/index.js +47 -2
  36. package/dist/helpers/supabase.helper.d.ts +75 -0
  37. package/dist/helpers/supabase.helper.d.ts.map +1 -0
  38. package/dist/hooks/index.d.ts +1 -0
  39. package/dist/hooks/index.d.ts.map +1 -1
  40. package/dist/hooks/index.js +46 -10
  41. package/dist/hooks/ui/useDataTable.d.ts +1 -1
  42. package/dist/hooks/ui/useDataTable.d.ts.map +1 -1
  43. package/dist/hooks/ui/useServerTable.d.ts +22 -0
  44. package/dist/hooks/ui/useServerTable.d.ts.map +1 -0
  45. package/dist/{index-DSyPHOLE.js → index-BSI9LuBZ.js} +1 -1
  46. package/dist/{loader-circle-GAYBtm3z.js → loader-circle-DEbczXZA.js} +1 -1
  47. package/dist/{select-zzSnHs9S.js → select-CDIMkakd.js} +3 -3
  48. package/dist/{toaster-B09ou5gw.js → toaster-Cz2Lbp2C.js} +4 -4
  49. package/dist/{toggle-group-iLf3T7oV.js → toggle-group-pAjKlGGO.js} +4 -4
  50. package/dist/{tooltip-CAu4DEhc.js → tooltip-mWS3Mix6.js} +2 -2
  51. package/dist/types/UseDataTableProps.d.ts +8 -0
  52. package/dist/types/UseDataTableProps.d.ts.map +1 -1
  53. package/dist/useDataTable-CxcA5S-s.js +126 -0
  54. package/dist/{useTheme-Bn8z_uxy.js → useTheme-BtR4Ahrp.js} +2 -2
  55. package/package.json +1 -1
  56. package/dist/useDataTable-CQpx3zTg.js +0 -91
  57. /package/dist/{index-gWiv5-6R.js → tailwind.helper-gWiv5-6R.js} +0 -0
@@ -1,54 +1,54 @@
1
- import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
- import { u as X } from "./useDataTable-CQpx3zTg.js";
3
- import { ax as _, aL as A, az as I, aB as Y, _ as $, cr as Z, cs as K, ay as R } from "./toggle-group-iLf3T7oV.js";
4
- import "./alert-sHZy6NHC.js";
5
- import { B as v } from "./tooltip-CAu4DEhc.js";
6
- import "./select-zzSnHs9S.js";
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-pAjKlGGO.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 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";
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 te = [
19
+ const he = [
20
20
  ["path", { d: "M12 5v14", key: "s699le" }],
21
21
  ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
22
- ], se = z("arrow-down", te);
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 ne = [
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
- ], ie = z("arrow-up-down", ne);
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 de = [
41
+ const pe = [
42
42
  ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
43
43
  ["path", { d: "M12 19V5", key: "x0mq9r" }]
44
- ], le = z("arrow-up", de);
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 oe = [
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
- ], ce = z("settings", oe), B = [5, 10, 30, 50, 100], he = B[1];
61
- function ge({ actions: d, row: n }) {
62
- return /* @__PURE__ */ a(_, { children: [
63
- /* @__PURE__ */ e(A, { 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" }) }) }),
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
- I,
65
+ B,
66
66
  {
67
67
  align: "end",
68
- onClick: (t) => {
69
- t.stopPropagation();
68
+ onClick: (a) => {
69
+ a.stopPropagation();
70
70
  },
71
- children: d.map((t, s) => {
72
- const h = t.icon;
73
- return /* @__PURE__ */ a(
74
- Y,
71
+ children: d.map((a, s) => {
72
+ const c = a.icon;
73
+ return /* @__PURE__ */ t(
74
+ se,
75
75
  {
76
76
  onClick: () => {
77
- t.onClick(n);
77
+ a.onClick(n);
78
78
  },
79
- className: t.className,
79
+ className: a.className,
80
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
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 me({
92
+ function Ne({
93
93
  isLoading: d,
94
94
  colSpanCount: n,
95
- noDataMessage: t,
95
+ noDataMessage: a,
96
96
  paginatedData: s,
97
- getRowId: h,
97
+ getRowId: c,
98
98
  onRowClick: i,
99
- hasBulkActions: y,
99
+ hasBulkActions: p,
100
100
  selectedRows: x,
101
- toggleRowSelection: g,
101
+ toggleRowSelection: h,
102
102
  visibleColumnsArray: l,
103
- columnWidths: b,
104
- hasActions: N,
103
+ columnWidths: k,
104
+ hasActions: w,
105
105
  actions: f,
106
- columns: k
106
+ columns: v
107
107
  }) {
108
- const w = (c, m) => {
109
- const o = k.find((r) => r.key === m);
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(c);
112
- const p = c[m];
113
- return /* @__PURE__ */ e("span", { className: "text-sm truncate", children: p != null ? String(p) : "-" });
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__ */ 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" }),
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: 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(
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(c),
124
+ onClick: () => i == null ? void 0 : i(g),
125
125
  children: [
126
- y ? /* @__PURE__ */ e(
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
- g(m);
138
+ h(m);
139
139
  }
140
140
  }
141
141
  )
142
142
  }
143
143
  ) : null,
144
- l.map((o, p) => {
145
- const r = p === l.length - 1;
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: b[o.key] },
151
- children: /* @__PURE__ */ e("div", { className: "w-full h-full", children: w(c, o.key) })
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
- N && f !== void 0 && f.length > 0 ? /* @__PURE__ */ e(
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(ge, { actions: f, row: c })
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 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: [
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: t.map((s, h) => {
179
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: a.map((s, c) => {
180
180
  const i = s.icon;
181
- return /* @__PURE__ */ a(
182
- v,
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
- h
197
+ c
198
198
  );
199
199
  }) })
200
200
  ] }),
201
201
  /* @__PURE__ */ e(
202
- v,
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 pe({
215
+ function we({
216
216
  hasBulkActions: d,
217
217
  selectedRows: n,
218
- totalItems: t,
218
+ totalItems: a,
219
219
  toggleSelectAll: s,
220
- visibleColumnsArray: h,
220
+ visibleColumnsArray: c,
221
221
  draggableColumns: i,
222
- resizableColumns: y,
222
+ resizableColumns: p,
223
223
  columnWidths: x,
224
- sortColumn: g,
224
+ sortColumn: h,
225
225
  sortDirection: l,
226
- handleSort: b,
227
- handleDragStart: N,
226
+ handleSort: k,
227
+ handleDragStart: w,
228
228
  handleDragOver: f,
229
- handleDrop: k,
230
- handleMouseDown: w,
231
- hasActions: c,
229
+ handleDrop: v,
230
+ handleMouseDown: C,
231
+ hasActions: g,
232
232
  settingsNode: m
233
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(
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
- 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" : ""
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: C,
245
+ draggable: z,
246
246
  onClick: () => {
247
- b(r.key);
247
+ k(r.key);
248
248
  },
249
249
  onDragStart: (u) => {
250
- C ? N(u, r.key) : u.preventDefault();
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
- k(u, r.key);
256
+ v(u, r.key);
257
257
  },
258
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,
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
- y ? /* @__PURE__ */ e(
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
- w(u, r.key);
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__ */ a("tr", { children: [
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 === t && t > 0 ? !0 : n.length > 0 ? "indeterminate" : !1,
284
+ checked: n.length === a && a > 0 ? !0 : n.length > 0 ? "indeterminate" : !1,
285
285
  onCheckedChange: s
286
286
  }
287
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
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 ye({
292
+ function Ce({
293
293
  totalItems: d,
294
294
  startIndex: n,
295
- endIndex: t,
295
+ endIndex: a,
296
296
  pageSize: s,
297
- setPageSize: h,
297
+ setPageSize: c,
298
298
  currentPage: i,
299
- setCurrentPage: y,
299
+ setCurrentPage: p,
300
300
  pageSizeOptions: x,
301
- totalPages: g
301
+ totalPages: h
302
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)}`,
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__ */ a("div", { className: "flex items-center gap-4", children: [
310
- /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
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
- h(Number(l.target.value)), y(1);
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__ */ a("div", { className: "flex items-center gap-2", children: [
324
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
325
325
  /* @__PURE__ */ e(
326
- v,
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
- y((l) => Math.max(1, l - 1));
332
+ p((l) => Math.max(1, l - 1));
333
333
  },
334
334
  disabled: i === 1,
335
- children: /* @__PURE__ */ e(Z, { className: "size-4" })
335
+ children: /* @__PURE__ */ e(ne, { className: "size-4" })
336
336
  }
337
337
  ),
338
- /* @__PURE__ */ a("span", { className: "text-sm text-muted-foreground", children: [
338
+ /* @__PURE__ */ t("span", { className: "text-sm text-muted-foreground", children: [
339
339
  "Page ",
340
340
  i,
341
341
  " sur ",
342
- g
342
+ h
343
343
  ] }),
344
344
  /* @__PURE__ */ e(
345
- v,
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
- y((l) => Math.min(g, l + 1));
351
+ p((l) => Math.min(h, l + 1));
352
352
  },
353
- disabled: i === g,
354
- children: /* @__PURE__ */ e(K, { className: "size-4" })
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 xe({ columns: d, visibleColumns: n, toggleColumnVisibility: t }) {
362
- return /* @__PURE__ */ a(_, { children: [
363
- /* @__PURE__ */ e(A, { 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(I, { align: "end", className: "w-56", children: d.map((s) => /* @__PURE__ */ e(
365
- R,
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
- t(s.key);
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 Te({
377
+ function Ve({
378
378
  data: d,
379
379
  columns: n,
380
- getRowId: t,
380
+ getRowId: a,
381
381
  onRowClick: s,
382
- actions: h,
382
+ actions: c,
383
383
  bulkActions: i,
384
- draggableColumns: y = !0,
384
+ draggableColumns: p = !0,
385
385
  resizableColumns: x = !0,
386
- columnVisibility: g = !0,
386
+ columnVisibility: h = !0,
387
387
  isLoading: l = !1,
388
- noDataMessage: b = "Aucun résultat",
389
- defaultPageSize: N = he,
390
- pageSizeOptions: f = B
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: 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: L,
408
- paginatedData: P,
409
- handleSort: V,
410
- handleMouseDown: q,
411
- handleDragStart: E,
412
- handleDragOver: G,
413
- handleDrop: H,
414
- toggleColumnVisibility: O,
415
- toggleRowSelection: U,
416
- toggleSelectAll: W,
417
- pageSize: F,
418
- setPageSize: J,
419
- setCurrentPage: Q
420
- } = X({
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: t,
424
- defaultPageSize: N,
425
- actions: h,
431
+ getRowId: a,
432
+ defaultPageSize: w,
433
+ actions: c,
426
434
  bulkActions: i,
427
- columnVisibility: g
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__ */ 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: [
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
- pe,
450
+ we,
435
451
  {
436
- hasBulkActions: j,
437
- selectedRows: c,
452
+ hasBulkActions: _,
453
+ selectedRows: b,
438
454
  totalItems: d.length,
439
- toggleSelectAll: W,
440
- visibleColumnsArray: T,
441
- draggableColumns: y,
455
+ toggleSelectAll: R,
456
+ visibleColumnsArray: A,
457
+ draggableColumns: p,
442
458
  resizableColumns: x,
443
- columnWidths: p,
444
- sortColumn: k,
445
- sortDirection: w,
446
- handleSort: V,
447
- handleDragStart: E,
448
- handleDragOver: G,
449
- handleDrop: H,
450
- handleMouseDown: q,
451
- hasActions: u,
452
- settingsNode: g ? /* @__PURE__ */ e(xe, { columns: n, visibleColumns: o, toggleColumnVisibility: O }) : void 0
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
- me,
472
+ Ne,
457
473
  {
458
474
  isLoading: l,
459
- colSpanCount: L,
460
- noDataMessage: b,
461
- paginatedData: P,
462
- getRowId: t,
475
+ colSpanCount: U,
476
+ noDataMessage: k,
477
+ paginatedData: W,
478
+ getRowId: a,
463
479
  onRowClick: s,
464
- hasBulkActions: j,
465
- selectedRows: c,
466
- toggleRowSelection: U,
467
- visibleColumnsArray: T,
468
- columnWidths: p,
469
- hasActions: u,
470
- actions: h,
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
- ye,
492
+ Ce,
477
493
  {
478
- totalItems: d.length,
479
- startIndex: C,
480
- endIndex: D,
481
- pageSize: F,
482
- setPageSize: J,
483
- currentPage: r,
484
- setCurrentPage: Q,
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: S
502
+ totalPages: E
487
503
  }
488
504
  )
489
505
  ] })
490
506
  ] });
491
507
  }
492
508
  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
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
  };