laif-ds 0.2.75 → 0.2.76
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 +15 -0
- package/dist/agent-docs/adoption-report.json +5 -4
- 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 +1 -0
- package/dist/agent-docs/manifest.json +11 -9
- package/dist/agent-docs/truncated-cell.md +342 -0
- 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 +35 -4
- package/dist/index.js +375 -373
- package/dist/styles.v3.css +1 -1
- package/package.json +1 -1
|
@@ -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
|
]
|
|
@@ -1,111 +1,112 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { flexRender as
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { ScrollArea as
|
|
7
|
-
import { Table as
|
|
8
|
-
import { getPinnedStyle as
|
|
9
|
-
import { DataTableHeaderComponent as
|
|
10
|
-
import { SkeletonRows as
|
|
11
|
-
function
|
|
2
|
+
import { jsx as s, jsxs as C } from "react/jsx-runtime";
|
|
3
|
+
import { flexRender as oe } from "../../../../../node_modules/@tanstack/react-table/build/lib/index.js";
|
|
4
|
+
import { useRef as ne, useState as G, useMemo as b, useCallback as F, useLayoutEffect as re, useEffect as B } from "react";
|
|
5
|
+
import { cn as L } from "../../../../../lib/utils.js";
|
|
6
|
+
import { ScrollArea as se, ScrollBar as P } from "../../../scroll-area.js";
|
|
7
|
+
import { Table as ie, TableBody as A, TableRow as I, TableCell as M } from "../../../table.js";
|
|
8
|
+
import { getPinnedStyle as ce } from "../data-table.service.js";
|
|
9
|
+
import { DataTableHeaderComponent as le } from "./data-table-header.js";
|
|
10
|
+
import { SkeletonRows as ue } from "./data-table-skeleton-rows.js";
|
|
11
|
+
function Re({
|
|
12
12
|
table: u,
|
|
13
|
-
tableContainerRef:
|
|
13
|
+
tableContainerRef: i,
|
|
14
14
|
loading: d,
|
|
15
|
-
data:
|
|
16
|
-
emptyComponent:
|
|
17
|
-
notFoundMessage:
|
|
18
|
-
onAddFilter:
|
|
19
|
-
maxSortedColumns:
|
|
20
|
-
i18n:
|
|
15
|
+
data: W,
|
|
16
|
+
emptyComponent: j,
|
|
17
|
+
notFoundMessage: V,
|
|
18
|
+
onAddFilter: $,
|
|
19
|
+
maxSortedColumns: U = 3,
|
|
20
|
+
i18n: J,
|
|
21
21
|
isServerSide: p = !1,
|
|
22
|
-
filterBadges:
|
|
22
|
+
filterBadges: K = [],
|
|
23
23
|
advancedFilterBadge: R,
|
|
24
|
-
searchbarGlobalFilter:
|
|
25
|
-
serverDebounceTime:
|
|
24
|
+
searchbarGlobalFilter: Q,
|
|
25
|
+
serverDebounceTime: D = 750,
|
|
26
|
+
rowClassName: x
|
|
26
27
|
}) {
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
29
|
-
const o = (
|
|
28
|
+
const X = (e) => {
|
|
29
|
+
if (K.some((r) => r.columnId === e)) return !0;
|
|
30
|
+
const o = (r) => r.some((c) => c.columnId === e), n = (r) => r ? r.some((c) => o(c.conditions) ? !0 : c.groups ? n(c.groups) : !1) : !1;
|
|
30
31
|
if (R?.rootGroup) {
|
|
31
32
|
if (o(R.rootGroup.conditions))
|
|
32
33
|
return !0;
|
|
33
34
|
if (R.rootGroup.groups)
|
|
34
|
-
return
|
|
35
|
+
return n(R.rootGroup.groups);
|
|
35
36
|
}
|
|
36
37
|
return !1;
|
|
37
|
-
},
|
|
38
|
+
}, z = ne({}), [k, Y] = G({}), [Z, N] = G(8), [v, _] = G(!1), y = b(() => {
|
|
38
39
|
let e;
|
|
39
40
|
const t = (o) => {
|
|
40
41
|
clearTimeout(e), e = setTimeout(
|
|
41
42
|
() => _(o),
|
|
42
|
-
|
|
43
|
+
D
|
|
43
44
|
);
|
|
44
45
|
};
|
|
45
46
|
return t.cancel = () => {
|
|
46
47
|
clearTimeout(e);
|
|
47
48
|
}, t;
|
|
48
|
-
}, [
|
|
49
|
+
}, [D]), q = b(() => {
|
|
49
50
|
const e = u.getHeaderGroups()[0];
|
|
50
51
|
return e ? e.headers : [];
|
|
51
52
|
}, [u.getHeaderGroups]), g = b(
|
|
52
53
|
() => q.filter((e) => e.column.getIsVisible()),
|
|
53
54
|
[q]
|
|
54
|
-
),
|
|
55
|
+
), H = b(
|
|
55
56
|
() => g.filter((e) => e.column.columnDef.meta?.pinned === "left"),
|
|
56
57
|
[g]
|
|
57
|
-
),
|
|
58
|
+
), S = b(
|
|
58
59
|
() => g.filter((e) => e.column.columnDef.meta?.pinned === "right"),
|
|
59
60
|
[g]
|
|
60
|
-
),
|
|
61
|
+
), ee = b(
|
|
61
62
|
() => g.map((e) => e.id).join("|"),
|
|
62
63
|
[g]
|
|
63
|
-
),
|
|
64
|
-
const e =
|
|
64
|
+
), te = u.getState().pagination, T = F(() => {
|
|
65
|
+
const e = i.current;
|
|
65
66
|
if (!e) return 8;
|
|
66
|
-
const t = e.querySelector("thead tr"), o = e.querySelector("tbody tr"),
|
|
67
|
+
const t = e.querySelector("thead tr"), o = e.querySelector("tbody tr"), n = t?.getBoundingClientRect().height ?? 40, r = o?.getBoundingClientRect().height ?? 32.5, O = e.offsetHeight - n, w = Math.floor(O / r);
|
|
67
68
|
return w > 1 ? w : 8;
|
|
68
|
-
}, [
|
|
69
|
+
}, [i]), a = F(
|
|
69
70
|
(e = 0) => {
|
|
70
71
|
const t = {};
|
|
71
72
|
let o = !1;
|
|
72
|
-
if (!
|
|
73
|
+
if (!i.current) {
|
|
73
74
|
e < 5 && setTimeout(() => a(e + 1), 100);
|
|
74
75
|
return;
|
|
75
76
|
}
|
|
76
|
-
const
|
|
77
|
+
const n = i.current.querySelector(
|
|
77
78
|
"tbody tr:first-child"
|
|
78
79
|
);
|
|
79
|
-
let
|
|
80
|
-
for (const w of
|
|
80
|
+
let r = 0;
|
|
81
|
+
for (const w of H) {
|
|
81
82
|
const f = w.column.id;
|
|
82
|
-
t[f] = { side: "left", offset:
|
|
83
|
+
t[f] = { side: "left", offset: r };
|
|
83
84
|
let l = 0;
|
|
84
|
-
const m =
|
|
85
|
+
const m = n?.querySelector(
|
|
85
86
|
`[data-column-id="${f}"]`
|
|
86
|
-
), h =
|
|
87
|
-
m && m.offsetWidth > 0 ? l = m.getBoundingClientRect().width : h && h.offsetWidth > 0 ? l = h.getBoundingClientRect().width : (o = !0, l = 150),
|
|
87
|
+
), h = z.current[f];
|
|
88
|
+
m && m.offsetWidth > 0 ? l = m.getBoundingClientRect().width : h && h.offsetWidth > 0 ? l = h.getBoundingClientRect().width : (o = !0, l = 150), r += l;
|
|
88
89
|
}
|
|
89
90
|
let c = 0;
|
|
90
|
-
for (const w of [...
|
|
91
|
+
for (const w of [...S].reverse()) {
|
|
91
92
|
const f = w.column.id;
|
|
92
93
|
t[f] = { side: "right", offset: c };
|
|
93
94
|
let l = 0;
|
|
94
|
-
const m =
|
|
95
|
+
const m = n?.querySelector(
|
|
95
96
|
`[data-column-id="${f}"]`
|
|
96
|
-
), h =
|
|
97
|
+
), h = z.current[f];
|
|
97
98
|
m && m.offsetWidth > 0 ? l = m.getBoundingClientRect().width : h && h.offsetWidth > 0 ? l = h.getBoundingClientRect().width : (o = !0, l = 150), c += l;
|
|
98
99
|
}
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
|
|
100
|
+
Y(t);
|
|
101
|
+
const O = T();
|
|
102
|
+
N(O), o && e < 5 && setTimeout(
|
|
102
103
|
() => a(e + 1),
|
|
103
104
|
100 * (e + 1)
|
|
104
105
|
);
|
|
105
106
|
},
|
|
106
|
-
[
|
|
107
|
+
[T, H, S, i]
|
|
107
108
|
);
|
|
108
|
-
return
|
|
109
|
+
return re(() => {
|
|
109
110
|
(() => {
|
|
110
111
|
requestAnimationFrame(() => {
|
|
111
112
|
requestAnimationFrame(() => {
|
|
@@ -116,33 +117,33 @@ function be({
|
|
|
116
117
|
});
|
|
117
118
|
})();
|
|
118
119
|
}, [
|
|
119
|
-
v,
|
|
120
120
|
H,
|
|
121
|
-
|
|
121
|
+
S,
|
|
122
|
+
ee,
|
|
122
123
|
d,
|
|
123
|
-
|
|
124
|
-
|
|
124
|
+
W,
|
|
125
|
+
te,
|
|
125
126
|
a
|
|
126
|
-
]),
|
|
127
|
+
]), B(() => {
|
|
127
128
|
const e = () => {
|
|
128
129
|
clearTimeout(e.timeout), e.timeout = setTimeout(() => a(), 100);
|
|
129
130
|
};
|
|
130
131
|
window.addEventListener("resize", e);
|
|
131
|
-
const t =
|
|
132
|
+
const t = i.current;
|
|
132
133
|
let o = null;
|
|
133
134
|
return t && typeof ResizeObserver < "u" && (o = new ResizeObserver(() => {
|
|
134
135
|
a();
|
|
135
136
|
}), o.observe(t)), () => {
|
|
136
137
|
window.removeEventListener("resize", e), clearTimeout(e.timeout), o && o.disconnect();
|
|
137
138
|
};
|
|
138
|
-
}, [a,
|
|
139
|
+
}, [a, i]), B(() => {
|
|
139
140
|
if (d) {
|
|
140
141
|
const e = () => {
|
|
141
|
-
const
|
|
142
|
-
|
|
142
|
+
const n = T();
|
|
143
|
+
N(n);
|
|
143
144
|
};
|
|
144
145
|
e();
|
|
145
|
-
const t =
|
|
146
|
+
const t = i.current;
|
|
146
147
|
let o = null;
|
|
147
148
|
return t && typeof ResizeObserver < "u" && (o = new ResizeObserver(() => {
|
|
148
149
|
e();
|
|
@@ -150,84 +151,91 @@ function be({
|
|
|
150
151
|
o && o.disconnect();
|
|
151
152
|
};
|
|
152
153
|
}
|
|
153
|
-
}, [
|
|
154
|
-
|
|
155
|
-
}), [d,
|
|
154
|
+
}, [T, d, i]), B(() => (d ? (_(!0), y.cancel()) : y(!1), () => {
|
|
155
|
+
y.cancel();
|
|
156
|
+
}), [d, y]), /* @__PURE__ */ s(
|
|
156
157
|
"div",
|
|
157
158
|
{
|
|
158
159
|
className: "flex max-h-full min-h-0 max-w-full min-w-0 flex-1",
|
|
159
|
-
ref:
|
|
160
|
-
children: /* @__PURE__ */
|
|
161
|
-
/* @__PURE__ */
|
|
162
|
-
/* @__PURE__ */
|
|
163
|
-
/* @__PURE__ */
|
|
164
|
-
/* @__PURE__ */
|
|
165
|
-
|
|
160
|
+
ref: i,
|
|
161
|
+
children: /* @__PURE__ */ C(se, { className: "border-d-border h-full min-h-0 w-full rounded-md border", children: [
|
|
162
|
+
/* @__PURE__ */ s(P, { orientation: "horizontal", className: "z-[100]" }),
|
|
163
|
+
/* @__PURE__ */ s(P, { orientation: "vertical" }),
|
|
164
|
+
/* @__PURE__ */ C(ie, { className: "w-full min-w-max", children: [
|
|
165
|
+
/* @__PURE__ */ s(
|
|
166
|
+
le,
|
|
166
167
|
{
|
|
167
168
|
table: u,
|
|
168
|
-
headerRefs:
|
|
169
|
-
pinnedOffsets:
|
|
170
|
-
maxSortedColumns:
|
|
171
|
-
i18n:
|
|
172
|
-
searchbarGlobalFilter:
|
|
173
|
-
isColumnFiltered:
|
|
174
|
-
onAddFilter:
|
|
169
|
+
headerRefs: z,
|
|
170
|
+
pinnedOffsets: k,
|
|
171
|
+
maxSortedColumns: U,
|
|
172
|
+
i18n: J,
|
|
173
|
+
searchbarGlobalFilter: Q,
|
|
174
|
+
isColumnFiltered: X,
|
|
175
|
+
onAddFilter: $
|
|
175
176
|
}
|
|
176
177
|
),
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
|
|
178
|
+
/* @__PURE__ */ s(
|
|
179
|
+
A,
|
|
179
180
|
{
|
|
180
181
|
"data-table-body": "skeleton",
|
|
181
|
-
className: p &&
|
|
182
|
-
children: (p &&
|
|
183
|
-
|
|
182
|
+
className: p && v || !p && d ? "" : "absolute -z-100 h-0 min-h-0 overflow-hidden opacity-0",
|
|
183
|
+
children: (p && v || !p && d) && /* @__PURE__ */ s(
|
|
184
|
+
ue,
|
|
184
185
|
{
|
|
185
|
-
skeletonRowCount:
|
|
186
|
-
pinnedOffsets:
|
|
186
|
+
skeletonRowCount: Z,
|
|
187
|
+
pinnedOffsets: k,
|
|
187
188
|
table: u
|
|
188
189
|
}
|
|
189
190
|
)
|
|
190
191
|
}
|
|
191
192
|
),
|
|
192
|
-
/* @__PURE__ */
|
|
193
|
-
|
|
193
|
+
/* @__PURE__ */ s(
|
|
194
|
+
A,
|
|
194
195
|
{
|
|
195
196
|
"data-table-body": "data",
|
|
196
|
-
className: p &&
|
|
197
|
-
children: u.getRowModel().rows?.length ? u.getRowModel().rows.map((e) => /* @__PURE__ */
|
|
198
|
-
|
|
197
|
+
className: p && v || !p && d ? "absolute -z-100 h-0 min-h-0 overflow-hidden opacity-0" : "",
|
|
198
|
+
children: u.getRowModel().rows?.length ? u.getRowModel().rows.map((e) => /* @__PURE__ */ s(
|
|
199
|
+
I,
|
|
199
200
|
{
|
|
200
201
|
"data-state": e.getIsSelected() && "selected",
|
|
201
|
-
className:
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
202
|
+
className: L(
|
|
203
|
+
"border-0 shadow-[inset_0_-1px_0_var(--d-border)]",
|
|
204
|
+
typeof x == "function" ? x(e) : x
|
|
205
|
+
),
|
|
206
|
+
children: e.getVisibleCells().map((t) => {
|
|
207
|
+
const o = t.column.columnDef.meta?.cellClassName, n = typeof o == "function" ? o(t.getValue(), e.original) : o;
|
|
208
|
+
return /* @__PURE__ */ s(
|
|
209
|
+
M,
|
|
210
|
+
{
|
|
211
|
+
"data-column-id": t.column.id,
|
|
212
|
+
className: L(
|
|
213
|
+
"border-0",
|
|
214
|
+
t.column.columnDef.meta?.pinned ? "bg-d-background z-[50]" : "shadow-[inset_-1px_0_0_var(--d-border)]",
|
|
215
|
+
n
|
|
216
|
+
),
|
|
217
|
+
style: ce(
|
|
218
|
+
t.column.id,
|
|
219
|
+
k,
|
|
220
|
+
t.column.columnDef.meta?.pinned,
|
|
221
|
+
!1
|
|
222
|
+
),
|
|
223
|
+
children: oe(
|
|
224
|
+
t.column.columnDef.cell,
|
|
225
|
+
t.getContext()
|
|
226
|
+
)
|
|
227
|
+
},
|
|
228
|
+
t.id
|
|
229
|
+
);
|
|
230
|
+
})
|
|
223
231
|
},
|
|
224
232
|
e.id
|
|
225
|
-
)) : /* @__PURE__ */
|
|
226
|
-
|
|
233
|
+
)) : /* @__PURE__ */ s(I, { children: /* @__PURE__ */ s(
|
|
234
|
+
M,
|
|
227
235
|
{
|
|
228
236
|
colSpan: u?.getHeaderGroups()?.[0]?.headers?.length ?? 1,
|
|
229
237
|
className: "pt-4 text-center",
|
|
230
|
-
children:
|
|
238
|
+
children: j || V
|
|
231
239
|
}
|
|
232
240
|
) })
|
|
233
241
|
}
|
|
@@ -238,5 +246,5 @@ function be({
|
|
|
238
246
|
);
|
|
239
247
|
}
|
|
240
248
|
export {
|
|
241
|
-
|
|
249
|
+
Re as DataTableBody
|
|
242
250
|
};
|
|
@@ -6,8 +6,8 @@ import { cn as l } from "../../../../../lib/utils.js";
|
|
|
6
6
|
import { Button as i } from "../../../button.js";
|
|
7
7
|
import { Icon as m } from "../../../icon.js";
|
|
8
8
|
import { Popover as D, PopoverTrigger as y, PopoverContent as N } from "../../../popover.js";
|
|
9
|
-
import { TableHeader as I, TableRow as h, TableHead as
|
|
10
|
-
import { getPinnedStyle as
|
|
9
|
+
import { TableHeader as I, TableRow as h, TableHead as C } from "../../../table.js";
|
|
10
|
+
import { getPinnedStyle as z } from "../data-table.service.js";
|
|
11
11
|
function F({
|
|
12
12
|
table: r,
|
|
13
13
|
headerRefs: g,
|
|
@@ -20,16 +20,17 @@ function F({
|
|
|
20
20
|
}) {
|
|
21
21
|
const [x, u] = S.useState({});
|
|
22
22
|
return /* @__PURE__ */ t(I, { children: r.getHeaderGroups().map((a) => /* @__PURE__ */ t(h, { children: a.headers.map((e) => /* @__PURE__ */ t(
|
|
23
|
-
|
|
23
|
+
C,
|
|
24
24
|
{
|
|
25
25
|
ref: (o) => {
|
|
26
26
|
g.current[e.column.id] = o;
|
|
27
27
|
},
|
|
28
28
|
className: l(
|
|
29
29
|
"bg-d-background sticky top-0 h-8 px-0",
|
|
30
|
-
e.column.columnDef.meta?.pinned ? "z-[49]" : "z-10"
|
|
30
|
+
e.column.columnDef.meta?.pinned ? "z-[49]" : "z-10",
|
|
31
|
+
e.column.columnDef.meta?.headerClassName
|
|
31
32
|
),
|
|
32
|
-
style:
|
|
33
|
+
style: z(
|
|
33
34
|
e.column.id,
|
|
34
35
|
d,
|
|
35
36
|
e.column.columnDef.meta?.pinned,
|