laif-ds 0.2.47 → 0.2.48
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/_virtual/index2.js +2 -5
- package/dist/_virtual/index3.js +5 -2
- package/dist/agent-docs/components/AppForm.md +66 -1
- package/dist/agent-docs/components/AsyncSelect.md +94 -103
- package/dist/components/kanban.js +540 -0
- package/dist/components/ui/app-form.js +76 -44
- package/dist/components/ui/app-kanban.js +137 -0
- package/dist/components/ui/app-select.js +100 -87
- package/dist/components/ui/async-select.js +264 -278
- package/dist/index.d.ts +81 -29
- package/dist/index.js +77 -75
- package/dist/node_modules/@radix-ui/react-alert-dialog/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-slot/dist/index.js +12 -0
- package/dist/node_modules/@radix-ui/react-collection/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
- package/dist/node_modules/@radix-ui/react-menu/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
- package/dist/node_modules/@radix-ui/react-popover/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-primitive/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
- package/dist/node_modules/@radix-ui/react-select/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-select/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js +47 -44
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.js +12 -0
- package/dist/node_modules/eventemitter3/index.js +1 -1
- package/dist/node_modules/recharts/es6/util/Events.js +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +536 -502
- package/dist/node_modules/use-sync-external-store/shim/index.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.v3.css +1 -1
- package/package.json +4 -4
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import { cn as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
const
|
|
2
|
+
import { jsxs as u, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { useDebounce as le } from "../../hooks/use-debounce.js";
|
|
4
|
+
import { cva as de } from "../../node_modules/class-variance-authority/dist/index.js";
|
|
5
|
+
import * as S from "react";
|
|
6
|
+
import { useState as p, useEffect as N, useCallback as j } from "react";
|
|
7
|
+
import { cn as v } from "../../lib/utils.js";
|
|
8
|
+
import { Checkbox as ie } from "./checkbox.js";
|
|
9
|
+
import { Command as fe, CommandInput as me, CommandList as ue, CommandEmpty as he, CommandGroup as _, CommandItem as O } from "./command.js";
|
|
10
|
+
import { Icon as Z } from "./icon.js";
|
|
11
|
+
import { Label as ge } from "./label.js";
|
|
12
|
+
import { Popover as pe, PopoverTrigger as xe, PopoverContent as we } from "./popover.js";
|
|
13
|
+
import ye from "../../node_modules/lucide-react/dist/esm/icons/loader-circle.js";
|
|
14
|
+
import Ne from "../../node_modules/lucide-react/dist/esm/icons/check.js";
|
|
15
|
+
const be = de(
|
|
16
16
|
"flex items-center justify-between whitespace-nowrap rounded-md border border-d-input bg-d-input px-3 py-2 data-[placeholder]:text-muted-foreground focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 ",
|
|
17
17
|
{
|
|
18
18
|
variants: {
|
|
@@ -27,317 +27,303 @@ const ye = ce(
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
);
|
|
30
|
-
function
|
|
31
|
-
fetcher:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
notFound:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
noResultsMessage: D,
|
|
48
|
-
clearable: b = !0,
|
|
30
|
+
function Ie({
|
|
31
|
+
fetcher: i,
|
|
32
|
+
initialOptions: t,
|
|
33
|
+
debounce: x = 300,
|
|
34
|
+
renderOptionItem: b,
|
|
35
|
+
resolveOptionValue: a,
|
|
36
|
+
renderSelectedValue: s,
|
|
37
|
+
notFound: h,
|
|
38
|
+
label: y,
|
|
39
|
+
placeholder: f = "Select...",
|
|
40
|
+
value: n,
|
|
41
|
+
onChange: g,
|
|
42
|
+
disabled: C = !1,
|
|
43
|
+
className: D,
|
|
44
|
+
wrpClassName: T,
|
|
45
|
+
noResultsMessage: z,
|
|
46
|
+
clearable: A = !0,
|
|
49
47
|
multiple: l = !1,
|
|
50
|
-
size:
|
|
48
|
+
size: V
|
|
51
49
|
}) {
|
|
52
|
-
const [
|
|
53
|
-
|
|
54
|
-
)
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
loading: !1,
|
|
70
|
-
error: t instanceof Error ? t.message : "Failed to fetch options"
|
|
71
|
-
});
|
|
72
|
-
} finally {
|
|
73
|
-
v((t) => ({ ...t, loading: !1 }));
|
|
74
|
-
}
|
|
75
|
-
})(), () => {
|
|
76
|
-
R([]), F(/* @__PURE__ */ new Map());
|
|
77
|
-
}), [a, c]), j(() => {
|
|
78
|
-
if (g)
|
|
79
|
-
if (c) {
|
|
80
|
-
const n = I.get("__preload__") || [];
|
|
81
|
-
if (S) {
|
|
82
|
-
const t = n.filter(
|
|
83
|
-
(o) => f ? f(o, S) : String(s(o)).toLowerCase().includes(S.toLowerCase())
|
|
84
|
-
);
|
|
85
|
-
R(t);
|
|
86
|
-
} else
|
|
87
|
-
R(n);
|
|
88
|
-
} else {
|
|
89
|
-
const n = S || "";
|
|
90
|
-
if (I.has(n)) {
|
|
91
|
-
const t = I.get(n);
|
|
92
|
-
R(t);
|
|
93
|
-
} else
|
|
94
|
-
(async () => {
|
|
95
|
-
try {
|
|
96
|
-
v({ loading: !0, error: null });
|
|
97
|
-
const o = await a(S);
|
|
98
|
-
F((y) => new Map(y).set(n, o)), R(o);
|
|
99
|
-
} catch (o) {
|
|
100
|
-
v({
|
|
101
|
-
loading: !1,
|
|
102
|
-
error: o instanceof Error ? o.message : "Failed to fetch options"
|
|
103
|
-
});
|
|
104
|
-
} finally {
|
|
105
|
-
v((o) => ({ ...o, loading: !1 }));
|
|
106
|
-
}
|
|
107
|
-
})();
|
|
50
|
+
const [m, E] = p(!1), L = S.useRef(null), P = S.useRef(null), ee = S.useRef(null), [re, F] = p({ loading: !1, error: null }), [U, ne] = p(""), I = le(U, x), [W, X] = p(/* @__PURE__ */ new Map()), [B, $] = p([]), [q, te] = p(0), [H, J] = p(() => t?.length ? new Map(
|
|
51
|
+
t.map((e) => [a(e), e])
|
|
52
|
+
) : /* @__PURE__ */ new Map());
|
|
53
|
+
N(() => {
|
|
54
|
+
t?.length && (X((e) => {
|
|
55
|
+
const o = new Map(e);
|
|
56
|
+
return o.has("") || o.set("", t), o;
|
|
57
|
+
}), $((e) => e.length ? e : t), J((e) => {
|
|
58
|
+
const o = new Map(e);
|
|
59
|
+
return t.forEach((c) => o.set(a(c), c)), o;
|
|
60
|
+
}));
|
|
61
|
+
}, [t, a]);
|
|
62
|
+
const [M, Q] = p([]), R = j(
|
|
63
|
+
(e) => {
|
|
64
|
+
if (!e) {
|
|
65
|
+
Q([]);
|
|
66
|
+
return;
|
|
108
67
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
68
|
+
const c = (Array.isArray(e) ? e : [e]).map((d) => {
|
|
69
|
+
const w = H.get(d);
|
|
70
|
+
if (w) return w;
|
|
71
|
+
if (t?.length) {
|
|
72
|
+
const k = t.find(
|
|
73
|
+
(oe) => a(oe) === d
|
|
74
|
+
);
|
|
75
|
+
if (k) return k;
|
|
76
|
+
}
|
|
77
|
+
return B.find(
|
|
78
|
+
(k) => a(k) === d
|
|
79
|
+
) ?? null;
|
|
80
|
+
}).filter(Boolean);
|
|
81
|
+
Q(c);
|
|
82
|
+
},
|
|
83
|
+
[H, a, t, B]
|
|
84
|
+
);
|
|
85
|
+
N(() => {
|
|
86
|
+
R(n);
|
|
87
|
+
}, [n, R]);
|
|
88
|
+
const G = S.useMemo(() => l ? null : M[0] ?? null, [l, M]);
|
|
89
|
+
N(() => {
|
|
90
|
+
if (!m) return;
|
|
91
|
+
const e = I || "";
|
|
92
|
+
if (W.has(e)) {
|
|
93
|
+
$(W.get(e));
|
|
94
|
+
return;
|
|
123
95
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
96
|
+
(async () => {
|
|
97
|
+
try {
|
|
98
|
+
F({ loading: !0, error: null });
|
|
99
|
+
const c = await i(I);
|
|
100
|
+
X((d) => new Map(d).set(e, c)), $(c), J((d) => {
|
|
101
|
+
const w = new Map(d);
|
|
102
|
+
return c.forEach((K) => w.set(a(K), K)), w;
|
|
103
|
+
});
|
|
104
|
+
} catch (c) {
|
|
105
|
+
F({
|
|
106
|
+
loading: !1,
|
|
107
|
+
error: c instanceof Error ? c.message : "Failed to fetch options"
|
|
108
|
+
});
|
|
109
|
+
} finally {
|
|
110
|
+
F((c) => ({ ...c, loading: !1 }));
|
|
111
|
+
}
|
|
112
|
+
})();
|
|
113
|
+
}, [m, I, W, i, a]), N(() => {
|
|
114
|
+
m && R(n);
|
|
115
|
+
}, [m, R, n]), N(() => {
|
|
116
|
+
m && L.current && L.current.focus();
|
|
117
|
+
}, [m]), N(() => {
|
|
118
|
+
if (!m || !P.current) return;
|
|
119
|
+
const e = P.current.getBoundingClientRect();
|
|
120
|
+
te(e.width);
|
|
121
|
+
}, [m]);
|
|
122
|
+
const se = j(
|
|
123
|
+
(e) => {
|
|
124
|
+
g?.(A && e === n ? "" : e), E(!1);
|
|
128
125
|
},
|
|
129
|
-
[
|
|
130
|
-
),
|
|
131
|
-
(
|
|
126
|
+
[n, g, A]
|
|
127
|
+
), ce = j(
|
|
128
|
+
(e) => {
|
|
132
129
|
if (!l) return;
|
|
133
|
-
const
|
|
134
|
-
let
|
|
135
|
-
|
|
130
|
+
const o = Array.isArray(n) ? n : [], c = o.includes(e);
|
|
131
|
+
let d;
|
|
132
|
+
c ? d = o.filter((w) => w !== e) : d = [...o, e], g?.(d);
|
|
136
133
|
},
|
|
137
|
-
[
|
|
138
|
-
),
|
|
139
|
-
(
|
|
140
|
-
|
|
134
|
+
[n, g, l]
|
|
135
|
+
), ae = j(
|
|
136
|
+
(e) => {
|
|
137
|
+
e.stopPropagation(), e.preventDefault(), g?.(l ? [] : ""), E(!1);
|
|
141
138
|
},
|
|
142
|
-
[
|
|
143
|
-
),
|
|
144
|
-
return /* @__PURE__ */
|
|
145
|
-
|
|
146
|
-
{
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
)
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
onClick: se,
|
|
177
|
-
onMouseDown: (n) => n.preventDefault(),
|
|
178
|
-
"aria-label": "Clear selection",
|
|
179
|
-
children: /* @__PURE__ */ e(
|
|
180
|
-
X,
|
|
181
|
-
{
|
|
182
|
-
name: "X",
|
|
183
|
-
size: "xs",
|
|
184
|
-
className: "!text-d-foreground opacity-50"
|
|
185
|
-
}
|
|
186
|
-
)
|
|
187
|
-
}
|
|
188
|
-
),
|
|
189
|
-
/* @__PURE__ */ e(
|
|
190
|
-
X,
|
|
139
|
+
[g]
|
|
140
|
+
), Y = S.useId();
|
|
141
|
+
return /* @__PURE__ */ u("div", { className: v("flex flex-col gap-2", T), children: [
|
|
142
|
+
y && /* @__PURE__ */ r(ge, { htmlFor: Y, children: y }),
|
|
143
|
+
/* @__PURE__ */ u(pe, { open: m, onOpenChange: E, children: [
|
|
144
|
+
/* @__PURE__ */ r(xe, { asChild: !0, children: /* @__PURE__ */ r(
|
|
145
|
+
"button",
|
|
146
|
+
{
|
|
147
|
+
id: Y,
|
|
148
|
+
ref: P,
|
|
149
|
+
type: "button",
|
|
150
|
+
disabled: C,
|
|
151
|
+
className: v(
|
|
152
|
+
be({ size: V }),
|
|
153
|
+
"!border-d-border/50 border !shadow-none",
|
|
154
|
+
C && "cursor-not-allowed opacity-50",
|
|
155
|
+
"font-normal",
|
|
156
|
+
"w-full",
|
|
157
|
+
"focus-visible:ring-d-ring focus-visible:ring-1",
|
|
158
|
+
m && "ring-d-ring ring-1",
|
|
159
|
+
D
|
|
160
|
+
),
|
|
161
|
+
children: /* @__PURE__ */ u("div", { className: "flex w-full flex-1 items-center justify-between overflow-hidden", children: [
|
|
162
|
+
l ? Array.isArray(n) && n.length > 0 ? /* @__PURE__ */ r("div", { className: "min-w-0 flex-1 truncate text-left", children: n.length === 1 ? M[0] && s(M[0]) : `${n.length} elementi selezionati` }) : /* @__PURE__ */ r("span", { className: "text-d-muted-foreground truncate text-left", children: f }) : G ? /* @__PURE__ */ r("div", { className: "min-w-0 flex-1 truncate text-left", children: s(G) }) : /* @__PURE__ */ r("span", { className: "text-d-muted-foreground truncate text-left", children: f }),
|
|
163
|
+
/* @__PURE__ */ u("div", { className: "flex flex-shrink-0 items-center justify-end gap-1", children: [
|
|
164
|
+
A && (l && Array.isArray(n) && n.length > 0 || !l && G) && /* @__PURE__ */ r(
|
|
165
|
+
"div",
|
|
166
|
+
{
|
|
167
|
+
className: "border-d-input bg-d-accent cursor-pointer rounded-full p-1",
|
|
168
|
+
onClick: ae,
|
|
169
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
170
|
+
"aria-label": "Clear selection",
|
|
171
|
+
children: /* @__PURE__ */ r(
|
|
172
|
+
Z,
|
|
191
173
|
{
|
|
192
|
-
name: "
|
|
174
|
+
name: "X",
|
|
193
175
|
size: "xs",
|
|
194
176
|
className: "!text-d-foreground opacity-50"
|
|
195
177
|
}
|
|
196
178
|
)
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
/* @__PURE__ */ e(
|
|
202
|
-
fe,
|
|
203
|
-
{
|
|
204
|
-
className: L("p-0"),
|
|
205
|
-
style: {
|
|
206
|
-
width: C ? B ? `${B}px` : void 0 : typeof x == "number" ? `${x}px` : x
|
|
207
|
-
},
|
|
208
|
-
align: "start",
|
|
209
|
-
side: "bottom",
|
|
210
|
-
sideOffset: 4,
|
|
211
|
-
onWheel: (n) => n.stopPropagation(),
|
|
212
|
-
avoidCollisions: !1,
|
|
213
|
-
children: /* @__PURE__ */ e(
|
|
214
|
-
be,
|
|
179
|
+
}
|
|
180
|
+
),
|
|
181
|
+
/* @__PURE__ */ r(
|
|
182
|
+
Z,
|
|
215
183
|
{
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
searchTerm: K,
|
|
220
|
-
onSearchTermChange: V,
|
|
221
|
-
fetchState: Z,
|
|
222
|
-
options: w,
|
|
223
|
-
loadingSkeleton: M,
|
|
224
|
-
notFound: u,
|
|
225
|
-
noResultsMessage: D,
|
|
226
|
-
multiple: l,
|
|
227
|
-
value: r,
|
|
228
|
-
getOptionValue: m,
|
|
229
|
-
getDisplayValue: s,
|
|
230
|
-
renderOption: k,
|
|
231
|
-
onSelect: re,
|
|
232
|
-
onSelectMultiple: te
|
|
184
|
+
name: "ChevronsUpDown",
|
|
185
|
+
size: "xs",
|
|
186
|
+
className: "!text-d-foreground opacity-50"
|
|
233
187
|
}
|
|
234
188
|
)
|
|
189
|
+
] })
|
|
190
|
+
] })
|
|
191
|
+
}
|
|
192
|
+
) }),
|
|
193
|
+
/* @__PURE__ */ r(
|
|
194
|
+
we,
|
|
195
|
+
{
|
|
196
|
+
className: v("p-0"),
|
|
197
|
+
style: { width: q ? `${q}px` : void 0 },
|
|
198
|
+
align: "start",
|
|
199
|
+
side: "bottom",
|
|
200
|
+
sideOffset: 4,
|
|
201
|
+
onWheel: (e) => e.stopPropagation(),
|
|
202
|
+
avoidCollisions: !1,
|
|
203
|
+
children: /* @__PURE__ */ r(
|
|
204
|
+
Ae,
|
|
205
|
+
{
|
|
206
|
+
inputRef: L,
|
|
207
|
+
commandListRef: ee,
|
|
208
|
+
placeholder: f,
|
|
209
|
+
searchTerm: U,
|
|
210
|
+
onSearchTermChange: ne,
|
|
211
|
+
fetchState: re,
|
|
212
|
+
options: B,
|
|
213
|
+
notFound: h,
|
|
214
|
+
noResultsMessage: z,
|
|
215
|
+
multiple: l,
|
|
216
|
+
value: n,
|
|
217
|
+
resolveOptionValue: a,
|
|
218
|
+
renderSelectedValue: s,
|
|
219
|
+
renderOptionItem: b,
|
|
220
|
+
onSelect: se,
|
|
221
|
+
onSelectMultiple: ce
|
|
235
222
|
}
|
|
236
223
|
)
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
}
|
|
240
|
-
);
|
|
224
|
+
}
|
|
225
|
+
)
|
|
226
|
+
] })
|
|
227
|
+
] });
|
|
241
228
|
}
|
|
242
|
-
function
|
|
243
|
-
option:
|
|
244
|
-
multiple:
|
|
245
|
-
value:
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
onSelect:
|
|
250
|
-
onSelectMultiple:
|
|
229
|
+
function Ce({
|
|
230
|
+
option: i,
|
|
231
|
+
multiple: t,
|
|
232
|
+
value: x,
|
|
233
|
+
resolveOptionValue: b,
|
|
234
|
+
renderSelectedValue: a,
|
|
235
|
+
renderOptionItem: s,
|
|
236
|
+
onSelect: h,
|
|
237
|
+
onSelectMultiple: y
|
|
251
238
|
}) {
|
|
252
|
-
const
|
|
253
|
-
let
|
|
254
|
-
return
|
|
255
|
-
|
|
239
|
+
const f = b(i);
|
|
240
|
+
let n = !1;
|
|
241
|
+
return t ? n = Array.isArray(x) && x.includes(f) : n = x === f, /* @__PURE__ */ r(
|
|
242
|
+
O,
|
|
256
243
|
{
|
|
257
|
-
value:
|
|
258
|
-
onSelect:
|
|
244
|
+
value: f,
|
|
245
|
+
onSelect: t ? y : h,
|
|
259
246
|
className: "cursor-pointer",
|
|
260
|
-
children: /* @__PURE__ */
|
|
261
|
-
/* @__PURE__ */
|
|
262
|
-
|
|
263
|
-
s ? /* @__PURE__ */
|
|
247
|
+
children: /* @__PURE__ */ u("div", { className: "flex w-full items-center justify-between overflow-hidden", children: [
|
|
248
|
+
/* @__PURE__ */ u("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
249
|
+
t && /* @__PURE__ */ r(ie, { checked: n }),
|
|
250
|
+
s ? /* @__PURE__ */ r("div", { className: "truncate", children: s(i) }) : /* @__PURE__ */ r("span", { className: "truncate", children: a(i) })
|
|
264
251
|
] }),
|
|
265
|
-
/* @__PURE__ */
|
|
266
|
-
|
|
252
|
+
/* @__PURE__ */ r(
|
|
253
|
+
Ne,
|
|
267
254
|
{
|
|
268
|
-
className:
|
|
255
|
+
className: v(
|
|
269
256
|
"ml-2 h-4 w-4 flex-shrink-0",
|
|
270
|
-
|
|
257
|
+
n ? "opacity-100" : "opacity-0"
|
|
271
258
|
)
|
|
272
259
|
}
|
|
273
260
|
)
|
|
274
261
|
] })
|
|
275
262
|
},
|
|
276
|
-
|
|
263
|
+
f
|
|
277
264
|
);
|
|
278
265
|
}
|
|
279
|
-
function
|
|
280
|
-
inputRef:
|
|
281
|
-
commandListRef:
|
|
282
|
-
placeholder:
|
|
283
|
-
searchTerm:
|
|
284
|
-
onSearchTermChange:
|
|
266
|
+
function Ae({
|
|
267
|
+
inputRef: i,
|
|
268
|
+
commandListRef: t,
|
|
269
|
+
placeholder: x,
|
|
270
|
+
searchTerm: b,
|
|
271
|
+
onSearchTermChange: a,
|
|
285
272
|
fetchState: s,
|
|
286
|
-
options:
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
renderOption: x,
|
|
273
|
+
options: h,
|
|
274
|
+
notFound: y,
|
|
275
|
+
noResultsMessage: f,
|
|
276
|
+
multiple: n,
|
|
277
|
+
value: g,
|
|
278
|
+
resolveOptionValue: C,
|
|
279
|
+
renderSelectedValue: D,
|
|
280
|
+
renderOptionItem: T,
|
|
295
281
|
onSelect: z,
|
|
296
|
-
onSelectMultiple:
|
|
282
|
+
onSelectMultiple: A
|
|
297
283
|
}) {
|
|
298
|
-
return /* @__PURE__ */
|
|
299
|
-
/* @__PURE__ */
|
|
300
|
-
|
|
284
|
+
return /* @__PURE__ */ u(fe, { shouldFilter: !1, className: "w-full border-none shadow-sm", children: [
|
|
285
|
+
/* @__PURE__ */ r(
|
|
286
|
+
me,
|
|
301
287
|
{
|
|
302
|
-
ref:
|
|
303
|
-
placeholder:
|
|
288
|
+
ref: i,
|
|
289
|
+
placeholder: x,
|
|
304
290
|
className: "placeholder:text-d-muted-foreground",
|
|
305
|
-
value:
|
|
306
|
-
onValueChange:
|
|
291
|
+
value: b,
|
|
292
|
+
onValueChange: a
|
|
307
293
|
}
|
|
308
294
|
),
|
|
309
|
-
s.loading &&
|
|
310
|
-
/* @__PURE__ */
|
|
311
|
-
s.error && /* @__PURE__ */
|
|
312
|
-
s.loading &&
|
|
313
|
-
!s.loading && !s.error &&
|
|
314
|
-
!s.loading && !s.error &&
|
|
315
|
-
|
|
295
|
+
s.loading && h.length > 0 && /* @__PURE__ */ r("div", { className: "flex items-center justify-center p-2", children: /* @__PURE__ */ r(ye, { className: "h-4 w-4 animate-spin" }) }),
|
|
296
|
+
/* @__PURE__ */ u(ue, { ref: t, children: [
|
|
297
|
+
s.error && /* @__PURE__ */ r("div", { className: "text-d-destructive p-3 text-center", children: s.error }),
|
|
298
|
+
s.loading && h.length === 0 && /* @__PURE__ */ r(Se, {}),
|
|
299
|
+
!s.loading && !s.error && h.length === 0 && (y || /* @__PURE__ */ r(he, { children: f || "No results found." })),
|
|
300
|
+
!s.loading && !s.error && h.length > 0 && /* @__PURE__ */ r(_, { children: h.map((l) => /* @__PURE__ */ r(
|
|
301
|
+
Ce,
|
|
316
302
|
{
|
|
317
|
-
option:
|
|
318
|
-
multiple:
|
|
319
|
-
value:
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
303
|
+
option: l,
|
|
304
|
+
multiple: n,
|
|
305
|
+
value: g,
|
|
306
|
+
resolveOptionValue: C,
|
|
307
|
+
renderSelectedValue: D,
|
|
308
|
+
renderOptionItem: T,
|
|
323
309
|
onSelect: z,
|
|
324
|
-
onSelectMultiple:
|
|
310
|
+
onSelectMultiple: A
|
|
325
311
|
},
|
|
326
|
-
|
|
312
|
+
C(l)
|
|
327
313
|
)) })
|
|
328
314
|
] })
|
|
329
315
|
] });
|
|
330
316
|
}
|
|
331
|
-
function
|
|
332
|
-
return /* @__PURE__ */
|
|
333
|
-
/* @__PURE__ */
|
|
334
|
-
/* @__PURE__ */
|
|
335
|
-
/* @__PURE__ */
|
|
336
|
-
/* @__PURE__ */
|
|
317
|
+
function Se() {
|
|
318
|
+
return /* @__PURE__ */ r(_, { children: [1, 2, 3].map((i) => /* @__PURE__ */ r(O, { disabled: !0, children: /* @__PURE__ */ u("div", { className: "flex w-full items-center gap-2", children: [
|
|
319
|
+
/* @__PURE__ */ r("div", { className: "bg-d-secondary h-6 w-6 animate-pulse rounded-full" }),
|
|
320
|
+
/* @__PURE__ */ u("div", { className: "flex flex-1 flex-col gap-1", children: [
|
|
321
|
+
/* @__PURE__ */ r("div", { className: "bg-d-secondary h-4 w-24 animate-pulse rounded" }),
|
|
322
|
+
/* @__PURE__ */ r("div", { className: "bg-d-secondary h-3 w-16 animate-pulse rounded" })
|
|
337
323
|
] })
|
|
338
|
-
] }) },
|
|
324
|
+
] }) }, i)) });
|
|
339
325
|
}
|
|
340
326
|
export {
|
|
341
|
-
|
|
342
|
-
|
|
327
|
+
Ie as AsyncSelect,
|
|
328
|
+
be as selectTriggerVariants
|
|
343
329
|
};
|