@krosoft/react 0.0.176 → 0.0.177
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-CwPaiNx1.js → AppActions-DEkRxBia.js} +4 -4
- package/dist/{AppSubTitle-6JLlE8Vf.js → AppSubTitle-ChCtQ7Sv.js} +1 -1
- package/dist/{AppVerticalTabs-BkZkxL_K.js → AppVerticalTabs-BSU6M8OU.js} +3 -3
- package/dist/{ConfirmationDialog-t5QtNOQO.js → ConfirmationDialog-Ht4e-1Lg.js} +5 -5
- package/dist/{DataTable-CfCXm_D_.js → DataTable-ny08K506.js} +4 -4
- package/dist/{GenericForm-DXclmweK.js → GenericForm-COQEdT9e.js} +7 -7
- package/dist/{ImageInput-BqoCekqh.js → ImageInput-BoYUZx9H.js} +4 -4
- package/dist/{KpiCardsLayout-BhEoJhJ9.js → KpiCardsLayout-C4Ds3BEl.js} +6 -6
- package/dist/{MetricCard-C7kgpgRl.js → MetricCard-CvQFjIOb.js} +1 -1
- package/dist/{MultiSelect-BFdaRnIO.js → MultiSelect-DF7-91OW.js} +25 -29
- package/dist/{SearchInput-Dg5Aw2lv.js → SearchInput-ClZbbRWg.js} +38 -37
- package/dist/{SkeletonCards-DemfjUfD.js → SkeletonCards-BvJYF_LK.js} +4 -4
- package/dist/{TableFilter-WWNz4Nua.js → TableFilter-Dbo7qkgR.js} +51 -47
- package/dist/{ThemeSelector-BwrbKW-4.js → ThemeSelector-BFC37dSl.js} +2 -2
- package/dist/{Topbar-D55ou5Uk.js → Topbar-CFmKB_S2.js} +2 -2
- package/dist/components/core/cards/index.js +2 -2
- package/dist/components/core/dialogs/index.js +2 -2
- package/dist/components/core/filters/SearchableFilterPill.d.ts.map +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 +16 -16
- 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 +3 -3
- package/dist/components/core/layouts/index.js +3 -3
- package/dist/components/core/navbar/index.js +1 -1
- package/dist/components/core/table/index.js +1 -1
- package/dist/components/core/tabs/index.js +1 -1
- package/dist/components/core/theme/index.js +1 -1
- package/dist/components/index.js +67 -65
- package/dist/components/ui/control.d.ts +18 -0
- package/dist/components/ui/control.d.ts.map +1 -0
- 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 +49 -47
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/{select-BwcXfUqZ.js → select-BpjFWqAY.js} +44 -54
- package/dist/{sheet-DOncI9p6.js → sheet-B_uq6-K_.js} +38 -35
- package/dist/{toaster-S0xacBVZ.js → toaster-B6XKMRwI.js} +1 -1
- package/dist/{toggle-group-DC5hqQ4H.js → toggle-group-D6c-gM1D.js} +1 -1
- package/dist/{tooltip-OY3E8Lo0.js → tooltip-DVeqVwqV.js} +24 -19
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs as n, jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import { ay as u, aM as t, aA as c, aH as g, aC as d } from "./toggle-group-
|
|
2
|
+
import { ay as u, aM as t, aA as c, aH as g, aC as d } from "./toggle-group-D6c-gM1D.js";
|
|
3
3
|
import "./alert-B9F1N9Qk.js";
|
|
4
4
|
import "@radix-ui/react-aspect-ratio";
|
|
5
|
-
import { B as p } from "./tooltip-
|
|
5
|
+
import { B as p } from "./tooltip-DVeqVwqV.js";
|
|
6
6
|
import "@radix-ui/react-collapsible";
|
|
7
|
-
import "./sheet-
|
|
7
|
+
import "./sheet-B_uq6-K_.js";
|
|
8
8
|
import { MoreVerticalIcon as C } from "lucide-react";
|
|
9
9
|
import "react-resizable-panels";
|
|
10
10
|
import { c as i } from "./tailwind.helper-B6yFEsav.js";
|
|
11
|
-
import "./select-
|
|
11
|
+
import "./select-BpjFWqAY.js";
|
|
12
12
|
import "next-themes";
|
|
13
13
|
import "sonner";
|
|
14
14
|
import "react";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as l } from "react-i18next";
|
|
3
|
-
import { A as m } from "./AppActions-
|
|
3
|
+
import { A as m } from "./AppActions-DEkRxBia.js";
|
|
4
4
|
function f({ titleKey: s, actions: t, className: o }) {
|
|
5
5
|
const { t: r } = l();
|
|
6
6
|
return /* @__PURE__ */ i("div", { className: "flex flex-col sm:flex-row sm:items-center justify-between gap-4", children: [
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs as n, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { J as N, N as g, K as v, bN as y, bP as T, bQ as b, bO as w, bA as S } from "./toggle-group-
|
|
3
|
-
import { A as C } from "./AppActions-
|
|
2
|
+
import { J as N, N as g, K as v, bN as y, bP as T, bQ as b, bO as w, bA as S } from "./toggle-group-D6c-gM1D.js";
|
|
3
|
+
import { A as C } from "./AppActions-DEkRxBia.js";
|
|
4
4
|
import { A } from "./AppTitle-uboDuil4.js";
|
|
5
5
|
import { useTranslation as x } from "react-i18next";
|
|
6
6
|
import { useSearchParams as f } from "react-router-dom";
|
|
7
7
|
import { c as P } from "./tailwind.helper-B6yFEsav.js";
|
|
8
|
-
import { S as k, h as j, i as z, a as K, c as V } from "./select-
|
|
8
|
+
import { S as k, h as j, i as z, a as K, c as V } from "./select-BpjFWqAY.js";
|
|
9
9
|
import { ConstructionIcon as p } from "lucide-react";
|
|
10
10
|
function L({ titleKey: s, descriptionKey: l, actions: c = [], className: t }) {
|
|
11
11
|
return /* @__PURE__ */ n("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between", children: [
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsx as e, jsxs as r, Fragment as M } from "react/jsx-runtime";
|
|
2
|
-
import { D as q, b as B, P as R, e as W, h as X, c as $, m as J, p as Q, s as F, t as U, q as j, r as V, o as Y } from "./toggle-group-
|
|
2
|
+
import { D as q, b as B, P as R, e as W, h as X, c as $, m as J, p as Q, s as F, t as U, q as j, r as V, o as Y } from "./toggle-group-D6c-gM1D.js";
|
|
3
3
|
import { A as Z, a as _ } from "./alert-B9F1N9Qk.js";
|
|
4
4
|
import "@radix-ui/react-aspect-ratio";
|
|
5
|
-
import { B as v } from "./tooltip-
|
|
5
|
+
import { B as v } from "./tooltip-DVeqVwqV.js";
|
|
6
6
|
import "@radix-ui/react-collapsible";
|
|
7
|
-
import "./sheet-
|
|
7
|
+
import "./sheet-B_uq6-K_.js";
|
|
8
8
|
import { AlertCircleIcon as L, X as S, Save as T, Pen as I } from "lucide-react";
|
|
9
9
|
import "react-resizable-panels";
|
|
10
10
|
import "clsx";
|
|
11
11
|
import "tailwind-merge";
|
|
12
|
-
import "./select-
|
|
12
|
+
import "./select-BpjFWqAY.js";
|
|
13
13
|
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-COQEdT9e.js";
|
|
18
18
|
import { E as ie } from "./ErrorAlert-SrIcU1mM.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,16 +1,16 @@
|
|
|
1
1
|
import { jsxs as i, jsx as e, Fragment as ne } from "react/jsx-runtime";
|
|
2
2
|
import { u as le } from "./useDataTable-CxcA5S-s.js";
|
|
3
|
-
import { ay as B, aM as L, aA as V, aC as de, $ as O, az as ce } from "./toggle-group-
|
|
3
|
+
import { ay as B, aM as L, aA as V, aC as de, $ as O, az as ce } from "./toggle-group-D6c-gM1D.js";
|
|
4
4
|
import "./alert-B9F1N9Qk.js";
|
|
5
5
|
import "@radix-ui/react-aspect-ratio";
|
|
6
|
-
import { B as y } from "./tooltip-
|
|
6
|
+
import { B as y } from "./tooltip-DVeqVwqV.js";
|
|
7
7
|
import "@radix-ui/react-collapsible";
|
|
8
|
-
import "./sheet-
|
|
8
|
+
import "./sheet-B_uq6-K_.js";
|
|
9
9
|
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";
|
|
10
10
|
import "react-resizable-panels";
|
|
11
11
|
import "clsx";
|
|
12
12
|
import "tailwind-merge";
|
|
13
|
-
import { S as be, h as Ne, i as ke, a as Se, c as we } from "./select-
|
|
13
|
+
import { S as be, h as Ne, i as ke, a as Se, c as we } from "./select-BpjFWqAY.js";
|
|
14
14
|
import "next-themes";
|
|
15
15
|
import "sonner";
|
|
16
16
|
import "react";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx as r, jsxs as o } from "react/jsx-runtime";
|
|
2
|
-
import { I as J } from "./ImageInput-
|
|
3
|
-
import { A as V } from "./AppSubTitle-
|
|
4
|
-
import { M as Q } from "./MultiSelect-
|
|
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-
|
|
2
|
+
import { I as J } from "./ImageInput-BoYUZx9H.js";
|
|
3
|
+
import { A as V } from "./AppSubTitle-ChCtQ7Sv.js";
|
|
4
|
+
import { M as Q } from "./MultiSelect-DF7-91OW.js";
|
|
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-D6c-gM1D.js";
|
|
6
6
|
import "./alert-B9F1N9Qk.js";
|
|
7
7
|
import "@radix-ui/react-aspect-ratio";
|
|
8
|
-
import { B as M } from "./tooltip-
|
|
8
|
+
import { B as M } from "./tooltip-DVeqVwqV.js";
|
|
9
9
|
import "@radix-ui/react-collapsible";
|
|
10
|
-
import { I as k } from "./sheet-
|
|
10
|
+
import { I as k } from "./sheet-B_uq6-K_.js";
|
|
11
11
|
import "lucide-react";
|
|
12
12
|
import "react-resizable-panels";
|
|
13
13
|
import { c as i } from "./tailwind.helper-B6yFEsav.js";
|
|
14
|
-
import { S as ae, h as re, i as se, a as ne, c as le } from "./select-
|
|
14
|
+
import { S as ae, h as re, i as se, a as ne, c as le } from "./select-BpjFWqAY.js";
|
|
15
15
|
import "next-themes";
|
|
16
16
|
import "sonner";
|
|
17
17
|
import { u as ce } from "./useToast-BFTk4lWz.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
2
|
-
import "./toggle-group-
|
|
2
|
+
import "./toggle-group-D6c-gM1D.js";
|
|
3
3
|
import "./alert-B9F1N9Qk.js";
|
|
4
4
|
import "@radix-ui/react-aspect-ratio";
|
|
5
|
-
import { B as x } from "./tooltip-
|
|
5
|
+
import { B as x } from "./tooltip-DVeqVwqV.js";
|
|
6
6
|
import "@radix-ui/react-collapsible";
|
|
7
|
-
import "./sheet-
|
|
7
|
+
import "./sheet-B_uq6-K_.js";
|
|
8
8
|
import { XIcon as N, ImageIcon as v, UploadIcon as w } from "lucide-react";
|
|
9
9
|
import "react-resizable-panels";
|
|
10
10
|
import { c as u } from "./tailwind.helper-B6yFEsav.js";
|
|
11
|
-
import "./select-
|
|
11
|
+
import "./select-BpjFWqAY.js";
|
|
12
12
|
import "next-themes";
|
|
13
13
|
import "sonner";
|
|
14
14
|
import { forwardRef as I, useRef as y } from "react";
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { jsxs as o, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import "./toggle-group-
|
|
2
|
+
import "./toggle-group-D6c-gM1D.js";
|
|
3
3
|
import "./alert-B9F1N9Qk.js";
|
|
4
4
|
import "@radix-ui/react-aspect-ratio";
|
|
5
|
-
import { B as c } from "./tooltip-
|
|
5
|
+
import { B as c } from "./tooltip-DVeqVwqV.js";
|
|
6
6
|
import "@radix-ui/react-collapsible";
|
|
7
|
-
import "./sheet-
|
|
7
|
+
import "./sheet-B_uq6-K_.js";
|
|
8
8
|
import { ArrowLeftIcon as l } from "lucide-react";
|
|
9
9
|
import "react-resizable-panels";
|
|
10
10
|
import "clsx";
|
|
11
11
|
import "tailwind-merge";
|
|
12
|
-
import "./select-
|
|
12
|
+
import "./select-BpjFWqAY.js";
|
|
13
13
|
import "next-themes";
|
|
14
14
|
import "sonner";
|
|
15
15
|
import "react";
|
|
16
|
-
import { A as f } from "./AppActions-
|
|
16
|
+
import { A as f } from "./AppActions-DEkRxBia.js";
|
|
17
17
|
import { A as u } from "./AppTitle-uboDuil4.js";
|
|
18
18
|
import { u as d } from "./useDocumentTitle-WNwdPz-I.js";
|
|
19
19
|
import { useTranslation as x } from "react-i18next";
|
|
20
20
|
import "@krosoft/core/helpers";
|
|
21
|
-
import { b as g, a as h } from "./SkeletonCards-
|
|
21
|
+
import { b as g, a as h } from "./SkeletonCards-BvJYF_LK.js";
|
|
22
22
|
import { E as A } from "./ErrorState-CmaxuJyW.js";
|
|
23
23
|
function M({
|
|
24
24
|
icon: t,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { J as l, N as h, O as m, K as g } from "./toggle-group-
|
|
2
|
+
import { J as l, N as h, O as m, K as g } from "./toggle-group-D6c-gM1D.js";
|
|
3
3
|
import { c as b } from "./tailwind.helper-B6yFEsav.js";
|
|
4
4
|
import { useTranslation as p } from "react-i18next";
|
|
5
5
|
const k = ({ titleKey: t, icon: s, className: n, children: a }) => {
|
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useState as k, useRef as w, useMemo as N, useEffect as y } from "react";
|
|
3
|
-
import { $ as C } from "./toggle-group-
|
|
3
|
+
import { $ as C } from "./toggle-group-D6c-gM1D.js";
|
|
4
4
|
import "./alert-B9F1N9Qk.js";
|
|
5
5
|
import "@radix-ui/react-aspect-ratio";
|
|
6
|
-
import "./tooltip-
|
|
6
|
+
import { f as L } from "./tooltip-DVeqVwqV.js";
|
|
7
7
|
import "@radix-ui/react-collapsible";
|
|
8
|
-
import "./sheet-
|
|
9
|
-
import { XIcon as
|
|
8
|
+
import "./sheet-B_uq6-K_.js";
|
|
9
|
+
import { XIcon as R, ChevronDownIcon as j, SearchIcon as D } from "lucide-react";
|
|
10
10
|
import "react-resizable-panels";
|
|
11
11
|
import { c as z } from "./tailwind.helper-B6yFEsav.js";
|
|
12
|
-
import "./select-
|
|
12
|
+
import "./select-BpjFWqAY.js";
|
|
13
13
|
import "next-themes";
|
|
14
14
|
import "sonner";
|
|
15
|
-
const
|
|
15
|
+
const K = ({
|
|
16
16
|
options: i,
|
|
17
17
|
selected: n,
|
|
18
|
-
onToggle:
|
|
18
|
+
onToggle: g,
|
|
19
19
|
onClear: d,
|
|
20
20
|
onSelectAll: u,
|
|
21
21
|
placeholder: E = "Sélectionner...",
|
|
22
22
|
searchable: m = !1,
|
|
23
|
-
searchPlaceholder:
|
|
23
|
+
searchPlaceholder: T = "Rechercher...",
|
|
24
24
|
disabled: f = !1
|
|
25
25
|
}) => {
|
|
26
|
-
const [c,
|
|
26
|
+
const [c, h] = k(""), [a, b] = k(!1), p = w(null), v = w(null), o = N(() => c === "" ? i : i.filter((e) => e.label.toLowerCase().includes(c.toLowerCase())), [i, c]), x = 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;
|
|
30
|
-
(e =
|
|
30
|
+
(e = v.current) == null || e.focus();
|
|
31
31
|
});
|
|
32
32
|
}, [a, m]), y(() => {
|
|
33
33
|
if (!a) return;
|
|
34
34
|
const e = (t) => {
|
|
35
|
-
|
|
35
|
+
p.current !== null && !p.current.contains(t.target) && (b(!1), h(""));
|
|
36
36
|
};
|
|
37
37
|
return document.addEventListener("mousedown", e), () => {
|
|
38
38
|
document.removeEventListener("mousedown", e);
|
|
39
39
|
};
|
|
40
40
|
}, [a]);
|
|
41
41
|
const I = () => {
|
|
42
|
-
if (
|
|
42
|
+
if (x) {
|
|
43
43
|
const e = o.map((s) => s.value), t = n.filter((s) => !e.includes(s));
|
|
44
44
|
u !== void 0 ? u(t) : d();
|
|
45
45
|
} else {
|
|
@@ -47,24 +47,20 @@ const J = ({
|
|
|
47
47
|
o.forEach((t) => {
|
|
48
48
|
e.includes(t.value) || e.push(t.value);
|
|
49
49
|
}), u !== void 0 ? u(e) : o.forEach((t) => {
|
|
50
|
-
n.includes(t.value) ||
|
|
50
|
+
n.includes(t.value) || g(t.value);
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
|
-
return /* @__PURE__ */ l("div", { ref:
|
|
54
|
+
return /* @__PURE__ */ l("div", { ref: p, className: "relative w-full", children: [
|
|
55
55
|
/* @__PURE__ */ l(
|
|
56
56
|
"button",
|
|
57
57
|
{
|
|
58
58
|
type: "button",
|
|
59
59
|
disabled: f,
|
|
60
60
|
onClick: () => {
|
|
61
|
-
f || b((e) => (e &&
|
|
61
|
+
f || b((e) => (e && h(""), !e));
|
|
62
62
|
},
|
|
63
|
-
className: z(
|
|
64
|
-
"flex h-10 w-full items-center justify-between rounded-control 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
|
-
a && "ring-2 ring-ring ring-offset-2",
|
|
66
|
-
n.length === 0 && "text-muted-foreground"
|
|
67
|
-
),
|
|
63
|
+
className: z(L, "w-full", a && "ring-2 ring-ring ring-offset-2", n.length === 0 && "text-muted-foreground"),
|
|
68
64
|
children: [
|
|
69
65
|
/* @__PURE__ */ r("span", { className: "truncate", children: n.length === 0 ? E : n.map((e) => {
|
|
70
66
|
var t;
|
|
@@ -83,33 +79,33 @@ const J = ({
|
|
|
83
79
|
e.preventDefault(), e.stopPropagation(), d();
|
|
84
80
|
},
|
|
85
81
|
className: "text-muted-foreground hover:text-foreground",
|
|
86
|
-
children: /* @__PURE__ */ r(
|
|
82
|
+
children: /* @__PURE__ */ r(R, { className: "size-4" })
|
|
87
83
|
}
|
|
88
84
|
),
|
|
89
|
-
/* @__PURE__ */ r(
|
|
85
|
+
/* @__PURE__ */ r(j, { className: z("size-4 opacity-50 shrink-0 transition-transform", a && "rotate-180") })
|
|
90
86
|
] })
|
|
91
87
|
]
|
|
92
88
|
}
|
|
93
89
|
),
|
|
94
90
|
a ? /* @__PURE__ */ l("div", { className: "absolute left-0 right-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: [
|
|
95
91
|
m ? /* @__PURE__ */ r("div", { className: "border-b border-border p-2", children: /* @__PURE__ */ l("div", { className: "relative", children: [
|
|
96
|
-
/* @__PURE__ */ r(
|
|
92
|
+
/* @__PURE__ */ r(D, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
|
|
97
93
|
/* @__PURE__ */ r(
|
|
98
94
|
"input",
|
|
99
95
|
{
|
|
100
|
-
ref:
|
|
96
|
+
ref: v,
|
|
101
97
|
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",
|
|
102
|
-
placeholder:
|
|
98
|
+
placeholder: T,
|
|
103
99
|
value: c,
|
|
104
100
|
onChange: (e) => {
|
|
105
|
-
|
|
101
|
+
h(e.target.value);
|
|
106
102
|
}
|
|
107
103
|
}
|
|
108
104
|
)
|
|
109
105
|
] }) }) : null,
|
|
110
106
|
/* @__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
107
|
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__ */ r(C, { checked:
|
|
108
|
+
/* @__PURE__ */ r(C, { checked: x, onCheckedChange: I }),
|
|
113
109
|
"Tout sélectionner"
|
|
114
110
|
] }),
|
|
115
111
|
o.length === 0 && /* @__PURE__ */ r("p", { className: "px-2 py-3 text-center text-xs text-muted-foreground", children: "Aucun résultat" }),
|
|
@@ -119,7 +115,7 @@ const J = ({
|
|
|
119
115
|
{
|
|
120
116
|
checked: n.includes(e.value),
|
|
121
117
|
onCheckedChange: () => {
|
|
122
|
-
|
|
118
|
+
g(e.value);
|
|
123
119
|
}
|
|
124
120
|
}
|
|
125
121
|
),
|
|
@@ -140,5 +136,5 @@ const J = ({
|
|
|
140
136
|
] });
|
|
141
137
|
};
|
|
142
138
|
export {
|
|
143
|
-
|
|
139
|
+
K as M
|
|
144
140
|
};
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { jsxs as s, jsx as t } from "react/jsx-runtime";
|
|
2
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 L, bx as O, bw as j } from "./toggle-group-D6c-gM1D.js";
|
|
5
5
|
import "./alert-B9F1N9Qk.js";
|
|
6
6
|
import "@radix-ui/react-aspect-ratio";
|
|
7
|
-
import { B as g } from "./tooltip-
|
|
7
|
+
import { B as g, f as A } from "./tooltip-DVeqVwqV.js";
|
|
8
8
|
import "@radix-ui/react-collapsible";
|
|
9
|
-
import { I as
|
|
10
|
-
import { CalendarIcon as D, XIcon as M, ChevronDownIcon as
|
|
9
|
+
import { I as q } from "./sheet-B_uq6-K_.js";
|
|
10
|
+
import { CalendarIcon as D, XIcon as M, ChevronDownIcon as B, SearchIcon as E, CheckIcon as $ } from "lucide-react";
|
|
11
11
|
import "react-resizable-panels";
|
|
12
|
-
import { c as
|
|
13
|
-
import "./select-
|
|
12
|
+
import { c as f } from "./tailwind.helper-B6yFEsav.js";
|
|
13
|
+
import "./select-BpjFWqAY.js";
|
|
14
14
|
import "next-themes";
|
|
15
15
|
import "sonner";
|
|
16
16
|
import { format as v } from "date-fns";
|
|
17
17
|
import { fr as N } from "date-fns/locale";
|
|
18
|
-
const
|
|
19
|
-
const [u,
|
|
18
|
+
const ne = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
19
|
+
const [u, m] = k(!1), c = C(null);
|
|
20
20
|
z(() => {
|
|
21
21
|
if (!u) return;
|
|
22
22
|
const l = (n) => {
|
|
23
|
-
c.current !== null && !c.current.contains(n.target) &&
|
|
23
|
+
c.current !== null && !c.current.contains(n.target) && m(!1);
|
|
24
24
|
};
|
|
25
25
|
return document.addEventListener("mousedown", l), () => {
|
|
26
26
|
document.removeEventListener("mousedown", l);
|
|
27
27
|
};
|
|
28
28
|
}, [u]);
|
|
29
29
|
const d = () => {
|
|
30
|
-
|
|
30
|
+
m((l) => !l);
|
|
31
31
|
}, a = (l) => {
|
|
32
|
-
o(l),
|
|
32
|
+
o(l), m(!1);
|
|
33
33
|
};
|
|
34
34
|
return /* @__PURE__ */ s("div", { ref: c, className: "relative w-full", children: [
|
|
35
35
|
/* @__PURE__ */ s(
|
|
@@ -38,7 +38,7 @@ const oe = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
|
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"
|
|
@@ -51,11 +51,11 @@ const oe = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
|
51
51
|
),
|
|
52
52
|
u ? /* @__PURE__ */ t("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__ */ t(I, { mode: "single", selected: r, onSelect: a }) }) : null
|
|
53
53
|
] });
|
|
54
|
-
},
|
|
55
|
-
const [
|
|
54
|
+
}, se = ({ value: r, onChange: o, placeholder: p = "Selectionner une periode", className: u }) => {
|
|
55
|
+
const [m, c] = w.useState(!1), [d, a] = w.useState(r);
|
|
56
56
|
w.useEffect(() => {
|
|
57
|
-
|
|
58
|
-
}, [
|
|
57
|
+
m && a(r);
|
|
58
|
+
}, [m, r]);
|
|
59
59
|
const l = (i) => {
|
|
60
60
|
i.stopPropagation(), o(void 0), c(!1);
|
|
61
61
|
}, n = () => {
|
|
@@ -65,8 +65,8 @@ const oe = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
|
65
65
|
}, y = () => {
|
|
66
66
|
a(void 0);
|
|
67
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:
|
|
69
|
-
/* @__PURE__ */ t(
|
|
68
|
+
return /* @__PURE__ */ t("div", { className: f("grid gap-2", u), children: /* @__PURE__ */ s(L, { open: m, onOpenChange: c, children: [
|
|
69
|
+
/* @__PURE__ */ t(O, { 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
70
|
/* @__PURE__ */ t(D, { className: "mr-2 size-4" }),
|
|
71
71
|
x(r),
|
|
72
72
|
(r == null ? void 0 : r.from) && /* @__PURE__ */ t(
|
|
@@ -104,12 +104,12 @@ const oe = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
|
104
104
|
] })
|
|
105
105
|
] })
|
|
106
106
|
] }) });
|
|
107
|
-
},
|
|
107
|
+
}, le = ({
|
|
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
|
}) => {
|
|
@@ -124,8 +124,8 @@ const oe = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
|
124
124
|
});
|
|
125
125
|
}, [n]), z(() => {
|
|
126
126
|
if (!n) return;
|
|
127
|
-
const e = (
|
|
128
|
-
y.current !== null && !y.current.contains(
|
|
127
|
+
const e = (T) => {
|
|
128
|
+
y.current !== null && !y.current.contains(T.target) && (b(!1), l(""));
|
|
129
129
|
};
|
|
130
130
|
return document.addEventListener("mousedown", e), () => {
|
|
131
131
|
document.removeEventListener("mousedown", e);
|
|
@@ -143,15 +143,16 @@ const oe = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
|
143
143
|
d || b((e) => (e && l(""), !e));
|
|
144
144
|
},
|
|
145
145
|
disabled: d,
|
|
146
|
-
className:
|
|
147
|
-
|
|
146
|
+
className: f(
|
|
147
|
+
A,
|
|
148
|
+
"w-full",
|
|
148
149
|
n && "ring-2 ring-ring ring-offset-2",
|
|
149
150
|
(o === void 0 || o === "") && "text-muted-foreground"
|
|
150
151
|
),
|
|
151
152
|
children: [
|
|
152
153
|
/* @__PURE__ */ s("span", { className: "flex items-center gap-2 truncate", children: [
|
|
153
154
|
(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 ??
|
|
155
|
+
/* @__PURE__ */ t("span", { className: "truncate", children: P ?? m })
|
|
155
156
|
] }),
|
|
156
157
|
/* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
|
|
157
158
|
u && o !== void 0 && o !== "" && !d && /* @__PURE__ */ t(
|
|
@@ -169,7 +170,7 @@ const oe = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
|
169
170
|
children: /* @__PURE__ */ t(M, { className: "size-4" })
|
|
170
171
|
}
|
|
171
172
|
),
|
|
172
|
-
/* @__PURE__ */ t(
|
|
173
|
+
/* @__PURE__ */ t(B, { className: f("size-4 opacity-50 shrink-0 transition-transform", n && "rotate-180") })
|
|
173
174
|
] })
|
|
174
175
|
]
|
|
175
176
|
}
|
|
@@ -199,12 +200,12 @@ const oe = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
|
199
200
|
onClick: () => {
|
|
200
201
|
R(e.value);
|
|
201
202
|
},
|
|
202
|
-
className:
|
|
203
|
+
className: f(
|
|
203
204
|
"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",
|
|
204
205
|
o === e.value && "bg-muted font-medium"
|
|
205
206
|
),
|
|
206
207
|
children: [
|
|
207
|
-
/* @__PURE__ */ t(
|
|
208
|
+
/* @__PURE__ */ t($, { className: f("size-3.5 shrink-0", o === e.value ? "opacity-100" : "opacity-0") }),
|
|
208
209
|
e.color && /* @__PURE__ */ t("span", { className: "size-2.5 shrink-0 rounded-full", style: { backgroundColor: e.color } }),
|
|
209
210
|
e.label
|
|
210
211
|
]
|
|
@@ -214,22 +215,22 @@ const oe = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
|
214
215
|
] })
|
|
215
216
|
] }) : null
|
|
216
217
|
] });
|
|
217
|
-
},
|
|
218
|
+
}, ae = ({
|
|
218
219
|
searchQuery: r,
|
|
219
220
|
search: o,
|
|
220
221
|
placeholder: p = "Rechercher...",
|
|
221
222
|
onSearch: u,
|
|
222
|
-
onSubmit:
|
|
223
|
+
onSubmit: m,
|
|
223
224
|
onClear: c,
|
|
224
225
|
className: d
|
|
225
226
|
}) => {
|
|
226
227
|
const a = r ?? o ?? "", l = () => {
|
|
227
228
|
u(""), c !== void 0 && c();
|
|
228
229
|
};
|
|
229
|
-
return /* @__PURE__ */ s("div", { className:
|
|
230
|
+
return /* @__PURE__ */ s("div", { className: f("relative h-fit w-full md:w-64", d), children: [
|
|
230
231
|
/* @__PURE__ */ t(E, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground w-4 h-4" }),
|
|
231
232
|
/* @__PURE__ */ t(
|
|
232
|
-
|
|
233
|
+
q,
|
|
233
234
|
{
|
|
234
235
|
placeholder: p,
|
|
235
236
|
value: a,
|
|
@@ -238,7 +239,7 @@ const oe = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
|
238
239
|
},
|
|
239
240
|
className: "pl-8",
|
|
240
241
|
onKeyDown: (n) => {
|
|
241
|
-
n.key === "Enter" &&
|
|
242
|
+
n.key === "Enter" && m !== void 0 && (n.preventDefault(), m());
|
|
242
243
|
}
|
|
243
244
|
}
|
|
244
245
|
),
|
|
@@ -246,8 +247,8 @@ const oe = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
|
246
247
|
] });
|
|
247
248
|
};
|
|
248
249
|
export {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
250
|
+
ne as D,
|
|
251
|
+
ae as S,
|
|
252
|
+
se as a,
|
|
253
|
+
le as b
|
|
253
254
|
};
|
|
@@ -2,15 +2,15 @@ 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 { J as c, N as p, O as v, K as N } from "./toggle-group-
|
|
5
|
+
import { J as c, N as p, O as v, K as N } from "./toggle-group-D6c-gM1D.js";
|
|
6
6
|
import "./alert-B9F1N9Qk.js";
|
|
7
7
|
import "@radix-ui/react-aspect-ratio";
|
|
8
|
-
import "./tooltip-
|
|
8
|
+
import "./tooltip-DVeqVwqV.js";
|
|
9
9
|
import "@radix-ui/react-collapsible";
|
|
10
|
-
import "./sheet-
|
|
10
|
+
import "./sheet-B_uq6-K_.js";
|
|
11
11
|
import "lucide-react";
|
|
12
12
|
import "react-resizable-panels";
|
|
13
|
-
import "./select-
|
|
13
|
+
import "./select-BpjFWqAY.js";
|
|
14
14
|
import { S as n } from "./skeleton-BX4RcsiK.js";
|
|
15
15
|
import "next-themes";
|
|
16
16
|
import "sonner";
|