@krosoft/react 0.0.158 → 0.0.160
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/{ConfirmationDialog-wGKgYkmd.js → ConfirmationDialog-Dy_6PcOr.js} +1 -1
- package/dist/{DataTable-BVgo8YWR.js → DataTable-DJM7KWWK.js} +38 -38
- package/dist/{GenericForm-Cy5ntJxi.js → GenericForm-Bb4E2Wxd.js} +1 -1
- package/dist/{MultiSelect-DblSHEsg.js → MultiSelect-BPffv2am.js} +31 -30
- package/dist/{SearchInput-T9TeORNA.js → SearchInput-bwnVKhhE.js} +88 -85
- package/dist/{TableFilter-DUGalkoi.js → TableFilter-mQSKN8O8.js} +2 -2
- package/dist/{ThemeSelector-Qv8QBlYq.js → ThemeSelector-CQ3fSDJ2.js} +1 -1
- package/dist/components/core/dialogs/index.js +1 -1
- package/dist/components/core/filters/index.js +1 -1
- package/dist/components/core/forms/index.js +1 -1
- package/dist/components/core/index.js +7 -7
- 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.js +2 -2
- package/dist/components/core/table/DataTable.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 +7 -7
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/ui/index.js +1 -1
- package/dist/hooks/ui/useTheme.d.ts +2 -1
- package/dist/hooks/ui/useTheme.d.ts.map +1 -1
- package/dist/useTheme-CSr_h5xJ.js +24 -0
- package/package.json +1 -1
- package/dist/useTheme-B0Bxda3I.js +0 -22
|
@@ -14,7 +14,7 @@ import "next-themes";
|
|
|
14
14
|
import "sonner";
|
|
15
15
|
import { useState as w, useEffect as ee } from "react";
|
|
16
16
|
import { useTranslation as O } from "react-i18next";
|
|
17
|
-
import { G as le } from "./GenericForm-
|
|
17
|
+
import { G as le } from "./GenericForm-Bb4E2Wxd.js";
|
|
18
18
|
import { E as ie } from "./ErrorAlert-DH1onuyt.js";
|
|
19
19
|
function re({ open: t, onOpenChange: c, config: l, isLoading: u, error: s, children: p }) {
|
|
20
20
|
const { t: i } = O(), { title: b, description: m, icon: f, maxWidth: g = "sm:max-w-xl", actions: n } = l;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
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 { ay as A, aM as P, aA as B, aC as
|
|
3
|
+
import { ay as A, aM as P, aA as B, aC as se, $, az as ne } from "./toggle-group-BASGy2mQ.js";
|
|
4
4
|
import "./alert-B78CiTYe.js";
|
|
5
5
|
import "@radix-ui/react-aspect-ratio";
|
|
6
6
|
import { B as C } from "./tooltip-BWyFpIxo.js";
|
|
@@ -15,7 +15,7 @@ import "next-themes";
|
|
|
15
15
|
import "sonner";
|
|
16
16
|
import "react";
|
|
17
17
|
const L = [5, 10, 30, 50, 100], pe = L[1];
|
|
18
|
-
function xe({ actions: l, row:
|
|
18
|
+
function xe({ actions: l, row: s }) {
|
|
19
19
|
return /* @__PURE__ */ r(A, { children: [
|
|
20
20
|
/* @__PURE__ */ e(P, { asChild: !0, children: /* @__PURE__ */ e(C, { variant: "ghost", size: "icon", className: "h-7 w-7 text-muted-foreground hover:text-foreground", children: /* @__PURE__ */ e(ie, { className: "size-3.5" }) }) }),
|
|
21
21
|
/* @__PURE__ */ e(
|
|
@@ -28,10 +28,10 @@ function xe({ actions: l, row: n }) {
|
|
|
28
28
|
children: l.map((t, a) => {
|
|
29
29
|
const c = t.icon;
|
|
30
30
|
return /* @__PURE__ */ r(
|
|
31
|
-
|
|
31
|
+
se,
|
|
32
32
|
{
|
|
33
33
|
onClick: () => {
|
|
34
|
-
t.onClick(
|
|
34
|
+
t.onClick(s);
|
|
35
35
|
},
|
|
36
36
|
className: t.className,
|
|
37
37
|
children: [
|
|
@@ -48,11 +48,11 @@ function xe({ actions: l, row: n }) {
|
|
|
48
48
|
}
|
|
49
49
|
function fe({
|
|
50
50
|
isLoading: l,
|
|
51
|
-
colSpanCount:
|
|
51
|
+
colSpanCount: s,
|
|
52
52
|
noDataMessage: t,
|
|
53
53
|
paginatedData: a,
|
|
54
54
|
getRowId: c,
|
|
55
|
-
onRowClick:
|
|
55
|
+
onRowClick: n,
|
|
56
56
|
hasBulkActions: p,
|
|
57
57
|
selectedRows: f,
|
|
58
58
|
toggleRowSelection: h,
|
|
@@ -70,16 +70,16 @@ function fe({
|
|
|
70
70
|
const x = m[g];
|
|
71
71
|
return /* @__PURE__ */ e("span", { className: "text-sm truncate", children: x != null ? String(x) : "-" });
|
|
72
72
|
};
|
|
73
|
-
return l ? /* @__PURE__ */ e("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-800", children: /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan:
|
|
73
|
+
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: [
|
|
74
74
|
/* @__PURE__ */ e(le, { className: "h-6 w-6 animate-spin text-primary" }),
|
|
75
75
|
/* @__PURE__ */ e("span", { className: "text-sm", children: "Chargement..." })
|
|
76
|
-
] }) }) }) }) : 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:
|
|
76
|
+
] }) }) }) }) : 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) => {
|
|
77
77
|
const g = c(m);
|
|
78
78
|
return /* @__PURE__ */ r(
|
|
79
79
|
"tr",
|
|
80
80
|
{
|
|
81
|
-
className: `group hover:bg-muted/50 dark:hover:bg-gray-900/50 transition-colors ${
|
|
82
|
-
onClick: () =>
|
|
81
|
+
className: `group hover:bg-muted/50 dark:hover:bg-gray-900/50 transition-colors ${n !== void 0 ? "cursor-pointer" : ""}`,
|
|
82
|
+
onClick: () => n == null ? void 0 : n(m),
|
|
83
83
|
children: [
|
|
84
84
|
p ? /* @__PURE__ */ e(
|
|
85
85
|
"td",
|
|
@@ -129,7 +129,7 @@ function fe({
|
|
|
129
129
|
);
|
|
130
130
|
}) });
|
|
131
131
|
}
|
|
132
|
-
function ye({ selectedRows: l, setSelectedRows:
|
|
132
|
+
function ye({ selectedRows: l, setSelectedRows: s, bulkActions: t }) {
|
|
133
133
|
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: [
|
|
134
134
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-4", children: [
|
|
135
135
|
/* @__PURE__ */ r("span", { className: "text-sm font-medium text-primary ml-1", children: [
|
|
@@ -137,7 +137,7 @@ function ye({ selectedRows: l, setSelectedRows: n, bulkActions: t }) {
|
|
|
137
137
|
" sélectionné(s)"
|
|
138
138
|
] }),
|
|
139
139
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: t.map((a, c) => {
|
|
140
|
-
const
|
|
140
|
+
const n = a.icon;
|
|
141
141
|
return /* @__PURE__ */ r(
|
|
142
142
|
C,
|
|
143
143
|
{
|
|
@@ -145,12 +145,12 @@ function ye({ selectedRows: l, setSelectedRows: n, bulkActions: t }) {
|
|
|
145
145
|
size: "sm",
|
|
146
146
|
onClick: () => {
|
|
147
147
|
a.onClick(l, () => {
|
|
148
|
-
|
|
148
|
+
s([]);
|
|
149
149
|
});
|
|
150
150
|
},
|
|
151
151
|
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"}`,
|
|
152
152
|
children: [
|
|
153
|
-
|
|
153
|
+
n !== void 0 && /* @__PURE__ */ e("span", { className: "mr-1.5 flex items-center justify-center", children: /* @__PURE__ */ e(n, { className: "h-3.5 w-3.5" }) }),
|
|
154
154
|
a.label
|
|
155
155
|
]
|
|
156
156
|
},
|
|
@@ -164,7 +164,7 @@ function ye({ selectedRows: l, setSelectedRows: n, bulkActions: t }) {
|
|
|
164
164
|
variant: "ghost",
|
|
165
165
|
size: "sm",
|
|
166
166
|
onClick: () => {
|
|
167
|
-
|
|
167
|
+
s([]);
|
|
168
168
|
},
|
|
169
169
|
className: "text-xs text-muted-foreground hover:text-foreground h-7 px-2",
|
|
170
170
|
children: "Désélectionner"
|
|
@@ -174,11 +174,11 @@ function ye({ selectedRows: l, setSelectedRows: n, bulkActions: t }) {
|
|
|
174
174
|
}
|
|
175
175
|
function be({
|
|
176
176
|
hasBulkActions: l,
|
|
177
|
-
selectedRows:
|
|
177
|
+
selectedRows: s,
|
|
178
178
|
totalItems: t,
|
|
179
179
|
toggleSelectAll: a,
|
|
180
180
|
visibleColumnsArray: c,
|
|
181
|
-
draggableColumns:
|
|
181
|
+
draggableColumns: n,
|
|
182
182
|
resizableColumns: p,
|
|
183
183
|
columnWidths: f,
|
|
184
184
|
sortColumn: h,
|
|
@@ -193,7 +193,7 @@ function be({
|
|
|
193
193
|
bordered: g = !1
|
|
194
194
|
}) {
|
|
195
195
|
let i = !1;
|
|
196
|
-
|
|
196
|
+
s.length === t && t > 0 ? i = !0 : s.length > 0 && (i = "indeterminate");
|
|
197
197
|
const x = (d) => d.sortable !== !0 ? null : h === d.key ? o === "asc" ? /* @__PURE__ */ e(oe, { className: "size-3.5 text-foreground" }) : /* @__PURE__ */ e(ce, { className: "size-3.5 text-foreground" }) : /* @__PURE__ */ e(me, { className: "size-3.5 text-muted-foreground/50 group-hover:text-muted-foreground transition-colors" }), b = (d, I) => {
|
|
198
198
|
const S = I !== !1, k = d.sortable === !0;
|
|
199
199
|
return /* @__PURE__ */ r(
|
|
@@ -242,24 +242,24 @@ function be({
|
|
|
242
242
|
};
|
|
243
243
|
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: [
|
|
244
244
|
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($, { checked: i, onCheckedChange: a }) }) }) : null,
|
|
245
|
-
c.map((d) => b(d,
|
|
245
|
+
c.map((d) => b(d, n)),
|
|
246
246
|
D || m !== void 0 ? /* @__PURE__ */ e("th", { className: "p-1 text-center align-middle", style: { width: "32px", minWidth: "32px", maxWidth: "32px" }, children: m }) : null
|
|
247
247
|
] }) });
|
|
248
248
|
}
|
|
249
249
|
function ve({
|
|
250
250
|
totalItems: l,
|
|
251
|
-
startIndex:
|
|
251
|
+
startIndex: s,
|
|
252
252
|
endIndex: t,
|
|
253
253
|
pageSize: a,
|
|
254
254
|
setPageSize: c,
|
|
255
|
-
currentPage:
|
|
255
|
+
currentPage: n,
|
|
256
256
|
setCurrentPage: p,
|
|
257
257
|
pageSizeOptions: f,
|
|
258
258
|
totalPages: h
|
|
259
259
|
}) {
|
|
260
260
|
return /* @__PURE__ */ r("div", { className: "px-4 py-2 border-t border-gray-200 dark:border-gray-800 flex items-center justify-between bg-muted/50 dark:bg-gray-900/50 flex-wrap gap-2", children: [
|
|
261
261
|
/* @__PURE__ */ r("div", { className: "text-sm text-muted-foreground", children: [
|
|
262
|
-
l === 0 ? "0" : `${String(
|
|
262
|
+
l === 0 ? "0" : `${String(s + 1)} - ${String(t)}`,
|
|
263
263
|
" sur ",
|
|
264
264
|
l
|
|
265
265
|
] }),
|
|
@@ -288,13 +288,13 @@ function ve({
|
|
|
288
288
|
onClick: () => {
|
|
289
289
|
p((o) => Math.max(1, o - 1));
|
|
290
290
|
},
|
|
291
|
-
disabled:
|
|
291
|
+
disabled: n === 1,
|
|
292
292
|
children: /* @__PURE__ */ e(he, { className: "size-4" })
|
|
293
293
|
}
|
|
294
294
|
),
|
|
295
295
|
/* @__PURE__ */ r("span", { className: "text-sm text-muted-foreground", children: [
|
|
296
296
|
"Page ",
|
|
297
|
-
|
|
297
|
+
n,
|
|
298
298
|
" sur ",
|
|
299
299
|
h
|
|
300
300
|
] }),
|
|
@@ -307,7 +307,7 @@ function ve({
|
|
|
307
307
|
onClick: () => {
|
|
308
308
|
p((o) => Math.min(h, o + 1));
|
|
309
309
|
},
|
|
310
|
-
disabled:
|
|
310
|
+
disabled: n === h,
|
|
311
311
|
children: /* @__PURE__ */ e(ge, { className: "size-4" })
|
|
312
312
|
}
|
|
313
313
|
)
|
|
@@ -315,13 +315,13 @@ function ve({
|
|
|
315
315
|
] })
|
|
316
316
|
] });
|
|
317
317
|
}
|
|
318
|
-
function Ne({ columns: l, visibleColumns:
|
|
318
|
+
function Ne({ columns: l, visibleColumns: s, toggleColumnVisibility: t }) {
|
|
319
319
|
return /* @__PURE__ */ r(A, { children: [
|
|
320
320
|
/* @__PURE__ */ e(P, { asChild: !0, children: /* @__PURE__ */ e(C, { 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(ue, { className: "size-3.5 text-gray-600 dark:text-gray-300" }) }) }),
|
|
321
321
|
/* @__PURE__ */ e(B, { align: "end", className: "w-56", children: l.map((a) => /* @__PURE__ */ e(
|
|
322
|
-
|
|
322
|
+
ne,
|
|
323
323
|
{
|
|
324
|
-
checked:
|
|
324
|
+
checked: s.has(a.key),
|
|
325
325
|
onCheckedChange: () => {
|
|
326
326
|
t(a.key);
|
|
327
327
|
},
|
|
@@ -333,14 +333,14 @@ function Ne({ columns: l, visibleColumns: n, toggleColumnVisibility: t }) {
|
|
|
333
333
|
}
|
|
334
334
|
function He({
|
|
335
335
|
data: l,
|
|
336
|
-
columns:
|
|
336
|
+
columns: s,
|
|
337
337
|
getRowId: t,
|
|
338
338
|
onRowClick: a,
|
|
339
339
|
actions: c,
|
|
340
|
-
bulkActions:
|
|
341
|
-
draggableColumns: p = !
|
|
342
|
-
resizableColumns: f = !
|
|
343
|
-
columnVisibility: h = !
|
|
340
|
+
bulkActions: n,
|
|
341
|
+
draggableColumns: p = !1,
|
|
342
|
+
resizableColumns: f = !1,
|
|
343
|
+
columnVisibility: h = !1,
|
|
344
344
|
isLoading: o = !1,
|
|
345
345
|
bordered: v = !1,
|
|
346
346
|
noDataMessage: w = "Aucun résultat",
|
|
@@ -385,11 +385,11 @@ function He({
|
|
|
385
385
|
setCurrentPage: te
|
|
386
386
|
} = ae({
|
|
387
387
|
data: l,
|
|
388
|
-
columns:
|
|
388
|
+
columns: s,
|
|
389
389
|
getRowId: t,
|
|
390
390
|
defaultPageSize: y,
|
|
391
391
|
actions: c,
|
|
392
|
-
bulkActions:
|
|
392
|
+
bulkActions: n,
|
|
393
393
|
columnVisibility: h,
|
|
394
394
|
totalRows: N,
|
|
395
395
|
currentPage: D,
|
|
@@ -401,7 +401,7 @@ function He({
|
|
|
401
401
|
onSortChange: d
|
|
402
402
|
});
|
|
403
403
|
return /* @__PURE__ */ r("div", { className: "space-y-4", children: [
|
|
404
|
-
k.length > 0 &&
|
|
404
|
+
k.length > 0 && n !== void 0 && n.length > 0 && /* @__PURE__ */ e(ye, { selectedRows: k, setSelectedRows: u, bulkActions: n }),
|
|
405
405
|
/* @__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: [
|
|
406
406
|
/* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */ r("table", { ref: q, className: "w-full", children: [
|
|
407
407
|
/* @__PURE__ */ e(
|
|
@@ -424,7 +424,7 @@ function He({
|
|
|
424
424
|
handleMouseDown: Q,
|
|
425
425
|
hasActions: M,
|
|
426
426
|
bordered: v,
|
|
427
|
-
settingsNode: h ? /* @__PURE__ */ e(Ne, { columns:
|
|
427
|
+
settingsNode: h ? /* @__PURE__ */ e(Ne, { columns: s, visibleColumns: H, toggleColumnVisibility: _ }) : void 0
|
|
428
428
|
}
|
|
429
429
|
),
|
|
430
430
|
/* @__PURE__ */ e(
|
|
@@ -444,7 +444,7 @@ function He({
|
|
|
444
444
|
columnWidths: j,
|
|
445
445
|
hasActions: M || h,
|
|
446
446
|
actions: c,
|
|
447
|
-
columns:
|
|
447
|
+
columns: s
|
|
448
448
|
}
|
|
449
449
|
)
|
|
450
450
|
] }) }),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as r, jsxs as o } from "react/jsx-runtime";
|
|
2
2
|
import { I as J } from "./ImageInput-CJ419eqw.js";
|
|
3
3
|
import { A as V } from "./AppSubTitle-BNd5_q0i.js";
|
|
4
|
-
import { M as Q } from "./MultiSelect-
|
|
4
|
+
import { M as Q } from "./MultiSelect-BPffv2am.js";
|
|
5
5
|
import { aN as W, aQ as $, aR as q, aS as D, aO as A, aT as L, J as X, N as Y, K as F, bR as ee, $ as te } from "./toggle-group-BASGy2mQ.js";
|
|
6
6
|
import "./alert-B78CiTYe.js";
|
|
7
7
|
import "@radix-ui/react-aspect-ratio";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as l, jsx as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useState as k, useRef as w, useMemo as N, useEffect as y } from "react";
|
|
3
3
|
import { $ as C } from "./toggle-group-BASGy2mQ.js";
|
|
4
4
|
import "./alert-B78CiTYe.js";
|
|
5
5
|
import "@radix-ui/react-aspect-ratio";
|
|
@@ -8,22 +8,22 @@ import "@radix-ui/react-collapsible";
|
|
|
8
8
|
import "./sheet-Gop1cIaU.js";
|
|
9
9
|
import { XIcon as L, ChevronDownIcon as R, SearchIcon as T } from "lucide-react";
|
|
10
10
|
import "react-resizable-panels";
|
|
11
|
-
import { c as
|
|
11
|
+
import { c as z } from "./tailwind.helper-B6yFEsav.js";
|
|
12
12
|
import "./select-MWzbMBAS.js";
|
|
13
13
|
import "next-themes";
|
|
14
14
|
import "sonner";
|
|
15
15
|
const J = ({
|
|
16
|
-
options:
|
|
16
|
+
options: i,
|
|
17
17
|
selected: n,
|
|
18
18
|
onToggle: h,
|
|
19
19
|
onClear: d,
|
|
20
20
|
onSelectAll: u,
|
|
21
|
-
placeholder:
|
|
21
|
+
placeholder: E = "Sélectionner...",
|
|
22
22
|
searchable: m = !1,
|
|
23
|
-
searchPlaceholder:
|
|
23
|
+
searchPlaceholder: j = "Rechercher...",
|
|
24
24
|
disabled: f = !1
|
|
25
25
|
}) => {
|
|
26
|
-
const [c, p] =
|
|
26
|
+
const [c, p] = k(""), [a, b] = k(!1), g = w(null), x = w(null), o = N(() => c === "" ? i : i.filter((e) => e.label.toLowerCase().includes(c.toLowerCase())), [i, c]), v = N(() => o.length === 0 ? !1 : o.every((e) => n.includes(e.value)), [o, n]);
|
|
27
27
|
y(() => {
|
|
28
28
|
a && m && requestAnimationFrame(() => {
|
|
29
29
|
var e;
|
|
@@ -31,8 +31,8 @@ const J = ({
|
|
|
31
31
|
});
|
|
32
32
|
}, [a, m]), y(() => {
|
|
33
33
|
if (!a) return;
|
|
34
|
-
const e = (
|
|
35
|
-
g.current !== null && !g.current.contains(
|
|
34
|
+
const e = (t) => {
|
|
35
|
+
g.current !== null && !g.current.contains(t.target) && (b(!1), p(""));
|
|
36
36
|
};
|
|
37
37
|
return document.addEventListener("mousedown", e), () => {
|
|
38
38
|
document.removeEventListener("mousedown", e);
|
|
@@ -40,14 +40,14 @@ const J = ({
|
|
|
40
40
|
}, [a]);
|
|
41
41
|
const I = () => {
|
|
42
42
|
if (v) {
|
|
43
|
-
const e = o.map((
|
|
44
|
-
u !== void 0 ? u(
|
|
43
|
+
const e = o.map((s) => s.value), t = n.filter((s) => !e.includes(s));
|
|
44
|
+
u !== void 0 ? u(t) : d();
|
|
45
45
|
} else {
|
|
46
46
|
const e = [...n];
|
|
47
|
-
o.forEach((
|
|
48
|
-
e.includes(
|
|
49
|
-
}), u !== void 0 ? u(e) : o.forEach((
|
|
50
|
-
n.includes(
|
|
47
|
+
o.forEach((t) => {
|
|
48
|
+
e.includes(t.value) || e.push(t.value);
|
|
49
|
+
}), u !== void 0 ? u(e) : o.forEach((t) => {
|
|
50
|
+
n.includes(t.value) || h(t.value);
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
};
|
|
@@ -60,18 +60,18 @@ const J = ({
|
|
|
60
60
|
onClick: () => {
|
|
61
61
|
f || b((e) => (e && p(""), !e));
|
|
62
62
|
},
|
|
63
|
-
className:
|
|
63
|
+
className: z(
|
|
64
64
|
"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
65
65
|
a && "ring-2 ring-ring ring-offset-2",
|
|
66
66
|
n.length === 0 && "text-muted-foreground"
|
|
67
67
|
),
|
|
68
68
|
children: [
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
var
|
|
71
|
-
return ((
|
|
69
|
+
/* @__PURE__ */ r("span", { className: "truncate", children: n.length === 0 ? E : n.map((e) => {
|
|
70
|
+
var t;
|
|
71
|
+
return ((t = i.find((s) => s.value === e)) == null ? void 0 : t.label) ?? e;
|
|
72
72
|
}).join(", ") }),
|
|
73
73
|
/* @__PURE__ */ l("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
74
|
-
n.length > 0 && !f && /* @__PURE__ */
|
|
74
|
+
n.length > 0 && !f && /* @__PURE__ */ r(
|
|
75
75
|
"span",
|
|
76
76
|
{
|
|
77
77
|
role: "button",
|
|
@@ -83,23 +83,23 @@ const J = ({
|
|
|
83
83
|
e.preventDefault(), e.stopPropagation(), d();
|
|
84
84
|
},
|
|
85
85
|
className: "text-muted-foreground hover:text-foreground",
|
|
86
|
-
children: /* @__PURE__ */
|
|
86
|
+
children: /* @__PURE__ */ r(L, { className: "size-4" })
|
|
87
87
|
}
|
|
88
88
|
),
|
|
89
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ r(R, { className: z("size-4 opacity-50 shrink-0 transition-transform", a && "rotate-180") })
|
|
90
90
|
] })
|
|
91
91
|
]
|
|
92
92
|
}
|
|
93
93
|
),
|
|
94
94
|
a ? /* @__PURE__ */ l("div", { className: "absolute left-0 right-0 top-[calc(100%+4px)] z-[100] rounded-md border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 slide-in-from-top-2", children: [
|
|
95
|
-
m ? /* @__PURE__ */
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
/* @__PURE__ */
|
|
95
|
+
m ? /* @__PURE__ */ r("div", { className: "border-b border-border p-2", children: /* @__PURE__ */ l("div", { className: "relative", children: [
|
|
96
|
+
/* @__PURE__ */ r(T, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
|
|
97
|
+
/* @__PURE__ */ r(
|
|
98
98
|
"input",
|
|
99
99
|
{
|
|
100
100
|
ref: x,
|
|
101
101
|
className: "w-full rounded-md bg-muted/50 py-1.5 pl-7 pr-2 text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-1 focus:ring-ring",
|
|
102
|
-
placeholder:
|
|
102
|
+
placeholder: j,
|
|
103
103
|
value: c,
|
|
104
104
|
onChange: (e) => {
|
|
105
105
|
p(e.target.value);
|
|
@@ -109,12 +109,12 @@ const J = ({
|
|
|
109
109
|
] }) }) : null,
|
|
110
110
|
/* @__PURE__ */ l("div", { className: "flex flex-col gap-0.5 max-h-56 overflow-y-auto p-1.5 scrollbar-thin scrollbar-thumb-rounded scrollbar-thumb-muted-foreground/20 scrollbar-track-transparent [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-muted-foreground/20 [&::-webkit-scrollbar-track]:bg-transparent", children: [
|
|
111
111
|
o.length > 0 && /* @__PURE__ */ l("label", { className: "flex items-center gap-2.5 rounded-md px-2 py-2 text-sm hover:bg-muted cursor-pointer transition-colors", children: [
|
|
112
|
-
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */ r(C, { checked: v, onCheckedChange: I }),
|
|
113
113
|
"Tout sélectionner"
|
|
114
114
|
] }),
|
|
115
|
-
o.length === 0 && /* @__PURE__ */
|
|
115
|
+
o.length === 0 && /* @__PURE__ */ r("p", { className: "px-2 py-3 text-center text-xs text-muted-foreground", children: "Aucun résultat" }),
|
|
116
116
|
o.map((e) => /* @__PURE__ */ l("label", { className: "flex items-center gap-2.5 rounded-md px-2 py-2 text-sm hover:bg-muted cursor-pointer transition-colors", children: [
|
|
117
|
-
/* @__PURE__ */
|
|
117
|
+
/* @__PURE__ */ r(
|
|
118
118
|
C,
|
|
119
119
|
{
|
|
120
120
|
checked: n.includes(e.value),
|
|
@@ -123,10 +123,11 @@ const J = ({
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
),
|
|
126
|
+
e.color && /* @__PURE__ */ r("span", { className: "size-2.5 shrink-0 rounded-full", style: { backgroundColor: e.color } }),
|
|
126
127
|
e.label
|
|
127
128
|
] }, e.value))
|
|
128
129
|
] }),
|
|
129
|
-
n.length > 0 && /* @__PURE__ */
|
|
130
|
+
n.length > 0 && /* @__PURE__ */ r("div", { className: "border-t border-border p-1.5", children: /* @__PURE__ */ r(
|
|
130
131
|
"button",
|
|
131
132
|
{
|
|
132
133
|
type: "button",
|
|
@@ -1,88 +1,88 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsxs as s, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import * as w from "react";
|
|
3
3
|
import { useState as k, useRef as C, useEffect as z, useMemo as S } from "react";
|
|
4
|
-
import { I, bv as
|
|
4
|
+
import { I, bv as O, bx as T, bw as j } from "./toggle-group-BASGy2mQ.js";
|
|
5
5
|
import "./alert-B78CiTYe.js";
|
|
6
6
|
import "@radix-ui/react-aspect-ratio";
|
|
7
|
-
import { B as
|
|
7
|
+
import { B as g } from "./tooltip-BWyFpIxo.js";
|
|
8
8
|
import "@radix-ui/react-collapsible";
|
|
9
|
-
import { I as
|
|
10
|
-
import { CalendarIcon as
|
|
9
|
+
import { I as A } from "./sheet-Gop1cIaU.js";
|
|
10
|
+
import { CalendarIcon as D, XIcon as M, ChevronDownIcon as q, SearchIcon as E, CheckIcon as B } from "lucide-react";
|
|
11
11
|
import "react-resizable-panels";
|
|
12
|
-
import { c as
|
|
12
|
+
import { c as f } from "./tailwind.helper-B6yFEsav.js";
|
|
13
13
|
import "./select-MWzbMBAS.js";
|
|
14
14
|
import "next-themes";
|
|
15
15
|
import "sonner";
|
|
16
|
-
import { format as
|
|
17
|
-
import { fr as
|
|
18
|
-
const
|
|
19
|
-
const [u,
|
|
16
|
+
import { format as v } from "date-fns";
|
|
17
|
+
import { fr as N } from "date-fns/locale";
|
|
18
|
+
const oe = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
19
|
+
const [u, m] = k(!1), c = C(null);
|
|
20
20
|
z(() => {
|
|
21
21
|
if (!u) return;
|
|
22
|
-
const
|
|
23
|
-
c.current !== null && !c.current.contains(n.target) &&
|
|
22
|
+
const l = (n) => {
|
|
23
|
+
c.current !== null && !c.current.contains(n.target) && m(!1);
|
|
24
24
|
};
|
|
25
|
-
return document.addEventListener("mousedown",
|
|
26
|
-
document.removeEventListener("mousedown",
|
|
25
|
+
return document.addEventListener("mousedown", l), () => {
|
|
26
|
+
document.removeEventListener("mousedown", l);
|
|
27
27
|
};
|
|
28
28
|
}, [u]);
|
|
29
29
|
const d = () => {
|
|
30
|
-
|
|
31
|
-
}, a = (
|
|
32
|
-
o(
|
|
30
|
+
m((l) => !l);
|
|
31
|
+
}, a = (l) => {
|
|
32
|
+
o(l), m(!1);
|
|
33
33
|
};
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
|
|
34
|
+
return /* @__PURE__ */ s("div", { ref: c, className: "relative w-full", children: [
|
|
35
|
+
/* @__PURE__ */ s(
|
|
36
|
+
g,
|
|
37
37
|
{
|
|
38
38
|
variant: "outline",
|
|
39
39
|
type: "button",
|
|
40
40
|
onClick: d,
|
|
41
|
-
className:
|
|
41
|
+
className: f(
|
|
42
42
|
"w-full justify-start text-left font-normal focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
43
43
|
u && "ring-2 ring-ring ring-offset-2",
|
|
44
44
|
r === void 0 && "text-muted-foreground"
|
|
45
45
|
),
|
|
46
46
|
children: [
|
|
47
|
-
/* @__PURE__ */ t(
|
|
48
|
-
r !== void 0 ?
|
|
47
|
+
/* @__PURE__ */ t(D, { className: "mr-2 size-4 shrink-0" }),
|
|
48
|
+
r !== void 0 ? v(r, "dd/MM/yyyy", { locale: N }) : /* @__PURE__ */ t("span", { children: p })
|
|
49
49
|
]
|
|
50
50
|
}
|
|
51
51
|
),
|
|
52
52
|
u ? /* @__PURE__ */ t("div", { className: "absolute left-0 top-[calc(100%+4px)] z-[100] rounded-md border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 slide-in-from-top-2", children: /* @__PURE__ */ t(I, { mode: "single", selected: r, onSelect: a }) }) : null
|
|
53
53
|
] });
|
|
54
|
-
},
|
|
55
|
-
const [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}, [
|
|
59
|
-
const
|
|
54
|
+
}, ne = ({ value: r, onChange: o, placeholder: p = "Selectionner une periode", className: u }) => {
|
|
55
|
+
const [m, c] = w.useState(!1), [d, a] = w.useState(r);
|
|
56
|
+
w.useEffect(() => {
|
|
57
|
+
m && a(r);
|
|
58
|
+
}, [m, r]);
|
|
59
|
+
const l = (i) => {
|
|
60
60
|
i.stopPropagation(), o(void 0), c(!1);
|
|
61
61
|
}, n = () => {
|
|
62
62
|
o(d), c(!1);
|
|
63
|
-
}, g = () => {
|
|
64
|
-
a(r), c(!1);
|
|
65
63
|
}, b = () => {
|
|
64
|
+
a(r), c(!1);
|
|
65
|
+
}, y = () => {
|
|
66
66
|
a(void 0);
|
|
67
|
-
},
|
|
68
|
-
return /* @__PURE__ */ t("div", { className:
|
|
69
|
-
/* @__PURE__ */ t(
|
|
70
|
-
/* @__PURE__ */ t(
|
|
71
|
-
|
|
67
|
+
}, x = (i) => i != null && i.from ? !i.to || i.from.getTime() === i.to.getTime() ? v(i.from, "dd MMM yyyy", { locale: N }) : `${v(i.from, "dd MMM yyyy", { locale: N })} - ${v(i.to, "dd MMM yyyy", { locale: N })}` : p;
|
|
68
|
+
return /* @__PURE__ */ t("div", { className: f("grid gap-2", u), children: /* @__PURE__ */ s(O, { open: m, onOpenChange: c, children: [
|
|
69
|
+
/* @__PURE__ */ t(T, { asChild: !0, children: /* @__PURE__ */ s(g, { id: "date", variant: "outline", className: f("w-[300px] justify-start text-left font-normal", !(r != null && r.from) && "text-muted-foreground"), children: [
|
|
70
|
+
/* @__PURE__ */ t(D, { className: "mr-2 size-4" }),
|
|
71
|
+
x(r),
|
|
72
72
|
(r == null ? void 0 : r.from) && /* @__PURE__ */ t(
|
|
73
|
-
|
|
73
|
+
g,
|
|
74
74
|
{
|
|
75
75
|
type: "button",
|
|
76
76
|
variant: "ghost",
|
|
77
77
|
size: "icon",
|
|
78
78
|
"aria-label": "Effacer la periode selectionnee",
|
|
79
79
|
className: "ml-auto h-5 w-5 opacity-50 hover:opacity-100",
|
|
80
|
-
onClick:
|
|
80
|
+
onClick: l,
|
|
81
81
|
children: /* @__PURE__ */ t(M, { className: "size-4" })
|
|
82
82
|
}
|
|
83
83
|
)
|
|
84
84
|
] }) }),
|
|
85
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ s(j, { className: "w-auto p-0", align: "start", side: "bottom", sideOffset: 4, children: [
|
|
86
86
|
/* @__PURE__ */ t(
|
|
87
87
|
I,
|
|
88
88
|
{
|
|
@@ -95,63 +95,65 @@ const re = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
|
95
95
|
className: "pointer-events-auto p-3"
|
|
96
96
|
}
|
|
97
97
|
),
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
/* @__PURE__ */ t(
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
/* @__PURE__ */ t(
|
|
102
|
-
/* @__PURE__ */ t(
|
|
98
|
+
/* @__PURE__ */ s("div", { className: "flex items-center justify-between border-t border-border px-3 py-2", children: [
|
|
99
|
+
/* @__PURE__ */ t(g, { variant: "ghost", size: "sm", onClick: y, children: "Effacer" }),
|
|
100
|
+
/* @__PURE__ */ s("div", { className: "flex gap-2", children: [
|
|
101
|
+
/* @__PURE__ */ t(g, { variant: "ghost", size: "sm", onClick: b, children: "Annuler" }),
|
|
102
|
+
/* @__PURE__ */ t(g, { size: "sm", onClick: n, children: "Appliquer" })
|
|
103
103
|
] })
|
|
104
104
|
] })
|
|
105
105
|
] })
|
|
106
106
|
] }) });
|
|
107
|
-
},
|
|
107
|
+
}, se = ({
|
|
108
108
|
options: r = [],
|
|
109
109
|
value: o,
|
|
110
110
|
onChange: p,
|
|
111
111
|
onClear: u,
|
|
112
|
-
placeholder:
|
|
112
|
+
placeholder: m = "Sélectionner...",
|
|
113
113
|
searchPlaceholder: c = "Rechercher...",
|
|
114
114
|
disabled: d = !1
|
|
115
115
|
}) => {
|
|
116
|
-
const [a,
|
|
117
|
-
var e;
|
|
116
|
+
const [a, l] = k(""), [n, b] = k(!1), y = C(null), x = C(null), i = S(() => a === "" ? r : r.filter((e) => e.label.toLowerCase().includes(a.toLowerCase())), [r, a]), h = S(() => {
|
|
118
117
|
if (!(o === void 0 || o === ""))
|
|
119
|
-
return
|
|
120
|
-
}, [r, o]);
|
|
118
|
+
return r.find((e) => e.value === o);
|
|
119
|
+
}, [r, o]), P = o === void 0 || o === "" ? void 0 : (h == null ? void 0 : h.label) ?? o;
|
|
121
120
|
z(() => {
|
|
122
121
|
n && requestAnimationFrame(() => {
|
|
123
122
|
var e;
|
|
124
|
-
(e =
|
|
123
|
+
(e = x.current) == null || e.focus();
|
|
125
124
|
});
|
|
126
125
|
}, [n]), z(() => {
|
|
127
126
|
if (!n) return;
|
|
128
|
-
const e = (
|
|
129
|
-
|
|
127
|
+
const e = (L) => {
|
|
128
|
+
y.current !== null && !y.current.contains(L.target) && (b(!1), l(""));
|
|
130
129
|
};
|
|
131
130
|
return document.addEventListener("mousedown", e), () => {
|
|
132
131
|
document.removeEventListener("mousedown", e);
|
|
133
132
|
};
|
|
134
133
|
}, [n]);
|
|
135
|
-
const
|
|
136
|
-
p(e),
|
|
134
|
+
const R = (e) => {
|
|
135
|
+
p(e), b(!1), l("");
|
|
137
136
|
};
|
|
138
|
-
return /* @__PURE__ */
|
|
139
|
-
/* @__PURE__ */
|
|
137
|
+
return /* @__PURE__ */ s("div", { ref: y, className: "relative w-full", children: [
|
|
138
|
+
/* @__PURE__ */ s(
|
|
140
139
|
"button",
|
|
141
140
|
{
|
|
142
141
|
type: "button",
|
|
143
142
|
onClick: () => {
|
|
144
|
-
d ||
|
|
143
|
+
d || b((e) => (e && l(""), !e));
|
|
145
144
|
},
|
|
146
145
|
disabled: d,
|
|
147
|
-
className:
|
|
146
|
+
className: f(
|
|
148
147
|
"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
149
148
|
n && "ring-2 ring-ring ring-offset-2",
|
|
150
149
|
(o === void 0 || o === "") && "text-muted-foreground"
|
|
151
150
|
),
|
|
152
151
|
children: [
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
-
|
|
152
|
+
/* @__PURE__ */ s("span", { className: "flex items-center gap-2 truncate", children: [
|
|
153
|
+
(h == null ? void 0 : h.color) && /* @__PURE__ */ t("span", { className: "size-2.5 shrink-0 rounded-full", style: { backgroundColor: h.color } }),
|
|
154
|
+
/* @__PURE__ */ t("span", { className: "truncate", children: P ?? m })
|
|
155
|
+
] }),
|
|
156
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
|
|
155
157
|
u && o !== void 0 && o !== "" && !d && /* @__PURE__ */ t(
|
|
156
158
|
"span",
|
|
157
159
|
{
|
|
@@ -167,42 +169,43 @@ const re = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
|
167
169
|
children: /* @__PURE__ */ t(M, { className: "size-4" })
|
|
168
170
|
}
|
|
169
171
|
),
|
|
170
|
-
/* @__PURE__ */ t(
|
|
172
|
+
/* @__PURE__ */ t(q, { className: f("size-4 opacity-50 shrink-0 transition-transform", n && "rotate-180") })
|
|
171
173
|
] })
|
|
172
174
|
]
|
|
173
175
|
}
|
|
174
176
|
),
|
|
175
|
-
n ? /* @__PURE__ */
|
|
176
|
-
/* @__PURE__ */ t("div", { className: "border-b border-border p-2", children: /* @__PURE__ */
|
|
177
|
-
/* @__PURE__ */ t(
|
|
177
|
+
n ? /* @__PURE__ */ s("div", { className: "absolute left-0 right-0 top-[calc(100%+4px)] z-[100] rounded-md border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 slide-in-from-top-2", children: [
|
|
178
|
+
/* @__PURE__ */ t("div", { className: "border-b border-border p-2", children: /* @__PURE__ */ s("div", { className: "relative", children: [
|
|
179
|
+
/* @__PURE__ */ t(E, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
|
|
178
180
|
/* @__PURE__ */ t(
|
|
179
181
|
"input",
|
|
180
182
|
{
|
|
181
|
-
ref:
|
|
183
|
+
ref: x,
|
|
182
184
|
className: "w-full rounded-md bg-muted/50 py-1.5 pl-7 pr-2 text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-1 focus:ring-ring",
|
|
183
185
|
placeholder: c,
|
|
184
186
|
value: a,
|
|
185
187
|
onChange: (e) => {
|
|
186
|
-
|
|
188
|
+
l(e.target.value);
|
|
187
189
|
}
|
|
188
190
|
}
|
|
189
191
|
)
|
|
190
192
|
] }) }),
|
|
191
|
-
/* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ s("div", { className: "flex flex-col gap-0.5 max-h-56 overflow-y-auto p-1.5 scrollbar-thin scrollbar-thumb-rounded scrollbar-thumb-muted-foreground/20 scrollbar-track-transparent [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-muted-foreground/20 [&::-webkit-scrollbar-track]:bg-transparent", children: [
|
|
192
194
|
i.length === 0 && /* @__PURE__ */ t("p", { className: "px-2 py-3 text-center text-xs text-muted-foreground", children: "Aucun résultat" }),
|
|
193
|
-
i.map((e) => /* @__PURE__ */
|
|
195
|
+
i.map((e) => /* @__PURE__ */ s(
|
|
194
196
|
"button",
|
|
195
197
|
{
|
|
196
198
|
type: "button",
|
|
197
199
|
onClick: () => {
|
|
198
|
-
|
|
200
|
+
R(e.value);
|
|
199
201
|
},
|
|
200
|
-
className:
|
|
202
|
+
className: f(
|
|
201
203
|
"flex items-center gap-2.5 rounded-md px-2 py-2 text-sm hover:bg-muted cursor-pointer transition-colors text-left w-full",
|
|
202
204
|
o === e.value && "bg-muted font-medium"
|
|
203
205
|
),
|
|
204
206
|
children: [
|
|
205
|
-
/* @__PURE__ */ t(
|
|
207
|
+
/* @__PURE__ */ t(B, { className: f("size-3.5 shrink-0", o === e.value ? "opacity-100" : "opacity-0") }),
|
|
208
|
+
e.color && /* @__PURE__ */ t("span", { className: "size-2.5 shrink-0 rounded-full", style: { backgroundColor: e.color } }),
|
|
206
209
|
e.label
|
|
207
210
|
]
|
|
208
211
|
},
|
|
@@ -211,22 +214,22 @@ const re = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
|
211
214
|
] })
|
|
212
215
|
] }) : null
|
|
213
216
|
] });
|
|
214
|
-
},
|
|
217
|
+
}, le = ({
|
|
215
218
|
searchQuery: r,
|
|
216
219
|
search: o,
|
|
217
220
|
placeholder: p = "Rechercher...",
|
|
218
221
|
onSearch: u,
|
|
219
|
-
onSubmit:
|
|
222
|
+
onSubmit: m,
|
|
220
223
|
onClear: c,
|
|
221
224
|
className: d
|
|
222
225
|
}) => {
|
|
223
|
-
const a = r ?? o ?? "",
|
|
226
|
+
const a = r ?? o ?? "", l = () => {
|
|
224
227
|
u(""), c !== void 0 && c();
|
|
225
228
|
};
|
|
226
|
-
return /* @__PURE__ */
|
|
227
|
-
/* @__PURE__ */ t(
|
|
229
|
+
return /* @__PURE__ */ s("div", { className: f("relative h-fit w-full md:w-64", d), children: [
|
|
230
|
+
/* @__PURE__ */ t(E, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground w-4 h-4" }),
|
|
228
231
|
/* @__PURE__ */ t(
|
|
229
|
-
|
|
232
|
+
A,
|
|
230
233
|
{
|
|
231
234
|
placeholder: p,
|
|
232
235
|
value: a,
|
|
@@ -235,16 +238,16 @@ const re = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
|
235
238
|
},
|
|
236
239
|
className: "pl-8",
|
|
237
240
|
onKeyDown: (n) => {
|
|
238
|
-
n.key === "Enter" &&
|
|
241
|
+
n.key === "Enter" && m !== void 0 && (n.preventDefault(), m());
|
|
239
242
|
}
|
|
240
243
|
}
|
|
241
244
|
),
|
|
242
|
-
a !== "" ? /* @__PURE__ */ t("button", { onClick:
|
|
245
|
+
a !== "" ? /* @__PURE__ */ t("button", { onClick: l, className: "absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700", type: "button", children: /* @__PURE__ */ t(M, { className: "size-4" }) }) : null
|
|
243
246
|
] });
|
|
244
247
|
};
|
|
245
248
|
export {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
249
|
+
oe as D,
|
|
250
|
+
le as S,
|
|
251
|
+
ne as a,
|
|
252
|
+
se as b
|
|
250
253
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as u, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useState as F, useEffect as $, useMemo as A } from "react";
|
|
3
|
-
import { a as D, D as O, b as j, S as M } from "./SearchInput-
|
|
3
|
+
import { a as D, D as O, b as j, S as M } from "./SearchInput-bwnVKhhE.js";
|
|
4
4
|
import { B as k, a$ as I, bv as R, bx as z, bw as B, $ as C } from "./toggle-group-BASGy2mQ.js";
|
|
5
5
|
import "./alert-B78CiTYe.js";
|
|
6
6
|
import "@radix-ui/react-aspect-ratio";
|
|
@@ -15,7 +15,7 @@ import { S as W, h as Y, i as Z, a as q, c as ee } from "./select-MWzbMBAS.js";
|
|
|
15
15
|
import "next-themes";
|
|
16
16
|
import "sonner";
|
|
17
17
|
import { c as re } from "./tailwind.helper-B6yFEsav.js";
|
|
18
|
-
import { M as te } from "./MultiSelect-
|
|
18
|
+
import { M as te } from "./MultiSelect-BPffv2am.js";
|
|
19
19
|
const L = (l, n, c = {}) => {
|
|
20
20
|
if (n instanceof Date)
|
|
21
21
|
return n.toLocaleDateString("fr-FR");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as a, jsxs as s } from "react/jsx-runtime";
|
|
2
2
|
import { b as m, T as h, c as u, B as g, a as f } from "./tooltip-BWyFpIxo.js";
|
|
3
3
|
import { S as v, h as b, i as N, a as S, c as x } from "./select-MWzbMBAS.js";
|
|
4
|
-
import { u as C } from "./useTheme-
|
|
4
|
+
import { u as C } from "./useTheme-CSr_h5xJ.js";
|
|
5
5
|
function I({ themeOptions: r, variant: i = "select" }) {
|
|
6
6
|
const { theme: n, handleThemeChange: t, currentThemeOption: e, nextThemeOption: c, cycleTheme: o } = C(r);
|
|
7
7
|
if (i === "mini") {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as i, C as s, F as g } from "../../../ConfirmationDialog-
|
|
1
|
+
import { A as i, C as s, F as g } from "../../../ConfirmationDialog-Dy_6PcOr.js";
|
|
2
2
|
import { D as r, a as D, b as e, c as t, d as n, e as p, f, g as m, h as C, i as F, P } from "../../../toggle-group-BASGy2mQ.js";
|
|
3
3
|
export {
|
|
4
4
|
i as AppDialog,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { D as r, M as o } from "../../MetricCard-D-qPl6zh.js";
|
|
2
2
|
import { K as t, a as i, S as l, b as p } from "../../SkeletonCards-qHukR79N.js";
|
|
3
|
-
import { A as m, C as d, F as g } from "../../ConfirmationDialog-
|
|
3
|
+
import { A as m, C as d, F as g } from "../../ConfirmationDialog-Dy_6PcOr.js";
|
|
4
4
|
import { D as A, a as D, b as T, c as n, d as c, e as x, f as S, g as C, h as F, i as P, P as h } from "../../toggle-group-BASGy2mQ.js";
|
|
5
|
-
import { A as k, a as H, F as I, S as K, T as v } from "../../TableFilter-
|
|
6
|
-
import { G as M } from "../../GenericForm-
|
|
5
|
+
import { A as k, a as H, F as I, S as K, T as v } from "../../TableFilter-mQSKN8O8.js";
|
|
6
|
+
import { G as M } from "../../GenericForm-Bb4E2Wxd.js";
|
|
7
7
|
import { I as L } from "../../ImageInput-CJ419eqw.js";
|
|
8
|
-
import { D as G, a as N, S as O, b as R } from "../../SearchInput-
|
|
9
|
-
import { M as j } from "../../MultiSelect-
|
|
8
|
+
import { D as G, a as N, S as O, b as R } from "../../SearchInput-bwnVKhhE.js";
|
|
9
|
+
import { M as j } from "../../MultiSelect-BPffv2am.js";
|
|
10
10
|
import { A as w } from "../../AppActions-DCaejx-3.js";
|
|
11
11
|
import { A as J, K as Q } from "../../KpiCardsLayout-CK1TEUc1.js";
|
|
12
12
|
import { A as W } from "../../AppSubTitle-BNd5_q0i.js";
|
|
@@ -15,9 +15,9 @@ import { S as _, a as $, b as aa, T as ea } from "../../Topbar-DMyjbOTI.js";
|
|
|
15
15
|
import { E as oa } from "../../ErrorAlert-DH1onuyt.js";
|
|
16
16
|
import { E as ta } from "../../ErrorState-vU8d4CwD.js";
|
|
17
17
|
import { L as la } from "../../LoadingState-BN0YaPSs.js";
|
|
18
|
-
import { D as ba, T as ma, a as da, b as ga, c as fa, d as Aa, e as Da } from "../../DataTable-
|
|
18
|
+
import { D as ba, T as ma, a as da, b as ga, c as fa, d as Aa, e as Da } from "../../DataTable-DJM7KWWK.js";
|
|
19
19
|
import { A as na, a as ca, b as xa, c as Sa } from "../../AppVerticalTabs-NZ02HPGP.js";
|
|
20
|
-
import { T as Fa } from "../../ThemeSelector-
|
|
20
|
+
import { T as Fa } from "../../ThemeSelector-CQ3fSDJ2.js";
|
|
21
21
|
export {
|
|
22
22
|
k as ActiveFilters,
|
|
23
23
|
H as AdvancedFilters,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSelect.d.ts","sourceRoot":"","sources":["../../../../src/components/core/inputs/MultiSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAIpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,UAAU,gBAAgB;IACxB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,WAAW,GAAI,8GAUzB,gBAAgB,KAAG,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"MultiSelect.d.ts","sourceRoot":"","sources":["../../../../src/components/core/inputs/MultiSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAIpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,UAAU,gBAAgB;IACxB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,WAAW,GAAI,8GAUzB,gBAAgB,KAAG,KAAK,CAAC,YAqK3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchableSelect.d.ts","sourceRoot":"","sources":["../../../../src/components/core/inputs/SearchableSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAGpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,UAAU,qBAAqB;IAC7B,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,gBAAgB,GAAI,kFAQ9B,qBAAqB,KAAG,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"SearchableSelect.d.ts","sourceRoot":"","sources":["../../../../src/components/core/inputs/SearchableSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAGpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,UAAU,qBAAqB;IAC7B,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,gBAAgB,GAAI,kFAQ9B,qBAAqB,KAAG,KAAK,CAAC,YAuIhC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { I as r } from "../../../ImageInput-CJ419eqw.js";
|
|
2
|
-
import { D as c, a as o, S as s, b as p } from "../../../SearchInput-
|
|
3
|
-
import { M as l } from "../../../MultiSelect-
|
|
2
|
+
import { D as c, a as o, S as s, b as p } from "../../../SearchInput-bwnVKhhE.js";
|
|
3
|
+
import { M as l } from "../../../MultiSelect-BPffv2am.js";
|
|
4
4
|
export {
|
|
5
5
|
c as DatePicker,
|
|
6
6
|
o as DateRangePicker,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../../src/components/core/table/DataTable.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../../src/components/core/table/DataTable.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAOvE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEvE,MAAM,WAAW,cAAc,CAAC,CAAC;IAC/B,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;IACxB,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC;IAC9B,OAAO,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;IACzB,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;IAC3B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAG3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAG9C,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,aAAa,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAC/B,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,SAAS,EAAE,KAAK,GAAG,MAAM,KAAK,IAAI,CAAC;CAC3E;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,EAC3B,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,UAAU,EACV,OAAO,EACP,WAAW,EACX,gBAAwB,EACxB,gBAAwB,EACxB,gBAAwB,EACxB,SAAiB,EACjB,QAAgB,EAChB,aAAgC,EAChC,eAAmC,EACnC,eAA2C,EAC3C,SAAS,EACT,WAAW,EACX,QAAQ,EAAE,kBAAkB,EAC5B,YAAY,EACZ,gBAAgB,EAChB,UAAU,EAAE,oBAAoB,EAChC,aAAa,EAAE,uBAAuB,EACtC,YAAY,GACb,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAkHvC"}
|
package/dist/components/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { D as o, M as r } from "../MetricCard-D-qPl6zh.js";
|
|
2
2
|
import { K as t, a as n, S as i, b as l } from "../SkeletonCards-qHukR79N.js";
|
|
3
|
-
import { A as p, C as u, F as g } from "../ConfirmationDialog-
|
|
3
|
+
import { A as p, C as u, F as g } from "../ConfirmationDialog-Dy_6PcOr.js";
|
|
4
4
|
import { A as m, j as C, k as S, l as T, m as c, n as D, o as M, p as x, q as A, r as I, s as P, t as h, u as f, v as w, w as v, x as F, B as L, y as B, z as G, C as H, E as R, F as k, G as N, H as y, I as E, J as O, K as V, L as K, M as z, N as U, O as j, Q as q, R as J, S as Q, T as W, U as X, V as Y, W as Z, X as _, Y as $, Z as aa, _ as ea, $ as oa, a0 as ra, a1 as sa, a2 as ta, a3 as na, a4 as ia, a5 as la, a6 as ba, a7 as pa, a8 as ua, a9 as ga, aa as da, ab as ma, ac as Ca, ad as Sa, ae as Ta, af as ca, ag as Da, ah as Ma, ai as xa, aj as Aa, ak as Ia, al as Pa, am as ha, an as fa, D as wa, a as va, b as Fa, c as La, d as Ba, e as Ga, f as Ha, g as Ra, h as ka, i as Na, ao as ya, ap as Ea, aq as Oa, ar as Va, as as Ka, at as za, au as Ua, av as ja, aw as qa, ax as Ja, ay as Qa, az as Wa, aA as Xa, aB as Ya, aC as Za, aD as _a, aE as $a, aF as ae, aG as ee, aH as oe, aI as re, aJ as se, aK as te, aL as ne, aM as ie, aN as le, aO as be, aP as pe, aQ as ue, aR as ge, aS as de, aT as me, aU as Ce, aV as Se, aW as Te, aX as ce, aY as De, aZ as Me, a_ as xe, a$ as Ae, b0 as Ie, b1 as Pe, b2 as he, b3 as fe, b4 as we, b5 as ve, b6 as Fe, b7 as Le, b8 as Be, b9 as Ge, ba as He, bb as Re, bc as ke, bd as Ne, be as ye, bf as Ee, bg as Oe, bh as Ve, bi as Ke, bj as ze, bk as Ue, bl as je, bm as qe, bn as Je, bo as Qe, bp as We, bq as Xe, br as Ye, bs as Ze, bt as _e, bu as $e, bv as ao, bw as eo, bx as oo, P as ro, by as so, bz as to, bA as no, bB as io, bC as lo, bD as bo, bE as po, bF as uo, bG as go, bH as mo, bI as Co, bJ as So, bK as To, bL as co, bM as Do, bN as Mo, bO as xo, bP as Ao, bQ as Io, bR as Po, bS as ho, bT as fo, bU as wo, bV as vo, bW as Fo, bX as Lo, bY as Bo, bZ as Go, b_ as Ho, b$ as Ro, c0 as ko, c1 as No, c2 as yo, c3 as Eo } from "../toggle-group-BASGy2mQ.js";
|
|
5
|
-
import { A as Vo, a as Ko, F as zo, S as Uo, T as jo } from "../TableFilter-
|
|
6
|
-
import { G as Jo } from "../GenericForm-
|
|
5
|
+
import { A as Vo, a as Ko, F as zo, S as Uo, T as jo } from "../TableFilter-mQSKN8O8.js";
|
|
6
|
+
import { G as Jo } from "../GenericForm-Bb4E2Wxd.js";
|
|
7
7
|
import { I as Wo } from "../ImageInput-CJ419eqw.js";
|
|
8
|
-
import { D as Yo, a as Zo, S as _o, b as $o } from "../SearchInput-
|
|
9
|
-
import { M as er } from "../MultiSelect-
|
|
8
|
+
import { D as Yo, a as Zo, S as _o, b as $o } from "../SearchInput-bwnVKhhE.js";
|
|
9
|
+
import { M as er } from "../MultiSelect-BPffv2am.js";
|
|
10
10
|
import { A as rr } from "../AppActions-DCaejx-3.js";
|
|
11
11
|
import { A as tr, K as nr } from "../KpiCardsLayout-CK1TEUc1.js";
|
|
12
12
|
import { A as lr } from "../AppSubTitle-BNd5_q0i.js";
|
|
@@ -15,9 +15,9 @@ import { S as gr, a as dr, b as mr, T as Cr } from "../Topbar-DMyjbOTI.js";
|
|
|
15
15
|
import { E as Tr } from "../ErrorAlert-DH1onuyt.js";
|
|
16
16
|
import { E as Dr } from "../ErrorState-vU8d4CwD.js";
|
|
17
17
|
import { L as xr } from "../LoadingState-BN0YaPSs.js";
|
|
18
|
-
import { D as Ir, T as Pr, a as hr, b as fr, c as wr, d as vr, e as Fr } from "../DataTable-
|
|
18
|
+
import { D as Ir, T as Pr, a as hr, b as fr, c as wr, d as vr, e as Fr } from "../DataTable-DJM7KWWK.js";
|
|
19
19
|
import { A as Br, a as Gr, b as Hr, c as Rr } from "../AppVerticalTabs-NZ02HPGP.js";
|
|
20
|
-
import { T as Nr } from "../ThemeSelector-
|
|
20
|
+
import { T as Nr } from "../ThemeSelector-CQ3fSDJ2.js";
|
|
21
21
|
import { A as Er, a as Or, b as Vr } from "../alert-B78CiTYe.js";
|
|
22
22
|
import { A as zr, C as Ur, a as jr, b as qr, R as Jr, c as Qr, d as Wr, T as Xr, e as Yr } from "../toaster-Du2OlHAd.js";
|
|
23
23
|
import { B as _r, T as $r, a as as, b as es, c as os, d as rs } from "../tooltip-BWyFpIxo.js";
|
package/dist/hooks/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { u as x } from "../useDocumentTitle-WNwdPz-I.js";
|
|
|
5
5
|
import { u as D } from "../useMobile-DN1_OMDB.js";
|
|
6
6
|
import { u as n } from "../useNotifications-zbUhCvF_.js";
|
|
7
7
|
import { u as g } from "../useServerTable-UvTY6L1N.js";
|
|
8
|
-
import { u as C } from "../useTheme-
|
|
8
|
+
import { u as C } from "../useTheme-CSr_h5xJ.js";
|
|
9
9
|
import { t as d, u as h } from "../useToast-BFTk4lWz.js";
|
|
10
10
|
export {
|
|
11
11
|
d as toast,
|
package/dist/hooks/ui/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { u as t } from "../../useDocumentTitle-WNwdPz-I.js";
|
|
|
3
3
|
import { u } from "../../useMobile-DN1_OMDB.js";
|
|
4
4
|
import { u as f } from "../../useNotifications-zbUhCvF_.js";
|
|
5
5
|
import { u as x } from "../../useServerTable-UvTY6L1N.js";
|
|
6
|
-
import { u as T } from "../../useTheme-
|
|
6
|
+
import { u as T } from "../../useTheme-CSr_h5xJ.js";
|
|
7
7
|
import { t as b, u as c } from "../../useToast-BFTk4lWz.js";
|
|
8
8
|
export {
|
|
9
9
|
b as toast,
|
|
@@ -6,6 +6,7 @@ export interface ThemeOption {
|
|
|
6
6
|
className?: string;
|
|
7
7
|
}>;
|
|
8
8
|
message?: string;
|
|
9
|
+
hideInMini?: boolean;
|
|
9
10
|
}
|
|
10
11
|
export declare function useTheme(themeOptions: readonly ThemeOption[]): {
|
|
11
12
|
theme: string | undefined;
|
|
@@ -13,7 +14,7 @@ export declare function useTheme(themeOptions: readonly ThemeOption[]): {
|
|
|
13
14
|
handleThemeChange: (newTheme: string) => void;
|
|
14
15
|
themeOptions: readonly ThemeOption[];
|
|
15
16
|
currentThemeOption: ThemeOption | undefined;
|
|
16
|
-
nextThemeOption: ThemeOption;
|
|
17
|
+
nextThemeOption: ThemeOption | undefined;
|
|
17
18
|
isDark: boolean;
|
|
18
19
|
cycleTheme: () => void;
|
|
19
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../src/hooks/ui/useTheme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAClD,OAAO,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../src/hooks/ui/useTheme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAClD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,QAAQ,CAAC,YAAY,EAAE,SAAS,WAAW,EAAE;;;kCAItB,MAAM;;;;;;EA8B5C"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useTheme as f } from "next-themes";
|
|
2
|
+
import { u as d } from "./useNotifications-zbUhCvF_.js";
|
|
3
|
+
function x(s) {
|
|
4
|
+
const { showSuccess: r } = d(), { theme: n, setTheme: a } = f(), i = (e) => {
|
|
5
|
+
a(e);
|
|
6
|
+
const o = s.find((m) => m.value === e);
|
|
7
|
+
r("Thème mis à jour", `Le thème a été changé vers ${(o == null ? void 0 : o.label) ?? e}.`);
|
|
8
|
+
}, t = s.filter((e) => !e.hideInMini), u = s.find((e) => e.value === n), l = t.findIndex((e) => e.value === n), c = t.length > 0 ? t[(l + 1) % t.length] : void 0, h = (n == null ? void 0 : n.startsWith("dark")) ?? !1;
|
|
9
|
+
return {
|
|
10
|
+
theme: n,
|
|
11
|
+
setTheme: a,
|
|
12
|
+
handleThemeChange: i,
|
|
13
|
+
themeOptions: s,
|
|
14
|
+
currentThemeOption: u,
|
|
15
|
+
nextThemeOption: c,
|
|
16
|
+
isDark: h,
|
|
17
|
+
cycleTheme: () => {
|
|
18
|
+
c && i(c.value);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
x as u
|
|
24
|
+
};
|
package/package.json
CHANGED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { useTheme as i } from "next-themes";
|
|
2
|
-
import { u as m } from "./useNotifications-zbUhCvF_.js";
|
|
3
|
-
function x(s) {
|
|
4
|
-
const { showSuccess: u } = m(), { theme: c, setTheme: a } = i(), r = (e) => {
|
|
5
|
-
a(e);
|
|
6
|
-
const n = s.find((f) => f.value === e);
|
|
7
|
-
u("Thème mis à jour", `Le thème a été changé vers ${(n == null ? void 0 : n.label) ?? e}.`);
|
|
8
|
-
}, o = s.find((e) => e.value === c), l = s.findIndex((e) => e.value === c), t = s[(l + 1) % s.length], h = (c == null ? void 0 : c.startsWith("dark")) ?? !1;
|
|
9
|
-
return {
|
|
10
|
-
theme: c,
|
|
11
|
-
setTheme: a,
|
|
12
|
-
handleThemeChange: r,
|
|
13
|
-
themeOptions: s,
|
|
14
|
-
currentThemeOption: o,
|
|
15
|
-
nextThemeOption: t,
|
|
16
|
-
isDark: h,
|
|
17
|
-
cycleTheme: () => r(t.value)
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
export {
|
|
21
|
-
x as u
|
|
22
|
-
};
|