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