@krosoft/react 0.0.95 → 0.0.97
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/{AppSubTitle-BpBamEcm.js → AppSubTitle-Bc8utqt7.js} +1 -1
- package/dist/{AppTitle-eMxmvBxB.js → AppTitle-QlMMlpbQ.js} +8 -8
- package/dist/{AppVerticalTabs-CVukFn4d.js → AppVerticalTabs--Kb9OFa4.js} +29 -30
- package/dist/{ConfirmationDialog-D7W5xkwQ.js → ConfirmationDialog-Bv-O4ui4.js} +43 -43
- package/dist/{DataTable-C5t09hPv.js → DataTable-DWGao3TY.js} +28 -28
- package/dist/{ErrorAlert-BITMD2I5.js → ErrorAlert-DpOsMww8.js} +1 -1
- package/dist/LoadingState-M_TV_5Ui.js +13 -0
- package/dist/MetricCard-BjTGW3b2.js +103 -0
- package/dist/{SearchInput-Cez8b7gL.js → SearchInput-CKG1_3iS.js} +228 -212
- package/dist/{TableFilter-ChclLTH1.js → TableFilter-oBrNz-v_.js} +44 -44
- package/dist/alert-sHZy6NHC.js +30 -0
- package/dist/components/core/cards/CardSkeleton.d.ts.map +1 -0
- package/dist/components/core/cards/CardsSkeleton.d.ts.map +1 -0
- package/dist/components/core/cards/DashboardCard.d.ts +10 -0
- package/dist/components/core/cards/DashboardCard.d.ts.map +1 -0
- package/dist/components/core/cards/index.d.ts +4 -1
- package/dist/components/core/cards/index.d.ts.map +1 -1
- package/dist/components/core/cards/index.js +7 -4
- package/dist/components/core/dialogs/index.js +2 -2
- package/dist/components/core/filters/index.js +1 -1
- package/dist/components/core/index.js +63 -62
- package/dist/components/core/inputs/SearchableSelect.d.ts +3 -1
- package/dist/components/core/inputs/SearchableSelect.d.ts.map +1 -1
- package/dist/components/core/inputs/index.js +1 -1
- package/dist/components/core/layouts/index.js +2 -2
- package/dist/components/core/states/index.d.ts +0 -2
- package/dist/components/core/states/index.d.ts.map +1 -1
- package/dist/components/core/states/index.js +5 -7
- package/dist/components/core/table/index.js +1 -1
- package/dist/components/core/tabs/index.js +1 -1
- package/dist/components/index.js +284 -283
- package/dist/components/ui/button.d.ts +2 -2
- package/dist/components/ui/command.d.ts +12 -12
- package/dist/components/ui/index.js +187 -187
- package/dist/{toaster-DeSyPrhi.js → toaster-B09ou5gw.js} +24 -24
- package/dist/{toggle-group-CrQymn4l.js → toggle-group-iLf3T7oV.js} +5850 -5832
- package/package.json +1 -1
- package/dist/LoadingState-COf3KhOP.js +0 -29
- package/dist/MetricCard-BkOvTc3_.js +0 -85
- package/dist/card-Bn3Y7DHQ.js +0 -48
- package/dist/components/core/states/CardSkeleton.d.ts.map +0 -1
- package/dist/components/core/states/CardsSkeleton.d.ts.map +0 -1
- /package/dist/components/core/{states → cards}/CardSkeleton.d.ts +0 -0
- /package/dist/components/core/{states → cards}/CardsSkeleton.d.ts +0 -0
|
@@ -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 "./AppTitle-
|
|
3
|
+
import { A as m } from "./AppTitle-QlMMlpbQ.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,18 +1,18 @@
|
|
|
1
1
|
import { jsxs as n, jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import "./
|
|
2
|
+
import { ax as c, aL as b, az as f, aG as h, aB as u } from "./toggle-group-iLf3T7oV.js";
|
|
3
|
+
import "./alert-sHZy6NHC.js";
|
|
4
4
|
import { c as m } from "./index-gWiv5-6R.js";
|
|
5
5
|
import { B as p } from "./tooltip-CAu4DEhc.js";
|
|
6
6
|
import "./select-zzSnHs9S.js";
|
|
7
7
|
import "next-themes";
|
|
8
8
|
import "react";
|
|
9
|
-
import { u as
|
|
9
|
+
import { u as x } from "./useMobile-DN1_OMDB.js";
|
|
10
10
|
import { useTranslation as N } from "react-i18next";
|
|
11
|
-
import { E as
|
|
11
|
+
import { E as v } from "./ellipsis-vertical-BVxSFNOa.js";
|
|
12
12
|
function T({ actions: d, className: o }) {
|
|
13
|
-
const { t: i } = N(), t =
|
|
13
|
+
const { t: i } = N(), t = x();
|
|
14
14
|
return !d || d.length === 0 ? null : t ? /* @__PURE__ */ n(c, { children: [
|
|
15
|
-
/* @__PURE__ */ l(b, { asChild: !0, children: /* @__PURE__ */ l(p, { variant: "outline", size: "icon", children: /* @__PURE__ */ l(
|
|
15
|
+
/* @__PURE__ */ l(b, { asChild: !0, children: /* @__PURE__ */ l(p, { variant: "outline", size: "icon", children: /* @__PURE__ */ l(v, { className: "size-4" }) }) }),
|
|
16
16
|
/* @__PURE__ */ l(f, { align: "end", className: "min-w-48", children: d.map((r, e) => r ? r.children && r.children.length > 0 ? /* @__PURE__ */ n("div", { children: [
|
|
17
17
|
e > 0 && /* @__PURE__ */ l(h, {}),
|
|
18
18
|
r.children.map((s, a) => s ? /* @__PURE__ */ n(
|
|
@@ -65,7 +65,7 @@ function T({ actions: d, className: o }) {
|
|
|
65
65
|
s
|
|
66
66
|
) : null) }))(d);
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function G({ titleKey: d, descriptionKey: o, isSubTitle: i }) {
|
|
69
69
|
const { t } = N();
|
|
70
70
|
return /* @__PURE__ */ n("div", { className: "flex flex-col gap-1", children: [
|
|
71
71
|
/* @__PURE__ */ l("h1", { className: i ? "text-xl md:text-2xl font-semibold" : "text-xl md:text-3xl font-bold", children: t(d) ?? "" }),
|
|
@@ -74,5 +74,5 @@ function F({ titleKey: d, descriptionKey: o, isSubTitle: i }) {
|
|
|
74
74
|
}
|
|
75
75
|
export {
|
|
76
76
|
T as A,
|
|
77
|
-
|
|
77
|
+
G as a
|
|
78
78
|
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { jsxs as n, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
4
|
-
import { bR as T, bT as b, bU as S, bS as C, bu as k } from "./toggle-group-CrQymn4l.js";
|
|
2
|
+
import { I as v, M as g, J as y, bX as N, bZ as w, b_ as b, bY as T, bA as S } from "./toggle-group-iLf3T7oV.js";
|
|
3
|
+
import { a as C, A as k } from "./AppTitle-QlMMlpbQ.js";
|
|
5
4
|
import { useTranslation as x } from "react-i18next";
|
|
6
5
|
import { useSearchParams as f } from "react-router-dom";
|
|
7
6
|
import { c as A } from "./index-gWiv5-6R.js";
|
|
8
|
-
import { S as P, h as j, i as
|
|
7
|
+
import { S as P, h as j, i as M, a as z, c as L } from "./select-zzSnHs9S.js";
|
|
9
8
|
import { c as V } from "./index-DSyPHOLE.js";
|
|
10
9
|
/**
|
|
11
10
|
* @license lucide-react v1.16.0 - ISC
|
|
@@ -13,7 +12,7 @@ import { c as V } from "./index-DSyPHOLE.js";
|
|
|
13
12
|
* This source code is licensed under the ISC license.
|
|
14
13
|
* See the LICENSE file in the root directory of this source tree.
|
|
15
14
|
*/
|
|
16
|
-
const
|
|
15
|
+
const I = [
|
|
17
16
|
["rect", { x: "2", y: "6", width: "20", height: "8", rx: "1", key: "1estib" }],
|
|
18
17
|
["path", { d: "M17 14v7", key: "7m2elx" }],
|
|
19
18
|
["path", { d: "M7 14v7", key: "1cm7wv" }],
|
|
@@ -22,27 +21,27 @@ const K = [
|
|
|
22
21
|
["path", { d: "M10 14 2.3 6.3", key: "1023jk" }],
|
|
23
22
|
["path", { d: "m14 6 7.7 7.7", key: "1s8pl2" }],
|
|
24
23
|
["path", { d: "m8 6 8 8", key: "hl96qh" }]
|
|
25
|
-
], p = V("construction",
|
|
26
|
-
function
|
|
24
|
+
], p = V("construction", I);
|
|
25
|
+
function K({ titleKey: s, descriptionKey: l, actions: c = [], className: t }) {
|
|
27
26
|
return /* @__PURE__ */ n("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between", children: [
|
|
28
|
-
/* @__PURE__ */ a(
|
|
29
|
-
/* @__PURE__ */ a(
|
|
27
|
+
/* @__PURE__ */ a(C, { titleKey: s, descriptionKey: l, isSubTitle: !0 }),
|
|
28
|
+
/* @__PURE__ */ a(k, { actions: c, className: t })
|
|
30
29
|
] });
|
|
31
30
|
}
|
|
32
|
-
function
|
|
31
|
+
function Y({ titleKey: s, descriptionKey: l, actions: c = [], className: t, children: o, isSubTitle: i }) {
|
|
33
32
|
return /* @__PURE__ */ n(v, { children: [
|
|
34
|
-
/* @__PURE__ */ a(g, { children: /* @__PURE__ */ a(
|
|
33
|
+
/* @__PURE__ */ a(g, { children: /* @__PURE__ */ a(K, { titleKey: s, descriptionKey: l, actions: c, className: t }) }),
|
|
35
34
|
/* @__PURE__ */ a(y, { className: "space-y-4", children: o })
|
|
36
35
|
] });
|
|
37
36
|
}
|
|
38
|
-
function
|
|
39
|
-
var
|
|
40
|
-
const { t: o } = x(), [i,
|
|
41
|
-
return /* @__PURE__ */ n(
|
|
37
|
+
function Z({ tabs: s, itemId: l, item: c, fit: t }) {
|
|
38
|
+
var d;
|
|
39
|
+
const { t: o } = x(), [i, m] = f(), h = i.get("tab") || ((d = s[0]) == null ? void 0 : d.value);
|
|
40
|
+
return /* @__PURE__ */ n(N, { value: h, onValueChange: (e) => {
|
|
42
41
|
const r = new URLSearchParams();
|
|
43
|
-
r.set("tab", e),
|
|
42
|
+
r.set("tab", e), m(r);
|
|
44
43
|
}, children: [
|
|
45
|
-
/* @__PURE__ */ a(
|
|
44
|
+
/* @__PURE__ */ a(w, { className: A("w-full justify-start", t && "sm:w-fit"), children: s.map((e) => /* @__PURE__ */ n(b, { value: e.value, className: "gap-2", disabled: e.disabled, children: [
|
|
46
45
|
e.icon ? /* @__PURE__ */ a("span", { className: "hidden sm:inline", children: /* @__PURE__ */ a(e.icon, { className: "size-4" }) }) : null,
|
|
47
46
|
/* @__PURE__ */ a("span", { className: "text-xs sm:text-sm", children: o(e.titleKey) ?? "" }),
|
|
48
47
|
e.count ? /* @__PURE__ */ n("span", { className: "text-gray-500 text-xs", children: [
|
|
@@ -51,12 +50,12 @@ function G({ tabs: s, itemId: l, item: c, fit: t }) {
|
|
|
51
50
|
")"
|
|
52
51
|
] }) : null
|
|
53
52
|
] }, e.value)) }),
|
|
54
|
-
s.map((e) => /* @__PURE__ */ a(
|
|
53
|
+
s.map((e) => /* @__PURE__ */ a(T, { value: e.value, className: "mt-4", children: e.component ? e.component(l) : null }, e.value))
|
|
55
54
|
] });
|
|
56
55
|
}
|
|
57
|
-
const
|
|
58
|
-
var
|
|
59
|
-
const { t: c } = x(), [t, o] = f(), i = t.get("tab") || ((
|
|
56
|
+
const $ = ({ tabs: s, item: l }) => {
|
|
57
|
+
var d;
|
|
58
|
+
const { t: c } = x(), [t, o] = f(), i = t.get("tab") || ((d = s[0]) == null ? void 0 : d.value), m = (e) => {
|
|
60
59
|
const r = new URLSearchParams();
|
|
61
60
|
r.set("tab", e), o(r);
|
|
62
61
|
}, h = () => {
|
|
@@ -68,11 +67,11 @@ const J = ({ tabs: s, item: l }) => {
|
|
|
68
67
|
/* @__PURE__ */ a("p", { className: "text-sm text-gray-400", children: "Cette fonctionnalité sera bientôt disponible" })
|
|
69
68
|
] }) }) });
|
|
70
69
|
return /* @__PURE__ */ n("div", { className: "flex flex-col md:flex-row h-full min-w-0 ", children: [
|
|
71
|
-
/* @__PURE__ */ a("div", { className: "w-64 lg:w-80 flex-shrink-0 hidden md:block border-r border-gray-200 dark:border-gray-700 pr-4", children: /* @__PURE__ */ a(
|
|
70
|
+
/* @__PURE__ */ a("div", { className: "w-64 lg:w-80 flex-shrink-0 hidden md:block border-r border-gray-200 dark:border-gray-700 pr-4", children: /* @__PURE__ */ a(S, { className: "h-full", children: /* @__PURE__ */ a("div", { className: "space-y-1", children: s.map((e, r) => /* @__PURE__ */ n(
|
|
72
71
|
"div",
|
|
73
72
|
{
|
|
74
73
|
className: `px-2 py-2 rounded-2xl text-sm transition-colors flex items-center gap-2 ${e.disabled ? "text-gray-400 cursor-not-allowed opacity-50" : i === e.value ? "crm-color-styled font-medium cursor-pointer" : "text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700 cursor-pointer"}`,
|
|
75
|
-
onClick: () => !e.disabled &&
|
|
74
|
+
onClick: () => !e.disabled && m(e.value),
|
|
76
75
|
children: [
|
|
77
76
|
e.icon && /* @__PURE__ */ a(e.icon, { className: "size-4" }),
|
|
78
77
|
/* @__PURE__ */ a("span", { className: "flex-1", children: c(e.titleKey) }),
|
|
@@ -86,9 +85,9 @@ const J = ({ tabs: s, item: l }) => {
|
|
|
86
85
|
},
|
|
87
86
|
r
|
|
88
87
|
)) }) }) }),
|
|
89
|
-
/* @__PURE__ */ a("div", { className: "md:hidden w-full border-b pb-4 mb-4", children: /* @__PURE__ */ n(P, { value: i, onValueChange:
|
|
90
|
-
/* @__PURE__ */ a(j, { className: "w-full", children: /* @__PURE__ */ a(
|
|
91
|
-
/* @__PURE__ */ a(
|
|
88
|
+
/* @__PURE__ */ a("div", { className: "md:hidden w-full border-b pb-4 mb-4", children: /* @__PURE__ */ n(P, { value: i, onValueChange: m, children: [
|
|
89
|
+
/* @__PURE__ */ a(j, { className: "w-full", children: /* @__PURE__ */ a(M, { placeholder: "Sélectionner une section" }) }),
|
|
90
|
+
/* @__PURE__ */ a(z, { children: s.map((e, r) => /* @__PURE__ */ a(L, { value: e.value, disabled: e.disabled, children: /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
92
91
|
e.icon && /* @__PURE__ */ a(e.icon, { className: "size-4" }),
|
|
93
92
|
/* @__PURE__ */ a("span", { children: c(e.titleKey) }),
|
|
94
93
|
e.count && /* @__PURE__ */ n("span", { className: "text-xs text-gray-500", children: [
|
|
@@ -103,8 +102,8 @@ const J = ({ tabs: s, item: l }) => {
|
|
|
103
102
|
] });
|
|
104
103
|
};
|
|
105
104
|
export {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
105
|
+
Y as A,
|
|
106
|
+
K as a,
|
|
107
|
+
Z as b,
|
|
108
|
+
$ as c
|
|
110
109
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as e, jsxs as i, Fragment as U } from "react/jsx-runtime";
|
|
2
|
-
import { D as Y, b as Z, P as L, e as ee, h as re, c as le,
|
|
3
|
-
import { A as se, a as oe } from "./
|
|
2
|
+
import { D as Y, b as Z, P as L, e as ee, h as re, c as le, a$ as ie, aW as ae, m as W, p as q, s as S, t as J, q as F, r as B, o as X, u as te, n as ne } from "./toggle-group-iLf3T7oV.js";
|
|
3
|
+
import { A as se, a as oe } from "./alert-sHZy6NHC.js";
|
|
4
4
|
import { B as k } from "./tooltip-CAu4DEhc.js";
|
|
5
|
-
import { X as
|
|
5
|
+
import { X as O } from "./select-zzSnHs9S.js";
|
|
6
6
|
import "next-themes";
|
|
7
7
|
import { useState as _, useEffect as de } from "react";
|
|
8
|
-
import { useTranslation as
|
|
9
|
-
import { c as
|
|
10
|
-
import { E as ce } from "./ErrorAlert-
|
|
8
|
+
import { useTranslation as G } from "react-i18next";
|
|
9
|
+
import { c as z } from "./index-DSyPHOLE.js";
|
|
10
|
+
import { E as ce } from "./ErrorAlert-DpOsMww8.js";
|
|
11
11
|
/**
|
|
12
12
|
* @license lucide-react v1.16.0 - ISC
|
|
13
13
|
*
|
|
@@ -18,7 +18,7 @@ const me = [
|
|
|
18
18
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
19
19
|
["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
|
|
20
20
|
["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
|
|
21
|
-
], he =
|
|
21
|
+
], he = z("circle-alert", me);
|
|
22
22
|
/**
|
|
23
23
|
* @license lucide-react v1.16.0 - ISC
|
|
24
24
|
*
|
|
@@ -33,7 +33,7 @@ const ue = [
|
|
|
33
33
|
key: "1a8usu"
|
|
34
34
|
}
|
|
35
35
|
]
|
|
36
|
-
], I =
|
|
36
|
+
], I = z("pen", ue);
|
|
37
37
|
/**
|
|
38
38
|
* @license lucide-react v1.16.0 - ISC
|
|
39
39
|
*
|
|
@@ -50,7 +50,7 @@ const ge = [
|
|
|
50
50
|
],
|
|
51
51
|
["path", { d: "M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7", key: "1ydtos" }],
|
|
52
52
|
["path", { d: "M7 3v4a1 1 0 0 0 1 1h7", key: "t51u73" }]
|
|
53
|
-
], P =
|
|
53
|
+
], P = z("save", ge);
|
|
54
54
|
/**
|
|
55
55
|
* @license lucide-react v1.16.0 - ISC
|
|
56
56
|
*
|
|
@@ -61,9 +61,9 @@ const pe = [
|
|
|
61
61
|
["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
|
|
62
62
|
["path", { d: "M3 6h18", key: "d0wm0j" }],
|
|
63
63
|
["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
|
|
64
|
-
], fe =
|
|
64
|
+
], fe = z("trash", pe);
|
|
65
65
|
function ve({ open: s, onOpenChange: h, config: l, isLoading: o, error: d, children: c }) {
|
|
66
|
-
const { t: n } =
|
|
66
|
+
const { t: n } = G(), { title: C, description: g, icon: v, maxWidth: D = "sm:max-w-xl", actions: u } = l;
|
|
67
67
|
return /* @__PURE__ */ e(Y, { open: s, onOpenChange: h, children: /* @__PURE__ */ i(Z, { className: `${D} max-h-[90vh] border-0 shadow-2xl p-0 flex flex-col overflow-hidden`, children: [
|
|
68
68
|
o === !0 ? /* @__PURE__ */ e("div", { className: "absolute top-0 left-0 right-0 z-10", children: /* @__PURE__ */ e(L, { indeterminate: !0, className: "h-1 rounded-none" }) }) : null,
|
|
69
69
|
/* @__PURE__ */ i(ee, { className: "bg-gradient-to-r from-slate-900 to-purple-700 p-6 rounded-t-lg shrink-0", children: [
|
|
@@ -78,13 +78,13 @@ function ve({ open: s, onOpenChange: h, config: l, isLoading: o, error: d, child
|
|
|
78
78
|
/* @__PURE__ */ e(oe, { className: "break-words overflow-wrap-anywhere max-w-full", children: d.message })
|
|
79
79
|
] }) }) : null,
|
|
80
80
|
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto px-6 ", children: c }),
|
|
81
|
-
u !== void 0 && u.length > 0 ? /* @__PURE__ */ e("div", { className: "rounded-b-lg border-t border-gray-200 dark:border-gray-700 shrink-0 p-6 light:bg-gradient-to-r light:from-gray-50 light:to-gray-100 dark:bg-gray-950", children: /* @__PURE__ */ e("div", { className: "flex justify-end gap-3", children: u.map((m,
|
|
81
|
+
u !== void 0 && u.length > 0 ? /* @__PURE__ */ e("div", { className: "rounded-b-lg border-t border-gray-200 dark:border-gray-700 shrink-0 p-6 light:bg-gradient-to-r light:from-gray-50 light:to-gray-100 dark:bg-gray-950", children: /* @__PURE__ */ e("div", { className: "flex justify-end gap-3", children: u.map((m, V) => /* @__PURE__ */ i(k, { variant: m.variant ?? "default", onClick: m.onClick, disabled: m.disabled === !0 || o === !0, children: [
|
|
82
82
|
m.icon !== void 0 ? /* @__PURE__ */ e(m.icon, { className: "size-4" }) : null,
|
|
83
83
|
n(m.label)
|
|
84
|
-
] },
|
|
84
|
+
] }, V)) }) }) : null
|
|
85
85
|
] }) });
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function je({
|
|
88
88
|
open: s,
|
|
89
89
|
onOpenChange: h,
|
|
90
90
|
data: l,
|
|
@@ -98,7 +98,7 @@ function Ve({
|
|
|
98
98
|
saveLabel: D = "Sauvegarder",
|
|
99
99
|
cancelLabel: u = "Annuler",
|
|
100
100
|
hideSaveIcon: m = !1,
|
|
101
|
-
maxWidth:
|
|
101
|
+
maxWidth: V = "sm:max-w-4xl"
|
|
102
102
|
}) {
|
|
103
103
|
const [w, y] = _(g), [b, N] = _({}), [p, A] = _(!1);
|
|
104
104
|
if (de(() => {
|
|
@@ -120,7 +120,7 @@ function Ve({
|
|
|
120
120
|
y(!0), N({});
|
|
121
121
|
}, M = () => {
|
|
122
122
|
y(!1), N({});
|
|
123
|
-
},
|
|
123
|
+
}, $ = async () => {
|
|
124
124
|
if (n !== void 0) {
|
|
125
125
|
A(!0);
|
|
126
126
|
try {
|
|
@@ -131,13 +131,13 @@ function Ve({
|
|
|
131
131
|
A(!1);
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
},
|
|
134
|
+
}, H = (r, a) => {
|
|
135
135
|
N((f) => ({ ...f, [r]: a }));
|
|
136
|
-
},
|
|
136
|
+
}, K = (r) => {
|
|
137
137
|
if (w && n !== void 0) {
|
|
138
138
|
if (r.renderEdit !== void 0)
|
|
139
139
|
return r.renderEdit(l, b, (t) => {
|
|
140
|
-
|
|
140
|
+
H(r.key, t);
|
|
141
141
|
});
|
|
142
142
|
let x = "";
|
|
143
143
|
if (b[r.key] !== void 0)
|
|
@@ -153,7 +153,7 @@ function Ve({
|
|
|
153
153
|
{
|
|
154
154
|
value: x,
|
|
155
155
|
onChange: (t) => {
|
|
156
|
-
|
|
156
|
+
H(r.key, t.target.value);
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
);
|
|
@@ -164,25 +164,25 @@ function Ve({
|
|
|
164
164
|
let f = "Non renseigné";
|
|
165
165
|
return Array.isArray(a) ? a.length > 0 && (f = a.map((t) => {
|
|
166
166
|
if (typeof t == "object" && t !== null) {
|
|
167
|
-
const
|
|
168
|
-
return typeof
|
|
167
|
+
const j = t;
|
|
168
|
+
return typeof j.name == "string" ? j.name : typeof j.label == "string" ? j.label : JSON.stringify(t);
|
|
169
169
|
}
|
|
170
170
|
return String(t);
|
|
171
171
|
}).join(", ")) : typeof a == "object" && a !== null ? f = JSON.stringify(a) : (typeof a == "string" || typeof a == "number" || typeof a == "boolean") && (f = String(a)), /* @__PURE__ */ e("div", { className: "p-2 bg-gray-50 dark:bg-gray-900 rounded border border-transparent min-h-[36px] flex items-center", children: f });
|
|
172
|
-
},
|
|
172
|
+
}, Q = (r) => /* @__PURE__ */ i("div", { className: `col-span-1 ${r.fullWidth === !0 ? "md:col-span-2" : ""}`, children: [
|
|
173
173
|
/* @__PURE__ */ e(ie, { className: "mb-1 block text-sm font-medium", children: r.label }),
|
|
174
|
-
|
|
174
|
+
K(r)
|
|
175
175
|
] }, r.key), E = [];
|
|
176
176
|
n !== void 0 && (w ? (u !== "" && E.push({
|
|
177
177
|
label: u,
|
|
178
178
|
onClick: M,
|
|
179
179
|
variant: "outline",
|
|
180
180
|
disabled: p,
|
|
181
|
-
icon:
|
|
181
|
+
icon: O
|
|
182
182
|
}), E.push({
|
|
183
183
|
label: p ? "Enregistrement..." : D,
|
|
184
184
|
onClick: () => {
|
|
185
|
-
|
|
185
|
+
$();
|
|
186
186
|
},
|
|
187
187
|
variant: "default",
|
|
188
188
|
disabled: p,
|
|
@@ -197,7 +197,7 @@ function Ve({
|
|
|
197
197
|
}));
|
|
198
198
|
const R = {
|
|
199
199
|
title: o(l),
|
|
200
|
-
maxWidth:
|
|
200
|
+
maxWidth: V,
|
|
201
201
|
actions: v ? E : []
|
|
202
202
|
};
|
|
203
203
|
return /* @__PURE__ */ e(
|
|
@@ -216,19 +216,19 @@ function Ve({
|
|
|
216
216
|
r.icon,
|
|
217
217
|
/* @__PURE__ */ e("h3", { className: "text-lg font-semibold", children: r.title })
|
|
218
218
|
] }),
|
|
219
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-4", children: r.fields.map(
|
|
219
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-4", children: r.fields.map(Q) })
|
|
220
220
|
] }, a)) }),
|
|
221
221
|
C !== void 0 ? C(l) : null,
|
|
222
222
|
n !== void 0 && !v ? /* @__PURE__ */ e("div", { className: "flex justify-end gap-2 border-t pt-4 mt-6", children: w ? /* @__PURE__ */ i(U, { children: [
|
|
223
223
|
u !== "" ? /* @__PURE__ */ i(k, { onClick: M, variant: "outline", size: "sm", disabled: p, children: [
|
|
224
|
-
/* @__PURE__ */ e(
|
|
224
|
+
/* @__PURE__ */ e(O, { className: "h-4 w-4 mr-2" }),
|
|
225
225
|
u
|
|
226
226
|
] }) : null,
|
|
227
227
|
/* @__PURE__ */ i(
|
|
228
228
|
k,
|
|
229
229
|
{
|
|
230
230
|
onClick: () => {
|
|
231
|
-
|
|
231
|
+
$();
|
|
232
232
|
},
|
|
233
233
|
size: "sm",
|
|
234
234
|
disabled: p,
|
|
@@ -257,13 +257,13 @@ function Ve({
|
|
|
257
257
|
}
|
|
258
258
|
);
|
|
259
259
|
}
|
|
260
|
-
const
|
|
261
|
-
const { t: o } =
|
|
260
|
+
const ze = ({ isLoading: s, error: h, config: l }) => {
|
|
261
|
+
const { t: o } = G(), d = (c) => {
|
|
262
262
|
!c && !s && l.onClose();
|
|
263
263
|
};
|
|
264
|
-
return /* @__PURE__ */ e(
|
|
264
|
+
return /* @__PURE__ */ e(W, { open: l.isOpen, onOpenChange: d, children: /* @__PURE__ */ i(q, { children: [
|
|
265
265
|
/* @__PURE__ */ i(S, { children: [
|
|
266
|
-
/* @__PURE__ */ i(
|
|
266
|
+
/* @__PURE__ */ i(J, { className: "flex items-center gap-2 text-destructive", children: [
|
|
267
267
|
/* @__PURE__ */ e(fe, { className: "size-4" }),
|
|
268
268
|
o(l.title)
|
|
269
269
|
] }),
|
|
@@ -273,7 +273,7 @@ const je = ({ isLoading: s, error: h, config: l }) => {
|
|
|
273
273
|
] }),
|
|
274
274
|
/* @__PURE__ */ e(ce, { error: h instanceof Error ? null : h }),
|
|
275
275
|
/* @__PURE__ */ i(B, { children: [
|
|
276
|
-
/* @__PURE__ */ i(
|
|
276
|
+
/* @__PURE__ */ i(X, { disabled: s, children: [
|
|
277
277
|
" ",
|
|
278
278
|
o("common.buttons.cancel")
|
|
279
279
|
] }),
|
|
@@ -291,7 +291,7 @@ const je = ({ isLoading: s, error: h, config: l }) => {
|
|
|
291
291
|
] })
|
|
292
292
|
] }) });
|
|
293
293
|
};
|
|
294
|
-
function
|
|
294
|
+
function Ve({
|
|
295
295
|
children: s,
|
|
296
296
|
title: h,
|
|
297
297
|
description: l,
|
|
@@ -300,15 +300,15 @@ function ze({
|
|
|
300
300
|
onConfirm: c,
|
|
301
301
|
destructive: n = !1
|
|
302
302
|
}) {
|
|
303
|
-
return /* @__PURE__ */ i(
|
|
303
|
+
return /* @__PURE__ */ i(W, { children: [
|
|
304
304
|
/* @__PURE__ */ e(te, { asChild: !0, children: s }),
|
|
305
|
-
/* @__PURE__ */ i(
|
|
305
|
+
/* @__PURE__ */ i(q, { children: [
|
|
306
306
|
/* @__PURE__ */ i(S, { children: [
|
|
307
|
-
/* @__PURE__ */ e(
|
|
307
|
+
/* @__PURE__ */ e(J, { children: h }),
|
|
308
308
|
/* @__PURE__ */ e(F, { children: l })
|
|
309
309
|
] }),
|
|
310
310
|
/* @__PURE__ */ i(B, { children: [
|
|
311
|
-
/* @__PURE__ */ e(
|
|
311
|
+
/* @__PURE__ */ e(X, { children: d }),
|
|
312
312
|
/* @__PURE__ */ e(ne, { onClick: c, className: n ? "bg-red-600 hover:bg-red-700" : "", children: o })
|
|
313
313
|
] })
|
|
314
314
|
] })
|
|
@@ -316,7 +316,7 @@ function ze({
|
|
|
316
316
|
}
|
|
317
317
|
export {
|
|
318
318
|
ve as A,
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
319
|
+
ze as C,
|
|
320
|
+
je as F,
|
|
321
|
+
Ve as a
|
|
322
322
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { u as X } from "./useDataTable-CQpx3zTg.js";
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
3
|
+
import { ax as _, aL as A, az as I, aB as Y, _ as $, cr as Z, cs as K, ay as R } from "./toggle-group-iLf3T7oV.js";
|
|
4
|
+
import "./alert-sHZy6NHC.js";
|
|
5
5
|
import { B as v } from "./tooltip-CAu4DEhc.js";
|
|
6
6
|
import "./select-zzSnHs9S.js";
|
|
7
7
|
import "next-themes";
|
|
@@ -57,12 +57,12 @@ const oe = [
|
|
|
57
57
|
}
|
|
58
58
|
],
|
|
59
59
|
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
60
|
-
], ce = z("settings", oe),
|
|
60
|
+
], ce = z("settings", oe), B = [5, 10, 30, 50, 100], he = B[1];
|
|
61
61
|
function ge({ actions: d, row: n }) {
|
|
62
|
-
return /* @__PURE__ */ a(
|
|
63
|
-
/* @__PURE__ */ e(
|
|
62
|
+
return /* @__PURE__ */ a(_, { children: [
|
|
63
|
+
/* @__PURE__ */ e(A, { asChild: !0, children: /* @__PURE__ */ e(v, { variant: "ghost", size: "icon", className: "h-8 w-8 text-muted-foreground hover:text-foreground", children: /* @__PURE__ */ e(ee, { className: "size-4" }) }) }),
|
|
64
64
|
/* @__PURE__ */ e(
|
|
65
|
-
|
|
65
|
+
I,
|
|
66
66
|
{
|
|
67
67
|
align: "end",
|
|
68
68
|
onClick: (t) => {
|
|
@@ -359,9 +359,9 @@ function ye({
|
|
|
359
359
|
] });
|
|
360
360
|
}
|
|
361
361
|
function xe({ columns: d, visibleColumns: n, toggleColumnVisibility: t }) {
|
|
362
|
-
return /* @__PURE__ */ a(
|
|
363
|
-
/* @__PURE__ */ e(
|
|
364
|
-
/* @__PURE__ */ e(
|
|
362
|
+
return /* @__PURE__ */ a(_, { children: [
|
|
363
|
+
/* @__PURE__ */ e(A, { asChild: !0, children: /* @__PURE__ */ e(v, { variant: "outline", size: "sm", className: "size-8 p-0 bg-white hover:bg-gray-100 dark:bg-gray-900 shadow-sm border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ e(ce, { className: "size-4 text-gray-600 dark:text-gray-300" }) }) }),
|
|
364
|
+
/* @__PURE__ */ e(I, { align: "end", className: "w-56", children: d.map((s) => /* @__PURE__ */ e(
|
|
365
365
|
R,
|
|
366
366
|
{
|
|
367
367
|
checked: n.has(s.key),
|
|
@@ -387,7 +387,7 @@ function Te({
|
|
|
387
387
|
isLoading: l = !1,
|
|
388
388
|
noDataMessage: b = "Aucun résultat",
|
|
389
389
|
defaultPageSize: N = he,
|
|
390
|
-
pageSizeOptions: f =
|
|
390
|
+
pageSizeOptions: f = B
|
|
391
391
|
}) {
|
|
392
392
|
const {
|
|
393
393
|
sortColumn: k,
|
|
@@ -404,17 +404,17 @@ function Te({
|
|
|
404
404
|
hasActions: u,
|
|
405
405
|
hasBulkActions: j,
|
|
406
406
|
visibleColumnsArray: T,
|
|
407
|
-
colSpanCount:
|
|
408
|
-
paginatedData:
|
|
407
|
+
colSpanCount: L,
|
|
408
|
+
paginatedData: P,
|
|
409
409
|
handleSort: V,
|
|
410
410
|
handleMouseDown: q,
|
|
411
|
-
handleDragStart:
|
|
412
|
-
handleDragOver:
|
|
413
|
-
handleDrop:
|
|
414
|
-
toggleColumnVisibility:
|
|
415
|
-
toggleRowSelection:
|
|
416
|
-
toggleSelectAll:
|
|
417
|
-
pageSize:
|
|
411
|
+
handleDragStart: E,
|
|
412
|
+
handleDragOver: G,
|
|
413
|
+
handleDrop: H,
|
|
414
|
+
toggleColumnVisibility: O,
|
|
415
|
+
toggleRowSelection: U,
|
|
416
|
+
toggleSelectAll: W,
|
|
417
|
+
pageSize: F,
|
|
418
418
|
setPageSize: J,
|
|
419
419
|
setCurrentPage: Q
|
|
420
420
|
} = X({
|
|
@@ -436,7 +436,7 @@ function Te({
|
|
|
436
436
|
hasBulkActions: j,
|
|
437
437
|
selectedRows: c,
|
|
438
438
|
totalItems: d.length,
|
|
439
|
-
toggleSelectAll:
|
|
439
|
+
toggleSelectAll: W,
|
|
440
440
|
visibleColumnsArray: T,
|
|
441
441
|
draggableColumns: y,
|
|
442
442
|
resizableColumns: x,
|
|
@@ -444,26 +444,26 @@ function Te({
|
|
|
444
444
|
sortColumn: k,
|
|
445
445
|
sortDirection: w,
|
|
446
446
|
handleSort: V,
|
|
447
|
-
handleDragStart:
|
|
448
|
-
handleDragOver:
|
|
449
|
-
handleDrop:
|
|
447
|
+
handleDragStart: E,
|
|
448
|
+
handleDragOver: G,
|
|
449
|
+
handleDrop: H,
|
|
450
450
|
handleMouseDown: q,
|
|
451
451
|
hasActions: u,
|
|
452
|
-
settingsNode: g ? /* @__PURE__ */ e(xe, { columns: n, visibleColumns: o, toggleColumnVisibility:
|
|
452
|
+
settingsNode: g ? /* @__PURE__ */ e(xe, { columns: n, visibleColumns: o, toggleColumnVisibility: O }) : void 0
|
|
453
453
|
}
|
|
454
454
|
),
|
|
455
455
|
/* @__PURE__ */ e(
|
|
456
456
|
me,
|
|
457
457
|
{
|
|
458
458
|
isLoading: l,
|
|
459
|
-
colSpanCount:
|
|
459
|
+
colSpanCount: L,
|
|
460
460
|
noDataMessage: b,
|
|
461
|
-
paginatedData:
|
|
461
|
+
paginatedData: P,
|
|
462
462
|
getRowId: t,
|
|
463
463
|
onRowClick: s,
|
|
464
464
|
hasBulkActions: j,
|
|
465
465
|
selectedRows: c,
|
|
466
|
-
toggleRowSelection:
|
|
466
|
+
toggleRowSelection: U,
|
|
467
467
|
visibleColumnsArray: T,
|
|
468
468
|
columnWidths: p,
|
|
469
469
|
hasActions: u,
|
|
@@ -478,7 +478,7 @@ function Te({
|
|
|
478
478
|
totalItems: d.length,
|
|
479
479
|
startIndex: C,
|
|
480
480
|
endIndex: D,
|
|
481
|
-
pageSize:
|
|
481
|
+
pageSize: F,
|
|
482
482
|
setPageSize: J,
|
|
483
483
|
currentPage: r,
|
|
484
484
|
setCurrentPage: Q,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsxs as r, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { L as i } from "./loader-circle-GAYBtm3z.js";
|
|
3
|
+
const d = ({ message: e }) => /* @__PURE__ */ r("div", { className: "p-6 border border-destructive bg-destructive/10 text-destructive rounded-md animate-fade-in", children: [
|
|
4
|
+
/* @__PURE__ */ t("p", { className: "font-semibold mb-2", children: "Une erreur est survenue." }),
|
|
5
|
+
e !== void 0 && e !== "" ? /* @__PURE__ */ t("p", { className: "text-sm opacity-80", children: e }) : null
|
|
6
|
+
] }), s = ({ message: e }) => /* @__PURE__ */ r("div", { className: "flex flex-col items-center justify-center p-12 text-muted-foreground animate-fade-in", children: [
|
|
7
|
+
/* @__PURE__ */ t(i, { className: "size-8 animate-spin mb-4 text-primary" }),
|
|
8
|
+
e !== void 0 && e !== "" ? /* @__PURE__ */ t("p", { className: "font-semibold text-sm", children: e }) : null
|
|
9
|
+
] });
|
|
10
|
+
export {
|
|
11
|
+
d as E,
|
|
12
|
+
s as L
|
|
13
|
+
};
|