laif-ds 0.2.74 → 0.2.75
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 +431 -0
- package/dist/agent-docs/adoption-report.json +614 -0
- package/dist/agent-docs/components/Accordion.md +46 -16
- package/dist/agent-docs/components/Alert.md +90 -95
- package/dist/agent-docs/components/AlertDialog.md +132 -126
- package/dist/agent-docs/components/AppEditor.md +90 -90
- package/dist/agent-docs/components/AppRadioGroup.md +18 -18
- package/dist/agent-docs/components/AppSidebar.md +129 -122
- package/dist/agent-docs/components/AppStepper.md +81 -77
- package/dist/agent-docs/components/AspectRatio.md +70 -62
- package/dist/agent-docs/components/AudioVisualizer.md +5 -5
- package/dist/agent-docs/components/Avatar.md +112 -113
- package/dist/agent-docs/components/Badge.md +123 -118
- package/dist/agent-docs/components/Breadcrumb.md +8 -1
- package/dist/agent-docs/components/Button.md +131 -129
- package/dist/agent-docs/components/Card.md +172 -147
- package/dist/agent-docs/components/Carousel.md +148 -129
- package/dist/agent-docs/components/Chat.md +121 -109
- package/dist/agent-docs/components/ChatMessage.md +72 -61
- package/dist/agent-docs/components/Checkbox.md +150 -135
- package/dist/agent-docs/components/CircularProgress.md +53 -49
- package/dist/agent-docs/components/CodeHighlighter.md +4 -4
- package/dist/agent-docs/components/Collapsible.md +114 -95
- package/dist/agent-docs/components/Command.md +141 -142
- package/dist/agent-docs/components/Confirmer.md +182 -175
- package/dist/agent-docs/components/ContextMenu.md +196 -191
- package/dist/agent-docs/components/DataCrossTable.md +114 -94
- package/dist/agent-docs/components/DataTable.md +29 -24
- package/dist/agent-docs/components/Dialog.md +130 -125
- package/dist/agent-docs/components/Drawer.md +141 -127
- package/dist/agent-docs/components/FilePreviewer.md +138 -139
- package/dist/agent-docs/components/FileUploader.md +143 -129
- package/dist/agent-docs/components/Form.md +3 -1
- package/dist/agent-docs/components/FormComposer.md +163 -137
- package/dist/agent-docs/components/GanttChart.md +125 -122
- package/dist/agent-docs/components/HoverCard.md +1 -1
- package/dist/agent-docs/components/Icon.md +98 -99
- package/dist/agent-docs/components/Input.md +173 -138
- package/dist/agent-docs/components/InputOtp.md +6 -1
- package/dist/agent-docs/components/InputSelector.md +94 -97
- package/dist/agent-docs/components/InterruptPrompt.md +4 -4
- package/dist/agent-docs/components/MarkdownRenderer.md +5 -2
- package/dist/agent-docs/components/Menubar.md +60 -57
- package/dist/agent-docs/components/MessageInput.md +134 -131
- package/dist/agent-docs/components/MessageList.md +110 -96
- package/dist/agent-docs/components/MultipleSelector.md +147 -146
- package/dist/agent-docs/components/NavigationMenu.md +6 -2
- package/dist/agent-docs/components/Popover.md +112 -103
- package/dist/agent-docs/components/PromptSuggestions.md +5 -5
- package/dist/agent-docs/components/RadioGroup.md +97 -90
- package/dist/agent-docs/components/Resizable.md +4 -1
- package/dist/agent-docs/components/ResizePrompt.md +12 -13
- package/dist/agent-docs/components/ScrollArea.md +6 -2
- package/dist/agent-docs/components/SecurePdfViewer.md +10 -6
- package/dist/agent-docs/components/Select.md +131 -132
- package/dist/agent-docs/components/Sheet.md +8 -1
- package/dist/agent-docs/components/ShikiHighlighter.md +5 -5
- package/dist/agent-docs/components/Sidebar.md +94 -85
- package/dist/agent-docs/components/Slider.md +62 -58
- package/dist/agent-docs/components/Sonner.md +1 -0
- package/dist/agent-docs/components/Spinner.md +14 -14
- package/dist/agent-docs/components/Stepper.md +93 -67
- package/dist/agent-docs/components/Switch.md +41 -42
- package/dist/agent-docs/components/TableSkeleton.md +8 -8
- package/dist/agent-docs/components/Tabs.md +106 -86
- package/dist/agent-docs/components/TextArea.md +51 -52
- package/dist/agent-docs/components/ThemeSwitcher.md +72 -69
- package/dist/agent-docs/components/Toaster.md +1 -0
- package/dist/agent-docs/components/Tooltip.md +102 -91
- package/dist/agent-docs/components/Typo.md +68 -65
- package/dist/agent-docs/components/WeeklyCalendar.md +63 -64
- package/dist/agent-docs/manifest.json +5979 -0
- package/dist/components/editor/editor-hooks/use-update-toolbar.js +6 -6
- package/dist/components/editor/plugins/actions/counter-character-plugin.js +6 -6
- package/dist/components/editor/plugins/toolbar/font-format-toolbar-plugin.js +18 -18
- package/dist/components/editor/plugins/toolbar/history-toolbar-plugin.js +10 -10
- package/dist/components/editor/plugins/toolbar/toolbar-plugin.js +9 -9
- package/dist/components/ui/app-checkbox.js +1 -1
- package/dist/components/ui/app-dialog.js +70 -64
- package/dist/components/ui/app-editor.js +51 -51
- package/dist/components/ui/app-form.js +81 -81
- package/dist/components/ui/app-multiple-select-dropdown.js +36 -36
- package/dist/components/ui/app-select.js +109 -104
- package/dist/components/ui/app-sidebar.js +41 -41
- package/dist/components/ui/app-stepper.js +1 -1
- package/dist/components/ui/app-time-picker.js +18 -18
- package/dist/components/ui/app-tooltip.js +1 -1
- package/dist/components/ui/async-select.js +5 -5
- package/dist/components/ui/audio-visualizer.js +61 -58
- package/dist/components/ui/card.js +1 -1
- package/dist/components/ui/carousel.js +2 -2
- package/dist/components/ui/chart.js +1 -1
- package/dist/components/ui/chat-message.js +8 -8
- package/dist/components/ui/chat.js +86 -88
- package/dist/components/ui/command.js +2 -2
- package/dist/components/ui/copy-button.js +4 -4
- package/dist/components/ui/date-picker.js +20 -20
- package/dist/components/ui/file-preview/index.js +13 -13
- package/dist/components/ui/file-previewer.js +12 -11
- package/dist/components/ui/form.js +2 -2
- package/dist/components/ui/gantt/components/Chart/Bars/Bars.js +56 -56
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarItem/BarItem.js +12 -12
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsItems/BarItems.js +1 -1
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsRow.js +4 -4
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/RepeteadBars/RepeteadBars.js +2 -2
- package/dist/components/ui/gantt/components/Chart/Chart.js +23 -23
- package/dist/components/ui/gantt/components/Chart/Scale/Scale.js +1 -1
- package/dist/components/ui/gantt/components/Chart/Tree/Tree.js +34 -34
- package/dist/components/ui/gantt/components/Controls/Controls.js +5 -5
- package/dist/components/ui/gantt/components/Gantt/Gantt.js +4 -4
- package/dist/components/ui/gantt/hooks/useGanttCalculate.js +25 -18
- package/dist/components/ui/input-selector.js +1 -1
- package/dist/components/ui/input.js +23 -23
- package/dist/components/ui/kanban.js +8 -9
- package/dist/components/ui/markdown-renderer.js +41 -35
- package/dist/components/ui/message-input.js +45 -44
- package/dist/components/ui/multiple-selector.js +91 -82
- package/dist/components/ui/secure-pdf-viewer.js +19 -7
- package/dist/components/ui/sidebar.js +1 -1
- package/dist/components/ui/slider.js +1 -1
- package/dist/components/ui/spinner.js +4 -4
- package/dist/components/ui/stepper.js +157 -138
- package/dist/components/ui/tables/data-cross-table/data-cross-table-buttons.js +29 -29
- package/dist/components/ui/tables/data-cross-table/data-cross-table.js +258 -246
- package/dist/components/ui/tables/data-table/components/data-table-advanced-filter.js +4 -1
- package/dist/components/ui/tables/data-table/components/data-table-body.js +204 -368
- package/dist/components/ui/tables/data-table/components/data-table-filter-inputs.js +114 -112
- package/dist/components/ui/tables/data-table/components/data-table-filters.js +116 -96
- package/dist/components/ui/tables/data-table/components/data-table-header.js +210 -0
- package/dist/components/ui/tables/data-table/components/data-table-searchbar.js +8 -8
- package/dist/components/ui/tables/data-table/components/data-table-skeleton-rows.js +33 -0
- package/dist/components/ui/tables/data-table/data-table.js +256 -250
- package/dist/components/ui/tables/data-table/data-table.service.js +112 -97
- package/dist/components/ui/tables/data-table/data-table.utils.js +2 -0
- package/dist/components/ui/textarea.js +2 -2
- package/dist/components/ui/theme-switcher.js +1 -1
- package/dist/components/ui/toggle-group.js +2 -2
- package/dist/components/ui/weekly-calendar/appointment-card.js +16 -16
- package/dist/components/ui/weekly-calendar/calendar-context.js +6 -6
- package/dist/components/ui/weekly-calendar/calendar-header.js +12 -12
- package/dist/components/ui/weekly-calendar/day-column.js +16 -16
- package/dist/components/ui/weekly-calendar/time-column.js +4 -4
- package/dist/components/ui/weekly-calendar/weekly-calendar.js +4 -4
- package/dist/hooks/use-audio-recording.js +1 -1
- package/dist/hooks/use-auto-scroll.js +18 -18
- package/dist/hooks/use-autosize-textarea.js +12 -13
- package/dist/index.d.ts +67 -43
- package/dist/index.js +229 -229
- package/dist/lib/utils.js +6 -6
- package/dist/styles.v3.css +1 -1
- package/package.json +14 -4
|
@@ -1,143 +1,149 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as c, jsx as l } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import { useReactTable as Pe, flexRender as _ } from "../../../../node_modules/@tanstack/react-table/build/lib/index.js";
|
|
3
|
+
import { useReactTable as Pe, flexRender as q } from "../../../../node_modules/@tanstack/react-table/build/lib/index.js";
|
|
5
4
|
import { useVirtualizer as $e } from "../../../../node_modules/@tanstack/react-virtual/dist/esm/index.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { useState as u, useEffect as re, useCallback as V, useMemo as G, useRef as Ae } from "react";
|
|
6
|
+
import { cn as k } from "../../../../lib/utils.js";
|
|
7
|
+
import { TableSkeleton as Le } from "../../table-skeleton.js";
|
|
8
8
|
import { useDataCrossTable as He } from "./data-cross-table-context.js";
|
|
9
|
-
import {
|
|
10
|
-
import { Button as
|
|
11
|
-
import { Icon as
|
|
9
|
+
import { TruncatedText as b } from "./truncated-text.js";
|
|
10
|
+
import { Button as z } from "../../button.js";
|
|
11
|
+
import { Icon as J } from "../../icon.js";
|
|
12
12
|
import { Popover as Be, PopoverTrigger as Fe, PopoverContent as Oe } from "../../popover.js";
|
|
13
13
|
import { getSortedRowModel as We, getCoreRowModel as Ue } from "../../../../node_modules/@tanstack/table-core/build/lib/index.js";
|
|
14
|
-
import { Table as ie, TableHeader as ae, TableRow as
|
|
15
|
-
function
|
|
16
|
-
crossTableData:
|
|
17
|
-
filterable:
|
|
14
|
+
import { Table as ie, TableHeader as ae, TableRow as Q, TableHead as ce, TableBody as Xe, TableCell as Ye } from "../../table.js";
|
|
15
|
+
function at({
|
|
16
|
+
crossTableData: I,
|
|
17
|
+
filterable: y = !1,
|
|
18
18
|
loading: de = !1,
|
|
19
19
|
emptyComponent: ue,
|
|
20
|
-
className:
|
|
20
|
+
className: K,
|
|
21
21
|
notFoundMessage: fe = "Nessun risultato trovato.",
|
|
22
|
-
cornerHeaderFrom:
|
|
23
|
-
cornerHeaderTo:
|
|
24
|
-
minWidthCell:
|
|
22
|
+
cornerHeaderFrom: M = "Da",
|
|
23
|
+
cornerHeaderTo: P = "A",
|
|
24
|
+
minWidthCell: $ = 160,
|
|
25
25
|
editable: me = !1,
|
|
26
26
|
editMode: pe = !1,
|
|
27
|
-
onEditModeChange:
|
|
28
|
-
onSelectedRow:
|
|
29
|
-
selectedRow:
|
|
27
|
+
onEditModeChange: A,
|
|
28
|
+
onSelectedRow: L,
|
|
29
|
+
selectedRow: T,
|
|
30
30
|
rowSortAsc: he = !0
|
|
31
31
|
}) {
|
|
32
|
-
const [ge, xe] =
|
|
33
|
-
|
|
34
|
-
), [
|
|
32
|
+
const [ge, xe] = u([]), f = I.headerTop, d = I.headerLeft, p = I.data, [h, H] = u(
|
|
33
|
+
T?.id ?? null
|
|
34
|
+
), [B, F] = u(he), C = He(), [ve] = u(me && pe), [we, be] = u({}), [ye, Ce] = u({}), N = C?.editMode ?? ve, Z = C?.editedCells ?? we, g = C?.setEditedCells ?? be, O = C?.toDefaultCells ?? ye, x = C?.setToDefaultCells ?? Ce;
|
|
35
35
|
re(() => {
|
|
36
|
-
|
|
37
|
-
}, [
|
|
38
|
-
|
|
39
|
-
}, [
|
|
40
|
-
const [s, Ne] =
|
|
36
|
+
A && A(!!N);
|
|
37
|
+
}, [N, A]), re(() => {
|
|
38
|
+
T?.id && H(T.id);
|
|
39
|
+
}, [T]);
|
|
40
|
+
const [s, Ne] = u(null), [Se, v] = u(!1), [R, D] = u(null), Ve = V(
|
|
41
41
|
(t) => {
|
|
42
|
-
t && s &&
|
|
42
|
+
t && s && D(s.value), v(t);
|
|
43
43
|
},
|
|
44
44
|
[s]
|
|
45
|
-
), ke =
|
|
46
|
-
s &&
|
|
45
|
+
), ke = V(() => {
|
|
46
|
+
s && R !== null ? (g((t) => ({
|
|
47
47
|
...t,
|
|
48
48
|
[s.cellKey]: {
|
|
49
|
-
value:
|
|
49
|
+
value: R,
|
|
50
50
|
cell: s.cellData
|
|
51
51
|
}
|
|
52
|
-
})),
|
|
52
|
+
})), O[s.cellKey] && x((t) => {
|
|
53
53
|
const e = { ...t };
|
|
54
54
|
return delete e[s.cellKey], e;
|
|
55
55
|
}), setTimeout(() => {
|
|
56
|
-
|
|
57
|
-
}, 300)) :
|
|
58
|
-
}, [
|
|
59
|
-
s
|
|
56
|
+
v(!1);
|
|
57
|
+
}, 300)) : v(!1);
|
|
58
|
+
}, [
|
|
59
|
+
s,
|
|
60
|
+
R,
|
|
61
|
+
O,
|
|
62
|
+
g,
|
|
63
|
+
x
|
|
64
|
+
]), ze = V(() => {
|
|
65
|
+
s && (D(s.originalValue), g((t) => {
|
|
60
66
|
const e = { ...t };
|
|
61
67
|
return e[s.cellKey] && delete e[s.cellKey], e;
|
|
62
|
-
}),
|
|
68
|
+
}), x((t) => {
|
|
63
69
|
const e = { ...t };
|
|
64
70
|
return e[s.cellKey] && delete e[s.cellKey], e;
|
|
65
|
-
})),
|
|
66
|
-
}, [s]), Te =
|
|
67
|
-
s && (
|
|
71
|
+
})), v(!1);
|
|
72
|
+
}, [s, g, x]), Te = V(() => {
|
|
73
|
+
s && (g((t) => {
|
|
68
74
|
const e = { ...t };
|
|
69
75
|
return e[s.cellKey] && delete e[s.cellKey], e;
|
|
70
|
-
}),
|
|
76
|
+
}), x((t) => ({
|
|
71
77
|
...t,
|
|
72
78
|
[s.cellKey]: {
|
|
73
79
|
value: s.originalValue,
|
|
74
80
|
cell: s.cellData
|
|
75
81
|
}
|
|
76
|
-
}))),
|
|
77
|
-
}, [s]), Re =
|
|
82
|
+
}))), v(!1);
|
|
83
|
+
}, [s, g, x]), Re = V(
|
|
78
84
|
(t) => {
|
|
79
|
-
|
|
85
|
+
D(t.target.value);
|
|
80
86
|
},
|
|
81
87
|
[]
|
|
82
|
-
), De = (t) => t && typeof t == "object" && "value" in t ? t.value : t,
|
|
83
|
-
if (!
|
|
84
|
-
const e =
|
|
85
|
-
(
|
|
88
|
+
), De = (t) => t && typeof t == "object" && "value" in t ? t.value : t, w = G(() => {
|
|
89
|
+
if (!h || !d.find((n) => n.id === h)) return f;
|
|
90
|
+
const e = d.findIndex(
|
|
91
|
+
(n) => n.id === h
|
|
86
92
|
);
|
|
87
93
|
if (e === -1) return f;
|
|
88
|
-
const
|
|
94
|
+
const o = f.map((n, i) => {
|
|
89
95
|
const r = p[e]?.[i] ?? null, a = De(r);
|
|
90
|
-
return { header:
|
|
96
|
+
return { header: n, value: a };
|
|
91
97
|
});
|
|
92
|
-
return
|
|
93
|
-
if (typeof
|
|
94
|
-
return
|
|
95
|
-
const r = String(
|
|
96
|
-
return
|
|
97
|
-
}),
|
|
98
|
-
}, [f,
|
|
98
|
+
return o.sort((n, i) => {
|
|
99
|
+
if (typeof n.value == "number" && typeof i.value == "number")
|
|
100
|
+
return B ? n.value - i.value : i.value - n.value;
|
|
101
|
+
const r = String(n.value ?? ""), a = String(i.value ?? "");
|
|
102
|
+
return B ? r.localeCompare(a) : a.localeCompare(r);
|
|
103
|
+
}), o.map((n) => n.header);
|
|
104
|
+
}, [f, d, p, h, B]), je = G(() => {
|
|
99
105
|
const t = [
|
|
100
106
|
{
|
|
101
107
|
id: "cross-header",
|
|
102
108
|
header: () => /* @__PURE__ */ c("div", { className: "relative", children: [
|
|
103
|
-
/* @__PURE__ */ l("div", { className: "absolute top-0 left-2 text-xs", children:
|
|
104
|
-
/* @__PURE__ */ l("div", { className: "absolute right-2 bottom-0 text-xs", children:
|
|
109
|
+
/* @__PURE__ */ l("div", { className: "absolute top-0 left-2 text-xs", children: M }),
|
|
110
|
+
/* @__PURE__ */ l("div", { className: "absolute right-2 bottom-0 text-xs", children: P })
|
|
105
111
|
] }),
|
|
106
112
|
accessorFn: (e) => e.item,
|
|
107
113
|
cell: (e) => {
|
|
108
|
-
const
|
|
109
|
-
if (!
|
|
110
|
-
return /* @__PURE__ */ l(
|
|
111
|
-
const
|
|
114
|
+
const o = e.getValue();
|
|
115
|
+
if (!y)
|
|
116
|
+
return /* @__PURE__ */ l(b, { text: o.label, className: "w-full" });
|
|
117
|
+
const n = h === o.id;
|
|
112
118
|
return /* @__PURE__ */ l(
|
|
113
|
-
|
|
119
|
+
z,
|
|
114
120
|
{
|
|
115
121
|
variant: "ghost",
|
|
116
122
|
size: "sm",
|
|
117
123
|
iconLeft: "ArrowLeftRight",
|
|
118
124
|
className: "text-right",
|
|
119
125
|
onClick: () => {
|
|
120
|
-
|
|
126
|
+
y && (n ? F((i) => !i) : (H(d[e.row.index].id), F(!0), L && L(d[e.row.index])));
|
|
121
127
|
},
|
|
122
|
-
children: /* @__PURE__ */ l(
|
|
128
|
+
children: /* @__PURE__ */ l(b, { text: o.label })
|
|
123
129
|
}
|
|
124
130
|
);
|
|
125
131
|
}
|
|
126
132
|
}
|
|
127
133
|
];
|
|
128
|
-
return
|
|
134
|
+
return w.forEach((e) => {
|
|
129
135
|
t.push({
|
|
130
136
|
id: e.id,
|
|
131
|
-
accessorFn: (
|
|
132
|
-
header: ({ column:
|
|
133
|
-
|
|
137
|
+
accessorFn: (o) => o[e.id],
|
|
138
|
+
header: ({ column: o }) => y ? /* @__PURE__ */ l(
|
|
139
|
+
z,
|
|
134
140
|
{
|
|
135
141
|
variant: "ghost",
|
|
136
142
|
size: "sm",
|
|
137
143
|
iconLeft: "ArrowUpDown",
|
|
138
|
-
onClick:
|
|
144
|
+
onClick: y ? () => o.toggleSorting(o.getIsSorted() === "asc") : void 0,
|
|
139
145
|
children: /* @__PURE__ */ l(
|
|
140
|
-
|
|
146
|
+
b,
|
|
141
147
|
{
|
|
142
148
|
text: e.label,
|
|
143
149
|
className: "w-full max-w-full min-w-0"
|
|
@@ -145,77 +151,79 @@ function ct({
|
|
|
145
151
|
)
|
|
146
152
|
}
|
|
147
153
|
) : /* @__PURE__ */ l(
|
|
148
|
-
|
|
154
|
+
b,
|
|
149
155
|
{
|
|
150
156
|
text: e.label,
|
|
151
157
|
className: "w-full max-w-full min-w-0 text-center font-medium"
|
|
152
158
|
}
|
|
153
159
|
),
|
|
154
|
-
sortingFn: (
|
|
155
|
-
let r =
|
|
160
|
+
sortingFn: (o, n, i) => {
|
|
161
|
+
let r = o.getValue(i), a = n.getValue(i);
|
|
156
162
|
return r == null && a == null ? 0 : r == null ? 1 : a == null ? -1 : (r && typeof r == "object" && "value" in r && (r = r.value), a && typeof a == "object" && "value" in a && (a = a.value), typeof r == "number" && typeof a == "number" ? r - a : String(r).localeCompare(String(a)));
|
|
157
163
|
},
|
|
158
|
-
cell: (
|
|
159
|
-
const
|
|
160
|
-
return
|
|
164
|
+
cell: (o) => {
|
|
165
|
+
const n = o.getValue();
|
|
166
|
+
return n ? n.render ? n.render(n.fromId, n.toId, n.id) : /* @__PURE__ */ l("div", { className: "flex h-full w-full min-w-0 items-center justify-center", children: /* @__PURE__ */ l(b, { text: String(n?.value ?? "") }) }) : null;
|
|
161
167
|
}
|
|
162
168
|
});
|
|
163
169
|
}), t;
|
|
164
170
|
}, [
|
|
165
|
-
|
|
166
|
-
I,
|
|
167
|
-
K,
|
|
171
|
+
d,
|
|
168
172
|
w,
|
|
169
|
-
|
|
173
|
+
M,
|
|
170
174
|
P,
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
175
|
+
L,
|
|
176
|
+
h,
|
|
177
|
+
y,
|
|
178
|
+
H,
|
|
179
|
+
F
|
|
180
|
+
]), Ee = G(() => d.map((t, e) => {
|
|
181
|
+
const o = { item: t };
|
|
182
|
+
return w.forEach((n) => {
|
|
183
|
+
const i = f.findIndex((r) => r.id === n.id);
|
|
184
|
+
o[n.id] = i !== -1 ? p[e]?.[i] ?? null : null;
|
|
185
|
+
}), o;
|
|
186
|
+
}), [d, w, p, f]), j = Pe({
|
|
187
|
+
data: Ee,
|
|
188
|
+
columns: je,
|
|
181
189
|
state: { sorting: ge },
|
|
182
190
|
onSortingChange: xe,
|
|
183
191
|
getCoreRowModel: Ue(),
|
|
184
192
|
getSortedRowModel: We()
|
|
185
|
-
}),
|
|
186
|
-
count:
|
|
187
|
-
getScrollElement: () =>
|
|
193
|
+
}), _ = Ae(null), ee = $e({
|
|
194
|
+
count: j.getRowModel().rows.length,
|
|
195
|
+
getScrollElement: () => _.current,
|
|
188
196
|
estimateSize: () => 40,
|
|
189
197
|
overscan: 5,
|
|
190
198
|
measureElement: typeof window < "u" ? (t) => t.getBoundingClientRect().height : void 0
|
|
191
199
|
});
|
|
192
200
|
if (de)
|
|
193
201
|
return /* @__PURE__ */ l(
|
|
194
|
-
|
|
202
|
+
Le,
|
|
195
203
|
{
|
|
196
|
-
headerRow:
|
|
197
|
-
rowCount:
|
|
198
|
-
columnCount:
|
|
199
|
-
className:
|
|
200
|
-
cornerHeaderFrom:
|
|
201
|
-
cornerHeaderTo:
|
|
204
|
+
headerRow: w.map((t) => t.label),
|
|
205
|
+
rowCount: d.length || 5,
|
|
206
|
+
columnCount: w.length || 5,
|
|
207
|
+
className: K,
|
|
208
|
+
cornerHeaderFrom: M,
|
|
209
|
+
cornerHeaderTo: P
|
|
202
210
|
}
|
|
203
211
|
);
|
|
204
212
|
const te = (t) => {
|
|
205
|
-
const e = t.column.id === "cross-header",
|
|
206
|
-
e ||
|
|
213
|
+
const e = t.column.id === "cross-header", o = e, n = ["bg-d-secondary"];
|
|
214
|
+
e || n.push("border-r"), e && n.push("sticky left-0"), n.push("sticky top-0 z-20"), o ? n.push("z-40") : e && n.push("z-30");
|
|
207
215
|
let i = "none";
|
|
208
216
|
return e && (i = "inset -1px 0 0 0 var(--d-border), 0 1px 0 0 var(--d-border)"), {
|
|
209
|
-
className:
|
|
210
|
-
style: { boxShadow: i, width: `${
|
|
217
|
+
className: n.join(" "),
|
|
218
|
+
style: { boxShadow: i, width: `${$}px` }
|
|
211
219
|
};
|
|
212
220
|
};
|
|
213
221
|
return !p || p.length === 0 ? /* @__PURE__ */ c(
|
|
214
222
|
"div",
|
|
215
223
|
{
|
|
216
|
-
className:
|
|
224
|
+
className: k(
|
|
217
225
|
"flex h-full w-full flex-col overflow-auto",
|
|
218
|
-
|
|
226
|
+
K ?? ""
|
|
219
227
|
),
|
|
220
228
|
children: [
|
|
221
229
|
/* @__PURE__ */ l(ie, { className: "relative w-full table-fixed border-collapse", children: /* @__PURE__ */ l(
|
|
@@ -223,18 +231,18 @@ function ct({
|
|
|
223
231
|
{
|
|
224
232
|
className: "bg-d-secondary sticky top-0 z-20 w-full",
|
|
225
233
|
style: { boxShadow: "0 1px 0 0 var(--d-border)" },
|
|
226
|
-
children: (
|
|
227
|
-
|
|
234
|
+
children: (j.getHeaderGroups() ?? []).map((t) => /* @__PURE__ */ l(
|
|
235
|
+
Q,
|
|
228
236
|
{
|
|
229
237
|
className: "bg-d-secondary sticky top-0 z-20",
|
|
230
238
|
children: t.headers.map((e) => {
|
|
231
|
-
const
|
|
239
|
+
const o = te(e);
|
|
232
240
|
return /* @__PURE__ */ l(
|
|
233
241
|
ce,
|
|
234
242
|
{
|
|
235
|
-
className:
|
|
236
|
-
style:
|
|
237
|
-
children: e.isPlaceholder ? null :
|
|
243
|
+
className: o.className,
|
|
244
|
+
style: o.style,
|
|
245
|
+
children: e.isPlaceholder ? null : q(
|
|
238
246
|
e.column.columnDef.header,
|
|
239
247
|
e.getContext()
|
|
240
248
|
)
|
|
@@ -250,11 +258,11 @@ function ct({
|
|
|
250
258
|
/* @__PURE__ */ l("div", { className: "sticky top-0 left-0 flex flex-1", children: ue || fe })
|
|
251
259
|
]
|
|
252
260
|
}
|
|
253
|
-
) : /* @__PURE__ */ c("div", { className: `${
|
|
261
|
+
) : /* @__PURE__ */ c("div", { className: `${k("w-[900px]", K || "")}`, children: [
|
|
254
262
|
/* @__PURE__ */ l(
|
|
255
263
|
"div",
|
|
256
264
|
{
|
|
257
|
-
ref:
|
|
265
|
+
ref: _,
|
|
258
266
|
className: "border-d-border h-fit max-h-full min-h-0 overflow-auto rounded-md border",
|
|
259
267
|
children: /* @__PURE__ */ c(ie, { className: "relative w-full table-fixed border-collapse", children: [
|
|
260
268
|
/* @__PURE__ */ l(
|
|
@@ -262,18 +270,18 @@ function ct({
|
|
|
262
270
|
{
|
|
263
271
|
className: "bg-d-secondary sticky top-0 z-20 w-full",
|
|
264
272
|
style: { boxShadow: "0 1px 0 0 var(--d-border)" },
|
|
265
|
-
children:
|
|
266
|
-
|
|
273
|
+
children: j.getHeaderGroups().map((t) => /* @__PURE__ */ l(
|
|
274
|
+
Q,
|
|
267
275
|
{
|
|
268
276
|
className: "bg-d-secondary sticky top-0 z-20",
|
|
269
277
|
children: t.headers.map((e) => {
|
|
270
|
-
const
|
|
278
|
+
const o = te(e);
|
|
271
279
|
return /* @__PURE__ */ l(
|
|
272
280
|
ce,
|
|
273
281
|
{
|
|
274
|
-
className:
|
|
275
|
-
style:
|
|
276
|
-
children: e.isPlaceholder ? null :
|
|
282
|
+
className: o.className,
|
|
283
|
+
style: o.style,
|
|
284
|
+
children: e.isPlaceholder ? null : q(
|
|
277
285
|
e.column.columnDef.header,
|
|
278
286
|
e.getContext()
|
|
279
287
|
)
|
|
@@ -294,125 +302,129 @@ function ct({
|
|
|
294
302
|
position: "relative",
|
|
295
303
|
width: "100%"
|
|
296
304
|
},
|
|
297
|
-
children: ee.getVirtualItems().map(
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
305
|
+
children: ee.getVirtualItems().map(
|
|
306
|
+
(t) => {
|
|
307
|
+
const e = j.getRowModel().rows[t.index];
|
|
308
|
+
return /* @__PURE__ */ l(
|
|
309
|
+
Q,
|
|
310
|
+
{
|
|
311
|
+
"data-index": t.index,
|
|
312
|
+
style: {
|
|
313
|
+
position: "absolute",
|
|
314
|
+
top: 0,
|
|
315
|
+
left: 0,
|
|
316
|
+
transform: `translateY(${t.start}px)`,
|
|
317
|
+
width: "100%",
|
|
318
|
+
height: `${t.size}px`,
|
|
319
|
+
display: "flex"
|
|
320
|
+
},
|
|
321
|
+
children: e.getVisibleCells().map((o, n) => {
|
|
322
|
+
const i = n === 0, r = o.getValue(), a = i ? "var(--d-secondary)" : r?.bgColor || "transparent", S = r.editable ?? !0;
|
|
323
|
+
return /* @__PURE__ */ l(
|
|
324
|
+
Ye,
|
|
325
|
+
{
|
|
326
|
+
onClick: (m) => {
|
|
327
|
+
!S || !N || (m.stopPropagation(), m.preventDefault());
|
|
328
|
+
},
|
|
329
|
+
className: k(
|
|
330
|
+
"border-d-border text-center",
|
|
331
|
+
i ? "sticky left-0 z-10" : "border-r",
|
|
332
|
+
S && N && "cursor-pointer"
|
|
333
|
+
),
|
|
334
|
+
style: {
|
|
335
|
+
boxShadow: i ? "inset -1px 0 0 0 var(--d-border)" : "none",
|
|
336
|
+
backgroundColor: a,
|
|
337
|
+
color: r?.textColor || "inherit",
|
|
338
|
+
minWidth: `${$}px`,
|
|
339
|
+
flex: `1 0 ${$}px`,
|
|
340
|
+
display: "flex",
|
|
341
|
+
alignItems: "center",
|
|
342
|
+
justifyContent: "center"
|
|
343
|
+
},
|
|
344
|
+
children: i || !N || !r ? (
|
|
345
|
+
// Rendering normale per la prima colonna o quando non siamo in modalità edit
|
|
346
|
+
q(
|
|
347
|
+
o.column.columnDef.cell,
|
|
348
|
+
o.getContext()
|
|
349
|
+
)
|
|
350
|
+
) : (
|
|
351
|
+
// Rendering con cella modificabile
|
|
352
|
+
(() => {
|
|
353
|
+
const m = `${e.index}-${o.column.id}`, E = m in Z ? Z[m].value : r.value || "", Ie = E !== r.value, le = m in O;
|
|
354
|
+
return /* @__PURE__ */ l(
|
|
355
|
+
"div",
|
|
356
|
+
{
|
|
357
|
+
className: "flex w-full cursor-pointer items-center justify-center",
|
|
358
|
+
onClick: (Ke) => {
|
|
359
|
+
const W = Ke.currentTarget.getBoundingClientRect(), ne = 400, oe = 164, U = 8;
|
|
360
|
+
let X = W.left + window.scrollX, Y = W.bottom + 5;
|
|
361
|
+
const se = window.innerWidth, Me = window.innerHeight;
|
|
362
|
+
X + ne > se - U && (X = se - ne - U), Y + oe > Me - U && (Y = W.bottom - oe - 5), Ne({
|
|
363
|
+
cellKey: m,
|
|
364
|
+
value: E,
|
|
365
|
+
originalValue: r.value || "",
|
|
366
|
+
cellData: r,
|
|
367
|
+
position: { top: Y, left: X }
|
|
368
|
+
}), D(
|
|
369
|
+
E
|
|
370
|
+
), v(!0);
|
|
371
|
+
},
|
|
372
|
+
children: /* @__PURE__ */ c("div", { className: "relative flex h-full max-h-full w-full max-w-full items-center justify-center gap-1", children: [
|
|
373
|
+
Ie && !le && /* @__PURE__ */ l(
|
|
374
|
+
"div",
|
|
375
|
+
{
|
|
376
|
+
className: "bg-d-primary absolute -top-1.5 -left-1.5 rounded p-1",
|
|
377
|
+
title: "Valore modificato"
|
|
378
|
+
}
|
|
379
|
+
),
|
|
380
|
+
le && /* @__PURE__ */ l(
|
|
381
|
+
"div",
|
|
382
|
+
{
|
|
383
|
+
className: "bg-d-destructive absolute -top-1.5 -left-1.5 rounded p-1",
|
|
384
|
+
title: "Ripristino richiesto"
|
|
385
|
+
}
|
|
386
|
+
),
|
|
387
|
+
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1", children: /* @__PURE__ */ l(
|
|
388
|
+
"div",
|
|
389
|
+
{
|
|
390
|
+
className: k(
|
|
391
|
+
"h-full min-h-full w-full min-w-full truncate text-center",
|
|
392
|
+
S ? "text-d-muted-foreground" : "text-d-muted"
|
|
393
|
+
),
|
|
394
|
+
children: /* @__PURE__ */ l(
|
|
395
|
+
b,
|
|
396
|
+
{
|
|
397
|
+
text: String(E),
|
|
398
|
+
className: "w-full"
|
|
399
|
+
}
|
|
400
|
+
)
|
|
401
|
+
}
|
|
402
|
+
) }),
|
|
403
|
+
/* @__PURE__ */ l(
|
|
404
|
+
J,
|
|
405
|
+
{
|
|
406
|
+
name: S ? "Pencil" : "PencilOff",
|
|
407
|
+
size: "sm",
|
|
408
|
+
className: k(
|
|
409
|
+
"h-3 w-3",
|
|
410
|
+
S ? "text-d-muted-foreground" : "text-d-muted"
|
|
411
|
+
)
|
|
412
|
+
}
|
|
413
|
+
)
|
|
414
|
+
] })
|
|
415
|
+
}
|
|
416
|
+
);
|
|
417
|
+
})()
|
|
340
418
|
)
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
const O = Ke.currentTarget.getBoundingClientRect(), oe = 400, ne = 164, W = 8;
|
|
351
|
-
let U = O.left + window.scrollX, X = O.bottom + 5;
|
|
352
|
-
const se = window.innerWidth, Me = window.innerHeight;
|
|
353
|
-
U + oe > se - W && (U = se - oe - W), X + ne > Me - W && (X = O.bottom - ne - 5), Ne({
|
|
354
|
-
cellKey: m,
|
|
355
|
-
value: D,
|
|
356
|
-
originalValue: r.value || "",
|
|
357
|
-
cellData: r,
|
|
358
|
-
position: { top: X, left: U }
|
|
359
|
-
}), T(D), h(!0);
|
|
360
|
-
},
|
|
361
|
-
children: /* @__PURE__ */ c("div", { className: "relative flex h-full max-h-full w-full max-w-full items-center justify-center gap-1", children: [
|
|
362
|
-
Ie && !le && /* @__PURE__ */ l(
|
|
363
|
-
"div",
|
|
364
|
-
{
|
|
365
|
-
className: "bg-d-primary absolute -top-1.5 -left-1.5 rounded p-1",
|
|
366
|
-
title: "Valore modificato"
|
|
367
|
-
}
|
|
368
|
-
),
|
|
369
|
-
le && /* @__PURE__ */ l(
|
|
370
|
-
"div",
|
|
371
|
-
{
|
|
372
|
-
className: "bg-d-destructive absolute -top-1.5 -left-1.5 rounded p-1",
|
|
373
|
-
title: "Ripristino richiesto"
|
|
374
|
-
}
|
|
375
|
-
),
|
|
376
|
-
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1", children: /* @__PURE__ */ l(
|
|
377
|
-
"div",
|
|
378
|
-
{
|
|
379
|
-
className: V(
|
|
380
|
-
"h-full min-h-full w-full min-w-full truncate text-center",
|
|
381
|
-
N ? "text-d-muted-foreground" : "text-d-muted"
|
|
382
|
-
),
|
|
383
|
-
children: /* @__PURE__ */ l(
|
|
384
|
-
x,
|
|
385
|
-
{
|
|
386
|
-
text: D,
|
|
387
|
-
className: "w-full"
|
|
388
|
-
}
|
|
389
|
-
)
|
|
390
|
-
}
|
|
391
|
-
) }),
|
|
392
|
-
/* @__PURE__ */ l(
|
|
393
|
-
q,
|
|
394
|
-
{
|
|
395
|
-
name: N ? "Pencil" : "PencilOff",
|
|
396
|
-
size: "sm",
|
|
397
|
-
className: V(
|
|
398
|
-
"h-3 w-3",
|
|
399
|
-
N ? "text-d-muted-foreground" : "text-d-muted"
|
|
400
|
-
)
|
|
401
|
-
}
|
|
402
|
-
)
|
|
403
|
-
] })
|
|
404
|
-
}
|
|
405
|
-
);
|
|
406
|
-
})()
|
|
407
|
-
)
|
|
408
|
-
},
|
|
409
|
-
n.id
|
|
410
|
-
);
|
|
411
|
-
})
|
|
412
|
-
},
|
|
413
|
-
e.id
|
|
414
|
-
);
|
|
415
|
-
})
|
|
419
|
+
},
|
|
420
|
+
o.id
|
|
421
|
+
);
|
|
422
|
+
})
|
|
423
|
+
},
|
|
424
|
+
e.id
|
|
425
|
+
);
|
|
426
|
+
}
|
|
427
|
+
)
|
|
416
428
|
}
|
|
417
429
|
)
|
|
418
430
|
] })
|
|
@@ -441,14 +453,14 @@ function ct({
|
|
|
441
453
|
{
|
|
442
454
|
type: "text",
|
|
443
455
|
className: "bg-d-secondary w-full rounded border p-2",
|
|
444
|
-
value:
|
|
456
|
+
value: R || "",
|
|
445
457
|
onChange: Re,
|
|
446
458
|
autoFocus: !0
|
|
447
459
|
}
|
|
448
460
|
),
|
|
449
461
|
/* @__PURE__ */ c("div", { className: "flex items-center justify-between", children: [
|
|
450
462
|
/* @__PURE__ */ c(
|
|
451
|
-
|
|
463
|
+
z,
|
|
452
464
|
{
|
|
453
465
|
variant: "destructive",
|
|
454
466
|
size: "sm",
|
|
@@ -456,14 +468,14 @@ function ct({
|
|
|
456
468
|
className: "text-xs",
|
|
457
469
|
title: "Ripristina il valore originale e segna la cella come da ripristinare",
|
|
458
470
|
children: [
|
|
459
|
-
/* @__PURE__ */ l(
|
|
471
|
+
/* @__PURE__ */ l(J, { name: "RotateCcw", className: "mr-1 h-3 w-3" }),
|
|
460
472
|
"Ripristina"
|
|
461
473
|
]
|
|
462
474
|
}
|
|
463
475
|
),
|
|
464
476
|
/* @__PURE__ */ c("div", { className: "flex space-x-2", children: [
|
|
465
477
|
/* @__PURE__ */ l(
|
|
466
|
-
|
|
478
|
+
z,
|
|
467
479
|
{
|
|
468
480
|
variant: "ghost",
|
|
469
481
|
size: "sm",
|
|
@@ -474,14 +486,14 @@ function ct({
|
|
|
474
486
|
}
|
|
475
487
|
),
|
|
476
488
|
/* @__PURE__ */ c(
|
|
477
|
-
|
|
489
|
+
z,
|
|
478
490
|
{
|
|
479
491
|
size: "sm",
|
|
480
492
|
onClick: ke,
|
|
481
493
|
className: "text-xs",
|
|
482
494
|
title: "Conferma le modifiche e salva",
|
|
483
495
|
children: [
|
|
484
|
-
/* @__PURE__ */ l(
|
|
496
|
+
/* @__PURE__ */ l(J, { name: "Check", className: "mr-1 h-3 w-3" }),
|
|
485
497
|
"Conferma"
|
|
486
498
|
]
|
|
487
499
|
}
|
|
@@ -495,5 +507,5 @@ function ct({
|
|
|
495
507
|
] });
|
|
496
508
|
}
|
|
497
509
|
export {
|
|
498
|
-
|
|
510
|
+
at as DataCrossTable
|
|
499
511
|
};
|