laif-ds 0.1.96 → 0.1.97
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/_virtual/index2.js +2 -5
- package/dist/_virtual/index3.js +5 -2
- package/dist/_virtual/index4.js +5 -5
- package/dist/_virtual/index5.js +4 -4
- package/dist/_virtual/index6.js +2 -2
- package/dist/_virtual/index7.js +2 -2
- package/dist/components/ui/data-table.js +166 -154
- package/dist/index.d.ts +1 -0
- package/dist/node_modules/eventemitter3/index.js +1 -1
- package/dist/node_modules/eventemitter3/index2.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/style-to-object/cjs/index.js +1 -1
- package/dist/node_modules/unified/lib/index.js +1 -1
- package/dist/node_modules/use-sync-external-store/shim/index.js +1 -1
- package/package.json +1 -1
package/dist/_virtual/index2.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import { __require as t } from "../node_modules/eventemitter3/index2.js";
|
|
4
|
-
var r = t();
|
|
5
|
-
const m = /* @__PURE__ */ e(r);
|
|
2
|
+
var e = { exports: {} };
|
|
6
3
|
export {
|
|
7
|
-
|
|
4
|
+
e as __module
|
|
8
5
|
};
|
package/dist/_virtual/index3.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
2
|
+
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
|
|
3
|
+
import { __require as e } from "../node_modules/style-to-js/cjs/index.js";
|
|
4
|
+
var t = e();
|
|
5
|
+
const a = /* @__PURE__ */ r(t);
|
|
3
6
|
export {
|
|
4
|
-
|
|
7
|
+
a as default
|
|
5
8
|
};
|
package/dist/_virtual/index4.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { getDefaultExportFromCjs as
|
|
3
|
-
import { __require as
|
|
4
|
-
var t =
|
|
5
|
-
const
|
|
2
|
+
import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
|
|
3
|
+
import { __require as r } from "../node_modules/extend/index.js";
|
|
4
|
+
var t = r();
|
|
5
|
+
const x = /* @__PURE__ */ e(t);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
x as default
|
|
8
8
|
};
|
package/dist/_virtual/index5.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
|
|
3
|
-
import { __require as
|
|
4
|
-
var
|
|
5
|
-
const
|
|
3
|
+
import { __require as t } from "../node_modules/eventemitter3/index2.js";
|
|
4
|
+
var r = t();
|
|
5
|
+
const m = /* @__PURE__ */ e(r);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
m as default
|
|
8
8
|
};
|
package/dist/_virtual/index6.js
CHANGED
package/dist/_virtual/index7.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as n, jsxs as h } from "react/jsx-runtime";
|
|
3
|
-
import { useReactTable as ce, flexRender as
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { createCustomFilterFns as
|
|
7
|
-
import { Pagination as pe, PaginationContent as xe, PaginationItem as
|
|
3
|
+
import { useReactTable as ce, flexRender as G } from "../../node_modules/@tanstack/react-table/build/lib/index.js";
|
|
4
|
+
import { useRef as v, useState as u, useMemo as se, useEffect as z } from "react";
|
|
5
|
+
import { cn as de } from "../../lib/utils.js";
|
|
6
|
+
import { createCustomFilterFns as re, ELogicalFilterOperator as ue, debounce as me, createMultiValueFilterFn as fe, updatePageSizeFromContainer as he } from "./data-table.service.js";
|
|
7
|
+
import { Pagination as pe, PaginationContent as xe, PaginationItem as w, PaginationFirst as be, PaginationPrevious as Ce, PaginationLink as we, PaginationNext as Pe, PaginationLast as Se } from "./pagination.js";
|
|
8
8
|
import { Checkbox as E } from "./checkbox.js";
|
|
9
9
|
import { Input as Ie } from "./input.js";
|
|
10
10
|
import { ScrollArea as W, ScrollBar as F } from "./scroll-area.js";
|
|
11
|
-
import { AppMultipleSelectDropdown as
|
|
12
|
-
import { Table as
|
|
11
|
+
import { AppMultipleSelectDropdown as ze } from "./app-multiple-select-dropdown.js";
|
|
12
|
+
import { Table as Re, TableHeader as Ne, TableRow as R, TableHead as Me, TableBody as ye, TableCell as H } from "./table.js";
|
|
13
13
|
import { Skeleton as ke } from "./skeleton.js";
|
|
14
14
|
import { getPaginationRowModel as Fe, getFilteredRowModel as He, getSortedRowModel as De, getCoreRowModel as Ve } from "../../node_modules/@tanstack/table-core/build/lib/index.js";
|
|
15
15
|
function Ue({
|
|
16
16
|
columns: P,
|
|
17
17
|
data: D,
|
|
18
|
-
loading:
|
|
19
|
-
emptyComponent:
|
|
18
|
+
loading: J = !1,
|
|
19
|
+
emptyComponent: _,
|
|
20
20
|
className: K,
|
|
21
21
|
rowSelection: q = {},
|
|
22
22
|
onRowSelectionChange: V,
|
|
23
23
|
checkable: S = !1,
|
|
24
|
-
onCheckedRowsChange:
|
|
24
|
+
onCheckedRowsChange: N,
|
|
25
25
|
notFoundMessage: Q = "Nessun risultato trovato.",
|
|
26
|
-
searchBar:
|
|
27
|
-
dropdownFilters:
|
|
28
|
-
totalItems:
|
|
26
|
+
searchBar: m = void 0,
|
|
27
|
+
dropdownFilters: r = void 0,
|
|
28
|
+
totalItems: M = void 0,
|
|
29
29
|
datatableSizes: p = {
|
|
30
30
|
rowHeight: 32.5,
|
|
31
31
|
// default table row height in pixels
|
|
@@ -35,13 +35,13 @@ function Ue({
|
|
|
35
35
|
// default container height in pixels
|
|
36
36
|
},
|
|
37
37
|
paginationPlaceholders: x = void 0,
|
|
38
|
-
serverOptions:
|
|
39
|
-
setServerOptions:
|
|
38
|
+
serverOptions: g = void 0,
|
|
39
|
+
setServerOptions: c = void 0
|
|
40
40
|
}) {
|
|
41
|
-
const y =
|
|
41
|
+
const y = v(null), A = v(void 0), [U, X] = u([]), [Y, Z] = u([]), [B, O] = u({}), [C, ee] = u(""), [b, k] = u({
|
|
42
42
|
pageIndex: 0,
|
|
43
43
|
pageSize: 10
|
|
44
|
-
}), [te, j] =
|
|
44
|
+
}), [te, j] = u(0), [ne, ie] = u({}), L = V ? q : ne, ae = V || ie, [I, le] = u({}), s = !!g, oe = se(() => S ? [
|
|
45
45
|
{
|
|
46
46
|
id: "select",
|
|
47
47
|
header: ({ table: e }) => /* @__PURE__ */ n(
|
|
@@ -65,8 +65,8 @@ function Ue({
|
|
|
65
65
|
},
|
|
66
66
|
...P
|
|
67
67
|
] : P, [P, S]).map((e) => {
|
|
68
|
-
const t =
|
|
69
|
-
(
|
|
68
|
+
const t = r?.find(
|
|
69
|
+
(i) => i.column === e?.accessorKey
|
|
70
70
|
);
|
|
71
71
|
return {
|
|
72
72
|
...e,
|
|
@@ -79,33 +79,37 @@ function Ue({
|
|
|
79
79
|
onSortingChange: X,
|
|
80
80
|
getSortedRowModel: De(),
|
|
81
81
|
onColumnVisibilityChange: O,
|
|
82
|
-
onRowSelectionChange:
|
|
82
|
+
onRowSelectionChange: ae,
|
|
83
83
|
getFilteredRowModel: He(),
|
|
84
|
-
globalFilterFn: (e, t,
|
|
85
|
-
const
|
|
86
|
-
return String(
|
|
84
|
+
globalFilterFn: (e, t, i) => s || !i ? !0 : m?.columns.some((o) => {
|
|
85
|
+
const l = e.getValue(o);
|
|
86
|
+
return String(l).toLowerCase().includes(i.toLowerCase());
|
|
87
87
|
}) ?? !1,
|
|
88
88
|
filterFns: {
|
|
89
|
-
multiValue: (e, t,
|
|
89
|
+
multiValue: (e, t, i) => fe(
|
|
90
90
|
e,
|
|
91
91
|
t,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
i,
|
|
93
|
+
r,
|
|
94
|
+
g
|
|
95
95
|
),
|
|
96
|
-
...
|
|
96
|
+
...re(r ?? [], g)
|
|
97
97
|
},
|
|
98
98
|
onPaginationChange: (e) => {
|
|
99
|
-
|
|
99
|
+
s ? typeof e == "object" && c && c?.((t) => ({
|
|
100
100
|
...t,
|
|
101
|
-
pagination: {
|
|
101
|
+
pagination: g.disableAutoPageSize ? {
|
|
102
102
|
...t.pagination,
|
|
103
103
|
pageIndex: e.pageIndex
|
|
104
|
+
} : {
|
|
105
|
+
...t.pagination,
|
|
106
|
+
pageIndex: e.pageIndex,
|
|
107
|
+
pageSize: e.pageSize
|
|
104
108
|
}
|
|
105
109
|
})) : k(e);
|
|
106
110
|
},
|
|
107
111
|
getPaginationRowModel: Fe(),
|
|
108
|
-
manualPagination:
|
|
112
|
+
manualPagination: s,
|
|
109
113
|
pageCount: te,
|
|
110
114
|
state: {
|
|
111
115
|
sorting: U,
|
|
@@ -113,88 +117,96 @@ function Ue({
|
|
|
113
117
|
columnVisibility: B,
|
|
114
118
|
rowSelection: L,
|
|
115
119
|
globalFilter: C,
|
|
116
|
-
pagination:
|
|
120
|
+
pagination: g?.pagination ?? b
|
|
117
121
|
}
|
|
118
|
-
},
|
|
119
|
-
|
|
122
|
+
}, a = ce(ge);
|
|
123
|
+
z(() => {
|
|
120
124
|
let e;
|
|
121
|
-
if (
|
|
125
|
+
if (m && C && (e || (e = {}), e.searchbarFilters = {
|
|
122
126
|
value: C,
|
|
123
|
-
columns:
|
|
124
|
-
}),
|
|
125
|
-
const
|
|
126
|
-
for (const
|
|
127
|
-
const f = I[
|
|
128
|
-
f && f.length > 0 && (
|
|
129
|
-
column:
|
|
127
|
+
columns: m.columns
|
|
128
|
+
}), r && Object.keys(I).length > 0) {
|
|
129
|
+
const l = {};
|
|
130
|
+
for (const d of r) {
|
|
131
|
+
const f = I[d.column];
|
|
132
|
+
f && f.length > 0 && (l[d.column] = {
|
|
133
|
+
column: d.column,
|
|
130
134
|
value: f,
|
|
131
|
-
logic:
|
|
135
|
+
logic: d.innerFiltersMode || ue.OR
|
|
132
136
|
});
|
|
133
137
|
}
|
|
134
|
-
Object.keys(
|
|
138
|
+
Object.keys(l).length > 0 && (e || (e = {}), e.dropdownFilters = l);
|
|
135
139
|
}
|
|
136
|
-
const t =
|
|
137
|
-
JSON.stringify(t ?? {}) !== JSON.stringify(
|
|
138
|
-
...
|
|
140
|
+
const t = A.current, i = e;
|
|
141
|
+
JSON.stringify(t ?? {}) !== JSON.stringify(i ?? {}) && c && (A.current = i, c((l) => ({
|
|
142
|
+
...l,
|
|
139
143
|
pagination: {
|
|
140
144
|
pageIndex: 0,
|
|
141
|
-
pageSize:
|
|
145
|
+
pageSize: g?.pagination.pageSize ?? 10
|
|
142
146
|
},
|
|
143
|
-
filters:
|
|
147
|
+
filters: i
|
|
144
148
|
})));
|
|
145
149
|
}, [
|
|
146
|
-
|
|
150
|
+
r,
|
|
147
151
|
I,
|
|
148
|
-
|
|
152
|
+
m,
|
|
149
153
|
C,
|
|
150
|
-
|
|
151
|
-
|
|
154
|
+
g,
|
|
155
|
+
c
|
|
152
156
|
]);
|
|
153
|
-
const T =
|
|
154
|
-
return
|
|
155
|
-
if (
|
|
157
|
+
const T = a.getFilteredRowModel();
|
|
158
|
+
return z(() => {
|
|
159
|
+
if (s)
|
|
156
160
|
j(
|
|
157
161
|
Math.ceil(
|
|
158
|
-
(
|
|
162
|
+
(M ?? 0) / (g.pagination?.pageSize || b.pageSize || 10)
|
|
159
163
|
)
|
|
160
164
|
);
|
|
161
165
|
else {
|
|
162
166
|
const e = T.rows.length;
|
|
163
|
-
j(Math.ceil(e /
|
|
167
|
+
j(Math.ceil(e / b.pageSize));
|
|
164
168
|
}
|
|
165
169
|
}, [
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
170
|
+
s,
|
|
171
|
+
M,
|
|
172
|
+
g?.pagination.pageSize,
|
|
173
|
+
g?.pagination.pageIndex,
|
|
174
|
+
a,
|
|
171
175
|
T,
|
|
172
|
-
|
|
173
|
-
]),
|
|
174
|
-
const e =
|
|
176
|
+
b.pageSize
|
|
177
|
+
]), z(() => {
|
|
178
|
+
const e = me(() => {
|
|
175
179
|
const t = y.current;
|
|
176
180
|
t && he(t, {
|
|
177
181
|
rowHeight: p.rowHeight,
|
|
178
182
|
headerHeight: p.headerHeight,
|
|
179
183
|
containerHeight: p.containerHeight,
|
|
180
|
-
onPageChange:
|
|
181
|
-
|
|
182
|
-
...
|
|
183
|
-
pagination: {
|
|
184
|
-
...
|
|
185
|
-
pageIndex:
|
|
184
|
+
onPageChange: s ? (i, o) => {
|
|
185
|
+
c?.((l) => ({
|
|
186
|
+
...l,
|
|
187
|
+
pagination: g.disableAutoPageSize ? {
|
|
188
|
+
...l.pagination,
|
|
189
|
+
pageIndex: i
|
|
190
|
+
} : {
|
|
191
|
+
...l.pagination,
|
|
192
|
+
pageIndex: i,
|
|
193
|
+
pageSize: o
|
|
186
194
|
}
|
|
187
195
|
}));
|
|
188
|
-
} : (
|
|
189
|
-
k({ pageIndex:
|
|
196
|
+
} : (i, o) => {
|
|
197
|
+
k({ pageIndex: i, pageSize: o });
|
|
190
198
|
},
|
|
191
|
-
setPagination: (
|
|
192
|
-
const o = typeof
|
|
193
|
-
|
|
194
|
-
...
|
|
195
|
-
pagination: {
|
|
196
|
-
...
|
|
199
|
+
setPagination: (i) => {
|
|
200
|
+
const o = typeof i == "function" ? i({ pageIndex: 0, pageSize: 10 }) : i;
|
|
201
|
+
s ? c?.((l) => ({
|
|
202
|
+
...l,
|
|
203
|
+
pagination: g.disableAutoPageSize ? {
|
|
204
|
+
...l.pagination,
|
|
197
205
|
pageIndex: o.pageIndex
|
|
206
|
+
} : {
|
|
207
|
+
...l.pagination,
|
|
208
|
+
pageIndex: o.pageIndex,
|
|
209
|
+
pageSize: o.pageSize
|
|
198
210
|
}
|
|
199
211
|
})) : k({
|
|
200
212
|
pageIndex: o.pageIndex,
|
|
@@ -207,32 +219,32 @@ function Ue({
|
|
|
207
219
|
window.removeEventListener("resize", e);
|
|
208
220
|
};
|
|
209
221
|
}, [
|
|
210
|
-
|
|
222
|
+
s,
|
|
211
223
|
p.containerHeight,
|
|
212
224
|
p.headerHeight,
|
|
213
225
|
p.rowHeight,
|
|
214
226
|
y,
|
|
215
|
-
|
|
227
|
+
c
|
|
216
228
|
// should be stable, but include for clarity
|
|
217
|
-
]),
|
|
218
|
-
if (
|
|
219
|
-
const e =
|
|
220
|
-
|
|
229
|
+
]), z(() => {
|
|
230
|
+
if (N && S) {
|
|
231
|
+
const e = a.getFilteredSelectedRowModel().rows.map((t) => t.original);
|
|
232
|
+
N(e);
|
|
221
233
|
}
|
|
222
|
-
}, [
|
|
234
|
+
}, [a, N, S, L]), /* @__PURE__ */ h(
|
|
223
235
|
"div",
|
|
224
236
|
{
|
|
225
|
-
className:
|
|
237
|
+
className: de(
|
|
226
238
|
"flex h-full max-h-full min-h-0 w-full max-w-full flex-col gap-2",
|
|
227
239
|
K
|
|
228
240
|
),
|
|
229
241
|
children: [
|
|
230
|
-
(
|
|
231
|
-
|
|
242
|
+
(m || r?.length) && /* @__PURE__ */ h("div", { className: "flex flex-col items-start justify-between gap-2 sm:flex-row sm:items-end", children: [
|
|
243
|
+
m && /* @__PURE__ */ n(
|
|
232
244
|
Ie,
|
|
233
245
|
{
|
|
234
246
|
iconLeft: "Search",
|
|
235
|
-
placeholder:
|
|
247
|
+
placeholder: m.placeholder ?? "Cerca...",
|
|
236
248
|
value: C,
|
|
237
249
|
onChange: (e) => {
|
|
238
250
|
ee(e.target.value);
|
|
@@ -240,28 +252,28 @@ function Ue({
|
|
|
240
252
|
className: "w-60"
|
|
241
253
|
}
|
|
242
254
|
),
|
|
243
|
-
/* @__PURE__ */ n("div", { className: "flex h-full max-w-full min-w-0 flex-1 items-center", children:
|
|
255
|
+
/* @__PURE__ */ n("div", { className: "flex h-full max-w-full min-w-0 flex-1 items-center", children: r && r.length > 0 && /* @__PURE__ */ h(W, { className: "h-full w-full", children: [
|
|
244
256
|
/* @__PURE__ */ n(F, { orientation: "horizontal" }),
|
|
245
|
-
/* @__PURE__ */ n("div", { className: "flex w-full max-w-full min-w-0 items-center justify-start gap-2 p-0.5 sm:justify-end", children:
|
|
246
|
-
const
|
|
257
|
+
/* @__PURE__ */ n("div", { className: "flex w-full max-w-full min-w-0 items-center justify-start gap-2 p-0.5 sm:justify-end", children: r.map((e, t) => {
|
|
258
|
+
const i = I[e.column] ?? [];
|
|
247
259
|
return /* @__PURE__ */ n(
|
|
248
|
-
|
|
260
|
+
ze,
|
|
249
261
|
{
|
|
250
262
|
className: "w-60",
|
|
251
263
|
options: e.items,
|
|
252
|
-
value:
|
|
264
|
+
value: i,
|
|
253
265
|
placeholder: e.placeholder,
|
|
254
266
|
label: e.label,
|
|
255
267
|
onChange: (o) => {
|
|
256
|
-
|
|
257
|
-
...
|
|
268
|
+
le((l) => ({
|
|
269
|
+
...l,
|
|
258
270
|
[e.column]: o
|
|
259
|
-
})), Z((
|
|
260
|
-
const
|
|
271
|
+
})), Z((l) => {
|
|
272
|
+
const d = l.filter(
|
|
261
273
|
(f) => f.id !== e.column
|
|
262
274
|
);
|
|
263
|
-
return o.length === 0 ?
|
|
264
|
-
...
|
|
275
|
+
return o.length === 0 ? d : [
|
|
276
|
+
...d,
|
|
265
277
|
{ id: e.column, value: o }
|
|
266
278
|
];
|
|
267
279
|
});
|
|
@@ -280,34 +292,34 @@ function Ue({
|
|
|
280
292
|
children: /* @__PURE__ */ h(W, { className: "border-d-border h-full min-h-0 w-full rounded-md border", children: [
|
|
281
293
|
/* @__PURE__ */ n(F, { orientation: "horizontal" }),
|
|
282
294
|
/* @__PURE__ */ n(F, { orientation: "vertical" }),
|
|
283
|
-
/* @__PURE__ */ h(
|
|
284
|
-
/* @__PURE__ */ n(
|
|
285
|
-
|
|
295
|
+
/* @__PURE__ */ h(Re, { children: [
|
|
296
|
+
/* @__PURE__ */ n(Ne, { children: a.getHeaderGroups().map((e) => /* @__PURE__ */ n(R, { children: e.headers.map((t) => /* @__PURE__ */ n(
|
|
297
|
+
Me,
|
|
286
298
|
{
|
|
287
299
|
className: `bg-d-secondary sticky top-0 z-10 ${t.column.columnDef.sticky ? "left-0" : ""}`,
|
|
288
|
-
children: t.isPlaceholder ? null :
|
|
300
|
+
children: t.isPlaceholder ? null : G(
|
|
289
301
|
t.column.columnDef.header,
|
|
290
302
|
t.getContext()
|
|
291
303
|
)
|
|
292
304
|
},
|
|
293
305
|
t.id
|
|
294
306
|
)) }, e.id)) }),
|
|
295
|
-
/* @__PURE__ */ n(ye, { children:
|
|
307
|
+
/* @__PURE__ */ n(ye, { children: J ? Array.from({ length: D.length || 8 }).map((e, t) => /* @__PURE__ */ n(R, { children: a.getHeaderGroups()[0].headers.map((i, o) => /* @__PURE__ */ n(
|
|
296
308
|
H,
|
|
297
309
|
{
|
|
298
|
-
className: `w-full ${
|
|
310
|
+
className: `w-full ${i.column.columnDef.sticky ? "bg-d-background sticky left-0 z-10" : ""}`,
|
|
299
311
|
children: /* @__PURE__ */ n(ke, { className: "h-6 w-full" })
|
|
300
312
|
},
|
|
301
313
|
`skeleton-cell-${t}-${o}`
|
|
302
|
-
)) }, `skeleton-row-${t}`)) :
|
|
303
|
-
|
|
314
|
+
)) }, `skeleton-row-${t}`)) : a.getRowModel().rows?.length ? a.getRowModel().rows.map((e) => /* @__PURE__ */ n(
|
|
315
|
+
R,
|
|
304
316
|
{
|
|
305
317
|
"data-state": e.getIsSelected() && "selected",
|
|
306
318
|
children: e.getVisibleCells().map((t) => /* @__PURE__ */ n(
|
|
307
319
|
H,
|
|
308
320
|
{
|
|
309
321
|
className: `${t.column.columnDef.sticky ? "bg-d-background sticky left-0 z-10" : ""}`,
|
|
310
|
-
children:
|
|
322
|
+
children: G(
|
|
311
323
|
t.column.columnDef.cell,
|
|
312
324
|
t.getContext()
|
|
313
325
|
)
|
|
@@ -316,12 +328,12 @@ function Ue({
|
|
|
316
328
|
))
|
|
317
329
|
},
|
|
318
330
|
e.id
|
|
319
|
-
)) : /* @__PURE__ */ n(
|
|
331
|
+
)) : /* @__PURE__ */ n(R, { children: /* @__PURE__ */ n(
|
|
320
332
|
H,
|
|
321
333
|
{
|
|
322
334
|
colSpan: P.length,
|
|
323
335
|
className: "pt-4 text-center",
|
|
324
|
-
children:
|
|
336
|
+
children: _ || Q
|
|
325
337
|
}
|
|
326
338
|
) }) })
|
|
327
339
|
] })
|
|
@@ -330,115 +342,115 @@ function Ue({
|
|
|
330
342
|
),
|
|
331
343
|
/* @__PURE__ */ h(pe, { className: "h-9", children: [
|
|
332
344
|
/* @__PURE__ */ n("div", { className: "flex h-full flex-1 items-center align-middle", children: /* @__PURE__ */ n("div", { className: "text-d-foreground hidden text-sm md:flex", children: Math.min(
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
) + " / " + (
|
|
345
|
+
g?.pagination?.pageSize ?? b.pageSize,
|
|
346
|
+
a.getFilteredRowModel().rows.length ?? 9999
|
|
347
|
+
) + " / " + (g ? M ?? "missing totalItems" : a.getFilteredRowModel().rows.length) + " " + (x?.rows ?? "Righe") }) }),
|
|
336
348
|
/* @__PURE__ */ h(xe, { children: [
|
|
337
|
-
/* @__PURE__ */ n(
|
|
338
|
-
|
|
349
|
+
/* @__PURE__ */ n(w, { children: /* @__PURE__ */ n(
|
|
350
|
+
be,
|
|
339
351
|
{
|
|
340
352
|
size: "sm",
|
|
341
|
-
isDisabled: !
|
|
353
|
+
isDisabled: !a.getCanPreviousPage(),
|
|
342
354
|
label: x?.first,
|
|
343
355
|
onClick: () => {
|
|
344
|
-
|
|
356
|
+
s ? c?.((e) => ({
|
|
345
357
|
...e,
|
|
346
358
|
pagination: {
|
|
347
359
|
...e.pagination,
|
|
348
360
|
pageIndex: 0
|
|
349
361
|
}
|
|
350
|
-
})) :
|
|
362
|
+
})) : a.setPageIndex(0);
|
|
351
363
|
},
|
|
352
364
|
"aria-label": "Go to first page"
|
|
353
365
|
}
|
|
354
366
|
) }),
|
|
355
|
-
/* @__PURE__ */ n(
|
|
367
|
+
/* @__PURE__ */ n(w, { children: /* @__PURE__ */ n(
|
|
356
368
|
Ce,
|
|
357
369
|
{
|
|
358
370
|
size: "sm",
|
|
359
|
-
isDisabled: !
|
|
371
|
+
isDisabled: !a.getCanPreviousPage(),
|
|
360
372
|
label: x?.previous,
|
|
361
373
|
onClick: () => {
|
|
362
|
-
if (
|
|
363
|
-
if (
|
|
364
|
-
const e =
|
|
365
|
-
|
|
366
|
-
...
|
|
374
|
+
if (a.getCanPreviousPage())
|
|
375
|
+
if (s) {
|
|
376
|
+
const e = g?.pagination.pageIndex ?? b.pageIndex, t = Math.max(e - 1, 0);
|
|
377
|
+
c?.((i) => ({
|
|
378
|
+
...i,
|
|
367
379
|
pagination: {
|
|
368
|
-
...
|
|
380
|
+
...i.pagination,
|
|
369
381
|
pageIndex: t
|
|
370
382
|
}
|
|
371
383
|
}));
|
|
372
384
|
} else
|
|
373
|
-
|
|
385
|
+
a.previousPage();
|
|
374
386
|
}
|
|
375
387
|
}
|
|
376
388
|
) }),
|
|
377
389
|
(() => {
|
|
378
|
-
const e =
|
|
390
|
+
const e = a.getState().pagination.pageIndex, t = a.getPageCount(), i = 5;
|
|
379
391
|
let o = Math.max(
|
|
380
392
|
0,
|
|
381
|
-
e - Math.floor(
|
|
382
|
-
),
|
|
383
|
-
return
|
|
384
|
-
|
|
393
|
+
e - Math.floor(i / 2)
|
|
394
|
+
), l = o + i;
|
|
395
|
+
return l > t && (l = t, o = Math.max(0, l - i)), a.getPageOptions().slice(o, l).map((d, f) => /* @__PURE__ */ n(w, { children: /* @__PURE__ */ n(
|
|
396
|
+
we,
|
|
385
397
|
{
|
|
386
398
|
size: "icon",
|
|
387
|
-
isActive: e ===
|
|
399
|
+
isActive: e === d,
|
|
388
400
|
onClick: () => {
|
|
389
|
-
if (
|
|
390
|
-
if (e ===
|
|
391
|
-
|
|
392
|
-
|
|
401
|
+
if (s) {
|
|
402
|
+
if (e === d) return;
|
|
403
|
+
c?.(($) => ({
|
|
404
|
+
...$,
|
|
393
405
|
pagination: {
|
|
394
|
-
|
|
395
|
-
pageIndex:
|
|
406
|
+
...$.pagination,
|
|
407
|
+
pageIndex: d
|
|
396
408
|
}
|
|
397
409
|
}));
|
|
398
410
|
} else
|
|
399
|
-
|
|
411
|
+
a.setPageIndex(d);
|
|
400
412
|
},
|
|
401
|
-
children:
|
|
413
|
+
children: d + 1
|
|
402
414
|
}
|
|
403
415
|
) }, f));
|
|
404
416
|
})(),
|
|
405
|
-
/* @__PURE__ */ n(
|
|
417
|
+
/* @__PURE__ */ n(w, { children: /* @__PURE__ */ n(
|
|
406
418
|
Pe,
|
|
407
419
|
{
|
|
408
420
|
size: "sm",
|
|
409
|
-
isDisabled: !
|
|
421
|
+
isDisabled: !a.getCanNextPage(),
|
|
410
422
|
label: x?.next,
|
|
411
423
|
onClick: () => {
|
|
412
|
-
|
|
424
|
+
a.getCanNextPage() && (s ? c?.((e) => ({
|
|
413
425
|
...e,
|
|
414
426
|
pagination: {
|
|
415
427
|
...e.pagination,
|
|
416
428
|
pageIndex: e.pagination.pageIndex + 1
|
|
417
429
|
}
|
|
418
|
-
})) :
|
|
430
|
+
})) : a.nextPage());
|
|
419
431
|
}
|
|
420
432
|
}
|
|
421
433
|
) }),
|
|
422
|
-
/* @__PURE__ */ n(
|
|
434
|
+
/* @__PURE__ */ n(w, { children: /* @__PURE__ */ n(
|
|
423
435
|
Se,
|
|
424
436
|
{
|
|
425
437
|
size: "sm",
|
|
426
|
-
isDisabled: !
|
|
438
|
+
isDisabled: !a.getCanNextPage(),
|
|
427
439
|
label: x?.last,
|
|
428
440
|
onClick: () => {
|
|
429
|
-
|
|
441
|
+
s ? c?.((e) => ({
|
|
430
442
|
...e,
|
|
431
443
|
pagination: {
|
|
432
444
|
...e.pagination,
|
|
433
|
-
pageIndex:
|
|
445
|
+
pageIndex: a.getPageCount() - 1
|
|
434
446
|
}
|
|
435
|
-
})) :
|
|
447
|
+
})) : a.setPageIndex(a.getPageCount() - 1);
|
|
436
448
|
},
|
|
437
449
|
"aria-label": "Go to last page"
|
|
438
450
|
}
|
|
439
451
|
) })
|
|
440
452
|
] }),
|
|
441
|
-
/* @__PURE__ */ n("div", { className: "flex h-full flex-1 items-center justify-end align-middle", children: /* @__PURE__ */ n("div", { className: "text-d-foreground hidden text-sm md:flex", children: (
|
|
453
|
+
/* @__PURE__ */ n("div", { className: "flex h-full flex-1 items-center justify-end align-middle", children: /* @__PURE__ */ n("div", { className: "text-d-foreground hidden text-sm md:flex", children: (a.getPageCount() ? a.getState().pagination.pageIndex + 1 : 0) + " / " + a.getPageCount() + " " + (x?.pages ?? "Pagine") }) })
|
|
442
454
|
] })
|
|
443
455
|
]
|
|
444
456
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1059,6 +1059,7 @@ export declare interface IServerFilterProps {
|
|
|
1059
1059
|
export declare interface IServerOptionsProps {
|
|
1060
1060
|
pagination: IPaginationProps;
|
|
1061
1061
|
filters?: IServerFilterProps;
|
|
1062
|
+
disableAutoPageSize?: boolean;
|
|
1062
1063
|
}
|
|
1063
1064
|
|
|
1064
1065
|
export declare function Label({ className, ...props }: React_2.ComponentProps<typeof LabelPrimitive.Root>): JSX.Element;
|
|
@@ -3,7 +3,7 @@ import { stringify as w } from "../../comma-separated-tokens/index.js";
|
|
|
3
3
|
import { ok as u } from "../../devlop/lib/default.js";
|
|
4
4
|
import { svg as m, html as C } from "../../property-information/index.js";
|
|
5
5
|
import { stringify as N } from "../../space-separated-tokens/index.js";
|
|
6
|
-
import S from "../../../_virtual/
|
|
6
|
+
import S from "../../../_virtual/index3.js";
|
|
7
7
|
import { whitespace as j } from "../../hast-util-whitespace/lib/index.js";
|
|
8
8
|
import { name as x } from "../../estree-util-is-identifier-name/lib/index.js";
|
|
9
9
|
import { VFileMessage as h } from "../../vfile-message/lib/index.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { bail as P } from "../../bail/index.js";
|
|
3
|
-
import y from "../../../_virtual/
|
|
3
|
+
import y from "../../../_virtual/index4.js";
|
|
4
4
|
import z from "../../is-plain-obj/index.js";
|
|
5
5
|
import { CallableInstance as C } from "./callable-instance.js";
|
|
6
6
|
import { trough as A } from "../../trough/lib/index.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { __module as e } from "../../../_virtual/
|
|
2
|
+
import { __module as e } from "../../../_virtual/index2.js";
|
|
3
3
|
import { __require as i } from "../cjs/use-sync-external-store-shim.production.js";
|
|
4
4
|
import { __require as o } from "../cjs/use-sync-external-store-shim.development.js";
|
|
5
5
|
var r;
|