laif-ds 1.0.2-app-data-grid.77 → 1.0.2-app-data-grid.80
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 +44 -0
- package/dist/_virtual/index3.js +5 -5
- package/dist/_virtual/index4.js +5 -5
- package/dist/_virtual/index5.js +4 -4
- package/dist/agent-docs/adoption-report.json +3 -3
- package/dist/agent-docs/components/AppDataGrid.md +6 -6
- package/dist/agent-docs/components-list.md +19 -0
- package/dist/agent-docs/manifest.json +3 -3
- package/dist/components/ui/app-data-grid/app-data-grid.js +267 -259
- package/dist/components/ui/app-data-grid/engine/use-grid-engine.js +272 -252
- package/dist/components/ui/app-data-grid/grid-filter-client.js +73 -0
- package/dist/components/ui/app-data-grid/grid-filter-operators.js +31 -29
- package/dist/components/ui/app-data-grid/parts/grid-filter-editor.js +42 -42
- package/dist/index.d.ts +39 -11
- package/dist/node_modules/eventemitter3/index.js +1 -1
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
- package/dist/node_modules/recharts/es6/util/Events.js +1 -1
- package/dist/node_modules/unified/lib/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,36 +1,37 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as n, jsxs as H } from "react/jsx-runtime";
|
|
3
|
-
import { useMemo as
|
|
4
|
-
import { Icon as
|
|
3
|
+
import { useMemo as ae, useRef as m, useEffect as He, useLayoutEffect as nt, useState as _e, useId as je, useCallback as D } from "react";
|
|
4
|
+
import { Icon as Qe } from "../icon.js";
|
|
5
5
|
import { Input as it } from "../input.js";
|
|
6
|
-
import { cn as
|
|
6
|
+
import { cn as le } from "../../../lib/utils.js";
|
|
7
7
|
import { useGridEngine as st } from "./engine/use-grid-engine.js";
|
|
8
8
|
import { useGridInfiniteLoader as at } from "./engine/use-grid-infinite-loader.js";
|
|
9
9
|
import { useGridVirtualizer as lt } from "./engine/use-grid-virtualizer.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
10
|
+
import { GRID_VALUELESS_OPERATOR_SET as dt, isGridFilterValueEmpty as ct } from "./grid-filter-operators.js";
|
|
11
|
+
import { flattenGridColumns as Ue } from "./grid-header-matrix.js";
|
|
12
|
+
import { defaultGridI18n as s } from "./grid-i18n.js";
|
|
13
|
+
import { registerGridMount as ut } from "./grid-mount-count.js";
|
|
14
|
+
import { gridResultScope as pt, GRID_PAGE_SIZE_OPTIONS as gt } from "./grid-result-scope.js";
|
|
15
|
+
import { gridRowHeight as W, gridZ as ft, gridFrameGapClass as mt } from "./grid-tokens.js";
|
|
16
|
+
import { readGridViewPreset as wt } from "./grid-view-preset.js";
|
|
17
|
+
import { GridActionsRow as ht } from "./parts/grid-actions-row.js";
|
|
18
|
+
import { createGridFilterBadge as yt } from "./parts/grid-filter-panel.js";
|
|
19
|
+
import { GridFullscreenToggle as vt } from "./parts/grid-fullscreen-toggle.js";
|
|
20
|
+
import { GridPaginationControl as Ct } from "./parts/grid-pagination-control.js";
|
|
21
|
+
import { GridScrollArea as bt } from "./parts/grid-scroll-area.js";
|
|
22
|
+
import { GridSelectionBar as Rt } from "./parts/grid-selection-bar.js";
|
|
22
23
|
import { GridStatusSurface as Ke } from "./parts/grid-status-surface.js";
|
|
23
|
-
import { gridBypassLinkClass as
|
|
24
|
-
import { GridToolbarResetFiltersTrigger as
|
|
25
|
-
import { toGridFilterColumns as
|
|
26
|
-
const
|
|
24
|
+
import { gridBypassLinkClass as Ze, GridTable as St } from "./parts/grid-table.js";
|
|
25
|
+
import { GridToolbarResetFiltersTrigger as It, GridToolbarFiltersTrigger as xt, GridToolbarCustomFilters as Tt, GridToolbarFilterRowToggle as Ft, GridToolbarColumnsTrigger as At } from "./parts/grid-toolbar-slots.js";
|
|
26
|
+
import { toGridFilterColumns as Ot } from "./use-grid-filters.js";
|
|
27
|
+
const Gt = [
|
|
27
28
|
"a[href]",
|
|
28
29
|
"button:not([disabled])",
|
|
29
30
|
"input:not([disabled])",
|
|
30
31
|
"select:not([disabled])",
|
|
31
32
|
"textarea:not([disabled])",
|
|
32
33
|
'[tabindex]:not([tabindex="-1"])'
|
|
33
|
-
].join(","),
|
|
34
|
+
].join(","), Mt = ({ visible: v, children: C }) => {
|
|
34
35
|
const T = /* @__PURE__ */ n(
|
|
35
36
|
"div",
|
|
36
37
|
{
|
|
@@ -49,7 +50,7 @@ const Mt = [
|
|
|
49
50
|
className: "flex shrink-0 items-center gap-1.5 text-xs",
|
|
50
51
|
children: [
|
|
51
52
|
/* @__PURE__ */ n(
|
|
52
|
-
|
|
53
|
+
Qe,
|
|
53
54
|
{
|
|
54
55
|
name: "Megaphone",
|
|
55
56
|
size: "xs",
|
|
@@ -61,25 +62,25 @@ const Mt = [
|
|
|
61
62
|
]
|
|
62
63
|
}
|
|
63
64
|
) : T;
|
|
64
|
-
},
|
|
65
|
+
}, nr = (v) => {
|
|
65
66
|
const {
|
|
66
67
|
columns: C,
|
|
67
68
|
data: T,
|
|
68
|
-
i18n: r =
|
|
69
|
-
sortMode:
|
|
70
|
-
maxSortedColumns:
|
|
71
|
-
density:
|
|
72
|
-
onDensityChange:
|
|
73
|
-
onFullscreenChange:
|
|
69
|
+
i18n: r = s,
|
|
70
|
+
sortMode: Xe = "multi",
|
|
71
|
+
maxSortedColumns: Je = 2,
|
|
72
|
+
density: _,
|
|
73
|
+
onDensityChange: de,
|
|
74
|
+
onFullscreenChange: Ye,
|
|
74
75
|
filters: S,
|
|
75
|
-
columnVisibility:
|
|
76
|
-
onColumnVisibilityChange:
|
|
76
|
+
columnVisibility: j,
|
|
77
|
+
onColumnVisibilityChange: ce,
|
|
77
78
|
// I DUE VERSI DELLA CATTURA DI VISTA che P10 non aveva. Si destrutturano
|
|
78
79
|
// accanto alla loro sorella perché sono lo stesso mestiere — i tre tipi
|
|
79
80
|
// stanno invece in `GridShellFields` per vincolo di posa, e il perché sta
|
|
80
81
|
// sul TSDoc di ciascuno.
|
|
81
|
-
onColumnWidthsChange:
|
|
82
|
-
onColumnOrderChange:
|
|
82
|
+
onColumnWidthsChange: eo,
|
|
83
|
+
onColumnOrderChange: oo,
|
|
83
84
|
// IL GUSCIO — `selection` SI LEGGE DA QUI DALLA FASE 6, e il commento che
|
|
84
85
|
// stava qui («non si destruttura perché passarla non fa niente») descriveva
|
|
85
86
|
// le Fasi 3-5. Ora la barra della selezione di pagina esiste, e i due membri
|
|
@@ -90,50 +91,50 @@ const Mt = [
|
|
|
90
91
|
// secondo ramo da instradare.
|
|
91
92
|
//
|
|
92
93
|
// ⚠️ `pagination` si legge da qui dalla Fase 4, per la stessa ragione.
|
|
93
|
-
selection:
|
|
94
|
-
pagination:
|
|
94
|
+
selection: U,
|
|
95
|
+
pagination: K,
|
|
95
96
|
toolbar: l,
|
|
96
|
-
initialFullscreen:
|
|
97
|
+
initialFullscreen: to,
|
|
97
98
|
paginated: F = !1,
|
|
98
|
-
pageSize:
|
|
99
|
-
virtualized:
|
|
99
|
+
pageSize: ro = 10,
|
|
100
|
+
virtualized: ue = !1,
|
|
100
101
|
infinite: c,
|
|
101
102
|
groupBy: Z,
|
|
102
|
-
initialOpenGroups:
|
|
103
|
+
initialOpenGroups: no,
|
|
103
104
|
// DOVE CADE L'ETICHETTA DI UN GRUPPO — M5, criterio 2. Default
|
|
104
105
|
// `"grouping-column"`, cioè il comportamento di sempre: una griglia che non
|
|
105
106
|
// passa questa prop rende esattamente ciò che rendeva prima.
|
|
106
|
-
groupLabelPlacement:
|
|
107
|
-
preset:
|
|
108
|
-
onPresetApplied:
|
|
107
|
+
groupLabelPlacement: io = "grouping-column",
|
|
108
|
+
preset: A,
|
|
109
|
+
onPresetApplied: pe,
|
|
109
110
|
serverMode: ge = !1,
|
|
110
111
|
serverConfig: q,
|
|
111
|
-
initialState:
|
|
112
|
-
viewportHeight:
|
|
113
|
-
loading:
|
|
114
|
-
emptyComponent:
|
|
112
|
+
initialState: so,
|
|
113
|
+
viewportHeight: fe = 480,
|
|
114
|
+
loading: p = !1,
|
|
115
|
+
emptyComponent: ao,
|
|
115
116
|
// GLI ESITI SENZA DATI — FASE 5. `error` è il PREDICATO (una fetch caduta è
|
|
116
117
|
// distinguibile da un filtro che non pesca niente) e `onRetry` è la sola
|
|
117
118
|
// callback del comando che rilancia: assente, l'esito di errore resta un
|
|
118
119
|
// messaggio senza bottone.
|
|
119
|
-
error:
|
|
120
|
-
onRetry:
|
|
120
|
+
error: lo = !1,
|
|
121
|
+
onRetry: co,
|
|
121
122
|
// I FILTRI SENZA COLONNA — Fase 8, R15. `onRemoveFilter` è la porta che
|
|
122
123
|
// accende il gruppo tratteggiato in toolbar (senza gestore la sua «×»
|
|
123
124
|
// sarebbe un comando morto); `filterControls` serve solo a riconoscere un
|
|
124
125
|
// badge custom la cui chiave non è registrata.
|
|
125
|
-
filterControls:
|
|
126
|
+
filterControls: uo,
|
|
126
127
|
onRemoveFilter: I,
|
|
127
128
|
// LA RIGA ZERO — Fase 9. `filterMode` dice DOVE vivono i filtri; le due
|
|
128
129
|
// callback sono il canale di scrittura di chi solleva `filters`, e senza di
|
|
129
130
|
// loro le celle restano vuote invece di offrire un comando morto.
|
|
130
|
-
filterMode:
|
|
131
|
-
onAddFilter:
|
|
132
|
-
onUpdateFilter:
|
|
131
|
+
filterMode: me = "row",
|
|
132
|
+
onAddFilter: E,
|
|
133
|
+
onUpdateFilter: $,
|
|
133
134
|
// LA RIGA DI STATO A SCHERMO — M4, criterio 1. Default SPENTO: `sr-only` è
|
|
134
135
|
// `position: absolute`, quindi da spenta la region non è un flex item della
|
|
135
136
|
// radice e non porta né altezza né gap. Vedi `GridLiveRegion`.
|
|
136
|
-
statusRowVisible:
|
|
137
|
+
statusRowVisible: po = !1,
|
|
137
138
|
// IL TOGGLE DELLA RIGA ZERO, OSSERVABILE — R13, criterio 4. Nessun default:
|
|
138
139
|
// non passarla lascia la griglia esattamente com'era. Vedi il TSDoc.
|
|
139
140
|
onFilterRowOpenChange: go,
|
|
@@ -141,31 +142,31 @@ const Mt = [
|
|
|
141
142
|
// passarla lascia la griglia esattamente com'era, ed è un canale di sola
|
|
142
143
|
// LETTURA (non esiste una prop che imponga la portata da fuori). Vedi il
|
|
143
144
|
// TSDoc, dove le due metà della precondizione sono separate.
|
|
144
|
-
onSelectionScopeChange:
|
|
145
|
-
actions:
|
|
146
|
-
hideActionsRow:
|
|
147
|
-
checkable:
|
|
148
|
-
rowSelection:
|
|
149
|
-
getRowId:
|
|
150
|
-
onRowSelectionChange:
|
|
151
|
-
onCheckedRowsChange:
|
|
152
|
-
rowClassName:
|
|
153
|
-
onQueryChange:
|
|
154
|
-
debounceTime:
|
|
155
|
-
className:
|
|
156
|
-
id:
|
|
157
|
-
"data-testid":
|
|
158
|
-
} = v,
|
|
145
|
+
onSelectionScopeChange: fo,
|
|
146
|
+
actions: we = [],
|
|
147
|
+
hideActionsRow: mo = !1,
|
|
148
|
+
checkable: wo = !1,
|
|
149
|
+
rowSelection: ho,
|
|
150
|
+
getRowId: yo,
|
|
151
|
+
onRowSelectionChange: vo,
|
|
152
|
+
onCheckedRowsChange: Co,
|
|
153
|
+
rowClassName: bo,
|
|
154
|
+
onQueryChange: he,
|
|
155
|
+
debounceTime: Ro,
|
|
156
|
+
className: So,
|
|
157
|
+
id: ye,
|
|
158
|
+
"data-testid": ve
|
|
159
|
+
} = v, Io = _ !== void 0, o = st({
|
|
159
160
|
columns: C,
|
|
160
161
|
data: T,
|
|
161
|
-
sortMode:
|
|
162
|
-
maxSortedColumns:
|
|
163
|
-
initialFullscreen:
|
|
162
|
+
sortMode: Xe,
|
|
163
|
+
maxSortedColumns: Je,
|
|
164
|
+
initialFullscreen: to,
|
|
164
165
|
// Il valore INIZIALE del riduttore. In modalità controllata il riduttore
|
|
165
166
|
// continua a tenere una densità che nessuno legge (vedi `density` sotto): non
|
|
166
167
|
// è stato morto, è il valore da cui riparte se il call-site smette di
|
|
167
168
|
// controllare la prop.
|
|
168
|
-
density:
|
|
169
|
+
density: _ ?? "default",
|
|
169
170
|
paginated: F,
|
|
170
171
|
// LA TAGLIA DI PAGINA SI RISOLVE QUI, IN UN PUNTO SOLO — e la precedenza è
|
|
171
172
|
// `initialState.pagination.pageSize` > `pagination.pageSize` > `pageSize`.
|
|
@@ -181,30 +182,30 @@ const Mt = [
|
|
|
181
182
|
// resta nell'engine, che legge `initialState` per primo: passandogli lo slot
|
|
182
183
|
// al posto della prop, la precedenza è quella dichiarata sopra e non ci sono
|
|
183
184
|
// due posti che rispondono alla stessa domanda.
|
|
184
|
-
pageSize:
|
|
185
|
+
pageSize: K?.pageSize ?? ro,
|
|
185
186
|
// ⚠️ UN SOLO EMETTITORE, e la precedenza è dichiarata: `onQueryChange` vince
|
|
186
187
|
// su `serverConfig.onStateChange`. Chiamarli entrambi sarebbe due refetch per
|
|
187
188
|
// gesto, cioè il difetto R10 con un altro nome — e un consumer che li passa
|
|
188
189
|
// tutti e due ha quasi certamente migrato a metà, non chiesto il doppio.
|
|
189
|
-
onQueryChange:
|
|
190
|
-
debounceTime:
|
|
190
|
+
onQueryChange: he ?? q?.onStateChange,
|
|
191
|
+
debounceTime: Ro,
|
|
191
192
|
serverMode: ge,
|
|
192
193
|
serverConfig: q,
|
|
193
|
-
initialState:
|
|
194
|
+
initialState: so,
|
|
194
195
|
groupBy: Z,
|
|
195
|
-
initialOpenGroups:
|
|
196
|
-
rowSelection:
|
|
197
|
-
getRowId:
|
|
198
|
-
onRowSelectionChange:
|
|
199
|
-
onCheckedRowsChange:
|
|
200
|
-
rowClassName:
|
|
196
|
+
initialOpenGroups: no,
|
|
197
|
+
rowSelection: ho,
|
|
198
|
+
getRowId: yo,
|
|
199
|
+
onRowSelectionChange: vo,
|
|
200
|
+
onCheckedRowsChange: Co,
|
|
201
|
+
rowClassName: bo,
|
|
201
202
|
// Le due fonti sollevate di P7: quando ci sono, comandano. Vedi le prop.
|
|
202
203
|
filters: S,
|
|
203
|
-
columnVisibility:
|
|
204
|
-
}), x =
|
|
205
|
-
o.applyView({ type: "view/fullscreen", fullscreen: e }),
|
|
206
|
-
},
|
|
207
|
-
() =>
|
|
204
|
+
columnVisibility: j
|
|
205
|
+
}), x = Io ? _ : o.state.view.density, z = r.toolbar ?? s.toolbar, d = o.state.view.fullscreen, Ce = (e) => {
|
|
206
|
+
o.applyView({ type: "view/fullscreen", fullscreen: e }), Ye?.(e);
|
|
207
|
+
}, be = (e, t) => e?.render ? e.render() : t, xo = ae(
|
|
208
|
+
() => Ue(C).map((e) => ({
|
|
208
209
|
id: e.id,
|
|
209
210
|
// ⚠️ RIPIEGO SULL'`id` QUANDO L'ETICHETTA È VUOTA, e non è una cortesia.
|
|
210
211
|
// `header: ""` è l'idioma STANDARD di una colonna di azioni — nell'header
|
|
@@ -239,38 +240,38 @@ const Mt = [
|
|
|
239
240
|
pinned: e.pinned
|
|
240
241
|
})),
|
|
241
242
|
[C]
|
|
242
|
-
),
|
|
243
|
-
!t && !
|
|
243
|
+
), To = j === void 0 || ce !== void 0, Re = o.headers.length > 1, Fo = (e, t) => {
|
|
244
|
+
!t && !Re || (j === void 0 && o.applyView({ type: "view/column-visibility", columnId: e, visible: t }), ce?.({
|
|
244
245
|
...o.state.view.columnVisibility,
|
|
245
246
|
[e]: t
|
|
246
247
|
}));
|
|
247
|
-
},
|
|
248
|
-
o.applyView({ type: "view/column-order", columnOrder: e }),
|
|
249
|
-
},
|
|
250
|
-
o.applyView({ type: "view/column-width", columnId: e, width: t }),
|
|
248
|
+
}, Ao = (e) => {
|
|
249
|
+
o.applyView({ type: "view/column-order", columnOrder: e }), oo?.([...e]);
|
|
250
|
+
}, Oo = (e, t) => {
|
|
251
|
+
o.applyView({ type: "view/column-width", columnId: e, width: t }), eo?.({
|
|
251
252
|
...o.state.view.columnWidths,
|
|
252
253
|
[e]: t
|
|
253
254
|
});
|
|
254
|
-
},
|
|
255
|
-
|
|
256
|
-
if (
|
|
257
|
-
|
|
255
|
+
}, Se = v.viewportHeight !== void 0 || ue || c !== void 0 || Z !== void 0, O = m(null), Ie = m(0), xe = m(void 0);
|
|
256
|
+
He(() => {
|
|
257
|
+
if (A === void 0 || xe.current === A) return;
|
|
258
|
+
xe.current = A;
|
|
258
259
|
let e;
|
|
259
260
|
try {
|
|
260
|
-
e =
|
|
261
|
+
e = wt(A);
|
|
261
262
|
} catch (t) {
|
|
262
263
|
console.error(t);
|
|
263
264
|
return;
|
|
264
265
|
}
|
|
265
|
-
o.applyPreset({ query: e.query, view: e.view }),
|
|
266
|
-
}, [
|
|
267
|
-
const Q = m(null),
|
|
268
|
-
const
|
|
269
|
-
if (
|
|
266
|
+
o.applyPreset({ query: e.query, view: e.view }), de?.(e.view.density), pe?.(e);
|
|
267
|
+
}, [A, o, pe, de]);
|
|
268
|
+
const Q = m(null), Go = (e, t) => {
|
|
269
|
+
const i = O.current;
|
|
270
|
+
if (i !== null) {
|
|
270
271
|
const a = k.findIndex(
|
|
271
|
-
(
|
|
272
|
+
(We) => We.kind === "group" && We.group.path === e
|
|
272
273
|
), u = Math.floor(
|
|
273
|
-
|
|
274
|
+
i.scrollTop / W[x]
|
|
274
275
|
), P = { ...o.state.view.groupExpansion };
|
|
275
276
|
P[e] = t;
|
|
276
277
|
const R = o.bodyRowCountWith(P) - k.length, f = a !== -1 && a < u, rt = f && R < 0 && u <= a - R;
|
|
@@ -279,7 +280,7 @@ const Mt = [
|
|
|
279
280
|
// ⚠️ SI LEGGE ADESSO, PRIMA DEL COMMIT, e non nell'effetto: è
|
|
280
281
|
// l'unico istante in cui questo numero è ancora quello
|
|
281
282
|
// dell'utente. Vedi il `useLayoutEffect`.
|
|
282
|
-
scrollTopPrima:
|
|
283
|
+
scrollTopPrima: i.scrollTop,
|
|
283
284
|
delta: R
|
|
284
285
|
};
|
|
285
286
|
}
|
|
@@ -288,49 +289,49 @@ const Mt = [
|
|
|
288
289
|
nt(() => {
|
|
289
290
|
const e = Q.current;
|
|
290
291
|
if (Q.current = null, e === null) return;
|
|
291
|
-
const t =
|
|
292
|
+
const t = O.current;
|
|
292
293
|
t !== null && (t.scrollTop = e.modo === "atterra-sul-gruppo" ? e.indiceGruppo * W[x] : e.scrollTopPrima + e.delta * W[x]);
|
|
293
294
|
});
|
|
294
|
-
const
|
|
295
|
-
V.current = e, e && (
|
|
295
|
+
const Te = m(0), Fe = ye ?? ve ?? null, X = m(null), V = m(null), Mo = (e) => {
|
|
296
|
+
V.current = e, e && (Ie.current += 1, e.setAttribute("data-render-count", String(Ie.current)), X.current === null && (X.current = Fe === null ? 1 : ut(Fe)), e.setAttribute("data-mount-count", String(X.current)), e.setAttribute(
|
|
296
297
|
"data-loadmore-call-count",
|
|
297
|
-
String(
|
|
298
|
+
String(Te.current)
|
|
298
299
|
));
|
|
299
|
-
},
|
|
300
|
+
}, Ae = (e) => {
|
|
300
301
|
const t = V.current;
|
|
301
302
|
if (!t) return;
|
|
302
|
-
const
|
|
303
|
-
t.querySelectorAll(
|
|
304
|
-
).filter((u) => u.dataset.gridFocusSentinel === void 0), a = e === "first" ?
|
|
303
|
+
const i = Array.from(
|
|
304
|
+
t.querySelectorAll(Gt)
|
|
305
|
+
).filter((u) => u.dataset.gridFocusSentinel === void 0), a = e === "first" ? i : [...i].reverse();
|
|
305
306
|
for (const u of a)
|
|
306
307
|
if (u.focus(), document.activeElement === u) return;
|
|
307
|
-
}, k = o.bodyRows,
|
|
308
|
-
w <
|
|
309
|
-
const
|
|
310
|
-
|
|
311
|
-
c === void 0 ||
|
|
312
|
-
}, [c,
|
|
313
|
-
const
|
|
308
|
+
}, k = o.bodyRows, Po = k.length, w = o.state.query.requestCount, G = m(w);
|
|
309
|
+
w < G.current && (G.current = w);
|
|
310
|
+
const qo = c !== void 0 && w > Math.max(1, G.current);
|
|
311
|
+
He(() => {
|
|
312
|
+
c === void 0 || p || w > G.current && (G.current = w);
|
|
313
|
+
}, [c, p, w]);
|
|
314
|
+
const Eo = c !== void 0 && p && w > 1, $o = p && !Eo, J = o.state.query.pagination.pageSize, Oe = p ? Math.min(J, 1e3) : 0, h = $o ? 0 : Po, Ge = h > 0, y = ("resultTotal" in v ? v.resultTotal : void 0) ?? q?.totalItems ?? (F && !ge && !(c !== void 0 && c.hasMore) ? o.filteredRowCount : void 0), zo = ae(
|
|
314
315
|
() => new Set(o.state.query.filters.map((e) => e.columnId)),
|
|
315
316
|
[o.state.query.filters]
|
|
316
|
-
), Y =
|
|
317
|
+
), Y = ae(
|
|
317
318
|
// `flattenGridColumns` PRIMA, perché `columns` è l'albero e
|
|
318
319
|
// `toGridFilterColumns` vuole le foglie: è lo stesso appiattimento che il
|
|
319
320
|
// call-site fa per costruire le colonne dell'inventario, quindi le due liste
|
|
320
321
|
// sono la stessa lista e non due liste che si somigliano.
|
|
321
|
-
() =>
|
|
322
|
+
() => Ot(Ue(C)),
|
|
322
323
|
[C]
|
|
323
|
-
),
|
|
324
|
+
), Vo = S === void 0 || E !== void 0 && $ !== void 0, [Me, ko] = _e(!0), Pe = m(!0), qe = je(), Ee = m(0), L = D(
|
|
324
325
|
(e, t) => {
|
|
325
|
-
const
|
|
326
|
+
const i = o.state.query.filters, a = i.find((f) => f.columnId === e);
|
|
326
327
|
if (a !== void 0) {
|
|
327
|
-
if (
|
|
328
|
-
|
|
328
|
+
if ($ !== void 0) {
|
|
329
|
+
$(a.id, t);
|
|
329
330
|
return;
|
|
330
331
|
}
|
|
331
332
|
o.applyAndEmit({
|
|
332
333
|
type: "query/filters",
|
|
333
|
-
filters:
|
|
334
|
+
filters: i.map(
|
|
334
335
|
(f) => f.id === a.id ? { ...f, ...t } : f
|
|
335
336
|
)
|
|
336
337
|
});
|
|
@@ -340,86 +341,93 @@ const Mt = [
|
|
|
340
341
|
(f) => f.id === e
|
|
341
342
|
);
|
|
342
343
|
if (u === void 0) return;
|
|
343
|
-
|
|
344
|
-
const P =
|
|
344
|
+
Ee.current += 1;
|
|
345
|
+
const P = yt(
|
|
345
346
|
u,
|
|
346
347
|
r,
|
|
347
|
-
`${
|
|
348
|
+
`${qe}-${Ee.current}`
|
|
348
349
|
);
|
|
349
350
|
if (P === void 0) return;
|
|
350
351
|
const R = { ...P, ...t };
|
|
351
|
-
if (
|
|
352
|
-
|
|
352
|
+
if (E !== void 0) {
|
|
353
|
+
E(R);
|
|
353
354
|
return;
|
|
354
355
|
}
|
|
355
356
|
o.applyAndEmit({
|
|
356
357
|
type: "query/filters",
|
|
357
|
-
filters: [...
|
|
358
|
+
filters: [...i, R]
|
|
358
359
|
});
|
|
359
360
|
},
|
|
360
361
|
[
|
|
361
362
|
o,
|
|
362
363
|
Y,
|
|
363
|
-
|
|
364
|
+
qe,
|
|
364
365
|
r,
|
|
365
|
-
|
|
366
|
-
|
|
366
|
+
E,
|
|
367
|
+
$
|
|
367
368
|
]
|
|
368
|
-
), ko = D(
|
|
369
|
-
(e, t) => {
|
|
370
|
-
L(e, { operator: t });
|
|
371
|
-
},
|
|
372
|
-
[L]
|
|
373
369
|
), Lo = D(
|
|
374
370
|
(e, t) => {
|
|
375
|
-
L(e, {
|
|
371
|
+
L(e, { operator: t });
|
|
376
372
|
},
|
|
377
373
|
[L]
|
|
378
|
-
),
|
|
374
|
+
), ee = D(
|
|
379
375
|
(e) => {
|
|
380
|
-
const t = o.state.query.filters,
|
|
381
|
-
if (
|
|
376
|
+
const t = o.state.query.filters, i = t.find((a) => a.columnId === e);
|
|
377
|
+
if (i !== void 0) {
|
|
382
378
|
if (S !== void 0) {
|
|
383
379
|
if (I === void 0) return;
|
|
384
|
-
I(
|
|
380
|
+
I(i.id);
|
|
385
381
|
return;
|
|
386
382
|
}
|
|
387
383
|
o.applyAndEmit({
|
|
388
384
|
type: "query/filters",
|
|
389
|
-
filters: t.filter((a) => a.id !==
|
|
385
|
+
filters: t.filter((a) => a.id !== i.id)
|
|
390
386
|
});
|
|
391
387
|
}
|
|
392
388
|
},
|
|
393
389
|
[o, S, I]
|
|
394
|
-
),
|
|
390
|
+
), No = D(
|
|
391
|
+
(e, t) => {
|
|
392
|
+
const i = o.state.query.filters.find(
|
|
393
|
+
(a) => a.columnId === e
|
|
394
|
+
);
|
|
395
|
+
if (i !== void 0 && !dt.has(i.operator) && ct(t)) {
|
|
396
|
+
ee(e);
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
L(e, { value: t });
|
|
400
|
+
},
|
|
401
|
+
[L, ee, o]
|
|
402
|
+
), Bo = S === void 0 || I !== void 0, Do = me === "row", g = pt({
|
|
395
403
|
badges: o.state.query.filters,
|
|
396
404
|
resultTotal: y,
|
|
397
405
|
rowsInPage: o.rows.length,
|
|
398
406
|
pageIndex: o.state.query.pagination.pageIndex,
|
|
399
407
|
pageSize: J
|
|
400
|
-
}), Wo = y === void 0 ? void 0 :
|
|
401
|
-
const t = e.sortDirection === "descending" ? r.sorting.descending : r.sorting.ascending,
|
|
402
|
-
if (e.sortCount <= 1) return
|
|
403
|
-
const a = r.sorting.sortPosition ??
|
|
404
|
-
return `${
|
|
405
|
-
}).join("; ")}`,
|
|
408
|
+
}), Wo = y === void 0 ? void 0 : g, oe = r.status ?? {}, N = r.selection ?? {}, $e = o.headers.filter((e) => e.sortIndex !== null).sort((e, t) => (e.sortIndex ?? 0) - (t.sortIndex ?? 0)), Ho = $e.length === 0 ? "" : `${oe.sortedBy ?? s.status.sortedBy} ${$e.map((e) => {
|
|
409
|
+
const t = e.sortDirection === "descending" ? r.sorting.descending : r.sorting.ascending, i = `${e.headerLabel} ${t}`;
|
|
410
|
+
if (e.sortCount <= 1) return i;
|
|
411
|
+
const a = r.sorting.sortPosition ?? s.sorting.sortPosition, u = r.pagination.of ?? s.pagination.of;
|
|
412
|
+
return `${i}, ${a} ${e.sortIndex ?? 0} ${u} ${e.sortCount}`;
|
|
413
|
+
}).join("; ")}`, _o = `${g.totalLabel} ${g.totalIsSingular ? r.pagination.rowOne ?? s.pagination.rowOne : r.pagination.rows}`, te = o.state.query.filters.filter(
|
|
406
414
|
(e) => e.kind === "custom"
|
|
407
|
-
),
|
|
408
|
-
scope:
|
|
415
|
+
), jo = te.length === 0 ? "" : `, ${g.formatCount(te.length)} ${r.filters.withoutColumn ?? s.filters.withoutColumn}: ${te.map((e) => e.customLabel ?? e.customKey ?? e.id).join(", ")}`, Uo = `${g.filterCountLabel} ${g.filterCountIsSingular ? r.filters.filterOne ?? s.filters.filterOne : r.filters.filterMany ?? s.filters.filterMany} ${g.filterCountIsSingular ? oe.filterActiveOne ?? s.status.filterActiveOne : oe.filterActiveMany ?? s.status.filterActiveMany}${jo}`, b = o.selectedPageRowIds.length, ze = U?.mode === "all" && y !== void 0, [Ko, Zo] = _e("page"), re = ze ? Ko : "page", Qo = {
|
|
416
|
+
scope: re,
|
|
409
417
|
rowIds: o.selectedPageRowIds,
|
|
410
|
-
count:
|
|
411
|
-
},
|
|
412
|
-
e !==
|
|
418
|
+
count: re === "all" ? y ?? b : b
|
|
419
|
+
}, Ve = (e) => {
|
|
420
|
+
e !== re && (Zo(e), fo?.({
|
|
413
421
|
scope: e,
|
|
414
422
|
rowIds: o.selectedPageRowIds,
|
|
415
423
|
count: e === "all" ? y ?? b : b
|
|
416
424
|
}));
|
|
417
|
-
}, Xo = `${
|
|
425
|
+
}, Xo = `${g.formatCount(b)} ${b === 1 ? N.selectedOne ?? s.selection.selectedOne : N.selectedMany ?? s.selection.selectedMany}` + (b > 0 ? ` ${N.outOf ?? s.selection.outOf} ${g.rowsInPageLabel} ${N.onPage ?? s.selection.onPage}` : ""), Jo = [
|
|
418
426
|
Ho,
|
|
419
|
-
|
|
420
|
-
|
|
427
|
+
_o,
|
|
428
|
+
Uo,
|
|
421
429
|
Xo
|
|
422
|
-
].filter((e) => e !== "").join(". "), Yo = c !== void 0 && c.hasMore ? -1 : y ?? h, B =
|
|
430
|
+
].filter((e) => e !== "").join(". "), Yo = c !== void 0 && c.hasMore ? -1 : y ?? h, B = lo && !p, ne = !p && // ⚠️ `&& !erroreVisibile`, ED È LA RIGA CHE TIENE I DUE ESITI SEPARATI. Una
|
|
423
431
|
// fetch caduta ha `dataRowCount === 0`, quindi senza questo termine i due
|
|
424
432
|
// predicati sono veri insieme. Il vuoto è quello che tace, perché è l'esito
|
|
425
433
|
// che l'errore SPIEGA.
|
|
@@ -439,13 +447,13 @@ const Mt = [
|
|
|
439
447
|
// un terzo lettore che lo consumasse senza provare l'errore prima renderebbe
|
|
440
448
|
// il vuoto sopra una fetch caduta. Dichiarare il termine qui è più economico
|
|
441
449
|
// che ricordare l'ordine in tre punti.
|
|
442
|
-
!B && h === 0 && !(c !== void 0 && c.hasMore),
|
|
450
|
+
!B && h === 0 && !(c !== void 0 && c.hasMore), ie = lt({
|
|
443
451
|
// `enabled: virtualized`, SENZA `&& !loading`: adesso è `count` a dire la
|
|
444
452
|
// verità sul da farsi. Quando si sostituisce, `count` è zero e l'hook esce
|
|
445
453
|
// con `null` — stesso effetto di prima, ma per la ragione giusta e in un
|
|
446
454
|
// punto solo.
|
|
447
|
-
enabled:
|
|
448
|
-
count: h +
|
|
455
|
+
enabled: ue,
|
|
456
|
+
count: h + Oe,
|
|
449
457
|
// L'altezza ESATTA della riga alla densità corrente, non una stima. Misurato
|
|
450
458
|
// in Chrome: sotto `border-collapse: collapse` una `<tr>` con `height: 36px`
|
|
451
459
|
// e `border-bottom: 1px` è alta esattamente 36 — il bordo collassato non si
|
|
@@ -455,21 +463,21 @@ const Mt = [
|
|
|
455
463
|
// resa è zero, e non serve nessuna misurazione dinamica (quindi nessun
|
|
456
464
|
// `ResizeObserver` da mandare in loop).
|
|
457
465
|
rowHeight: W[x],
|
|
458
|
-
scrollRef:
|
|
466
|
+
scrollRef: O,
|
|
459
467
|
// Serve al PRIMO render, quando il ref è ancora `null`: senza di lui la
|
|
460
468
|
// griglia montava tutte e 10.000 le righe prima di ridursi a 22.
|
|
461
|
-
viewportHeight:
|
|
462
|
-
}),
|
|
463
|
-
Math.min(
|
|
464
|
-
Math.min(
|
|
465
|
-
),
|
|
469
|
+
viewportHeight: fe
|
|
470
|
+
}), ke = ie?.startIndex ?? 0, Le = ie?.endIndex ?? h + Oe, Ne = k.slice(
|
|
471
|
+
Math.min(ke, h),
|
|
472
|
+
Math.min(Le, h)
|
|
473
|
+
), Be = o.headers[0]?.columnId, et = io === "first-column" && Be !== void 0 ? Ne.map(
|
|
466
474
|
(e) => e.kind === "group" ? {
|
|
467
475
|
...e,
|
|
468
|
-
group: { ...e.group, columnId:
|
|
476
|
+
group: { ...e.group, columnId: Be }
|
|
469
477
|
} : e
|
|
470
|
-
) :
|
|
478
|
+
) : Ne, ot = Math.max(
|
|
471
479
|
0,
|
|
472
|
-
|
|
480
|
+
Le - Math.max(ke, h)
|
|
473
481
|
);
|
|
474
482
|
at({
|
|
475
483
|
// ⚠️ `&& !paginated`, ED È UNA RIPARAZIONE. Le due prop sono entrambe
|
|
@@ -492,58 +500,58 @@ const Mt = [
|
|
|
492
500
|
// una prop che tace è peggio di una che non c'è.
|
|
493
501
|
enabled: c !== void 0 && !F,
|
|
494
502
|
hasMore: c?.hasMore ?? !1,
|
|
495
|
-
loading:
|
|
503
|
+
loading: p,
|
|
496
504
|
// ⚠️ I DATI CONSEGNATI, non `engine.rows.length`: quello è il row model DOPO
|
|
497
505
|
// il filtro client, quindi in modalità server una risposta che il filtro
|
|
498
506
|
// locale scarta tutta lascerebbe la chiave immobile e la lista bloccata.
|
|
499
507
|
rowCount: T.length,
|
|
500
508
|
querySignature: o.querySignature,
|
|
501
|
-
scrollRef:
|
|
509
|
+
scrollRef: O,
|
|
502
510
|
onLoadMore: () => {
|
|
503
|
-
|
|
511
|
+
Te.current += 1, o.applyAndEmit({ type: "query/load-more" });
|
|
504
512
|
}
|
|
505
513
|
});
|
|
506
|
-
const
|
|
514
|
+
const M = r.table ?? s.table, tt = B ? {
|
|
507
515
|
kind: "error",
|
|
508
516
|
content: /* @__PURE__ */ n(
|
|
509
517
|
Ke,
|
|
510
518
|
{
|
|
511
519
|
kind: "error",
|
|
512
|
-
message:
|
|
513
|
-
retryLabel:
|
|
514
|
-
onRetry:
|
|
520
|
+
message: M.errorMessage ?? s.table.errorMessage,
|
|
521
|
+
retryLabel: M.retry ?? s.table.retry,
|
|
522
|
+
onRetry: co
|
|
515
523
|
}
|
|
516
524
|
)
|
|
517
|
-
} :
|
|
525
|
+
} : ne ? {
|
|
518
526
|
kind: "empty",
|
|
519
527
|
content: /* @__PURE__ */ n(
|
|
520
528
|
Ke,
|
|
521
529
|
{
|
|
522
530
|
kind: "empty",
|
|
523
|
-
content:
|
|
531
|
+
content: ao ?? r.notFoundMessage
|
|
524
532
|
}
|
|
525
533
|
)
|
|
526
|
-
} : void 0,
|
|
527
|
-
head: `adg-head-${
|
|
528
|
-
rows: `adg-rows-${
|
|
534
|
+
} : void 0, De = je().replace(/[^a-zA-Z0-9]/g, ""), se = {
|
|
535
|
+
head: `adg-head-${De}`,
|
|
536
|
+
rows: `adg-rows-${De}`
|
|
529
537
|
};
|
|
530
538
|
return /* @__PURE__ */ H(
|
|
531
539
|
"div",
|
|
532
540
|
{
|
|
533
|
-
id:
|
|
534
|
-
"data-testid":
|
|
541
|
+
id: ye,
|
|
542
|
+
"data-testid": ve,
|
|
535
543
|
"data-app-data-grid": "",
|
|
536
|
-
ref:
|
|
544
|
+
ref: Mo,
|
|
537
545
|
"data-emissions": o.emissions,
|
|
538
546
|
"data-grid-fullscreen": d ? "true" : "false",
|
|
539
|
-
"aria-busy":
|
|
540
|
-
className:
|
|
547
|
+
"aria-busy": p ? !0 : void 0,
|
|
548
|
+
className: le(
|
|
541
549
|
// ⚠️ `gridFrameGapClass` E NON `gap-2` SCRITTO QUI: il px che
|
|
542
550
|
// `gridFrameHeight` somma quando la barra di selezione compare e la
|
|
543
551
|
// classe che lo rende devono cambiare insieme. Vivono accanto in
|
|
544
552
|
// `grid-tokens.ts`, come `gridRowHeight`/`gridRowHeightClass`.
|
|
545
553
|
"border-d-border bg-d-background text-d-foreground flex w-full flex-col rounded-md border p-2",
|
|
546
|
-
|
|
554
|
+
mt,
|
|
547
555
|
// LO SCHERMO INTERO È UNA PROMOZIONE DELLO STESSO NODO — P6, criteri 2-4.
|
|
548
556
|
//
|
|
549
557
|
// Non un portale, non un secondo albero, non `requestFullscreen`: le
|
|
@@ -560,14 +568,14 @@ const Mt = [
|
|
|
560
568
|
// `rounded-none` invece serve: a tutto schermo gli angoli arrotondati
|
|
561
569
|
// lascerebbero quattro triangoli della pagina visibili negli spigoli.
|
|
562
570
|
d && "fixed inset-0 rounded-none border-0",
|
|
563
|
-
|
|
571
|
+
So
|
|
564
572
|
),
|
|
565
|
-
style: d ? { zIndex:
|
|
573
|
+
style: d ? { zIndex: ft.fullscreen } : void 0,
|
|
566
574
|
role: d ? "dialog" : void 0,
|
|
567
575
|
"aria-modal": d ? !0 : void 0,
|
|
568
|
-
"aria-label": d ?
|
|
576
|
+
"aria-label": d ? z.fullscreenExit : void 0,
|
|
569
577
|
onKeyDown: d ? (e) => {
|
|
570
|
-
e.key === "Escape" && (e.defaultPrevented || (e.stopPropagation(),
|
|
578
|
+
e.key === "Escape" && (e.defaultPrevented || (e.stopPropagation(), Ce(!1)));
|
|
571
579
|
} : void 0,
|
|
572
580
|
children: [
|
|
573
581
|
d && /* @__PURE__ */ n(
|
|
@@ -577,7 +585,7 @@ const Mt = [
|
|
|
577
585
|
tabIndex: 0,
|
|
578
586
|
"aria-hidden": "true",
|
|
579
587
|
className: "sr-only",
|
|
580
|
-
onFocus: () =>
|
|
588
|
+
onFocus: () => Ae("last")
|
|
581
589
|
}
|
|
582
590
|
),
|
|
583
591
|
/* @__PURE__ */ H(
|
|
@@ -586,16 +594,16 @@ const Mt = [
|
|
|
586
594
|
"data-grid-toolbar": "",
|
|
587
595
|
className: "relative flex flex-wrap items-center gap-2",
|
|
588
596
|
children: [
|
|
589
|
-
/* @__PURE__ */ n("a", { href: `#${
|
|
590
|
-
/* @__PURE__ */ n("a", { href: `#${
|
|
591
|
-
|
|
597
|
+
/* @__PURE__ */ n("a", { href: `#${se.rows}`, className: Ze, children: M.skipToRows }),
|
|
598
|
+
/* @__PURE__ */ n("a", { href: `#${se.head}`, className: Ze, children: M.skipToHeader }),
|
|
599
|
+
be(
|
|
592
600
|
l?.search,
|
|
593
601
|
/* @__PURE__ */ n(
|
|
594
602
|
it,
|
|
595
603
|
{
|
|
596
604
|
type: "search",
|
|
597
605
|
"data-grid-search": "",
|
|
598
|
-
label:
|
|
606
|
+
label: z.searchLabel,
|
|
599
607
|
placeholder: r.searchPlaceholder,
|
|
600
608
|
value: o.state.query.search,
|
|
601
609
|
onChange: (e) => (
|
|
@@ -614,11 +622,11 @@ const Mt = [
|
|
|
614
622
|
"data-grid-search-clear": "",
|
|
615
623
|
"aria-label": r.clearSearch,
|
|
616
624
|
onClick: () => o.applyAndEmit({ type: "query/search", value: "" }),
|
|
617
|
-
className:
|
|
625
|
+
className: le(
|
|
618
626
|
"focus-visible:ring-d-foreground",
|
|
619
627
|
"text-d-muted-foreground hover:text-d-foreground flex size-6 cursor-pointer items-center justify-center rounded-md focus-visible:ring-2 focus-visible:outline-none"
|
|
620
628
|
),
|
|
621
|
-
children: /* @__PURE__ */ n(
|
|
629
|
+
children: /* @__PURE__ */ n(Qe, { name: "X", size: "xs", "aria-hidden": "true" })
|
|
622
630
|
}
|
|
623
631
|
),
|
|
624
632
|
labelClassName: "shrink-0 text-xs font-normal whitespace-nowrap",
|
|
@@ -627,37 +635,37 @@ const Mt = [
|
|
|
627
635
|
)
|
|
628
636
|
),
|
|
629
637
|
l?.resetFilters?.render ? l.resetFilters.render() : l?.resetFilters?.onReset !== void 0 && /* @__PURE__ */ n(
|
|
630
|
-
|
|
638
|
+
It,
|
|
631
639
|
{
|
|
632
640
|
onReset: l.resetFilters.onReset,
|
|
633
641
|
i18n: r
|
|
634
642
|
}
|
|
635
643
|
),
|
|
636
644
|
l?.filters?.render ? l.filters.render() : l?.filters?.onOpen !== void 0 && /* @__PURE__ */ n(
|
|
637
|
-
|
|
645
|
+
xt,
|
|
638
646
|
{
|
|
639
647
|
badges: o.state.query.filters,
|
|
640
|
-
scope:
|
|
648
|
+
scope: g,
|
|
641
649
|
onOpen: l.filters.onOpen,
|
|
642
650
|
i18n: r
|
|
643
651
|
}
|
|
644
652
|
),
|
|
645
653
|
I !== void 0 && S !== void 0 && /* @__PURE__ */ n(
|
|
646
|
-
|
|
654
|
+
Tt,
|
|
647
655
|
{
|
|
648
656
|
badges: o.state.query.filters,
|
|
649
657
|
onRemove: I,
|
|
650
|
-
controls:
|
|
658
|
+
controls: uo,
|
|
651
659
|
i18n: r
|
|
652
660
|
}
|
|
653
661
|
),
|
|
654
662
|
Do && /* @__PURE__ */ n(
|
|
655
|
-
|
|
663
|
+
Ft,
|
|
656
664
|
{
|
|
657
|
-
open:
|
|
665
|
+
open: Me,
|
|
658
666
|
onToggle: () => {
|
|
659
|
-
const e = !
|
|
660
|
-
|
|
667
|
+
const e = !Pe.current;
|
|
668
|
+
Pe.current = e, ko(e), go?.(e);
|
|
661
669
|
},
|
|
662
670
|
i18n: r
|
|
663
671
|
}
|
|
@@ -672,28 +680,28 @@ const Mt = [
|
|
|
672
680
|
// spegnere un pannello suo, che magari scrive la mappa dal proprio
|
|
673
681
|
// riduttore. Trovato da una review delle riparazioni.
|
|
674
682
|
l.columns.render()
|
|
675
|
-
) :
|
|
676
|
-
|
|
683
|
+
) : To ? /* @__PURE__ */ n(
|
|
684
|
+
At,
|
|
677
685
|
{
|
|
678
|
-
columns:
|
|
686
|
+
columns: xo,
|
|
679
687
|
columnVisibility: o.state.view.columnVisibility,
|
|
680
|
-
onColumnVisibleChange:
|
|
681
|
-
onColumnOrderChange:
|
|
688
|
+
onColumnVisibleChange: Fo,
|
|
689
|
+
onColumnOrderChange: Ao,
|
|
682
690
|
columnOrder: o.state.view.columnOrder,
|
|
683
|
-
puoNascondere:
|
|
691
|
+
puoNascondere: Re,
|
|
684
692
|
rootRef: V,
|
|
685
693
|
i18n: r
|
|
686
694
|
}
|
|
687
695
|
) : null),
|
|
688
|
-
|
|
696
|
+
we.length > 0 && !mo && /* @__PURE__ */ n(ht, { actions: we, i18n: r, rootRef: V }),
|
|
689
697
|
l?.actions?.render?.() ?? null,
|
|
690
|
-
|
|
698
|
+
be(
|
|
691
699
|
l?.fullscreen,
|
|
692
700
|
/* @__PURE__ */ n(
|
|
693
|
-
|
|
701
|
+
vt,
|
|
694
702
|
{
|
|
695
703
|
fullscreen: d,
|
|
696
|
-
onChange:
|
|
704
|
+
onChange: Ce,
|
|
697
705
|
i18n: r
|
|
698
706
|
}
|
|
699
707
|
)
|
|
@@ -703,57 +711,57 @@ const Mt = [
|
|
|
703
711
|
}
|
|
704
712
|
),
|
|
705
713
|
/* @__PURE__ */ n(
|
|
706
|
-
|
|
714
|
+
Rt,
|
|
707
715
|
{
|
|
708
716
|
selectedRowIds: o.selectedPageRowIds,
|
|
709
717
|
rowsInPage: o.rows.length,
|
|
710
|
-
formatCount:
|
|
718
|
+
formatCount: g.formatCount,
|
|
711
719
|
density: x,
|
|
712
720
|
cells: o.selectionCells,
|
|
713
721
|
labelColumnId: o.footerCells.find((e) => e.content === null)?.columnId,
|
|
714
|
-
actions:
|
|
722
|
+
actions: U?.actions,
|
|
715
723
|
scope: Qo,
|
|
716
724
|
promotion: ze && y !== void 0 ? {
|
|
717
725
|
total: y,
|
|
718
|
-
onPromote: () =>
|
|
719
|
-
onDemote: () =>
|
|
726
|
+
onPromote: () => Ve("all"),
|
|
727
|
+
onDemote: () => Ve("page")
|
|
720
728
|
} : void 0,
|
|
721
729
|
allRowsSelected: o.allRowsSelected,
|
|
722
730
|
onDismiss: () => o.toggleRows(o.selectedPageRowIds, !1),
|
|
723
|
-
summary:
|
|
731
|
+
summary: U?.summary?.render,
|
|
724
732
|
i18n: r
|
|
725
733
|
}
|
|
726
734
|
),
|
|
727
735
|
/* @__PURE__ */ n(
|
|
728
|
-
|
|
736
|
+
bt,
|
|
729
737
|
{
|
|
730
|
-
ref:
|
|
731
|
-
className:
|
|
738
|
+
ref: O,
|
|
739
|
+
className: le(
|
|
732
740
|
d && "min-h-0 flex-1",
|
|
733
|
-
!d && !
|
|
741
|
+
!d && !Se && "min-h-0 grow"
|
|
734
742
|
),
|
|
735
|
-
style:
|
|
743
|
+
style: Se && !d ? { height: fe } : void 0,
|
|
736
744
|
children: /* @__PURE__ */ n(
|
|
737
|
-
|
|
745
|
+
St,
|
|
738
746
|
{
|
|
739
747
|
headers: o.headers,
|
|
740
748
|
bodyRows: et,
|
|
741
749
|
statusSurface: tt,
|
|
742
750
|
footerCells: o.footerCells,
|
|
743
751
|
hasAggregates: o.hasAggregates,
|
|
744
|
-
bodyHasData:
|
|
745
|
-
onToggleGroup:
|
|
752
|
+
bodyHasData: Ge,
|
|
753
|
+
onToggleGroup: Go,
|
|
746
754
|
groupByColumnIds: o.groupByColumnIds,
|
|
747
|
-
virtualWindow:
|
|
755
|
+
virtualWindow: ie,
|
|
748
756
|
totalRowCount: Yo,
|
|
749
757
|
columnTree: o.columnTree,
|
|
750
|
-
onColumnResize:
|
|
758
|
+
onColumnResize: Oo,
|
|
751
759
|
density: x,
|
|
752
760
|
fullscreen: d,
|
|
753
761
|
i18n: r,
|
|
754
762
|
columnWidths: o.state.view.columnWidths,
|
|
755
763
|
skeletonRowCount: ot,
|
|
756
|
-
checkable:
|
|
764
|
+
checkable: wo,
|
|
757
765
|
selection: o.selection,
|
|
758
766
|
allRowsSelected: o.allRowsSelected,
|
|
759
767
|
someRowsSelected: o.someRowsSelected,
|
|
@@ -762,21 +770,21 @@ const Mt = [
|
|
|
762
770
|
onToggleRows: o.toggleRows,
|
|
763
771
|
onSort: o.sort,
|
|
764
772
|
filteredColumnIds: zo,
|
|
765
|
-
filterMode:
|
|
766
|
-
filterColumns:
|
|
773
|
+
filterMode: me,
|
|
774
|
+
filterColumns: Vo ? Y : [],
|
|
767
775
|
filterBadges: o.state.query.filters,
|
|
768
|
-
filtersHidden: !
|
|
769
|
-
onFilterRowOperatorChange:
|
|
770
|
-
onFilterRowValueChange:
|
|
771
|
-
onFilterRowClear: Bo ?
|
|
776
|
+
filtersHidden: !Me,
|
|
777
|
+
onFilterRowOperatorChange: Lo,
|
|
778
|
+
onFilterRowValueChange: No,
|
|
779
|
+
onFilterRowClear: Bo ? ee : void 0,
|
|
772
780
|
rowHeaderColumnId: o.rowHeaderColumnId,
|
|
773
|
-
bypassIds:
|
|
781
|
+
bypassIds: se
|
|
774
782
|
}
|
|
775
783
|
)
|
|
776
784
|
}
|
|
777
785
|
),
|
|
778
|
-
|
|
779
|
-
|
|
786
|
+
Ge && (F || K?.pageSize !== void 0 && Z === void 0) && /* @__PURE__ */ n(
|
|
787
|
+
Ct,
|
|
780
788
|
{
|
|
781
789
|
pageIndex: o.state.query.pagination.pageIndex,
|
|
782
790
|
pageCount: o.pageCount,
|
|
@@ -786,18 +794,18 @@ const Mt = [
|
|
|
786
794
|
// sapere, quindi emette. Esattamente una volta.
|
|
787
795
|
o.applyAndEmit({ type: "query/page", pageIndex: e })
|
|
788
796
|
),
|
|
789
|
-
navigable: F || q !== void 0 ||
|
|
797
|
+
navigable: F || q !== void 0 || he !== void 0,
|
|
790
798
|
scope: Wo,
|
|
791
799
|
pageSize: J,
|
|
792
|
-
pageSizeOptions:
|
|
800
|
+
pageSizeOptions: K?.pageSizeOptions ?? gt,
|
|
793
801
|
applyAndEmit: o.applyAndEmit
|
|
794
802
|
}
|
|
795
803
|
),
|
|
796
804
|
/* @__PURE__ */ n(
|
|
797
|
-
|
|
805
|
+
Mt,
|
|
798
806
|
{
|
|
799
|
-
visible: !!(
|
|
800
|
-
children:
|
|
807
|
+
visible: !!(po && !p && !B && !ne),
|
|
808
|
+
children: p ? z.loadingMore : B ? (
|
|
801
809
|
// ⚠️ IL RAMO DELL'ERRORE STA PRIMA DI QUELLO DEL VUOTO — Fase 5,
|
|
802
810
|
// criterio 4. Una fetch caduta ha `dataRowCount === 0`, quindi nel
|
|
803
811
|
// ternario cadrebbe nel ramo del vuoto e chi ascolta sentirebbe
|
|
@@ -809,8 +817,8 @@ const Mt = [
|
|
|
809
817
|
// screen reader leggerebbe due volte, una nella tabella e una in
|
|
810
818
|
// questa regione. Il fallback è PER FOGLIA perché la chiave è
|
|
811
819
|
// opzionale nel tipo.
|
|
812
|
-
|
|
813
|
-
) :
|
|
820
|
+
M.errorMessage ?? s.table.errorMessage
|
|
821
|
+
) : ne ? (
|
|
814
822
|
// ⚠️ SEMPRE `i18n.notFoundMessage`, MAI `emptyComponent`.
|
|
815
823
|
// `emptyComponent` è un `ReactNode` arbitrario — un'illustrazione,
|
|
816
824
|
// un bottone, un frammento — e una live region annuncia TESTO:
|
|
@@ -849,7 +857,7 @@ const Mt = [
|
|
|
849
857
|
// dentro, per la ragione già scritta per `appendingPage`: fuori
|
|
850
858
|
// dalla modalità infinita non esiste nessuna «pagina in più» da
|
|
851
859
|
// annunciare.
|
|
852
|
-
|
|
860
|
+
qo ? z.loadedMore : (
|
|
853
861
|
// IL RAMO DI RIPOSO, che fino alla Fase 5 era la stringa
|
|
854
862
|
// vuota: qui vivono le quattro clausole. Sta in FONDO al
|
|
855
863
|
// ternario di proposito — i tre rami sopra restano intatti,
|
|
@@ -869,7 +877,7 @@ const Mt = [
|
|
|
869
877
|
tabIndex: 0,
|
|
870
878
|
"aria-hidden": "true",
|
|
871
879
|
className: "sr-only",
|
|
872
|
-
onFocus: () =>
|
|
880
|
+
onFocus: () => Ae("first")
|
|
873
881
|
}
|
|
874
882
|
)
|
|
875
883
|
]
|
|
@@ -877,5 +885,5 @@ const Mt = [
|
|
|
877
885
|
);
|
|
878
886
|
};
|
|
879
887
|
export {
|
|
880
|
-
|
|
888
|
+
nr as AppDataGrid
|
|
881
889
|
};
|