@krosoft/react 0.0.90 → 0.0.92
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-RKbtrPJr.js → AppSubTitle-CvJlatS9.js} +1 -1
- package/dist/{AppTitle-DCQpP2qE.js → AppTitle-LIQCjpo5.js} +26 -25
- package/dist/{AppVerticalTabs-pK3i9ZTD.js → AppVerticalTabs-BHrad7wu.js} +23 -23
- package/dist/ConfirmationDialog-BlRXnFH5.js +321 -0
- package/dist/ErrorAlert-BITMD2I5.js +33 -0
- package/dist/{LoadingState-DQjGcT2l.js → LoadingState-COf3KhOP.js} +6 -6
- package/dist/{MetricCard-DB1ME6tD.js → MetricCard-BGT2QRn0.js} +14 -13
- package/dist/{SearchInput-D_SLIZ2y.js → SearchInput-DpOuKSIf.js} +115 -126
- package/dist/{TableFilter-DXTOY-oa.js → TableFilter-DFtN_-Bg.js} +51 -51
- package/dist/{TableSettings-CBtuAPgM.js → TableSettings-m2q3s0wU.js} +68 -80
- package/dist/{ThemeSelector-CU8JmN2b.js → ThemeSelector-D9KTJAWz.js} +3 -3
- package/dist/{Topbar-BzZxu1Zi.js → Topbar-QKCJiWdO.js} +2 -2
- package/dist/{badge-DyRSpnOb.js → badge-C09fRxvd.js} +1 -1
- package/dist/card-Bn3Y7DHQ.js +48 -0
- package/dist/components/core/cards/index.js +1 -1
- package/dist/components/core/dialogs/ConfirmDeleteDialog.d.ts +10 -0
- package/dist/components/core/dialogs/ConfirmDeleteDialog.d.ts.map +1 -0
- package/dist/components/core/dialogs/ConfirmationDialog.d.ts +13 -0
- package/dist/components/core/dialogs/ConfirmationDialog.d.ts.map +1 -0
- package/dist/components/core/dialogs/index.d.ts +3 -0
- package/dist/components/core/dialogs/index.d.ts.map +1 -1
- package/dist/components/core/dialogs/index.js +15 -13
- package/dist/components/core/filters/index.js +1 -1
- package/dist/components/core/index.js +60 -56
- package/dist/components/core/inputs/index.js +1 -1
- package/dist/components/core/layouts/index.js +2 -2
- package/dist/components/core/navbar/index.js +1 -1
- package/dist/components/core/states/ErrorAlert.d.ts +7 -0
- package/dist/components/core/states/ErrorAlert.d.ts.map +1 -0
- package/dist/components/core/states/index.d.ts +1 -0
- package/dist/components/core/states/index.d.ts.map +1 -1
- package/dist/components/core/states/index.js +6 -4
- 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 +280 -136
- package/dist/components/ui/accordion.d.ts +8 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog.d.ts +21 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/aspect-ratio.d.ts +4 -0
- package/dist/components/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/components/ui/avatar.d.ts +7 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/breadcrumb.d.ts +20 -0
- package/dist/components/ui/breadcrumb.d.ts.map +1 -0
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/carousel.d.ts +19 -0
- package/dist/components/ui/carousel.d.ts.map +1 -0
- package/dist/components/ui/chart.d.ts +50 -0
- package/dist/components/ui/chart.d.ts.map +1 -0
- package/dist/components/ui/collapsible.d.ts +6 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/command.d.ts +83 -0
- package/dist/components/ui/command.d.ts.map +1 -0
- package/dist/components/ui/context-menu.d.ts +28 -0
- package/dist/components/ui/context-menu.d.ts.map +1 -0
- package/dist/components/ui/drawer.d.ts +23 -0
- package/dist/components/ui/drawer.d.ts.map +1 -0
- package/dist/components/ui/form.d.ts +24 -0
- package/dist/components/ui/form.d.ts.map +1 -0
- package/dist/components/ui/hover-card.d.ts +7 -0
- package/dist/components/ui/hover-card.d.ts.map +1 -0
- package/dist/components/ui/index.d.ts +42 -16
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +231 -91
- package/dist/components/ui/input-otp.d.ts +35 -0
- package/dist/components/ui/input-otp.d.ts.map +1 -0
- package/dist/components/ui/menubar.d.ts +34 -0
- package/dist/components/ui/menubar.d.ts.map +1 -0
- package/dist/components/ui/navigation-menu.d.ts +13 -0
- package/dist/components/ui/navigation-menu.d.ts.map +1 -0
- package/dist/components/ui/pagination.d.ts +33 -0
- package/dist/components/ui/pagination.d.ts.map +1 -0
- package/dist/components/ui/radio-group.d.ts +6 -0
- package/dist/components/ui/radio-group.d.ts.map +1 -0
- package/dist/components/ui/resizable.d.ts +8 -0
- package/dist/components/ui/resizable.d.ts.map +1 -0
- package/dist/components/ui/sheet.d.ts +1 -1
- package/dist/components/ui/sidebar.d.ts +67 -0
- package/dist/components/ui/sidebar.d.ts.map +1 -0
- package/dist/components/ui/simple-table.d.ts +11 -0
- package/dist/components/ui/simple-table.d.ts.map +1 -0
- package/dist/components/ui/slider.d.ts +5 -0
- package/dist/components/ui/slider.d.ts.map +1 -0
- package/dist/components/ui/sonner.d.ts +5 -0
- package/dist/components/ui/sonner.d.ts.map +1 -0
- package/dist/components/ui/switch.d.ts +5 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/textarea.d.ts +6 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/toaster.d.ts +2 -0
- package/dist/components/ui/toaster.d.ts.map +1 -0
- package/dist/components/ui/toggle-group.d.ts +13 -0
- package/dist/components/ui/toggle-group.d.ts.map +1 -0
- package/dist/components/ui/toggle.d.ts +13 -0
- package/dist/components/ui/toggle.d.ts.map +1 -0
- package/dist/{ellipsis-vertical-CqrunffH.js → ellipsis-vertical-BVxSFNOa.js} +1 -1
- package/dist/grip-vertical-CJ07_87Y.js +18 -0
- package/dist/hooks/index.js +6 -5
- package/dist/index-DSyPHOLE.js +147 -0
- package/dist/{loader-circle-BhJXKs31.js → loader-circle-GAYBtm3z.js} +1 -1
- package/dist/{select-B5wF6jxC.js → select-D6_XPD6x.js} +309 -308
- package/dist/toaster-D6ND7OTk.js +113 -0
- package/dist/toggle-group-VJoGbVQm.js +19987 -0
- package/dist/{tooltip-BzTGwm2E.js → tooltip-CAu4DEhc.js} +767 -796
- package/dist/types/ConfirmDialogConfig.d.ts +11 -0
- package/dist/types/ConfirmDialogConfig.d.ts.map +1 -0
- package/dist/useTheme-Bn8z_uxy.js +31 -0
- package/dist/useToast-BFTk4lWz.js +100 -0
- package/package.json +26 -4
- package/dist/FormDialog-CXLQG83d.js +0 -250
- package/dist/card-7XPLAra3.js +0 -23
- package/dist/createLucideIcon-CRdjzt2A.js +0 -116
- package/dist/skeleton-CJ1F2tD3.js +0 -8
- package/dist/tabs-BYqvMsA6.js +0 -6628
- package/dist/useTheme-CvNYmhjo.js +0 -128
|
@@ -2,10 +2,11 @@ import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
|
2
2
|
import { formatNumber as h } from "@krosoft/core/helpers";
|
|
3
3
|
import { useTranslation as b } from "react-i18next";
|
|
4
4
|
import { c as d } from "./index-gWiv5-6R.js";
|
|
5
|
-
import "./
|
|
6
|
-
import "./
|
|
7
|
-
import
|
|
8
|
-
import "./select-
|
|
5
|
+
import "./toggle-group-VJoGbVQm.js";
|
|
6
|
+
import { C as u, f as N, g as x, c as f } from "./card-Bn3Y7DHQ.js";
|
|
7
|
+
import "./tooltip-CAu4DEhc.js";
|
|
8
|
+
import "./select-D6_XPD6x.js";
|
|
9
|
+
import "react";
|
|
9
10
|
const v = ({
|
|
10
11
|
titleKey: r,
|
|
11
12
|
value: t,
|
|
@@ -17,9 +18,9 @@ const v = ({
|
|
|
17
18
|
onClick: o
|
|
18
19
|
}) => {
|
|
19
20
|
const { t: m } = b();
|
|
20
|
-
return /* @__PURE__ */ s(
|
|
21
|
+
return /* @__PURE__ */ s(u, { className: d(o !== void 0 ? "hover:border-primary cursor-pointer" : ""), onClick: o, children: [
|
|
21
22
|
/* @__PURE__ */ s(N, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
22
|
-
/* @__PURE__ */ e(
|
|
23
|
+
/* @__PURE__ */ e(x, { className: "text-sm font-medium", children: m(r) }),
|
|
23
24
|
/* @__PURE__ */ e(a, { className: d("size-6 text-muted-foreground", c) })
|
|
24
25
|
] }),
|
|
25
26
|
/* @__PURE__ */ s(f, { children: [
|
|
@@ -27,7 +28,7 @@ const v = ({
|
|
|
27
28
|
/* @__PURE__ */ e("p", { className: d("text-xs text-muted-foreground", i), children: l })
|
|
28
29
|
] })
|
|
29
30
|
] });
|
|
30
|
-
},
|
|
31
|
+
}, S = ({ stats: r }) => /* @__PURE__ */ e("div", { className: "grid gap-6 md:grid-cols-2 lg:grid-cols-4", children: r.map((t) => /* @__PURE__ */ e(
|
|
31
32
|
v,
|
|
32
33
|
{
|
|
33
34
|
titleKey: t.titleKey,
|
|
@@ -55,12 +56,12 @@ const v = ({
|
|
|
55
56
|
sm: "size-4",
|
|
56
57
|
md: "size-5",
|
|
57
58
|
lg: "size-6"
|
|
58
|
-
}, y = (r) => r === "up" ? "↑" : r === "down" ? "↓" : "", K = (r) => r === "up" ? "text-green-600" : r === "down" ? "text-red-600" : "text-muted-foreground",
|
|
59
|
+
}, y = (r) => r === "up" ? "↑" : r === "down" ? "↓" : "", K = (r) => r === "up" ? "text-green-600" : r === "down" ? "text-red-600" : "text-muted-foreground", q = ({ title: r, value: t, unit: n, subtitle: a, icon: c, iconSize: l = "md", trend: i, trendValue: o, color: m = "blue", children: g }) => {
|
|
59
60
|
const p = c;
|
|
60
|
-
return /* @__PURE__ */ e(
|
|
61
|
+
return /* @__PURE__ */ e(u, { className: "relative overflow-hidden bg-card border shadow-lg hover:shadow-xl transition-all duration-300", children: /* @__PURE__ */ s(f, { className: "pt-6", children: [
|
|
61
62
|
/* @__PURE__ */ s("div", { className: "flex items-start justify-between", children: [
|
|
62
63
|
/* @__PURE__ */ s("div", { children: [
|
|
63
|
-
/* @__PURE__ */ e(
|
|
64
|
+
/* @__PURE__ */ e(x, { className: "text-sm font-medium text-muted-foreground", children: r }),
|
|
64
65
|
/* @__PURE__ */ s("div", { className: "flex items-baseline space-x-2 mt-1", children: [
|
|
65
66
|
/* @__PURE__ */ e("div", { className: "text-2xl font-bold text-card-foreground", children: typeof t == "number" ? t.toFixed(1) : t }),
|
|
66
67
|
n && /* @__PURE__ */ e("div", { className: "text-sm text-muted-foreground font-medium", children: n })
|
|
@@ -73,11 +74,11 @@ const v = ({
|
|
|
73
74
|
] }),
|
|
74
75
|
/* @__PURE__ */ e("div", { className: `p-2 rounded-lg ${C[m]} shadow-lg`, children: /* @__PURE__ */ e(p, { className: w[l] }) })
|
|
75
76
|
] }),
|
|
76
|
-
|
|
77
|
+
g && /* @__PURE__ */ e("div", { className: "mt-4", children: g })
|
|
77
78
|
] }) });
|
|
78
79
|
};
|
|
79
80
|
export {
|
|
80
81
|
v as K,
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
q as M,
|
|
83
|
+
S as a
|
|
83
84
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as d, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import * as L from "react";
|
|
3
3
|
import { useState as P, useRef as j, useEffect as T, useMemo as z } from "react";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import "./card-7XPLAra3.js";
|
|
4
|
+
import { ch as D, ci as C, cj as k, ck as q, cl as S, H as R, bp as F, br as X, c7 as E, bq as V, c8 as J, U as O, aQ as _ } from "./toggle-group-VJoGbVQm.js";
|
|
5
|
+
import "./card-Bn3Y7DHQ.js";
|
|
7
6
|
import { c as b } from "./index-gWiv5-6R.js";
|
|
8
|
-
import { C as
|
|
9
|
-
import {
|
|
7
|
+
import { B as y, C as A } from "./tooltip-CAu4DEhc.js";
|
|
8
|
+
import { C as I } from "./select-D6_XPD6x.js";
|
|
9
|
+
import { c as Q } from "./index-DSyPHOLE.js";
|
|
10
10
|
/**
|
|
11
11
|
* @license lucide-react v1.16.0 - ISC
|
|
12
12
|
*
|
|
@@ -18,17 +18,7 @@ const Y = [
|
|
|
18
18
|
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
19
19
|
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
20
20
|
["path", { d: "M3 10h18", key: "8toen8" }]
|
|
21
|
-
], H =
|
|
22
|
-
/**
|
|
23
|
-
* @license lucide-react v1.16.0 - ISC
|
|
24
|
-
*
|
|
25
|
-
* This source code is licensed under the ISC license.
|
|
26
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/
|
|
28
|
-
const $ = [
|
|
29
|
-
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
30
|
-
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
31
|
-
], J = F("search", $), B = {
|
|
21
|
+
], H = Q("calendar", Y), $ = {
|
|
32
22
|
lessThanXSeconds: {
|
|
33
23
|
one: "moins d’une seconde",
|
|
34
24
|
other: "moins de {{count}} secondes"
|
|
@@ -90,10 +80,10 @@ const $ = [
|
|
|
90
80
|
one: "presqu’un an",
|
|
91
81
|
other: "presque {{count}} ans"
|
|
92
82
|
}
|
|
93
|
-
},
|
|
83
|
+
}, B = (e, t, s) => {
|
|
94
84
|
let r;
|
|
95
|
-
const
|
|
96
|
-
return typeof
|
|
85
|
+
const o = $[e];
|
|
86
|
+
return typeof o == "string" ? r = o : t === 1 ? r = o.one : r = o.other.replace("{{count}}", String(t)), s != null && s.addSuffix ? s.comparison && s.comparison > 0 ? "dans " + r : "il y a " + r : r;
|
|
97
87
|
}, K = {
|
|
98
88
|
full: "EEEE d MMMM y",
|
|
99
89
|
long: "d MMMM y",
|
|
@@ -104,40 +94,40 @@ const $ = [
|
|
|
104
94
|
long: "HH:mm:ss z",
|
|
105
95
|
medium: "HH:mm:ss",
|
|
106
96
|
short: "HH:mm"
|
|
107
|
-
},
|
|
97
|
+
}, G = {
|
|
108
98
|
full: "{{date}} 'à' {{time}}",
|
|
109
99
|
long: "{{date}} 'à' {{time}}",
|
|
110
100
|
medium: "{{date}}, {{time}}",
|
|
111
101
|
short: "{{date}}, {{time}}"
|
|
112
|
-
},
|
|
113
|
-
date:
|
|
102
|
+
}, Z = {
|
|
103
|
+
date: D({
|
|
114
104
|
formats: K,
|
|
115
105
|
defaultWidth: "full"
|
|
116
106
|
}),
|
|
117
|
-
time:
|
|
107
|
+
time: D({
|
|
118
108
|
formats: U,
|
|
119
109
|
defaultWidth: "full"
|
|
120
110
|
}),
|
|
121
|
-
dateTime:
|
|
122
|
-
formats:
|
|
111
|
+
dateTime: D({
|
|
112
|
+
formats: G,
|
|
123
113
|
defaultWidth: "full"
|
|
124
114
|
})
|
|
125
|
-
},
|
|
115
|
+
}, ee = {
|
|
126
116
|
lastWeek: "eeee 'dernier à' p",
|
|
127
117
|
yesterday: "'hier à' p",
|
|
128
118
|
today: "'aujourd’hui à' p",
|
|
129
119
|
tomorrow: "'demain à' p'",
|
|
130
120
|
nextWeek: "eeee 'prochain à' p",
|
|
131
121
|
other: "P"
|
|
132
|
-
},
|
|
122
|
+
}, te = (e, t, s, r) => ee[e], ne = {
|
|
133
123
|
narrow: ["av. J.-C", "ap. J.-C"],
|
|
134
124
|
abbreviated: ["av. J.-C", "ap. J.-C"],
|
|
135
125
|
wide: ["avant Jésus-Christ", "après Jésus-Christ"]
|
|
136
|
-
},
|
|
126
|
+
}, re = {
|
|
137
127
|
narrow: ["T1", "T2", "T3", "T4"],
|
|
138
128
|
abbreviated: ["1er trim.", "2ème trim.", "3ème trim.", "4ème trim."],
|
|
139
129
|
wide: ["1er trimestre", "2ème trimestre", "3ème trimestre", "4ème trimestre"]
|
|
140
|
-
},
|
|
130
|
+
}, ae = {
|
|
141
131
|
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
142
132
|
abbreviated: [
|
|
143
133
|
"janv.",
|
|
@@ -180,7 +170,7 @@ const $ = [
|
|
|
180
170
|
"vendredi",
|
|
181
171
|
"samedi"
|
|
182
172
|
]
|
|
183
|
-
},
|
|
173
|
+
}, oe = {
|
|
184
174
|
narrow: {
|
|
185
175
|
am: "AM",
|
|
186
176
|
pm: "PM",
|
|
@@ -211,30 +201,30 @@ const $ = [
|
|
|
211
201
|
evening: "du soir",
|
|
212
202
|
night: "du matin"
|
|
213
203
|
}
|
|
214
|
-
},
|
|
204
|
+
}, se = (e, t) => {
|
|
215
205
|
const s = Number(e), r = t == null ? void 0 : t.unit;
|
|
216
206
|
if (s === 0) return "0";
|
|
217
|
-
const
|
|
207
|
+
const o = ["year", "week", "hour", "minute", "second"];
|
|
218
208
|
let l;
|
|
219
|
-
return s === 1 ? l = r &&
|
|
220
|
-
},
|
|
209
|
+
return s === 1 ? l = r && o.includes(r) ? "ère" : "er" : l = "ème", s + l;
|
|
210
|
+
}, le = ["MMM", "MMMM"], de = {
|
|
221
211
|
preprocessor: (e, t) => e.getDate() === 1 || !t.some(
|
|
222
|
-
(r) => r.isToken &&
|
|
212
|
+
(r) => r.isToken && le.includes(r.value)
|
|
223
213
|
) ? t : t.map(
|
|
224
214
|
(r) => r.isToken && r.value === "do" ? { isToken: !0, value: "d" } : r
|
|
225
215
|
),
|
|
226
|
-
ordinalNumber:
|
|
216
|
+
ordinalNumber: se,
|
|
227
217
|
era: C({
|
|
228
|
-
values:
|
|
218
|
+
values: ne,
|
|
229
219
|
defaultWidth: "wide"
|
|
230
220
|
}),
|
|
231
221
|
quarter: C({
|
|
232
|
-
values:
|
|
222
|
+
values: re,
|
|
233
223
|
defaultWidth: "wide",
|
|
234
224
|
argumentCallback: (e) => e - 1
|
|
235
225
|
}),
|
|
236
226
|
month: C({
|
|
237
|
-
values:
|
|
227
|
+
values: ae,
|
|
238
228
|
defaultWidth: "wide"
|
|
239
229
|
}),
|
|
240
230
|
day: C({
|
|
@@ -242,26 +232,26 @@ const $ = [
|
|
|
242
232
|
defaultWidth: "wide"
|
|
243
233
|
}),
|
|
244
234
|
dayPeriod: C({
|
|
245
|
-
values:
|
|
235
|
+
values: oe,
|
|
246
236
|
defaultWidth: "wide"
|
|
247
237
|
})
|
|
248
|
-
},
|
|
238
|
+
}, ce = /^(\d+)(ième|ère|ème|er|e)?/i, ue = /\d+/i, me = {
|
|
249
239
|
narrow: /^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,
|
|
250
240
|
abbreviated: /^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,
|
|
251
241
|
wide: /^(avant Jésus-Christ|après Jésus-Christ)/i
|
|
252
|
-
},
|
|
242
|
+
}, fe = {
|
|
253
243
|
any: [/^av/i, /^ap/i]
|
|
254
|
-
},
|
|
244
|
+
}, he = {
|
|
255
245
|
narrow: /^T?[1234]/i,
|
|
256
246
|
abbreviated: /^[1234](er|ème|e)? trim\.?/i,
|
|
257
247
|
wide: /^[1234](er|ème|e)? trimestre/i
|
|
258
|
-
},
|
|
248
|
+
}, pe = {
|
|
259
249
|
any: [/1/i, /2/i, /3/i, /4/i]
|
|
260
|
-
},
|
|
250
|
+
}, ve = {
|
|
261
251
|
narrow: /^[jfmasond]/i,
|
|
262
252
|
abbreviated: /^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,
|
|
263
253
|
wide: /^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i
|
|
264
|
-
},
|
|
254
|
+
}, ge = {
|
|
265
255
|
narrow: [
|
|
266
256
|
/^j/i,
|
|
267
257
|
/^f/i,
|
|
@@ -290,18 +280,18 @@ const $ = [
|
|
|
290
280
|
/^n/i,
|
|
291
281
|
/^d/i
|
|
292
282
|
]
|
|
293
|
-
},
|
|
283
|
+
}, be = {
|
|
294
284
|
narrow: /^[lmjvsd]/i,
|
|
295
285
|
short: /^(di|lu|ma|me|je|ve|sa)/i,
|
|
296
286
|
abbreviated: /^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,
|
|
297
287
|
wide: /^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i
|
|
298
|
-
},
|
|
288
|
+
}, ye = {
|
|
299
289
|
narrow: [/^d/i, /^l/i, /^m/i, /^m/i, /^j/i, /^v/i, /^s/i],
|
|
300
290
|
any: [/^di/i, /^lu/i, /^ma/i, /^me/i, /^je/i, /^ve/i, /^sa/i]
|
|
301
291
|
}, we = {
|
|
302
292
|
narrow: /^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,
|
|
303
293
|
any: /^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i
|
|
304
|
-
},
|
|
294
|
+
}, xe = {
|
|
305
295
|
any: {
|
|
306
296
|
am: /^a/i,
|
|
307
297
|
pm: /^p/i,
|
|
@@ -312,69 +302,69 @@ const $ = [
|
|
|
312
302
|
evening: /soir/i,
|
|
313
303
|
night: /nuit/i
|
|
314
304
|
}
|
|
315
|
-
},
|
|
305
|
+
}, Me = {
|
|
316
306
|
ordinalNumber: q({
|
|
317
|
-
matchPattern:
|
|
318
|
-
parsePattern:
|
|
307
|
+
matchPattern: ce,
|
|
308
|
+
parsePattern: ue,
|
|
319
309
|
valueCallback: (e) => parseInt(e)
|
|
320
310
|
}),
|
|
321
311
|
era: k({
|
|
322
|
-
matchPatterns:
|
|
312
|
+
matchPatterns: me,
|
|
323
313
|
defaultMatchWidth: "wide",
|
|
324
|
-
parsePatterns:
|
|
314
|
+
parsePatterns: fe,
|
|
325
315
|
defaultParseWidth: "any"
|
|
326
316
|
}),
|
|
327
317
|
quarter: k({
|
|
328
|
-
matchPatterns:
|
|
318
|
+
matchPatterns: he,
|
|
329
319
|
defaultMatchWidth: "wide",
|
|
330
|
-
parsePatterns:
|
|
320
|
+
parsePatterns: pe,
|
|
331
321
|
defaultParseWidth: "any",
|
|
332
322
|
valueCallback: (e) => e + 1
|
|
333
323
|
}),
|
|
334
324
|
month: k({
|
|
335
|
-
matchPatterns:
|
|
325
|
+
matchPatterns: ve,
|
|
336
326
|
defaultMatchWidth: "wide",
|
|
337
|
-
parsePatterns:
|
|
327
|
+
parsePatterns: ge,
|
|
338
328
|
defaultParseWidth: "any"
|
|
339
329
|
}),
|
|
340
330
|
day: k({
|
|
341
|
-
matchPatterns:
|
|
331
|
+
matchPatterns: be,
|
|
342
332
|
defaultMatchWidth: "wide",
|
|
343
|
-
parsePatterns:
|
|
333
|
+
parsePatterns: ye,
|
|
344
334
|
defaultParseWidth: "any"
|
|
345
335
|
}),
|
|
346
336
|
dayPeriod: k({
|
|
347
337
|
matchPatterns: we,
|
|
348
338
|
defaultMatchWidth: "any",
|
|
349
|
-
parsePatterns:
|
|
339
|
+
parsePatterns: xe,
|
|
350
340
|
defaultParseWidth: "any"
|
|
351
341
|
})
|
|
352
342
|
}, W = {
|
|
353
343
|
code: "fr",
|
|
354
|
-
formatDistance:
|
|
355
|
-
formatLong:
|
|
356
|
-
formatRelative:
|
|
357
|
-
localize:
|
|
358
|
-
match:
|
|
344
|
+
formatDistance: B,
|
|
345
|
+
formatLong: Z,
|
|
346
|
+
formatRelative: te,
|
|
347
|
+
localize: de,
|
|
348
|
+
match: Me,
|
|
359
349
|
options: {
|
|
360
350
|
weekStartsOn: 1,
|
|
361
351
|
firstWeekContainsDate: 4
|
|
362
352
|
}
|
|
363
|
-
},
|
|
364
|
-
const [r,
|
|
353
|
+
}, Le = ({ date: e, onDateChange: t, placeholder: s }) => {
|
|
354
|
+
const [r, o] = P(!1), l = j(null);
|
|
365
355
|
T(() => {
|
|
366
356
|
if (!r) return;
|
|
367
357
|
const u = (f) => {
|
|
368
|
-
l.current !== null && !l.current.contains(f.target) &&
|
|
358
|
+
l.current !== null && !l.current.contains(f.target) && o(!1);
|
|
369
359
|
};
|
|
370
360
|
return document.addEventListener("mousedown", u), () => {
|
|
371
361
|
document.removeEventListener("mousedown", u);
|
|
372
362
|
};
|
|
373
363
|
}, [r]);
|
|
374
364
|
const m = () => {
|
|
375
|
-
|
|
365
|
+
o((u) => !u);
|
|
376
366
|
}, c = (u) => {
|
|
377
|
-
t(u),
|
|
367
|
+
t(u), o(!1);
|
|
378
368
|
};
|
|
379
369
|
return /* @__PURE__ */ d("div", { ref: l, className: "relative w-full", children: [
|
|
380
370
|
/* @__PURE__ */ d(
|
|
@@ -397,23 +387,23 @@ const $ = [
|
|
|
397
387
|
r ? /* @__PURE__ */ n("div", { className: "absolute left-0 top-[calc(100%+4px)] z-[100] rounded-md border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 slide-in-from-top-2", children: /* @__PURE__ */ n(R, { mode: "single", selected: e, onSelect: c }) }) : null
|
|
398
388
|
] });
|
|
399
389
|
}, De = ({ value: e, onChange: t, placeholder: s = "Selectionner une periode", className: r }) => {
|
|
400
|
-
const [
|
|
390
|
+
const [o, l] = L.useState(!1), [m, c] = L.useState(e);
|
|
401
391
|
L.useEffect(() => {
|
|
402
|
-
|
|
403
|
-
}, [
|
|
392
|
+
o && c(e);
|
|
393
|
+
}, [o, e]);
|
|
404
394
|
const u = (h) => {
|
|
405
395
|
h.stopPropagation(), t(void 0), l(!1);
|
|
406
396
|
}, f = () => {
|
|
407
397
|
t(m), l(!1);
|
|
408
398
|
}, p = () => {
|
|
409
399
|
c(e), l(!1);
|
|
410
|
-
},
|
|
400
|
+
}, w = () => {
|
|
411
401
|
c(void 0);
|
|
412
|
-
},
|
|
413
|
-
return /* @__PURE__ */ n("div", { className: b("grid gap-2", r), children: /* @__PURE__ */ d(
|
|
414
|
-
/* @__PURE__ */ n(
|
|
402
|
+
}, x = (h) => h != null && h.from ? !h.to || h.from.getTime() === h.to.getTime() ? S(h.from, "dd MMM yyyy", { locale: W }) : `${S(h.from, "dd MMM yyyy", { locale: W })} - ${S(h.to, "dd MMM yyyy", { locale: W })}` : s;
|
|
403
|
+
return /* @__PURE__ */ n("div", { className: b("grid gap-2", r), children: /* @__PURE__ */ d(F, { open: o, onOpenChange: l, children: [
|
|
404
|
+
/* @__PURE__ */ n(X, { asChild: !0, children: /* @__PURE__ */ d(y, { id: "date", variant: "outline", className: b("w-[300px] justify-start text-left font-normal", !(e != null && e.from) && "text-muted-foreground"), children: [
|
|
415
405
|
/* @__PURE__ */ n(H, { className: "mr-2 size-4" }),
|
|
416
|
-
|
|
406
|
+
x(e),
|
|
417
407
|
(e == null ? void 0 : e.from) && /* @__PURE__ */ n(
|
|
418
408
|
y,
|
|
419
409
|
{
|
|
@@ -423,7 +413,7 @@ const $ = [
|
|
|
423
413
|
"aria-label": "Effacer la periode selectionnee",
|
|
424
414
|
className: "ml-auto h-5 w-5 opacity-50 hover:opacity-100",
|
|
425
415
|
onClick: u,
|
|
426
|
-
children: /* @__PURE__ */ n(
|
|
416
|
+
children: /* @__PURE__ */ n(E, { className: "size-4" })
|
|
427
417
|
}
|
|
428
418
|
)
|
|
429
419
|
] }) }),
|
|
@@ -441,7 +431,7 @@ const $ = [
|
|
|
441
431
|
}
|
|
442
432
|
),
|
|
443
433
|
/* @__PURE__ */ d("div", { className: "flex items-center justify-between border-t border-border px-3 py-2", children: [
|
|
444
|
-
/* @__PURE__ */ n(y, { variant: "ghost", size: "sm", onClick:
|
|
434
|
+
/* @__PURE__ */ n(y, { variant: "ghost", size: "sm", onClick: w, children: "Effacer" }),
|
|
445
435
|
/* @__PURE__ */ d("div", { className: "flex gap-2", children: [
|
|
446
436
|
/* @__PURE__ */ n(y, { variant: "ghost", size: "sm", onClick: p, children: "Annuler" }),
|
|
447
437
|
/* @__PURE__ */ n(y, { size: "sm", onClick: f, children: "Appliquer" })
|
|
@@ -449,17 +439,17 @@ const $ = [
|
|
|
449
439
|
] })
|
|
450
440
|
] })
|
|
451
441
|
] }) });
|
|
452
|
-
},
|
|
442
|
+
}, Ee = ({
|
|
453
443
|
options: e,
|
|
454
444
|
selected: t,
|
|
455
445
|
onToggle: s,
|
|
456
446
|
onClear: r,
|
|
457
|
-
onSelectAll:
|
|
447
|
+
onSelectAll: o,
|
|
458
448
|
placeholder: l = "Sélectionner...",
|
|
459
449
|
searchable: m = !1,
|
|
460
450
|
searchPlaceholder: c = "Rechercher..."
|
|
461
451
|
}) => {
|
|
462
|
-
const [u, f] = P(""), [p,
|
|
452
|
+
const [u, f] = P(""), [p, w] = P(!1), x = j(null), h = j(null), g = z(() => u === "" ? e : e.filter((a) => a.label.toLowerCase().includes(u.toLowerCase())), [e, u]), i = z(() => g.length === 0 ? !1 : g.every((a) => t.includes(a.value)), [g, t]);
|
|
463
453
|
T(() => {
|
|
464
454
|
p && m && requestAnimationFrame(() => {
|
|
465
455
|
var a;
|
|
@@ -468,33 +458,33 @@ const $ = [
|
|
|
468
458
|
}, [p, m]), T(() => {
|
|
469
459
|
if (!p) return;
|
|
470
460
|
const a = (v) => {
|
|
471
|
-
|
|
461
|
+
x.current !== null && !x.current.contains(v.target) && (w(!1), f(""));
|
|
472
462
|
};
|
|
473
463
|
return document.addEventListener("mousedown", a), () => {
|
|
474
464
|
document.removeEventListener("mousedown", a);
|
|
475
465
|
};
|
|
476
466
|
}, [p]);
|
|
477
467
|
const M = () => {
|
|
478
|
-
if (
|
|
468
|
+
if (i) {
|
|
479
469
|
const a = g.map((N) => N.value), v = t.filter((N) => !a.includes(N));
|
|
480
|
-
|
|
470
|
+
o !== void 0 ? o(v) : r();
|
|
481
471
|
} else {
|
|
482
472
|
const a = [...t];
|
|
483
473
|
g.forEach((v) => {
|
|
484
474
|
a.includes(v.value) || a.push(v.value);
|
|
485
|
-
}),
|
|
475
|
+
}), o !== void 0 ? o(a) : g.forEach((v) => {
|
|
486
476
|
t.includes(v.value) || s(v.value);
|
|
487
477
|
});
|
|
488
478
|
}
|
|
489
479
|
};
|
|
490
|
-
return /* @__PURE__ */ d("div", { ref:
|
|
480
|
+
return /* @__PURE__ */ d("div", { ref: x, className: "relative w-full", children: [
|
|
491
481
|
/* @__PURE__ */ d(
|
|
492
482
|
y,
|
|
493
483
|
{
|
|
494
484
|
variant: "outline",
|
|
495
485
|
type: "button",
|
|
496
486
|
onClick: () => {
|
|
497
|
-
|
|
487
|
+
w((a) => (a && f(""), !a));
|
|
498
488
|
},
|
|
499
489
|
className: b(
|
|
500
490
|
"w-full justify-between text-left font-normal focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
@@ -515,7 +505,7 @@ const $ = [
|
|
|
515
505
|
a.stopPropagation(), r();
|
|
516
506
|
},
|
|
517
507
|
className: "rounded-full p-0.5 opacity-50 transition-opacity hover:opacity-100",
|
|
518
|
-
children: /* @__PURE__ */ n(
|
|
508
|
+
children: /* @__PURE__ */ n(E, { className: "h-3.5 w-3.5" })
|
|
519
509
|
}
|
|
520
510
|
),
|
|
521
511
|
/* @__PURE__ */ n(A, { className: b("h-4 w-4 opacity-50 transition-transform", p && "rotate-180") })
|
|
@@ -541,7 +531,7 @@ const $ = [
|
|
|
541
531
|
] }) }) : null,
|
|
542
532
|
/* @__PURE__ */ d("div", { className: "flex flex-col gap-0.5 max-h-56 overflow-y-auto p-1.5", children: [
|
|
543
533
|
g.length > 0 && /* @__PURE__ */ d("label", { className: "flex items-center gap-2.5 rounded-md px-2 py-2 text-sm hover:bg-muted cursor-pointer transition-colors", children: [
|
|
544
|
-
/* @__PURE__ */ n(O, { checked:
|
|
534
|
+
/* @__PURE__ */ n(O, { checked: i, onCheckedChange: M }),
|
|
545
535
|
"Tout sélectionner"
|
|
546
536
|
] }),
|
|
547
537
|
g.length === 0 && /* @__PURE__ */ n("p", { className: "px-2 py-3 text-center text-xs text-muted-foreground", children: "Aucun résultat" }),
|
|
@@ -569,34 +559,34 @@ const $ = [
|
|
|
569
559
|
) })
|
|
570
560
|
] }) : null
|
|
571
561
|
] });
|
|
572
|
-
},
|
|
562
|
+
}, Je = ({
|
|
573
563
|
options: e,
|
|
574
564
|
value: t,
|
|
575
565
|
onChange: s,
|
|
576
566
|
placeholder: r = "Sélectionner...",
|
|
577
|
-
searchPlaceholder:
|
|
567
|
+
searchPlaceholder: o = "Rechercher..."
|
|
578
568
|
}) => {
|
|
579
|
-
const [l, m] = P(""), [c, u] = P(!1), f = j(null), p = j(null),
|
|
580
|
-
var
|
|
569
|
+
const [l, m] = P(""), [c, u] = P(!1), f = j(null), p = j(null), w = z(() => l === "" ? e : e.filter((i) => i.label.toLowerCase().includes(l.toLowerCase())), [e, l]), x = z(() => {
|
|
570
|
+
var i;
|
|
581
571
|
if (!(t === void 0 || t === ""))
|
|
582
|
-
return ((
|
|
572
|
+
return ((i = e.find((M) => M.value === t)) == null ? void 0 : i.label) ?? t;
|
|
583
573
|
}, [e, t]);
|
|
584
574
|
T(() => {
|
|
585
575
|
c && requestAnimationFrame(() => {
|
|
586
|
-
var
|
|
587
|
-
(
|
|
576
|
+
var i;
|
|
577
|
+
(i = p.current) == null || i.focus();
|
|
588
578
|
});
|
|
589
579
|
}, [c]), T(() => {
|
|
590
580
|
if (!c) return;
|
|
591
|
-
const
|
|
581
|
+
const i = (M) => {
|
|
592
582
|
f.current !== null && !f.current.contains(M.target) && (u(!1), m(""));
|
|
593
583
|
};
|
|
594
|
-
return document.addEventListener("mousedown",
|
|
595
|
-
document.removeEventListener("mousedown",
|
|
584
|
+
return document.addEventListener("mousedown", i), () => {
|
|
585
|
+
document.removeEventListener("mousedown", i);
|
|
596
586
|
};
|
|
597
587
|
}, [c]);
|
|
598
|
-
const h = (
|
|
599
|
-
s(
|
|
588
|
+
const h = (i) => {
|
|
589
|
+
s(i), u(!1), m("");
|
|
600
590
|
};
|
|
601
591
|
return /* @__PURE__ */ d("div", { ref: f, className: "relative w-full", children: [
|
|
602
592
|
/* @__PURE__ */ d(
|
|
@@ -605,7 +595,7 @@ const $ = [
|
|
|
605
595
|
variant: "outline",
|
|
606
596
|
type: "button",
|
|
607
597
|
onClick: () => {
|
|
608
|
-
u((
|
|
598
|
+
u((i) => (i && m(""), !i));
|
|
609
599
|
},
|
|
610
600
|
className: b(
|
|
611
601
|
"w-full justify-between text-left font-normal focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
@@ -613,7 +603,7 @@ const $ = [
|
|
|
613
603
|
(t === void 0 || t === "") && "text-muted-foreground"
|
|
614
604
|
),
|
|
615
605
|
children: [
|
|
616
|
-
/* @__PURE__ */ n("span", { className: "truncate", children:
|
|
606
|
+
/* @__PURE__ */ n("span", { className: "truncate", children: x ?? r }),
|
|
617
607
|
/* @__PURE__ */ n(A, { className: b("h-4 w-4 opacity-50 shrink-0 transition-transform", c && "rotate-180") })
|
|
618
608
|
]
|
|
619
609
|
}
|
|
@@ -626,43 +616,43 @@ const $ = [
|
|
|
626
616
|
{
|
|
627
617
|
ref: p,
|
|
628
618
|
className: "w-full rounded-md 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",
|
|
629
|
-
placeholder:
|
|
619
|
+
placeholder: o,
|
|
630
620
|
value: l,
|
|
631
|
-
onChange: (
|
|
632
|
-
m(
|
|
621
|
+
onChange: (i) => {
|
|
622
|
+
m(i.target.value);
|
|
633
623
|
}
|
|
634
624
|
}
|
|
635
625
|
)
|
|
636
626
|
] }) }),
|
|
637
627
|
/* @__PURE__ */ d("div", { className: "flex flex-col gap-0.5 max-h-56 overflow-y-auto p-1.5", children: [
|
|
638
|
-
|
|
639
|
-
|
|
628
|
+
w.length === 0 && /* @__PURE__ */ n("p", { className: "px-2 py-3 text-center text-xs text-muted-foreground", children: "Aucun résultat" }),
|
|
629
|
+
w.map((i) => /* @__PURE__ */ d(
|
|
640
630
|
"button",
|
|
641
631
|
{
|
|
642
632
|
type: "button",
|
|
643
633
|
onClick: () => {
|
|
644
|
-
h(
|
|
634
|
+
h(i.value);
|
|
645
635
|
},
|
|
646
636
|
className: b(
|
|
647
637
|
"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",
|
|
648
|
-
t ===
|
|
638
|
+
t === i.value && "bg-muted font-medium"
|
|
649
639
|
),
|
|
650
640
|
children: [
|
|
651
|
-
/* @__PURE__ */ n(
|
|
652
|
-
|
|
641
|
+
/* @__PURE__ */ n(I, { className: b("size-3.5 shrink-0", t === i.value ? "opacity-100" : "opacity-0") }),
|
|
642
|
+
i.label
|
|
653
643
|
]
|
|
654
644
|
},
|
|
655
|
-
|
|
645
|
+
i.value
|
|
656
646
|
))
|
|
657
647
|
] })
|
|
658
648
|
] }) : null
|
|
659
649
|
] });
|
|
660
|
-
},
|
|
650
|
+
}, Oe = ({
|
|
661
651
|
searchQuery: e,
|
|
662
652
|
search: t,
|
|
663
653
|
placeholder: s = "Rechercher...",
|
|
664
654
|
onSearch: r,
|
|
665
|
-
onSubmit:
|
|
655
|
+
onSubmit: o,
|
|
666
656
|
onClear: l,
|
|
667
657
|
className: m
|
|
668
658
|
}) => {
|
|
@@ -672,7 +662,7 @@ const $ = [
|
|
|
672
662
|
return /* @__PURE__ */ d("div", { className: b("relative h-fit w-full md:w-64", m), children: [
|
|
673
663
|
/* @__PURE__ */ n(J, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground w-4 h-4" }),
|
|
674
664
|
/* @__PURE__ */ n(
|
|
675
|
-
|
|
665
|
+
_,
|
|
676
666
|
{
|
|
677
667
|
placeholder: s,
|
|
678
668
|
value: c,
|
|
@@ -681,18 +671,17 @@ const $ = [
|
|
|
681
671
|
},
|
|
682
672
|
className: "pl-8",
|
|
683
673
|
onKeyDown: (f) => {
|
|
684
|
-
f.key === "Enter" &&
|
|
674
|
+
f.key === "Enter" && o !== void 0 && (f.preventDefault(), o());
|
|
685
675
|
}
|
|
686
676
|
}
|
|
687
677
|
),
|
|
688
|
-
c !== "" ? /* @__PURE__ */ n("button", { onClick: u, className: "absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700", type: "button", children: /* @__PURE__ */ n(
|
|
678
|
+
c !== "" ? /* @__PURE__ */ n("button", { onClick: u, className: "absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700", type: "button", children: /* @__PURE__ */ n(E, { className: "size-4" }) }) : null
|
|
689
679
|
] });
|
|
690
680
|
};
|
|
691
681
|
export {
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
682
|
+
Le as D,
|
|
683
|
+
Ee as M,
|
|
684
|
+
Oe as S,
|
|
695
685
|
De as a,
|
|
696
|
-
|
|
697
|
-
J as c
|
|
686
|
+
Je as b
|
|
698
687
|
};
|