@krosoft/react 0.0.102 → 0.0.104
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-DBxJVB46.js → AppSubTitle-Cr3zbmee.js} +1 -1
- package/dist/{AppTitle-DDQoaHBb.js → AppTitle-eazxzYGa.js} +1 -1
- package/dist/{AppVerticalTabs-CYx0jMXp.js → AppVerticalTabs-ujb4jtNi.js} +2 -2
- package/dist/ConfirmationDialog-B41OAAmc.js +257 -0
- package/dist/{DataTable-CtzBzpP-.js → DataTable-jrFyuw67.js} +1 -1
- package/dist/GenericForm-D3Gxh9kf.js +11365 -0
- package/dist/{ImageInput-DVMsk_kn.js → ImageInput-BcGHoduc.js} +1 -1
- package/dist/{MetricCard-CFwSSiQY.js → MetricCard-CXDB0msa.js} +1 -1
- package/dist/MultiSelect-Bc0Re1XN.js +137 -0
- package/dist/SearchInput-DFrIqONH.js +586 -0
- package/dist/{TableFilter-DGFQNbZ_.js → TableFilter-CK8NyawM.js} +27 -26
- package/dist/components/core/cards/index.js +1 -1
- package/dist/components/core/dialogs/FormDialog.d.ts +6 -18
- package/dist/components/core/dialogs/FormDialog.d.ts.map +1 -1
- package/dist/components/core/dialogs/index.d.ts +1 -1
- package/dist/components/core/dialogs/index.d.ts.map +1 -1
- package/dist/components/core/dialogs/index.js +2 -2
- package/dist/components/core/filters/index.js +1 -1
- package/dist/components/core/forms/GenericForm.d.ts +57 -0
- package/dist/components/core/forms/GenericForm.d.ts.map +1 -0
- package/dist/components/core/forms/index.d.ts +2 -0
- package/dist/components/core/forms/index.d.ts.map +1 -0
- package/dist/components/core/forms/index.js +4 -0
- 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 +48 -45
- package/dist/components/core/inputs/MultiSelect.d.ts +2 -1
- package/dist/components/core/inputs/MultiSelect.d.ts.map +1 -1
- package/dist/components/core/inputs/index.js +8 -7
- package/dist/components/core/layouts/index.js +2 -2
- package/dist/components/core/table/index.js +1 -1
- package/dist/components/core/tabs/index.js +1 -1
- package/dist/components/index.js +100 -97
- package/dist/components/ui/index.js +2 -2
- package/dist/{toaster-BTQcWjuV.js → toaster-CtADevTu.js} +1 -1
- package/dist/{toggle-group-6CH5BRLO.js → toggle-group-Cnfwf4uy.js} +8376 -7317
- package/dist/types/forms/FieldType.d.ts +2 -0
- package/dist/types/forms/FieldType.d.ts.map +1 -0
- package/dist/types/forms/FormField.d.ts +40 -0
- package/dist/types/forms/FormField.d.ts.map +1 -0
- package/dist/types/forms/FormSchema.d.ts +6 -0
- package/dist/types/forms/FormSchema.d.ts.map +1 -0
- package/dist/types/forms/FormSection.d.ts +12 -0
- package/dist/types/forms/FormSection.d.ts.map +1 -0
- package/dist/types/forms/index.d.ts +5 -0
- package/dist/types/forms/index.d.ts.map +1 -0
- package/dist/types/forms/index.js +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +8 -6
- package/dist/ConfirmationDialog-bBFPpP2z.js +0 -322
- package/dist/SearchInput-CsZcpaxL.js +0 -710
|
@@ -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-eazxzYGa.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,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as n, jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import { ax as c, aL as b, az as f, aG as h, aB as u } from "./toggle-group-
|
|
2
|
+
import { ax as c, aL as b, az as f, aG as h, aB as u } from "./toggle-group-Cnfwf4uy.js";
|
|
3
3
|
import "./alert-srKINZRG.js";
|
|
4
4
|
import { c as m } from "./tailwind.helper-gWiv5-6R.js";
|
|
5
5
|
import { B as p } from "./tooltip-mWS3Mix6.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as n, jsx as a } from "react/jsx-runtime";
|
|
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-
|
|
3
|
-
import { a as C, A as k } from "./AppTitle-
|
|
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-Cnfwf4uy.js";
|
|
3
|
+
import { a as C, A as k } from "./AppTitle-eazxzYGa.js";
|
|
4
4
|
import { useTranslation as x } from "react-i18next";
|
|
5
5
|
import { useSearchParams as f } from "react-router-dom";
|
|
6
6
|
import { c as A } from "./tailwind.helper-gWiv5-6R.js";
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { jsx as e, jsxs as l, Fragment as W } from "react/jsx-runtime";
|
|
2
|
+
import { D as X, b as J, P as K, e as Q, h as U, c as Y, m as H, p as V, s as z, t as $, q as M, r as I, o as O, u as Z, n as L } from "./toggle-group-Cnfwf4uy.js";
|
|
3
|
+
import { A as ee, a as le } from "./alert-srKINZRG.js";
|
|
4
|
+
import { B as g } from "./tooltip-mWS3Mix6.js";
|
|
5
|
+
import { X as j } from "./select-CDIMkakd.js";
|
|
6
|
+
import "next-themes";
|
|
7
|
+
import { useState as w, useEffect as ie } from "react";
|
|
8
|
+
import { useTranslation as P } from "react-i18next";
|
|
9
|
+
import { c as C } from "./index-BSI9LuBZ.js";
|
|
10
|
+
import { G as re } from "./GenericForm-D3Gxh9kf.js";
|
|
11
|
+
import { E as ae } from "./ErrorAlert-B2LV1J2R.js";
|
|
12
|
+
/**
|
|
13
|
+
* @license lucide-react v1.16.0 - ISC
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the ISC license.
|
|
16
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/
|
|
18
|
+
const te = [
|
|
19
|
+
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
20
|
+
["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
|
|
21
|
+
["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
|
|
22
|
+
], se = C("circle-alert", te);
|
|
23
|
+
/**
|
|
24
|
+
* @license lucide-react v1.16.0 - ISC
|
|
25
|
+
*
|
|
26
|
+
* This source code is licensed under the ISC license.
|
|
27
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
28
|
+
*/
|
|
29
|
+
const ne = [
|
|
30
|
+
[
|
|
31
|
+
"path",
|
|
32
|
+
{
|
|
33
|
+
d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",
|
|
34
|
+
key: "1a8usu"
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
], S = C("pen", ne);
|
|
38
|
+
/**
|
|
39
|
+
* @license lucide-react v1.16.0 - ISC
|
|
40
|
+
*
|
|
41
|
+
* This source code is licensed under the ISC license.
|
|
42
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
43
|
+
*/
|
|
44
|
+
const oe = [
|
|
45
|
+
[
|
|
46
|
+
"path",
|
|
47
|
+
{
|
|
48
|
+
d: "M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",
|
|
49
|
+
key: "1c8476"
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
["path", { d: "M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7", key: "1ydtos" }],
|
|
53
|
+
["path", { d: "M7 3v4a1 1 0 0 0 1 1h7", key: "t51u73" }]
|
|
54
|
+
], T = C("save", oe);
|
|
55
|
+
/**
|
|
56
|
+
* @license lucide-react v1.16.0 - ISC
|
|
57
|
+
*
|
|
58
|
+
* This source code is licensed under the ISC license.
|
|
59
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
60
|
+
*/
|
|
61
|
+
const ce = [
|
|
62
|
+
["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
|
|
63
|
+
["path", { d: "M3 6h18", key: "d0wm0j" }],
|
|
64
|
+
["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
|
|
65
|
+
], de = C("trash", ce);
|
|
66
|
+
function me({ open: r, onOpenChange: c, config: i, isLoading: t, error: s, children: n }) {
|
|
67
|
+
const { t: a } = P(), { title: v, description: u, icon: p, maxWidth: b = "sm:max-w-xl", actions: d } = i;
|
|
68
|
+
return /* @__PURE__ */ e(X, { open: r, onOpenChange: c, children: /* @__PURE__ */ l(J, { className: `${b} max-h-[90vh] border-0 shadow-2xl p-0 flex flex-col overflow-hidden`, children: [
|
|
69
|
+
t === !0 ? /* @__PURE__ */ e("div", { className: "absolute top-0 left-0 right-0 z-10", children: /* @__PURE__ */ e(K, { indeterminate: !0, className: "h-1 rounded-none" }) }) : null,
|
|
70
|
+
/* @__PURE__ */ l(Q, { className: "bg-gradient-to-r from-slate-900 to-purple-700 p-6 rounded-t-lg shrink-0", children: [
|
|
71
|
+
/* @__PURE__ */ l(U, { className: "text-2xl font-bold flex items-center gap-2 text-white", children: [
|
|
72
|
+
p !== void 0 ? /* @__PURE__ */ e("div", { className: "p-2 bg-white/20 rounded-lg", children: /* @__PURE__ */ e(p, { className: "size-4 text-white" }) }) : null,
|
|
73
|
+
a(v)
|
|
74
|
+
] }),
|
|
75
|
+
u !== void 0 && u !== "" ? /* @__PURE__ */ e(Y, { className: "text-indigo-100 text-base", children: a(u) }) : null
|
|
76
|
+
] }),
|
|
77
|
+
s != null ? /* @__PURE__ */ e("div", { className: "px-6 ", children: /* @__PURE__ */ l(ee, { variant: "destructive", className: "max-w-full", children: [
|
|
78
|
+
/* @__PURE__ */ e(se, { className: "size-4" }),
|
|
79
|
+
/* @__PURE__ */ e(le, { className: "break-words overflow-wrap-anywhere max-w-full", children: s.message })
|
|
80
|
+
] }) }) : null,
|
|
81
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto px-6 ", children: n }),
|
|
82
|
+
d !== void 0 && d.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: d.map((o, D) => /* @__PURE__ */ l(g, { variant: o.variant ?? "default", onClick: o.onClick, disabled: o.disabled === !0 || t === !0, children: [
|
|
83
|
+
o.icon !== void 0 ? /* @__PURE__ */ e(o.icon, { className: "size-4" }) : null,
|
|
84
|
+
a(o.label)
|
|
85
|
+
] }, D)) }) }) : null
|
|
86
|
+
] }) });
|
|
87
|
+
}
|
|
88
|
+
function Ce({
|
|
89
|
+
open: r,
|
|
90
|
+
onOpenChange: c,
|
|
91
|
+
data: i,
|
|
92
|
+
title: t,
|
|
93
|
+
headerBadge: s,
|
|
94
|
+
schema: n,
|
|
95
|
+
onSave: a,
|
|
96
|
+
customFooter: v,
|
|
97
|
+
defaultEditing: u = !1,
|
|
98
|
+
footerActions: p = !0,
|
|
99
|
+
saveLabel: b = "Sauvegarder",
|
|
100
|
+
cancelLabel: d = "Annuler",
|
|
101
|
+
hideSaveIcon: o = !1,
|
|
102
|
+
maxWidth: D = "sm:max-w-4xl",
|
|
103
|
+
isLoading: f = !1
|
|
104
|
+
}) {
|
|
105
|
+
const [x, N] = w(u), [m, _] = w(!1), [y, q] = w(null);
|
|
106
|
+
if (ie(() => {
|
|
107
|
+
r && N(u);
|
|
108
|
+
}, [r, u]), i == null) return null;
|
|
109
|
+
const E = () => {
|
|
110
|
+
x ? a !== void 0 && y && y() : N(!0);
|
|
111
|
+
}, A = () => {
|
|
112
|
+
N(!1);
|
|
113
|
+
}, F = () => {
|
|
114
|
+
a !== void 0 && y && y();
|
|
115
|
+
}, G = async (h) => {
|
|
116
|
+
if (a) {
|
|
117
|
+
_(!0);
|
|
118
|
+
try {
|
|
119
|
+
await a(h), N(!1);
|
|
120
|
+
} catch (R) {
|
|
121
|
+
console.error(R);
|
|
122
|
+
} finally {
|
|
123
|
+
_(!1);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}, k = [];
|
|
127
|
+
a !== void 0 && (x ? (d !== "" && k.push({
|
|
128
|
+
label: d,
|
|
129
|
+
onClick: A,
|
|
130
|
+
variant: "outline",
|
|
131
|
+
disabled: m || f,
|
|
132
|
+
icon: j
|
|
133
|
+
}), k.push({
|
|
134
|
+
label: m ? "Enregistrement..." : b,
|
|
135
|
+
onClick: F,
|
|
136
|
+
variant: "default",
|
|
137
|
+
disabled: m || f,
|
|
138
|
+
icon: o ? void 0 : T
|
|
139
|
+
})) : k.push({
|
|
140
|
+
label: "Modifier",
|
|
141
|
+
onClick: E,
|
|
142
|
+
variant: "outline",
|
|
143
|
+
icon: S
|
|
144
|
+
}));
|
|
145
|
+
const B = {
|
|
146
|
+
title: t(i),
|
|
147
|
+
maxWidth: D,
|
|
148
|
+
actions: p ? k : []
|
|
149
|
+
};
|
|
150
|
+
return /* @__PURE__ */ e(
|
|
151
|
+
me,
|
|
152
|
+
{
|
|
153
|
+
open: r,
|
|
154
|
+
onOpenChange: (h) => {
|
|
155
|
+
c(h), h || A();
|
|
156
|
+
},
|
|
157
|
+
config: B,
|
|
158
|
+
isLoading: m || f,
|
|
159
|
+
children: /* @__PURE__ */ l("div", { className: "py-4", children: [
|
|
160
|
+
s !== void 0 ? /* @__PURE__ */ e("div", { className: "mb-4", children: s(i) }) : null,
|
|
161
|
+
/* @__PURE__ */ e(
|
|
162
|
+
re,
|
|
163
|
+
{
|
|
164
|
+
schema: n,
|
|
165
|
+
initialData: i,
|
|
166
|
+
disabled: !x,
|
|
167
|
+
onSubmit: (h) => {
|
|
168
|
+
G(h);
|
|
169
|
+
},
|
|
170
|
+
renderActions: !1,
|
|
171
|
+
onRegisterSubmit: (h) => {
|
|
172
|
+
q(() => h);
|
|
173
|
+
},
|
|
174
|
+
isLoading: m || f
|
|
175
|
+
}
|
|
176
|
+
),
|
|
177
|
+
v !== void 0 ? v(i) : null,
|
|
178
|
+
a !== void 0 && !p ? /* @__PURE__ */ e("div", { className: "flex justify-end gap-2 border-t pt-4 mt-6", children: x ? /* @__PURE__ */ l(W, { children: [
|
|
179
|
+
d !== "" ? /* @__PURE__ */ l(g, { onClick: A, variant: "outline", size: "sm", disabled: m || f, children: [
|
|
180
|
+
/* @__PURE__ */ e(j, { className: "size-4 mr-2" }),
|
|
181
|
+
d
|
|
182
|
+
] }) : null,
|
|
183
|
+
/* @__PURE__ */ l(g, { onClick: F, size: "sm", disabled: m || f, className: "text-white", children: [
|
|
184
|
+
o ? null : /* @__PURE__ */ e(T, { className: "size-4 mr-2" }),
|
|
185
|
+
m ? "Enregistrement..." : b
|
|
186
|
+
] })
|
|
187
|
+
] }) : /* @__PURE__ */ l(g, { onClick: E, variant: "outline", size: "sm", children: [
|
|
188
|
+
/* @__PURE__ */ e(S, { className: "size-4 mr-2" }),
|
|
189
|
+
"Modifier"
|
|
190
|
+
] }) }) : null
|
|
191
|
+
] })
|
|
192
|
+
}
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
const De = ({ isLoading: r, error: c, config: i }) => {
|
|
196
|
+
const { t } = P(), s = (n) => {
|
|
197
|
+
!n && !r && i.onClose();
|
|
198
|
+
};
|
|
199
|
+
return /* @__PURE__ */ e(H, { open: i.isOpen, onOpenChange: s, children: /* @__PURE__ */ l(V, { children: [
|
|
200
|
+
/* @__PURE__ */ l(z, { children: [
|
|
201
|
+
/* @__PURE__ */ l($, { className: "flex items-center gap-2 text-destructive", children: [
|
|
202
|
+
/* @__PURE__ */ e(de, { className: "size-4" }),
|
|
203
|
+
t(i.title)
|
|
204
|
+
] }),
|
|
205
|
+
/* @__PURE__ */ e(z, { className: "bg-gradient-to-r from-slate-900 to-purple-700 rounded-t-lg shrink-0" }),
|
|
206
|
+
/* @__PURE__ */ e(M, { children: t(i.description) }),
|
|
207
|
+
/* @__PURE__ */ e(M, { children: i.itemName && /* @__PURE__ */ e("span", { className: "font-semibold block my-2", children: i.itemName }) })
|
|
208
|
+
] }),
|
|
209
|
+
/* @__PURE__ */ e(ae, { error: c instanceof Error ? null : c }),
|
|
210
|
+
/* @__PURE__ */ l(I, { children: [
|
|
211
|
+
/* @__PURE__ */ l(O, { disabled: r, children: [
|
|
212
|
+
" ",
|
|
213
|
+
t("common.buttons.cancel")
|
|
214
|
+
] }),
|
|
215
|
+
/* @__PURE__ */ e(
|
|
216
|
+
g,
|
|
217
|
+
{
|
|
218
|
+
onClick: (n) => {
|
|
219
|
+
n.preventDefault(), i.onConfirm();
|
|
220
|
+
},
|
|
221
|
+
disabled: r,
|
|
222
|
+
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
223
|
+
children: r ? "Suppression..." : "Supprimer"
|
|
224
|
+
}
|
|
225
|
+
)
|
|
226
|
+
] })
|
|
227
|
+
] }) });
|
|
228
|
+
};
|
|
229
|
+
function Ae({
|
|
230
|
+
children: r,
|
|
231
|
+
title: c,
|
|
232
|
+
description: i,
|
|
233
|
+
confirmText: t = "Confirmer",
|
|
234
|
+
cancelText: s = "Annuler",
|
|
235
|
+
onConfirm: n,
|
|
236
|
+
destructive: a = !1
|
|
237
|
+
}) {
|
|
238
|
+
return /* @__PURE__ */ l(H, { children: [
|
|
239
|
+
/* @__PURE__ */ e(Z, { asChild: !0, children: r }),
|
|
240
|
+
/* @__PURE__ */ l(V, { children: [
|
|
241
|
+
/* @__PURE__ */ l(z, { children: [
|
|
242
|
+
/* @__PURE__ */ e($, { children: c }),
|
|
243
|
+
/* @__PURE__ */ e(M, { children: i })
|
|
244
|
+
] }),
|
|
245
|
+
/* @__PURE__ */ l(I, { children: [
|
|
246
|
+
/* @__PURE__ */ e(O, { children: s }),
|
|
247
|
+
/* @__PURE__ */ e(L, { onClick: n, className: a ? "bg-red-600 hover:bg-red-700" : "", children: t })
|
|
248
|
+
] })
|
|
249
|
+
] })
|
|
250
|
+
] });
|
|
251
|
+
}
|
|
252
|
+
export {
|
|
253
|
+
me as A,
|
|
254
|
+
De as C,
|
|
255
|
+
Ce as F,
|
|
256
|
+
Ae as a
|
|
257
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { u as ae } from "./useDataTable-CxcA5S-s.js";
|
|
3
|
-
import { ax as I, aL as $, az as B, aB as se, _ as L, cr as ie, cs as ne, ay as de } from "./toggle-group-
|
|
3
|
+
import { ax as I, aL as $, az as B, aB as se, _ as L, cr as ie, cs as ne, ay as de } from "./toggle-group-Cnfwf4uy.js";
|
|
4
4
|
import "./alert-srKINZRG.js";
|
|
5
5
|
import { B as k } from "./tooltip-mWS3Mix6.js";
|
|
6
6
|
import "./select-CDIMkakd.js";
|