laif-ds 0.1.52 → 0.1.54
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/index.js +5 -2
- package/dist/_virtual/index3.js +2 -5
- package/dist/components/ui/async-select.js +33 -32
- package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +1 -1
- package/dist/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/recharts/es6/util/ReactUtils.js +1 -1
- package/dist/node_modules/use-sync-external-store/shim/index.js +1 -1
- package/package.json +1 -1
package/dist/_virtual/index.js
CHANGED
package/dist/_virtual/index3.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
3
3
|
import * as Y from "react";
|
|
4
|
-
import { useState as
|
|
4
|
+
import { useState as i, useEffect as j, useCallback as D } from "react";
|
|
5
5
|
import { useDebounce as Z } from "../../hooks/use-debounce.js";
|
|
6
6
|
import { cva as _ } from "../../node_modules/class-variance-authority/dist/index.js";
|
|
7
7
|
import { cn as k } from "../../lib/utils.js";
|
|
8
8
|
import { Button as V } from "./button.js";
|
|
9
9
|
import { Label as ee } from "./label.js";
|
|
10
10
|
import { Command as te, CommandInput as oe, CommandList as se, CommandEmpty as ne, CommandGroup as O, CommandItem as R } from "./command.js";
|
|
11
|
-
import { Popover as re, PopoverTrigger as ae, PopoverContent as
|
|
12
|
-
import
|
|
11
|
+
import { Popover as re, PopoverTrigger as ae, PopoverContent as ie } from "./popover.js";
|
|
12
|
+
import ce from "../../node_modules/lucide-react/dist/esm/icons/x.js";
|
|
13
13
|
import le from "../../node_modules/lucide-react/dist/esm/icons/chevrons-up-down.js";
|
|
14
14
|
import de from "../../node_modules/lucide-react/dist/esm/icons/loader-circle.js";
|
|
15
15
|
import me from "../../node_modules/lucide-react/dist/esm/icons/check.js";
|
|
@@ -29,38 +29,38 @@ const fe = _(
|
|
|
29
29
|
}
|
|
30
30
|
);
|
|
31
31
|
function ke({
|
|
32
|
-
fetcher:
|
|
32
|
+
fetcher: c,
|
|
33
33
|
preload: m,
|
|
34
34
|
filterFn: x,
|
|
35
35
|
renderOption: A,
|
|
36
36
|
getOptionValue: a,
|
|
37
|
-
getDisplayValue:
|
|
37
|
+
getDisplayValue: v,
|
|
38
38
|
notFound: F,
|
|
39
39
|
loadingSkeleton: $,
|
|
40
40
|
label: l,
|
|
41
41
|
labelClassName: B,
|
|
42
42
|
placeholder: G = "Select...",
|
|
43
43
|
value: n,
|
|
44
|
-
onChange:
|
|
44
|
+
onChange: u,
|
|
45
45
|
disabled: z = !1,
|
|
46
46
|
width: E = "200px",
|
|
47
47
|
className: M,
|
|
48
48
|
triggerClassName: U,
|
|
49
49
|
noResultsMessage: X,
|
|
50
|
-
clearable:
|
|
50
|
+
clearable: w = !0,
|
|
51
51
|
size: q
|
|
52
52
|
}) {
|
|
53
|
-
const [
|
|
53
|
+
const [p, N] = i(!1), [r, d] = i([]), [b, h] = i(!1), [C, g] = i(null), [S, y] = i(null), [I, H] = i(""), f = Z(I, m ? 0 : 300), [L, P] = i([]);
|
|
54
54
|
j(() => ((async () => {
|
|
55
55
|
try {
|
|
56
56
|
if (h(!0), g(null), m) {
|
|
57
57
|
console.log(
|
|
58
58
|
"[AsyncSelect] Preload attivo: caricamento completo dei dati"
|
|
59
59
|
);
|
|
60
|
-
const o = await
|
|
60
|
+
const o = await c("");
|
|
61
61
|
P(o), d(o);
|
|
62
62
|
} else {
|
|
63
|
-
const o = await
|
|
63
|
+
const o = await c(n);
|
|
64
64
|
d(o);
|
|
65
65
|
}
|
|
66
66
|
} catch (o) {
|
|
@@ -72,12 +72,12 @@ function ke({
|
|
|
72
72
|
}
|
|
73
73
|
})(), () => {
|
|
74
74
|
d([]), P([]);
|
|
75
|
-
}), [
|
|
76
|
-
if (
|
|
75
|
+
}), [c, n, m]), j(() => {
|
|
76
|
+
if (p)
|
|
77
77
|
if (m)
|
|
78
78
|
if (f) {
|
|
79
79
|
const t = L.filter(
|
|
80
|
-
(o) => x ? x(o, f) : String(
|
|
80
|
+
(o) => x ? x(o, f) : String(v(o)).toLowerCase().includes(f.toLowerCase())
|
|
81
81
|
);
|
|
82
82
|
d(t);
|
|
83
83
|
} else
|
|
@@ -86,7 +86,7 @@ function ke({
|
|
|
86
86
|
(async () => {
|
|
87
87
|
try {
|
|
88
88
|
h(!0), g(null);
|
|
89
|
-
const o = await
|
|
89
|
+
const o = await c(f);
|
|
90
90
|
d(o);
|
|
91
91
|
} catch (o) {
|
|
92
92
|
g(
|
|
@@ -97,12 +97,12 @@ function ke({
|
|
|
97
97
|
}
|
|
98
98
|
})();
|
|
99
99
|
}, [
|
|
100
|
-
|
|
100
|
+
p,
|
|
101
101
|
f,
|
|
102
102
|
m,
|
|
103
103
|
x,
|
|
104
104
|
L,
|
|
105
|
-
|
|
105
|
+
v
|
|
106
106
|
]), j(() => {
|
|
107
107
|
if (n && r.length > 0) {
|
|
108
108
|
const t = r.find((o) => a(o) === n);
|
|
@@ -111,27 +111,27 @@ function ke({
|
|
|
111
111
|
}, [n, r, a]);
|
|
112
112
|
const J = D(
|
|
113
113
|
(t) => {
|
|
114
|
-
const o =
|
|
115
|
-
y(Q),
|
|
114
|
+
const o = w && t === n ? "" : t, Q = r.find((W) => a(W) === o) || null;
|
|
115
|
+
y(Q), u(o), N(!1);
|
|
116
116
|
},
|
|
117
|
-
[n,
|
|
117
|
+
[n, u, w, r, a]
|
|
118
118
|
), K = D(
|
|
119
119
|
(t) => {
|
|
120
|
-
t.stopPropagation(), t.preventDefault(), y(null),
|
|
120
|
+
t.stopPropagation(), t.preventDefault(), y(null), u(""), N(!1);
|
|
121
121
|
},
|
|
122
|
-
[
|
|
122
|
+
[u]
|
|
123
123
|
), T = Y.useId();
|
|
124
124
|
return /* @__PURE__ */ s("div", { className: "space-y-1.5", children: [
|
|
125
125
|
l && /* @__PURE__ */ e(ee, { htmlFor: T, className: B, children: l }),
|
|
126
|
-
/* @__PURE__ */ s(re, { open:
|
|
127
|
-
/* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(
|
|
126
|
+
/* @__PURE__ */ s(re, { open: p, onOpenChange: N, children: [
|
|
127
|
+
/* @__PURE__ */ e(ae, { asChild: !0, children: /* @__PURE__ */ e(
|
|
128
128
|
V,
|
|
129
129
|
{
|
|
130
130
|
id: T,
|
|
131
131
|
type: "button",
|
|
132
132
|
variant: "ghost",
|
|
133
133
|
role: "combobox",
|
|
134
|
-
"aria-expanded":
|
|
134
|
+
"aria-expanded": p,
|
|
135
135
|
className: k(
|
|
136
136
|
fe({ size: q }),
|
|
137
137
|
z && "cursor-not-allowed opacity-50",
|
|
@@ -141,16 +141,16 @@ function ke({
|
|
|
141
141
|
style: { width: E },
|
|
142
142
|
disabled: z,
|
|
143
143
|
children: /* @__PURE__ */ s("div", { className: "flex flex-1 items-center justify-between overflow-hidden", children: [
|
|
144
|
-
S ? /* @__PURE__ */ e("div", { className: "truncate", children:
|
|
144
|
+
S ? /* @__PURE__ */ e("div", { className: "truncate", children: v(S) }) : /* @__PURE__ */ e("span", { className: "text-d-muted-foreground hover:text-d-foreground", children: G }),
|
|
145
145
|
/* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
|
|
146
|
-
|
|
146
|
+
w && S && /* @__PURE__ */ e(
|
|
147
147
|
"div",
|
|
148
148
|
{
|
|
149
149
|
className: "bg-d-secondary/20 hover:bg-d-secondary/30 z-20 flex cursor-pointer items-center justify-center rounded-full border p-1",
|
|
150
150
|
onClick: K,
|
|
151
151
|
onMouseDown: (t) => t.preventDefault(),
|
|
152
152
|
"aria-label": "Clear selection",
|
|
153
|
-
children: /* @__PURE__ */ e(
|
|
153
|
+
children: /* @__PURE__ */ e(ce, { size: 8, className: "text-d-foreground" })
|
|
154
154
|
}
|
|
155
155
|
),
|
|
156
156
|
/* @__PURE__ */ e(le, { className: "opacity-50", size: 10 })
|
|
@@ -159,7 +159,7 @@ function ke({
|
|
|
159
159
|
}
|
|
160
160
|
) }),
|
|
161
161
|
/* @__PURE__ */ e(
|
|
162
|
-
|
|
162
|
+
ie,
|
|
163
163
|
{
|
|
164
164
|
style: { width: E },
|
|
165
165
|
className: k("p-0", M),
|
|
@@ -168,6 +168,7 @@ function ke({
|
|
|
168
168
|
/* @__PURE__ */ e(
|
|
169
169
|
oe,
|
|
170
170
|
{
|
|
171
|
+
className: "!outline-none !focus:outline-none !focus-visible:outline-none !focus:ring-0 !focus:ring-offset-0 !focus-visible:ring-0 !focus-visible:ring-offset-0 !border-none",
|
|
171
172
|
placeholder: `Search ${typeof l == "string" ? l.toLowerCase() : "options"}...`,
|
|
172
173
|
value: I,
|
|
173
174
|
onValueChange: (t) => {
|
|
@@ -179,7 +180,7 @@ function ke({
|
|
|
179
180
|
] }),
|
|
180
181
|
/* @__PURE__ */ s(se, { children: [
|
|
181
182
|
C && /* @__PURE__ */ e("div", { className: "text-d-destructive p-3 text-center", children: C }),
|
|
182
|
-
b && r.length === 0 && ($ || /* @__PURE__ */ e(
|
|
183
|
+
b && r.length === 0 && ($ || /* @__PURE__ */ e(ue, {})),
|
|
183
184
|
!b && !C && r.length === 0 && (F || /* @__PURE__ */ e(ne, { children: X ?? `No ${typeof l == "string" ? l.toLowerCase() : "options"} found.` })),
|
|
184
185
|
/* @__PURE__ */ e(O, { children: r.map((t) => /* @__PURE__ */ s(
|
|
185
186
|
R,
|
|
@@ -208,14 +209,14 @@ function ke({
|
|
|
208
209
|
] })
|
|
209
210
|
] });
|
|
210
211
|
}
|
|
211
|
-
function
|
|
212
|
-
return /* @__PURE__ */ e(O, { children: [1, 2, 3].map((
|
|
212
|
+
function ue() {
|
|
213
|
+
return /* @__PURE__ */ e(O, { children: [1, 2, 3].map((c) => /* @__PURE__ */ e(R, { disabled: !0, children: /* @__PURE__ */ s("div", { className: "flex w-full items-center gap-2", children: [
|
|
213
214
|
/* @__PURE__ */ e("div", { className: "bg-d-secondary h-6 w-6 animate-pulse rounded-full" }),
|
|
214
215
|
/* @__PURE__ */ s("div", { className: "flex flex-1 flex-col gap-1", children: [
|
|
215
216
|
/* @__PURE__ */ e("div", { className: "bg-d-secondary h-4 w-24 animate-pulse rounded" }),
|
|
216
217
|
/* @__PURE__ */ e("div", { className: "bg-d-secondary h-3 w-16 animate-pulse rounded" })
|
|
217
218
|
] })
|
|
218
|
-
] }) },
|
|
219
|
+
] }) }, c)) });
|
|
219
220
|
}
|
|
220
221
|
export {
|
|
221
222
|
ke as AsyncSelect
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { __module as e } from "../../_virtual/
|
|
2
|
+
import { __module as e } from "../../_virtual/index4.js";
|
|
3
3
|
import { __require as t } from "./cjs/react-is.production.min.js";
|
|
4
4
|
import { __require as o } from "./cjs/react-is.development.js";
|
|
5
5
|
var r;
|
|
@@ -5,7 +5,7 @@ import "../../../../_virtual/isString.js";
|
|
|
5
5
|
import f from "../../../../_virtual/isFunction.js";
|
|
6
6
|
import s from "../../../../_virtual/isObject.js";
|
|
7
7
|
import { isValidElement as d } from "react";
|
|
8
|
-
import "../../../../_virtual/
|
|
8
|
+
import "../../../../_virtual/index3.js";
|
|
9
9
|
import { SVGElementPropKeys as m, EventKeys as p, FilteredElementKeyMap as o } from "./types.js";
|
|
10
10
|
var h = function(i) {
|
|
11
11
|
return typeof i == "string" ? i : i ? i.displayName || i.name || "Component" : "";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { __module as e } from "../../../_virtual/
|
|
2
|
+
import { __module as e } from "../../../_virtual/index2.js";
|
|
3
3
|
import { __require as i } from "../cjs/use-sync-external-store-shim.production.js";
|
|
4
4
|
import { __require as o } from "../cjs/use-sync-external-store-shim.development.js";
|
|
5
5
|
var r;
|