@krosoft/react 0.0.217 → 0.0.219
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/README.md +31 -0
- package/dist/{AppActions-BCXERyyB.js → AppActions-BFmagl91.js} +1 -1
- package/dist/{AppSubTitle-H8ElNObI.js → AppSubTitle-BMQMoehZ.js} +1 -1
- package/dist/AppVerticalTabs-0DrrDO3S.js +101 -0
- package/dist/{ConfirmationDialog-BmxaMEYz.js → ConfirmationDialog-CFsh-Eui.js} +62 -61
- package/dist/DataTable-Cpbp6yse.js +551 -0
- package/dist/ErrorAlert-D_203tKa.js +21 -0
- package/dist/ErrorState-DfJ009uc.js +12 -0
- package/dist/GenericForm-q9dvYl_h.js +342 -0
- package/dist/ImageInput-BYXz8wM1.js +68 -0
- package/dist/{KpiCardsLayout-XZTxB8FV.js → KpiCardsLayout-B-lMaUMA.js} +4 -4
- package/dist/{MultiSelect-Cj8vgAXJ.js → MultiSelect-Dkz1dgXo.js} +52 -51
- package/dist/{PieChart-D6y5EQnh.js → PieChart-bDy_V9Xt.js} +82 -81
- package/dist/SearchInput-CJ2YZpmB.js +244 -0
- package/dist/{SkeletonCards-CYo_lvKx.js → SkeletonCards-Bg2ygjwy.js} +1 -1
- package/dist/{TableFilter-DbnGaGKL.js → TableFilter-u6F06nMx.js} +133 -130
- package/dist/ThemeSelector-BRpEgvX8.js +49 -0
- package/dist/Topbar-bIyAunNd.js +318 -0
- package/dist/components/core/cards/index.js +1 -1
- package/dist/components/core/charts/ChartCard.d.ts.map +1 -1
- package/dist/components/core/charts/index.js +1 -1
- package/dist/components/core/dialogs/FormDialog.d.ts.map +1 -1
- package/dist/components/core/dialogs/index.js +2 -2
- package/dist/components/core/filters/ActiveFilters.d.ts.map +1 -1
- package/dist/components/core/filters/AdvancedFilters.d.ts.map +1 -1
- package/dist/components/core/filters/FilterField.d.ts.map +1 -1
- package/dist/components/core/filters/SearchableFilterPill.d.ts.map +1 -1
- package/dist/components/core/filters/TableFilter.d.ts.map +1 -1
- package/dist/components/core/filters/index.js +1 -1
- package/dist/components/core/forms/GenericForm.d.ts.map +1 -1
- package/dist/components/core/forms/index.js +1 -1
- package/dist/components/core/index.js +18 -18
- package/dist/components/core/inputs/DateRangePicker.d.ts.map +1 -1
- package/dist/components/core/inputs/ImageInput.d.ts.map +1 -1
- package/dist/components/core/inputs/MultiSelect.d.ts.map +1 -1
- package/dist/components/core/inputs/SearchInput.d.ts +1 -1
- package/dist/components/core/inputs/SearchInput.d.ts.map +1 -1
- package/dist/components/core/inputs/SearchableSelect.d.ts.map +1 -1
- package/dist/components/core/inputs/index.js +3 -3
- package/dist/components/core/layouts/index.js +3 -3
- package/dist/components/core/navbar/GlobalSearch.d.ts.map +1 -1
- package/dist/components/core/navbar/Sidebar.d.ts.map +1 -1
- package/dist/components/core/navbar/index.js +1 -1
- package/dist/components/core/states/ErrorAlert.d.ts.map +1 -1
- package/dist/components/core/states/ErrorState.d.ts.map +1 -1
- package/dist/components/core/states/index.js +2 -2
- package/dist/components/core/table/DataTable.d.ts.map +1 -1
- package/dist/components/core/table/TableBody.d.ts +1 -1
- package/dist/components/core/table/TableBody.d.ts.map +1 -1
- package/dist/components/core/table/TablePagination.d.ts.map +1 -1
- package/dist/components/core/table/index.js +1 -1
- package/dist/components/core/tabs/AppVerticalTabs.d.ts.map +1 -1
- package/dist/components/core/tabs/index.js +1 -1
- package/dist/components/core/theme/ThemeSelector.d.ts.map +1 -1
- package/dist/components/core/theme/index.js +1 -1
- package/dist/components/index.js +18 -18
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/index.js +1 -1
- package/dist/hooks/behavior/index.js +1 -1
- package/dist/hooks/behavior/useConfirmDeleteDialog.d.ts +1 -1
- package/dist/hooks/behavior/useConfirmDeleteDialog.d.ts.map +1 -1
- package/dist/hooks/index.js +2 -2
- package/dist/hooks/ui/index.js +1 -1
- package/dist/hooks/ui/useTheme.d.ts.map +1 -1
- package/dist/i18n/index.d.ts +3 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +7 -0
- package/dist/i18n/krosoftLocales.d.ts +175 -0
- package/dist/i18n/krosoftLocales.d.ts.map +1 -0
- package/dist/i18n/useKrosoftTranslation.d.ts +15 -0
- package/dist/i18n/useKrosoftTranslation.d.ts.map +1 -0
- package/dist/providers/index.js +1 -1
- package/dist/{sheet-BQmtrGf2.js → sheet-CDqLa-FP.js} +105 -108
- package/dist/useKrosoftTranslation-DdcylBY2.js +43 -0
- package/dist/usePage-Bhb81ffo.js +82 -0
- package/dist/useTheme-Cmw14Zxi.js +25 -0
- package/package.json +1 -1
- package/dist/AppVerticalTabs-aJmAVu6F.js +0 -100
- package/dist/DataTable-0-lae9KY.js +0 -550
- package/dist/ErrorAlert-SrIcU1mM.js +0 -17
- package/dist/ErrorState-CmaxuJyW.js +0 -8
- package/dist/GenericForm-DJR7PD-i.js +0 -341
- package/dist/ImageInput-DYe2XPNZ.js +0 -67
- package/dist/SearchInput-oeq0NBIc.js +0 -251
- package/dist/ThemeSelector-BFC37dSl.js +0 -48
- package/dist/Topbar-DUq-UeR0.js +0 -306
- package/dist/usePage-BFE9lxI1.js +0 -84
- package/dist/useTheme-CSr_h5xJ.js +0 -24
|
@@ -1,550 +0,0 @@
|
|
|
1
|
-
import { jsxs as i, jsx as e, Fragment as ne } from "react/jsx-runtime";
|
|
2
|
-
import { u as le } from "./useDataTable-CxcA5S-s.js";
|
|
3
|
-
import { a3 as B, ah as L, a5 as V, a7 as de, E as O, a4 as ce } from "./toggle-group-DLLrEwv2.js";
|
|
4
|
-
import "./alert-B9F1N9Qk.js";
|
|
5
|
-
import "@radix-ui/react-aspect-ratio";
|
|
6
|
-
import { B as y } from "./tooltip-DVeqVwqV.js";
|
|
7
|
-
import "./chart-DntJZGxB.js";
|
|
8
|
-
import "@radix-ui/react-collapsible";
|
|
9
|
-
import "./sheet-BQmtrGf2.js";
|
|
10
|
-
import { MoreVerticalIcon as oe, Loader2Icon as he, AlertTriangleIcon as me, GripVerticalIcon as ge, ArrowUpIcon as ue, ArrowDownIcon as fe, ArrowUpDownIcon as pe, ChevronLeftIcon as xe, ChevronRightIcon as ve, SettingsIcon as ye } from "lucide-react";
|
|
11
|
-
import "react-resizable-panels";
|
|
12
|
-
import "clsx";
|
|
13
|
-
import "tailwind-merge";
|
|
14
|
-
import { S as be, h as Ne, i as ke, a as Se, c as we } from "./select-BpjFWqAY.js";
|
|
15
|
-
import "next-themes";
|
|
16
|
-
import "sonner";
|
|
17
|
-
import "react";
|
|
18
|
-
const H = [5, 10, 30, 50, 100], Ce = H[1];
|
|
19
|
-
function ze({ actions: n, row: t }) {
|
|
20
|
-
const a = n.filter((r) => r.visible === void 0 || r.visible(t));
|
|
21
|
-
if (a.length === 0)
|
|
22
|
-
return null;
|
|
23
|
-
const d = a.filter((r) => r.overflow !== !0), g = a.filter((r) => r.overflow === !0);
|
|
24
|
-
return /* @__PURE__ */ i("div", { className: "flex items-center justify-center gap-1", children: [
|
|
25
|
-
d.map((r, c) => {
|
|
26
|
-
var o;
|
|
27
|
-
const m = r.icon;
|
|
28
|
-
return /* @__PURE__ */ i(
|
|
29
|
-
y,
|
|
30
|
-
{
|
|
31
|
-
variant: r.variant ?? "ghost",
|
|
32
|
-
size: "sm",
|
|
33
|
-
disabled: ((o = r.disabled) == null ? void 0 : o.call(r, t)) ?? !1,
|
|
34
|
-
className: `h-7 px-2 text-muted-foreground hover:text-foreground ${r.className ?? ""}`,
|
|
35
|
-
onClick: (x) => {
|
|
36
|
-
x.stopPropagation(), r.onClick(t);
|
|
37
|
-
},
|
|
38
|
-
children: [
|
|
39
|
-
m !== void 0 && /* @__PURE__ */ e(m, { className: "size-3.5" }),
|
|
40
|
-
r.label
|
|
41
|
-
]
|
|
42
|
-
},
|
|
43
|
-
c
|
|
44
|
-
);
|
|
45
|
-
}),
|
|
46
|
-
g.length > 0 && /* @__PURE__ */ i(B, { children: [
|
|
47
|
-
/* @__PURE__ */ e(L, { asChild: !0, children: /* @__PURE__ */ e(y, { variant: "ghost", size: "icon", className: "h-7 w-7 text-muted-foreground hover:text-foreground", children: /* @__PURE__ */ e(oe, { className: "size-3.5" }) }) }),
|
|
48
|
-
/* @__PURE__ */ e(
|
|
49
|
-
V,
|
|
50
|
-
{
|
|
51
|
-
align: "end",
|
|
52
|
-
onClick: (r) => {
|
|
53
|
-
r.stopPropagation();
|
|
54
|
-
},
|
|
55
|
-
children: g.map((r, c) => {
|
|
56
|
-
var o;
|
|
57
|
-
const m = r.icon;
|
|
58
|
-
return /* @__PURE__ */ i(
|
|
59
|
-
de,
|
|
60
|
-
{
|
|
61
|
-
disabled: ((o = r.disabled) == null ? void 0 : o.call(r, t)) ?? !1,
|
|
62
|
-
onClick: () => {
|
|
63
|
-
r.onClick(t);
|
|
64
|
-
},
|
|
65
|
-
className: r.className,
|
|
66
|
-
children: [
|
|
67
|
-
m !== void 0 && /* @__PURE__ */ e("span", { className: "mr-2 size-4 flex items-center justify-center", children: /* @__PURE__ */ e(m, { className: "size-4" }) }),
|
|
68
|
-
r.label
|
|
69
|
-
]
|
|
70
|
-
},
|
|
71
|
-
c
|
|
72
|
-
);
|
|
73
|
-
})
|
|
74
|
-
}
|
|
75
|
-
)
|
|
76
|
-
] })
|
|
77
|
-
] });
|
|
78
|
-
}
|
|
79
|
-
function De({
|
|
80
|
-
isLoading: n,
|
|
81
|
-
error: t,
|
|
82
|
-
colSpanCount: a,
|
|
83
|
-
noDataMessage: d,
|
|
84
|
-
paginatedData: g,
|
|
85
|
-
getRowId: r,
|
|
86
|
-
onRowClick: c,
|
|
87
|
-
hasBulkActions: m,
|
|
88
|
-
selectedRows: o,
|
|
89
|
-
toggleRowSelection: x,
|
|
90
|
-
visibleColumnsArray: l,
|
|
91
|
-
columnWidths: v,
|
|
92
|
-
hasActions: C,
|
|
93
|
-
actions: b,
|
|
94
|
-
columns: z,
|
|
95
|
-
bordered: k = !1,
|
|
96
|
-
resizableColumns: S = !1
|
|
97
|
-
}) {
|
|
98
|
-
const D = (u, p) => {
|
|
99
|
-
const h = z.find((N) => N.key === p);
|
|
100
|
-
if ((h == null ? void 0 : h.renderCell) !== void 0)
|
|
101
|
-
return h.renderCell(u);
|
|
102
|
-
const s = u[p];
|
|
103
|
-
return /* @__PURE__ */ e("span", { className: "text-sm truncate", children: s != null ? String(s) : "-" });
|
|
104
|
-
};
|
|
105
|
-
return n ? /* @__PURE__ */ e("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-800", children: /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: a, className: "py-8 text-center", children: /* @__PURE__ */ i("div", { className: "flex flex-col items-center justify-center gap-2 text-muted-foreground", children: [
|
|
106
|
-
/* @__PURE__ */ e(he, { className: "h-6 w-6 animate-spin text-primary" }),
|
|
107
|
-
/* @__PURE__ */ e("span", { className: "text-sm", children: "Chargement..." })
|
|
108
|
-
] }) }) }) }) : t ? /* @__PURE__ */ e("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-800", children: /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: a, className: "py-8 text-center", children: /* @__PURE__ */ i("div", { className: "flex flex-col items-center justify-center gap-2 text-destructive", children: [
|
|
109
|
-
/* @__PURE__ */ e(me, { className: "h-6 w-6" }),
|
|
110
|
-
/* @__PURE__ */ e("span", { className: "text-sm", children: t })
|
|
111
|
-
] }) }) }) }) : g.length === 0 ? /* @__PURE__ */ e("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-800", children: /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: a, className: "py-8 text-center text-sm text-muted-foreground", children: d }) }) }) : /* @__PURE__ */ e("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-800", children: g.map((u) => {
|
|
112
|
-
const p = r(u);
|
|
113
|
-
return /* @__PURE__ */ i(
|
|
114
|
-
"tr",
|
|
115
|
-
{
|
|
116
|
-
className: `group hover:bg-muted/50 dark:hover:bg-gray-900/50 transition-colors ${c !== void 0 ? "cursor-pointer" : ""}`,
|
|
117
|
-
onClick: (h) => c == null ? void 0 : c(u, h),
|
|
118
|
-
children: [
|
|
119
|
-
m ? /* @__PURE__ */ e(
|
|
120
|
-
"td",
|
|
121
|
-
{
|
|
122
|
-
className: "p-1 text-center align-middle",
|
|
123
|
-
style: { width: "32px", minWidth: "32px", maxWidth: "32px" },
|
|
124
|
-
onClick: (h) => {
|
|
125
|
-
h.stopPropagation();
|
|
126
|
-
},
|
|
127
|
-
children: /* @__PURE__ */ e("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ e(
|
|
128
|
-
O,
|
|
129
|
-
{
|
|
130
|
-
checked: o.includes(p),
|
|
131
|
-
onCheckedChange: () => {
|
|
132
|
-
x(p);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
) })
|
|
136
|
-
}
|
|
137
|
-
) : null,
|
|
138
|
-
l.map((h, s) => {
|
|
139
|
-
const N = s === l.length - 1;
|
|
140
|
-
return /* @__PURE__ */ e(
|
|
141
|
-
"td",
|
|
142
|
-
{
|
|
143
|
-
className: `px-2 py-2 relative ${k && !N ? "border-r border-gray-100 dark:border-gray-800" : ""} ${h.className ?? ""}`,
|
|
144
|
-
style: S ? { width: v[h.key] } : { minWidth: v[h.key] },
|
|
145
|
-
children: /* @__PURE__ */ e("div", { className: "w-full h-full", children: D(u, h.key) })
|
|
146
|
-
},
|
|
147
|
-
h.key
|
|
148
|
-
);
|
|
149
|
-
}),
|
|
150
|
-
C ? /* @__PURE__ */ e(
|
|
151
|
-
"td",
|
|
152
|
-
{
|
|
153
|
-
className: "p-1 text-center align-middle whitespace-nowrap",
|
|
154
|
-
style: { minWidth: "32px" },
|
|
155
|
-
onClick: (h) => {
|
|
156
|
-
h.stopPropagation();
|
|
157
|
-
},
|
|
158
|
-
children: b !== void 0 && b.length > 0 ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ e(ze, { actions: b, row: u }) }) : null
|
|
159
|
-
}
|
|
160
|
-
) : null
|
|
161
|
-
]
|
|
162
|
-
},
|
|
163
|
-
p
|
|
164
|
-
);
|
|
165
|
-
}) });
|
|
166
|
-
}
|
|
167
|
-
function Ie({ selectedRows: n, setSelectedRows: t, bulkActions: a }) {
|
|
168
|
-
return /* @__PURE__ */ i("div", { className: "bg-muted/60 dark:bg-gray-900/60 border border-border px-3 py-1.5 flex items-center justify-between rounded-surface", children: [
|
|
169
|
-
/* @__PURE__ */ i("div", { className: "flex items-center gap-4", children: [
|
|
170
|
-
/* @__PURE__ */ i("span", { className: "text-sm font-medium text-primary ml-1", children: [
|
|
171
|
-
n.length,
|
|
172
|
-
" sélectionné(s)"
|
|
173
|
-
] }),
|
|
174
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: a.map((d, g) => {
|
|
175
|
-
const r = d.icon;
|
|
176
|
-
return /* @__PURE__ */ i(
|
|
177
|
-
y,
|
|
178
|
-
{
|
|
179
|
-
variant: "outline",
|
|
180
|
-
size: "sm",
|
|
181
|
-
onClick: () => {
|
|
182
|
-
d.onClick(n, () => {
|
|
183
|
-
t([]);
|
|
184
|
-
});
|
|
185
|
-
},
|
|
186
|
-
className: `h-7 bg-background shadow-sm text-xs px-2.5 ${d.variant === "destructive" ? "text-destructive border-destructive/30 hover:bg-destructive/10 hover:text-destructive" : "text-foreground"}`,
|
|
187
|
-
children: [
|
|
188
|
-
r !== void 0 && /* @__PURE__ */ e("span", { className: "mr-1.5 flex items-center justify-center", children: /* @__PURE__ */ e(r, { className: "h-3.5 w-3.5" }) }),
|
|
189
|
-
d.label
|
|
190
|
-
]
|
|
191
|
-
},
|
|
192
|
-
g
|
|
193
|
-
);
|
|
194
|
-
}) })
|
|
195
|
-
] }),
|
|
196
|
-
/* @__PURE__ */ e(
|
|
197
|
-
y,
|
|
198
|
-
{
|
|
199
|
-
variant: "ghost",
|
|
200
|
-
size: "sm",
|
|
201
|
-
onClick: () => {
|
|
202
|
-
t([]);
|
|
203
|
-
},
|
|
204
|
-
className: "text-xs text-muted-foreground hover:text-foreground h-7 px-2",
|
|
205
|
-
children: "Désélectionner"
|
|
206
|
-
}
|
|
207
|
-
)
|
|
208
|
-
] });
|
|
209
|
-
}
|
|
210
|
-
function je({
|
|
211
|
-
hasBulkActions: n,
|
|
212
|
-
selectedRows: t,
|
|
213
|
-
totalItems: a,
|
|
214
|
-
toggleSelectAll: d,
|
|
215
|
-
visibleColumnsArray: g,
|
|
216
|
-
draggableColumns: r,
|
|
217
|
-
resizableColumns: c,
|
|
218
|
-
columnWidths: m,
|
|
219
|
-
sortColumn: o,
|
|
220
|
-
sortDirection: x,
|
|
221
|
-
handleSort: l,
|
|
222
|
-
handleDragStart: v,
|
|
223
|
-
handleDragOver: C,
|
|
224
|
-
handleDrop: b,
|
|
225
|
-
handleMouseDown: z,
|
|
226
|
-
hasActions: k,
|
|
227
|
-
settingsNode: S,
|
|
228
|
-
bordered: D = !1
|
|
229
|
-
}) {
|
|
230
|
-
let u = !1;
|
|
231
|
-
t.length === a && a > 0 ? u = !0 : t.length > 0 && (u = "indeterminate");
|
|
232
|
-
const p = (s) => s.sortable !== !0 ? null : o === s.key ? x === "asc" ? /* @__PURE__ */ e(ue, { className: "size-3.5 text-foreground" }) : /* @__PURE__ */ e(fe, { className: "size-3.5 text-foreground" }) : /* @__PURE__ */ e(pe, { className: "size-3.5 text-muted-foreground/50 group-hover:text-muted-foreground transition-colors" }), h = (s, N) => {
|
|
233
|
-
const I = N !== !1, T = s.sortable === !0;
|
|
234
|
-
return /* @__PURE__ */ i(
|
|
235
|
-
"th",
|
|
236
|
-
{
|
|
237
|
-
className: [
|
|
238
|
-
"px-2 py-2 text-left text-sm font-medium text-gray-900 dark:text-gray-100 relative group",
|
|
239
|
-
D ? "border-r border-gray-200 dark:border-gray-800" : "",
|
|
240
|
-
T ? "cursor-pointer select-none" : "",
|
|
241
|
-
s.className ?? ""
|
|
242
|
-
].filter(Boolean).join(" "),
|
|
243
|
-
style: c ? { width: m[s.key] } : { minWidth: m[s.key] },
|
|
244
|
-
draggable: I,
|
|
245
|
-
onClick: () => {
|
|
246
|
-
l(s.key);
|
|
247
|
-
},
|
|
248
|
-
onDragStart: (f) => {
|
|
249
|
-
I ? v(f, s.key) : f.preventDefault();
|
|
250
|
-
},
|
|
251
|
-
onDragOver: (f) => {
|
|
252
|
-
C(f, s.key);
|
|
253
|
-
},
|
|
254
|
-
onDrop: (f) => {
|
|
255
|
-
b(f, s.key);
|
|
256
|
-
},
|
|
257
|
-
children: [
|
|
258
|
-
/* @__PURE__ */ i("div", { className: "flex items-center justify-between pr-2", children: [
|
|
259
|
-
/* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
|
|
260
|
-
I ? /* @__PURE__ */ e(ge, { className: "size-4 text-gray-400 cursor-grab dark:text-gray-300 shrink-0" }) : null,
|
|
261
|
-
/* @__PURE__ */ e("span", { className: "truncate", children: s.label })
|
|
262
|
-
] }),
|
|
263
|
-
/* @__PURE__ */ e("div", { className: "ml-1 shrink-0", children: p(s) })
|
|
264
|
-
] }),
|
|
265
|
-
c ? /* @__PURE__ */ e(
|
|
266
|
-
"div",
|
|
267
|
-
{
|
|
268
|
-
className: "absolute right-0 top-0 bottom-0 w-2 cursor-col-resize hover:bg-blue-500 opacity-0 group-hover:opacity-50 transition-opacity",
|
|
269
|
-
onMouseDown: (f) => {
|
|
270
|
-
z(f, s.key);
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
) : null
|
|
274
|
-
]
|
|
275
|
-
},
|
|
276
|
-
s.key
|
|
277
|
-
);
|
|
278
|
-
};
|
|
279
|
-
return /* @__PURE__ */ e("thead", { className: "bg-muted/50 dark:bg-gray-900/50 border-b border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ i("tr", { children: [
|
|
280
|
-
n ? /* @__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(O, { checked: u, onCheckedChange: d }) }) }) : null,
|
|
281
|
-
g.map((s) => h(s, r)),
|
|
282
|
-
k || S !== void 0 ? /* @__PURE__ */ e("th", { className: "p-1 text-center align-middle", style: { minWidth: "32px" }, children: S }) : null
|
|
283
|
-
] }) });
|
|
284
|
-
}
|
|
285
|
-
const w = "…";
|
|
286
|
-
function j(n, t) {
|
|
287
|
-
return Array.from({ length: t - n + 1 }, (a, d) => n + d);
|
|
288
|
-
}
|
|
289
|
-
function Te(n, t, a = 1) {
|
|
290
|
-
if (a * 2 + 5 >= t)
|
|
291
|
-
return j(1, t);
|
|
292
|
-
const g = Math.max(n - a, 1), r = Math.min(n + a, t), c = g > 2, m = r < t - 1;
|
|
293
|
-
if (!c && m)
|
|
294
|
-
return [...j(1, a + 2), w, t];
|
|
295
|
-
if (c && !m) {
|
|
296
|
-
const o = j(t - (a + 2) + 1, t);
|
|
297
|
-
return [1, w, ...o];
|
|
298
|
-
}
|
|
299
|
-
return [1, w, ...j(g, r), w, t];
|
|
300
|
-
}
|
|
301
|
-
function Ae({
|
|
302
|
-
totalItems: n,
|
|
303
|
-
startIndex: t,
|
|
304
|
-
endIndex: a,
|
|
305
|
-
pageSize: d,
|
|
306
|
-
setPageSize: g,
|
|
307
|
-
currentPage: r,
|
|
308
|
-
setCurrentPage: c,
|
|
309
|
-
pageSizeOptions: m,
|
|
310
|
-
totalPages: o
|
|
311
|
-
}) {
|
|
312
|
-
const x = Te(r, o);
|
|
313
|
-
return /* @__PURE__ */ i("div", { className: "px-4 py-2 border-t border-gray-200 dark:border-gray-800 flex flex-col sm:grid sm:grid-cols-3 items-center gap-2 bg-muted/50 dark:bg-gray-900/50", children: [
|
|
314
|
-
/* @__PURE__ */ i("div", { className: "text-sm text-muted-foreground justify-self-start", children: [
|
|
315
|
-
n === 0 ? "0" : `${String(t + 1)} - ${String(a)}`,
|
|
316
|
-
" sur ",
|
|
317
|
-
n
|
|
318
|
-
] }),
|
|
319
|
-
/* @__PURE__ */ e("div", { className: "flex items-center justify-center gap-1", children: o > 1 && /* @__PURE__ */ i(ne, { children: [
|
|
320
|
-
/* @__PURE__ */ e(
|
|
321
|
-
y,
|
|
322
|
-
{
|
|
323
|
-
variant: "ghost",
|
|
324
|
-
size: "icon",
|
|
325
|
-
className: "h-8 w-8 rounded-control",
|
|
326
|
-
onClick: () => {
|
|
327
|
-
c((l) => Math.max(1, l - 1));
|
|
328
|
-
},
|
|
329
|
-
disabled: r === 1,
|
|
330
|
-
"aria-label": "Page précédente",
|
|
331
|
-
children: /* @__PURE__ */ e(xe, { className: "size-4" })
|
|
332
|
-
}
|
|
333
|
-
),
|
|
334
|
-
x.map(
|
|
335
|
-
(l, v) => l === w ? /* @__PURE__ */ e("span", { className: "flex h-8 w-8 items-center justify-center text-sm text-muted-foreground", children: w }, `dots-${String(v)}`) : /* @__PURE__ */ e(
|
|
336
|
-
y,
|
|
337
|
-
{
|
|
338
|
-
variant: l === r ? "default" : "ghost",
|
|
339
|
-
size: "icon",
|
|
340
|
-
className: "h-8 w-8 rounded-control text-sm",
|
|
341
|
-
onClick: () => {
|
|
342
|
-
c(l);
|
|
343
|
-
},
|
|
344
|
-
"aria-current": l === r ? "page" : void 0,
|
|
345
|
-
children: l
|
|
346
|
-
},
|
|
347
|
-
l
|
|
348
|
-
)
|
|
349
|
-
),
|
|
350
|
-
/* @__PURE__ */ e(
|
|
351
|
-
y,
|
|
352
|
-
{
|
|
353
|
-
variant: "ghost",
|
|
354
|
-
size: "icon",
|
|
355
|
-
className: "h-8 w-8 rounded-control",
|
|
356
|
-
onClick: () => {
|
|
357
|
-
c((l) => Math.min(o, l + 1));
|
|
358
|
-
},
|
|
359
|
-
disabled: r === o,
|
|
360
|
-
"aria-label": "Page suivante",
|
|
361
|
-
children: /* @__PURE__ */ e(ve, { className: "size-4" })
|
|
362
|
-
}
|
|
363
|
-
)
|
|
364
|
-
] }) }),
|
|
365
|
-
/* @__PURE__ */ e("div", { className: "justify-self-end", children: /* @__PURE__ */ i(
|
|
366
|
-
be,
|
|
367
|
-
{
|
|
368
|
-
value: String(d),
|
|
369
|
-
onValueChange: (l) => {
|
|
370
|
-
g(Number(l)), c(1);
|
|
371
|
-
},
|
|
372
|
-
children: [
|
|
373
|
-
/* @__PURE__ */ e(Ne, { className: "h-8 w-[110px] text-sm", children: /* @__PURE__ */ e(ke, {}) }),
|
|
374
|
-
/* @__PURE__ */ e(Se, { children: m.map((l) => /* @__PURE__ */ i(we, { value: String(l), children: [
|
|
375
|
-
l,
|
|
376
|
-
" / page"
|
|
377
|
-
] }, l)) })
|
|
378
|
-
]
|
|
379
|
-
}
|
|
380
|
-
) })
|
|
381
|
-
] });
|
|
382
|
-
}
|
|
383
|
-
function Me({ columns: n, visibleColumns: t, toggleColumnVisibility: a }) {
|
|
384
|
-
return /* @__PURE__ */ i(B, { children: [
|
|
385
|
-
/* @__PURE__ */ e(L, { asChild: !0, children: /* @__PURE__ */ e(y, { 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(ye, { className: "size-3.5 text-gray-600 dark:text-gray-300" }) }) }),
|
|
386
|
-
/* @__PURE__ */ e(V, { align: "end", className: "w-56", children: n.map((d) => /* @__PURE__ */ e(
|
|
387
|
-
ce,
|
|
388
|
-
{
|
|
389
|
-
checked: t.has(d.key),
|
|
390
|
-
onCheckedChange: () => {
|
|
391
|
-
a(d.key);
|
|
392
|
-
},
|
|
393
|
-
children: d.label
|
|
394
|
-
},
|
|
395
|
-
d.key
|
|
396
|
-
)) })
|
|
397
|
-
] });
|
|
398
|
-
}
|
|
399
|
-
function Xe({
|
|
400
|
-
data: n,
|
|
401
|
-
columns: t,
|
|
402
|
-
getRowId: a,
|
|
403
|
-
onRowClick: d,
|
|
404
|
-
actions: g,
|
|
405
|
-
bulkActions: r,
|
|
406
|
-
draggableColumns: c = !1,
|
|
407
|
-
resizableColumns: m = !1,
|
|
408
|
-
columnVisibility: o = !1,
|
|
409
|
-
isLoading: x = !1,
|
|
410
|
-
error: l = null,
|
|
411
|
-
bordered: v = !1,
|
|
412
|
-
noDataMessage: C = "Aucun résultat",
|
|
413
|
-
defaultPageSize: b = Ce,
|
|
414
|
-
pageSizeOptions: z = H,
|
|
415
|
-
totalRows: k,
|
|
416
|
-
currentPage: S,
|
|
417
|
-
pageSize: D,
|
|
418
|
-
onPageChange: u,
|
|
419
|
-
onPageSizeChange: p,
|
|
420
|
-
sortColumn: h,
|
|
421
|
-
sortDirection: s,
|
|
422
|
-
onSortChange: N
|
|
423
|
-
}) {
|
|
424
|
-
const {
|
|
425
|
-
sortColumn: I,
|
|
426
|
-
sortDirection: T,
|
|
427
|
-
selectedRows: f,
|
|
428
|
-
setSelectedRows: U,
|
|
429
|
-
visibleColumns: E,
|
|
430
|
-
columnWidths: A,
|
|
431
|
-
safeCurrentPage: F,
|
|
432
|
-
totalPages: G,
|
|
433
|
-
startIndex: R,
|
|
434
|
-
endIndex: _,
|
|
435
|
-
tableRef: q,
|
|
436
|
-
hasActions: M,
|
|
437
|
-
hasBulkActions: $,
|
|
438
|
-
visibleColumnsArray: W,
|
|
439
|
-
colSpanCount: J,
|
|
440
|
-
paginatedData: P,
|
|
441
|
-
handleSort: Q,
|
|
442
|
-
handleMouseDown: X,
|
|
443
|
-
handleDragStart: Y,
|
|
444
|
-
handleDragOver: Z,
|
|
445
|
-
handleDrop: K,
|
|
446
|
-
toggleColumnVisibility: ee,
|
|
447
|
-
toggleRowSelection: re,
|
|
448
|
-
toggleSelectAll: te,
|
|
449
|
-
pageSize: ae,
|
|
450
|
-
setPageSize: se,
|
|
451
|
-
setCurrentPage: ie
|
|
452
|
-
} = le({
|
|
453
|
-
data: n,
|
|
454
|
-
columns: t,
|
|
455
|
-
getRowId: a,
|
|
456
|
-
defaultPageSize: b,
|
|
457
|
-
actions: g,
|
|
458
|
-
bulkActions: r,
|
|
459
|
-
columnVisibility: o,
|
|
460
|
-
totalRows: k,
|
|
461
|
-
currentPage: S,
|
|
462
|
-
pageSize: D,
|
|
463
|
-
onPageChange: u,
|
|
464
|
-
onPageSizeChange: p,
|
|
465
|
-
sortColumn: h,
|
|
466
|
-
sortDirection: s,
|
|
467
|
-
onSortChange: N
|
|
468
|
-
});
|
|
469
|
-
return (
|
|
470
|
-
// Le tableau suit le preset de l'application — square reste square — mais
|
|
471
|
-
// bascule sur les valeurs plafonnées : ni ses contrôles ni son cadre ne
|
|
472
|
-
// prennent la forme capsule. Le scope couvre le cadre, les actions
|
|
473
|
-
// groupées et la pagination. Les fallbacks correspondent au preset "soft".
|
|
474
|
-
/* @__PURE__ */ i("div", { className: "space-y-4 [--k-radius-control:var(--k-radius-control-dense,0.5rem)] [--k-radius-surface:var(--k-radius-surface-dense,0.75rem)]", children: [
|
|
475
|
-
f.length > 0 && r !== void 0 && r.length > 0 && /* @__PURE__ */ e(Ie, { selectedRows: f, setSelectedRows: U, bulkActions: r }),
|
|
476
|
-
/* @__PURE__ */ i("div", { className: "w-full bg-card dark:bg-gray-950 rounded-surface border border-gray-200 dark:border-gray-800 overflow-hidden", children: [
|
|
477
|
-
/* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */ i("table", { ref: q, className: "w-full", children: [
|
|
478
|
-
/* @__PURE__ */ e(
|
|
479
|
-
je,
|
|
480
|
-
{
|
|
481
|
-
hasBulkActions: $,
|
|
482
|
-
selectedRows: f,
|
|
483
|
-
totalItems: n.length,
|
|
484
|
-
toggleSelectAll: te,
|
|
485
|
-
visibleColumnsArray: W,
|
|
486
|
-
draggableColumns: c,
|
|
487
|
-
resizableColumns: m,
|
|
488
|
-
columnWidths: A,
|
|
489
|
-
sortColumn: I,
|
|
490
|
-
sortDirection: T,
|
|
491
|
-
handleSort: Q,
|
|
492
|
-
handleDragStart: Y,
|
|
493
|
-
handleDragOver: Z,
|
|
494
|
-
handleDrop: K,
|
|
495
|
-
handleMouseDown: X,
|
|
496
|
-
hasActions: M,
|
|
497
|
-
bordered: v,
|
|
498
|
-
settingsNode: o ? /* @__PURE__ */ e(Me, { columns: t, visibleColumns: E, toggleColumnVisibility: ee }) : void 0
|
|
499
|
-
}
|
|
500
|
-
),
|
|
501
|
-
/* @__PURE__ */ e(
|
|
502
|
-
De,
|
|
503
|
-
{
|
|
504
|
-
bordered: v,
|
|
505
|
-
isLoading: x,
|
|
506
|
-
error: l,
|
|
507
|
-
colSpanCount: J,
|
|
508
|
-
noDataMessage: C,
|
|
509
|
-
paginatedData: P,
|
|
510
|
-
getRowId: a,
|
|
511
|
-
onRowClick: d,
|
|
512
|
-
hasBulkActions: $,
|
|
513
|
-
selectedRows: f,
|
|
514
|
-
toggleRowSelection: re,
|
|
515
|
-
visibleColumnsArray: W,
|
|
516
|
-
columnWidths: A,
|
|
517
|
-
hasActions: M || o,
|
|
518
|
-
actions: g,
|
|
519
|
-
columns: t,
|
|
520
|
-
resizableColumns: m
|
|
521
|
-
}
|
|
522
|
-
)
|
|
523
|
-
] }) }),
|
|
524
|
-
/* @__PURE__ */ e(
|
|
525
|
-
Ae,
|
|
526
|
-
{
|
|
527
|
-
totalItems: k ?? n.length,
|
|
528
|
-
startIndex: R,
|
|
529
|
-
endIndex: _,
|
|
530
|
-
pageSize: ae,
|
|
531
|
-
setPageSize: se,
|
|
532
|
-
currentPage: F,
|
|
533
|
-
setCurrentPage: ie,
|
|
534
|
-
pageSizeOptions: z,
|
|
535
|
-
totalPages: G
|
|
536
|
-
}
|
|
537
|
-
)
|
|
538
|
-
] })
|
|
539
|
-
] })
|
|
540
|
-
);
|
|
541
|
-
}
|
|
542
|
-
export {
|
|
543
|
-
Xe as D,
|
|
544
|
-
ze as T,
|
|
545
|
-
De as a,
|
|
546
|
-
Ie as b,
|
|
547
|
-
je as c,
|
|
548
|
-
Ae as d,
|
|
549
|
-
Me as e
|
|
550
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { jsxs as r, jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { A as n, a as t } from "./alert-B9F1N9Qk.js";
|
|
3
|
-
import { AlertTriangle as a } from "lucide-react";
|
|
4
|
-
const o = ({ error: e }) => e ? /* @__PURE__ */ r(n, { variant: "destructive", children: [
|
|
5
|
-
/* @__PURE__ */ s(a, { className: "size-4" }),
|
|
6
|
-
/* @__PURE__ */ r(t, { children: [
|
|
7
|
-
/* @__PURE__ */ r("div", { className: "flex items-center space-x-2", children: [
|
|
8
|
-
/* @__PURE__ */ s("span", { className: "font-semibold", children: "Erreur :" }),
|
|
9
|
-
/* @__PURE__ */ s("span", { children: e.code }),
|
|
10
|
-
/* @__PURE__ */ s("span", { children: e.message })
|
|
11
|
-
] }),
|
|
12
|
-
e.errors && e.errors.length > 0 && /* @__PURE__ */ s("ul", { className: "mt-2 list-disc list-inside", children: e.errors.map((i, l) => /* @__PURE__ */ s("li", { children: i }, l)) })
|
|
13
|
-
] })
|
|
14
|
-
] }) : null;
|
|
15
|
-
export {
|
|
16
|
-
o as E
|
|
17
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
const d = ({ message: e }) => /* @__PURE__ */ t("div", { className: "p-6 border border-destructive bg-destructive/10 text-destructive rounded-surface animate-fade-in", children: [
|
|
3
|
-
/* @__PURE__ */ r("p", { className: "font-semibold mb-2", children: "Une erreur est survenue." }),
|
|
4
|
-
e !== void 0 && e !== "" ? /* @__PURE__ */ r("p", { className: "text-sm opacity-80", children: e }) : null
|
|
5
|
-
] });
|
|
6
|
-
export {
|
|
7
|
-
d as E
|
|
8
|
-
};
|