laif-ds 0.1.42 → 0.1.44
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/index5.js +5 -5
- package/dist/_virtual/index6.js +2 -5
- package/dist/components/ui/app-multiple-select-dropdown.js +120 -121
- package/dist/components/ui/command-portal.js +66 -0
- package/dist/components/ui/multiple-selector.js +152 -140
- package/dist/components/ui/tables/data-cross-table/data-cross-table-buttons.js +56 -72
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
- package/dist/node_modules/react-is/index.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/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/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 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/index6.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import { __require as r } from "../node_modules/extend/index.js";
|
|
4
|
-
var t = r();
|
|
5
|
-
const x = /* @__PURE__ */ e(t);
|
|
2
|
+
var e = { exports: {} };
|
|
6
3
|
export {
|
|
7
|
-
|
|
4
|
+
e as __module
|
|
8
5
|
};
|
|
@@ -1,101 +1,92 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as r, jsxs as
|
|
3
|
-
import * as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { Badge as D } from "./badge.js";
|
|
2
|
+
import { jsx as r, jsxs as a, Fragment as P } from "react/jsx-runtime";
|
|
3
|
+
import * as t from "react";
|
|
4
|
+
import { cn as C } from "../../lib/utils.js";
|
|
5
|
+
import { Label as A } from "./label.js";
|
|
6
|
+
import { Badge as B } from "./badge.js";
|
|
8
7
|
import { Button as p } from "./button.js";
|
|
9
|
-
import { Command as
|
|
10
|
-
import { Input as
|
|
11
|
-
import { Checkbox as
|
|
8
|
+
import { Command as D, CommandList as F, CommandEmpty as E, CommandGroup as G, CommandItem as X } from "./command.js";
|
|
9
|
+
import { Input as q } from "./input.js";
|
|
10
|
+
import { Checkbox as H } from "./checkbox.js";
|
|
11
|
+
import { CommandPortal as I } from "./command-portal.js";
|
|
12
12
|
import J from "../../node_modules/lucide-react/dist/esm/icons/x.js";
|
|
13
13
|
import K from "../../node_modules/lucide-react/dist/esm/icons/chevron-down.js";
|
|
14
14
|
import Q from "../../node_modules/lucide-react/dist/esm/icons/check.js";
|
|
15
|
-
const T =
|
|
15
|
+
const T = t.createContext({ size: "default" });
|
|
16
16
|
function ne({
|
|
17
17
|
options: o,
|
|
18
|
-
value:
|
|
18
|
+
value: l,
|
|
19
19
|
onChange: i,
|
|
20
|
-
placeholder:
|
|
21
|
-
disabled:
|
|
22
|
-
size:
|
|
23
|
-
label:
|
|
24
|
-
labelClassName:
|
|
25
|
-
emptyMessage:
|
|
26
|
-
className:
|
|
20
|
+
placeholder: N = "Seleziona...",
|
|
21
|
+
disabled: y = !1,
|
|
22
|
+
size: c = "default",
|
|
23
|
+
label: h,
|
|
24
|
+
labelClassName: k,
|
|
25
|
+
emptyMessage: M = "Nessun risultato trovato",
|
|
26
|
+
className: L,
|
|
27
27
|
filterPlaceholder: z = "Cerca...",
|
|
28
|
-
cancelLabel:
|
|
29
|
-
cancelButtonLabel:
|
|
30
|
-
maxSelectedItems:
|
|
28
|
+
cancelLabel: R = "Cancella selezione",
|
|
29
|
+
cancelButtonLabel: S = "Cancella",
|
|
30
|
+
maxSelectedItems: n
|
|
31
31
|
}) {
|
|
32
|
-
const
|
|
33
|
-
A(() => {
|
|
34
|
-
const e = (n) => {
|
|
35
|
-
h.current && !h.current.contains(n.target) && c && b(!1);
|
|
36
|
-
};
|
|
37
|
-
return document.addEventListener("mousedown", e), () => {
|
|
38
|
-
document.removeEventListener("mousedown", e);
|
|
39
|
-
};
|
|
40
|
-
}, [c]);
|
|
41
|
-
const S = a.useCallback(
|
|
32
|
+
const u = t.useId(), [f, g] = t.useState(!1), [d, b] = t.useState(""), x = t.useRef(null), j = t.useCallback(
|
|
42
33
|
(e) => {
|
|
43
|
-
if (
|
|
44
|
-
i(
|
|
34
|
+
if (l.includes(e))
|
|
35
|
+
i(l.filter((s) => s !== e));
|
|
45
36
|
else {
|
|
46
|
-
if (
|
|
37
|
+
if (n && l.length >= n)
|
|
47
38
|
return;
|
|
48
|
-
i([...
|
|
39
|
+
i([...l, e]);
|
|
49
40
|
}
|
|
50
41
|
},
|
|
51
|
-
[
|
|
52
|
-
), w =
|
|
53
|
-
i([]),
|
|
54
|
-
}, [i]),
|
|
55
|
-
(e) => e.label.toLowerCase().includes(
|
|
56
|
-
) : o, [o,
|
|
57
|
-
return /* @__PURE__ */ r(T.Provider, { value: { size:
|
|
58
|
-
|
|
59
|
-
/* @__PURE__ */
|
|
42
|
+
[l, i, n]
|
|
43
|
+
), w = t.useCallback(() => {
|
|
44
|
+
i([]), b("");
|
|
45
|
+
}, [i]), m = t.useMemo(() => o.filter((e) => l.includes(e.value)), [o, l]), O = t.useMemo(() => d ? o.filter(
|
|
46
|
+
(e) => e.label.toLowerCase().includes(d.toLowerCase())
|
|
47
|
+
) : o, [o, d]), v = t.useMemo(() => n ? l.length >= n : !1, [l, n]);
|
|
48
|
+
return /* @__PURE__ */ r(T.Provider, { value: { size: c, id: u }, children: /* @__PURE__ */ a("div", { className: "space-y-1.5", children: [
|
|
49
|
+
h && /* @__PURE__ */ r(A, { htmlFor: u, className: k, children: h }),
|
|
50
|
+
/* @__PURE__ */ a(
|
|
60
51
|
"div",
|
|
61
52
|
{
|
|
62
|
-
ref:
|
|
53
|
+
ref: x,
|
|
63
54
|
className: "relative w-full",
|
|
64
55
|
"data-slot": "app-multiple-select-dropdown",
|
|
65
56
|
children: [
|
|
66
|
-
/* @__PURE__ */
|
|
57
|
+
/* @__PURE__ */ a(
|
|
67
58
|
p,
|
|
68
59
|
{
|
|
69
|
-
id:
|
|
60
|
+
id: u,
|
|
70
61
|
type: "button",
|
|
71
62
|
variant: "outline",
|
|
72
63
|
role: "combobox",
|
|
73
|
-
"aria-expanded":
|
|
74
|
-
disabled:
|
|
75
|
-
className:
|
|
76
|
-
"relative w-full justify-between border font-normal",
|
|
77
|
-
"border-d-input ring-offset-background focus:ring-ring flex items-center rounded-md border bg-transparent whitespace-nowrap shadow-sm focus:ring-1 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
64
|
+
"aria-expanded": f,
|
|
65
|
+
disabled: y,
|
|
66
|
+
className: C(
|
|
67
|
+
"relative w-full justify-between border bg-transparent font-normal",
|
|
68
|
+
"border-d-input ring-offset-background focus:ring-ring flex items-center rounded-md border !bg-transparent whitespace-nowrap shadow-sm focus:ring-1 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
78
69
|
"aria-invalid:ring-d-destructive/20 dark:aria-invalid:ring-d-destructive/40 aria-invalid:border-d-destructive",
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
70
|
+
c === "default" && "h-9 px-3 py-2 text-sm",
|
|
71
|
+
c === "sm" && "h-8 px-2 py-1 text-xs",
|
|
72
|
+
c === "lg" && "h-10 px-4 py-2 text-lg",
|
|
73
|
+
L
|
|
83
74
|
),
|
|
84
|
-
onClick: () =>
|
|
75
|
+
onClick: () => g(!f),
|
|
85
76
|
children: [
|
|
86
|
-
/* @__PURE__ */ r("div", { className: "flex w-full items-center gap-2 overflow-hidden", children:
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
|
|
77
|
+
/* @__PURE__ */ r("div", { className: "flex w-full items-center gap-2 overflow-hidden", children: m.length > 0 ? /* @__PURE__ */ a(P, { children: [
|
|
78
|
+
/* @__PURE__ */ a(
|
|
79
|
+
B,
|
|
89
80
|
{
|
|
90
81
|
variant: "secondary",
|
|
91
82
|
className: "flex items-center gap-1",
|
|
92
83
|
children: [
|
|
93
|
-
/* @__PURE__ */ r("span", { children:
|
|
94
|
-
|
|
84
|
+
/* @__PURE__ */ r("span", { children: m.length }),
|
|
85
|
+
m.length === 1 ? " elemento selezionato" : " elementi selezionati"
|
|
95
86
|
]
|
|
96
87
|
}
|
|
97
88
|
),
|
|
98
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ a(
|
|
99
90
|
p,
|
|
100
91
|
{
|
|
101
92
|
variant: "ghost",
|
|
@@ -106,71 +97,79 @@ function ne({
|
|
|
106
97
|
},
|
|
107
98
|
children: [
|
|
108
99
|
/* @__PURE__ */ r(J, { className: "h-3 w-3" }),
|
|
109
|
-
/* @__PURE__ */ r("span", { className: "sr-only", children:
|
|
100
|
+
/* @__PURE__ */ r("span", { className: "sr-only", children: R })
|
|
110
101
|
]
|
|
111
102
|
}
|
|
112
103
|
)
|
|
113
|
-
] }) : /* @__PURE__ */ r("span", { className: "text-d-muted-foreground", children:
|
|
104
|
+
] }) : /* @__PURE__ */ r("span", { className: "text-d-muted-foreground", children: N }) }),
|
|
114
105
|
/* @__PURE__ */ r(K, { className: "ml-1 h-4 w-4 shrink-0 opacity-50" })
|
|
115
106
|
]
|
|
116
107
|
}
|
|
117
108
|
),
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
109
|
+
/* @__PURE__ */ r(
|
|
110
|
+
I,
|
|
111
|
+
{
|
|
112
|
+
open: f,
|
|
113
|
+
triggerRef: x,
|
|
114
|
+
onClose: () => g(!1),
|
|
115
|
+
children: /* @__PURE__ */ a(D, { className: "bg-d-popover w-full rounded-md shadow-md", children: [
|
|
116
|
+
/* @__PURE__ */ a("div", { className: "flex items-center border-b px-3", children: [
|
|
117
|
+
/* @__PURE__ */ r(
|
|
118
|
+
q,
|
|
119
|
+
{
|
|
120
|
+
iconLeft: "Search",
|
|
121
|
+
placeholder: z,
|
|
122
|
+
value: d,
|
|
123
|
+
onChange: (e) => b(e.target.value),
|
|
124
|
+
className: "w-full !border-0 !border-none shadow-none !outline-none focus-visible:ring-0"
|
|
125
|
+
}
|
|
126
|
+
),
|
|
127
|
+
m.length > 0 && /* @__PURE__ */ r(
|
|
128
|
+
p,
|
|
129
|
+
{
|
|
130
|
+
variant: "ghost",
|
|
131
|
+
size: "sm",
|
|
132
|
+
className: "h-6 px-2 text-xs",
|
|
133
|
+
onClick: w,
|
|
134
|
+
children: S
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
] }),
|
|
138
|
+
/* @__PURE__ */ a(F, { className: "max-h-60 w-full overflow-auto", children: [
|
|
139
|
+
/* @__PURE__ */ r(E, { children: M }),
|
|
140
|
+
/* @__PURE__ */ r(G, { children: O.map((e) => {
|
|
141
|
+
const s = l.includes(e.value);
|
|
142
|
+
return /* @__PURE__ */ a(
|
|
143
|
+
X,
|
|
144
|
+
{
|
|
145
|
+
value: e.value,
|
|
146
|
+
disabled: e.disabled || !s && v,
|
|
147
|
+
onSelect: () => j(e.value),
|
|
148
|
+
className: C(
|
|
149
|
+
"aria-selected:bg-d-accent aria-selected:text-d-accent-foreground flex cursor-pointer items-center gap-2 px-2 py-1.5",
|
|
150
|
+
(e.disabled || !s && v) && "cursor-not-allowed opacity-50"
|
|
151
|
+
),
|
|
152
|
+
children: [
|
|
153
|
+
/* @__PURE__ */ r(
|
|
154
|
+
H,
|
|
155
|
+
{
|
|
156
|
+
checked: s,
|
|
157
|
+
className: "mr-2 flex-shrink-0",
|
|
158
|
+
onCheckedChange: () => {
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
),
|
|
162
|
+
/* @__PURE__ */ r("span", { className: "flex-1 truncate", children: e.label }),
|
|
163
|
+
s && /* @__PURE__ */ r(Q, { className: "text-d-primary ml-auto h-4 w-4 flex-shrink-0" })
|
|
164
|
+
]
|
|
165
|
+
},
|
|
166
|
+
e.value
|
|
167
|
+
);
|
|
168
|
+
}) })
|
|
169
|
+
] })
|
|
170
|
+
] })
|
|
171
|
+
}
|
|
172
|
+
)
|
|
174
173
|
]
|
|
175
174
|
}
|
|
176
175
|
)
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
3
|
+
import * as f from "react";
|
|
4
|
+
import { useState as h, useEffect as o } from "react";
|
|
5
|
+
import { Portal as x } from "../../node_modules/@radix-ui/react-select/dist/index.js";
|
|
6
|
+
import { cn as E } from "../../lib/utils.js";
|
|
7
|
+
function C({
|
|
8
|
+
children: w,
|
|
9
|
+
open: t,
|
|
10
|
+
className: v,
|
|
11
|
+
triggerRef: r,
|
|
12
|
+
onClose: s
|
|
13
|
+
}) {
|
|
14
|
+
const l = f.useRef(null), [i, c] = h(null), n = f.useCallback(() => {
|
|
15
|
+
if (t && r.current) {
|
|
16
|
+
const e = r.current.getBoundingClientRect();
|
|
17
|
+
c({
|
|
18
|
+
top: e.bottom + window.scrollY,
|
|
19
|
+
left: e.left + window.scrollX,
|
|
20
|
+
width: e.width
|
|
21
|
+
});
|
|
22
|
+
} else
|
|
23
|
+
c(null);
|
|
24
|
+
}, [t, r]);
|
|
25
|
+
return o(() => {
|
|
26
|
+
n();
|
|
27
|
+
}, [t, n]), o(() => {
|
|
28
|
+
if (t)
|
|
29
|
+
return window.addEventListener("resize", n), () => {
|
|
30
|
+
window.removeEventListener("resize", n);
|
|
31
|
+
};
|
|
32
|
+
}, [t, n]), o(() => {
|
|
33
|
+
if (t) {
|
|
34
|
+
const e = setInterval(n, 100);
|
|
35
|
+
return () => {
|
|
36
|
+
clearInterval(e);
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}, [t, n]), o(() => {
|
|
40
|
+
if (!t || !s) return;
|
|
41
|
+
const e = (p) => {
|
|
42
|
+
var a, d;
|
|
43
|
+
const u = p.target;
|
|
44
|
+
(a = r.current) != null && a.contains(u) || (d = l.current) != null && d.contains(u) || s();
|
|
45
|
+
};
|
|
46
|
+
return document.addEventListener("mousedown", e), () => {
|
|
47
|
+
document.removeEventListener("mousedown", e);
|
|
48
|
+
};
|
|
49
|
+
}, [t, s, r]), !t || !i ? null : /* @__PURE__ */ m(x, { children: /* @__PURE__ */ m(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
ref: l,
|
|
53
|
+
className: E("fixed z-50 mt-1", v),
|
|
54
|
+
style: {
|
|
55
|
+
top: `${i.top}px`,
|
|
56
|
+
left: `${i.left}px`,
|
|
57
|
+
width: `${i.width}px`
|
|
58
|
+
},
|
|
59
|
+
onClick: (e) => e.stopPropagation(),
|
|
60
|
+
children: w
|
|
61
|
+
}
|
|
62
|
+
) });
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
C as CommandPortal
|
|
66
|
+
};
|