@krosoft/react 0.0.183 → 0.0.184
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-DtdwQdm-.js → AppActions-DZ7wVdmt.js} +8 -7
- package/dist/{AppSubTitle-Co9HDBO4.js → AppSubTitle-CZN_tmfv.js} +1 -1
- package/dist/{AppVerticalTabs-B3_nbdLm.js → AppVerticalTabs-C1SsBNAH.js} +26 -25
- package/dist/{ConfirmationDialog-3rO4sYM8.js → ConfirmationDialog-M8sFAz4h.js} +7 -6
- package/dist/{DataTable-Ckbr166c.js → DataTable-KMYbhJ4C.js} +29 -28
- package/dist/{GenericForm-ClzOIaJc.js → GenericForm-DtY0moOD.js} +93 -92
- package/dist/{ImageInput-BPV_4oDI.js → ImageInput-3wZuCZGf.js} +2 -1
- package/dist/{KpiCardsLayout-D67cLG3R.js → KpiCardsLayout-DjRTqXFa.js} +16 -15
- package/dist/{MetricCard-BAa26w6e.js → MetricCard-B0xnFyim.js} +1 -1
- package/dist/{MultiSelect-ovXnKCuU.js → MultiSelect-BhRXVpky.js} +14 -13
- package/dist/PieChart-C9gn0Dws.js +282 -0
- package/dist/{SearchInput-B08-Mcsx.js → SearchInput-BXOlvTO9.js} +30 -29
- package/dist/{SkeletonCards-D0V2nuDg.js → SkeletonCards-av7XHlof.js} +12 -11
- package/dist/{TableFilter-Z0T30AzZ.js → TableFilter-BlrrSOtg.js} +21 -20
- package/dist/chart-DntJZGxB.js +181 -0
- package/dist/components/core/cards/index.js +2 -2
- package/dist/components/core/charts/BarChartHorizontal.d.ts +24 -0
- package/dist/components/core/charts/BarChartHorizontal.d.ts.map +1 -0
- package/dist/components/core/charts/BarChartVertical.d.ts +24 -0
- package/dist/components/core/charts/BarChartVertical.d.ts.map +1 -0
- package/dist/components/core/charts/ChartCard.d.ts +31 -0
- package/dist/components/core/charts/ChartCard.d.ts.map +1 -0
- package/dist/components/core/charts/CircularGauge.d.ts +39 -0
- package/dist/components/core/charts/CircularGauge.d.ts.map +1 -0
- package/dist/components/core/charts/LineChart.d.ts +23 -0
- package/dist/components/core/charts/LineChart.d.ts.map +1 -0
- package/dist/components/core/charts/PieChart.d.ts +26 -0
- package/dist/components/core/charts/PieChart.d.ts.map +1 -0
- package/dist/components/core/charts/chartColors.d.ts +13 -0
- package/dist/components/core/charts/chartColors.d.ts.map +1 -0
- package/dist/components/core/charts/chartTooltip.helper.d.ts +14 -0
- package/dist/components/core/charts/chartTooltip.helper.d.ts.map +1 -0
- package/dist/components/core/charts/index.d.ts +14 -0
- package/dist/components/core/charts/index.d.ts.map +1 -0
- package/dist/components/core/charts/index.js +11 -0
- package/dist/components/core/dialogs/index.js +2 -2
- package/dist/components/core/filters/index.js +1 -1
- package/dist/components/core/forms/index.js +1 -1
- package/dist/components/core/index.d.ts +1 -0
- package/dist/components/core/index.d.ts.map +1 -1
- package/dist/components/core/index.js +80 -71
- package/dist/components/core/inputs/index.js +3 -3
- package/dist/components/core/layouts/index.js +3 -3
- package/dist/components/core/table/index.js +1 -1
- package/dist/components/core/tabs/index.js +1 -1
- package/dist/components/index.js +307 -297
- 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 +218 -217
- package/dist/tailwind/index.d.ts +7 -0
- package/dist/tailwind/index.d.ts.map +1 -1
- package/dist/tailwind/index.js +11 -2
- package/dist/{toaster-BaFcYXKg.js → toaster-Cm7utXqi.js} +13 -13
- package/dist/toggle-group-D6aFQQcf.js +1460 -0
- package/dist/types/ChartDatum.d.ts +19 -0
- package/dist/types/ChartDatum.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/toggle-group-D2Li0iBJ.js +0 -1636
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { I as
|
|
3
|
-
import { A as
|
|
4
|
-
import { M as
|
|
5
|
-
import {
|
|
1
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { I as W } from "./ImageInput-3wZuCZGf.js";
|
|
3
|
+
import { A as T } from "./AppSubTitle-CZN_tmfv.js";
|
|
4
|
+
import { M as q } from "./MultiSelect-BhRXVpky.js";
|
|
5
|
+
import { aB as D, aE as J, aF as L, aG as Q, aC as A, aH as X, bF as Y, O as $ } from "./toggle-group-D6aFQQcf.js";
|
|
6
6
|
import "./alert-B9F1N9Qk.js";
|
|
7
7
|
import "@radix-ui/react-aspect-ratio";
|
|
8
8
|
import { B as M } from "./tooltip-DVeqVwqV.js";
|
|
9
|
+
import { C as F, d as ee, a as te } from "./chart-DntJZGxB.js";
|
|
9
10
|
import "@radix-ui/react-collapsible";
|
|
10
|
-
import { I as
|
|
11
|
+
import { I as C } from "./sheet-B_uq6-K_.js";
|
|
11
12
|
import "lucide-react";
|
|
12
13
|
import "react-resizable-panels";
|
|
13
14
|
import { c as i } from "./tailwind.helper-B6yFEsav.js";
|
|
14
|
-
import { S as
|
|
15
|
+
import { S as re, h as ae, i as se, a as ne, c as le } from "./select-BpjFWqAY.js";
|
|
15
16
|
import "next-themes";
|
|
16
17
|
import "sonner";
|
|
17
18
|
import { u as ce } from "./useToast-BFTk4lWz.js";
|
|
18
19
|
import { zodResolver as oe } from "@hookform/resolvers/zod";
|
|
19
|
-
import { useState as
|
|
20
|
+
import { useState as k } from "react";
|
|
20
21
|
import { useForm as ue } from "react-hook-form";
|
|
21
22
|
import { useTranslation as ie } from "react-i18next";
|
|
22
23
|
import { z as b } from "zod";
|
|
23
|
-
const
|
|
24
|
+
const Be = ({
|
|
24
25
|
schema: h,
|
|
25
26
|
isLoading: S,
|
|
26
|
-
error:
|
|
27
|
+
error: N,
|
|
27
28
|
onSubmit: P,
|
|
28
29
|
onCancel: f,
|
|
29
30
|
initialData: y,
|
|
@@ -32,9 +33,9 @@ const ze = ({
|
|
|
32
33
|
onRegisterSubmit: K,
|
|
33
34
|
defaultCols: z = 4
|
|
34
35
|
}) => {
|
|
35
|
-
const { t: u } = ie(), { toast: E } = ce(), [g, w] =
|
|
36
|
+
const { t: u } = ie(), { toast: E } = ce(), [g, w] = k(!1), [de, I] = k({});
|
|
36
37
|
if (!h) return null;
|
|
37
|
-
const
|
|
38
|
+
const B = (e) => {
|
|
38
39
|
switch (e) {
|
|
39
40
|
case 1:
|
|
40
41
|
return "md:col-span-1 col-span-4";
|
|
@@ -49,13 +50,13 @@ const ze = ({
|
|
|
49
50
|
}, O = (() => {
|
|
50
51
|
const e = {};
|
|
51
52
|
return h.sections.forEach((t) => {
|
|
52
|
-
t.fields.forEach((
|
|
53
|
-
if (
|
|
54
|
-
e[
|
|
53
|
+
t.fields.forEach((r) => {
|
|
54
|
+
if (r.rules)
|
|
55
|
+
e[r.key] = r.rules(b);
|
|
55
56
|
else
|
|
56
|
-
switch (
|
|
57
|
+
switch (r.type) {
|
|
57
58
|
case "checkbox":
|
|
58
|
-
e[
|
|
59
|
+
e[r.key] = b.boolean().nullable().optional();
|
|
59
60
|
break;
|
|
60
61
|
case "html":
|
|
61
62
|
break;
|
|
@@ -68,7 +69,7 @@ const ze = ({
|
|
|
68
69
|
case "multiSelect":
|
|
69
70
|
case "color":
|
|
70
71
|
case "image":
|
|
71
|
-
e[
|
|
72
|
+
e[r.key] = b.string().nullable().optional();
|
|
72
73
|
break;
|
|
73
74
|
}
|
|
74
75
|
});
|
|
@@ -77,19 +78,19 @@ const ze = ({
|
|
|
77
78
|
resolver: oe(O),
|
|
78
79
|
defaultValues: y || Object.fromEntries(h.sections.flatMap((e) => e.fields.map((t) => [t.key, t.defaultValue ?? null])))
|
|
79
80
|
});
|
|
80
|
-
|
|
81
|
-
K && K(() => void m.handleSubmit(
|
|
82
|
-
}),
|
|
81
|
+
k(() => {
|
|
82
|
+
K && K(() => void m.handleSubmit(V)());
|
|
83
|
+
}), k(() => {
|
|
83
84
|
if (y) {
|
|
84
85
|
const e = {};
|
|
85
86
|
h.sections.forEach((t) => {
|
|
86
|
-
t.fields.forEach((
|
|
87
|
-
|
|
87
|
+
t.fields.forEach((r) => {
|
|
88
|
+
r.type === "image" && y[r.key] && (e[r.key] = y[r.key]);
|
|
88
89
|
});
|
|
89
90
|
}), I(e);
|
|
90
91
|
}
|
|
91
92
|
});
|
|
92
|
-
const
|
|
93
|
+
const V = async (e) => {
|
|
93
94
|
if (g) return;
|
|
94
95
|
if (Object.keys(m.formState.errors).length > 0) {
|
|
95
96
|
E({
|
|
@@ -102,8 +103,8 @@ const ze = ({
|
|
|
102
103
|
w(!0);
|
|
103
104
|
try {
|
|
104
105
|
await Promise.resolve(P(e));
|
|
105
|
-
} catch (
|
|
106
|
-
console.error("Error during form submission:",
|
|
106
|
+
} catch (r) {
|
|
107
|
+
console.error("Error during form submission:", r), E({
|
|
107
108
|
title: "Erreur",
|
|
108
109
|
description: "Une erreur est survenue lors de l'enregistrement",
|
|
109
110
|
variant: "destructive"
|
|
@@ -111,53 +112,53 @@ const ze = ({
|
|
|
111
112
|
} finally {
|
|
112
113
|
w(!1);
|
|
113
114
|
}
|
|
114
|
-
},
|
|
115
|
-
t && I((
|
|
116
|
-
},
|
|
115
|
+
}, R = (e, t) => {
|
|
116
|
+
t && I((r) => ({ ...r, [e]: t }));
|
|
117
|
+
}, G = (e) => {
|
|
117
118
|
if (!e) return !1;
|
|
118
|
-
const t = (
|
|
119
|
-
if (!
|
|
120
|
-
const s =
|
|
119
|
+
const t = (r) => {
|
|
120
|
+
if (!r || !r._def) return !1;
|
|
121
|
+
const s = r._def;
|
|
121
122
|
return s.typeName === "ZodNullable" ? !0 : s.innerType ? t(s.innerType) : s.type ? t(s.type) : !1;
|
|
122
123
|
};
|
|
123
124
|
try {
|
|
124
|
-
const
|
|
125
|
-
return t(
|
|
125
|
+
const r = e(b);
|
|
126
|
+
return t(r);
|
|
126
127
|
} catch {
|
|
127
128
|
return !1;
|
|
128
129
|
}
|
|
129
|
-
},
|
|
130
|
+
}, Z = (e) => {
|
|
130
131
|
var s;
|
|
131
132
|
if (!e) return !1;
|
|
132
133
|
const t = e(b);
|
|
133
134
|
return t.safeParse(void 0).success ? !1 : ((s = t._def.checks) == null ? void 0 : s.some((n) => n.kind === "min")) ?? !1;
|
|
134
|
-
},
|
|
135
|
-
const
|
|
135
|
+
}, _ = (e, t) => {
|
|
136
|
+
const r = !!m.formState.errors[e.key], s = x;
|
|
136
137
|
switch (e.type) {
|
|
137
138
|
case "text":
|
|
138
139
|
case "color":
|
|
139
|
-
return /* @__PURE__ */
|
|
140
|
-
|
|
140
|
+
return /* @__PURE__ */ a(
|
|
141
|
+
C,
|
|
141
142
|
{
|
|
142
143
|
type: e.type,
|
|
143
144
|
...t,
|
|
144
145
|
placeholder: e.placeholderKey ? u(e.placeholderKey) : "",
|
|
145
|
-
className: i(
|
|
146
|
+
className: i(r && "border-destructive"),
|
|
146
147
|
disabled: s,
|
|
147
148
|
value: t.value ?? ""
|
|
148
149
|
}
|
|
149
150
|
);
|
|
150
151
|
case "image": {
|
|
151
152
|
const n = e, c = n.value !== void 0 ? n.value : t.value;
|
|
152
|
-
return /* @__PURE__ */
|
|
153
|
-
|
|
153
|
+
return /* @__PURE__ */ a(
|
|
154
|
+
W,
|
|
154
155
|
{
|
|
155
156
|
value: c ?? "",
|
|
156
157
|
onChange: (l) => {
|
|
157
158
|
if (n.onChange && n.onChange(l), t.onChange(l), l) {
|
|
158
159
|
const p = new FileReader();
|
|
159
160
|
p.onloadend = () => {
|
|
160
|
-
|
|
161
|
+
R(e.key, p.result);
|
|
161
162
|
}, p.readAsDataURL(l);
|
|
162
163
|
}
|
|
163
164
|
},
|
|
@@ -165,36 +166,36 @@ const ze = ({
|
|
|
165
166
|
maxSizeMB: n.maxSizeMB,
|
|
166
167
|
hint: n.hint,
|
|
167
168
|
disabled: s,
|
|
168
|
-
className: i(
|
|
169
|
+
className: i(r && "border-destructive")
|
|
169
170
|
}
|
|
170
171
|
);
|
|
171
172
|
}
|
|
172
173
|
case "date":
|
|
173
|
-
return /* @__PURE__ */
|
|
174
|
-
|
|
174
|
+
return /* @__PURE__ */ a(
|
|
175
|
+
C,
|
|
175
176
|
{
|
|
176
177
|
type: "date",
|
|
177
178
|
...t,
|
|
178
|
-
className: i(
|
|
179
|
+
className: i(r && "border-destructive"),
|
|
179
180
|
disabled: s,
|
|
180
181
|
value: t.value ?? ""
|
|
181
182
|
}
|
|
182
183
|
);
|
|
183
184
|
case "time":
|
|
184
|
-
return /* @__PURE__ */
|
|
185
|
-
|
|
185
|
+
return /* @__PURE__ */ a(
|
|
186
|
+
C,
|
|
186
187
|
{
|
|
187
188
|
type: "time",
|
|
188
189
|
...t,
|
|
189
|
-
className: i(
|
|
190
|
+
className: i(r && "border-destructive"),
|
|
190
191
|
disabled: s,
|
|
191
192
|
value: t.value ?? ""
|
|
192
193
|
}
|
|
193
194
|
);
|
|
194
195
|
case "checkbox":
|
|
195
196
|
return /* @__PURE__ */ o("div", { className: "flex items-center space-x-2", children: [
|
|
196
|
-
/* @__PURE__ */
|
|
197
|
-
|
|
197
|
+
/* @__PURE__ */ a(
|
|
198
|
+
$,
|
|
198
199
|
{
|
|
199
200
|
id: e.key,
|
|
200
201
|
checked: t.value === !0,
|
|
@@ -202,33 +203,33 @@ const ze = ({
|
|
|
202
203
|
t.onChange(n);
|
|
203
204
|
},
|
|
204
205
|
disabled: s,
|
|
205
|
-
className: i(
|
|
206
|
+
className: i(r && "border-destructive")
|
|
206
207
|
}
|
|
207
208
|
),
|
|
208
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ a("label", { htmlFor: e.key, className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: u(e.labelKey) })
|
|
209
210
|
] }, e.key);
|
|
210
211
|
case "textarea":
|
|
211
|
-
return /* @__PURE__ */
|
|
212
|
-
|
|
212
|
+
return /* @__PURE__ */ a(
|
|
213
|
+
Y,
|
|
213
214
|
{
|
|
214
215
|
...t,
|
|
215
216
|
placeholder: e.placeholderKey ? u(e.placeholderKey) : "",
|
|
216
|
-
className: i(
|
|
217
|
+
className: i(r && "border-destructive", "min-h-[100px]"),
|
|
217
218
|
disabled: s,
|
|
218
219
|
value: t.value ?? ""
|
|
219
220
|
}
|
|
220
221
|
);
|
|
221
222
|
case "number": {
|
|
222
223
|
const n = e;
|
|
223
|
-
return /* @__PURE__ */
|
|
224
|
-
|
|
224
|
+
return /* @__PURE__ */ a(
|
|
225
|
+
C,
|
|
225
226
|
{
|
|
226
227
|
type: "number",
|
|
227
228
|
...t,
|
|
228
229
|
step: n.step,
|
|
229
230
|
min: n.min,
|
|
230
231
|
placeholder: e.placeholderKey ? u(e.placeholderKey) : "",
|
|
231
|
-
className: i(
|
|
232
|
+
className: i(r && "border-destructive"),
|
|
232
233
|
disabled: s,
|
|
233
234
|
value: t.value ?? "",
|
|
234
235
|
onChange: (c) => {
|
|
@@ -239,31 +240,31 @@ const ze = ({
|
|
|
239
240
|
);
|
|
240
241
|
}
|
|
241
242
|
case "select": {
|
|
242
|
-
const n = e, c =
|
|
243
|
-
return /* @__PURE__ */ o(
|
|
244
|
-
/* @__PURE__ */
|
|
245
|
-
|
|
243
|
+
const n = e, c = G(e.rules), l = t.value === null || t.value === void 0 ? "" : t.value, p = n.options, v = p.find((d) => d.value === l);
|
|
244
|
+
return /* @__PURE__ */ o(re, { value: l, onValueChange: t.onChange, disabled: s, children: [
|
|
245
|
+
/* @__PURE__ */ a(A, { children: /* @__PURE__ */ a(
|
|
246
|
+
ae,
|
|
246
247
|
{
|
|
247
|
-
className: i(
|
|
248
|
+
className: i(r && "border-destructive"),
|
|
248
249
|
onClear: c && l ? (d) => {
|
|
249
250
|
d.preventDefault(), d.stopPropagation(), t.onChange(null);
|
|
250
251
|
} : void 0,
|
|
251
|
-
children: /* @__PURE__ */
|
|
252
|
-
v.color && /* @__PURE__ */
|
|
252
|
+
children: /* @__PURE__ */ a(se, { placeholder: e.placeholderKey ? u(e.placeholderKey) : "", children: v ? /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
|
|
253
|
+
v.color && /* @__PURE__ */ a("div", { className: "w-4 h-4 rounded-full", style: { backgroundColor: v.color } }),
|
|
253
254
|
v.label
|
|
254
255
|
] }) : void 0 })
|
|
255
256
|
}
|
|
256
257
|
) }),
|
|
257
|
-
/* @__PURE__ */
|
|
258
|
-
d.color && /* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ a(ne, { children: p.map((d, U) => /* @__PURE__ */ a(le, { value: d.value, children: /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
|
|
259
|
+
d.color && /* @__PURE__ */ a("div", { className: "w-4 h-4 rounded-full", style: { backgroundColor: d.color } }),
|
|
259
260
|
d.label
|
|
260
|
-
] }) },
|
|
261
|
+
] }) }, U)) })
|
|
261
262
|
] });
|
|
262
263
|
}
|
|
263
264
|
case "multiSelect": {
|
|
264
265
|
const n = e, c = t.value ?? [];
|
|
265
|
-
return /* @__PURE__ */
|
|
266
|
-
|
|
266
|
+
return /* @__PURE__ */ a(
|
|
267
|
+
q,
|
|
267
268
|
{
|
|
268
269
|
options: n.options,
|
|
269
270
|
selected: c,
|
|
@@ -287,54 +288,54 @@ const ze = ({
|
|
|
287
288
|
default:
|
|
288
289
|
return null;
|
|
289
290
|
}
|
|
290
|
-
},
|
|
291
|
-
const
|
|
292
|
-
|
|
291
|
+
}, H = (e, t) => {
|
|
292
|
+
const r = /* @__PURE__ */ a("div", { className: i("grid grid-cols-4 gap-4"), children: e.fields.map((s) => /* @__PURE__ */ a(
|
|
293
|
+
J,
|
|
293
294
|
{
|
|
294
295
|
control: m.control,
|
|
295
296
|
name: s.key,
|
|
296
297
|
render: ({ field: n }) => {
|
|
297
298
|
var c;
|
|
298
|
-
return /* @__PURE__ */ o(
|
|
299
|
-
s.type !== "checkbox" && s.type !== "html" && /* @__PURE__ */ o(
|
|
299
|
+
return /* @__PURE__ */ o(L, { className: i(B(((c = s.layout) == null ? void 0 : c.cols) ?? z)), children: [
|
|
300
|
+
s.type !== "checkbox" && s.type !== "html" && /* @__PURE__ */ o(Q, { children: [
|
|
300
301
|
u(s.labelKey),
|
|
301
|
-
|
|
302
|
+
Z(s.rules) && /* @__PURE__ */ a("span", { className: "text-destructive ml-1", children: "*" })
|
|
302
303
|
] }),
|
|
303
|
-
/* @__PURE__ */
|
|
304
|
-
/* @__PURE__ */
|
|
304
|
+
/* @__PURE__ */ a(A, { children: _(s, n) }),
|
|
305
|
+
/* @__PURE__ */ a(X, {})
|
|
305
306
|
] });
|
|
306
307
|
}
|
|
307
308
|
},
|
|
308
309
|
s.key
|
|
309
310
|
)) });
|
|
310
311
|
return h.useCards === !1 ? /* @__PURE__ */ o("div", { className: "space-y-4 mb-6", children: [
|
|
311
|
-
e.titleKey && /* @__PURE__ */
|
|
312
|
-
|
|
313
|
-
] }, t) : /* @__PURE__ */ o(
|
|
314
|
-
e.titleKey && /* @__PURE__ */
|
|
315
|
-
/* @__PURE__ */
|
|
312
|
+
e.titleKey && /* @__PURE__ */ a(T, { titleKey: e.titleKey }),
|
|
313
|
+
r
|
|
314
|
+
] }, t) : /* @__PURE__ */ o(F, { className: "mb-6", children: [
|
|
315
|
+
e.titleKey && /* @__PURE__ */ a(ee, { children: /* @__PURE__ */ a(T, { titleKey: e.titleKey }) }),
|
|
316
|
+
/* @__PURE__ */ a(te, { children: r })
|
|
316
317
|
] }, t);
|
|
317
318
|
};
|
|
318
|
-
return /* @__PURE__ */
|
|
319
|
+
return /* @__PURE__ */ a(D, { ...m, children: /* @__PURE__ */ o(
|
|
319
320
|
"form",
|
|
320
321
|
{
|
|
321
322
|
onSubmit: (e) => {
|
|
322
|
-
m.handleSubmit(
|
|
323
|
+
m.handleSubmit(V)(e);
|
|
323
324
|
},
|
|
324
325
|
className: "space-y-4 px-0 w-full",
|
|
325
326
|
children: [
|
|
326
327
|
/* @__PURE__ */ o("div", { className: "space-y-4", children: [
|
|
327
|
-
h.sections.map((e, t) =>
|
|
328
|
-
|
|
328
|
+
h.sections.map((e, t) => H(e, t)),
|
|
329
|
+
N && /* @__PURE__ */ a("div", { className: "text-sm font-medium text-destructive", children: N.message })
|
|
329
330
|
] }),
|
|
330
331
|
!x && j && /* @__PURE__ */ o("div", { className: "flex justify-end gap-3 mt-6 border-t pt-4", children: [
|
|
331
|
-
f && /* @__PURE__ */
|
|
332
|
-
/* @__PURE__ */
|
|
332
|
+
f && /* @__PURE__ */ a(M, { type: "button", variant: "outline", onClick: f, disabled: g || S, children: u("Annuler", "Annuler") }),
|
|
333
|
+
/* @__PURE__ */ a(M, { variant: "default", type: "submit", disabled: g || (S ?? !1) || m.formState.isSubmitting, children: g || S ? u("Enregistrement...", "Enregistrement...") : u("Enregistrer", "Enregistrer") })
|
|
333
334
|
] })
|
|
334
335
|
]
|
|
335
336
|
}
|
|
336
337
|
) });
|
|
337
338
|
};
|
|
338
339
|
export {
|
|
339
|
-
|
|
340
|
+
Be as G
|
|
340
341
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
2
|
-
import "./toggle-group-
|
|
2
|
+
import "./toggle-group-D6aFQQcf.js";
|
|
3
3
|
import "./alert-B9F1N9Qk.js";
|
|
4
4
|
import "@radix-ui/react-aspect-ratio";
|
|
5
5
|
import { B as x } from "./tooltip-DVeqVwqV.js";
|
|
6
|
+
import "./chart-DntJZGxB.js";
|
|
6
7
|
import "@radix-ui/react-collapsible";
|
|
7
8
|
import "./sheet-B_uq6-K_.js";
|
|
8
9
|
import { XIcon as N, ImageIcon as v, UploadIcon as w } from "lucide-react";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import "./toggle-group-
|
|
1
|
+
import { jsxs as m, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import "./toggle-group-D6aFQQcf.js";
|
|
3
3
|
import "./alert-B9F1N9Qk.js";
|
|
4
4
|
import "@radix-ui/react-aspect-ratio";
|
|
5
5
|
import { B as c } from "./tooltip-DVeqVwqV.js";
|
|
6
|
+
import "./chart-DntJZGxB.js";
|
|
6
7
|
import "@radix-ui/react-collapsible";
|
|
7
8
|
import "./sheet-B_uq6-K_.js";
|
|
8
9
|
import { ArrowLeftIcon as l } from "lucide-react";
|
|
@@ -13,37 +14,37 @@ import "./select-BpjFWqAY.js";
|
|
|
13
14
|
import "next-themes";
|
|
14
15
|
import "sonner";
|
|
15
16
|
import "react";
|
|
16
|
-
import { A as f } from "./AppActions-
|
|
17
|
+
import { A as f } from "./AppActions-DZ7wVdmt.js";
|
|
17
18
|
import { A as d } from "./AppTitle-D15YXeMx.js";
|
|
18
19
|
import { u } from "./useDocumentTitle-WNwdPz-I.js";
|
|
19
20
|
import { useTranslation as g } from "react-i18next";
|
|
20
21
|
import "@krosoft/core/helpers";
|
|
21
|
-
import { b as h, a as x } from "./SkeletonCards-
|
|
22
|
+
import { b as h, a as x } from "./SkeletonCards-av7XHlof.js";
|
|
22
23
|
import { E as A } from "./ErrorState-CmaxuJyW.js";
|
|
23
|
-
function
|
|
24
|
+
function O({
|
|
24
25
|
icon: t,
|
|
25
26
|
titleKey: e,
|
|
26
27
|
descriptionKey: i,
|
|
27
28
|
actions: a,
|
|
28
|
-
onBack:
|
|
29
|
-
renderPreActions:
|
|
29
|
+
onBack: o,
|
|
30
|
+
renderPreActions: s,
|
|
30
31
|
className: p
|
|
31
32
|
}) {
|
|
32
33
|
const { t: n } = g();
|
|
33
|
-
return u(n(e)), /* @__PURE__ */
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
|
|
34
|
+
return u(n(e)), /* @__PURE__ */ m("div", { className: "flex flex-row items-center justify-between gap-3 md:gap-4", children: [
|
|
35
|
+
/* @__PURE__ */ m("div", { className: "flex min-w-0 items-center gap-3 md:gap-4", children: [
|
|
36
|
+
o && /* @__PURE__ */ r(c, { variant: "ghost", size: "icon", className: "shrink-0", onClick: o, children: /* @__PURE__ */ r(l, { className: "h-4 w-4" }) }),
|
|
36
37
|
t && /* @__PURE__ */ r("div", { className: "size-12 shrink-0 bg-blue-100 rounded-control flex items-center justify-center", children: /* @__PURE__ */ r(t, { className: "h-6 w-6 text-blue-600" }) }),
|
|
37
38
|
/* @__PURE__ */ r(d, { titleKey: e, descriptionKey: i })
|
|
38
39
|
] }),
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
|
|
40
|
+
/* @__PURE__ */ m("div", { className: "flex shrink-0 items-center gap-2 md:gap-4", children: [
|
|
41
|
+
s && s(),
|
|
41
42
|
/* @__PURE__ */ r(f, { actions: a, className: p })
|
|
42
43
|
] })
|
|
43
44
|
] });
|
|
44
45
|
}
|
|
45
|
-
const
|
|
46
|
+
const P = ({ stats: t, isLoading: e, error: i }) => e ? /* @__PURE__ */ r(h, { count: 4 }) : i ? /* @__PURE__ */ r(A, { message: i.message }) : /* @__PURE__ */ r(x, { stats: t });
|
|
46
47
|
export {
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
O as A,
|
|
49
|
+
P as K
|
|
49
50
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { C as l, d as h, e as m, a as g } from "./chart-DntJZGxB.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,26 +1,27 @@
|
|
|
1
1
|
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useState as L, useRef as z, useMemo as v, useEffect as E } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { O as T } from "./toggle-group-D6aFQQcf.js";
|
|
4
4
|
import "./alert-B9F1N9Qk.js";
|
|
5
5
|
import "@radix-ui/react-aspect-ratio";
|
|
6
|
-
import { f as
|
|
6
|
+
import { f as D } from "./tooltip-DVeqVwqV.js";
|
|
7
|
+
import "./chart-DntJZGxB.js";
|
|
7
8
|
import "@radix-ui/react-collapsible";
|
|
8
9
|
import "./sheet-B_uq6-K_.js";
|
|
9
|
-
import { XIcon as
|
|
10
|
+
import { XIcon as M, ChevronDownIcon as P, SearchIcon as S } from "lucide-react";
|
|
10
11
|
import "react-resizable-panels";
|
|
11
12
|
import { c as I } from "./tailwind.helper-B6yFEsav.js";
|
|
12
13
|
import "./select-BpjFWqAY.js";
|
|
13
14
|
import "next-themes";
|
|
14
15
|
import "sonner";
|
|
15
|
-
const
|
|
16
|
+
const $ = ({
|
|
16
17
|
options: s,
|
|
17
18
|
selected: t,
|
|
18
19
|
onToggle: x,
|
|
19
20
|
onClear: d,
|
|
20
21
|
onSelectAll: u,
|
|
21
|
-
placeholder:
|
|
22
|
+
placeholder: O = "Sélectionner...",
|
|
22
23
|
searchable: m = !1,
|
|
23
|
-
searchPlaceholder:
|
|
24
|
+
searchPlaceholder: R = "Rechercher...",
|
|
24
25
|
disabled: f = !1,
|
|
25
26
|
maxCount: h
|
|
26
27
|
}) => {
|
|
@@ -42,7 +43,7 @@ const Z = ({
|
|
|
42
43
|
document.removeEventListener("mousedown", e);
|
|
43
44
|
};
|
|
44
45
|
}, [a]);
|
|
45
|
-
const
|
|
46
|
+
const j = () => {
|
|
46
47
|
if (w) {
|
|
47
48
|
const e = o.map((i) => i.value), n = t.filter((i) => !e.includes(i));
|
|
48
49
|
u !== void 0 ? u(n) : d();
|
|
@@ -64,9 +65,9 @@ const Z = ({
|
|
|
64
65
|
onClick: () => {
|
|
65
66
|
f || N((e) => (e && p(""), !e));
|
|
66
67
|
},
|
|
67
|
-
className: I(
|
|
68
|
+
className: I(D, "w-full", a && "ring-2 ring-ring ring-offset-2", t.length === 0 && "text-muted-foreground"),
|
|
68
69
|
children: [
|
|
69
|
-
/* @__PURE__ */ r("span", { className: "truncate", children: t.length === 0 ?
|
|
70
|
+
/* @__PURE__ */ r("span", { className: "truncate", children: t.length === 0 ? O : y.join(", ") }),
|
|
70
71
|
/* @__PURE__ */ l("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
71
72
|
C > 0 && /* @__PURE__ */ l("span", { className: "rounded-control bg-muted px-1.5 py-0.5 text-xs font-medium text-foreground", children: [
|
|
72
73
|
"+",
|
|
@@ -84,7 +85,7 @@ const Z = ({
|
|
|
84
85
|
e.preventDefault(), e.stopPropagation(), d();
|
|
85
86
|
},
|
|
86
87
|
className: "text-muted-foreground hover:text-foreground",
|
|
87
|
-
children: /* @__PURE__ */ r(
|
|
88
|
+
children: /* @__PURE__ */ r(M, { className: "size-4" })
|
|
88
89
|
}
|
|
89
90
|
),
|
|
90
91
|
/* @__PURE__ */ r(P, { className: I("size-4 opacity-50 shrink-0 transition-transform", a && "rotate-180") })
|
|
@@ -100,7 +101,7 @@ const Z = ({
|
|
|
100
101
|
{
|
|
101
102
|
ref: k,
|
|
102
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",
|
|
103
|
-
placeholder:
|
|
104
|
+
placeholder: R,
|
|
104
105
|
value: c,
|
|
105
106
|
onChange: (e) => {
|
|
106
107
|
p(e.target.value);
|
|
@@ -110,7 +111,7 @@ const Z = ({
|
|
|
110
111
|
] }) }) : null,
|
|
111
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: [
|
|
112
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: [
|
|
113
|
-
/* @__PURE__ */ r(T, { checked: w, onCheckedChange:
|
|
114
|
+
/* @__PURE__ */ r(T, { checked: w, onCheckedChange: j }),
|
|
114
115
|
"Tout sélectionner"
|
|
115
116
|
] }),
|
|
116
117
|
o.length === 0 && /* @__PURE__ */ r("p", { className: "px-2 py-3 text-center text-xs text-muted-foreground", children: "Aucun résultat" }),
|
|
@@ -141,5 +142,5 @@ const Z = ({
|
|
|
141
142
|
] });
|
|
142
143
|
};
|
|
143
144
|
export {
|
|
144
|
-
|
|
145
|
+
$ as M
|
|
145
146
|
};
|