laif-ds 0.2.75 → 0.2.77
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/CHANGELOG.md +27 -0
- package/dist/_virtual/index6.js +2 -2
- package/dist/_virtual/index7.js +2 -2
- package/dist/agent-docs/adoption-report.json +43 -39
- package/dist/agent-docs/components/AppCard.md +308 -0
- package/dist/agent-docs/components/AppForm.md +169 -358
- package/dist/agent-docs/components/DataTable.md +3 -0
- package/dist/agent-docs/components/FileUploader.md +7 -1
- package/dist/agent-docs/components-list.md +2 -0
- package/dist/agent-docs/manifest.json +110 -27
- package/dist/agent-docs/truncated-cell.md +342 -0
- package/dist/components/ui/app-card.js +115 -0
- package/dist/components/ui/app-form.js +322 -289
- package/dist/components/ui/card.js +20 -6
- package/dist/components/ui/file-uploader.js +86 -78
- package/dist/components/ui/tables/data-table/components/data-table-body.js +123 -115
- package/dist/components/ui/tables/data-table/components/data-table-header.js +6 -5
- package/dist/components/ui/tables/data-table/data-table.js +71 -69
- package/dist/components/ui/tables/data-table/data-table.utils.js +23 -15
- package/dist/components/ui/truncated-cell.js +100 -0
- package/dist/index.d.ts +212 -11
- package/dist/index.js +377 -373
- 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
|
@@ -27,7 +27,7 @@ const s = n.createContext({
|
|
|
27
27
|
gap: ""
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
|
-
function
|
|
30
|
+
function f({ className: r, size: t = "default", ...e }) {
|
|
31
31
|
return /* @__PURE__ */ a(s.Provider, { value: { size: t }, children: /* @__PURE__ */ a(
|
|
32
32
|
"div",
|
|
33
33
|
{
|
|
@@ -47,7 +47,7 @@ function x({ className: r, size: t = "default", ...e }) {
|
|
|
47
47
|
}
|
|
48
48
|
) });
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function x({ className: r, ...t }) {
|
|
51
51
|
const { size: e } = n.useContext(s);
|
|
52
52
|
return /* @__PURE__ */ a(
|
|
53
53
|
"div",
|
|
@@ -81,6 +81,19 @@ function g({ className: r, ...t }) {
|
|
|
81
81
|
}
|
|
82
82
|
);
|
|
83
83
|
}
|
|
84
|
+
function C({ className: r, ...t }) {
|
|
85
|
+
return /* @__PURE__ */ a(
|
|
86
|
+
"div",
|
|
87
|
+
{
|
|
88
|
+
"data-slot": "card-action",
|
|
89
|
+
className: o(
|
|
90
|
+
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
|
91
|
+
r
|
|
92
|
+
),
|
|
93
|
+
...t
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
}
|
|
84
97
|
function b({ className: r, ...t }) {
|
|
85
98
|
const { size: e } = n.useContext(s);
|
|
86
99
|
return /* @__PURE__ */ a(
|
|
@@ -92,7 +105,7 @@ function b({ className: r, ...t }) {
|
|
|
92
105
|
}
|
|
93
106
|
);
|
|
94
107
|
}
|
|
95
|
-
function
|
|
108
|
+
function y({ className: r, ...t }) {
|
|
96
109
|
const { size: e } = n.useContext(s);
|
|
97
110
|
return /* @__PURE__ */ a(
|
|
98
111
|
"div",
|
|
@@ -107,10 +120,11 @@ function C({ className: r, ...t }) {
|
|
|
107
120
|
);
|
|
108
121
|
}
|
|
109
122
|
export {
|
|
110
|
-
|
|
123
|
+
f as Card,
|
|
124
|
+
C as CardAction,
|
|
111
125
|
b as CardContent,
|
|
112
126
|
g as CardDescription,
|
|
113
|
-
|
|
114
|
-
|
|
127
|
+
y as CardFooter,
|
|
128
|
+
x as CardHeader,
|
|
115
129
|
m as CardTitle
|
|
116
130
|
};
|
|
@@ -22,132 +22,140 @@ const U = {
|
|
|
22
22
|
gif: ".gif",
|
|
23
23
|
image: "image/*",
|
|
24
24
|
video: "video/*",
|
|
25
|
-
audio: "audio/*"
|
|
25
|
+
audio: "audio/*",
|
|
26
|
+
// Keep both extensions and MIME aliases because archive file types are
|
|
27
|
+
// reported inconsistently across browsers and operating systems.
|
|
28
|
+
zip: ".zip,application/zip,application/x-zip-compressed,multipart/x-zip",
|
|
29
|
+
rar: ".rar,application/vnd.rar,application/x-rar-compressed",
|
|
30
|
+
"7z": ".7z,application/x-7z-compressed",
|
|
31
|
+
tar: ".tar,application/x-tar",
|
|
32
|
+
gz: ".gz,application/gzip,application/x-gzip",
|
|
33
|
+
tgz: ".tgz,.tar.gz,application/gzip,application/x-compressed-tar"
|
|
26
34
|
}, R = (g) => Math.ceil(g / (1024 * 1024)), ee = ({
|
|
27
35
|
extensions: g = ["pdf", "image", "video", "audio"],
|
|
28
|
-
multiple:
|
|
29
|
-
onUpload:
|
|
30
|
-
description:
|
|
31
|
-
formatDescription:
|
|
32
|
-
selectedLabel:
|
|
33
|
-
maxTotalSize:
|
|
34
|
-
removeAllLabel:
|
|
36
|
+
multiple: p = !1,
|
|
37
|
+
onUpload: z,
|
|
38
|
+
description: I = "Trascina un file o clicca per selezionare",
|
|
39
|
+
formatDescription: b = "Formato accettato: PDF, Immagini, Video, Audio",
|
|
40
|
+
selectedLabel: y = "File selezionati",
|
|
41
|
+
maxTotalSize: c,
|
|
42
|
+
removeAllLabel: N = "rimuovi tutto",
|
|
35
43
|
maxFiles: x,
|
|
36
|
-
id:
|
|
37
|
-
"data-testid":
|
|
44
|
+
id: s,
|
|
45
|
+
"data-testid": j
|
|
38
46
|
}) => {
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
(
|
|
47
|
+
const f = g.map((e) => U[e]).join(","), [a, u] = l.useState([]), [w, D] = l.useState(""), o = (e) => {
|
|
48
|
+
const n = Array.from(e).filter(
|
|
49
|
+
(i) => f.split(",").some((t) => (t = t.trim(), i.type.startsWith(t.replace("/*", "")) || i.name.toLowerCase().endsWith(t.replace("*", ""))))
|
|
42
50
|
);
|
|
43
|
-
let
|
|
51
|
+
let d = [];
|
|
44
52
|
const m = [];
|
|
45
|
-
if (
|
|
46
|
-
let
|
|
53
|
+
if (p) {
|
|
54
|
+
let i = n;
|
|
47
55
|
if (typeof x == "number") {
|
|
48
|
-
const t = Math.max(x -
|
|
49
|
-
t <
|
|
56
|
+
const t = Math.max(x - a.length, 0);
|
|
57
|
+
t < n.length && (i = n.slice(0, t), m.push(`Max ${x} file`));
|
|
50
58
|
}
|
|
51
|
-
if (typeof
|
|
52
|
-
const t =
|
|
53
|
-
let F =
|
|
59
|
+
if (typeof c == "number") {
|
|
60
|
+
const t = c;
|
|
61
|
+
let F = a.reduce((h, A) => h + (A.size || 0), 0);
|
|
54
62
|
const M = [];
|
|
55
63
|
let $ = !1;
|
|
56
|
-
for (const h of
|
|
64
|
+
for (const h of i)
|
|
57
65
|
F + (h.size || 0) <= t ? (M.push(h), F += h.size || 0) : $ || (m.push(`Max ${R(t)} MB`), $ = !0);
|
|
58
|
-
|
|
66
|
+
i = M;
|
|
59
67
|
}
|
|
60
|
-
|
|
68
|
+
d = [...a, ...i];
|
|
61
69
|
} else {
|
|
62
|
-
const
|
|
63
|
-
if (typeof
|
|
64
|
-
const t =
|
|
65
|
-
(
|
|
70
|
+
const i = n[0] ? [n[0]] : [];
|
|
71
|
+
if (typeof c == "number" && i[0]) {
|
|
72
|
+
const t = c;
|
|
73
|
+
(i[0].size || 0) > t ? (m.push(`Max ${R(t)} MB`), d = a) : d = i;
|
|
66
74
|
} else
|
|
67
|
-
|
|
75
|
+
d = i;
|
|
68
76
|
}
|
|
69
|
-
|
|
77
|
+
u(d), D(m.join(" • ")), z?.(d);
|
|
70
78
|
}, E = (e) => {
|
|
71
|
-
e.target.files &&
|
|
79
|
+
e.target.files && o(e.target.files), e.target.value = "";
|
|
72
80
|
}, L = (e) => {
|
|
73
|
-
e.preventDefault(),
|
|
81
|
+
e.preventDefault(), o(e.dataTransfer.files);
|
|
74
82
|
}, C = (e) => {
|
|
75
|
-
const
|
|
76
|
-
|
|
83
|
+
const n = a.filter((d, m) => m !== e);
|
|
84
|
+
u(n), D(""), z?.(n);
|
|
77
85
|
};
|
|
78
86
|
return /* @__PURE__ */ v("div", { className: "mx-auto w-full space-y-4", children: [
|
|
79
|
-
(
|
|
87
|
+
(p || a.length === 0) && /* @__PURE__ */ r(
|
|
80
88
|
V,
|
|
81
89
|
{
|
|
82
|
-
accept:
|
|
83
|
-
multiple:
|
|
90
|
+
accept: f,
|
|
91
|
+
multiple: p,
|
|
84
92
|
onDrop: L,
|
|
85
93
|
onChange: E,
|
|
86
|
-
description:
|
|
87
|
-
formatDescription:
|
|
88
|
-
errorCaption:
|
|
89
|
-
id:
|
|
90
|
-
"data-testid":
|
|
94
|
+
description: I,
|
|
95
|
+
formatDescription: b,
|
|
96
|
+
errorCaption: w,
|
|
97
|
+
id: s,
|
|
98
|
+
"data-testid": j
|
|
91
99
|
}
|
|
92
100
|
),
|
|
93
|
-
|
|
101
|
+
a.length > 0 && /* @__PURE__ */ r(B, { children: /* @__PURE__ */ v(P, { size: "sm", className: "shadow-none", children: [
|
|
94
102
|
/* @__PURE__ */ v(_, { className: "flex justify-between", children: [
|
|
95
|
-
/* @__PURE__ */ r(W, { children:
|
|
103
|
+
/* @__PURE__ */ r(W, { children: y }),
|
|
96
104
|
/* @__PURE__ */ r(
|
|
97
105
|
S,
|
|
98
106
|
{
|
|
99
107
|
size: "sm",
|
|
100
108
|
variant: "ghost",
|
|
101
109
|
className: "text-xs",
|
|
102
|
-
onClick: () =>
|
|
103
|
-
children:
|
|
110
|
+
onClick: () => u([]),
|
|
111
|
+
children: N
|
|
104
112
|
}
|
|
105
113
|
)
|
|
106
114
|
] }),
|
|
107
|
-
/* @__PURE__ */ r(H, { children:
|
|
115
|
+
/* @__PURE__ */ r(H, { children: p ? /* @__PURE__ */ r("div", { className: "flex flex-nowrap gap-2 overflow-x-auto py-2", children: a.map((e, n) => /* @__PURE__ */ r(
|
|
108
116
|
k,
|
|
109
117
|
{
|
|
110
118
|
file: e,
|
|
111
|
-
onRemove: () => C(
|
|
119
|
+
onRemove: () => C(n)
|
|
112
120
|
},
|
|
113
|
-
e.name +
|
|
114
|
-
)) }) : /* @__PURE__ */ r(k, { file:
|
|
121
|
+
e.name + n
|
|
122
|
+
)) }) : /* @__PURE__ */ r(k, { file: a[0], onRemove: () => C(0) }) })
|
|
115
123
|
] }) })
|
|
116
124
|
] });
|
|
117
125
|
}, V = ({
|
|
118
126
|
accept: g,
|
|
119
|
-
multiple:
|
|
120
|
-
onDrop:
|
|
121
|
-
onChange:
|
|
122
|
-
description:
|
|
123
|
-
formatDescription:
|
|
124
|
-
errorCaption:
|
|
125
|
-
id:
|
|
127
|
+
multiple: p,
|
|
128
|
+
onDrop: z,
|
|
129
|
+
onChange: I,
|
|
130
|
+
description: b,
|
|
131
|
+
formatDescription: y,
|
|
132
|
+
errorCaption: c,
|
|
133
|
+
id: N,
|
|
126
134
|
"data-testid": x
|
|
127
135
|
}) => {
|
|
128
|
-
const
|
|
136
|
+
const s = l.useRef(null), [j, f] = l.useState(!1), a = l.useId(), u = l.useId(), w = l.useId(), D = l.useId();
|
|
129
137
|
return /* @__PURE__ */ v(
|
|
130
138
|
"div",
|
|
131
139
|
{
|
|
132
|
-
id:
|
|
140
|
+
id: N,
|
|
133
141
|
"data-testid": x,
|
|
134
142
|
role: "button",
|
|
135
143
|
tabIndex: 0,
|
|
136
|
-
"aria-label":
|
|
137
|
-
"aria-describedby": `${
|
|
138
|
-
onKeyDown: (
|
|
139
|
-
(
|
|
144
|
+
"aria-label": b || "Seleziona file",
|
|
145
|
+
"aria-describedby": `${a} ${u}${c ? ` ${w}` : ""}`,
|
|
146
|
+
onKeyDown: (o) => {
|
|
147
|
+
(o.key === "Enter" || o.key === " ") && (o.preventDefault(), s.current && (s.current.value = "", s.current.click()));
|
|
140
148
|
},
|
|
141
149
|
onClick: () => {
|
|
142
|
-
|
|
150
|
+
s.current && (s.current.value = "", s.current.click());
|
|
143
151
|
},
|
|
144
|
-
onDragEnter: () =>
|
|
145
|
-
onDragOver: (
|
|
146
|
-
onDragLeave: () =>
|
|
147
|
-
onDrop: (
|
|
148
|
-
|
|
152
|
+
onDragEnter: () => f(!0),
|
|
153
|
+
onDragOver: (o) => o.preventDefault(),
|
|
154
|
+
onDragLeave: () => f(!1),
|
|
155
|
+
onDrop: (o) => {
|
|
156
|
+
f(!1), z(o);
|
|
149
157
|
},
|
|
150
|
-
className: `border-d-border flex w-full cursor-pointer flex-col items-center gap-3 rounded-lg border-2 border-dashed px-4 py-8 ${
|
|
158
|
+
className: `border-d-border flex w-full cursor-pointer flex-col items-center gap-3 rounded-lg border-2 border-dashed px-4 py-8 ${j ? "bg-muted/40" : ""}`,
|
|
151
159
|
children: [
|
|
152
160
|
/* @__PURE__ */ r(
|
|
153
161
|
K,
|
|
@@ -157,27 +165,27 @@ const U = {
|
|
|
157
165
|
}
|
|
158
166
|
),
|
|
159
167
|
/* @__PURE__ */ v("div", { className: "max-w-xs text-center", children: [
|
|
160
|
-
/* @__PURE__ */ r("p", { id:
|
|
168
|
+
/* @__PURE__ */ r("p", { id: a, className: "text-d-muted-foreground text-sm font-medium", children: b }),
|
|
161
169
|
/* @__PURE__ */ r(
|
|
162
170
|
"p",
|
|
163
171
|
{
|
|
164
|
-
id:
|
|
172
|
+
id: u,
|
|
165
173
|
className: "text-d-muted-foreground text-muted-foreground mt-1 text-xs",
|
|
166
|
-
children:
|
|
174
|
+
children: y
|
|
167
175
|
}
|
|
168
176
|
),
|
|
169
|
-
|
|
177
|
+
c ? /* @__PURE__ */ r("p", { id: w, className: "mt-2 text-xs font-medium text-red-600", children: c }) : null
|
|
170
178
|
] }),
|
|
171
179
|
/* @__PURE__ */ r(
|
|
172
180
|
O,
|
|
173
181
|
{
|
|
174
|
-
ref:
|
|
175
|
-
id:
|
|
182
|
+
ref: s,
|
|
183
|
+
id: D,
|
|
176
184
|
type: "file",
|
|
177
185
|
className: "hidden",
|
|
178
186
|
accept: g,
|
|
179
|
-
multiple:
|
|
180
|
-
onChange:
|
|
187
|
+
multiple: p,
|
|
188
|
+
onChange: I
|
|
181
189
|
}
|
|
182
190
|
)
|
|
183
191
|
]
|