@krosoft/react 0.0.123 → 0.0.125
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-po4LjUcM.js → AppActions-BbAnhStS.js} +22 -18
- package/dist/{AppSubTitle-CWrsJYFJ.js → AppSubTitle-lg3d5NWc.js} +1 -1
- package/dist/{AppTitle-CDxWr_0y.js → AppTitle-uboDuil4.js} +1 -1
- package/dist/{AppVerticalTabs-CdqoObXx.js → AppVerticalTabs-CBijkDF_.js} +33 -49
- package/dist/ConfirmationDialog-Co5yl0yA.js +184 -0
- package/dist/{DataTable-CrJoeR_0.js → DataTable-DSIgTHZS.js} +174 -218
- package/dist/ErrorAlert-DH1onuyt.js +17 -0
- package/dist/GenericForm-QoeireeW.js +339 -0
- package/dist/ImageInput-DLTYJMwr.js +65 -0
- package/dist/KpiCardsLayout-C3LmSeL1.js +22 -0
- package/dist/{LoadingState-PhGi7HXH.js → LoadingState-BN0YaPSs.js} +3 -3
- package/dist/{MetricCard-C-ewNR_i.js → MetricCard-CPw-fiNS.js} +6 -6
- package/dist/{MultiSelect-BoisW4Kn.js → MultiSelect-CX051kfk.js} +32 -27
- package/dist/SearchInput-D6LmcOjp.js +249 -0
- package/dist/SkeletonCards-BIEnyOuZ.js +62 -0
- package/dist/{TableFilter-CLjQU36k.js → TableFilter-Wh_Womy4.js} +114 -123
- package/dist/{ThemeSelector--w3R6Ff3.js → ThemeSelector-Qv8QBlYq.js} +2 -2
- package/dist/{Topbar-DFu_OdSs.js → Topbar-DVww-tU8.js} +49 -59
- package/dist/{alert-B34E_4uH.js → alert-B78CiTYe.js} +2 -2
- package/dist/components/core/cards/index.js +2 -2
- package/dist/components/core/dialogs/index.js +2 -2
- package/dist/components/core/filters/index.js +1 -1
- package/dist/components/core/forms/index.js +1 -1
- package/dist/components/core/index.js +19 -19
- package/dist/components/core/inputs/index.js +3 -3
- package/dist/components/core/layouts/index.js +4 -4
- package/dist/components/core/navbar/index.js +1 -1
- package/dist/components/core/states/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/core/theme/index.js +1 -1
- package/dist/components/index.js +270 -270
- package/dist/components/ui/index.js +213 -213
- package/dist/helpers/index.js +1 -1
- package/dist/hooks/behavior/index.js +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/select-MWzbMBAS.js +106 -0
- package/dist/tailwind.helper-B6yFEsav.js +8 -0
- package/dist/toaster-DTC8Duvh.js +75 -0
- package/dist/toggle-group-CSdAiS44.js +1694 -0
- package/dist/tooltip-BWyFpIxo.js +56 -0
- package/dist/useConfirmDeleteDialog-CiBQmRxg.js +65 -0
- package/package.json +3 -3
- package/dist/ConfirmationDialog-CkMyyh_3.js +0 -221
- package/dist/ErrorAlert-C6BbHHRZ.js +0 -33
- package/dist/GenericForm-CmwqEXiQ.js +0 -11410
- package/dist/ImageInput-C8HcxE8t.js +0 -82
- package/dist/KpiCardsLayout-CETMpB7A.js +0 -15
- package/dist/SearchInput-DJ_F3emq.js +0 -586
- package/dist/SkeletonCards-C5lXTSrB.js +0 -57
- package/dist/badge-CfWlt79h.js +0 -26
- package/dist/createLucideIcon-MP_wDWjs.js +0 -116
- package/dist/ellipsis-vertical-kB5yFb-i.js +0 -15
- package/dist/grip-vertical-DGywJXzS.js +0 -18
- package/dist/index-Be16PP7H.js +0 -34
- package/dist/loader-circle-CKy7u7JW.js +0 -11
- package/dist/select-DlQvLtI3.js +0 -1763
- package/dist/tailwind.helper-gWiv5-6R.js +0 -2278
- package/dist/toaster-CKoOjjKr.js +0 -134
- package/dist/toggle-group-wIgXZYDq.js +0 -29086
- package/dist/tooltip-YhBPXbcJ.js +0 -2477
- package/dist/useConfirmDeleteDialog-BOb3XFpz.js +0 -75
|
@@ -1,46 +1,37 @@
|
|
|
1
1
|
import { jsxs as u, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useState as w, useEffect as D, useMemo as N } from "react";
|
|
3
|
-
import { a as
|
|
4
|
-
import {
|
|
5
|
-
import "./alert-
|
|
6
|
-
import
|
|
7
|
-
import { B as F
|
|
8
|
-
import
|
|
3
|
+
import { a as $, D as M, b as O, S as I } from "./SearchInput-D6LmcOjp.js";
|
|
4
|
+
import { B as k, aX as C, bE as j, bN as R, bG as z, bJ as B, bM as Q, b0 as V, bI as _, bw as X, by as G, bx as H, $ as E } from "./toggle-group-CSdAiS44.js";
|
|
5
|
+
import "./alert-B78CiTYe.js";
|
|
6
|
+
import "@radix-ui/react-aspect-ratio";
|
|
7
|
+
import { B as F } from "./tooltip-BWyFpIxo.js";
|
|
8
|
+
import "@radix-ui/react-collapsible";
|
|
9
|
+
import { XIcon as P, Filter as J, ChevronDown as K, Search as U } from "lucide-react";
|
|
10
|
+
import "react-resizable-panels";
|
|
11
|
+
import "clsx";
|
|
12
|
+
import "tailwind-merge";
|
|
13
|
+
import { S as W, h as Y, i as Z, a as q, c as ee } from "./select-MWzbMBAS.js";
|
|
9
14
|
import "next-themes";
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
* @license lucide-react v1.17.0 - ISC
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the ISC license.
|
|
17
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/
|
|
19
|
-
const le = [
|
|
20
|
-
[
|
|
21
|
-
"path",
|
|
22
|
-
{
|
|
23
|
-
d: "M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",
|
|
24
|
-
key: "sc7q7i"
|
|
25
|
-
}
|
|
26
|
-
]
|
|
27
|
-
], ae = te("funnel", le), L = (c, l, s = {}) => {
|
|
15
|
+
import "sonner";
|
|
16
|
+
import { c as re } from "./tailwind.helper-B6yFEsav.js";
|
|
17
|
+
import { M as te } from "./MultiSelect-CX051kfk.js";
|
|
18
|
+
const L = (n, l, s = {}) => {
|
|
28
19
|
if (l instanceof Date)
|
|
29
20
|
return l.toLocaleDateString("fr-FR");
|
|
30
|
-
const i = String(l), d = s[`${
|
|
31
|
-
return d !== void 0 ? d :
|
|
21
|
+
const i = String(l), d = s[`${n}_${i}`];
|
|
22
|
+
return d !== void 0 ? d : n.includes("ok") || l === "true" || l === "false" ? l === "true" ? "Oui" : "Non" : i;
|
|
32
23
|
};
|
|
33
|
-
function
|
|
34
|
-
const
|
|
35
|
-
return
|
|
24
|
+
function le({ filters: n, onRemoveFilter: l, onClearAll: s, filterLabels: i = {}, optionLabels: d = {} }) {
|
|
25
|
+
const c = Object.entries(n).filter(([h, m]) => !(m == null || m === "" || Array.isArray(m) && m.length === 0));
|
|
26
|
+
return c.length === 0 ? null : /* @__PURE__ */ u("div", { className: "flex flex-wrap items-center gap-2 mb-4", children: [
|
|
36
27
|
/* @__PURE__ */ r("span", { className: "text-sm text-gray-600 font-medium", children: "Filtres actifs :" }),
|
|
37
|
-
|
|
28
|
+
c.flatMap(([h, m]) => {
|
|
38
29
|
const b = i[h] ?? h;
|
|
39
30
|
if (Array.isArray(m))
|
|
40
|
-
return m.map((
|
|
41
|
-
const p = L(h,
|
|
31
|
+
return m.map((y) => {
|
|
32
|
+
const p = L(h, y, d);
|
|
42
33
|
return /* @__PURE__ */ u(
|
|
43
|
-
|
|
34
|
+
k,
|
|
44
35
|
{
|
|
45
36
|
variant: "secondary",
|
|
46
37
|
className: "flex items-center gap-1 px-3 py-1 bg-blue-50 text-blue-700 border border-blue-200 hover:bg-blue-100",
|
|
@@ -52,19 +43,19 @@ function se({ filters: c, onRemoveFilter: l, onClearAll: s, filterLabels: i = {}
|
|
|
52
43
|
"button",
|
|
53
44
|
{
|
|
54
45
|
onClick: () => {
|
|
55
|
-
l(h,
|
|
46
|
+
l(h, y);
|
|
56
47
|
},
|
|
57
48
|
className: "ml-1 hover:bg-blue-200 rounded-full p-0.5",
|
|
58
|
-
children: /* @__PURE__ */ r(
|
|
49
|
+
children: /* @__PURE__ */ r(P, { className: "size-4" })
|
|
59
50
|
}
|
|
60
51
|
)
|
|
61
52
|
]
|
|
62
53
|
},
|
|
63
|
-
`${h}_${String(
|
|
54
|
+
`${h}_${String(y)}`
|
|
64
55
|
);
|
|
65
56
|
});
|
|
66
57
|
const x = L(h, m, d);
|
|
67
|
-
return /* @__PURE__ */ u(
|
|
58
|
+
return /* @__PURE__ */ u(k, { variant: "secondary", className: "flex items-center gap-1 px-3 py-1 bg-blue-50 text-blue-700 border border-blue-200 hover:bg-blue-100", children: [
|
|
68
59
|
b,
|
|
69
60
|
": ",
|
|
70
61
|
x,
|
|
@@ -75,119 +66,119 @@ function se({ filters: c, onRemoveFilter: l, onClearAll: s, filterLabels: i = {}
|
|
|
75
66
|
l(h);
|
|
76
67
|
},
|
|
77
68
|
className: "ml-1 hover:bg-blue-200 rounded-full p-0.5",
|
|
78
|
-
children: /* @__PURE__ */ r(
|
|
69
|
+
children: /* @__PURE__ */ r(P, { className: "size-4" })
|
|
79
70
|
}
|
|
80
71
|
)
|
|
81
72
|
] }, h);
|
|
82
73
|
}),
|
|
83
|
-
|
|
74
|
+
c.length > 0 && /* @__PURE__ */ r("button", { onClick: s, className: "text-xs text-red-500 hover:text-red-600 transition-colors font-medium ml-2", children: "Effacer tout" })
|
|
84
75
|
] });
|
|
85
76
|
}
|
|
86
|
-
const
|
|
87
|
-
field:
|
|
77
|
+
const ae = ({
|
|
78
|
+
field: n,
|
|
88
79
|
value: l,
|
|
89
80
|
onChange: s,
|
|
90
81
|
onToggleMultiSelect: i
|
|
91
82
|
}) => {
|
|
92
83
|
var d;
|
|
93
|
-
switch (
|
|
84
|
+
switch (n.type) {
|
|
94
85
|
case "text":
|
|
95
86
|
return /* @__PURE__ */ r(
|
|
96
|
-
|
|
87
|
+
C,
|
|
97
88
|
{
|
|
98
|
-
placeholder:
|
|
89
|
+
placeholder: n.placeholder,
|
|
99
90
|
value: l ?? "",
|
|
100
|
-
onChange: (
|
|
101
|
-
s(
|
|
91
|
+
onChange: (c) => {
|
|
92
|
+
s(c.target.value);
|
|
102
93
|
}
|
|
103
94
|
}
|
|
104
95
|
);
|
|
105
96
|
case "number":
|
|
106
97
|
return /* @__PURE__ */ r(
|
|
107
|
-
|
|
98
|
+
C,
|
|
108
99
|
{
|
|
109
100
|
type: "number",
|
|
110
|
-
placeholder:
|
|
101
|
+
placeholder: n.placeholder,
|
|
111
102
|
value: l ?? "",
|
|
112
|
-
onChange: (
|
|
113
|
-
s(
|
|
103
|
+
onChange: (c) => {
|
|
104
|
+
s(c.target.value);
|
|
114
105
|
},
|
|
115
|
-
min:
|
|
116
|
-
max:
|
|
106
|
+
min: n.min,
|
|
107
|
+
max: n.max
|
|
117
108
|
}
|
|
118
109
|
);
|
|
119
110
|
case "select":
|
|
120
|
-
return
|
|
111
|
+
return n.searchable === !0 ? /* @__PURE__ */ r(
|
|
121
112
|
O,
|
|
122
113
|
{
|
|
123
|
-
options:
|
|
114
|
+
options: n.options ?? [],
|
|
124
115
|
value: l,
|
|
125
116
|
onChange: s,
|
|
126
|
-
placeholder:
|
|
127
|
-
searchPlaceholder:
|
|
117
|
+
placeholder: n.placeholder,
|
|
118
|
+
searchPlaceholder: n.searchPlaceholder
|
|
128
119
|
}
|
|
129
|
-
) : /* @__PURE__ */ u(
|
|
130
|
-
/* @__PURE__ */ r(
|
|
131
|
-
/* @__PURE__ */ r(
|
|
120
|
+
) : /* @__PURE__ */ u(W, { value: l ?? "", onValueChange: s, children: [
|
|
121
|
+
/* @__PURE__ */ r(Y, { className: re((l === void 0 || l === "") && "text-muted-foreground"), children: /* @__PURE__ */ r(Z, { placeholder: n.placeholder }) }),
|
|
122
|
+
/* @__PURE__ */ r(q, { children: (d = n.options) == null ? void 0 : d.map((c) => /* @__PURE__ */ r(ee, { value: c.value, children: c.label }, c.value)) })
|
|
132
123
|
] });
|
|
133
124
|
case "date":
|
|
134
|
-
return /* @__PURE__ */ r(
|
|
125
|
+
return /* @__PURE__ */ r(M, { date: l, onDateChange: s, placeholder: n.placeholder ?? "Sélectionner une date" });
|
|
135
126
|
case "date-range":
|
|
136
|
-
return /* @__PURE__ */ r(
|
|
127
|
+
return /* @__PURE__ */ r($, { value: l, onChange: s, placeholder: n.placeholder });
|
|
137
128
|
case "multi-select":
|
|
138
129
|
return /* @__PURE__ */ r(
|
|
139
|
-
|
|
130
|
+
te,
|
|
140
131
|
{
|
|
141
|
-
options:
|
|
132
|
+
options: n.options ?? [],
|
|
142
133
|
selected: l ?? [],
|
|
143
134
|
onToggle: i,
|
|
144
135
|
onClear: () => {
|
|
145
136
|
s([]);
|
|
146
137
|
},
|
|
147
138
|
onSelectAll: s,
|
|
148
|
-
placeholder:
|
|
149
|
-
searchable:
|
|
150
|
-
searchPlaceholder:
|
|
139
|
+
placeholder: n.placeholder,
|
|
140
|
+
searchable: n.searchable,
|
|
141
|
+
searchPlaceholder: n.searchPlaceholder
|
|
151
142
|
}
|
|
152
143
|
);
|
|
153
144
|
default:
|
|
154
145
|
return null;
|
|
155
146
|
}
|
|
156
147
|
};
|
|
157
|
-
function
|
|
158
|
-
sections:
|
|
148
|
+
function se({
|
|
149
|
+
sections: n,
|
|
159
150
|
filters: l,
|
|
160
151
|
onFiltersChange: s,
|
|
161
152
|
buttonText: i = "Plus de filtres",
|
|
162
153
|
sheetTitle: d = "Filtres avancés"
|
|
163
154
|
}) {
|
|
164
|
-
const [
|
|
155
|
+
const [c, h] = w(!1), [m, b] = w(l);
|
|
165
156
|
D(() => {
|
|
166
157
|
b(l);
|
|
167
|
-
}, [l,
|
|
158
|
+
}, [l, c]);
|
|
168
159
|
const x = (f, t) => {
|
|
169
160
|
b((e) => ({ ...e, [f]: t }));
|
|
170
|
-
},
|
|
161
|
+
}, y = (f, t) => {
|
|
171
162
|
const e = m[f], a = Array.isArray(e) ? e : [], o = a.includes(t) ? a.filter((g) => g !== t) : [...a, t];
|
|
172
163
|
x(f, o);
|
|
173
164
|
}, p = () => {
|
|
174
165
|
s(m), h(!1);
|
|
175
|
-
},
|
|
166
|
+
}, v = () => {
|
|
176
167
|
b({}), s({}), h(!1);
|
|
177
168
|
};
|
|
178
|
-
return /* @__PURE__ */ u(
|
|
179
|
-
/* @__PURE__ */ r(
|
|
180
|
-
/* @__PURE__ */ r(
|
|
169
|
+
return /* @__PURE__ */ u(j, { open: c, onOpenChange: h, children: [
|
|
170
|
+
/* @__PURE__ */ r(R, { asChild: !0, children: /* @__PURE__ */ u(F, { variant: "outline", className: "gap-2", children: [
|
|
171
|
+
/* @__PURE__ */ r(J, { className: "size-4 shrink-0" }),
|
|
181
172
|
i
|
|
182
173
|
] }) }),
|
|
183
174
|
/* @__PURE__ */ u(z, { side: "right", className: "w-[400px] sm:w-[500px] flex flex-col p-0", children: [
|
|
184
|
-
/* @__PURE__ */ r(
|
|
185
|
-
/* @__PURE__ */ r("div", { className: "flex-1 overflow-y-auto p-6 pt-6", children: /* @__PURE__ */ r("div", { className: "space-y-6", children:
|
|
175
|
+
/* @__PURE__ */ r(B, { className: "p-6 pb-0", children: /* @__PURE__ */ r(Q, { children: d }) }),
|
|
176
|
+
/* @__PURE__ */ r("div", { className: "flex-1 overflow-y-auto p-6 pt-6", children: /* @__PURE__ */ r("div", { className: "space-y-6", children: n.map((f, t) => /* @__PURE__ */ u("div", { className: "space-y-4", children: [
|
|
186
177
|
/* @__PURE__ */ r("h3", { className: "font-semibold text-sm text-gray-900 dark:text-gray-100 border-b pb-2", children: f.title }),
|
|
187
178
|
f.filters.map((e) => /* @__PURE__ */ u("div", { className: "space-y-2", children: [
|
|
188
|
-
/* @__PURE__ */ r(
|
|
179
|
+
/* @__PURE__ */ r(V, { htmlFor: e.key, children: e.label }),
|
|
189
180
|
/* @__PURE__ */ r(
|
|
190
|
-
|
|
181
|
+
ae,
|
|
191
182
|
{
|
|
192
183
|
field: e,
|
|
193
184
|
value: m[e.key],
|
|
@@ -195,68 +186,68 @@ function ne({
|
|
|
195
186
|
x(e.key, a);
|
|
196
187
|
},
|
|
197
188
|
onToggleMultiSelect: (a) => {
|
|
198
|
-
|
|
189
|
+
y(e.key, a);
|
|
199
190
|
}
|
|
200
191
|
}
|
|
201
192
|
)
|
|
202
193
|
] }, e.key))
|
|
203
194
|
] }, t)) }) }),
|
|
204
|
-
/* @__PURE__ */ u(
|
|
205
|
-
/* @__PURE__ */ r(F, { variant: "outline", className: "flex-1", onClick:
|
|
195
|
+
/* @__PURE__ */ u(_, { className: "gap-2 p-6 border-t bg-white dark:bg-gray-950", children: [
|
|
196
|
+
/* @__PURE__ */ r(F, { variant: "outline", className: "flex-1", onClick: v, children: "Effacer les filtres" }),
|
|
206
197
|
/* @__PURE__ */ r(F, { className: "flex-1 bg-orange-500 hover:bg-orange-600 text-white", onClick: p, children: "Rechercher" })
|
|
207
198
|
] })
|
|
208
199
|
] })
|
|
209
200
|
] });
|
|
210
201
|
}
|
|
211
|
-
function
|
|
212
|
-
label:
|
|
202
|
+
function ne({
|
|
203
|
+
label: n,
|
|
213
204
|
options: l,
|
|
214
205
|
selected: s,
|
|
215
206
|
onToggle: i,
|
|
216
207
|
onClear: d,
|
|
217
|
-
onSelectAll:
|
|
208
|
+
onSelectAll: c,
|
|
218
209
|
searchable: h = !1,
|
|
219
210
|
searchPlaceholder: m = "Rechercher..."
|
|
220
211
|
}) {
|
|
221
|
-
const [b, x] = w(""),
|
|
222
|
-
if (
|
|
223
|
-
if (
|
|
212
|
+
const [b, x] = w(""), y = s.length > 0, p = N(() => b === "" ? l : l.filter((t) => t.label.toLowerCase().includes(b.toLowerCase())), [l, b]), v = N(() => p.length === 0 ? !1 : p.every((t) => s.includes(t.value)), [p, s]), f = () => {
|
|
213
|
+
if (v)
|
|
214
|
+
if (c !== void 0) {
|
|
224
215
|
const t = p.map((a) => a.value), e = s.filter((a) => !t.includes(a));
|
|
225
|
-
|
|
216
|
+
c(e);
|
|
226
217
|
} else d !== void 0 ? d() : s.forEach((t) => {
|
|
227
218
|
i(t);
|
|
228
219
|
});
|
|
229
|
-
else if (
|
|
220
|
+
else if (c !== void 0) {
|
|
230
221
|
const t = [...s];
|
|
231
222
|
p.forEach((e) => {
|
|
232
223
|
t.includes(e.value) || t.push(e.value);
|
|
233
|
-
}),
|
|
224
|
+
}), c(t);
|
|
234
225
|
} else
|
|
235
226
|
p.forEach((t) => {
|
|
236
227
|
s.includes(t.value) || i(t.value);
|
|
237
228
|
});
|
|
238
229
|
};
|
|
239
230
|
return /* @__PURE__ */ u(
|
|
240
|
-
|
|
231
|
+
X,
|
|
241
232
|
{
|
|
242
233
|
onOpenChange: () => {
|
|
243
234
|
x("");
|
|
244
235
|
},
|
|
245
236
|
children: [
|
|
246
|
-
/* @__PURE__ */ r(
|
|
237
|
+
/* @__PURE__ */ r(G, { asChild: !0, children: /* @__PURE__ */ u(
|
|
247
238
|
"button",
|
|
248
239
|
{
|
|
249
|
-
className: `inline-flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-sm transition-colors whitespace-nowrap ${
|
|
240
|
+
className: `inline-flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-sm transition-colors whitespace-nowrap ${y ? "border-primary bg-primary/10 text-primary font-medium" : "border-border bg-card text-card-foreground hover:bg-muted"}`,
|
|
250
241
|
children: [
|
|
251
|
-
|
|
242
|
+
n,
|
|
252
243
|
s.length > 0 && /* @__PURE__ */ r("span", { className: "flex h-4 min-w-[16px] items-center justify-center rounded-full bg-primary px-1 text-[10px] font-bold text-primary-foreground", children: s.length }),
|
|
253
|
-
/* @__PURE__ */ r(
|
|
244
|
+
/* @__PURE__ */ r(K, { className: "size-3.5 opacity-60" })
|
|
254
245
|
]
|
|
255
246
|
}
|
|
256
247
|
) }),
|
|
257
|
-
/* @__PURE__ */ u(
|
|
248
|
+
/* @__PURE__ */ u(H, { className: "w-56 p-0", align: "start", children: [
|
|
258
249
|
h ? /* @__PURE__ */ r("div", { className: "border-b border-border p-2", children: /* @__PURE__ */ u("div", { className: "relative", children: [
|
|
259
|
-
/* @__PURE__ */ r(
|
|
250
|
+
/* @__PURE__ */ r(U, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
|
|
260
251
|
/* @__PURE__ */ r(
|
|
261
252
|
"input",
|
|
262
253
|
{
|
|
@@ -272,13 +263,13 @@ function oe({
|
|
|
272
263
|
] }) }) : null,
|
|
273
264
|
/* @__PURE__ */ u("div", { className: "flex flex-col gap-0.5 max-h-56 overflow-y-auto p-1.5", children: [
|
|
274
265
|
p.length > 0 && /* @__PURE__ */ u("label", { className: "flex items-center gap-2.5 rounded-md px-2 py-2 text-sm hover:bg-muted cursor-pointer transition-colors", children: [
|
|
275
|
-
/* @__PURE__ */ r(
|
|
266
|
+
/* @__PURE__ */ r(E, { checked: v, onCheckedChange: f }),
|
|
276
267
|
"Tout sélectionner"
|
|
277
268
|
] }),
|
|
278
269
|
p.length === 0 && /* @__PURE__ */ r("p", { className: "px-2 py-3 text-center text-xs text-muted-foreground", children: "Aucun résultat" }),
|
|
279
270
|
p.map((t) => /* @__PURE__ */ u("label", { className: "flex items-center gap-2.5 rounded-md px-2 py-2 text-sm hover:bg-muted cursor-pointer transition-colors", children: [
|
|
280
271
|
/* @__PURE__ */ r(
|
|
281
|
-
|
|
272
|
+
E,
|
|
282
273
|
{
|
|
283
274
|
checked: s.includes(t.value),
|
|
284
275
|
onCheckedChange: () => {
|
|
@@ -306,13 +297,13 @@ function oe({
|
|
|
306
297
|
}
|
|
307
298
|
);
|
|
308
299
|
}
|
|
309
|
-
function
|
|
310
|
-
searchQuery:
|
|
300
|
+
function Fe({
|
|
301
|
+
searchQuery: n,
|
|
311
302
|
onSearchChange: l,
|
|
312
303
|
searchPlaceholder: s = "Rechercher...",
|
|
313
304
|
filters: i,
|
|
314
305
|
onFiltersChange: d,
|
|
315
|
-
sections:
|
|
306
|
+
sections: c,
|
|
316
307
|
advancedButtonText: h = "Filtres",
|
|
317
308
|
sheetTitle: m = "Filtres avancés"
|
|
318
309
|
}) {
|
|
@@ -322,14 +313,14 @@ function Ne({
|
|
|
322
313
|
}, x = (e) => {
|
|
323
314
|
const a = { ...i };
|
|
324
315
|
delete a[e], d(a);
|
|
325
|
-
},
|
|
316
|
+
}, y = () => {
|
|
326
317
|
d({});
|
|
327
318
|
}, p = (e, a) => {
|
|
328
319
|
const o = { ...i }, g = o[e];
|
|
329
320
|
Array.isArray(g) && a !== void 0 ? (o[e] = g.filter((A) => A !== a), Array.isArray(o[e]) && o[e].length === 0 && delete o[e]) : delete o[e], d(o);
|
|
330
|
-
},
|
|
321
|
+
}, v = N(() => {
|
|
331
322
|
const e = [];
|
|
332
|
-
return
|
|
323
|
+
return c.forEach((a) => {
|
|
333
324
|
a.filters.forEach((o) => {
|
|
334
325
|
o.isQuickFilter === !0 && e.push({
|
|
335
326
|
key: o.key,
|
|
@@ -340,29 +331,29 @@ function Ne({
|
|
|
340
331
|
});
|
|
341
332
|
});
|
|
342
333
|
}), e;
|
|
343
|
-
}, [
|
|
334
|
+
}, [c]), f = N(() => {
|
|
344
335
|
const e = {};
|
|
345
|
-
return
|
|
336
|
+
return c.forEach((a) => {
|
|
346
337
|
a.filters.forEach((o) => {
|
|
347
338
|
e[o.key] = o.badgeLabel ?? o.label;
|
|
348
339
|
});
|
|
349
340
|
}), e;
|
|
350
|
-
}, [
|
|
341
|
+
}, [c]), t = N(() => {
|
|
351
342
|
const e = {};
|
|
352
|
-
return
|
|
343
|
+
return c.forEach((a) => {
|
|
353
344
|
a.filters.forEach((o) => {
|
|
354
345
|
o.options !== void 0 && o.options.forEach((g) => {
|
|
355
346
|
e[`${o.key}_${g.value}`] = g.label;
|
|
356
347
|
});
|
|
357
348
|
});
|
|
358
349
|
}), e;
|
|
359
|
-
}, [
|
|
350
|
+
}, [c]);
|
|
360
351
|
return /* @__PURE__ */ u("div", { className: "space-y-4 w-full", children: [
|
|
361
352
|
/* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-3 justify-between", children: /* @__PURE__ */ u("div", { className: "flex flex-wrap items-center gap-3", children: [
|
|
362
353
|
l !== void 0 ? /* @__PURE__ */ r(
|
|
363
|
-
|
|
354
|
+
I,
|
|
364
355
|
{
|
|
365
|
-
searchQuery:
|
|
356
|
+
searchQuery: n,
|
|
366
357
|
onSearch: l,
|
|
367
358
|
onClear: () => {
|
|
368
359
|
l("");
|
|
@@ -370,8 +361,8 @@ function Ne({
|
|
|
370
361
|
placeholder: s
|
|
371
362
|
}
|
|
372
363
|
) : null,
|
|
373
|
-
|
|
374
|
-
|
|
364
|
+
v.map((e) => /* @__PURE__ */ r(
|
|
365
|
+
ne,
|
|
375
366
|
{
|
|
376
367
|
label: e.label,
|
|
377
368
|
options: e.options,
|
|
@@ -390,14 +381,14 @@ function Ne({
|
|
|
390
381
|
},
|
|
391
382
|
e.key
|
|
392
383
|
)),
|
|
393
|
-
|
|
384
|
+
c.length > 0 && /* @__PURE__ */ r(se, { sections: c, filters: i, onFiltersChange: d, buttonText: h, sheetTitle: m })
|
|
394
385
|
] }) }),
|
|
395
386
|
/* @__PURE__ */ r(
|
|
396
|
-
|
|
387
|
+
le,
|
|
397
388
|
{
|
|
398
389
|
filters: i,
|
|
399
390
|
onRemoveFilter: p,
|
|
400
|
-
onClearAll:
|
|
391
|
+
onClearAll: y,
|
|
401
392
|
filterLabels: f,
|
|
402
393
|
optionLabels: t
|
|
403
394
|
}
|
|
@@ -405,9 +396,9 @@ function Ne({
|
|
|
405
396
|
] });
|
|
406
397
|
}
|
|
407
398
|
export {
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
399
|
+
le as A,
|
|
400
|
+
ae as F,
|
|
401
|
+
ne as S,
|
|
402
|
+
Fe as T,
|
|
403
|
+
se as a
|
|
413
404
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as a, jsxs as s } from "react/jsx-runtime";
|
|
2
|
-
import { b as m, T as h, c as u, B as g, a as f } from "./tooltip-
|
|
3
|
-
import { S as v, h as b, i as N, a as S, c as x } from "./select-
|
|
2
|
+
import { b as m, T as h, c as u, B as g, a as f } from "./tooltip-BWyFpIxo.js";
|
|
3
|
+
import { S as v, h as b, i as N, a as S, c as x } from "./select-MWzbMBAS.js";
|
|
4
4
|
import { u as C } from "./useTheme-B0Bxda3I.js";
|
|
5
5
|
function I({ themeOptions: r, variant: i = "select" }) {
|
|
6
6
|
const { theme: n, handleThemeChange: t, currentThemeOption: e, nextThemeOption: c, cycleTheme: o } = C(r);
|