laif-ds 0.1.41 → 0.1.43

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,137 +1,141 @@
1
1
  "use client";
2
- import { jsxs as c, jsx as o } from "react/jsx-runtime";
3
- import { useState as u, useEffect as ee, useCallback as I, useMemo as Y, useRef as ke } from "react";
4
- import { useReactTable as Ve, flexRender as te } from "../../../../node_modules/@tanstack/react-table/build/lib/index.js";
5
- import { useVirtualizer as je } from "../../../../node_modules/@tanstack/react-virtual/dist/esm/index.js";
6
- import { TableSkeleton as ze } from "../../table-skeleton.js";
7
- import { TruncatedText as R } from "./truncated-text.js";
8
- import { EditControls as Te } from "./edit-controls.js";
9
- import { Icon as U } from "../../icon.js";
10
- import { Popover as De, PopoverTrigger as Re, PopoverContent as $e } from "../../popover.js";
11
- import { Button as k } from "../../button.js";
12
- import { TableRow as X, TableCell as le, Table as Ae, TableHeader as Ke, TableHead as Me, TableBody as Ee } from "../../table.js";
13
- import { getSortedRowModel as Oe, getCoreRowModel as Le } from "../../../../node_modules/@tanstack/table-core/build/lib/index.js";
14
- function We({
15
- crossTableData: $,
16
- filterable: b = !1,
17
- loading: ne = !1,
18
- emptyComponent: oe,
19
- className: A,
20
- notFoundMessage: re = "Nessun risultato trovato.",
21
- cornerHeaderFrom: K = "Da",
22
- cornerHeaderTo: M = "A",
23
- maxHeaderLength: C = 15,
24
- minWidthCell: E = 160,
25
- editable: O = !1,
2
+ import { jsxs as d, jsx as o } from "react/jsx-runtime";
3
+ import { useState as f, useEffect as W, useCallback as w, useMemo as O, useRef as De } from "react";
4
+ import { useReactTable as Ee, flexRender as ee } from "../../../../node_modules/@tanstack/react-table/build/lib/index.js";
5
+ import { useVirtualizer as $e } from "../../../../node_modules/@tanstack/react-virtual/dist/esm/index.js";
6
+ import { TableSkeleton as je } from "../../table-skeleton.js";
7
+ import { TruncatedText as k } from "./truncated-text.js";
8
+ import { useDataCrossTable as Ie } from "./data-cross-table-context.js";
9
+ import { Button as N } from "../../button.js";
10
+ import { Icon as Y } from "../../icon.js";
11
+ import { Popover as Ke, PopoverTrigger as Me, PopoverContent as Ve } from "../../popover.js";
12
+ import { TableRow as U, TableCell as te, Table as Re, TableHeader as Le, TableHead as Ae, TableBody as Pe } from "../../table.js";
13
+ import { getSortedRowModel as Be, getCoreRowModel as Fe } from "../../../../node_modules/@tanstack/table-core/build/lib/index.js";
14
+ function lt({
15
+ crossTableData: D,
16
+ filterable: y = !1,
17
+ loading: le = !1,
18
+ emptyComponent: ne,
19
+ className: E,
20
+ notFoundMessage: oe = "Nessun risultato trovato.",
21
+ cornerHeaderFrom: $ = "Da",
22
+ cornerHeaderTo: j = "A",
23
+ maxHeaderLength: b = 15,
24
+ minWidthCell: I = 160,
25
+ editable: re = !1,
26
26
  editMode: se = !1,
27
- editConfirmLabel: ie = "Conferma",
28
- editCancelLabel: ae = "Annulla",
29
- onConfirmedCells: V,
30
- onEditModeChange: L,
31
- onSelectedRow: q,
32
- selectedRow: d,
33
- rowSortAsc: ce = !0
27
+ onEditModeChange: K,
28
+ onSelectedRow: X,
29
+ selectedRow: u,
30
+ rowSortAsc: ie = !0
34
31
  }) {
35
- var Q, Z;
36
- const [de, ue] = u([]), m = $.headerTop, f = $.headerLeft, v = $.data, [w, P] = u(
37
- (d == null ? void 0 : d.id) ?? null
38
- ), [B, F] = u(ce), [j, fe] = u(O && se);
39
- ee(() => {
40
- L && L(!!j);
41
- }, [j, L]), ee(() => {
42
- d != null && d.id && P(d.id);
43
- }, [d]);
44
- const [N, S] = u({}), [p, x] = u({}), [l, me] = u(null), [pe, y] = u(!1), [z, T] = u(null), he = I(
32
+ var J, Q;
33
+ const [ae, ce] = f([]), p = D.headerTop, m = D.headerLeft, g = D.data, [C, M] = f(
34
+ (u == null ? void 0 : u.id) ?? null
35
+ ), [V, R] = f(ie);
36
+ let c = null;
37
+ try {
38
+ c = Ie();
39
+ } catch {
40
+ c = null;
41
+ }
42
+ const [de, Oe] = f(re && se), [ue, fe] = f({}), [me, pe] = f({}), L = (c == null ? void 0 : c.editMode) ?? de, _ = (c == null ? void 0 : c.editedCells) ?? ue, A = (c == null ? void 0 : c.setEditedCells) ?? fe, P = (c == null ? void 0 : c.toDefaultCells) ?? me, B = (c == null ? void 0 : c.setToDefaultCells) ?? pe;
43
+ W(() => {
44
+ K && K(!!L);
45
+ }, [L, K]), W(() => {
46
+ u != null && u.id && M(u.id);
47
+ }, [u]);
48
+ const [l, he] = f(null), [ve, x] = f(!1), [S, T] = f(null), ge = w(
45
49
  (t) => {
46
- t && l && T(l.value), y(t);
50
+ t && l && T(l.value), x(t);
47
51
  },
48
52
  [l]
49
- ), ge = I(() => {
50
- l && z !== null ? (S((t) => ({
53
+ ), xe = w(() => {
54
+ l && S !== null ? (A((t) => ({
51
55
  ...t,
52
56
  [l.cellKey]: {
53
- value: z,
57
+ value: S,
54
58
  cell: l.cellData
55
59
  }
56
- })), p[l.cellKey] && x((t) => {
60
+ })), P[l.cellKey] && B((t) => {
57
61
  const e = { ...t };
58
62
  return delete e[l.cellKey], e;
59
63
  }), setTimeout(() => {
60
- y(!1);
61
- }, 300)) : y(!1);
62
- }, [l, z, p]), ve = I(() => {
63
- l && (T(l.originalValue), S((t) => {
64
+ x(!1);
65
+ }, 300)) : x(!1);
66
+ }, [l, S, P]), ye = w(() => {
67
+ l && (T(l.originalValue), A((t) => {
64
68
  const e = { ...t };
65
69
  return e[l.cellKey] && delete e[l.cellKey], e;
66
- }), x((t) => {
70
+ }), B((t) => {
67
71
  const e = { ...t };
68
72
  return e[l.cellKey] && delete e[l.cellKey], e;
69
- })), y(!1);
70
- }, [l]), xe = I(() => {
71
- l && (S((t) => {
73
+ })), x(!1);
74
+ }, [l]), be = w(() => {
75
+ l && (A((t) => {
72
76
  const e = { ...t };
73
77
  return e[l.cellKey] && delete e[l.cellKey], e;
74
- }), x((t) => ({
78
+ }), B((t) => ({
75
79
  ...t,
76
80
  [l.cellKey]: {
77
81
  value: l.originalValue,
78
82
  cell: l.cellData
79
83
  }
80
- }))), y(!1);
81
- }, [l]), ye = I(
84
+ }))), x(!1);
85
+ }, [l]), Ce = w(
82
86
  (t) => {
83
87
  T(t.target.value);
84
88
  },
85
89
  []
86
- ), be = (t) => t && typeof t == "object" && "value" in t ? t.value : t, h = Y(() => {
87
- if (!w || !f.find((n) => n.id === w)) return m;
88
- const e = f.findIndex(
89
- (n) => n.id === w
90
+ ), we = (t) => t && typeof t == "object" && "value" in t ? t.value : t, h = O(() => {
91
+ if (!C || !m.find((n) => n.id === C)) return p;
92
+ const e = m.findIndex(
93
+ (n) => n.id === C
90
94
  );
91
- if (e === -1) return m;
92
- const r = m.map((n, i) => {
93
- var g;
94
- const s = ((g = v[e]) == null ? void 0 : g[i]) ?? null, a = be(s);
95
+ if (e === -1) return p;
96
+ const r = p.map((n, i) => {
97
+ var v;
98
+ const s = ((v = g[e]) == null ? void 0 : v[i]) ?? null, a = we(s);
95
99
  return { header: n, value: a };
96
100
  });
97
101
  return r.sort((n, i) => {
98
102
  if (typeof n.value == "number" && typeof i.value == "number")
99
- return B ? n.value - i.value : i.value - n.value;
103
+ return V ? n.value - i.value : i.value - n.value;
100
104
  const s = String(n.value ?? ""), a = String(i.value ?? "");
101
- return B ? s.localeCompare(a) : a.localeCompare(s);
105
+ return V ? s.localeCompare(a) : a.localeCompare(s);
102
106
  }), r.map((n) => n.header);
103
- }, [m, f, v, w, B]), Ce = Y(() => {
107
+ }, [p, m, g, C, V]), Ne = O(() => {
104
108
  const t = [
105
109
  {
106
110
  id: "cross-header",
107
- header: () => /* @__PURE__ */ c("div", { className: "relative", children: [
108
- /* @__PURE__ */ o("div", { className: "absolute top-0 left-2 text-xs", children: K }),
109
- /* @__PURE__ */ o("div", { className: "absolute right-2 bottom-0 text-xs", children: M })
111
+ header: () => /* @__PURE__ */ d("div", { className: "relative", children: [
112
+ /* @__PURE__ */ o("div", { className: "absolute top-0 left-2 text-xs", children: $ }),
113
+ /* @__PURE__ */ o("div", { className: "absolute right-2 bottom-0 text-xs", children: j })
110
114
  ] }),
111
115
  accessorFn: (e) => e.item,
112
116
  cell: (e) => {
113
117
  const r = e.getValue();
114
- if (!b)
118
+ if (!y)
115
119
  return /* @__PURE__ */ o(
116
- R,
120
+ k,
117
121
  {
118
122
  text: r.label,
119
- maxLength: C,
123
+ maxLength: b,
120
124
  className: "w-full"
121
125
  }
122
126
  );
123
- const n = w === r.id;
127
+ const n = C === r.id;
124
128
  return /* @__PURE__ */ o(
125
- k,
129
+ N,
126
130
  {
127
131
  variant: "ghost",
128
132
  size: "sm",
129
133
  iconLeft: "ArrowLeftRight",
130
134
  className: "text-right",
131
135
  onClick: () => {
132
- b && (n ? F((i) => !i) : (P(f[e.row.index].id), F(!0), q && q(f[e.row.index])));
136
+ y && (n ? R((i) => !i) : (M(m[e.row.index].id), R(!0), X && X(m[e.row.index])));
133
137
  },
134
- children: /* @__PURE__ */ o(R, { text: r.label, maxLength: C })
138
+ children: /* @__PURE__ */ o(k, { text: r.label, maxLength: b })
135
139
  }
136
140
  );
137
141
  }
@@ -141,20 +145,20 @@ function We({
141
145
  t.push({
142
146
  id: e.id,
143
147
  accessorFn: (r) => r[e.id],
144
- header: ({ column: r }) => b ? /* @__PURE__ */ o(
145
- k,
148
+ header: ({ column: r }) => y ? /* @__PURE__ */ o(
149
+ N,
146
150
  {
147
151
  variant: "ghost",
148
152
  size: "sm",
149
153
  iconLeft: "ArrowUpDown",
150
- onClick: b ? () => r.toggleSorting(r.getIsSorted() === "asc") : void 0,
151
- children: /* @__PURE__ */ o(R, { text: e.label, maxLength: C })
154
+ onClick: y ? () => r.toggleSorting(r.getIsSorted() === "asc") : void 0,
155
+ children: /* @__PURE__ */ o(k, { text: e.label, maxLength: b })
152
156
  }
153
157
  ) : /* @__PURE__ */ o(
154
- R,
158
+ k,
155
159
  {
156
160
  text: e.label,
157
- maxLength: C,
161
+ maxLength: b,
158
162
  className: "font-medium"
159
163
  }
160
164
  ),
@@ -170,138 +174,81 @@ function We({
170
174
  }), t;
171
175
  }, [
172
176
  h,
173
- K,
174
- M,
175
- d,
177
+ $,
178
+ j,
179
+ u,
180
+ y,
176
181
  b,
177
- C,
178
- P,
179
- F
180
- ]), we = Y(() => f.map((t, e) => {
182
+ M,
183
+ R
184
+ ]), Se = O(() => m.map((t, e) => {
181
185
  const r = { item: t };
182
186
  return h.forEach((n) => {
183
187
  var s;
184
- const i = m.findIndex((a) => a.id === n.id);
185
- r[n.id] = i !== -1 ? ((s = v[e]) == null ? void 0 : s[i]) ?? null : null;
188
+ const i = p.findIndex((a) => a.id === n.id);
189
+ r[n.id] = i !== -1 ? ((s = g[e]) == null ? void 0 : s[i]) ?? null : null;
186
190
  }), r;
187
- }), [f, h, v, m]), _ = Ve({
188
- data: we,
189
- columns: Ce,
190
- state: { sorting: de },
191
- onSortingChange: ue,
192
- getCoreRowModel: Le(),
193
- getSortedRowModel: Oe()
191
+ }), [m, h, g, p]), F = Ee({
192
+ data: Se,
193
+ columns: Ne,
194
+ state: { sorting: ae },
195
+ onSortingChange: ce,
196
+ getCoreRowModel: Fe(),
197
+ getSortedRowModel: Be()
194
198
  });
195
- if (!v || v.length === 0)
196
- return /* @__PURE__ */ o("div", { className: A, children: /* @__PURE__ */ o(X, { children: /* @__PURE__ */ o(le, { colSpan: h.length + 1, children: oe || re }) }) });
197
- if (ne)
199
+ if (!g || g.length === 0)
200
+ return /* @__PURE__ */ o("div", { className: E, children: /* @__PURE__ */ o(U, { children: /* @__PURE__ */ o(te, { colSpan: h.length + 1, children: ne || oe }) }) });
201
+ if (le)
198
202
  return /* @__PURE__ */ o(
199
- ze,
203
+ je,
200
204
  {
201
205
  headerRow: h.map((t) => t.label),
202
- rowCount: f.length || 5,
206
+ rowCount: m.length || 5,
203
207
  columnCount: h.length || 5,
204
- className: A,
205
- cornerHeaderFrom: K,
206
- cornerHeaderTo: M
208
+ className: E,
209
+ cornerHeaderFrom: $,
210
+ cornerHeaderTo: j
207
211
  }
208
212
  );
209
- const Ne = (t) => {
213
+ const Te = (t) => {
210
214
  const e = t.column.id === "cross-header", r = e, n = ["bg-d-secondary"];
211
215
  e || n.push("border-r"), e && n.push("sticky left-0"), n.push("sticky top-0 z-20"), r ? n.push("z-40") : e && n.push("z-30");
212
216
  let i = "none";
213
217
  return e && (i = "inset -1px 0 0 0 var(--d-border), 0 1px 0 0 var(--d-border)"), {
214
218
  className: n.join(" "),
215
- style: { boxShadow: i, width: `${E}px` }
219
+ style: { boxShadow: i, width: `${I}px` }
216
220
  };
217
- }, G = ke(null), J = je({
218
- count: _.getRowModel().rows.length,
219
- getScrollElement: () => G.current,
221
+ }, q = De(null), G = $e({
222
+ count: F.getRowModel().rows.length,
223
+ getScrollElement: () => q.current,
220
224
  estimateSize: () => 40,
221
225
  overscan: 5,
222
226
  measureElement: typeof window < "u" ? (t) => t.getBoundingClientRect().height : void 0
223
227
  });
224
- return /* @__PURE__ */ c("div", { className: `w-[900px] ${A || ""}`, children: [
225
- O && /* @__PURE__ */ o(
226
- Te,
227
- {
228
- editable: O,
229
- editConfirmLabel: ie,
230
- editCancelLabel: ae,
231
- editRestoreDefaultLabel: "Ripristina Default",
232
- editMode: j,
233
- setEditMode: fe,
234
- editedCount: Object.keys(N).length,
235
- defaultCount: Object.keys(p).length,
236
- restoreDefault: () => {
237
- if (V) {
238
- const t = Object.entries(p).map(
239
- ([r, { value: n, cell: i }]) => ({
240
- fromId: i.fromId,
241
- toId: i.toId,
242
- id: i.id,
243
- value: n
244
- })
245
- );
246
- V({
247
- editedCells: [],
248
- toDefaultCells: t
249
- });
250
- }
251
- x({});
252
- },
253
- confirmAll: () => {
254
- if (V && (Object.keys(N).length > 0 || Object.keys(p).length > 0)) {
255
- const e = Object.entries(N).map(
256
- ([i, { value: s, cell: a }]) => ({
257
- fromId: a.fromId,
258
- toId: a.toId,
259
- id: a.id,
260
- value: s
261
- })
262
- ), r = Object.entries(p).map(
263
- ([i, { value: s, cell: a }]) => ({
264
- fromId: a.fromId,
265
- toId: a.toId,
266
- id: a.id,
267
- value: s
268
- })
269
- );
270
- V({
271
- editedCells: e,
272
- toDefaultCells: r
273
- });
274
- }
275
- S({}), x({});
276
- },
277
- cancelAll: () => {
278
- S({}), x({});
279
- }
280
- }
281
- ),
228
+ return /* @__PURE__ */ d("div", { className: `w-[900px] ${E || ""}`, children: [
282
229
  /* @__PURE__ */ o(
283
230
  "div",
284
231
  {
285
- ref: G,
232
+ ref: q,
286
233
  className: "max-h-[600px] overflow-auto rounded-md border",
287
- children: /* @__PURE__ */ c(Ae, { className: "relative w-full table-fixed border-collapse", children: [
234
+ children: /* @__PURE__ */ d(Re, { className: "relative w-full table-fixed border-collapse", children: [
288
235
  /* @__PURE__ */ o(
289
- Ke,
236
+ Le,
290
237
  {
291
238
  className: "bg-d-secondary sticky top-0 z-20 w-full",
292
239
  style: { boxShadow: "0 1px 0 0 var(--d-border)" },
293
- children: _.getHeaderGroups().map((t) => /* @__PURE__ */ o(
294
- X,
240
+ children: F.getHeaderGroups().map((t) => /* @__PURE__ */ o(
241
+ U,
295
242
  {
296
243
  className: "bg-d-secondary sticky top-0 z-20",
297
244
  children: t.headers.map((e) => {
298
- const r = Ne(e);
245
+ const r = Te(e);
299
246
  return /* @__PURE__ */ o(
300
- Me,
247
+ Ae,
301
248
  {
302
249
  className: r.className,
303
250
  style: r.style,
304
- children: e.isPlaceholder ? null : te(
251
+ children: e.isPlaceholder ? null : ee(
305
252
  e.column.columnDef.header,
306
253
  e.getContext()
307
254
  )
@@ -315,17 +262,17 @@ function We({
315
262
  }
316
263
  ),
317
264
  /* @__PURE__ */ o(
318
- Ee,
265
+ Pe,
319
266
  {
320
267
  style: {
321
- height: `${J.getTotalSize()}px`,
268
+ height: `${G.getTotalSize()}px`,
322
269
  position: "relative",
323
270
  width: "100%"
324
271
  },
325
- children: J.getVirtualItems().map((t) => {
326
- const e = _.getRowModel().rows[t.index];
272
+ children: G.getVirtualItems().map((t) => {
273
+ const e = F.getRowModel().rows[t.index];
327
274
  return /* @__PURE__ */ o(
328
- X,
275
+ U,
329
276
  {
330
277
  "data-index": t.index,
331
278
  style: {
@@ -340,55 +287,55 @@ function We({
340
287
  children: e.getVisibleCells().map((r, n) => {
341
288
  const i = n === 0, s = r.getValue(), a = i ? "var(--d-secondary)" : (s == null ? void 0 : s.color) || "transparent";
342
289
  return /* @__PURE__ */ o(
343
- le,
290
+ te,
344
291
  {
345
292
  className: `text-center ${i ? "sticky left-0 z-10" : "border-r"}`,
346
293
  style: {
347
294
  boxShadow: i ? "inset -1px 0 0 0 var(--d-border)" : "none",
348
295
  backgroundColor: a,
349
- width: `${E}px`,
350
- flex: i ? "0 0 auto" : `1 0 ${E}px`,
296
+ width: `${I}px`,
297
+ flex: i ? "0 0 auto" : `1 0 ${I}px`,
351
298
  display: "flex",
352
299
  alignItems: "center",
353
300
  justifyContent: "center"
354
301
  },
355
- children: i || !j || !s ? (
302
+ children: i || !L || !s ? (
356
303
  // Rendering normale per la prima colonna o quando non siamo in modalità edit
357
- te(
304
+ ee(
358
305
  r.column.columnDef.cell,
359
306
  r.getContext()
360
307
  )
361
308
  ) : (
362
309
  // Rendering con cella modificabile
363
310
  (() => {
364
- const g = `${e.index}-${r.column.id}`, D = g in N ? N[g].value : s.value || "", Se = D !== s.value, H = g in p;
311
+ const v = `${e.index}-${r.column.id}`, z = v in _ ? _[v].value : s.value || "", ze = z !== s.value, Z = v in P;
365
312
  return /* @__PURE__ */ o(
366
313
  "div",
367
314
  {
368
315
  className: "flex w-full cursor-pointer items-center justify-center",
369
- onClick: (Ie) => {
370
- const W = Ie.currentTarget.getBoundingClientRect();
371
- me({
372
- cellKey: g,
373
- value: D,
316
+ onClick: (ke) => {
317
+ const H = ke.currentTarget.getBoundingClientRect();
318
+ he({
319
+ cellKey: v,
320
+ value: z,
374
321
  originalValue: s.value || "",
375
322
  cellData: s,
376
323
  position: {
377
- top: W.bottom + window.scrollY + 5,
378
- left: W.left + window.scrollX
324
+ top: H.bottom + window.scrollY + 5,
325
+ left: H.left + window.scrollX
379
326
  }
380
- }), T(D), y(!0);
327
+ }), T(z), x(!0);
381
328
  },
382
- children: /* @__PURE__ */ c("div", { className: "relative w-full flex-1 items-center justify-center text-center", children: [
383
- D || "",
384
- Se && !H && /* @__PURE__ */ o(
329
+ children: /* @__PURE__ */ d("div", { className: "relative w-full flex-1 items-center justify-center text-center", children: [
330
+ z || "",
331
+ ze && !Z && /* @__PURE__ */ o(
385
332
  "div",
386
333
  {
387
334
  className: "bg-d-primary absolute top-0 left-0 rounded p-1",
388
335
  title: "Valore modificato"
389
336
  }
390
337
  ),
391
- H && /* @__PURE__ */ o(
338
+ Z && /* @__PURE__ */ o(
392
339
  "div",
393
340
  {
394
341
  className: "bg-d-destructive absolute top-0 right-0 rounded p-1",
@@ -396,7 +343,7 @@ function We({
396
343
  }
397
344
  ),
398
345
  /* @__PURE__ */ o("span", { className: "text-d-muted-foreground ml-1 inline-flex items-center", children: /* @__PURE__ */ o(
399
- U,
346
+ Y,
400
347
  {
401
348
  name: "Pencil",
402
349
  size: "sm",
@@ -421,20 +368,20 @@ function We({
421
368
  ] })
422
369
  }
423
370
  ),
424
- /* @__PURE__ */ c(De, { open: pe, onOpenChange: he, children: [
425
- /* @__PURE__ */ o(Re, { asChild: !0, children: /* @__PURE__ */ o("div", { style: { display: "none" } }) }),
371
+ /* @__PURE__ */ d(Ke, { open: ve, onOpenChange: ge, children: [
372
+ /* @__PURE__ */ o(Me, { asChild: !0, children: /* @__PURE__ */ o("div", { style: { display: "none" } }) }),
426
373
  /* @__PURE__ */ o(
427
- $e,
374
+ Ve,
428
375
  {
429
376
  className: "w-[400px] p-4",
430
377
  style: {
431
378
  position: l != null && l.position ? "absolute" : "fixed",
432
- top: (Q = l == null ? void 0 : l.position) != null && Q.top ? `${l.position.top}px` : "50%",
433
- left: (Z = l == null ? void 0 : l.position) != null && Z.left ? `${l.position.left}px` : "50%",
379
+ top: (J = l == null ? void 0 : l.position) != null && J.top ? `${l.position.top}px` : "50%",
380
+ left: (Q = l == null ? void 0 : l.position) != null && Q.left ? `${l.position.left}px` : "50%",
434
381
  transform: l != null && l.position ? "none" : "translate(-50%, -50%)"
435
382
  },
436
- children: /* @__PURE__ */ c("div", { className: "space-y-4", children: [
437
- /* @__PURE__ */ c("div", { className: "flex items-center justify-between", children: [
383
+ children: /* @__PURE__ */ d("div", { className: "space-y-4", children: [
384
+ /* @__PURE__ */ d("div", { className: "flex items-center justify-between", children: [
438
385
  /* @__PURE__ */ o("div", { className: "font-medium", children: "Modifica valore" }),
439
386
  l && l.value !== l.originalValue && /* @__PURE__ */ o("div", { className: "text-d-muted-foreground text-xs", children: "Valore modificato" })
440
387
  ] }),
@@ -443,47 +390,47 @@ function We({
443
390
  {
444
391
  type: "text",
445
392
  className: "bg-d-secondary w-full rounded border p-2",
446
- value: z || "",
447
- onChange: ye,
393
+ value: S || "",
394
+ onChange: Ce,
448
395
  autoFocus: !0
449
396
  }
450
397
  ),
451
- /* @__PURE__ */ c("div", { className: "flex items-center justify-between", children: [
452
- /* @__PURE__ */ c(
453
- k,
398
+ /* @__PURE__ */ d("div", { className: "flex items-center justify-between", children: [
399
+ /* @__PURE__ */ d(
400
+ N,
454
401
  {
455
402
  variant: "destructive",
456
403
  size: "sm",
457
- onClick: xe,
404
+ onClick: be,
458
405
  className: "text-xs",
459
406
  title: "Ripristina il valore originale e segna la cella come da ripristinare",
460
407
  children: [
461
- /* @__PURE__ */ o(U, { name: "RotateCcw", className: "mr-1 h-3 w-3" }),
408
+ /* @__PURE__ */ o(Y, { name: "RotateCcw", className: "mr-1 h-3 w-3" }),
462
409
  "Ripristina"
463
410
  ]
464
411
  }
465
412
  ),
466
- /* @__PURE__ */ c("div", { className: "flex space-x-2", children: [
413
+ /* @__PURE__ */ d("div", { className: "flex space-x-2", children: [
467
414
  /* @__PURE__ */ o(
468
- k,
415
+ N,
469
416
  {
470
417
  variant: "ghost",
471
418
  size: "sm",
472
- onClick: ve,
419
+ onClick: ye,
473
420
  className: "text-xs",
474
421
  title: "Annulla le modifiche correnti e chiudi",
475
422
  children: "Annulla"
476
423
  }
477
424
  ),
478
- /* @__PURE__ */ c(
479
- k,
425
+ /* @__PURE__ */ d(
426
+ N,
480
427
  {
481
428
  size: "sm",
482
- onClick: ge,
429
+ onClick: xe,
483
430
  className: "text-xs",
484
431
  title: "Conferma le modifiche e salva",
485
432
  children: [
486
- /* @__PURE__ */ o(U, { name: "Check", className: "mr-1 h-3 w-3" }),
433
+ /* @__PURE__ */ o(Y, { name: "Check", className: "mr-1 h-3 w-3" }),
487
434
  "Conferma"
488
435
  ]
489
436
  }
@@ -497,5 +444,5 @@ function We({
497
444
  ] });
498
445
  }
499
446
  export {
500
- We as DataCrossTable
447
+ lt as DataCrossTable
501
448
  };