@krosoft/react 0.0.303 → 0.0.305
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/{GenericForm-CwbtZNXB.js → GenericForm-DBLeKiPm.js} +1 -1
- package/dist/{MultiSelect-DmdYovWw.js → MultiSelect-0iYNlt_e.js} +62 -53
- package/dist/{SearchInput-KWshEFFU.js → SearchInput-sg_-w8UW.js} +115 -111
- package/dist/components/core/dialogs/index.js +1 -1
- package/dist/components/core/filters/index.js +2 -2
- package/dist/components/core/forms/index.js +1 -1
- package/dist/components/core/index.js +5 -5
- package/dist/components/core/inputs/MultiSelect.d.ts +2 -0
- package/dist/components/core/inputs/MultiSelect.d.ts.map +1 -1
- package/dist/components/core/inputs/SingleSelect.d.ts +2 -0
- package/dist/components/core/inputs/SingleSelect.d.ts.map +1 -1
- package/dist/components/core/inputs/index.js +3 -3
- package/dist/components/core/inputs/select.helper.d.ts +7 -0
- package/dist/components/core/inputs/select.helper.d.ts.map +1 -0
- package/dist/components/index.js +5 -5
- package/dist/{dialogs-pgWKP4su.js → dialogs-BwObbaoM.js} +1 -1
- package/dist/{inputs-DrA-HJOt.js → inputs-Cxz5kfwF.js} +2 -2
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ import { i as h, l as g, n as ee, t as _, u as v } from "./select-KWMg2_7Z.js";
|
|
|
8
8
|
import { n as y } from "./useToast-UeDRLovh.js";
|
|
9
9
|
import { t as b } from "./ImageInput-B6NH8JDS.js";
|
|
10
10
|
import { t as x } from "./AppSubTitle-DJQjeSdC.js";
|
|
11
|
-
import { t as S } from "./MultiSelect-
|
|
11
|
+
import { t as S } from "./MultiSelect-0iYNlt_e.js";
|
|
12
12
|
import { useEffect as C, useRef as w, useState as T } from "react";
|
|
13
13
|
import { jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
14
14
|
import { useForm as O } from "react-hook-form";
|
|
@@ -7,94 +7,102 @@ import { useMemo as l, useState as u } from "react";
|
|
|
7
7
|
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
8
8
|
import { ChevronDownIcon as p, SearchIcon as m, XIcon as h } from "lucide-react";
|
|
9
9
|
import { Command as g } from "cmdk";
|
|
10
|
-
//#region src/components/core/inputs/
|
|
11
|
-
var _ = (
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
//#region src/components/core/inputs/select.helper.tsx
|
|
11
|
+
var _ = (t, n) => t === void 0 ? null : t ? /* @__PURE__ */ d("img", {
|
|
12
|
+
src: t,
|
|
13
|
+
alt: "",
|
|
14
|
+
loading: "lazy",
|
|
15
|
+
className: e("h-9 w-12 shrink-0 rounded object-cover", n)
|
|
16
|
+
}) : /* @__PURE__ */ d("span", {
|
|
17
|
+
className: e("flex h-9 w-12 shrink-0 items-center justify-center rounded bg-muted text-[9px] text-muted-foreground", n),
|
|
18
|
+
children: "—"
|
|
19
|
+
}), v = ({ options: v, selected: y, onToggle: b, onClear: x, onSelectAll: S, variant: C = "input", placeholder: w, labelKey: T, searchable: E = !1, searchPlaceholder: D, disabled: O = !1, maxCount: k, className: A, ...j }) => {
|
|
20
|
+
let { t: M } = t(), [N, P] = u(""), [F, I] = u(!1), L = C === "pill", R = C === "input" ? void 0 : i, z = l(() => N === "" ? v : v.filter((e) => e.label.toLowerCase().includes(N.toLowerCase())), [v, N]), B = l(() => z.filter((e) => e.disabled !== !0).map((e) => e.value), [z]), V = l(() => y.filter((e) => v.find((t) => t.value === e)?.disabled === !0), [v, y]), H = l(() => B.length !== 0 && B.every((e) => y.includes(e)), [B, y]), U = l(() => y.map((e) => v.find((t) => t.value === e)?.label ?? e), [v, y]), W = k !== void 0 && k > 0 ? U.slice(0, k) : U, G = U.length - W.length, K = (e) => {
|
|
21
|
+
I(e), e || P("");
|
|
20
22
|
}, q = () => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}) : x
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
V.length > 0 ? S === void 0 ? y.filter((e) => !V.includes(e)).forEach((e) => {
|
|
24
|
+
b(e);
|
|
25
|
+
}) : S(V) : x === void 0 ? S === void 0 ? y.forEach((e) => {
|
|
26
|
+
b(e);
|
|
27
|
+
}) : S([]) : x();
|
|
28
|
+
}, J = () => {
|
|
29
|
+
if (H) S === void 0 ? x !== void 0 && y.every((e) => B.includes(e)) ? x() : B.forEach((e) => {
|
|
30
|
+
b(e);
|
|
31
|
+
}) : S(y.filter((e) => !B.includes(e)));
|
|
32
|
+
else if (S !== void 0) {
|
|
33
|
+
let e = [...y];
|
|
34
|
+
B.forEach((t) => {
|
|
27
35
|
e.includes(t) || e.push(t);
|
|
28
|
-
}),
|
|
29
|
-
} else
|
|
30
|
-
|
|
36
|
+
}), S(e);
|
|
37
|
+
} else B.forEach((e) => {
|
|
38
|
+
y.includes(e) || b(e);
|
|
31
39
|
});
|
|
32
|
-
},
|
|
33
|
-
...
|
|
40
|
+
}, Y = L ? /* @__PURE__ */ f("button", {
|
|
41
|
+
...j,
|
|
34
42
|
type: "button",
|
|
35
|
-
disabled:
|
|
36
|
-
className: e(r, "inline-flex items-center justify-between gap-1.5 whitespace-nowrap transition-colors",
|
|
43
|
+
disabled: O,
|
|
44
|
+
className: e(r, "inline-flex items-center justify-between gap-1.5 whitespace-nowrap transition-colors", y.length > 0 ? "border-primary bg-primary/10 text-primary font-medium" : "hover:bg-muted", R, A),
|
|
37
45
|
children: [/* @__PURE__ */ d("span", {
|
|
38
46
|
className: "truncate",
|
|
39
|
-
children:
|
|
47
|
+
children: T === void 0 ? w ?? M("select.placeholder") : M(T)
|
|
40
48
|
}), /* @__PURE__ */ f("div", {
|
|
41
49
|
className: "flex shrink-0 items-center gap-1.5",
|
|
42
|
-
children: [
|
|
50
|
+
children: [y.length > 0 && /* @__PURE__ */ d("span", {
|
|
43
51
|
className: "flex h-4 min-w-[16px] items-center justify-center rounded-full bg-primary px-1 text-[10px] font-bold text-primary-foreground",
|
|
44
|
-
children:
|
|
45
|
-
}), /* @__PURE__ */ d(p, { className: e("size-3.5 opacity-60 transition-transform",
|
|
52
|
+
children: y.length
|
|
53
|
+
}), /* @__PURE__ */ d(p, { className: e("size-3.5 opacity-60 transition-transform", F && "rotate-180") })]
|
|
46
54
|
})]
|
|
47
55
|
}) : /* @__PURE__ */ f("button", {
|
|
48
|
-
...
|
|
56
|
+
...j,
|
|
49
57
|
type: "button",
|
|
50
|
-
disabled:
|
|
51
|
-
className: e(a, "w-full",
|
|
58
|
+
disabled: O,
|
|
59
|
+
className: e(a, "w-full", R, F && "ring-2 ring-ring ring-offset-2", y.length === 0 && "text-muted-foreground", A),
|
|
52
60
|
children: [/* @__PURE__ */ d("span", {
|
|
53
61
|
className: "truncate",
|
|
54
|
-
children:
|
|
62
|
+
children: y.length === 0 ? w ?? M("select.placeholder") : W.join(", ")
|
|
55
63
|
}), /* @__PURE__ */ f("div", {
|
|
56
64
|
className: "flex shrink-0 items-center gap-1",
|
|
57
65
|
children: [
|
|
58
|
-
|
|
66
|
+
G > 0 && /* @__PURE__ */ f("span", {
|
|
59
67
|
className: "rounded-control bg-muted px-1.5 py-0.5 text-xs font-medium text-foreground",
|
|
60
|
-
children: ["+",
|
|
68
|
+
children: ["+", G]
|
|
61
69
|
}),
|
|
62
|
-
|
|
70
|
+
y.length > 0 && !O && /* @__PURE__ */ d("span", {
|
|
63
71
|
role: "button",
|
|
64
72
|
tabIndex: -1,
|
|
65
73
|
onClick: (e) => {
|
|
66
74
|
e.stopPropagation();
|
|
67
75
|
},
|
|
68
76
|
onPointerDown: (e) => {
|
|
69
|
-
e.preventDefault(), e.stopPropagation(),
|
|
77
|
+
e.preventDefault(), e.stopPropagation(), q();
|
|
70
78
|
},
|
|
71
79
|
className: "text-muted-foreground hover:text-foreground",
|
|
72
80
|
children: /* @__PURE__ */ d(h, { className: "size-4" })
|
|
73
81
|
}),
|
|
74
|
-
/* @__PURE__ */ d(p, { className: e("size-4 opacity-50 shrink-0 transition-transform",
|
|
82
|
+
/* @__PURE__ */ d(p, { className: e("size-4 opacity-50 shrink-0 transition-transform", F && "rotate-180") })
|
|
75
83
|
]
|
|
76
84
|
})]
|
|
77
85
|
});
|
|
78
86
|
return /* @__PURE__ */ f(c, {
|
|
79
|
-
open:
|
|
80
|
-
onOpenChange:
|
|
87
|
+
open: F,
|
|
88
|
+
onOpenChange: K,
|
|
81
89
|
children: [/* @__PURE__ */ d(o, {
|
|
82
90
|
asChild: !0,
|
|
83
|
-
children:
|
|
91
|
+
children: Y
|
|
84
92
|
}), /* @__PURE__ */ f(s, {
|
|
85
|
-
className: e("p-0",
|
|
93
|
+
className: e("p-0", L ? "w-72 max-w-[var(--radix-popover-content-available-width)]" : "w-[var(--radix-popover-trigger-width)]"),
|
|
86
94
|
align: "start",
|
|
87
95
|
children: [/* @__PURE__ */ f(g, {
|
|
88
96
|
shouldFilter: !1,
|
|
89
97
|
className: "flex flex-col",
|
|
90
|
-
children: [
|
|
98
|
+
children: [E ? /* @__PURE__ */ d("div", {
|
|
91
99
|
className: "border-b border-border p-2",
|
|
92
100
|
children: /* @__PURE__ */ f("div", {
|
|
93
101
|
className: "relative",
|
|
94
102
|
children: [/* @__PURE__ */ d(m, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }), /* @__PURE__ */ d(g.Input, {
|
|
95
|
-
value:
|
|
96
|
-
onValueChange:
|
|
97
|
-
placeholder:
|
|
103
|
+
value: N,
|
|
104
|
+
onValueChange: P,
|
|
105
|
+
placeholder: D ?? M("search.placeholder"),
|
|
98
106
|
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",
|
|
99
107
|
autoFocus: !0
|
|
100
108
|
})]
|
|
@@ -105,21 +113,22 @@ var _ = ({ options: _, selected: v, onToggle: y, onClear: b, onSelectAll: x, var
|
|
|
105
113
|
className: "sr-only"
|
|
106
114
|
}), /* @__PURE__ */ f(g.List, {
|
|
107
115
|
className: "flex flex-col gap-0.5 max-h-56 overflow-y-auto overflow-x-hidden 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",
|
|
108
|
-
children: [
|
|
116
|
+
children: [z.length === 0 && /* @__PURE__ */ d("p", {
|
|
109
117
|
className: "px-2 py-3 text-center text-xs text-muted-foreground",
|
|
110
|
-
children:
|
|
111
|
-
}),
|
|
118
|
+
children: M("states.noResult")
|
|
119
|
+
}), z.map((e) => /* @__PURE__ */ f(g.Item, {
|
|
112
120
|
value: e.value,
|
|
113
121
|
disabled: e.disabled,
|
|
114
122
|
onSelect: () => {
|
|
115
|
-
|
|
123
|
+
b(e.value);
|
|
116
124
|
},
|
|
117
125
|
className: "flex min-w-0 items-center gap-2.5 rounded-md px-2 py-2 text-sm cursor-pointer transition-colors data-[selected=true]:bg-muted data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50",
|
|
118
126
|
children: [
|
|
119
127
|
/* @__PURE__ */ d("span", {
|
|
120
128
|
className: "pointer-events-none shrink-0",
|
|
121
|
-
children: /* @__PURE__ */ d(n, { checked:
|
|
129
|
+
children: /* @__PURE__ */ d(n, { checked: y.includes(e.value) })
|
|
122
130
|
}),
|
|
131
|
+
_(e.imageUrl),
|
|
123
132
|
e.color && /* @__PURE__ */ d("span", {
|
|
124
133
|
className: "size-2.5 shrink-0 rounded-full",
|
|
125
134
|
style: { backgroundColor: e.color }
|
|
@@ -132,17 +141,17 @@ var _ = ({ options: _, selected: v, onToggle: y, onClear: b, onSelectAll: x, var
|
|
|
132
141
|
]
|
|
133
142
|
}, e.value))]
|
|
134
143
|
})]
|
|
135
|
-
}),
|
|
144
|
+
}), B.length > 0 && /* @__PURE__ */ d("div", {
|
|
136
145
|
className: "border-t border-border p-1.5",
|
|
137
146
|
children: /* @__PURE__ */ d("button", {
|
|
138
147
|
type: "button",
|
|
139
|
-
onClick:
|
|
148
|
+
onClick: J,
|
|
140
149
|
className: "w-full rounded-md px-2 py-1.5 text-xs text-muted-foreground hover:text-foreground hover:bg-muted transition-colors text-center",
|
|
141
|
-
children:
|
|
150
|
+
children: M(H ? "filters.deselectAll" : "filters.selectAll")
|
|
142
151
|
})
|
|
143
152
|
})]
|
|
144
153
|
})]
|
|
145
154
|
});
|
|
146
155
|
};
|
|
147
156
|
//#endregion
|
|
148
|
-
export { _ as t };
|
|
157
|
+
export { _ as n, v as t };
|
|
@@ -4,16 +4,17 @@ import { En as r } from "./ui-BdLutnCT.js";
|
|
|
4
4
|
import { c as i, o as a, s as o } from "./tooltip-_geGvbS7.js";
|
|
5
5
|
import { g as s, h as c, m as l, p as u } from "./sheet-C2vx5V6Q.js";
|
|
6
6
|
import { i as d, l as f, n as p, t as m, u as h } from "./select-KWMg2_7Z.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
7
|
+
import { n as g } from "./MultiSelect-0iYNlt_e.js";
|
|
8
|
+
import * as _ from "react";
|
|
9
|
+
import { useEffect as v, useMemo as y, useRef as b, useState as x } from "react";
|
|
10
|
+
import { jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
11
|
+
import { CalendarIcon as w, CheckIcon as T, ChevronDownIcon as E, PlusIcon as D, SearchIcon as O, XIcon as k } from "lucide-react";
|
|
12
|
+
import { Command as A } from "cmdk";
|
|
13
|
+
import { format as j } from "date-fns";
|
|
13
14
|
//#region src/components/core/inputs/DatePicker.tsx
|
|
14
|
-
var
|
|
15
|
-
let s = t(), [c, l] =
|
|
16
|
-
return
|
|
15
|
+
var M = ({ date: n, onDateChange: a, placeholder: o }) => {
|
|
16
|
+
let s = t(), [c, l] = x(!1), u = b(null);
|
|
17
|
+
return v(() => {
|
|
17
18
|
if (!c) return;
|
|
18
19
|
let e = (e) => {
|
|
19
20
|
u.current !== null && !u.current.contains(e.target) && l(!1);
|
|
@@ -21,20 +22,20 @@ var j = ({ date: n, onDateChange: a, placeholder: o }) => {
|
|
|
21
22
|
return document.addEventListener("mousedown", e), () => {
|
|
22
23
|
document.removeEventListener("mousedown", e);
|
|
23
24
|
};
|
|
24
|
-
}, [c]), /* @__PURE__ */
|
|
25
|
+
}, [c]), /* @__PURE__ */ C("div", {
|
|
25
26
|
ref: u,
|
|
26
27
|
className: "relative w-full",
|
|
27
|
-
children: [/* @__PURE__ */
|
|
28
|
+
children: [/* @__PURE__ */ C(i, {
|
|
28
29
|
variant: "outline",
|
|
29
30
|
type: "button",
|
|
30
31
|
onClick: () => {
|
|
31
32
|
l((e) => !e);
|
|
32
33
|
},
|
|
33
34
|
className: e("w-full justify-start text-left font-normal focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", c && "ring-2 ring-ring ring-offset-2", n === void 0 && "text-muted-foreground"),
|
|
34
|
-
children: [/* @__PURE__ */
|
|
35
|
-
}), c ? /* @__PURE__ */
|
|
35
|
+
children: [/* @__PURE__ */ S(w, { className: "mr-2 size-4 shrink-0" }), n === void 0 ? /* @__PURE__ */ S("span", { children: o }) : j(n, "dd/MM/yyyy", { locale: s })]
|
|
36
|
+
}), c ? /* @__PURE__ */ S("div", {
|
|
36
37
|
className: "absolute left-0 top-[calc(100%+4px)] z-[100] rounded-surface border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",
|
|
37
|
-
children: /* @__PURE__ */
|
|
38
|
+
children: /* @__PURE__ */ S(r, {
|
|
38
39
|
mode: "single",
|
|
39
40
|
locale: s,
|
|
40
41
|
defaultMonth: n,
|
|
@@ -45,28 +46,28 @@ var j = ({ date: n, onDateChange: a, placeholder: o }) => {
|
|
|
45
46
|
})
|
|
46
47
|
}) : null]
|
|
47
48
|
});
|
|
48
|
-
},
|
|
49
|
+
}, N = (e) => e ? {
|
|
49
50
|
from: e.from,
|
|
50
51
|
to: e.to
|
|
51
|
-
} : void 0,
|
|
52
|
-
let { t: f } = n(), p = t(), [m, h] =
|
|
53
|
-
return
|
|
54
|
-
m && v(
|
|
55
|
-
}, [m, a]), /* @__PURE__ */
|
|
52
|
+
} : void 0, P = ({ value: a, onChange: o, placeholder: s, className: d }) => {
|
|
53
|
+
let { t: f } = n(), p = t(), [m, h] = _.useState(!1), [g, v] = _.useState(N(a));
|
|
54
|
+
return _.useEffect(() => {
|
|
55
|
+
m && v(N(a));
|
|
56
|
+
}, [m, a]), /* @__PURE__ */ S("div", {
|
|
56
57
|
className: e("grid gap-2", d),
|
|
57
|
-
children: /* @__PURE__ */
|
|
58
|
+
children: /* @__PURE__ */ C(u, {
|
|
58
59
|
open: m,
|
|
59
60
|
onOpenChange: h,
|
|
60
|
-
children: [/* @__PURE__ */
|
|
61
|
+
children: [/* @__PURE__ */ S(c, {
|
|
61
62
|
asChild: !0,
|
|
62
|
-
children: /* @__PURE__ */
|
|
63
|
+
children: /* @__PURE__ */ C(i, {
|
|
63
64
|
id: "date",
|
|
64
65
|
variant: "outline",
|
|
65
66
|
className: e("w-[300px] justify-start text-left font-normal", !a?.from && "text-muted-foreground"),
|
|
66
67
|
children: [
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
((e) => e?.from ? !e.to || e.from.getTime() === e.to.getTime() ?
|
|
69
|
-
a?.from && /* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ S(w, { className: "mr-2 size-4" }),
|
|
69
|
+
((e) => e?.from ? !e.to || e.from.getTime() === e.to.getTime() ? j(e.from, "dd MMM yyyy", { locale: p }) : `${j(e.from, "dd MMM yyyy", { locale: p })} - ${j(e.to, "dd MMM yyyy", { locale: p })}` : s ?? f("date.pickPeriod"))(a),
|
|
70
|
+
a?.from && /* @__PURE__ */ S(i, {
|
|
70
71
|
type: "button",
|
|
71
72
|
variant: "ghost",
|
|
72
73
|
size: "icon",
|
|
@@ -75,46 +76,46 @@ var j = ({ date: n, onDateChange: a, placeholder: o }) => {
|
|
|
75
76
|
onClick: (e) => {
|
|
76
77
|
e.stopPropagation(), o(void 0), h(!1);
|
|
77
78
|
},
|
|
78
|
-
children: /* @__PURE__ */
|
|
79
|
+
children: /* @__PURE__ */ S(k, { className: "size-4" })
|
|
79
80
|
})
|
|
80
81
|
]
|
|
81
82
|
})
|
|
82
|
-
}), /* @__PURE__ */
|
|
83
|
+
}), /* @__PURE__ */ C(l, {
|
|
83
84
|
className: "w-auto p-0",
|
|
84
85
|
align: "start",
|
|
85
86
|
side: "bottom",
|
|
86
87
|
sideOffset: 4,
|
|
87
|
-
children: [/* @__PURE__ */
|
|
88
|
+
children: [/* @__PURE__ */ S(r, {
|
|
88
89
|
mode: "range",
|
|
89
90
|
resetOnSelect: !0,
|
|
90
|
-
defaultMonth:
|
|
91
|
-
selected:
|
|
91
|
+
defaultMonth: g?.from,
|
|
92
|
+
selected: g,
|
|
92
93
|
onSelect: v,
|
|
93
94
|
numberOfMonths: 2,
|
|
94
95
|
locale: p,
|
|
95
96
|
className: "pointer-events-auto p-3"
|
|
96
|
-
}), /* @__PURE__ */
|
|
97
|
+
}), /* @__PURE__ */ C("div", {
|
|
97
98
|
className: "flex items-center justify-between border-t border-border px-3 py-2",
|
|
98
|
-
children: [/* @__PURE__ */
|
|
99
|
+
children: [/* @__PURE__ */ S(i, {
|
|
99
100
|
variant: "ghost",
|
|
100
101
|
size: "sm",
|
|
101
102
|
onClick: () => {
|
|
102
103
|
v(void 0);
|
|
103
104
|
},
|
|
104
105
|
children: f("actions.clear")
|
|
105
|
-
}), /* @__PURE__ */
|
|
106
|
+
}), /* @__PURE__ */ C("div", {
|
|
106
107
|
className: "flex gap-2",
|
|
107
|
-
children: [/* @__PURE__ */
|
|
108
|
+
children: [/* @__PURE__ */ S(i, {
|
|
108
109
|
variant: "ghost",
|
|
109
110
|
size: "sm",
|
|
110
111
|
onClick: () => {
|
|
111
|
-
v(
|
|
112
|
+
v(N(a)), h(!1);
|
|
112
113
|
},
|
|
113
114
|
children: f("actions.cancel")
|
|
114
|
-
}), /* @__PURE__ */
|
|
115
|
+
}), /* @__PURE__ */ S(i, {
|
|
115
116
|
size: "sm",
|
|
116
117
|
onClick: () => {
|
|
117
|
-
o(
|
|
118
|
+
o(g), h(!1);
|
|
118
119
|
},
|
|
119
120
|
children: f("actions.apply")
|
|
120
121
|
})]
|
|
@@ -123,35 +124,36 @@ var j = ({ date: n, onDateChange: a, placeholder: o }) => {
|
|
|
123
124
|
})]
|
|
124
125
|
})
|
|
125
126
|
});
|
|
126
|
-
},
|
|
127
|
-
let { t:
|
|
128
|
-
|
|
127
|
+
}, F = ({ options: t = [], value: r, onChange: i, onClear: s, searchable: _ = !1, onCreate: v, placeholder: b, searchPlaceholder: w, emptyLabel: j, createLabel: M, disabled: N = !1, modal: P = !0, variant: F = "input", className: I, ...L }) => {
|
|
128
|
+
let { t: R } = n(), [z, B] = x(!1), [V, H] = x(""), U = F === "filter" ? a : void 0, W = r !== void 0 && r !== "", G = y(() => W ? t.find((e) => e.value === r) : void 0, [
|
|
129
|
+
W,
|
|
129
130
|
t,
|
|
130
131
|
r
|
|
131
|
-
]),
|
|
132
|
-
if (!
|
|
132
|
+
]), K = W ? G?.label ?? r : void 0;
|
|
133
|
+
if (!_) return /* @__PURE__ */ C(m, {
|
|
133
134
|
value: r ?? "",
|
|
134
135
|
onValueChange: i,
|
|
135
|
-
disabled:
|
|
136
|
-
children: [/* @__PURE__ */
|
|
137
|
-
...
|
|
138
|
-
className: e(!
|
|
139
|
-
onClear: s !== void 0 &&
|
|
136
|
+
disabled: N,
|
|
137
|
+
children: [/* @__PURE__ */ S(f, {
|
|
138
|
+
...L,
|
|
139
|
+
className: e(!W && "text-muted-foreground", U, I),
|
|
140
|
+
onClear: s !== void 0 && W && !N ? (e) => {
|
|
140
141
|
e.preventDefault(), e.stopPropagation(), s();
|
|
141
142
|
} : void 0,
|
|
142
|
-
children: /* @__PURE__ */
|
|
143
|
-
}), /* @__PURE__ */
|
|
143
|
+
children: /* @__PURE__ */ S(h, { placeholder: b ?? R("select.placeholder") })
|
|
144
|
+
}), /* @__PURE__ */ S(p, { children: t.map((e) => /* @__PURE__ */ S(d, {
|
|
144
145
|
value: e.value,
|
|
145
146
|
disabled: e.disabled,
|
|
146
|
-
children: /* @__PURE__ */
|
|
147
|
+
children: /* @__PURE__ */ C("span", {
|
|
147
148
|
className: "flex items-center",
|
|
148
149
|
children: [
|
|
149
|
-
e.
|
|
150
|
+
g(e.imageUrl, "mr-2"),
|
|
151
|
+
e.color !== void 0 && /* @__PURE__ */ S("span", {
|
|
150
152
|
className: "mr-2 size-2.5 shrink-0 rounded-full",
|
|
151
153
|
style: { backgroundColor: e.color }
|
|
152
154
|
}),
|
|
153
155
|
e.label,
|
|
154
|
-
e.description !== void 0 && /* @__PURE__ */
|
|
156
|
+
e.description !== void 0 && /* @__PURE__ */ C("span", {
|
|
155
157
|
className: "ml-1 text-muted-foreground",
|
|
156
158
|
children: [
|
|
157
159
|
"(",
|
|
@@ -163,49 +165,50 @@ var j = ({ date: n, onDateChange: a, placeholder: o }) => {
|
|
|
163
165
|
})
|
|
164
166
|
}, e.value)) })]
|
|
165
167
|
});
|
|
166
|
-
let
|
|
167
|
-
|
|
168
|
-
},
|
|
169
|
-
i(e),
|
|
170
|
-
},
|
|
171
|
-
|
|
168
|
+
let q = V.trim(), J = v !== void 0 && q !== "" && !t.some((e) => e.label.toLowerCase() === q.toLowerCase()), Y = (e) => {
|
|
169
|
+
B(e), e || H("");
|
|
170
|
+
}, X = (e) => {
|
|
171
|
+
i(e), Y(!1);
|
|
172
|
+
}, Z = () => {
|
|
173
|
+
v?.(q), Y(!1);
|
|
172
174
|
};
|
|
173
|
-
return /* @__PURE__ */
|
|
174
|
-
open:
|
|
175
|
-
onOpenChange:
|
|
176
|
-
modal:
|
|
177
|
-
children: [/* @__PURE__ */
|
|
175
|
+
return /* @__PURE__ */ C(u, {
|
|
176
|
+
open: z,
|
|
177
|
+
onOpenChange: Y,
|
|
178
|
+
modal: P,
|
|
179
|
+
children: [/* @__PURE__ */ S(c, {
|
|
178
180
|
asChild: !0,
|
|
179
|
-
children: /* @__PURE__ */
|
|
180
|
-
...
|
|
181
|
+
children: /* @__PURE__ */ C("button", {
|
|
182
|
+
...L,
|
|
181
183
|
type: "button",
|
|
182
184
|
role: "combobox",
|
|
183
|
-
"aria-expanded":
|
|
184
|
-
disabled:
|
|
185
|
-
className: e(o, "w-full",
|
|
186
|
-
children: [/* @__PURE__ */
|
|
187
|
-
className: "flex items-center truncate",
|
|
185
|
+
"aria-expanded": z,
|
|
186
|
+
disabled: N,
|
|
187
|
+
className: e(o, "w-full", U, "data-[state=open]:ring-2 data-[state=open]:ring-ring data-[state=open]:ring-offset-2", !W && "text-muted-foreground", I),
|
|
188
|
+
children: [/* @__PURE__ */ C("div", {
|
|
189
|
+
className: "flex min-w-0 items-center truncate",
|
|
188
190
|
children: [
|
|
189
|
-
|
|
191
|
+
g(G?.imageUrl, "mr-2 h-6 w-8"),
|
|
192
|
+
G?.color && /* @__PURE__ */ S("span", {
|
|
190
193
|
className: "mr-2 size-2.5 shrink-0 rounded-full",
|
|
191
|
-
style: { backgroundColor:
|
|
194
|
+
style: { backgroundColor: G.color }
|
|
192
195
|
}),
|
|
193
|
-
/* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ S("span", {
|
|
194
197
|
className: "truncate",
|
|
195
|
-
children:
|
|
198
|
+
children: K ?? b ?? R("select.placeholder")
|
|
196
199
|
}),
|
|
197
|
-
|
|
200
|
+
G?.description !== void 0 && /* @__PURE__ */ C("span", {
|
|
198
201
|
className: "ml-1 truncate text-muted-foreground",
|
|
199
202
|
children: [
|
|
200
203
|
"(",
|
|
201
|
-
|
|
204
|
+
G.description,
|
|
202
205
|
")"
|
|
203
206
|
]
|
|
204
207
|
})
|
|
205
208
|
]
|
|
206
|
-
}), /* @__PURE__ */
|
|
209
|
+
}), /* @__PURE__ */ C("div", {
|
|
207
210
|
className: "flex items-center gap-1",
|
|
208
|
-
children: [s &&
|
|
211
|
+
children: [s && W && !N && /* @__PURE__ */ S("span", {
|
|
209
212
|
role: "button",
|
|
210
213
|
tabIndex: -1,
|
|
211
214
|
onClick: (e) => {
|
|
@@ -215,72 +218,73 @@ var j = ({ date: n, onDateChange: a, placeholder: o }) => {
|
|
|
215
218
|
e.preventDefault(), e.stopPropagation(), s();
|
|
216
219
|
},
|
|
217
220
|
className: "text-muted-foreground hover:text-foreground",
|
|
218
|
-
children: /* @__PURE__ */
|
|
219
|
-
}), /* @__PURE__ */
|
|
221
|
+
children: /* @__PURE__ */ S(k, { className: "size-4" })
|
|
222
|
+
}), /* @__PURE__ */ S(E, { className: e("size-4 shrink-0 opacity-50 transition-transform", z && "rotate-180") })]
|
|
220
223
|
})]
|
|
221
224
|
})
|
|
222
|
-
}), /* @__PURE__ */
|
|
225
|
+
}), /* @__PURE__ */ S(l, {
|
|
223
226
|
className: "w-[var(--radix-popover-trigger-width)] p-0",
|
|
224
227
|
align: "start",
|
|
225
|
-
children: /* @__PURE__ */
|
|
228
|
+
children: /* @__PURE__ */ C(A, {
|
|
226
229
|
className: "flex flex-col",
|
|
227
230
|
filter: (e, t, n) => +!!(n ?? []).join(" ").toLowerCase().includes(t.trim().toLowerCase()),
|
|
228
|
-
children: [/* @__PURE__ */
|
|
231
|
+
children: [/* @__PURE__ */ S("div", {
|
|
229
232
|
className: "border-b border-border p-2",
|
|
230
|
-
children: /* @__PURE__ */
|
|
233
|
+
children: /* @__PURE__ */ C("div", {
|
|
231
234
|
className: "relative",
|
|
232
|
-
children: [/* @__PURE__ */
|
|
233
|
-
value:
|
|
234
|
-
onValueChange:
|
|
235
|
-
placeholder:
|
|
235
|
+
children: [/* @__PURE__ */ S(O, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }), /* @__PURE__ */ S(A.Input, {
|
|
236
|
+
value: V,
|
|
237
|
+
onValueChange: H,
|
|
238
|
+
placeholder: w ?? R("search.placeholder"),
|
|
236
239
|
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",
|
|
237
240
|
autoFocus: !0
|
|
238
241
|
})]
|
|
239
242
|
})
|
|
240
|
-
}), /* @__PURE__ */
|
|
243
|
+
}), /* @__PURE__ */ C(A.List, {
|
|
241
244
|
className: "flex flex-col gap-0.5 max-h-56 overflow-y-auto overflow-x-hidden 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",
|
|
242
245
|
children: [
|
|
243
|
-
!
|
|
246
|
+
!J && /* @__PURE__ */ S(A.Empty, {
|
|
244
247
|
className: "px-2 py-3 text-center text-xs text-muted-foreground",
|
|
245
|
-
children:
|
|
248
|
+
children: j ?? R("states.noResult")
|
|
246
249
|
}),
|
|
247
|
-
t.map((t) => /* @__PURE__ */
|
|
250
|
+
t.map((t) => /* @__PURE__ */ C(A.Item, {
|
|
248
251
|
value: t.value,
|
|
249
252
|
keywords: [t.label, t.description ?? ""],
|
|
250
253
|
disabled: t.disabled,
|
|
251
254
|
onSelect: () => {
|
|
252
|
-
|
|
255
|
+
X(t.value);
|
|
253
256
|
},
|
|
254
|
-
className: "flex min-w-0 items-center gap-2
|
|
257
|
+
className: "flex min-w-0 items-center gap-2 rounded-md px-2 py-2 text-sm cursor-pointer transition-colors data-[selected=true]:bg-muted data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50",
|
|
255
258
|
children: [
|
|
256
|
-
|
|
257
|
-
t.color && /* @__PURE__ */
|
|
259
|
+
g(t.imageUrl),
|
|
260
|
+
t.color && /* @__PURE__ */ S("span", {
|
|
258
261
|
className: "size-2.5 shrink-0 rounded-full",
|
|
259
262
|
style: { backgroundColor: t.color }
|
|
260
263
|
}),
|
|
261
|
-
/* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ S("span", {
|
|
262
265
|
className: "min-w-0 flex-1 truncate",
|
|
263
266
|
title: t.label,
|
|
264
267
|
children: t.label
|
|
265
268
|
}),
|
|
266
|
-
t.description !== void 0 && /* @__PURE__ */
|
|
269
|
+
t.description !== void 0 && /* @__PURE__ */ C("span", {
|
|
267
270
|
className: "shrink-0 truncate text-muted-foreground",
|
|
268
271
|
children: [
|
|
269
272
|
"(",
|
|
270
273
|
t.description,
|
|
271
274
|
")"
|
|
272
275
|
]
|
|
273
|
-
})
|
|
276
|
+
}),
|
|
277
|
+
/* @__PURE__ */ S(T, { className: e("ml-auto size-4 shrink-0", r === t.value ? "opacity-100" : "opacity-0") })
|
|
274
278
|
]
|
|
275
279
|
}, t.value)),
|
|
276
|
-
|
|
280
|
+
J && /* @__PURE__ */ C(A.Item, {
|
|
277
281
|
forceMount: !0,
|
|
278
282
|
value: "__create__",
|
|
279
|
-
onSelect:
|
|
283
|
+
onSelect: Z,
|
|
280
284
|
className: "flex min-w-0 items-center gap-2.5 rounded-md px-2 py-2 text-sm cursor-pointer transition-colors data-[selected=true]:bg-muted",
|
|
281
|
-
children: [/* @__PURE__ */
|
|
285
|
+
children: [/* @__PURE__ */ S(D, { className: "size-4 shrink-0" }), /* @__PURE__ */ S("span", {
|
|
282
286
|
className: "truncate",
|
|
283
|
-
children:
|
|
287
|
+
children: M ? M(q) : R("select.create", { search: q })
|
|
284
288
|
})]
|
|
285
289
|
})
|
|
286
290
|
]
|
|
@@ -288,13 +292,13 @@ var j = ({ date: n, onDateChange: a, placeholder: o }) => {
|
|
|
288
292
|
})
|
|
289
293
|
})]
|
|
290
294
|
});
|
|
291
|
-
},
|
|
295
|
+
}, I = ({ searchQuery: t, search: r, placeholder: i, onSearch: a, onSubmit: o, onClear: c, className: l }) => {
|
|
292
296
|
let { t: u } = n(), d = t ?? r ?? "";
|
|
293
|
-
return /* @__PURE__ */
|
|
297
|
+
return /* @__PURE__ */ C("div", {
|
|
294
298
|
className: e("relative h-fit w-full md:w-64", l),
|
|
295
299
|
children: [
|
|
296
|
-
/* @__PURE__ */
|
|
297
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ S(O, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground w-4 h-4" }),
|
|
301
|
+
/* @__PURE__ */ S(s, {
|
|
298
302
|
placeholder: i ?? u("search.placeholder"),
|
|
299
303
|
value: d,
|
|
300
304
|
onChange: (e) => {
|
|
@@ -305,16 +309,16 @@ var j = ({ date: n, onDateChange: a, placeholder: o }) => {
|
|
|
305
309
|
e.key === "Enter" && o !== void 0 && (e.preventDefault(), o());
|
|
306
310
|
}
|
|
307
311
|
}),
|
|
308
|
-
d === "" ? null : /* @__PURE__ */
|
|
312
|
+
d === "" ? null : /* @__PURE__ */ S("button", {
|
|
309
313
|
onClick: () => {
|
|
310
314
|
a(""), c !== void 0 && c();
|
|
311
315
|
},
|
|
312
316
|
className: "absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700",
|
|
313
317
|
type: "button",
|
|
314
|
-
children: /* @__PURE__ */
|
|
318
|
+
children: /* @__PURE__ */ S(k, { className: "size-4" })
|
|
315
319
|
})
|
|
316
320
|
]
|
|
317
321
|
});
|
|
318
322
|
};
|
|
319
323
|
//#endregion
|
|
320
|
-
export {
|
|
324
|
+
export { M as i, F as n, P as r, I as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { I as e } from "../../../ui-BdLutnCT.js";
|
|
2
2
|
import { A as t, D as n, E as r, F as i, M as a, N as o, O as s, P as c, j as l, k as u } from "../../../sheet-C2vx5V6Q.js";
|
|
3
|
-
import { n as d, r as f, t as p } from "../../../dialogs-
|
|
3
|
+
import { n as d, r as f, t as p } from "../../../dialogs-BwObbaoM.js";
|
|
4
4
|
export { f as AppDialog, p as ConfirmationDialog, r as Dialog, n as DialogClose, s as DialogContent, u as DialogDescription, t as DialogFooter, l as DialogHeader, a as DialogOverlay, o as DialogPortal, c as DialogTitle, i as DialogTrigger, d as FormDialog, e as Progress };
|
|
@@ -3,8 +3,8 @@ import { t } from "../../../i18n-Iyf3fyzr.js";
|
|
|
3
3
|
import { At as n, Pn as r } from "../../../ui-BdLutnCT.js";
|
|
4
4
|
import { c as i } from "../../../tooltip-_geGvbS7.js";
|
|
5
5
|
import { a, g as o, l as s, o as c, r as l, t as u, u as d } from "../../../sheet-C2vx5V6Q.js";
|
|
6
|
-
import { t as f } from "../../../MultiSelect-
|
|
7
|
-
import { i as p, n as m, r as h, t as g } from "../../../SearchInput-
|
|
6
|
+
import { t as f } from "../../../MultiSelect-0iYNlt_e.js";
|
|
7
|
+
import { i as p, n as m, r as h, t as g } from "../../../SearchInput-sg_-w8UW.js";
|
|
8
8
|
import { useEffect as _, useMemo as v, useState as y } from "react";
|
|
9
9
|
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
10
10
|
import { getLocale as S } from "@krosoft/core/helpers";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../../GenericForm-
|
|
1
|
+
import { t as e } from "../../../GenericForm-DBLeKiPm.js";
|
|
2
2
|
export { e as GenericForm };
|
|
@@ -3,17 +3,17 @@ import { I as o } from "../../ui-BdLutnCT.js";
|
|
|
3
3
|
import { A as s, D as c, E as l, F as u, M as d, N as f, O as p, P as m, j as h, k as g } from "../../sheet-C2vx5V6Q.js";
|
|
4
4
|
import { a as _, c as v, i as y, n as b, o as x, r as S, s as C, t as w } from "../../charts-BDlyl5wa.js";
|
|
5
5
|
import { t as T } from "../../ErrorAlert-DrjpMJu6.js";
|
|
6
|
-
import { n as E, r as D, t as O } from "../../dialogs-
|
|
6
|
+
import { n as E, r as D, t as O } from "../../dialogs-BwObbaoM.js";
|
|
7
7
|
import { t as k } from "../../ImageInput-B6NH8JDS.js";
|
|
8
8
|
import { t as A } from "../../AppActions-CvT8dDnQ.js";
|
|
9
9
|
import { t as j } from "../../AppSubTitle-DJQjeSdC.js";
|
|
10
|
-
import { t as M } from "../../MultiSelect-
|
|
11
|
-
import { t as N } from "../../GenericForm-
|
|
12
|
-
import { i as P, n as F, r as I, t as L } from "../../SearchInput-
|
|
10
|
+
import { t as M } from "../../MultiSelect-0iYNlt_e.js";
|
|
11
|
+
import { t as N } from "../../GenericForm-DBLeKiPm.js";
|
|
12
|
+
import { i as P, n as F, r as I, t as L } from "../../SearchInput-sg_-w8UW.js";
|
|
13
13
|
import { ActiveFilters as R, AdvancedFilters as z, FilterField as B, FilterPills as V, FilterPillsGroup as H, TableFilter as U } from "./filters/index.js";
|
|
14
14
|
import "./forms/index.js";
|
|
15
15
|
import { n as W, t as G } from "../../icons-n0m_1w7z.js";
|
|
16
|
-
import { t as K } from "../../inputs-
|
|
16
|
+
import { t as K } from "../../inputs-Cxz5kfwF.js";
|
|
17
17
|
import { t as q } from "../../language-DgO7XgOg.js";
|
|
18
18
|
import { t as J } from "../../AppTitle-BShUHen9.js";
|
|
19
19
|
import { n as Y, t as X } from "../../states-Bs9lIWQe.js";
|
|
@@ -3,6 +3,8 @@ import type { SelectOption } from "@krosoft/core/types";
|
|
|
3
3
|
export interface MultiSelectOption extends SelectOption {
|
|
4
4
|
/** Option visible mais non basculable : grisée, ignorée par le clic, la navigation clavier et les actions globales. */
|
|
5
5
|
disabled?: boolean;
|
|
6
|
+
/** Vignette affichée avant le libellé dans la liste. Définie (URL) → image ; définie à `null`/`""` → placeholder gris ; absente → pas de vignette. */
|
|
7
|
+
imageUrl?: string | null;
|
|
6
8
|
}
|
|
7
9
|
/**
|
|
8
10
|
* Les props non reconnues (et la `ref`) sont relayées au bouton du trigger : c'est ce qui permet à un
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSelect.d.ts","sourceRoot":"","sources":["../../../../src/components/core/inputs/MultiSelect.tsx"],"names":[],"mappings":"AACA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAKjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"MultiSelect.d.ts","sourceRoot":"","sources":["../../../../src/components/core/inputs/MultiSelect.tsx"],"names":[],"mappings":"AACA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAKjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGxD,MAAM,WAAW,iBAAkB,SAAQ,YAAY;IACrD,uHAAuH;IACvH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sJAAsJ;IACtJ,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED;;;;;GAKG;AACH,UAAU,gBAAgB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAE,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,CAAC;IAC7J,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,QAAQ,EAAE,CAAC,EAAE,CAAC;IACd,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC;IACpC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iHAAiH;IACjH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,sKAepD,gBAAgB,CAAC,CAAC,CAAC,KAAG,KAAK,CAAC,YAoO9B,CAAC"}
|
|
@@ -5,6 +5,8 @@ export interface SingleSelectOption extends SelectOption {
|
|
|
5
5
|
description?: string;
|
|
6
6
|
/** Option visible mais non sélectionnable : grisée, ignorée par le clic et par la navigation clavier. */
|
|
7
7
|
disabled?: boolean;
|
|
8
|
+
/** Vignette affichée avant le libellé. Définie (URL) → image ; définie à `null`/`""` → placeholder gris ; absente → pas de vignette. */
|
|
9
|
+
imageUrl?: string | null;
|
|
8
10
|
}
|
|
9
11
|
/**
|
|
10
12
|
* Les props non reconnues (et la `ref`) sont relayées au bouton du trigger, dans les deux modes : c'est ce
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SingleSelect.d.ts","sourceRoot":"","sources":["../../../../src/components/core/inputs/SingleSelect.tsx"],"names":[],"mappings":"AACA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAKjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"SingleSelect.d.ts","sourceRoot":"","sources":["../../../../src/components/core/inputs/SingleSelect.tsx"],"names":[],"mappings":"AACA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAKjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGxD,MAAM,WAAW,kBAAmB,SAAQ,YAAY;IACtD,oIAAoI;IACpI,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yGAAyG;IACzG,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wIAAwI;IACxI,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED;;;;;GAKG;AACH,UAAU,iBAAkB,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,CAAC;IACtH,OAAO,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC/B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,gIAAgI;IAChI,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,8GAA8G;IAC9G,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,YAAY,GAAI,4KAgB1B,iBAAiB,KAAG,KAAK,CAAC,YAqL5B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "../../../ImageInput-B6NH8JDS.js";
|
|
2
|
-
import { t } from "../../../MultiSelect-
|
|
3
|
-
import { i as n, n as r, r as i, t as a } from "../../../SearchInput-
|
|
4
|
-
import { t as o } from "../../../inputs-
|
|
2
|
+
import { t } from "../../../MultiSelect-0iYNlt_e.js";
|
|
3
|
+
import { i as n, n as r, r as i, t as a } from "../../../SearchInput-sg_-w8UW.js";
|
|
4
|
+
import { t as o } from "../../../inputs-Cxz5kfwF.js";
|
|
5
5
|
export { n as DatePicker, i as DateRangePicker, e as ImageInput, t as MultiSelect, o as RatingInput, a as SearchInput, r as SingleSelect };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Vignette d'une option de select (partagée par `SingleSelect` et `MultiSelect`).
|
|
4
|
+
* URL → image ; `null`/`""` → placeholder gris ; `undefined` → rien (option sans vignette).
|
|
5
|
+
*/
|
|
6
|
+
export declare const renderOptionThumbnail: (imageUrl: string | null | undefined, className?: string) => React.ReactNode;
|
|
7
|
+
//# sourceMappingURL=select.helper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.helper.d.ts","sourceRoot":"","sources":["../../../../src/components/core/inputs/select.helper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAAI,UAAU,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,YAAY,MAAM,KAAG,KAAK,CAAC,SASrG,CAAC"}
|
package/dist/components/index.js
CHANGED
|
@@ -8,16 +8,16 @@ import { a as ur, c as dr, i as fr, l as pr, n as mr, o as hr, r as gr, s as _r,
|
|
|
8
8
|
import { t as br } from "../skeleton-D6Ga4BLw.js";
|
|
9
9
|
import { a as xr, c as Sr, i as Cr, n as wr, o as Tr, r as Er, s as Dr, t as Or } from "../charts-BDlyl5wa.js";
|
|
10
10
|
import { t as kr } from "../ErrorAlert-DrjpMJu6.js";
|
|
11
|
-
import { n as Ar, r as jr, t as Mr } from "../dialogs-
|
|
11
|
+
import { n as Ar, r as jr, t as Mr } from "../dialogs-BwObbaoM.js";
|
|
12
12
|
import { t as Nr } from "../ImageInput-B6NH8JDS.js";
|
|
13
13
|
import { t as Pr } from "../AppActions-CvT8dDnQ.js";
|
|
14
14
|
import { t as Fr } from "../AppSubTitle-DJQjeSdC.js";
|
|
15
|
-
import { t as Ir } from "../MultiSelect-
|
|
16
|
-
import { t as Lr } from "../GenericForm-
|
|
17
|
-
import { i as Rr, n as zr, r as Br, t as Vr } from "../SearchInput-
|
|
15
|
+
import { t as Ir } from "../MultiSelect-0iYNlt_e.js";
|
|
16
|
+
import { t as Lr } from "../GenericForm-DBLeKiPm.js";
|
|
17
|
+
import { i as Rr, n as zr, r as Br, t as Vr } from "../SearchInput-sg_-w8UW.js";
|
|
18
18
|
import { ActiveFilters as Hr, AdvancedFilters as Ur, FilterField as Wr, FilterPills as Gr, FilterPillsGroup as Kr, TableFilter as qr } from "./core/filters/index.js";
|
|
19
19
|
import { n as Jr, t as Yr } from "../icons-n0m_1w7z.js";
|
|
20
|
-
import { t as Xr } from "../inputs-
|
|
20
|
+
import { t as Xr } from "../inputs-Cxz5kfwF.js";
|
|
21
21
|
import { t as Zr } from "../language-DgO7XgOg.js";
|
|
22
22
|
import { t as Qr } from "../AppTitle-BShUHen9.js";
|
|
23
23
|
import { n as $r, t as ei } from "../states-Bs9lIWQe.js";
|
|
@@ -4,7 +4,7 @@ import { Bn as n, Gn as r, Hn as i, I as a, Kn as o, Un as s, Wn as c, qn as l }
|
|
|
4
4
|
import { c as u } from "./tooltip-_geGvbS7.js";
|
|
5
5
|
import { E as d, O as f, P as p, j as m, k as h } from "./sheet-C2vx5V6Q.js";
|
|
6
6
|
import { t as g } from "./ErrorAlert-DrjpMJu6.js";
|
|
7
|
-
import { t as _ } from "./GenericForm-
|
|
7
|
+
import { t as _ } from "./GenericForm-DBLeKiPm.js";
|
|
8
8
|
import { useEffect as v, useId as y, useState as b } from "react";
|
|
9
9
|
import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
10
10
|
import { Pen as w, Save as T, X as E } from "lucide-react";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./tailwind.helper-CJaRYBmL.js";
|
|
2
2
|
import "./ImageInput-B6NH8JDS.js";
|
|
3
|
-
import "./MultiSelect-
|
|
4
|
-
import "./SearchInput-
|
|
3
|
+
import "./MultiSelect-0iYNlt_e.js";
|
|
4
|
+
import "./SearchInput-sg_-w8UW.js";
|
|
5
5
|
import { jsx as t } from "react/jsx-runtime";
|
|
6
6
|
import { Heart as n, Star as r } from "lucide-react";
|
|
7
7
|
//#region src/components/core/inputs/RatingInput.tsx
|