laif-ds 0.1.88 → 0.1.90
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 -5
- package/dist/_virtual/index5.js +5 -5
- package/dist/components/ui/app-multiple-select-dropdown.js +76 -73
- package/dist/components/ui/app-select.js +54 -34
- package/dist/components/ui/async-select.js +88 -87
- package/dist/components/ui/button.js +32 -32
- package/dist/components/ui/calendar.js +2 -2
- package/dist/components/ui/data-table.js +1 -1
- package/dist/components/ui/date-picker.js +7 -7
- package/dist/components/ui/input.js +15 -16
- package/dist/components/ui/multiple-selector.js +36 -34
- package/dist/components/ui/select.js +34 -29
- package/dist/components/ui/switch.js +1 -1
- package/dist/index.d.ts +8 -6
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
- package/dist/node_modules/unified/lib/index.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.v3.css +1 -1
- package/package.json +1 -1
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
|
-
import { getDefaultExportFromCjs as
|
|
3
|
-
import { __require as
|
|
4
|
-
var t =
|
|
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
|
};
|
|
@@ -1,86 +1,89 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as r, jsxs as l, Fragment as
|
|
2
|
+
import { jsx as r, jsxs as l, Fragment as A } from "react/jsx-runtime";
|
|
3
3
|
import * as t from "react";
|
|
4
|
-
import { useEffect as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { Label as
|
|
4
|
+
import { useEffect as E } from "react";
|
|
5
|
+
import { cn as m } from "../../lib/utils.js";
|
|
6
|
+
import { Label as F } from "./label.js";
|
|
7
7
|
import { Badge as V } from "./badge.js";
|
|
8
|
-
import { Button as
|
|
8
|
+
import { Button as G } from "./button.js";
|
|
9
9
|
import { Popover as X, PopoverTrigger as $, PopoverContent as q } from "./popover.js";
|
|
10
10
|
import { Command as H, CommandList as I, CommandEmpty as J, CommandGroup as K, CommandItem as Q } from "./command.js";
|
|
11
11
|
import { inputVariants as U } from "./input.js";
|
|
12
12
|
import { Checkbox as Y } from "./checkbox.js";
|
|
13
|
-
import { Icon as
|
|
14
|
-
import Z from "
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
import { Icon as N } from "./icon.js";
|
|
14
|
+
import { selectTriggerVariants as Z } from "./async-select.js";
|
|
15
|
+
import _ from "../../node_modules/lucide-react/dist/esm/icons/chevron-down.js";
|
|
16
|
+
const ee = t.createContext({ size: "default" });
|
|
17
|
+
function pe({
|
|
18
|
+
options: i,
|
|
18
19
|
value: n,
|
|
19
|
-
onChange:
|
|
20
|
-
onClear:
|
|
21
|
-
placeholder:
|
|
22
|
-
disabled:
|
|
23
|
-
size:
|
|
20
|
+
onChange: s,
|
|
21
|
+
onClear: g,
|
|
22
|
+
placeholder: y = "Seleziona...",
|
|
23
|
+
disabled: k = !1,
|
|
24
|
+
size: f = "default",
|
|
24
25
|
label: b,
|
|
25
|
-
labelClassName:
|
|
26
|
-
emptyMessage:
|
|
27
|
-
className:
|
|
28
|
-
filterPlaceholder:
|
|
29
|
-
filterable:
|
|
30
|
-
cancelLabel:
|
|
31
|
-
cancelButtonLabel:
|
|
26
|
+
labelClassName: z,
|
|
27
|
+
emptyMessage: M = "Nessun risultato trovato",
|
|
28
|
+
className: P,
|
|
29
|
+
filterPlaceholder: R = "Cerca...",
|
|
30
|
+
filterable: j = !1,
|
|
31
|
+
cancelLabel: D = "Cancella selezione",
|
|
32
|
+
cancelButtonLabel: O = "Cancella",
|
|
32
33
|
maxSelectedItems: a
|
|
33
34
|
}) {
|
|
34
|
-
const
|
|
35
|
+
const p = t.useId(), [o, S] = t.useState(!1), [d, v] = t.useState(""), [L, B] = t.useState(
|
|
35
36
|
void 0
|
|
36
|
-
),
|
|
37
|
+
), T = t.useRef(null), h = t.useRef(null), w = t.useCallback(
|
|
37
38
|
(e) => {
|
|
38
39
|
if (n.includes(e))
|
|
39
|
-
|
|
40
|
+
s(n.filter((c) => c !== e));
|
|
40
41
|
else {
|
|
41
42
|
if (a && n.length >= a)
|
|
42
43
|
return;
|
|
43
|
-
|
|
44
|
+
s([...n, e]);
|
|
44
45
|
}
|
|
45
46
|
},
|
|
46
|
-
[n,
|
|
47
|
+
[n, s, a]
|
|
47
48
|
), x = t.useCallback(() => {
|
|
48
|
-
|
|
49
|
-
}, [
|
|
50
|
-
(e) => e.label.toLowerCase().includes(
|
|
51
|
-
) :
|
|
52
|
-
return
|
|
53
|
-
if (
|
|
54
|
-
const e =
|
|
55
|
-
|
|
49
|
+
s([]), v(""), g && g();
|
|
50
|
+
}, [s]), u = t.useMemo(() => i.filter((e) => n.includes(e.value)), [i, n]), W = t.useMemo(() => d ? i.filter(
|
|
51
|
+
(e) => e.label.toLowerCase().includes(d.toLowerCase())
|
|
52
|
+
) : i, [i, d]), C = t.useMemo(() => a ? n.length >= a : !1, [n, a]);
|
|
53
|
+
return E(() => {
|
|
54
|
+
if (o && h.current) {
|
|
55
|
+
const e = h.current.getBoundingClientRect();
|
|
56
|
+
B(e.width);
|
|
56
57
|
}
|
|
57
|
-
}, [
|
|
58
|
-
b && /* @__PURE__ */ r(
|
|
58
|
+
}, [o]), /* @__PURE__ */ r(ee.Provider, { value: { size: f, id: p }, children: /* @__PURE__ */ l("div", { className: "space-y-1.5", children: [
|
|
59
|
+
b && /* @__PURE__ */ r(F, { htmlFor: p, className: m(z, "w-fit"), children: b }),
|
|
59
60
|
/* @__PURE__ */ r(
|
|
60
61
|
"div",
|
|
61
62
|
{
|
|
62
|
-
ref:
|
|
63
|
+
ref: T,
|
|
63
64
|
className: "relative w-full",
|
|
64
65
|
"data-slot": "app-multiple-select-dropdown",
|
|
65
|
-
children: /* @__PURE__ */ l(X, { open:
|
|
66
|
+
children: /* @__PURE__ */ l(X, { open: o, onOpenChange: S, children: [
|
|
66
67
|
/* @__PURE__ */ r($, { asChild: !0, children: /* @__PURE__ */ l(
|
|
67
|
-
|
|
68
|
+
"button",
|
|
68
69
|
{
|
|
69
|
-
id:
|
|
70
|
+
id: p,
|
|
70
71
|
type: "button",
|
|
71
|
-
variant: "outline",
|
|
72
72
|
role: "combobox",
|
|
73
|
-
"aria-expanded":
|
|
74
|
-
disabled:
|
|
75
|
-
ref:
|
|
76
|
-
className:
|
|
77
|
-
|
|
78
|
-
"
|
|
73
|
+
"aria-expanded": o,
|
|
74
|
+
disabled: k,
|
|
75
|
+
ref: h,
|
|
76
|
+
className: m(
|
|
77
|
+
Z({ size: f }),
|
|
78
|
+
"!bg-d-input hover:bg-d-input/50 relative w-full justify-between font-normal",
|
|
79
|
+
"ring-offset-background border-d-border/50 flex items-center rounded-md border whitespace-nowrap focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
79
80
|
"aria-invalid:ring-d-destructive/20 dark:aria-invalid:ring-d-destructive/40 aria-invalid:border-d-destructive",
|
|
80
|
-
|
|
81
|
+
"focus-visible:ring-d-ring focus-visible:ring-1",
|
|
82
|
+
o && "ring-d-ring ring-1",
|
|
83
|
+
P
|
|
81
84
|
),
|
|
82
85
|
children: [
|
|
83
|
-
/* @__PURE__ */ r("div", { className: "flex w-full items-center justify-between gap-2 overflow-hidden", children: u.length > 0 ? /* @__PURE__ */ l(
|
|
86
|
+
/* @__PURE__ */ r("div", { className: "flex w-full items-center justify-between gap-2 overflow-hidden", children: u.length > 0 ? /* @__PURE__ */ l(A, { children: [
|
|
84
87
|
/* @__PURE__ */ l(
|
|
85
88
|
V,
|
|
86
89
|
{
|
|
@@ -100,9 +103,9 @@ function me({
|
|
|
100
103
|
e.stopPropagation(), e.preventDefault(), x();
|
|
101
104
|
},
|
|
102
105
|
onMouseDown: (e) => e.preventDefault(),
|
|
103
|
-
"aria-label":
|
|
106
|
+
"aria-label": D,
|
|
104
107
|
children: /* @__PURE__ */ r(
|
|
105
|
-
|
|
108
|
+
N,
|
|
106
109
|
{
|
|
107
110
|
name: "X",
|
|
108
111
|
size: "xs",
|
|
@@ -111,29 +114,29 @@ function me({
|
|
|
111
114
|
)
|
|
112
115
|
}
|
|
113
116
|
)
|
|
114
|
-
] }) : /* @__PURE__ */ r("span", { className: "text-d-muted-foreground", children:
|
|
115
|
-
/* @__PURE__ */ r(
|
|
117
|
+
] }) : /* @__PURE__ */ r("span", { className: "text-d-muted-foreground", children: y }) }),
|
|
118
|
+
/* @__PURE__ */ r(_, { className: "ml-1 h-4 w-4 shrink-0 opacity-50" })
|
|
116
119
|
]
|
|
117
120
|
}
|
|
118
121
|
) }),
|
|
119
122
|
/* @__PURE__ */ r(
|
|
120
123
|
q,
|
|
121
124
|
{
|
|
122
|
-
className:
|
|
123
|
-
style: { width:
|
|
125
|
+
className: m("p-0"),
|
|
126
|
+
style: { width: L },
|
|
124
127
|
align: "start",
|
|
125
128
|
side: "bottom",
|
|
126
129
|
sideOffset: 4,
|
|
127
130
|
onWheel: (e) => e.stopPropagation(),
|
|
128
131
|
avoidCollisions: !1,
|
|
129
|
-
children: /* @__PURE__ */ l(H, { className: "bg-d-popover w-full rounded-md border border-none
|
|
130
|
-
|
|
132
|
+
children: /* @__PURE__ */ l(H, { className: "bg-d-popover w-full rounded-md border border-none", children: [
|
|
133
|
+
j && /* @__PURE__ */ l("div", { className: "border-d-border flex items-center justify-between border-b px-3", children: [
|
|
131
134
|
/* @__PURE__ */ l("div", { className: "flex items-center", children: [
|
|
132
135
|
/* @__PURE__ */ r(
|
|
133
|
-
|
|
136
|
+
N,
|
|
134
137
|
{
|
|
135
138
|
name: "Search",
|
|
136
|
-
className: "text-d-accent-foreground",
|
|
139
|
+
className: "text-d-accent-foreground opacity-50",
|
|
137
140
|
size: "sm"
|
|
138
141
|
}
|
|
139
142
|
),
|
|
@@ -141,43 +144,43 @@ function me({
|
|
|
141
144
|
"input",
|
|
142
145
|
{
|
|
143
146
|
id: "app-multiple-select-dropdown-filter",
|
|
144
|
-
placeholder:
|
|
145
|
-
value:
|
|
147
|
+
placeholder: R,
|
|
148
|
+
value: d,
|
|
146
149
|
onChange: (e) => v(e.target.value),
|
|
147
|
-
className: `focus-visible:ring-none border-none focus-visible:border-none disabled:opacity-50 ${U({ size:
|
|
150
|
+
className: `focus-visible:ring-none border-none focus-visible:border-none disabled:opacity-50 ${U({ size: f })} !shadow-none`
|
|
148
151
|
}
|
|
149
152
|
)
|
|
150
153
|
] }),
|
|
151
154
|
u.length > 0 && /* @__PURE__ */ r(
|
|
152
|
-
|
|
155
|
+
G,
|
|
153
156
|
{
|
|
154
157
|
variant: "ghost",
|
|
155
158
|
size: "sm",
|
|
156
159
|
className: "h-6 px-2 text-xs",
|
|
157
160
|
onClick: x,
|
|
158
|
-
children:
|
|
161
|
+
children: O
|
|
159
162
|
}
|
|
160
163
|
)
|
|
161
164
|
] }),
|
|
162
165
|
/* @__PURE__ */ l(I, { className: "max-h-60 w-full", children: [
|
|
163
|
-
/* @__PURE__ */ r(J, { children:
|
|
164
|
-
/* @__PURE__ */ r(K, { children:
|
|
165
|
-
const
|
|
166
|
+
/* @__PURE__ */ r(J, { children: M }),
|
|
167
|
+
/* @__PURE__ */ r(K, { children: W.map((e) => {
|
|
168
|
+
const c = n.includes(e.value);
|
|
166
169
|
return /* @__PURE__ */ l(
|
|
167
170
|
Q,
|
|
168
171
|
{
|
|
169
172
|
value: e.value,
|
|
170
|
-
disabled: e.disabled || !
|
|
173
|
+
disabled: e.disabled || !c && C,
|
|
171
174
|
onSelect: () => w(e.value),
|
|
172
|
-
className:
|
|
175
|
+
className: m(
|
|
173
176
|
"aria-selected:!bg-d-accent aria-selected:text-d-accent-foreground flex cursor-pointer items-center gap-2 px-2 py-1.5",
|
|
174
|
-
(e.disabled || !
|
|
177
|
+
(e.disabled || !c && C) && "cursor-not-allowed opacity-50"
|
|
175
178
|
),
|
|
176
179
|
children: [
|
|
177
180
|
/* @__PURE__ */ r(
|
|
178
181
|
Y,
|
|
179
182
|
{
|
|
180
|
-
checked:
|
|
183
|
+
checked: c,
|
|
181
184
|
className: "z-10 mr-2 flex-shrink-0",
|
|
182
185
|
onCheckedChange: () => {
|
|
183
186
|
console.log("checkbox change for:", e.value), w(e.value);
|
|
@@ -200,5 +203,5 @@ function me({
|
|
|
200
203
|
] }) });
|
|
201
204
|
}
|
|
202
205
|
export {
|
|
203
|
-
|
|
206
|
+
pe as AppMultipleSelectDropdown
|
|
204
207
|
};
|
|
@@ -1,42 +1,62 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
2
|
+
import { jsxs as s, jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import * as b from "react";
|
|
4
|
+
import { Select as C, SelectTrigger as O, SelectValue as B, SelectContent as G, SelectSeparator as N, SelectGroup as j, SelectLabel as w, SelectItem as D } from "./select.js";
|
|
5
|
+
import { SelectScrollDownButton as F, SelectScrollUpButton as R } from "./select.js";
|
|
6
|
+
function U({
|
|
6
7
|
options: p,
|
|
7
|
-
placeholder:
|
|
8
|
-
children:
|
|
9
|
-
label:
|
|
10
|
-
className:
|
|
11
|
-
labelKey:
|
|
12
|
-
valueKey:
|
|
13
|
-
descriptionKey:
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
placeholder: d,
|
|
9
|
+
children: m,
|
|
10
|
+
label: g,
|
|
11
|
+
className: h,
|
|
12
|
+
labelKey: S,
|
|
13
|
+
valueKey: o,
|
|
14
|
+
descriptionKey: u,
|
|
15
|
+
groupNameKey: a,
|
|
16
|
+
isOptionDisabled: f,
|
|
17
|
+
...A
|
|
16
18
|
}) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
const i = (t) => {
|
|
20
|
+
const c = S && o, e = String(c ? t[o] : t.value), r = c ? String(t[S]) : t.label, l = c && u ? String(t[u]) : null, x = c ? f?.(t) ?? !1 : t.disabled;
|
|
21
|
+
return /* @__PURE__ */ n(D, { value: e, disabled: x, children: /* @__PURE__ */ s("span", { className: "flex flex-col", children: [
|
|
22
|
+
/* @__PURE__ */ n("span", { children: r }),
|
|
23
|
+
l && /* @__PURE__ */ s("span", { className: "text-muted-foreground text-d-tertiary text-xs", children: [
|
|
24
|
+
"- ",
|
|
25
|
+
l
|
|
26
|
+
] })
|
|
27
|
+
] }) }, e);
|
|
28
|
+
};
|
|
29
|
+
return /* @__PURE__ */ s(C, { ...A, label: g, className: h, children: [
|
|
30
|
+
m || /* @__PURE__ */ n(O, { className: "w-full", children: /* @__PURE__ */ n(B, { placeholder: d }) }),
|
|
31
|
+
/* @__PURE__ */ n(G, { children: (() => {
|
|
32
|
+
if (!p.some((e) => a ? String(e[a]) : e.groupName))
|
|
33
|
+
return p.map(i);
|
|
34
|
+
const c = p.reduce(
|
|
35
|
+
(e, r) => {
|
|
36
|
+
const l = a ? String(r[a]) : r.groupName || "Altro";
|
|
37
|
+
return e[l] || (e[l] = []), e[l].push(r), e;
|
|
38
|
+
},
|
|
39
|
+
{}
|
|
40
|
+
);
|
|
41
|
+
return Object.entries(c).map(([e, r], l) => /* @__PURE__ */ s(b.Fragment, { children: [
|
|
42
|
+
l > 0 && /* @__PURE__ */ n(N, {}),
|
|
43
|
+
/* @__PURE__ */ s(j, { children: [
|
|
44
|
+
/* @__PURE__ */ n(w, { children: e }),
|
|
45
|
+
r.map(i)
|
|
26
46
|
] })
|
|
27
|
-
] }
|
|
28
|
-
}) })
|
|
47
|
+
] }, e));
|
|
48
|
+
})() })
|
|
29
49
|
] });
|
|
30
50
|
}
|
|
31
51
|
export {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
52
|
+
U as AppSelect,
|
|
53
|
+
G as AppSelectContent,
|
|
54
|
+
j as AppSelectGroup,
|
|
55
|
+
D as AppSelectItem,
|
|
56
|
+
w as AppSelectLabel,
|
|
57
|
+
F as AppSelectScrollDownButton,
|
|
58
|
+
R as AppSelectScrollUpButton,
|
|
59
|
+
N as AppSelectSeparator,
|
|
60
|
+
O as AppSelectTrigger,
|
|
61
|
+
B as AppSelectValue
|
|
42
62
|
};
|