laif-ds 0.2.14 → 0.2.15
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/index4.js +5 -2
- package/dist/_virtual/index6.js +2 -5
- package/dist/_virtual/index7.js +2 -2
- package/dist/components/ui/app-select.js +61 -57
- package/dist/node_modules/eventemitter3/index2.js +1 -1
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
- package/dist/node_modules/style-to-object/cjs/index.js +1 -1
- package/package.json +1 -1
package/dist/_virtual/index4.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
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);
|
|
3
6
|
export {
|
|
4
|
-
|
|
7
|
+
a as default
|
|
5
8
|
};
|
package/dist/_virtual/index6.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import { __require as e } from "../node_modules/style-to-js/cjs/index.js";
|
|
4
|
-
var t = e();
|
|
5
|
-
const a = /* @__PURE__ */ r(t);
|
|
2
|
+
var e = {};
|
|
6
3
|
export {
|
|
7
|
-
|
|
4
|
+
e as __exports
|
|
8
5
|
};
|
package/dist/_virtual/index7.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as o, jsx as
|
|
3
|
-
import { Badge as
|
|
4
|
-
import { Command as
|
|
2
|
+
import { jsxs as o, jsx as l, Fragment as te } from "react/jsx-runtime";
|
|
3
|
+
import { Badge as le } from "./badge.js";
|
|
4
|
+
import { Command as ne, CommandInput as re, CommandList as ae, CommandEmpty as se, CommandGroup as k, CommandItem as D } from "./command.js";
|
|
5
5
|
import { Label as oe } from "./label.js";
|
|
6
6
|
import { cn as g } from "../../lib/utils.js";
|
|
7
7
|
import * as s from "react";
|
|
8
8
|
import { Checkbox as ie } from "./checkbox.js";
|
|
9
9
|
import { Icon as j } from "./icon.js";
|
|
10
|
-
import { Popover as
|
|
10
|
+
import { Popover as ce, PopoverTrigger as de, PopoverContent as ue } from "./popover.js";
|
|
11
11
|
import me from "../../node_modules/lucide-react/dist/esm/icons/chevron-down.js";
|
|
12
12
|
const fe = {
|
|
13
13
|
sm: "min-h-8 h-8 text-xs py-1.5",
|
|
@@ -22,7 +22,7 @@ function Se(B) {
|
|
|
22
22
|
const {
|
|
23
23
|
multiple: a = !1,
|
|
24
24
|
options: f,
|
|
25
|
-
value:
|
|
25
|
+
value: S,
|
|
26
26
|
defaultValue: A,
|
|
27
27
|
onValueChange: R,
|
|
28
28
|
onClear: b,
|
|
@@ -32,108 +32,112 @@ function Se(B) {
|
|
|
32
32
|
addItemPlaceholder: T = "Aggiungi",
|
|
33
33
|
itemCountMessage: W = (e) => `${e} elementi selezionati`,
|
|
34
34
|
maxSelectedMessage: X = (e) => `Puoi selezionare fino a ${e} elementi`,
|
|
35
|
-
label:
|
|
35
|
+
label: P,
|
|
36
36
|
className: $ = "",
|
|
37
37
|
wrpClassName: q = "",
|
|
38
|
-
searchable:
|
|
38
|
+
searchable: V = !1,
|
|
39
39
|
creatable: G = !1,
|
|
40
40
|
groupBy: v = "group",
|
|
41
41
|
maxSelected: i,
|
|
42
42
|
showChipsInsteadOfCount: H = !1,
|
|
43
43
|
disabled: x,
|
|
44
|
-
size:
|
|
45
|
-
} = B, [C, w] = s.useState(!1), [d, y] = s.useState(""), c = s.useRef(null), [J, K] = s.useState(0), [Q,
|
|
44
|
+
size: z = "default"
|
|
45
|
+
} = B, [C, w] = s.useState(!1), [d, y] = s.useState(""), c = s.useRef(null), [J, K] = s.useState(0), [Q, N] = s.useState(null);
|
|
46
46
|
s.useEffect(() => {
|
|
47
47
|
if (c.current) {
|
|
48
48
|
const e = c.current.closest(
|
|
49
49
|
'[data-slot="drawer-content"]'
|
|
50
50
|
);
|
|
51
|
-
e &&
|
|
52
|
-
const
|
|
51
|
+
e && N(e);
|
|
52
|
+
const n = c.current.closest(
|
|
53
53
|
'[data-slot="sheet-content"]'
|
|
54
54
|
);
|
|
55
|
-
|
|
55
|
+
n && N(n);
|
|
56
|
+
const t = c.current.closest(
|
|
57
|
+
'[data-slot="dialog-content"]'
|
|
58
|
+
);
|
|
59
|
+
t && N(t);
|
|
56
60
|
}
|
|
57
61
|
}, []);
|
|
58
|
-
const O =
|
|
62
|
+
const O = S !== void 0, [U, Y] = s.useState(A), u = O ? S : U, m = (e) => {
|
|
59
63
|
O || Y(e), R?.(e);
|
|
60
|
-
},
|
|
61
|
-
const e = f.filter((
|
|
64
|
+
}, r = s.useMemo(() => a ? Array.isArray(u) ? u : [] : u != null ? [u] : [], [u, a]), p = s.useMemo(() => {
|
|
65
|
+
const e = f.filter((n) => r.includes(n.value));
|
|
62
66
|
if (a) {
|
|
63
|
-
const
|
|
64
|
-
return [...e, ...
|
|
65
|
-
} else if (
|
|
66
|
-
return [{ value:
|
|
67
|
+
const n = r.filter((t) => !e.find((h) => h.value === t)).map((t) => ({ value: t, label: t }));
|
|
68
|
+
return [...e, ...n];
|
|
69
|
+
} else if (r.length && !e.length)
|
|
70
|
+
return [{ value: r[0], label: r[0] }];
|
|
67
71
|
return e;
|
|
68
|
-
}, [f,
|
|
72
|
+
}, [f, r, a]), I = (e) => {
|
|
69
73
|
if (!e.disabled)
|
|
70
74
|
if (a) {
|
|
71
|
-
const
|
|
72
|
-
if (!
|
|
75
|
+
const n = r.includes(e.value);
|
|
76
|
+
if (!n && i !== void 0 && r.length >= i)
|
|
73
77
|
return;
|
|
74
78
|
m(
|
|
75
|
-
|
|
79
|
+
n ? r.filter((t) => t !== e.value) : [...r, e.value]
|
|
76
80
|
);
|
|
77
81
|
} else
|
|
78
82
|
m(e.value), w(!1);
|
|
79
83
|
}, Z = s.useCallback(() => {
|
|
80
84
|
m([]), y(""), b && b();
|
|
81
85
|
}, [m, b]), _ = s.useMemo(() => v ? f.reduce(
|
|
82
|
-
(e,
|
|
83
|
-
const
|
|
84
|
-
return e[
|
|
86
|
+
(e, n) => {
|
|
87
|
+
const t = n[v] || "";
|
|
88
|
+
return e[t] = e[t] || [], e[t].push(n), e;
|
|
85
89
|
},
|
|
86
90
|
{}
|
|
87
91
|
) : { "": f }, [f, v]);
|
|
88
92
|
return s.useEffect(() => {
|
|
89
93
|
C && c.current && K(c.current.getBoundingClientRect().width);
|
|
90
94
|
}, [C]), /* @__PURE__ */ o("div", { className: g("flex flex-col gap-2", q), children: [
|
|
91
|
-
|
|
95
|
+
P && /* @__PURE__ */ l(oe, { children: P }),
|
|
92
96
|
/* @__PURE__ */ o(
|
|
93
|
-
|
|
97
|
+
ce,
|
|
94
98
|
{
|
|
95
99
|
open: x ? !1 : C,
|
|
96
100
|
onOpenChange: (e) => !x && w(e),
|
|
97
101
|
children: [
|
|
98
|
-
/* @__PURE__ */
|
|
102
|
+
/* @__PURE__ */ l(de, { asChild: !0, children: /* @__PURE__ */ o(
|
|
99
103
|
"div",
|
|
100
104
|
{
|
|
101
105
|
ref: c,
|
|
102
106
|
className: g(
|
|
103
107
|
"bg-d-input border-d-border/50 focus-within:ring-d-ring flex min-h-10 w-full min-w-[100px] items-center justify-between gap-2 rounded-md border px-3 py-2 text-sm focus-within:ring-1",
|
|
104
|
-
fe[
|
|
108
|
+
fe[z],
|
|
105
109
|
x && "cursor-not-allowed opacity-50",
|
|
106
110
|
$
|
|
107
111
|
),
|
|
108
112
|
children: [
|
|
109
|
-
p.length === 0 ? /* @__PURE__ */
|
|
110
|
-
/* @__PURE__ */
|
|
111
|
-
|
|
113
|
+
p.length === 0 ? /* @__PURE__ */ l("span", { className: "text-d-muted-foreground", children: E }) : a ? /* @__PURE__ */ o("div", { className: "flex h-full w-full min-w-0 items-center justify-between gap-2", children: [
|
|
114
|
+
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-nowrap gap-1 overflow-auto", children: H ? /* @__PURE__ */ l(te, { children: p.map((e) => /* @__PURE__ */ o(
|
|
115
|
+
le,
|
|
112
116
|
{
|
|
113
117
|
variant: "secondary",
|
|
114
118
|
className: "hover:bg-d-secondary/100 bg-d-secondary/50 border-d-border flex cursor-pointer items-center gap-1 border",
|
|
115
|
-
onClick: (
|
|
116
|
-
|
|
119
|
+
onClick: (n) => {
|
|
120
|
+
n.stopPropagation(), I(e);
|
|
117
121
|
},
|
|
118
122
|
children: [
|
|
119
123
|
e.label,
|
|
120
|
-
!e.fixed && /* @__PURE__ */
|
|
124
|
+
!e.fixed && /* @__PURE__ */ l(j, { name: "X", size: "xs" })
|
|
121
125
|
]
|
|
122
126
|
},
|
|
123
127
|
e.value
|
|
124
|
-
)) }) : /* @__PURE__ */
|
|
125
|
-
/* @__PURE__ */
|
|
128
|
+
)) }) : /* @__PURE__ */ l("div", { children: W(p.length) }) }),
|
|
129
|
+
/* @__PURE__ */ l(
|
|
126
130
|
"div",
|
|
127
131
|
{
|
|
128
132
|
className: g(
|
|
129
133
|
"border-d-input bg-d-accent flex aspect-square cursor-pointer items-center rounded-full p-1",
|
|
130
|
-
he[
|
|
134
|
+
he[z]
|
|
131
135
|
),
|
|
132
136
|
onClick: (e) => {
|
|
133
137
|
e.stopPropagation(), e.preventDefault(), Z();
|
|
134
138
|
},
|
|
135
139
|
onMouseDown: (e) => e.preventDefault(),
|
|
136
|
-
children: /* @__PURE__ */
|
|
140
|
+
children: /* @__PURE__ */ l(
|
|
137
141
|
j,
|
|
138
142
|
{
|
|
139
143
|
name: "X",
|
|
@@ -143,12 +147,12 @@ function Se(B) {
|
|
|
143
147
|
)
|
|
144
148
|
}
|
|
145
149
|
)
|
|
146
|
-
] }) : /* @__PURE__ */
|
|
147
|
-
/* @__PURE__ */
|
|
150
|
+
] }) : /* @__PURE__ */ l("span", { children: p[0]?.label }),
|
|
151
|
+
/* @__PURE__ */ l(me, { className: "h-4 w-4 opacity-50" })
|
|
148
152
|
]
|
|
149
153
|
}
|
|
150
154
|
) }),
|
|
151
|
-
/* @__PURE__ */
|
|
155
|
+
/* @__PURE__ */ l(
|
|
152
156
|
ue,
|
|
153
157
|
{
|
|
154
158
|
className: "p-0",
|
|
@@ -156,9 +160,9 @@ function Se(B) {
|
|
|
156
160
|
align: "start",
|
|
157
161
|
sideOffset: 4,
|
|
158
162
|
container: Q,
|
|
159
|
-
children: /* @__PURE__ */ o(
|
|
160
|
-
|
|
161
|
-
|
|
163
|
+
children: /* @__PURE__ */ o(ne, { shouldFilter: !!V, className: "w-full", children: [
|
|
164
|
+
V && /* @__PURE__ */ l("div", { className: "border-d-border border-b p-0.5", children: /* @__PURE__ */ l(
|
|
165
|
+
re,
|
|
162
166
|
{
|
|
163
167
|
placeholder: L,
|
|
164
168
|
value: d,
|
|
@@ -166,13 +170,13 @@ function Se(B) {
|
|
|
166
170
|
}
|
|
167
171
|
) }),
|
|
168
172
|
/* @__PURE__ */ o(ae, { className: "max-h-60 overflow-auto overscroll-contain", children: [
|
|
169
|
-
/* @__PURE__ */
|
|
170
|
-
G && d && /* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ l(se, { children: F }),
|
|
174
|
+
G && d && /* @__PURE__ */ l(k, { children: /* @__PURE__ */ l(
|
|
171
175
|
D,
|
|
172
176
|
{
|
|
173
177
|
className: "cursor-pointer",
|
|
174
178
|
onSelect: () => {
|
|
175
|
-
d && (m(a ? [...
|
|
179
|
+
d && (m(a ? [...r, d] : d), y(""), !a && w(!1));
|
|
176
180
|
},
|
|
177
181
|
children: /* @__PURE__ */ o("div", { className: "text-d-foreground text-xs", children: [
|
|
178
182
|
T,
|
|
@@ -182,13 +186,13 @@ function Se(B) {
|
|
|
182
186
|
] })
|
|
183
187
|
}
|
|
184
188
|
) }),
|
|
185
|
-
Object.entries(_).map(([e,
|
|
186
|
-
const h =
|
|
189
|
+
Object.entries(_).map(([e, n]) => /* @__PURE__ */ l(k, { heading: e || void 0, children: n.map((t) => {
|
|
190
|
+
const h = r.includes(t.value), ee = a && i !== void 0 && !h && r.length >= i, M = t.disabled || ee;
|
|
187
191
|
return /* @__PURE__ */ o(
|
|
188
192
|
D,
|
|
189
193
|
{
|
|
190
|
-
value: typeof
|
|
191
|
-
onSelect: () => !M && I(
|
|
194
|
+
value: typeof t.label == "string" ? t.label : String(t.value),
|
|
195
|
+
onSelect: () => !M && I(t),
|
|
192
196
|
className: g(
|
|
193
197
|
"cursor-pointer",
|
|
194
198
|
M && "cursor-not-allowed opacity-50",
|
|
@@ -196,15 +200,15 @@ function Se(B) {
|
|
|
196
200
|
// highlight single select
|
|
197
201
|
),
|
|
198
202
|
children: [
|
|
199
|
-
a && /* @__PURE__ */
|
|
200
|
-
/* @__PURE__ */
|
|
203
|
+
a && /* @__PURE__ */ l(ie, { checked: h, className: "mr-1" }),
|
|
204
|
+
/* @__PURE__ */ l("span", { children: t.label })
|
|
201
205
|
]
|
|
202
206
|
},
|
|
203
|
-
|
|
207
|
+
t.value
|
|
204
208
|
);
|
|
205
209
|
}) }, e))
|
|
206
210
|
] }),
|
|
207
|
-
a && i !== void 0 &&
|
|
211
|
+
a && i !== void 0 && r.length >= i && /* @__PURE__ */ l("div", { className: "border-d-border text-d-muted-foreground border-t px-2 py-1 text-xs", children: X(i) })
|
|
208
212
|
] })
|
|
209
213
|
}
|
|
210
214
|
)
|
|
@@ -3,7 +3,7 @@ import { stringify as w } from "../../comma-separated-tokens/index.js";
|
|
|
3
3
|
import { ok as u } from "../../devlop/lib/default.js";
|
|
4
4
|
import { svg as m, html as C } from "../../property-information/index.js";
|
|
5
5
|
import { stringify as N } from "../../space-separated-tokens/index.js";
|
|
6
|
-
import S from "../../../_virtual/
|
|
6
|
+
import S from "../../../_virtual/index4.js";
|
|
7
7
|
import { whitespace as j } from "../../hast-util-whitespace/lib/index.js";
|
|
8
8
|
import { name as x } from "../../estree-util-is-identifier-name/lib/index.js";
|
|
9
9
|
import { VFileMessage as h } from "../../vfile-message/lib/index.js";
|