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