@krosoft/react 0.0.200 → 0.0.201
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/{AppActions-DeBcK3cv.js → AppActions-ViFjSupi.js} +6 -6
- package/dist/{AppSubTitle-CdIM6aXB.js → AppSubTitle-ClHzadQW.js} +1 -1
- package/dist/{AppVerticalTabs-BlgIZ0mf.js → AppVerticalTabs-Cj66X8_R.js} +7 -7
- package/dist/{ConfirmationDialog-DZ6tvSwP.js → ConfirmationDialog-BoajNW2s.js} +15 -15
- package/dist/{DataTable-BDW0AEsH.js → DataTable-BUcnJCi6.js} +22 -22
- package/dist/{GenericForm-DFTUIw-X.js → GenericForm-BPY5O-B6.js} +43 -43
- package/dist/{ImageInput-MzY2W495.js → ImageInput-DOIglcpv.js} +2 -2
- package/dist/{KpiCardsLayout-fcfJK4ts.js → KpiCardsLayout-D9NSC5Fb.js} +4 -4
- package/dist/{MultiSelect-V-RantiK.js → MultiSelect-B60y82TF.js} +16 -16
- package/dist/{SearchInput-tz8UERbu.js → SearchInput-C-jCOSoi.js} +49 -49
- package/dist/{SkeletonCards-CyP7ZysR.js → SkeletonCards-63vDljXy.js} +2 -2
- package/dist/{TableFilter-BXf-oSjf.js → TableFilter-DP7cq0PU.js} +26 -26
- package/dist/Topbar-0EBMHLwG.js +301 -0
- package/dist/components/core/cards/index.js +1 -1
- package/dist/components/core/dialogs/index.js +8 -7
- package/dist/components/core/filters/index.js +1 -1
- package/dist/components/core/forms/index.js +1 -1
- package/dist/components/core/index.js +66 -64
- 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 +52 -0
- package/dist/components/core/navbar/GlobalSearch.d.ts.map +1 -0
- package/dist/components/core/navbar/index.d.ts +2 -0
- package/dist/components/core/navbar/index.d.ts.map +1 -1
- package/dist/components/core/navbar/index.js +6 -5
- package/dist/components/core/table/index.js +1 -1
- package/dist/components/core/tabs/index.js +1 -1
- package/dist/components/index.js +293 -292
- package/dist/components/ui/command.d.ts +20 -2
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +187 -187
- package/dist/hooks/behavior/index.d.ts +1 -0
- package/dist/hooks/behavior/index.d.ts.map +1 -1
- package/dist/hooks/behavior/index.js +6 -5
- package/dist/hooks/behavior/useDebouncedValue.d.ts +6 -0
- package/dist/hooks/behavior/useDebouncedValue.d.ts.map +1 -0
- package/dist/hooks/index.js +20 -19
- package/dist/sheet-C-QvdRNi.js +245 -0
- package/dist/{toaster-DG7IvN3o.js → toaster-D6OHn49K.js} +9 -9
- package/dist/{toggle-group-CKCJXGta.js → toggle-group-DLLrEwv2.js} +576 -714
- package/dist/usePage-BFE9lxI1.js +84 -0
- package/package.json +1 -1
- package/dist/Topbar-CFmKB_S2.js +0 -217
- package/dist/sheet-B_uq6-K_.js +0 -87
- package/dist/usePage-u2gRhvQ0.js +0 -72
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
3
|
-
import {
|
|
2
|
+
import { useState as E, useRef as L, useMemo as v, useEffect as z } from "react";
|
|
3
|
+
import { E as T } from "./toggle-group-DLLrEwv2.js";
|
|
4
4
|
import "./alert-B9F1N9Qk.js";
|
|
5
5
|
import "@radix-ui/react-aspect-ratio";
|
|
6
|
-
import { f as
|
|
6
|
+
import { f as M } from "./tooltip-DVeqVwqV.js";
|
|
7
7
|
import "./chart-DntJZGxB.js";
|
|
8
8
|
import "@radix-ui/react-collapsible";
|
|
9
|
-
import "./sheet-
|
|
10
|
-
import { XIcon as
|
|
9
|
+
import "./sheet-C-QvdRNi.js";
|
|
10
|
+
import { XIcon as O, ChevronDownIcon as P, SearchIcon as S } from "lucide-react";
|
|
11
11
|
import "react-resizable-panels";
|
|
12
12
|
import { c as I } from "./tailwind.helper-B6yFEsav.js";
|
|
13
13
|
import "./select-BpjFWqAY.js";
|
|
@@ -19,22 +19,22 @@ const $ = ({
|
|
|
19
19
|
onToggle: x,
|
|
20
20
|
onClear: d,
|
|
21
21
|
onSelectAll: u,
|
|
22
|
-
placeholder:
|
|
22
|
+
placeholder: R = "Sélectionner...",
|
|
23
23
|
searchable: m = !1,
|
|
24
|
-
searchPlaceholder:
|
|
24
|
+
searchPlaceholder: j = "Rechercher...",
|
|
25
25
|
disabled: f = !1,
|
|
26
26
|
maxCount: h
|
|
27
27
|
}) => {
|
|
28
|
-
const [c, p] =
|
|
28
|
+
const [c, p] = E(""), [a, N] = E(!1), g = L(null), k = L(null), o = v(() => c === "" ? s : s.filter((e) => e.label.toLowerCase().includes(c.toLowerCase())), [s, c]), w = v(() => o.length === 0 ? !1 : o.every((e) => t.includes(e.value)), [o, t]), b = v(() => t.map((e) => {
|
|
29
29
|
var n;
|
|
30
30
|
return ((n = s.find((i) => i.value === e)) == null ? void 0 : n.label) ?? e;
|
|
31
31
|
}), [s, t]), y = h !== void 0 && h > 0 ? b.slice(0, h) : b, C = b.length - y.length;
|
|
32
|
-
|
|
32
|
+
z(() => {
|
|
33
33
|
a && m && requestAnimationFrame(() => {
|
|
34
34
|
var e;
|
|
35
35
|
(e = k.current) == null || e.focus();
|
|
36
36
|
});
|
|
37
|
-
}, [a, m]),
|
|
37
|
+
}, [a, m]), z(() => {
|
|
38
38
|
if (!a) return;
|
|
39
39
|
const e = (n) => {
|
|
40
40
|
g.current !== null && !g.current.contains(n.target) && (N(!1), p(""));
|
|
@@ -43,7 +43,7 @@ const $ = ({
|
|
|
43
43
|
document.removeEventListener("mousedown", e);
|
|
44
44
|
};
|
|
45
45
|
}, [a]);
|
|
46
|
-
const
|
|
46
|
+
const D = () => {
|
|
47
47
|
if (w) {
|
|
48
48
|
const e = o.map((i) => i.value), n = t.filter((i) => !e.includes(i));
|
|
49
49
|
u !== void 0 ? u(n) : d();
|
|
@@ -65,9 +65,9 @@ const $ = ({
|
|
|
65
65
|
onClick: () => {
|
|
66
66
|
f || N((e) => (e && p(""), !e));
|
|
67
67
|
},
|
|
68
|
-
className: I(
|
|
68
|
+
className: I(M, "w-full", a && "ring-2 ring-ring ring-offset-2", t.length === 0 && "text-muted-foreground"),
|
|
69
69
|
children: [
|
|
70
|
-
/* @__PURE__ */ r("span", { className: "truncate", children: t.length === 0 ?
|
|
70
|
+
/* @__PURE__ */ r("span", { className: "truncate", children: t.length === 0 ? R : y.join(", ") }),
|
|
71
71
|
/* @__PURE__ */ l("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
72
72
|
C > 0 && /* @__PURE__ */ l("span", { className: "rounded-control bg-muted px-1.5 py-0.5 text-xs font-medium text-foreground", children: [
|
|
73
73
|
"+",
|
|
@@ -85,7 +85,7 @@ const $ = ({
|
|
|
85
85
|
e.preventDefault(), e.stopPropagation(), d();
|
|
86
86
|
},
|
|
87
87
|
className: "text-muted-foreground hover:text-foreground",
|
|
88
|
-
children: /* @__PURE__ */ r(
|
|
88
|
+
children: /* @__PURE__ */ r(O, { className: "size-4" })
|
|
89
89
|
}
|
|
90
90
|
),
|
|
91
91
|
/* @__PURE__ */ r(P, { className: I("size-4 opacity-50 shrink-0 transition-transform", a && "rotate-180") })
|
|
@@ -101,7 +101,7 @@ const $ = ({
|
|
|
101
101
|
{
|
|
102
102
|
ref: k,
|
|
103
103
|
className: "w-full rounded-control 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",
|
|
104
|
-
placeholder:
|
|
104
|
+
placeholder: j,
|
|
105
105
|
value: c,
|
|
106
106
|
onChange: (e) => {
|
|
107
107
|
p(e.target.value);
|
|
@@ -111,7 +111,7 @@ const $ = ({
|
|
|
111
111
|
] }) }) : null,
|
|
112
112
|
/* @__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: [
|
|
113
113
|
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: [
|
|
114
|
-
/* @__PURE__ */ r(T, { checked: w, onCheckedChange:
|
|
114
|
+
/* @__PURE__ */ r(T, { checked: w, onCheckedChange: D }),
|
|
115
115
|
"Tout sélectionner"
|
|
116
116
|
] }),
|
|
117
117
|
o.length === 0 && /* @__PURE__ */ r("p", { className: "px-2 py-3 text-center text-xs text-muted-foreground", children: "Aucun résultat" }),
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import * as S from "react";
|
|
3
3
|
import { useState as z, useRef as q, useEffect as G, useMemo as K } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { C as L, b0 as R, b2 as j, b1 as T } from "./toggle-group-DLLrEwv2.js";
|
|
5
5
|
import "./alert-B9F1N9Qk.js";
|
|
6
6
|
import "@radix-ui/react-aspect-ratio";
|
|
7
|
-
import { B as y, f as
|
|
7
|
+
import { B as y, f as X } from "./tooltip-DVeqVwqV.js";
|
|
8
8
|
import "./chart-DntJZGxB.js";
|
|
9
9
|
import "@radix-ui/react-collapsible";
|
|
10
|
-
import {
|
|
10
|
+
import { C as F, m as H, o as J, k as Q, l as U, n as E, I as W } from "./sheet-C-QvdRNi.js";
|
|
11
11
|
import { CalendarIcon as _, XIcon as M, ChevronDownIcon as Y, CheckIcon as Z, PlusIcon as ee, SearchIcon as te } from "lucide-react";
|
|
12
12
|
import "react-resizable-panels";
|
|
13
13
|
import { c as g } from "./tailwind.helper-B6yFEsav.js";
|
|
14
14
|
import "./select-BpjFWqAY.js";
|
|
15
15
|
import "next-themes";
|
|
16
16
|
import "sonner";
|
|
17
|
-
import { format as
|
|
18
|
-
import { fr as
|
|
19
|
-
const
|
|
20
|
-
const [c,
|
|
17
|
+
import { format as N } from "date-fns";
|
|
18
|
+
import { fr as b } from "date-fns/locale";
|
|
19
|
+
const Ne = ({ date: r, onDateChange: o, placeholder: h }) => {
|
|
20
|
+
const [c, a] = z(!1), s = q(null);
|
|
21
21
|
G(() => {
|
|
22
22
|
if (!c) return;
|
|
23
23
|
const i = (f) => {
|
|
24
|
-
s.current !== null && !s.current.contains(f.target) &&
|
|
24
|
+
s.current !== null && !s.current.contains(f.target) && a(!1);
|
|
25
25
|
};
|
|
26
26
|
return document.addEventListener("mousedown", i), () => {
|
|
27
27
|
document.removeEventListener("mousedown", i);
|
|
28
28
|
};
|
|
29
29
|
}, [c]);
|
|
30
30
|
const d = () => {
|
|
31
|
-
|
|
31
|
+
a((i) => !i);
|
|
32
32
|
}, m = (i) => {
|
|
33
|
-
o(i),
|
|
33
|
+
o(i), a(!1);
|
|
34
34
|
};
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */
|
|
35
|
+
return /* @__PURE__ */ n("div", { ref: s, className: "relative w-full", children: [
|
|
36
|
+
/* @__PURE__ */ n(
|
|
37
37
|
y,
|
|
38
38
|
{
|
|
39
39
|
variant: "outline",
|
|
@@ -46,17 +46,17 @@ const be = ({ date: r, onDateChange: o, placeholder: h }) => {
|
|
|
46
46
|
),
|
|
47
47
|
children: [
|
|
48
48
|
/* @__PURE__ */ e(_, { className: "mr-2 size-4 shrink-0" }),
|
|
49
|
-
r !== void 0 ?
|
|
49
|
+
r !== void 0 ? N(r, "dd/MM/yyyy", { locale: b }) : /* @__PURE__ */ e("span", { children: h })
|
|
50
50
|
]
|
|
51
51
|
}
|
|
52
52
|
),
|
|
53
53
|
c ? /* @__PURE__ */ e("div", { className: "absolute left-0 top-[calc(100%+4px)] z-[100] rounded-surface border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 slide-in-from-top-2", children: /* @__PURE__ */ e(L, { mode: "single", selected: r, onSelect: m }) }) : null
|
|
54
54
|
] });
|
|
55
|
-
},
|
|
56
|
-
const [
|
|
55
|
+
}, be = ({ value: r, onChange: o, placeholder: h = "Selectionner une periode", className: c }) => {
|
|
56
|
+
const [a, s] = S.useState(!1), [d, m] = S.useState(r);
|
|
57
57
|
S.useEffect(() => {
|
|
58
|
-
|
|
59
|
-
}, [
|
|
58
|
+
a && m(r);
|
|
59
|
+
}, [a, r]);
|
|
60
60
|
const i = (l) => {
|
|
61
61
|
l.stopPropagation(), o(void 0), s(!1);
|
|
62
62
|
}, f = () => {
|
|
@@ -65,9 +65,9 @@ const be = ({ date: r, onDateChange: o, placeholder: h }) => {
|
|
|
65
65
|
m(r), s(!1);
|
|
66
66
|
}, k = () => {
|
|
67
67
|
m(void 0);
|
|
68
|
-
}, p = (l) => l != null && l.from ? !l.to || l.from.getTime() === l.to.getTime() ?
|
|
69
|
-
return /* @__PURE__ */ e("div", { className: g("grid gap-2", c), children: /* @__PURE__ */
|
|
70
|
-
/* @__PURE__ */ e(
|
|
68
|
+
}, p = (l) => l != null && l.from ? !l.to || l.from.getTime() === l.to.getTime() ? N(l.from, "dd MMM yyyy", { locale: b }) : `${N(l.from, "dd MMM yyyy", { locale: b })} - ${N(l.to, "dd MMM yyyy", { locale: b })}` : h;
|
|
69
|
+
return /* @__PURE__ */ e("div", { className: g("grid gap-2", c), children: /* @__PURE__ */ n(R, { open: a, onOpenChange: s, children: [
|
|
70
|
+
/* @__PURE__ */ e(j, { asChild: !0, children: /* @__PURE__ */ n(y, { id: "date", variant: "outline", className: g("w-[300px] justify-start text-left font-normal", !(r != null && r.from) && "text-muted-foreground"), children: [
|
|
71
71
|
/* @__PURE__ */ e(_, { className: "mr-2 size-4" }),
|
|
72
72
|
p(r),
|
|
73
73
|
(r == null ? void 0 : r.from) && /* @__PURE__ */ e(
|
|
@@ -83,7 +83,7 @@ const be = ({ date: r, onDateChange: o, placeholder: h }) => {
|
|
|
83
83
|
}
|
|
84
84
|
)
|
|
85
85
|
] }) }),
|
|
86
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ n(T, { className: "w-auto p-0", align: "start", side: "bottom", sideOffset: 4, children: [
|
|
87
87
|
/* @__PURE__ */ e(
|
|
88
88
|
L,
|
|
89
89
|
{
|
|
@@ -96,9 +96,9 @@ const be = ({ date: r, onDateChange: o, placeholder: h }) => {
|
|
|
96
96
|
className: "pointer-events-auto p-3"
|
|
97
97
|
}
|
|
98
98
|
),
|
|
99
|
-
/* @__PURE__ */
|
|
99
|
+
/* @__PURE__ */ n("div", { className: "flex items-center justify-between border-t border-border px-3 py-2", children: [
|
|
100
100
|
/* @__PURE__ */ e(y, { variant: "ghost", size: "sm", onClick: k, children: "Effacer" }),
|
|
101
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ n("div", { className: "flex gap-2", children: [
|
|
102
102
|
/* @__PURE__ */ e(y, { variant: "ghost", size: "sm", onClick: x, children: "Annuler" }),
|
|
103
103
|
/* @__PURE__ */ e(y, { size: "sm", onClick: f, children: "Appliquer" })
|
|
104
104
|
] })
|
|
@@ -110,7 +110,7 @@ const be = ({ date: r, onDateChange: o, placeholder: h }) => {
|
|
|
110
110
|
value: o,
|
|
111
111
|
onChange: h,
|
|
112
112
|
onClear: c,
|
|
113
|
-
onCreate:
|
|
113
|
+
onCreate: a,
|
|
114
114
|
placeholder: s = "Sélectionner...",
|
|
115
115
|
searchPlaceholder: d = "Rechercher...",
|
|
116
116
|
emptyLabel: m = "Aucun résultat",
|
|
@@ -119,15 +119,15 @@ const be = ({ date: r, onDateChange: o, placeholder: h }) => {
|
|
|
119
119
|
modal: x = !0,
|
|
120
120
|
className: k
|
|
121
121
|
}) => {
|
|
122
|
-
const [p, l] = z(!1), [I, P] = z(""), v = o !== void 0 && o !== "", u = K(() => v ? r.find((t) => t.value === o) : void 0, [v, r, o]), A = v ? (u == null ? void 0 : u.label) ?? o : void 0,
|
|
122
|
+
const [p, l] = z(!1), [I, P] = z(""), v = o !== void 0 && o !== "", u = K(() => v ? r.find((t) => t.value === o) : void 0, [v, r, o]), A = v ? (u == null ? void 0 : u.label) ?? o : void 0, C = I.trim(), D = a !== void 0 && C !== "" && !r.some((t) => t.label.toLowerCase() === C.toLowerCase()), w = (t) => {
|
|
123
123
|
l(t), t || P("");
|
|
124
124
|
}, O = (t) => {
|
|
125
125
|
h(t), w(!1);
|
|
126
126
|
}, V = () => {
|
|
127
|
-
|
|
127
|
+
a == null || a(C), w(!1);
|
|
128
128
|
};
|
|
129
|
-
return /* @__PURE__ */
|
|
130
|
-
/* @__PURE__ */ e(
|
|
129
|
+
return /* @__PURE__ */ n(R, { open: p, onOpenChange: w, modal: x, children: [
|
|
130
|
+
/* @__PURE__ */ e(j, { asChild: !0, children: /* @__PURE__ */ n(
|
|
131
131
|
"button",
|
|
132
132
|
{
|
|
133
133
|
type: "button",
|
|
@@ -135,23 +135,23 @@ const be = ({ date: r, onDateChange: o, placeholder: h }) => {
|
|
|
135
135
|
"aria-expanded": p,
|
|
136
136
|
disabled: f,
|
|
137
137
|
className: g(
|
|
138
|
-
|
|
138
|
+
X,
|
|
139
139
|
"w-full",
|
|
140
140
|
"data-[state=open]:ring-2 data-[state=open]:ring-ring data-[state=open]:ring-offset-2",
|
|
141
141
|
!v && "text-muted-foreground",
|
|
142
142
|
k
|
|
143
143
|
),
|
|
144
144
|
children: [
|
|
145
|
-
/* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ n("span", { className: "flex items-center truncate", children: [
|
|
146
146
|
(u == null ? void 0 : u.color) && /* @__PURE__ */ e("span", { className: "mr-2 size-2.5 shrink-0 rounded-full", style: { backgroundColor: u.color } }),
|
|
147
147
|
/* @__PURE__ */ e("span", { className: "truncate", children: A ?? s }),
|
|
148
|
-
(u == null ? void 0 : u.description) !== void 0 && /* @__PURE__ */
|
|
148
|
+
(u == null ? void 0 : u.description) !== void 0 && /* @__PURE__ */ n("span", { className: "ml-1 truncate text-muted-foreground", children: [
|
|
149
149
|
"(",
|
|
150
150
|
u.description,
|
|
151
151
|
")"
|
|
152
152
|
] })
|
|
153
153
|
] }),
|
|
154
|
-
/* @__PURE__ */
|
|
154
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-1", children: [
|
|
155
155
|
c && v && !f && /* @__PURE__ */ e(
|
|
156
156
|
"span",
|
|
157
157
|
{
|
|
@@ -172,16 +172,16 @@ const be = ({ date: r, onDateChange: o, placeholder: h }) => {
|
|
|
172
172
|
]
|
|
173
173
|
}
|
|
174
174
|
) }),
|
|
175
|
-
/* @__PURE__ */ e(T, { className: "w-[var(--radix-popover-trigger-width)] p-0", align: "start", children: /* @__PURE__ */
|
|
176
|
-
|
|
175
|
+
/* @__PURE__ */ e(T, { className: "w-[var(--radix-popover-trigger-width)] p-0", align: "start", children: /* @__PURE__ */ n(
|
|
176
|
+
F,
|
|
177
177
|
{
|
|
178
178
|
filter: (t, $, B) => (B ?? []).join(" ").toLowerCase().includes($.trim().toLowerCase()) ? 1 : 0,
|
|
179
179
|
children: [
|
|
180
|
-
/* @__PURE__ */ e(
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
!D && /* @__PURE__ */ e(
|
|
183
|
-
/* @__PURE__ */
|
|
184
|
-
r.map((t) => /* @__PURE__ */
|
|
180
|
+
/* @__PURE__ */ e(H, { placeholder: d, value: I, onValueChange: P }),
|
|
181
|
+
/* @__PURE__ */ n(J, { children: [
|
|
182
|
+
!D && /* @__PURE__ */ e(Q, { children: m }),
|
|
183
|
+
/* @__PURE__ */ n(U, { children: [
|
|
184
|
+
r.map((t) => /* @__PURE__ */ n(
|
|
185
185
|
E,
|
|
186
186
|
{
|
|
187
187
|
value: t.value,
|
|
@@ -193,7 +193,7 @@ const be = ({ date: r, onDateChange: o, placeholder: h }) => {
|
|
|
193
193
|
/* @__PURE__ */ e(Z, { className: g("mr-2 size-4 shrink-0", o === t.value ? "opacity-100" : "opacity-0") }),
|
|
194
194
|
t.color !== void 0 && /* @__PURE__ */ e("span", { className: "mr-2 size-2.5 shrink-0 rounded-full", style: { backgroundColor: t.color } }),
|
|
195
195
|
/* @__PURE__ */ e("span", { className: "truncate", children: t.label }),
|
|
196
|
-
t.description !== void 0 && /* @__PURE__ */
|
|
196
|
+
t.description !== void 0 && /* @__PURE__ */ n("span", { className: "ml-1 truncate text-muted-foreground", children: [
|
|
197
197
|
"(",
|
|
198
198
|
t.description,
|
|
199
199
|
")"
|
|
@@ -202,9 +202,9 @@ const be = ({ date: r, onDateChange: o, placeholder: h }) => {
|
|
|
202
202
|
},
|
|
203
203
|
t.value
|
|
204
204
|
)),
|
|
205
|
-
D && /* @__PURE__ */
|
|
205
|
+
D && /* @__PURE__ */ n(E, { forceMount: !0, value: "__create__", onSelect: V, children: [
|
|
206
206
|
/* @__PURE__ */ e(ee, { className: "mr-2 size-4 shrink-0" }),
|
|
207
|
-
/* @__PURE__ */ e("span", { className: "truncate", children: i(
|
|
207
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: i(C) })
|
|
208
208
|
] })
|
|
209
209
|
] })
|
|
210
210
|
] })
|
|
@@ -217,17 +217,17 @@ const be = ({ date: r, onDateChange: o, placeholder: h }) => {
|
|
|
217
217
|
search: o,
|
|
218
218
|
placeholder: h = "Rechercher...",
|
|
219
219
|
onSearch: c,
|
|
220
|
-
onSubmit:
|
|
220
|
+
onSubmit: a,
|
|
221
221
|
onClear: s,
|
|
222
222
|
className: d
|
|
223
223
|
}) => {
|
|
224
224
|
const m = r ?? o ?? "", i = () => {
|
|
225
225
|
c(""), s !== void 0 && s();
|
|
226
226
|
};
|
|
227
|
-
return /* @__PURE__ */
|
|
227
|
+
return /* @__PURE__ */ n("div", { className: g("relative h-fit w-full md:w-64", d), children: [
|
|
228
228
|
/* @__PURE__ */ e(te, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground w-4 h-4" }),
|
|
229
229
|
/* @__PURE__ */ e(
|
|
230
|
-
|
|
230
|
+
W,
|
|
231
231
|
{
|
|
232
232
|
placeholder: h,
|
|
233
233
|
value: m,
|
|
@@ -236,7 +236,7 @@ const be = ({ date: r, onDateChange: o, placeholder: h }) => {
|
|
|
236
236
|
},
|
|
237
237
|
className: "pl-8",
|
|
238
238
|
onKeyDown: (f) => {
|
|
239
|
-
f.key === "Enter" &&
|
|
239
|
+
f.key === "Enter" && a !== void 0 && (f.preventDefault(), a());
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
242
|
),
|
|
@@ -244,8 +244,8 @@ const be = ({ date: r, onDateChange: o, placeholder: h }) => {
|
|
|
244
244
|
] });
|
|
245
245
|
};
|
|
246
246
|
export {
|
|
247
|
-
|
|
247
|
+
Ne as D,
|
|
248
248
|
ke as S,
|
|
249
|
-
|
|
249
|
+
be as a,
|
|
250
250
|
xe as b
|
|
251
251
|
};
|
|
@@ -2,13 +2,13 @@ import { jsxs as s, jsx as e, Fragment as o } from "react/jsx-runtime";
|
|
|
2
2
|
import { formatNumber as g } from "@krosoft/core/helpers";
|
|
3
3
|
import { useTranslation as b } from "react-i18next";
|
|
4
4
|
import { c as m } from "./tailwind.helper-B6yFEsav.js";
|
|
5
|
-
import "./toggle-group-
|
|
5
|
+
import "./toggle-group-DLLrEwv2.js";
|
|
6
6
|
import "./alert-B9F1N9Qk.js";
|
|
7
7
|
import "@radix-ui/react-aspect-ratio";
|
|
8
8
|
import "./tooltip-DVeqVwqV.js";
|
|
9
9
|
import { C as c, d as p, e as v, a as h } from "./chart-DntJZGxB.js";
|
|
10
10
|
import "@radix-ui/react-collapsible";
|
|
11
|
-
import "./sheet-
|
|
11
|
+
import "./sheet-C-QvdRNi.js";
|
|
12
12
|
import "lucide-react";
|
|
13
13
|
import "react-resizable-panels";
|
|
14
14
|
import "./select-BpjFWqAY.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs as u, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
3
|
-
import { a as
|
|
4
|
-
import { B as
|
|
2
|
+
import { useState as F, useEffect as O, useMemo as A } from "react";
|
|
3
|
+
import { a as j, D as M, b as z, S as I } from "./SearchInput-C-jCOSoi.js";
|
|
4
|
+
import { B as k, aw as $, b0 as B, b2 as R, b1 as Q, E as C } from "./toggle-group-DLLrEwv2.js";
|
|
5
5
|
import "./alert-B9F1N9Qk.js";
|
|
6
6
|
import "@radix-ui/react-aspect-ratio";
|
|
7
|
-
import { B as
|
|
7
|
+
import { B as w, e as V } from "./tooltip-DVeqVwqV.js";
|
|
8
8
|
import "./chart-DntJZGxB.js";
|
|
9
9
|
import "@radix-ui/react-collapsible";
|
|
10
|
-
import { I as
|
|
11
|
-
import { XIcon as
|
|
10
|
+
import { I as E, S as _, z as H, s as X, v as G, y as J, u as K } from "./sheet-C-QvdRNi.js";
|
|
11
|
+
import { XIcon as P, Filter as U, ChevronDown as W, Search as Y } from "lucide-react";
|
|
12
12
|
import "react-resizable-panels";
|
|
13
13
|
import "clsx";
|
|
14
14
|
import "tailwind-merge";
|
|
@@ -16,7 +16,7 @@ import { S as Z, h as q, i as ee, a as re, c as te } from "./select-BpjFWqAY.js"
|
|
|
16
16
|
import "next-themes";
|
|
17
17
|
import "sonner";
|
|
18
18
|
import { c as T } from "./tailwind.helper-B6yFEsav.js";
|
|
19
|
-
import { M as le } from "./MultiSelect-
|
|
19
|
+
import { M as le } from "./MultiSelect-B60y82TF.js";
|
|
20
20
|
const L = (a, n, c = {}) => {
|
|
21
21
|
if (n instanceof Date)
|
|
22
22
|
return n.toLocaleDateString("fr-FR");
|
|
@@ -33,7 +33,7 @@ function ae({ filters: a, onRemoveFilter: n, onClearAll: c, filterLabels: i = {}
|
|
|
33
33
|
return m.map((x) => {
|
|
34
34
|
const p = L(h, x, d);
|
|
35
35
|
return /* @__PURE__ */ u(
|
|
36
|
-
|
|
36
|
+
k,
|
|
37
37
|
{
|
|
38
38
|
variant: "secondary",
|
|
39
39
|
className: "flex items-center gap-1 px-3 py-1 bg-blue-50 text-blue-700 border border-blue-200 hover:bg-blue-100",
|
|
@@ -48,7 +48,7 @@ function ae({ filters: a, onRemoveFilter: n, onClearAll: c, filterLabels: i = {}
|
|
|
48
48
|
n(h, x);
|
|
49
49
|
},
|
|
50
50
|
className: "ml-1 hover:bg-blue-200 rounded-full p-0.5",
|
|
51
|
-
children: /* @__PURE__ */ r(
|
|
51
|
+
children: /* @__PURE__ */ r(P, { className: "size-4" })
|
|
52
52
|
}
|
|
53
53
|
)
|
|
54
54
|
]
|
|
@@ -57,7 +57,7 @@ function ae({ filters: a, onRemoveFilter: n, onClearAll: c, filterLabels: i = {}
|
|
|
57
57
|
);
|
|
58
58
|
});
|
|
59
59
|
const g = L(h, m, d);
|
|
60
|
-
return /* @__PURE__ */ u(
|
|
60
|
+
return /* @__PURE__ */ u(k, { variant: "secondary", className: "flex items-center gap-1 px-3 py-1 bg-blue-50 text-blue-700 border border-blue-200 hover:bg-blue-100", children: [
|
|
61
61
|
b,
|
|
62
62
|
": ",
|
|
63
63
|
g,
|
|
@@ -68,7 +68,7 @@ function ae({ filters: a, onRemoveFilter: n, onClearAll: c, filterLabels: i = {}
|
|
|
68
68
|
n(h);
|
|
69
69
|
},
|
|
70
70
|
className: "ml-1 hover:bg-blue-200 rounded-full p-0.5",
|
|
71
|
-
children: /* @__PURE__ */ r(
|
|
71
|
+
children: /* @__PURE__ */ r(P, { className: "size-4" })
|
|
72
72
|
}
|
|
73
73
|
)
|
|
74
74
|
] }, h);
|
|
@@ -86,7 +86,7 @@ const se = ({
|
|
|
86
86
|
switch (a.type) {
|
|
87
87
|
case "text":
|
|
88
88
|
return /* @__PURE__ */ r(
|
|
89
|
-
|
|
89
|
+
E,
|
|
90
90
|
{
|
|
91
91
|
placeholder: a.placeholder,
|
|
92
92
|
value: n ?? "",
|
|
@@ -97,7 +97,7 @@ const se = ({
|
|
|
97
97
|
);
|
|
98
98
|
case "number":
|
|
99
99
|
return /* @__PURE__ */ r(
|
|
100
|
-
|
|
100
|
+
E,
|
|
101
101
|
{
|
|
102
102
|
type: "number",
|
|
103
103
|
placeholder: a.placeholder,
|
|
@@ -111,7 +111,7 @@ const se = ({
|
|
|
111
111
|
);
|
|
112
112
|
case "select":
|
|
113
113
|
return a.searchable === !0 ? /* @__PURE__ */ r(
|
|
114
|
-
|
|
114
|
+
z,
|
|
115
115
|
{
|
|
116
116
|
options: a.options ?? [],
|
|
117
117
|
value: n,
|
|
@@ -126,7 +126,7 @@ const se = ({
|
|
|
126
126
|
case "date":
|
|
127
127
|
return /* @__PURE__ */ r(M, { date: n, onDateChange: c, placeholder: a.placeholder ?? "Sélectionner une date" });
|
|
128
128
|
case "date-range":
|
|
129
|
-
return /* @__PURE__ */ r(
|
|
129
|
+
return /* @__PURE__ */ r(j, { value: n, onChange: c, placeholder: a.placeholder });
|
|
130
130
|
case "multi-select":
|
|
131
131
|
return /* @__PURE__ */ r(
|
|
132
132
|
le,
|
|
@@ -154,8 +154,8 @@ function ce({
|
|
|
154
154
|
buttonText: i = "Plus de filtres",
|
|
155
155
|
sheetTitle: d = "Filtres avancés"
|
|
156
156
|
}) {
|
|
157
|
-
const [o, h] =
|
|
158
|
-
|
|
157
|
+
const [o, h] = F(!1), [m, b] = F(n);
|
|
158
|
+
O(() => {
|
|
159
159
|
b(n);
|
|
160
160
|
}, [n, o]);
|
|
161
161
|
const g = (l, e) => {
|
|
@@ -172,7 +172,7 @@ function ce({
|
|
|
172
172
|
return Object.entries(n).filter(([e, t]) => l.has(e) && ne(t)).length;
|
|
173
173
|
}, [a, n]);
|
|
174
174
|
return /* @__PURE__ */ u(_, { open: o, onOpenChange: h, children: [
|
|
175
|
-
/* @__PURE__ */ r(H, { asChild: !0, children: /* @__PURE__ */ u(
|
|
175
|
+
/* @__PURE__ */ r(H, { asChild: !0, children: /* @__PURE__ */ u(w, { variant: "outline", className: "gap-2", children: [
|
|
176
176
|
/* @__PURE__ */ r(U, { className: "size-4 shrink-0" }),
|
|
177
177
|
i,
|
|
178
178
|
v > 0 && /* @__PURE__ */ r("span", { className: "ml-1 flex h-5 min-w-5 items-center justify-center rounded-full bg-primary px-1.5 text-xs font-semibold text-primary-foreground", children: v })
|
|
@@ -182,7 +182,7 @@ function ce({
|
|
|
182
182
|
/* @__PURE__ */ r("div", { className: "flex-1 overflow-y-auto p-6 pt-6", children: /* @__PURE__ */ r("div", { className: "space-y-6", children: a.map((l, e) => /* @__PURE__ */ u("div", { className: "space-y-4", children: [
|
|
183
183
|
/* @__PURE__ */ r("h3", { className: "font-semibold text-sm text-gray-900 dark:text-gray-100 border-b pb-2", children: l.title }),
|
|
184
184
|
l.filters.map((t) => /* @__PURE__ */ u("div", { className: "space-y-2", children: [
|
|
185
|
-
/* @__PURE__ */ r(
|
|
185
|
+
/* @__PURE__ */ r($, { htmlFor: t.key, children: t.label }),
|
|
186
186
|
/* @__PURE__ */ r(
|
|
187
187
|
se,
|
|
188
188
|
{
|
|
@@ -199,8 +199,8 @@ function ce({
|
|
|
199
199
|
] }, t.key))
|
|
200
200
|
] }, e)) }) }),
|
|
201
201
|
/* @__PURE__ */ u(K, { className: "gap-2 p-6 border-t bg-white dark:bg-gray-950", children: [
|
|
202
|
-
/* @__PURE__ */ r(
|
|
203
|
-
/* @__PURE__ */ r(
|
|
202
|
+
/* @__PURE__ */ r(w, { variant: "outline", className: "flex-1", onClick: y, children: "Effacer les filtres" }),
|
|
203
|
+
/* @__PURE__ */ r(w, { className: "flex-1 bg-orange-500 hover:bg-orange-600 text-white", onClick: p, children: "Rechercher" })
|
|
204
204
|
] })
|
|
205
205
|
] })
|
|
206
206
|
] });
|
|
@@ -215,7 +215,7 @@ function oe({
|
|
|
215
215
|
searchable: h = !1,
|
|
216
216
|
searchPlaceholder: m = "Rechercher..."
|
|
217
217
|
}) {
|
|
218
|
-
const [b, g] =
|
|
218
|
+
const [b, g] = F(""), x = c.length > 0, p = A(() => b === "" ? n : n.filter((l) => l.label.toLowerCase().includes(b.toLowerCase())), [n, b]), y = A(() => p.length === 0 ? !1 : p.every((l) => c.includes(l.value)), [p, c]), v = () => {
|
|
219
219
|
if (y)
|
|
220
220
|
if (o !== void 0) {
|
|
221
221
|
const l = p.map((t) => t.value), e = c.filter((t) => !l.includes(t));
|
|
@@ -308,7 +308,7 @@ function oe({
|
|
|
308
308
|
}
|
|
309
309
|
);
|
|
310
310
|
}
|
|
311
|
-
function
|
|
311
|
+
function Ee({
|
|
312
312
|
searchQuery: a,
|
|
313
313
|
onSearchChange: n,
|
|
314
314
|
searchPlaceholder: c = "Rechercher...",
|
|
@@ -319,7 +319,7 @@ function Pe({
|
|
|
319
319
|
sheetTitle: m = "Filtres avancés"
|
|
320
320
|
}) {
|
|
321
321
|
const b = (e, t) => {
|
|
322
|
-
const s = i[e], f = Array.isArray(s) ? s : [], N = f.includes(t) ? f.filter((
|
|
322
|
+
const s = i[e], f = Array.isArray(s) ? s : [], N = f.includes(t) ? f.filter((D) => D !== t) : [...f, t], S = { ...i };
|
|
323
323
|
N.length === 0 ? delete S[e] : S[e] = N, d(S);
|
|
324
324
|
}, g = (e) => {
|
|
325
325
|
const t = { ...i };
|
|
@@ -363,7 +363,7 @@ function Pe({
|
|
|
363
363
|
/* @__PURE__ */ u("div", { className: "flex flex-wrap items-center gap-3 justify-between", children: [
|
|
364
364
|
/* @__PURE__ */ u("div", { className: "flex flex-wrap items-center gap-3", children: [
|
|
365
365
|
n !== void 0 ? /* @__PURE__ */ r(
|
|
366
|
-
|
|
366
|
+
I,
|
|
367
367
|
{
|
|
368
368
|
searchQuery: a,
|
|
369
369
|
onSearch: n,
|
|
@@ -412,6 +412,6 @@ export {
|
|
|
412
412
|
ae as A,
|
|
413
413
|
se as F,
|
|
414
414
|
oe as S,
|
|
415
|
-
|
|
415
|
+
Ee as T,
|
|
416
416
|
ce as a
|
|
417
417
|
};
|