@krosoft/react 0.0.292 → 0.0.294
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-BdKwapAz.js → GenericForm-D7ni-5-4.js} +1 -1
- package/dist/MultiSelect-CZ4hye2w.js +147 -0
- package/dist/SearchInput-nr0CrMLK.js +316 -0
- package/dist/components/core/dialogs/index.js +1 -1
- package/dist/components/core/filters/FilterField.d.ts.map +1 -1
- package/dist/components/core/filters/FilterPills.d.ts +1 -1
- package/dist/components/core/filters/TableFilter.d.ts.map +1 -1
- package/dist/components/core/filters/index.d.ts +0 -1
- package/dist/components/core/filters/index.d.ts.map +1 -1
- package/dist/components/core/filters/index.js +138 -253
- package/dist/components/core/forms/index.js +1 -1
- package/dist/components/core/index.js +15 -15
- package/dist/components/core/inputs/MultiSelect.d.ts +15 -7
- package/dist/components/core/inputs/MultiSelect.d.ts.map +1 -1
- package/dist/components/core/inputs/SingleSelect.d.ts +30 -0
- package/dist/components/core/inputs/SingleSelect.d.ts.map +1 -0
- package/dist/components/core/inputs/index.d.ts +2 -2
- package/dist/components/core/inputs/index.d.ts.map +1 -1
- package/dist/components/core/inputs/index.js +4 -4
- package/dist/components/index.js +15 -15
- package/dist/{dialogs-BxyPBIc6.js → dialogs-BjqvZvax.js} +1 -1
- package/dist/{inputs-CUNf48Vk.js → inputs-BMCt-VqZ.js} +2 -2
- package/package.json +1 -1
- package/dist/MultiSelect-O4JP5fRO.js +0 -129
- package/dist/SearchInput-BSIjKB_9.js +0 -259
- package/dist/components/core/filters/SearchableFilterPill.d.ts +0 -16
- package/dist/components/core/filters/SearchableFilterPill.d.ts.map +0 -1
- package/dist/components/core/inputs/SearchableSelect.d.ts +0 -28
- package/dist/components/core/inputs/SearchableSelect.d.ts.map +0 -1
|
@@ -8,7 +8,7 @@ import { i as h, l as g, n as _, t as v, u as y } from "./select-DmLScQKX.js";
|
|
|
8
8
|
import { n as b } from "./useToast-UeDRLovh.js";
|
|
9
9
|
import { t as x } from "./ImageInput-BPNEywyf.js";
|
|
10
10
|
import { t as S } from "./AppSubTitle-BOVTZlUB.js";
|
|
11
|
-
import { t as C } from "./MultiSelect-
|
|
11
|
+
import { t as C } from "./MultiSelect-CZ4hye2w.js";
|
|
12
12
|
import { useState as w } from "react";
|
|
13
13
|
import { jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
14
14
|
import { useForm as D } from "react-hook-form";
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { t as e } from "./tailwind.helper-CJaRYBmL.js";
|
|
2
|
+
import { t } from "./i18n-d2p0RJo9.js";
|
|
3
|
+
import { bn as n } from "./ui-D8Pg34YW.js";
|
|
4
|
+
import { a as r, o as i } from "./tooltip-BmZ9Bfou.js";
|
|
5
|
+
import { h as a, m as o, p as s } from "./sheet-DQTOen4V.js";
|
|
6
|
+
import { useMemo as c, useState as l } from "react";
|
|
7
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
8
|
+
import { ChevronDownIcon as f, SearchIcon as p, XIcon as m } from "lucide-react";
|
|
9
|
+
import { Command as h } from "cmdk";
|
|
10
|
+
//#region src/components/core/inputs/MultiSelect.tsx
|
|
11
|
+
var g = ({ options: g, selected: _, onToggle: v, onClear: y, onSelectAll: b, variant: x = "input", placeholder: S, labelKey: C, searchable: w = !1, searchPlaceholder: T, disabled: E = !1, maxCount: D, className: O }) => {
|
|
12
|
+
let { t: k } = t(), [A, j] = l(""), [M, N] = l(!1), P = x === "pill", F = c(() => A === "" ? g : g.filter((e) => e.label.toLowerCase().includes(A.toLowerCase())), [g, A]), I = c(() => F.length !== 0 && F.every((e) => _.includes(e.value)), [F, _]), L = c(() => _.map((e) => g.find((t) => t.value === e)?.label ?? e), [g, _]), R = D !== void 0 && D > 0 ? L.slice(0, D) : L, z = L.length - R.length, B = (e) => {
|
|
13
|
+
N(e), e || j("");
|
|
14
|
+
}, V = () => {
|
|
15
|
+
y === void 0 ? b === void 0 ? _.forEach((e) => {
|
|
16
|
+
v(e);
|
|
17
|
+
}) : b([]) : y();
|
|
18
|
+
}, H = () => {
|
|
19
|
+
if (I) {
|
|
20
|
+
if (b !== void 0) {
|
|
21
|
+
let e = F.map((e) => e.value);
|
|
22
|
+
b(_.filter((t) => !e.includes(t)));
|
|
23
|
+
} else y === void 0 ? _.forEach((e) => {
|
|
24
|
+
v(e);
|
|
25
|
+
}) : y();
|
|
26
|
+
} else if (b !== void 0) {
|
|
27
|
+
let e = [..._];
|
|
28
|
+
F.forEach((t) => {
|
|
29
|
+
e.includes(t.value) || e.push(t.value);
|
|
30
|
+
}), b(e);
|
|
31
|
+
} else F.forEach((e) => {
|
|
32
|
+
_.includes(e.value) || v(e.value);
|
|
33
|
+
});
|
|
34
|
+
}, U = P ? /* @__PURE__ */ d("button", {
|
|
35
|
+
type: "button",
|
|
36
|
+
disabled: E,
|
|
37
|
+
className: e(r, "inline-flex items-center justify-between gap-1.5 whitespace-nowrap transition-colors", _.length > 0 ? "border-primary bg-primary/10 text-primary font-medium" : "hover:bg-muted", O ?? "w-full md:w-[180px]"),
|
|
38
|
+
children: [/* @__PURE__ */ u("span", {
|
|
39
|
+
className: "truncate",
|
|
40
|
+
children: C === void 0 ? S ?? k("select.placeholder") : k(C)
|
|
41
|
+
}), /* @__PURE__ */ d("div", {
|
|
42
|
+
className: "flex shrink-0 items-center gap-1.5",
|
|
43
|
+
children: [_.length > 0 && /* @__PURE__ */ u("span", {
|
|
44
|
+
className: "flex h-4 min-w-[16px] items-center justify-center rounded-full bg-primary px-1 text-[10px] font-bold text-primary-foreground",
|
|
45
|
+
children: _.length
|
|
46
|
+
}), /* @__PURE__ */ u(f, { className: e("size-3.5 opacity-60 transition-transform", M && "rotate-180") })]
|
|
47
|
+
})]
|
|
48
|
+
}) : /* @__PURE__ */ d("button", {
|
|
49
|
+
type: "button",
|
|
50
|
+
disabled: E,
|
|
51
|
+
className: e(i, "w-full", M && "ring-2 ring-ring ring-offset-2", _.length === 0 && "text-muted-foreground", O),
|
|
52
|
+
children: [/* @__PURE__ */ u("span", {
|
|
53
|
+
className: "truncate",
|
|
54
|
+
children: _.length === 0 ? S ?? k("select.placeholder") : R.join(", ")
|
|
55
|
+
}), /* @__PURE__ */ d("div", {
|
|
56
|
+
className: "flex shrink-0 items-center gap-1",
|
|
57
|
+
children: [
|
|
58
|
+
z > 0 && /* @__PURE__ */ d("span", {
|
|
59
|
+
className: "rounded-control bg-muted px-1.5 py-0.5 text-xs font-medium text-foreground",
|
|
60
|
+
children: ["+", z]
|
|
61
|
+
}),
|
|
62
|
+
_.length > 0 && !E && /* @__PURE__ */ u("span", {
|
|
63
|
+
role: "button",
|
|
64
|
+
tabIndex: -1,
|
|
65
|
+
onClick: (e) => {
|
|
66
|
+
e.stopPropagation();
|
|
67
|
+
},
|
|
68
|
+
onPointerDown: (e) => {
|
|
69
|
+
e.preventDefault(), e.stopPropagation(), V();
|
|
70
|
+
},
|
|
71
|
+
className: "text-muted-foreground hover:text-foreground",
|
|
72
|
+
children: /* @__PURE__ */ u(m, { className: "size-4" })
|
|
73
|
+
}),
|
|
74
|
+
/* @__PURE__ */ u(f, { className: e("size-4 opacity-50 shrink-0 transition-transform", M && "rotate-180") })
|
|
75
|
+
]
|
|
76
|
+
})]
|
|
77
|
+
});
|
|
78
|
+
return /* @__PURE__ */ d(s, {
|
|
79
|
+
open: M,
|
|
80
|
+
onOpenChange: B,
|
|
81
|
+
children: [/* @__PURE__ */ u(a, {
|
|
82
|
+
asChild: !0,
|
|
83
|
+
children: U
|
|
84
|
+
}), /* @__PURE__ */ d(o, {
|
|
85
|
+
className: e("p-0", P ? "w-72 max-w-[var(--radix-popover-content-available-width)]" : "w-[var(--radix-popover-trigger-width)]"),
|
|
86
|
+
align: "start",
|
|
87
|
+
children: [/* @__PURE__ */ d(h, {
|
|
88
|
+
shouldFilter: !1,
|
|
89
|
+
className: "flex flex-col",
|
|
90
|
+
children: [w ? /* @__PURE__ */ u("div", {
|
|
91
|
+
className: "border-b border-border p-2",
|
|
92
|
+
children: /* @__PURE__ */ d("div", {
|
|
93
|
+
className: "relative",
|
|
94
|
+
children: [/* @__PURE__ */ u(p, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }), /* @__PURE__ */ u(h.Input, {
|
|
95
|
+
value: A,
|
|
96
|
+
onValueChange: j,
|
|
97
|
+
placeholder: T ?? k("search.placeholder"),
|
|
98
|
+
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
|
+
autoFocus: !0
|
|
100
|
+
})]
|
|
101
|
+
})
|
|
102
|
+
}) : /* @__PURE__ */ u(h.Input, {
|
|
103
|
+
autoFocus: !0,
|
|
104
|
+
tabIndex: -1,
|
|
105
|
+
className: "sr-only"
|
|
106
|
+
}), /* @__PURE__ */ d(h.List, {
|
|
107
|
+
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: [F.length === 0 && /* @__PURE__ */ u("p", {
|
|
109
|
+
className: "px-2 py-3 text-center text-xs text-muted-foreground",
|
|
110
|
+
children: k("states.noResult")
|
|
111
|
+
}), F.map((e) => /* @__PURE__ */ d(h.Item, {
|
|
112
|
+
value: e.value,
|
|
113
|
+
onSelect: () => {
|
|
114
|
+
v(e.value);
|
|
115
|
+
},
|
|
116
|
+
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",
|
|
117
|
+
children: [
|
|
118
|
+
/* @__PURE__ */ u("span", {
|
|
119
|
+
className: "pointer-events-none shrink-0",
|
|
120
|
+
children: /* @__PURE__ */ u(n, { checked: _.includes(e.value) })
|
|
121
|
+
}),
|
|
122
|
+
e.color && /* @__PURE__ */ u("span", {
|
|
123
|
+
className: "size-2.5 shrink-0 rounded-full",
|
|
124
|
+
style: { backgroundColor: e.color }
|
|
125
|
+
}),
|
|
126
|
+
/* @__PURE__ */ u("span", {
|
|
127
|
+
className: "min-w-0 flex-1 truncate",
|
|
128
|
+
title: e.label,
|
|
129
|
+
children: e.label
|
|
130
|
+
})
|
|
131
|
+
]
|
|
132
|
+
}, e.value))]
|
|
133
|
+
})]
|
|
134
|
+
}), F.length > 0 && /* @__PURE__ */ u("div", {
|
|
135
|
+
className: "border-t border-border p-1.5",
|
|
136
|
+
children: /* @__PURE__ */ u("button", {
|
|
137
|
+
type: "button",
|
|
138
|
+
onClick: H,
|
|
139
|
+
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",
|
|
140
|
+
children: k(I ? "filters.deselectAll" : "filters.selectAll")
|
|
141
|
+
})
|
|
142
|
+
})]
|
|
143
|
+
})]
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
//#endregion
|
|
147
|
+
export { g as t };
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
import { t as e } from "./tailwind.helper-CJaRYBmL.js";
|
|
2
|
+
import { r as t, t as n } from "./i18n-d2p0RJo9.js";
|
|
3
|
+
import { En as r } from "./ui-D8Pg34YW.js";
|
|
4
|
+
import { o as i, s as a } from "./tooltip-BmZ9Bfou.js";
|
|
5
|
+
import { g as o, h as s, m as c, p as l } from "./sheet-DQTOen4V.js";
|
|
6
|
+
import { i as u, l as d, n as f, t as p, u as m } from "./select-DmLScQKX.js";
|
|
7
|
+
import * as h from "react";
|
|
8
|
+
import { useEffect as g, useMemo as _, useRef as v, useState as y } from "react";
|
|
9
|
+
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
10
|
+
import { CalendarIcon as S, CheckIcon as C, ChevronDownIcon as w, PlusIcon as T, SearchIcon as E, XIcon as D } from "lucide-react";
|
|
11
|
+
import { Command as O } from "cmdk";
|
|
12
|
+
import { format as k } from "date-fns";
|
|
13
|
+
//#region src/components/core/inputs/DatePicker.tsx
|
|
14
|
+
var A = ({ date: n, onDateChange: i, placeholder: o }) => {
|
|
15
|
+
let s = t(), [c, l] = y(!1), u = v(null);
|
|
16
|
+
return g(() => {
|
|
17
|
+
if (!c) return;
|
|
18
|
+
let e = (e) => {
|
|
19
|
+
u.current !== null && !u.current.contains(e.target) && l(!1);
|
|
20
|
+
};
|
|
21
|
+
return document.addEventListener("mousedown", e), () => {
|
|
22
|
+
document.removeEventListener("mousedown", e);
|
|
23
|
+
};
|
|
24
|
+
}, [c]), /* @__PURE__ */ x("div", {
|
|
25
|
+
ref: u,
|
|
26
|
+
className: "relative w-full",
|
|
27
|
+
children: [/* @__PURE__ */ x(a, {
|
|
28
|
+
variant: "outline",
|
|
29
|
+
type: "button",
|
|
30
|
+
onClick: () => {
|
|
31
|
+
l((e) => !e);
|
|
32
|
+
},
|
|
33
|
+
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__ */ b(S, { className: "mr-2 size-4 shrink-0" }), n === void 0 ? /* @__PURE__ */ b("span", { children: o }) : k(n, "dd/MM/yyyy", { locale: s })]
|
|
35
|
+
}), c ? /* @__PURE__ */ b("div", {
|
|
36
|
+
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__ */ b(r, {
|
|
38
|
+
mode: "single",
|
|
39
|
+
locale: s,
|
|
40
|
+
defaultMonth: n,
|
|
41
|
+
selected: n,
|
|
42
|
+
onSelect: (e) => {
|
|
43
|
+
i(e), l(!1);
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
}) : null]
|
|
47
|
+
});
|
|
48
|
+
}, j = (e) => e ? {
|
|
49
|
+
from: e.from,
|
|
50
|
+
to: e.to
|
|
51
|
+
} : void 0, M = ({ value: i, onChange: o, placeholder: u, className: d }) => {
|
|
52
|
+
let { t: f } = n(), p = t(), [m, g] = h.useState(!1), [_, v] = h.useState(j(i));
|
|
53
|
+
return h.useEffect(() => {
|
|
54
|
+
m && v(j(i));
|
|
55
|
+
}, [m, i]), /* @__PURE__ */ b("div", {
|
|
56
|
+
className: e("grid gap-2", d),
|
|
57
|
+
children: /* @__PURE__ */ x(l, {
|
|
58
|
+
open: m,
|
|
59
|
+
onOpenChange: g,
|
|
60
|
+
children: [/* @__PURE__ */ b(s, {
|
|
61
|
+
asChild: !0,
|
|
62
|
+
children: /* @__PURE__ */ x(a, {
|
|
63
|
+
id: "date",
|
|
64
|
+
variant: "outline",
|
|
65
|
+
className: e("w-[300px] justify-start text-left font-normal", !i?.from && "text-muted-foreground"),
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ b(S, { className: "mr-2 size-4" }),
|
|
68
|
+
((e) => e?.from ? !e.to || e.from.getTime() === e.to.getTime() ? k(e.from, "dd MMM yyyy", { locale: p }) : `${k(e.from, "dd MMM yyyy", { locale: p })} - ${k(e.to, "dd MMM yyyy", { locale: p })}` : u ?? f("date.pickPeriod"))(i),
|
|
69
|
+
i?.from && /* @__PURE__ */ b(a, {
|
|
70
|
+
type: "button",
|
|
71
|
+
variant: "ghost",
|
|
72
|
+
size: "icon",
|
|
73
|
+
"aria-label": f("date.clearPeriod"),
|
|
74
|
+
className: "ml-auto h-5 w-5 opacity-50 hover:opacity-100",
|
|
75
|
+
onClick: (e) => {
|
|
76
|
+
e.stopPropagation(), o(void 0), g(!1);
|
|
77
|
+
},
|
|
78
|
+
children: /* @__PURE__ */ b(D, { className: "size-4" })
|
|
79
|
+
})
|
|
80
|
+
]
|
|
81
|
+
})
|
|
82
|
+
}), /* @__PURE__ */ x(c, {
|
|
83
|
+
className: "w-auto p-0",
|
|
84
|
+
align: "start",
|
|
85
|
+
side: "bottom",
|
|
86
|
+
sideOffset: 4,
|
|
87
|
+
children: [/* @__PURE__ */ b(r, {
|
|
88
|
+
mode: "range",
|
|
89
|
+
resetOnSelect: !0,
|
|
90
|
+
defaultMonth: _?.from,
|
|
91
|
+
selected: _,
|
|
92
|
+
onSelect: v,
|
|
93
|
+
numberOfMonths: 2,
|
|
94
|
+
locale: p,
|
|
95
|
+
className: "pointer-events-auto p-3"
|
|
96
|
+
}), /* @__PURE__ */ x("div", {
|
|
97
|
+
className: "flex items-center justify-between border-t border-border px-3 py-2",
|
|
98
|
+
children: [/* @__PURE__ */ b(a, {
|
|
99
|
+
variant: "ghost",
|
|
100
|
+
size: "sm",
|
|
101
|
+
onClick: () => {
|
|
102
|
+
v(void 0);
|
|
103
|
+
},
|
|
104
|
+
children: f("actions.clear")
|
|
105
|
+
}), /* @__PURE__ */ x("div", {
|
|
106
|
+
className: "flex gap-2",
|
|
107
|
+
children: [/* @__PURE__ */ b(a, {
|
|
108
|
+
variant: "ghost",
|
|
109
|
+
size: "sm",
|
|
110
|
+
onClick: () => {
|
|
111
|
+
v(j(i)), g(!1);
|
|
112
|
+
},
|
|
113
|
+
children: f("actions.cancel")
|
|
114
|
+
}), /* @__PURE__ */ b(a, {
|
|
115
|
+
size: "sm",
|
|
116
|
+
onClick: () => {
|
|
117
|
+
o(_), g(!1);
|
|
118
|
+
},
|
|
119
|
+
children: f("actions.apply")
|
|
120
|
+
})]
|
|
121
|
+
})]
|
|
122
|
+
})]
|
|
123
|
+
})]
|
|
124
|
+
})
|
|
125
|
+
});
|
|
126
|
+
}, N = ({ options: t = [], value: r, onChange: a, onClear: o, searchable: h = !1, onCreate: g, placeholder: v, searchPlaceholder: S, emptyLabel: k, createLabel: A, disabled: j = !1, modal: M = !0, className: N }) => {
|
|
127
|
+
let { t: P } = n(), [F, I] = y(!1), [L, R] = y(""), z = r !== void 0 && r !== "", B = _(() => z ? t.find((e) => e.value === r) : void 0, [
|
|
128
|
+
z,
|
|
129
|
+
t,
|
|
130
|
+
r
|
|
131
|
+
]), V = z ? B?.label ?? r : void 0;
|
|
132
|
+
if (!h) return /* @__PURE__ */ x(p, {
|
|
133
|
+
value: r ?? "",
|
|
134
|
+
onValueChange: a,
|
|
135
|
+
disabled: j,
|
|
136
|
+
children: [/* @__PURE__ */ b(d, {
|
|
137
|
+
className: e(!z && "text-muted-foreground", N),
|
|
138
|
+
onClear: o !== void 0 && z && !j ? (e) => {
|
|
139
|
+
e.preventDefault(), e.stopPropagation(), o();
|
|
140
|
+
} : void 0,
|
|
141
|
+
children: /* @__PURE__ */ b(m, { placeholder: v ?? P("select.placeholder") })
|
|
142
|
+
}), /* @__PURE__ */ b(f, { children: t.map((e) => /* @__PURE__ */ b(u, {
|
|
143
|
+
value: e.value,
|
|
144
|
+
children: /* @__PURE__ */ x("span", {
|
|
145
|
+
className: "flex items-center",
|
|
146
|
+
children: [
|
|
147
|
+
e.color !== void 0 && /* @__PURE__ */ b("span", {
|
|
148
|
+
className: "mr-2 size-2.5 shrink-0 rounded-full",
|
|
149
|
+
style: { backgroundColor: e.color }
|
|
150
|
+
}),
|
|
151
|
+
e.label,
|
|
152
|
+
e.description !== void 0 && /* @__PURE__ */ x("span", {
|
|
153
|
+
className: "ml-1 text-muted-foreground",
|
|
154
|
+
children: [
|
|
155
|
+
"(",
|
|
156
|
+
e.description,
|
|
157
|
+
")"
|
|
158
|
+
]
|
|
159
|
+
})
|
|
160
|
+
]
|
|
161
|
+
})
|
|
162
|
+
}, e.value)) })]
|
|
163
|
+
});
|
|
164
|
+
let H = L.trim(), U = g !== void 0 && H !== "" && !t.some((e) => e.label.toLowerCase() === H.toLowerCase()), W = (e) => {
|
|
165
|
+
I(e), e || R("");
|
|
166
|
+
}, G = (e) => {
|
|
167
|
+
a(e), W(!1);
|
|
168
|
+
};
|
|
169
|
+
return /* @__PURE__ */ x(l, {
|
|
170
|
+
open: F,
|
|
171
|
+
onOpenChange: W,
|
|
172
|
+
modal: M,
|
|
173
|
+
children: [/* @__PURE__ */ b(s, {
|
|
174
|
+
asChild: !0,
|
|
175
|
+
children: /* @__PURE__ */ x("button", {
|
|
176
|
+
type: "button",
|
|
177
|
+
role: "combobox",
|
|
178
|
+
"aria-expanded": F,
|
|
179
|
+
disabled: j,
|
|
180
|
+
className: e(i, "w-full", "data-[state=open]:ring-2 data-[state=open]:ring-ring data-[state=open]:ring-offset-2", !z && "text-muted-foreground", N),
|
|
181
|
+
children: [/* @__PURE__ */ x("span", {
|
|
182
|
+
className: "flex items-center truncate",
|
|
183
|
+
children: [
|
|
184
|
+
B?.color && /* @__PURE__ */ b("span", {
|
|
185
|
+
className: "mr-2 size-2.5 shrink-0 rounded-full",
|
|
186
|
+
style: { backgroundColor: B.color }
|
|
187
|
+
}),
|
|
188
|
+
/* @__PURE__ */ b("span", {
|
|
189
|
+
className: "truncate",
|
|
190
|
+
children: V ?? v ?? P("select.placeholder")
|
|
191
|
+
}),
|
|
192
|
+
B?.description !== void 0 && /* @__PURE__ */ x("span", {
|
|
193
|
+
className: "ml-1 truncate text-muted-foreground",
|
|
194
|
+
children: [
|
|
195
|
+
"(",
|
|
196
|
+
B.description,
|
|
197
|
+
")"
|
|
198
|
+
]
|
|
199
|
+
})
|
|
200
|
+
]
|
|
201
|
+
}), /* @__PURE__ */ x("div", {
|
|
202
|
+
className: "flex items-center gap-1",
|
|
203
|
+
children: [o && z && !j && /* @__PURE__ */ b("span", {
|
|
204
|
+
role: "button",
|
|
205
|
+
tabIndex: -1,
|
|
206
|
+
onClick: (e) => {
|
|
207
|
+
e.stopPropagation();
|
|
208
|
+
},
|
|
209
|
+
onPointerDown: (e) => {
|
|
210
|
+
e.preventDefault(), e.stopPropagation(), o();
|
|
211
|
+
},
|
|
212
|
+
className: "text-muted-foreground hover:text-foreground",
|
|
213
|
+
children: /* @__PURE__ */ b(D, { className: "size-4" })
|
|
214
|
+
}), /* @__PURE__ */ b(w, { className: e("size-4 shrink-0 opacity-50 transition-transform", F && "rotate-180") })]
|
|
215
|
+
})]
|
|
216
|
+
})
|
|
217
|
+
}), /* @__PURE__ */ b(c, {
|
|
218
|
+
className: "w-[var(--radix-popover-trigger-width)] p-0",
|
|
219
|
+
align: "start",
|
|
220
|
+
children: /* @__PURE__ */ x(O, {
|
|
221
|
+
className: "flex flex-col",
|
|
222
|
+
filter: (e, t, n) => +!!(n ?? []).join(" ").toLowerCase().includes(t.trim().toLowerCase()),
|
|
223
|
+
children: [/* @__PURE__ */ b("div", {
|
|
224
|
+
className: "border-b border-border p-2",
|
|
225
|
+
children: /* @__PURE__ */ x("div", {
|
|
226
|
+
className: "relative",
|
|
227
|
+
children: [/* @__PURE__ */ b(E, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }), /* @__PURE__ */ b(O.Input, {
|
|
228
|
+
value: L,
|
|
229
|
+
onValueChange: R,
|
|
230
|
+
placeholder: S ?? P("search.placeholder"),
|
|
231
|
+
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",
|
|
232
|
+
autoFocus: !0
|
|
233
|
+
})]
|
|
234
|
+
})
|
|
235
|
+
}), /* @__PURE__ */ x(O.List, {
|
|
236
|
+
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",
|
|
237
|
+
children: [
|
|
238
|
+
!U && /* @__PURE__ */ b(O.Empty, {
|
|
239
|
+
className: "px-2 py-3 text-center text-xs text-muted-foreground",
|
|
240
|
+
children: k ?? P("states.noResult")
|
|
241
|
+
}),
|
|
242
|
+
t.map((t) => /* @__PURE__ */ x(O.Item, {
|
|
243
|
+
value: t.value,
|
|
244
|
+
keywords: [t.label, t.description ?? ""],
|
|
245
|
+
onSelect: () => {
|
|
246
|
+
G(t.value);
|
|
247
|
+
},
|
|
248
|
+
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",
|
|
249
|
+
children: [
|
|
250
|
+
/* @__PURE__ */ b(C, { className: e("size-4 shrink-0", r === t.value ? "opacity-100" : "opacity-0") }),
|
|
251
|
+
t.color && /* @__PURE__ */ b("span", {
|
|
252
|
+
className: "size-2.5 shrink-0 rounded-full",
|
|
253
|
+
style: { backgroundColor: t.color }
|
|
254
|
+
}),
|
|
255
|
+
/* @__PURE__ */ b("span", {
|
|
256
|
+
className: "min-w-0 flex-1 truncate",
|
|
257
|
+
title: t.label,
|
|
258
|
+
children: t.label
|
|
259
|
+
}),
|
|
260
|
+
t.description !== void 0 && /* @__PURE__ */ x("span", {
|
|
261
|
+
className: "shrink-0 truncate text-muted-foreground",
|
|
262
|
+
children: [
|
|
263
|
+
"(",
|
|
264
|
+
t.description,
|
|
265
|
+
")"
|
|
266
|
+
]
|
|
267
|
+
})
|
|
268
|
+
]
|
|
269
|
+
}, t.value)),
|
|
270
|
+
U && /* @__PURE__ */ x(O.Item, {
|
|
271
|
+
forceMount: !0,
|
|
272
|
+
value: "__create__",
|
|
273
|
+
onSelect: () => {
|
|
274
|
+
g?.(H), W(!1);
|
|
275
|
+
},
|
|
276
|
+
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",
|
|
277
|
+
children: [/* @__PURE__ */ b(T, { className: "size-4 shrink-0" }), /* @__PURE__ */ b("span", {
|
|
278
|
+
className: "truncate",
|
|
279
|
+
children: A ? A(H) : P("select.create", { search: H })
|
|
280
|
+
})]
|
|
281
|
+
})
|
|
282
|
+
]
|
|
283
|
+
})]
|
|
284
|
+
})
|
|
285
|
+
})]
|
|
286
|
+
});
|
|
287
|
+
}, P = ({ searchQuery: t, search: r, placeholder: i, onSearch: a, onSubmit: s, onClear: c, className: l }) => {
|
|
288
|
+
let { t: u } = n(), d = t ?? r ?? "";
|
|
289
|
+
return /* @__PURE__ */ x("div", {
|
|
290
|
+
className: e("relative h-fit w-full md:w-64", l),
|
|
291
|
+
children: [
|
|
292
|
+
/* @__PURE__ */ b(E, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground w-4 h-4" }),
|
|
293
|
+
/* @__PURE__ */ b(o, {
|
|
294
|
+
placeholder: i ?? u("search.placeholder"),
|
|
295
|
+
value: d,
|
|
296
|
+
onChange: (e) => {
|
|
297
|
+
a(e.target.value);
|
|
298
|
+
},
|
|
299
|
+
className: "pl-8",
|
|
300
|
+
onKeyDown: (e) => {
|
|
301
|
+
e.key === "Enter" && s !== void 0 && (e.preventDefault(), s());
|
|
302
|
+
}
|
|
303
|
+
}),
|
|
304
|
+
d === "" ? null : /* @__PURE__ */ b("button", {
|
|
305
|
+
onClick: () => {
|
|
306
|
+
a(""), c !== void 0 && c();
|
|
307
|
+
},
|
|
308
|
+
className: "absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700",
|
|
309
|
+
type: "button",
|
|
310
|
+
children: /* @__PURE__ */ b(D, { className: "size-4" })
|
|
311
|
+
})
|
|
312
|
+
]
|
|
313
|
+
});
|
|
314
|
+
};
|
|
315
|
+
//#endregion
|
|
316
|
+
export { A as i, N as n, M as r, P as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { I as e } from "../../../ui-D8Pg34YW.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-DQTOen4V.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-BjqvZvax.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 };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterField.d.ts","sourceRoot":"","sources":["../../../../src/components/core/filters/FilterField.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FilterField.d.ts","sourceRoot":"","sources":["../../../../src/components/core/filters/FilterField.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,UAAU,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC1D,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAC5B,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AAED,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,kDAK5D,gBAAgB,CAAC,CAAC,CAAC,KAAG,KAAK,CAAC,YAAY,GAAG,IAiE7C,CAAC"}
|
|
@@ -10,7 +10,7 @@ export interface FilterPillsProps<T extends string | number> {
|
|
|
10
10
|
/**
|
|
11
11
|
* Groupe de pastilles de filtre à sélection unique, avec compteur optionnel par option.
|
|
12
12
|
*
|
|
13
|
-
* Complémentaire de `
|
|
13
|
+
* Complémentaire de `MultiSelect variant="pill"` (multi-sélection en popover) : ici toutes les
|
|
14
14
|
* options sont visibles en ligne et une seule est active à la fois, comme un segmented control.
|
|
15
15
|
* Pour la multi-sélection inline, voir `FilterPillsGroup`.
|
|
16
16
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableFilter.d.ts","sourceRoot":"","sources":["../../../../src/components/core/filters/TableFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAkB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TableFilter.d.ts","sourceRoot":"","sources":["../../../../src/components/core/filters/TableFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAkB,MAAM,OAAO,CAAC;AAOvC,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAE3F,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAG3B,OAAO,EAAE,CAAC,CAAC;IACX,eAAe,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,IAAI,CAAC;IAGtC,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;IAG7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EACvF,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,OAAO,EACP,eAAe,EACf,QAAQ,EACR,kBAAkB,EAClB,UAAU,GACX,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,YAAY,CAoJ1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/core/filters/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/core/filters/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC"}
|