laif-ds 0.1.68 → 0.1.70
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.
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as t, jsxs as
|
|
2
|
+
import { jsx as t, jsxs as b } from "react/jsx-runtime";
|
|
3
3
|
import { useReactTable as ue, flexRender as J } from "../../node_modules/@tanstack/react-table/build/lib/index.js";
|
|
4
|
-
import { useState as
|
|
4
|
+
import { useState as x, useRef as _, useMemo as de, useEffect as M } from "react";
|
|
5
5
|
import { cn as fe } from "../../lib/utils.js";
|
|
6
|
-
import { createCustomFilterFns as
|
|
6
|
+
import { createCustomFilterFns as he, ELogicalFilterOperator as xe, debounce as Ce, createMultiValueFilterFn as be, updatePageSizeFromContainer as se } from "./data-table.service.js";
|
|
7
7
|
import { Pagination as we, PaginationContent as re, PaginationItem as I, PaginationFirst as Ie, PaginationPrevious as Re, PaginationLink as ze, PaginationNext as Ne, PaginationLast as Me } from "./pagination.js";
|
|
8
8
|
import { Checkbox as K } from "./checkbox.js";
|
|
9
9
|
import { Input as ye } from "./input.js";
|
|
@@ -23,10 +23,10 @@ function pe({
|
|
|
23
23
|
checkable: z = !1,
|
|
24
24
|
onCheckedRowsChange: k,
|
|
25
25
|
notFoundMessage: Z = "Nessun risultato trovato.",
|
|
26
|
-
searchBar:
|
|
26
|
+
searchBar: h = void 0,
|
|
27
27
|
dropdownFilters: u = void 0,
|
|
28
28
|
totalItems: P = void 0,
|
|
29
|
-
datatableSizes:
|
|
29
|
+
datatableSizes: s = {
|
|
30
30
|
rowHeight: 32.5,
|
|
31
31
|
// default table row height in pixels
|
|
32
32
|
headerHeight: 40,
|
|
@@ -39,10 +39,10 @@ function pe({
|
|
|
39
39
|
setServerOptions: i = void 0
|
|
40
40
|
}) {
|
|
41
41
|
var S, E;
|
|
42
|
-
const [p, B] =
|
|
42
|
+
const [p, B] = x([]), [v, O] = x([]), [ee, le] = x({}), [r, te] = x(""), [ae, ne] = x({}), T = L ? Y : ae, ie = L || ne, [N, ge] = x({}), d = !!g, [w, H] = x({
|
|
43
43
|
pageIndex: 0,
|
|
44
44
|
pageSize: 10
|
|
45
|
-
}), [oe, A] =
|
|
45
|
+
}), [oe, A] = x(0), D = _(null), $ = _(void 0), ce = de(() => z ? [
|
|
46
46
|
{
|
|
47
47
|
id: "select",
|
|
48
48
|
header: ({ table: e }) => /* @__PURE__ */ t(
|
|
@@ -82,19 +82,19 @@ function pe({
|
|
|
82
82
|
onColumnVisibilityChange: le,
|
|
83
83
|
onRowSelectionChange: ie,
|
|
84
84
|
getFilteredRowModel: Le(),
|
|
85
|
-
globalFilterFn: (e, l, n) => d || !n ? !0 : (
|
|
85
|
+
globalFilterFn: (e, l, n) => d || !n ? !0 : (h == null ? void 0 : h.columns.some((o) => {
|
|
86
86
|
const c = e.getValue(o);
|
|
87
87
|
return String(c).toLowerCase().includes(n.toLowerCase());
|
|
88
88
|
})) ?? !1,
|
|
89
89
|
filterFns: {
|
|
90
|
-
multiValue: (e, l, n) =>
|
|
90
|
+
multiValue: (e, l, n) => be(
|
|
91
91
|
e,
|
|
92
92
|
l,
|
|
93
93
|
n,
|
|
94
94
|
u,
|
|
95
95
|
g
|
|
96
96
|
),
|
|
97
|
-
...
|
|
97
|
+
...he(u ?? [], g)
|
|
98
98
|
},
|
|
99
99
|
onPaginationChange: (e) => {
|
|
100
100
|
d ? typeof e == "object" && i && i((l) => ({
|
|
@@ -119,17 +119,17 @@ function pe({
|
|
|
119
119
|
}, a = ue(me);
|
|
120
120
|
M(() => {
|
|
121
121
|
let e;
|
|
122
|
-
if (
|
|
122
|
+
if (h && r && (e || (e = {}), e.searchbarFilters = {
|
|
123
123
|
value: r,
|
|
124
|
-
columns:
|
|
124
|
+
columns: h.columns
|
|
125
125
|
}), u && Object.keys(N).length > 0) {
|
|
126
126
|
const c = {};
|
|
127
127
|
for (const f of u) {
|
|
128
|
-
const
|
|
129
|
-
|
|
128
|
+
const C = N[f.column];
|
|
129
|
+
C && C.length > 0 && (c[f.column] = {
|
|
130
130
|
column: f.column,
|
|
131
|
-
value:
|
|
132
|
-
logic: f.innerFiltersMode ||
|
|
131
|
+
value: C,
|
|
132
|
+
logic: f.innerFiltersMode || xe.OR
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
135
|
Object.keys(c).length > 0 && (e || (e = {}), e.dropdownFilters = c);
|
|
@@ -146,7 +146,7 @@ function pe({
|
|
|
146
146
|
}, [
|
|
147
147
|
u,
|
|
148
148
|
N,
|
|
149
|
-
|
|
149
|
+
h,
|
|
150
150
|
r,
|
|
151
151
|
g,
|
|
152
152
|
i
|
|
@@ -172,12 +172,12 @@ function pe({
|
|
|
172
172
|
G,
|
|
173
173
|
w.pageSize
|
|
174
174
|
]), M(() => {
|
|
175
|
-
const e =
|
|
175
|
+
const e = Ce(() => {
|
|
176
176
|
const l = D.current;
|
|
177
|
-
l &&
|
|
178
|
-
rowHeight:
|
|
179
|
-
headerHeight:
|
|
180
|
-
containerHeight:
|
|
177
|
+
l && se(l, {
|
|
178
|
+
rowHeight: s.rowHeight,
|
|
179
|
+
headerHeight: s.headerHeight,
|
|
180
|
+
containerHeight: s.containerHeight,
|
|
181
181
|
onPageChange: d ? (n, o) => {
|
|
182
182
|
i == null || i((c) => ({
|
|
183
183
|
...c,
|
|
@@ -207,9 +207,9 @@ function pe({
|
|
|
207
207
|
};
|
|
208
208
|
}, [
|
|
209
209
|
d,
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
210
|
+
s.containerHeight,
|
|
211
|
+
s.headerHeight,
|
|
212
|
+
s.rowHeight,
|
|
213
213
|
D,
|
|
214
214
|
i
|
|
215
215
|
// should be stable, but include for clarity
|
|
@@ -218,7 +218,7 @@ function pe({
|
|
|
218
218
|
const e = a.getFilteredSelectedRowModel().rows.map((l) => l.original);
|
|
219
219
|
k(e);
|
|
220
220
|
}
|
|
221
|
-
}, [a, k, z, T]), /* @__PURE__ */
|
|
221
|
+
}, [a, k, z, T]), /* @__PURE__ */ b(
|
|
222
222
|
"div",
|
|
223
223
|
{
|
|
224
224
|
className: fe(
|
|
@@ -226,12 +226,12 @@ function pe({
|
|
|
226
226
|
X
|
|
227
227
|
),
|
|
228
228
|
children: [
|
|
229
|
-
(
|
|
230
|
-
|
|
229
|
+
(h || (u == null ? void 0 : u.length)) && /* @__PURE__ */ b("div", { className: "flex flex-col items-start justify-between gap-2 sm:flex-row sm:items-end", children: [
|
|
230
|
+
h && /* @__PURE__ */ t(
|
|
231
231
|
ye,
|
|
232
232
|
{
|
|
233
233
|
iconLeft: "Search",
|
|
234
|
-
placeholder:
|
|
234
|
+
placeholder: h.placeholder ?? "Cerca...",
|
|
235
235
|
value: r,
|
|
236
236
|
onChange: (e) => {
|
|
237
237
|
te(e.target.value);
|
|
@@ -239,7 +239,7 @@ function pe({
|
|
|
239
239
|
className: "w-60"
|
|
240
240
|
}
|
|
241
241
|
),
|
|
242
|
-
/* @__PURE__ */ t("div", { className: "flex h-full max-w-full min-w-0 flex-1 items-center", children: u && u.length > 0 && /* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ t("div", { className: "flex h-full max-w-full min-w-0 flex-1 items-center", children: u && u.length > 0 && /* @__PURE__ */ b(q, { className: "h-full w-full", children: [
|
|
243
243
|
/* @__PURE__ */ t(F, { orientation: "horizontal" }),
|
|
244
244
|
/* @__PURE__ */ t("div", { className: "flex w-full max-w-full min-w-0 items-center justify-start gap-2 sm:justify-end", children: u.map((e, l) => {
|
|
245
245
|
const n = N[e.column] ?? [];
|
|
@@ -257,7 +257,7 @@ function pe({
|
|
|
257
257
|
[e.column]: o
|
|
258
258
|
})), O((c) => {
|
|
259
259
|
const f = c.filter(
|
|
260
|
-
(
|
|
260
|
+
(C) => C.id !== e.column
|
|
261
261
|
);
|
|
262
262
|
return o.length === 0 ? f : [
|
|
263
263
|
...f,
|
|
@@ -276,10 +276,10 @@ function pe({
|
|
|
276
276
|
{
|
|
277
277
|
className: "flex max-h-full min-h-0 max-w-full min-w-0 flex-1",
|
|
278
278
|
ref: D,
|
|
279
|
-
children: /* @__PURE__ */
|
|
279
|
+
children: /* @__PURE__ */ b(q, { className: "border-d-border h-full min-h-0 w-full rounded-md border", children: [
|
|
280
280
|
/* @__PURE__ */ t(F, { orientation: "horizontal" }),
|
|
281
281
|
/* @__PURE__ */ t(F, { orientation: "vertical" }),
|
|
282
|
-
/* @__PURE__ */
|
|
282
|
+
/* @__PURE__ */ b(Pe, { children: [
|
|
283
283
|
/* @__PURE__ */ t(He, { children: a.getHeaderGroups().map((e) => /* @__PURE__ */ t(y, { children: e.headers.map((l) => /* @__PURE__ */ t(
|
|
284
284
|
De,
|
|
285
285
|
{
|
|
@@ -327,12 +327,12 @@ function pe({
|
|
|
327
327
|
] })
|
|
328
328
|
}
|
|
329
329
|
),
|
|
330
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ b(we, { className: "h-9", children: [
|
|
331
331
|
/* @__PURE__ */ t("div", { className: "flex h-full flex-1 items-center align-middle", children: /* @__PURE__ */ t("div", { className: "text-d-foreground hidden text-sm md:flex", children: Math.min(
|
|
332
332
|
((E = g == null ? void 0 : g.pagination) == null ? void 0 : E.pageSize) ?? w.pageSize,
|
|
333
333
|
a.getFilteredRowModel().rows.length ?? 9999
|
|
334
|
-
) + " / " + (g ? P ?? "missing totalItems" : a.getFilteredRowModel().rows.length) + " " + ((m == null ? void 0 : m.rows) ?? "
|
|
335
|
-
/* @__PURE__ */
|
|
334
|
+
) + " / " + (g ? P ?? "missing totalItems" : a.getFilteredRowModel().rows.length) + " " + ((m == null ? void 0 : m.rows) ?? "Righe") }) }),
|
|
335
|
+
/* @__PURE__ */ b(re, { children: [
|
|
336
336
|
/* @__PURE__ */ t(I, { children: /* @__PURE__ */ t(
|
|
337
337
|
Ie,
|
|
338
338
|
{
|
|
@@ -379,7 +379,7 @@ function pe({
|
|
|
379
379
|
0,
|
|
380
380
|
e - Math.floor(n / 2)
|
|
381
381
|
), c = o + n;
|
|
382
|
-
return c > l && (c = l, o = Math.max(0, c - n)), a.getPageOptions().slice(o, c).map((f,
|
|
382
|
+
return c > l && (c = l, o = Math.max(0, c - n)), a.getPageOptions().slice(o, c).map((f, C) => /* @__PURE__ */ t(I, { children: /* @__PURE__ */ t(
|
|
383
383
|
ze,
|
|
384
384
|
{
|
|
385
385
|
size: "icon",
|
|
@@ -399,7 +399,7 @@ function pe({
|
|
|
399
399
|
},
|
|
400
400
|
children: f + 1
|
|
401
401
|
}
|
|
402
|
-
) },
|
|
402
|
+
) }, C));
|
|
403
403
|
})(),
|
|
404
404
|
/* @__PURE__ */ t(I, { children: /* @__PURE__ */ t(
|
|
405
405
|
Ne,
|
|
@@ -437,7 +437,7 @@ function pe({
|
|
|
437
437
|
}
|
|
438
438
|
) })
|
|
439
439
|
] }),
|
|
440
|
-
/* @__PURE__ */ t("div", { className: "flex h-full flex-1 items-center justify-end align-middle", children: /* @__PURE__ */ t("div", { className: "text-d-foreground hidden text-sm md:flex", children: (a.getPageCount() ? a.getState().pagination.pageIndex + 1 : 0) + " / " + a.getPageCount() + " " + ((m == null ? void 0 : m.pages) ?? "
|
|
440
|
+
/* @__PURE__ */ t("div", { className: "flex h-full flex-1 items-center justify-end align-middle", children: /* @__PURE__ */ t("div", { className: "text-d-foreground hidden text-sm md:flex", children: (a.getPageCount() ? a.getState().pagination.pageIndex + 1 : 0) + " / " + a.getPageCount() + " " + ((m == null ? void 0 : m.pages) ?? "Pagine") }) })
|
|
441
441
|
] })
|
|
442
442
|
]
|
|
443
443
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as i, jsxs as o } from "react/jsx-runtime";
|
|
3
|
-
import { cn as
|
|
3
|
+
import { cn as t } from "../../lib/utils.js";
|
|
4
4
|
import { buttonVariants as c } from "./button.js";
|
|
5
5
|
import p from "../../node_modules/lucide-react/dist/esm/icons/ellipsis.js";
|
|
6
6
|
import m from "../../node_modules/lucide-react/dist/esm/icons/chevron-right.js";
|
|
7
7
|
import u from "../../node_modules/lucide-react/dist/esm/icons/chevron-left.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
8
|
+
import d from "../../node_modules/lucide-react/dist/esm/icons/chevron-first.js";
|
|
9
|
+
import g from "../../node_modules/lucide-react/dist/esm/icons/chevron-last.js";
|
|
10
10
|
function C({ className: a, ...n }) {
|
|
11
11
|
return /* @__PURE__ */ i(
|
|
12
12
|
"nav",
|
|
@@ -14,12 +14,12 @@ function C({ className: a, ...n }) {
|
|
|
14
14
|
role: "navigation",
|
|
15
15
|
"aria-label": "pagination",
|
|
16
16
|
"data-slot": "pagination",
|
|
17
|
-
className:
|
|
17
|
+
className: t("mx-auto flex w-full justify-center", a),
|
|
18
18
|
...n
|
|
19
19
|
}
|
|
20
20
|
);
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function j({
|
|
23
23
|
className: a,
|
|
24
24
|
...n
|
|
25
25
|
}) {
|
|
@@ -27,18 +27,18 @@ function L({
|
|
|
27
27
|
"ul",
|
|
28
28
|
{
|
|
29
29
|
"data-slot": "pagination-content",
|
|
30
|
-
className:
|
|
30
|
+
className: t("flex flex-row items-center gap-1", a),
|
|
31
31
|
...n
|
|
32
32
|
}
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function y({ ...a }) {
|
|
36
36
|
return /* @__PURE__ */ i("li", { "data-slot": "pagination-item", ...a });
|
|
37
37
|
}
|
|
38
38
|
function r({
|
|
39
39
|
className: a,
|
|
40
40
|
isActive: n,
|
|
41
|
-
isDisabled:
|
|
41
|
+
isDisabled: e,
|
|
42
42
|
size: s = "icon",
|
|
43
43
|
...l
|
|
44
44
|
}) {
|
|
@@ -48,51 +48,51 @@ function r({
|
|
|
48
48
|
"aria-current": n ? "page" : void 0,
|
|
49
49
|
"data-slot": "pagination-link",
|
|
50
50
|
"data-active": n,
|
|
51
|
-
className:
|
|
51
|
+
className: t(
|
|
52
52
|
c({
|
|
53
53
|
variant: n ? "outline" : "ghost",
|
|
54
54
|
// variant: isDisabled ? "disabled" : isActive ? "outline" : "ghost",
|
|
55
55
|
size: s
|
|
56
56
|
}),
|
|
57
|
-
|
|
57
|
+
e && "pointer-events-none cursor-not-allowed opacity-40",
|
|
58
58
|
a
|
|
59
59
|
),
|
|
60
60
|
...l
|
|
61
61
|
}
|
|
62
62
|
);
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function G({
|
|
65
65
|
className: a,
|
|
66
66
|
label: n,
|
|
67
|
-
...
|
|
67
|
+
...e
|
|
68
68
|
}) {
|
|
69
69
|
return /* @__PURE__ */ o(
|
|
70
70
|
r,
|
|
71
71
|
{
|
|
72
72
|
"aria-label": "Go to previous page",
|
|
73
|
-
className:
|
|
74
|
-
...
|
|
73
|
+
className: t("gap-1 px-2.5 sm:pl-2.5", a),
|
|
74
|
+
...e,
|
|
75
75
|
children: [
|
|
76
|
-
/* @__PURE__ */ i(
|
|
77
|
-
/* @__PURE__ */ i("span", { className: "hidden sm:block", children: n ?? "
|
|
76
|
+
/* @__PURE__ */ i(d, {}),
|
|
77
|
+
/* @__PURE__ */ i("span", { className: "hidden sm:block", children: n ?? "Primo" })
|
|
78
78
|
]
|
|
79
79
|
}
|
|
80
80
|
);
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function L({
|
|
83
83
|
className: a,
|
|
84
84
|
label: n,
|
|
85
|
-
...
|
|
85
|
+
...e
|
|
86
86
|
}) {
|
|
87
87
|
return /* @__PURE__ */ o(
|
|
88
88
|
r,
|
|
89
89
|
{
|
|
90
90
|
"aria-label": "Go to previous page",
|
|
91
|
-
className:
|
|
92
|
-
...
|
|
91
|
+
className: t("gap-1 px-2.5 sm:pl-2.5", a),
|
|
92
|
+
...e,
|
|
93
93
|
children: [
|
|
94
94
|
/* @__PURE__ */ i(u, {}),
|
|
95
|
-
/* @__PURE__ */ i("span", { className: "hidden sm:block", children: n ?? "
|
|
95
|
+
/* @__PURE__ */ i("span", { className: "hidden sm:block", children: n ?? "Precedente" })
|
|
96
96
|
]
|
|
97
97
|
}
|
|
98
98
|
);
|
|
@@ -100,40 +100,40 @@ function G({
|
|
|
100
100
|
function w({
|
|
101
101
|
className: a,
|
|
102
102
|
label: n,
|
|
103
|
-
...
|
|
103
|
+
...e
|
|
104
104
|
}) {
|
|
105
105
|
return /* @__PURE__ */ o(
|
|
106
106
|
r,
|
|
107
107
|
{
|
|
108
108
|
"aria-label": "Go to next page",
|
|
109
|
-
className:
|
|
110
|
-
...
|
|
109
|
+
className: t("gap-1 px-2.5 sm:pr-2.5", a),
|
|
110
|
+
...e,
|
|
111
111
|
children: [
|
|
112
|
-
/* @__PURE__ */ i("span", { className: "hidden sm:block", children: n ?? "
|
|
112
|
+
/* @__PURE__ */ i("span", { className: "hidden sm:block", children: n ?? "Prossimo" }),
|
|
113
113
|
/* @__PURE__ */ i(m, {})
|
|
114
114
|
]
|
|
115
115
|
}
|
|
116
116
|
);
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function z({
|
|
119
119
|
className: a,
|
|
120
120
|
label: n,
|
|
121
|
-
...
|
|
121
|
+
...e
|
|
122
122
|
}) {
|
|
123
123
|
return /* @__PURE__ */ o(
|
|
124
124
|
r,
|
|
125
125
|
{
|
|
126
126
|
"aria-label": "Go to next page",
|
|
127
|
-
className:
|
|
128
|
-
...
|
|
127
|
+
className: t("gap-1 px-2.5 sm:pr-2.5", a),
|
|
128
|
+
...e,
|
|
129
129
|
children: [
|
|
130
|
-
/* @__PURE__ */ i("span", { className: "hidden sm:block", children: n ?? "
|
|
131
|
-
/* @__PURE__ */ i(
|
|
130
|
+
/* @__PURE__ */ i("span", { className: "hidden sm:block", children: n ?? "Ultimo" }),
|
|
131
|
+
/* @__PURE__ */ i(g, {})
|
|
132
132
|
]
|
|
133
133
|
}
|
|
134
134
|
);
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function E({
|
|
137
137
|
className: a,
|
|
138
138
|
...n
|
|
139
139
|
}) {
|
|
@@ -142,7 +142,7 @@ function z({
|
|
|
142
142
|
{
|
|
143
143
|
"aria-hidden": !0,
|
|
144
144
|
"data-slot": "pagination-ellipsis",
|
|
145
|
-
className:
|
|
145
|
+
className: t("flex size-9 items-center justify-center", a),
|
|
146
146
|
...n,
|
|
147
147
|
children: [
|
|
148
148
|
/* @__PURE__ */ i(p, { className: "size-4" }),
|
|
@@ -153,12 +153,12 @@ function z({
|
|
|
153
153
|
}
|
|
154
154
|
export {
|
|
155
155
|
C as Pagination,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
156
|
+
j as PaginationContent,
|
|
157
|
+
E as PaginationEllipsis,
|
|
158
|
+
G as PaginationFirst,
|
|
159
|
+
y as PaginationItem,
|
|
160
|
+
z as PaginationLast,
|
|
161
161
|
r as PaginationLink,
|
|
162
162
|
w as PaginationNext,
|
|
163
|
-
|
|
163
|
+
L as PaginationPrevious
|
|
164
164
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as d, jsx as l } from "react/jsx-runtime";
|
|
3
|
-
import { useState as f, useEffect as ae, useCallback as
|
|
4
|
-
import { useReactTable as
|
|
3
|
+
import { useState as f, useEffect as ae, useCallback as S, useMemo as Y, useRef as $e } from "react";
|
|
4
|
+
import { useReactTable as Ae, flexRender as _ } from "../../../../node_modules/@tanstack/react-table/build/lib/index.js";
|
|
5
5
|
import { useVirtualizer as He } from "../../../../node_modules/@tanstack/react-virtual/dist/esm/index.js";
|
|
6
6
|
import { TableSkeleton as Be } from "../../table-skeleton.js";
|
|
7
|
-
import { TruncatedText as
|
|
7
|
+
import { TruncatedText as w } from "./truncated-text.js";
|
|
8
8
|
import { useDataCrossTable as Fe } from "./data-cross-table-context.js";
|
|
9
|
-
import { cn as
|
|
10
|
-
import { Button as
|
|
9
|
+
import { cn as k } from "../../../../lib/utils.js";
|
|
10
|
+
import { Button as z } from "../../button.js";
|
|
11
11
|
import { Icon as q } from "../../icon.js";
|
|
12
12
|
import { Popover as Oe, PopoverTrigger as We, PopoverContent as Ue } from "../../popover.js";
|
|
13
13
|
import { Table as ce, TableHeader as de, TableRow as G, TableHead as ue, TableBody as Xe, TableCell as Ye } from "../../table.js";
|
|
14
14
|
import { getSortedRowModel as _e, getCoreRowModel as qe } from "../../../../node_modules/@tanstack/table-core/build/lib/index.js";
|
|
15
15
|
function ut({
|
|
16
16
|
crossTableData: I,
|
|
17
|
-
filterable:
|
|
17
|
+
filterable: y = !1,
|
|
18
18
|
loading: fe = !1,
|
|
19
19
|
emptyComponent: me,
|
|
20
20
|
className: K,
|
|
@@ -29,75 +29,75 @@ function ut({
|
|
|
29
29
|
selectedRow: u,
|
|
30
30
|
rowSortAsc: ve = !0
|
|
31
31
|
}) {
|
|
32
|
-
var le,
|
|
33
|
-
const [xe, be] = f([]),
|
|
32
|
+
var le, re;
|
|
33
|
+
const [xe, be] = f([]), h = I.headerTop, m = I.headerLeft, v = I.data, [C, P] = f(
|
|
34
34
|
(u == null ? void 0 : u.id) ?? null
|
|
35
|
-
), [A
|
|
35
|
+
), [$, A] = f(ve), c = Fe(), [we, Ge] = f(he && ge), [ye, Ce] = f({}), [Ne, Se] = f({}), N = (c == null ? void 0 : c.editMode) ?? we, Q = (c == null ? void 0 : c.editedCells) ?? ye, H = (c == null ? void 0 : c.setEditedCells) ?? Ce, B = (c == null ? void 0 : c.toDefaultCells) ?? Ne, F = (c == null ? void 0 : c.setToDefaultCells) ?? Se;
|
|
36
36
|
ae(() => {
|
|
37
|
-
L && L(!!
|
|
38
|
-
}, [
|
|
39
|
-
u != null && u.id &&
|
|
37
|
+
L && L(!!N);
|
|
38
|
+
}, [N, L]), ae(() => {
|
|
39
|
+
u != null && u.id && P(u.id);
|
|
40
40
|
}, [u]);
|
|
41
|
-
const [
|
|
41
|
+
const [n, ke] = f(null), [ze, x] = f(!1), [T, D] = f(null), Te = S(
|
|
42
42
|
(t) => {
|
|
43
|
-
t &&
|
|
43
|
+
t && n && D(n.value), x(t);
|
|
44
44
|
},
|
|
45
|
-
[
|
|
46
|
-
),
|
|
47
|
-
|
|
45
|
+
[n]
|
|
46
|
+
), De = S(() => {
|
|
47
|
+
n && T !== null ? (H((t) => ({
|
|
48
48
|
...t,
|
|
49
|
-
[
|
|
50
|
-
value:
|
|
51
|
-
cell:
|
|
49
|
+
[n.cellKey]: {
|
|
50
|
+
value: T,
|
|
51
|
+
cell: n.cellData
|
|
52
52
|
}
|
|
53
|
-
})), B[
|
|
53
|
+
})), B[n.cellKey] && F((t) => {
|
|
54
54
|
const e = { ...t };
|
|
55
|
-
return delete e[
|
|
55
|
+
return delete e[n.cellKey], e;
|
|
56
56
|
}), setTimeout(() => {
|
|
57
|
-
|
|
58
|
-
}, 300)) :
|
|
59
|
-
}, [
|
|
60
|
-
|
|
57
|
+
x(!1);
|
|
58
|
+
}, 300)) : x(!1);
|
|
59
|
+
}, [n, T, B]), Ee = S(() => {
|
|
60
|
+
n && (D(n.originalValue), H((t) => {
|
|
61
61
|
const e = { ...t };
|
|
62
|
-
return e[
|
|
62
|
+
return e[n.cellKey] && delete e[n.cellKey], e;
|
|
63
63
|
}), F((t) => {
|
|
64
64
|
const e = { ...t };
|
|
65
|
-
return e[
|
|
66
|
-
})),
|
|
67
|
-
}, [
|
|
68
|
-
|
|
65
|
+
return e[n.cellKey] && delete e[n.cellKey], e;
|
|
66
|
+
})), x(!1);
|
|
67
|
+
}, [n]), je = S(() => {
|
|
68
|
+
n && (H((t) => {
|
|
69
69
|
const e = { ...t };
|
|
70
|
-
return e[
|
|
70
|
+
return e[n.cellKey] && delete e[n.cellKey], e;
|
|
71
71
|
}), F((t) => ({
|
|
72
72
|
...t,
|
|
73
|
-
[
|
|
74
|
-
value:
|
|
75
|
-
cell:
|
|
73
|
+
[n.cellKey]: {
|
|
74
|
+
value: n.originalValue,
|
|
75
|
+
cell: n.cellData
|
|
76
76
|
}
|
|
77
|
-
}))),
|
|
78
|
-
}, [
|
|
77
|
+
}))), x(!1);
|
|
78
|
+
}, [n]), Ie = S(
|
|
79
79
|
(t) => {
|
|
80
|
-
|
|
80
|
+
D(t.target.value);
|
|
81
81
|
},
|
|
82
82
|
[]
|
|
83
|
-
), Ke = (t) => t && typeof t == "object" && "value" in t ? t.value : t,
|
|
84
|
-
if (!
|
|
83
|
+
), Ke = (t) => t && typeof t == "object" && "value" in t ? t.value : t, b = Y(() => {
|
|
84
|
+
if (!C || !m.find((r) => r.id === C)) return h;
|
|
85
85
|
const e = m.findIndex(
|
|
86
|
-
(
|
|
86
|
+
(r) => r.id === C
|
|
87
87
|
);
|
|
88
|
-
if (e === -1) return
|
|
89
|
-
const o =
|
|
90
|
-
var
|
|
91
|
-
const s = ((
|
|
92
|
-
return { header:
|
|
88
|
+
if (e === -1) return h;
|
|
89
|
+
const o = h.map((r, i) => {
|
|
90
|
+
var p;
|
|
91
|
+
const s = ((p = v[e]) == null ? void 0 : p[i]) ?? null, a = Ke(s);
|
|
92
|
+
return { header: r, value: a };
|
|
93
93
|
});
|
|
94
|
-
return o.sort((
|
|
95
|
-
if (typeof
|
|
96
|
-
return
|
|
97
|
-
const s = String(
|
|
98
|
-
return
|
|
99
|
-
}), o.map((
|
|
100
|
-
}, [
|
|
94
|
+
return o.sort((r, i) => {
|
|
95
|
+
if (typeof r.value == "number" && typeof i.value == "number")
|
|
96
|
+
return $ ? r.value - i.value : i.value - r.value;
|
|
97
|
+
const s = String(r.value ?? ""), a = String(i.value ?? "");
|
|
98
|
+
return $ ? s.localeCompare(a) : a.localeCompare(s);
|
|
99
|
+
}), o.map((r) => r.header);
|
|
100
|
+
}, [h, m, v, C, $]), Me = Y(() => {
|
|
101
101
|
const t = [
|
|
102
102
|
{
|
|
103
103
|
id: "cross-header",
|
|
@@ -108,38 +108,38 @@ function ut({
|
|
|
108
108
|
accessorFn: (e) => e.item,
|
|
109
109
|
cell: (e) => {
|
|
110
110
|
const o = e.getValue();
|
|
111
|
-
if (!
|
|
112
|
-
return /* @__PURE__ */ l(
|
|
113
|
-
const
|
|
111
|
+
if (!y)
|
|
112
|
+
return /* @__PURE__ */ l(w, { text: o.label, className: "w-full" });
|
|
113
|
+
const r = C === o.id;
|
|
114
114
|
return /* @__PURE__ */ l(
|
|
115
|
-
|
|
115
|
+
z,
|
|
116
116
|
{
|
|
117
117
|
variant: "ghost",
|
|
118
118
|
size: "sm",
|
|
119
119
|
iconLeft: "ArrowLeftRight",
|
|
120
120
|
className: "text-right",
|
|
121
121
|
onClick: () => {
|
|
122
|
-
|
|
122
|
+
y && (r ? A((i) => !i) : (P(m[e.row.index].id), A(!0), J && J(m[e.row.index])));
|
|
123
123
|
},
|
|
124
|
-
children: /* @__PURE__ */ l(
|
|
124
|
+
children: /* @__PURE__ */ l(w, { text: o.label })
|
|
125
125
|
}
|
|
126
126
|
);
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
];
|
|
130
|
-
return
|
|
130
|
+
return b.forEach((e) => {
|
|
131
131
|
t.push({
|
|
132
132
|
id: e.id,
|
|
133
133
|
accessorFn: (o) => o[e.id],
|
|
134
|
-
header: ({ column: o }) =>
|
|
135
|
-
|
|
134
|
+
header: ({ column: o }) => y ? /* @__PURE__ */ l(
|
|
135
|
+
z,
|
|
136
136
|
{
|
|
137
137
|
variant: "ghost",
|
|
138
138
|
size: "sm",
|
|
139
139
|
iconLeft: "ArrowUpDown",
|
|
140
|
-
onClick:
|
|
140
|
+
onClick: y ? () => o.toggleSorting(o.getIsSorted() === "asc") : void 0,
|
|
141
141
|
children: /* @__PURE__ */ l(
|
|
142
|
-
|
|
142
|
+
w,
|
|
143
143
|
{
|
|
144
144
|
text: e.label,
|
|
145
145
|
className: "w-full max-w-full min-w-0"
|
|
@@ -147,46 +147,46 @@ function ut({
|
|
|
147
147
|
)
|
|
148
148
|
}
|
|
149
149
|
) : /* @__PURE__ */ l(
|
|
150
|
-
|
|
150
|
+
w,
|
|
151
151
|
{
|
|
152
152
|
text: e.label,
|
|
153
153
|
className: "w-full max-w-full min-w-0 text-center font-medium"
|
|
154
154
|
}
|
|
155
155
|
),
|
|
156
|
-
sortingFn: (o,
|
|
157
|
-
let s = o.getValue(i), a =
|
|
156
|
+
sortingFn: (o, r, i) => {
|
|
157
|
+
let s = o.getValue(i), a = r.getValue(i);
|
|
158
158
|
return s == null && a == null ? 0 : s == null ? 1 : a == null ? -1 : (s && typeof s == "object" && "value" in s && (s = s.value), a && typeof a == "object" && "value" in a && (a = a.value), typeof s == "number" && typeof a == "number" ? s - a : String(s).localeCompare(String(a)));
|
|
159
159
|
},
|
|
160
160
|
cell: (o) => {
|
|
161
|
-
const
|
|
162
|
-
return
|
|
161
|
+
const r = o.getValue();
|
|
162
|
+
return r ? r.render ? r.render(r.fromId, r.toId, r.id) : /* @__PURE__ */ l("div", { className: "flex h-full w-full min-w-0 items-center justify-center", children: /* @__PURE__ */ l(w, { text: String((r == null ? void 0 : r.value) ?? "") }) }) : null;
|
|
163
163
|
}
|
|
164
164
|
});
|
|
165
165
|
}), t;
|
|
166
166
|
}, [
|
|
167
|
-
|
|
167
|
+
b,
|
|
168
168
|
M,
|
|
169
169
|
V,
|
|
170
170
|
u,
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
171
|
+
y,
|
|
172
|
+
P,
|
|
173
|
+
A
|
|
174
174
|
]), Ve = Y(() => m.map((t, e) => {
|
|
175
175
|
const o = { item: t };
|
|
176
|
-
return
|
|
176
|
+
return b.forEach((r) => {
|
|
177
177
|
var s;
|
|
178
|
-
const i =
|
|
179
|
-
o[
|
|
178
|
+
const i = h.findIndex((a) => a.id === r.id);
|
|
179
|
+
o[r.id] = i !== -1 ? ((s = v[e]) == null ? void 0 : s[i]) ?? null : null;
|
|
180
180
|
}), o;
|
|
181
|
-
}), [m,
|
|
181
|
+
}), [m, b, v, h]), E = Ae({
|
|
182
182
|
data: Ve,
|
|
183
183
|
columns: Me,
|
|
184
184
|
state: { sorting: xe },
|
|
185
185
|
onSortingChange: be,
|
|
186
186
|
getCoreRowModel: qe(),
|
|
187
187
|
getSortedRowModel: _e()
|
|
188
|
-
}), Z =
|
|
189
|
-
count:
|
|
188
|
+
}), Z = $e(null), ee = He({
|
|
189
|
+
count: E.getRowModel().rows.length,
|
|
190
190
|
getScrollElement: () => Z.current,
|
|
191
191
|
estimateSize: () => 40,
|
|
192
192
|
overscan: 5,
|
|
@@ -196,27 +196,27 @@ function ut({
|
|
|
196
196
|
return /* @__PURE__ */ l(
|
|
197
197
|
Be,
|
|
198
198
|
{
|
|
199
|
-
headerRow:
|
|
199
|
+
headerRow: b.map((t) => t.label),
|
|
200
200
|
rowCount: m.length || 5,
|
|
201
|
-
columnCount:
|
|
201
|
+
columnCount: b.length || 5,
|
|
202
202
|
className: K,
|
|
203
203
|
cornerHeaderFrom: M,
|
|
204
204
|
cornerHeaderTo: V
|
|
205
205
|
}
|
|
206
206
|
);
|
|
207
207
|
const te = (t) => {
|
|
208
|
-
const e = t.column.id === "cross-header", o = e,
|
|
209
|
-
e ||
|
|
208
|
+
const e = t.column.id === "cross-header", o = e, r = ["bg-d-secondary"];
|
|
209
|
+
e || r.push("border-r"), e && r.push("sticky left-0"), r.push("sticky top-0 z-20"), o ? r.push("z-40") : e && r.push("z-30");
|
|
210
210
|
let i = "none";
|
|
211
211
|
return e && (i = "inset -1px 0 0 0 var(--d-border), 0 1px 0 0 var(--d-border)"), {
|
|
212
|
-
className:
|
|
212
|
+
className: r.join(" "),
|
|
213
213
|
style: { boxShadow: i, width: `${R}px` }
|
|
214
214
|
};
|
|
215
215
|
};
|
|
216
|
-
return !
|
|
216
|
+
return !v || v.length === 0 ? /* @__PURE__ */ d(
|
|
217
217
|
"div",
|
|
218
218
|
{
|
|
219
|
-
className:
|
|
219
|
+
className: k(
|
|
220
220
|
"flex h-full w-full flex-col overflow-auto",
|
|
221
221
|
K ?? ""
|
|
222
222
|
),
|
|
@@ -226,7 +226,7 @@ function ut({
|
|
|
226
226
|
{
|
|
227
227
|
className: "bg-d-secondary sticky top-0 z-20 w-full",
|
|
228
228
|
style: { boxShadow: "0 1px 0 0 var(--d-border)" },
|
|
229
|
-
children: (
|
|
229
|
+
children: (E.getHeaderGroups() ?? []).map((t) => /* @__PURE__ */ l(
|
|
230
230
|
G,
|
|
231
231
|
{
|
|
232
232
|
className: "bg-d-secondary sticky top-0 z-20",
|
|
@@ -253,7 +253,7 @@ function ut({
|
|
|
253
253
|
/* @__PURE__ */ l("div", { className: "sticky top-0 left-0 flex flex-1", children: me || pe })
|
|
254
254
|
]
|
|
255
255
|
}
|
|
256
|
-
) : /* @__PURE__ */ d("div", { className: `${
|
|
256
|
+
) : /* @__PURE__ */ d("div", { className: `${k("w-[900px]", K || "")}`, children: [
|
|
257
257
|
/* @__PURE__ */ l(
|
|
258
258
|
"div",
|
|
259
259
|
{
|
|
@@ -265,7 +265,7 @@ function ut({
|
|
|
265
265
|
{
|
|
266
266
|
className: "bg-d-secondary sticky top-0 z-20 w-full",
|
|
267
267
|
style: { boxShadow: "0 1px 0 0 var(--d-border)" },
|
|
268
|
-
children:
|
|
268
|
+
children: E.getHeaderGroups().map((t) => /* @__PURE__ */ l(
|
|
269
269
|
G,
|
|
270
270
|
{
|
|
271
271
|
className: "bg-d-secondary sticky top-0 z-20",
|
|
@@ -298,7 +298,7 @@ function ut({
|
|
|
298
298
|
width: "100%"
|
|
299
299
|
},
|
|
300
300
|
children: ee.getVirtualItems().map((t) => {
|
|
301
|
-
const e =
|
|
301
|
+
const e = E.getRowModel().rows[t.index];
|
|
302
302
|
return /* @__PURE__ */ l(
|
|
303
303
|
G,
|
|
304
304
|
{
|
|
@@ -312,15 +312,18 @@ function ut({
|
|
|
312
312
|
height: `${t.size}px`,
|
|
313
313
|
display: "flex"
|
|
314
314
|
},
|
|
315
|
-
children: e.getVisibleCells().map((o,
|
|
316
|
-
const i =
|
|
315
|
+
children: e.getVisibleCells().map((o, r) => {
|
|
316
|
+
const i = r === 0, s = o.getValue(), a = i ? "var(--d-secondary)" : (s == null ? void 0 : s.bgColor) || "transparent", p = s.editable ?? !0;
|
|
317
317
|
return /* @__PURE__ */ l(
|
|
318
318
|
Ye,
|
|
319
319
|
{
|
|
320
|
-
|
|
320
|
+
onClick: (g) => {
|
|
321
|
+
!p || !N || (g.stopPropagation(), g.preventDefault());
|
|
322
|
+
},
|
|
323
|
+
className: k(
|
|
321
324
|
"border-d-border text-center",
|
|
322
325
|
i ? "sticky left-0 z-10" : "border-r",
|
|
323
|
-
|
|
326
|
+
p && N && "cursor-pointer"
|
|
324
327
|
),
|
|
325
328
|
style: {
|
|
326
329
|
boxShadow: i ? "inset -1px 0 0 0 var(--d-border)" : "none",
|
|
@@ -332,7 +335,7 @@ function ut({
|
|
|
332
335
|
alignItems: "center",
|
|
333
336
|
justifyContent: "center"
|
|
334
337
|
},
|
|
335
|
-
children: i || !
|
|
338
|
+
children: i || !N || !s ? (
|
|
336
339
|
// Rendering normale per la prima colonna o quando non siamo in modalità edit
|
|
337
340
|
_(
|
|
338
341
|
o.column.columnDef.cell,
|
|
@@ -341,7 +344,7 @@ function ut({
|
|
|
341
344
|
) : (
|
|
342
345
|
// Rendering con cella modificabile
|
|
343
346
|
(() => {
|
|
344
|
-
const
|
|
347
|
+
const g = `${e.index}-${o.column.id}`, j = g in Q ? Q[g].value : s.value || "", Re = j !== s.value, ne = g in B;
|
|
345
348
|
return /* @__PURE__ */ l(
|
|
346
349
|
"div",
|
|
347
350
|
{
|
|
@@ -349,24 +352,24 @@ function ut({
|
|
|
349
352
|
onClick: (Le) => {
|
|
350
353
|
const O = Le.currentTarget.getBoundingClientRect(), oe = 400, se = 164, W = 8;
|
|
351
354
|
let U = O.left + window.scrollX, X = O.bottom + 5;
|
|
352
|
-
const ie = window.innerWidth,
|
|
353
|
-
U + oe > ie - W && (U = ie - oe - W), X + se >
|
|
354
|
-
cellKey:
|
|
355
|
+
const ie = window.innerWidth, Pe = window.innerHeight;
|
|
356
|
+
U + oe > ie - W && (U = ie - oe - W), X + se > Pe - W && (X = O.bottom - se - 5), ke({
|
|
357
|
+
cellKey: g,
|
|
355
358
|
value: j,
|
|
356
359
|
originalValue: s.value || "",
|
|
357
360
|
cellData: s,
|
|
358
361
|
position: { top: X, left: U }
|
|
359
|
-
}),
|
|
362
|
+
}), D(j), x(!0);
|
|
360
363
|
},
|
|
361
364
|
children: /* @__PURE__ */ d("div", { className: "relative flex h-full max-h-full w-full max-w-full items-center justify-center gap-1", children: [
|
|
362
|
-
Re && !
|
|
365
|
+
Re && !ne && /* @__PURE__ */ l(
|
|
363
366
|
"div",
|
|
364
367
|
{
|
|
365
368
|
className: "bg-d-primary absolute -top-1.5 -left-1.5 rounded p-1",
|
|
366
369
|
title: "Valore modificato"
|
|
367
370
|
}
|
|
368
371
|
),
|
|
369
|
-
|
|
372
|
+
ne && /* @__PURE__ */ l(
|
|
370
373
|
"div",
|
|
371
374
|
{
|
|
372
375
|
className: "bg-d-destructive absolute -top-1.5 -left-1.5 rounded p-1",
|
|
@@ -376,21 +379,27 @@ function ut({
|
|
|
376
379
|
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1", children: /* @__PURE__ */ l(
|
|
377
380
|
"div",
|
|
378
381
|
{
|
|
379
|
-
className:
|
|
382
|
+
className: k(
|
|
380
383
|
"h-full min-h-full w-full min-w-full truncate text-center",
|
|
381
|
-
|
|
384
|
+
p ? "text-d-muted-foreground" : "text-d-muted"
|
|
382
385
|
),
|
|
383
|
-
children:
|
|
386
|
+
children: /* @__PURE__ */ l(
|
|
387
|
+
w,
|
|
388
|
+
{
|
|
389
|
+
text: j,
|
|
390
|
+
className: "w-full"
|
|
391
|
+
}
|
|
392
|
+
)
|
|
384
393
|
}
|
|
385
394
|
) }),
|
|
386
395
|
/* @__PURE__ */ l(
|
|
387
396
|
q,
|
|
388
397
|
{
|
|
389
|
-
name:
|
|
398
|
+
name: p ? "Pencil" : "PencilOff",
|
|
390
399
|
size: "sm",
|
|
391
|
-
className:
|
|
400
|
+
className: k(
|
|
392
401
|
"h-3 w-3",
|
|
393
|
-
|
|
402
|
+
p ? "text-d-muted-foreground" : "text-d-muted"
|
|
394
403
|
)
|
|
395
404
|
}
|
|
396
405
|
)
|
|
@@ -412,7 +421,7 @@ function ut({
|
|
|
412
421
|
] })
|
|
413
422
|
}
|
|
414
423
|
),
|
|
415
|
-
/* @__PURE__ */ d(Oe, { open:
|
|
424
|
+
/* @__PURE__ */ d(Oe, { open: ze, onOpenChange: Te, children: [
|
|
416
425
|
/* @__PURE__ */ l(We, { asChild: !0, children: /* @__PURE__ */ l("div", { style: { display: "none" } }) }),
|
|
417
426
|
/* @__PURE__ */ l(
|
|
418
427
|
Ue,
|
|
@@ -421,32 +430,32 @@ function ut({
|
|
|
421
430
|
sideOffset: 5,
|
|
422
431
|
style: {
|
|
423
432
|
position: "absolute",
|
|
424
|
-
top: ((le =
|
|
425
|
-
left: ((
|
|
433
|
+
top: ((le = n == null ? void 0 : n.position) == null ? void 0 : le.top) ?? 0,
|
|
434
|
+
left: ((re = n == null ? void 0 : n.position) == null ? void 0 : re.left) ?? 0,
|
|
426
435
|
zIndex: 50
|
|
427
436
|
},
|
|
428
437
|
children: /* @__PURE__ */ d("div", { className: "space-y-4", children: [
|
|
429
438
|
/* @__PURE__ */ d("div", { className: "flex items-center justify-between", children: [
|
|
430
439
|
/* @__PURE__ */ l("div", { className: "font-medium", children: "Modifica valore" }),
|
|
431
|
-
|
|
440
|
+
n && n.value !== n.originalValue && /* @__PURE__ */ l("div", { className: "text-d-muted-foreground text-xs", children: "Valore modificato" })
|
|
432
441
|
] }),
|
|
433
442
|
/* @__PURE__ */ l(
|
|
434
443
|
"input",
|
|
435
444
|
{
|
|
436
445
|
type: "text",
|
|
437
446
|
className: "bg-d-secondary w-full rounded border p-2",
|
|
438
|
-
value:
|
|
447
|
+
value: T || "",
|
|
439
448
|
onChange: Ie,
|
|
440
449
|
autoFocus: !0
|
|
441
450
|
}
|
|
442
451
|
),
|
|
443
452
|
/* @__PURE__ */ d("div", { className: "flex items-center justify-between", children: [
|
|
444
453
|
/* @__PURE__ */ d(
|
|
445
|
-
|
|
454
|
+
z,
|
|
446
455
|
{
|
|
447
456
|
variant: "destructive",
|
|
448
457
|
size: "sm",
|
|
449
|
-
onClick:
|
|
458
|
+
onClick: je,
|
|
450
459
|
className: "text-xs",
|
|
451
460
|
title: "Ripristina il valore originale e segna la cella come da ripristinare",
|
|
452
461
|
children: [
|
|
@@ -457,21 +466,21 @@ function ut({
|
|
|
457
466
|
),
|
|
458
467
|
/* @__PURE__ */ d("div", { className: "flex space-x-2", children: [
|
|
459
468
|
/* @__PURE__ */ l(
|
|
460
|
-
|
|
469
|
+
z,
|
|
461
470
|
{
|
|
462
471
|
variant: "ghost",
|
|
463
472
|
size: "sm",
|
|
464
|
-
onClick:
|
|
473
|
+
onClick: Ee,
|
|
465
474
|
className: "text-xs",
|
|
466
475
|
title: "Annulla le modifiche correnti e chiudi",
|
|
467
476
|
children: "Annulla"
|
|
468
477
|
}
|
|
469
478
|
),
|
|
470
479
|
/* @__PURE__ */ d(
|
|
471
|
-
|
|
480
|
+
z,
|
|
472
481
|
{
|
|
473
482
|
size: "sm",
|
|
474
|
-
onClick:
|
|
483
|
+
onClick: De,
|
|
475
484
|
className: "text-xs",
|
|
476
485
|
title: "Conferma le modifiche e salva",
|
|
477
486
|
children: [
|