laif-ds 0.2.41 → 0.2.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.
- package/dist/_virtual/index6.js +2 -2
- package/dist/_virtual/index7.js +2 -2
- package/dist/components/ui/tables/data-table/components/data-table-actions.js +30 -22
- package/dist/components/ui/tables/data-table/components/data-table-advanced-filter.js +92 -89
- package/dist/components/ui/tables/data-table/components/data-table-body.js +256 -190
- package/dist/components/ui/tables/data-table/components/data-table-column-visibility.js +38 -38
- package/dist/components/ui/tables/data-table/components/data-table-filters.js +3 -3
- package/dist/components/ui/tables/data-table/components/data-table-searchbar.js +4 -1
- package/dist/components/ui/tables/data-table/components/data-table-sorting.js +30 -30
- package/dist/components/ui/tables/data-table/data-table.js +308 -292
- package/dist/components/ui/tables/data-table/data-table.service.js +11 -9
- package/dist/components/ui/tables/data-table/data-table.utils.js +302 -0
- package/dist/index.d.ts +387 -1
- package/dist/index.js +191 -164
- package/dist/node_modules/eventemitter3/index2.js +1 -1
- package/dist/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/styles.v3.css +1 -1
- package/package.json +1 -1
|
@@ -1,274 +1,326 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as n, jsxs as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { flexRender as
|
|
5
|
-
import { useRef as
|
|
6
|
-
import { Button as
|
|
7
|
-
import { Icon as
|
|
8
|
-
import { Popover as
|
|
9
|
-
import { ScrollArea as
|
|
10
|
-
import { Skeleton as
|
|
11
|
-
import { Table as
|
|
12
|
-
function
|
|
2
|
+
import { jsx as n, jsxs as i } from "react/jsx-runtime";
|
|
3
|
+
import { cn as u } from "../../../../../lib/utils.js";
|
|
4
|
+
import { flexRender as B } from "../../../../../node_modules/@tanstack/react-table/build/lib/index.js";
|
|
5
|
+
import { useRef as Z, useState as E, useMemo as T, useLayoutEffect as ee, useEffect as L } from "react";
|
|
6
|
+
import { Button as S } from "../../../button.js";
|
|
7
|
+
import { Icon as z } from "../../../icon.js";
|
|
8
|
+
import { Popover as te, PopoverTrigger as oe, PopoverContent as ne } from "../../../popover.js";
|
|
9
|
+
import { ScrollArea as re, ScrollBar as q } from "../../../scroll-area.js";
|
|
10
|
+
import { Skeleton as F } from "../../../skeleton.js";
|
|
11
|
+
import { Table as se, TableHeader as le, TableRow as y, TableHead as ce, TableBody as ie, TableCell as R } from "../../../table.js";
|
|
12
|
+
function xe({
|
|
13
13
|
table: s,
|
|
14
|
-
tableContainerRef:
|
|
15
|
-
loading:
|
|
16
|
-
data:
|
|
17
|
-
emptyComponent:
|
|
18
|
-
notFoundMessage:
|
|
19
|
-
onAddFilter:
|
|
20
|
-
maxSortedColumns:
|
|
21
|
-
i18n:
|
|
14
|
+
tableContainerRef: d,
|
|
15
|
+
loading: v,
|
|
16
|
+
data: W,
|
|
17
|
+
emptyComponent: U,
|
|
18
|
+
notFoundMessage: M,
|
|
19
|
+
onAddFilter: V,
|
|
20
|
+
maxSortedColumns: h = 3,
|
|
21
|
+
i18n: w,
|
|
22
|
+
isServerSide: A = !1,
|
|
23
|
+
filterBadges: X = [],
|
|
24
|
+
advancedFilterBadge: D,
|
|
25
|
+
searchbarGlobalFilter: J
|
|
22
26
|
}) {
|
|
23
|
-
const
|
|
24
|
-
(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
const K = (o) => {
|
|
28
|
+
if (X.some((l) => l.columnId === o)) return !0;
|
|
29
|
+
const t = (l) => l.some((c) => c.columnId === o), r = (l) => l ? l.some((c) => t(c.conditions) ? !0 : c.groups ? r(c.groups) : !1) : !1;
|
|
30
|
+
if (D?.rootGroup) {
|
|
31
|
+
if (t(D.rootGroup.conditions))
|
|
32
|
+
return !0;
|
|
33
|
+
if (D.rootGroup.groups)
|
|
34
|
+
return r(D.rootGroup.groups);
|
|
35
|
+
}
|
|
36
|
+
return !1;
|
|
37
|
+
}, I = Z({}), [Q, Y] = E({}), [H, $] = E(8), O = s.getHeaderGroups()[0], G = O ? O.headers : [], x = T(
|
|
38
|
+
() => G.filter((o) => o.column.getIsVisible()),
|
|
39
|
+
[G]
|
|
40
|
+
), P = T(
|
|
41
|
+
() => x.filter((o) => o.column.columnDef.meta?.pinned === "left"),
|
|
42
|
+
[x]
|
|
43
|
+
), _ = T(
|
|
44
|
+
() => x.filter((o) => o.column.columnDef.meta?.pinned === "right"),
|
|
45
|
+
[x]
|
|
46
|
+
), j = () => {
|
|
47
|
+
const o = d.current;
|
|
48
|
+
if (!o) return 8;
|
|
49
|
+
const e = o.querySelector("thead tr"), t = o.querySelector("tbody tr"), r = e?.getBoundingClientRect().height ?? 40, l = t?.getBoundingClientRect().height ?? 32.5, N = o.offsetHeight - r, a = Math.floor(N / l);
|
|
50
|
+
return a > 1 ? a : 8;
|
|
51
|
+
}, b = (o = 0) => {
|
|
38
52
|
const e = {};
|
|
39
|
-
let
|
|
40
|
-
if (!
|
|
41
|
-
|
|
53
|
+
let t = !1;
|
|
54
|
+
if (!d.current) {
|
|
55
|
+
o < 5 && setTimeout(() => b(o + 1), 100);
|
|
42
56
|
return;
|
|
43
57
|
}
|
|
44
|
-
const r =
|
|
58
|
+
const r = d.current.querySelector(
|
|
45
59
|
"tbody tr:first-child"
|
|
46
60
|
);
|
|
47
|
-
let
|
|
48
|
-
for (const
|
|
49
|
-
const
|
|
50
|
-
e[
|
|
51
|
-
let
|
|
52
|
-
const
|
|
53
|
-
`[data-column-id="${
|
|
54
|
-
),
|
|
55
|
-
|
|
61
|
+
let l = 0;
|
|
62
|
+
for (const a of P) {
|
|
63
|
+
const f = a.column.id;
|
|
64
|
+
e[f] = { side: "left", offset: l };
|
|
65
|
+
let m = 0;
|
|
66
|
+
const g = r?.querySelector(
|
|
67
|
+
`[data-column-id="${f}"]`
|
|
68
|
+
), p = I.current[f];
|
|
69
|
+
g && g.offsetWidth > 0 ? m = g.getBoundingClientRect().width : p && p.offsetWidth > 0 ? m = p.getBoundingClientRect().width : (t = !0, m = 150), l += m;
|
|
56
70
|
}
|
|
57
|
-
let
|
|
58
|
-
for (const
|
|
59
|
-
const
|
|
60
|
-
e[
|
|
61
|
-
let
|
|
62
|
-
const
|
|
63
|
-
`[data-column-id="${
|
|
64
|
-
),
|
|
65
|
-
|
|
71
|
+
let c = 0;
|
|
72
|
+
for (const a of [..._].reverse()) {
|
|
73
|
+
const f = a.column.id;
|
|
74
|
+
e[f] = { side: "right", offset: c };
|
|
75
|
+
let m = 0;
|
|
76
|
+
const g = r?.querySelector(
|
|
77
|
+
`[data-column-id="${f}"]`
|
|
78
|
+
), p = I.current[f];
|
|
79
|
+
g && g.offsetWidth > 0 ? m = g.getBoundingClientRect().width : p && p.offsetWidth > 0 ? m = p.getBoundingClientRect().width : (t = !0, m = 150), c += m;
|
|
66
80
|
}
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
() =>
|
|
71
|
-
100 * (
|
|
81
|
+
Y(e);
|
|
82
|
+
const N = j();
|
|
83
|
+
$(N), t && o < 5 && setTimeout(
|
|
84
|
+
() => b(o + 1),
|
|
85
|
+
100 * (o + 1)
|
|
72
86
|
);
|
|
73
87
|
};
|
|
74
|
-
|
|
88
|
+
ee(() => {
|
|
75
89
|
(() => {
|
|
76
90
|
requestAnimationFrame(() => {
|
|
77
91
|
requestAnimationFrame(() => {
|
|
78
92
|
setTimeout(() => {
|
|
79
|
-
|
|
93
|
+
b();
|
|
80
94
|
}, 50);
|
|
81
95
|
});
|
|
82
96
|
});
|
|
83
97
|
})();
|
|
84
98
|
}, [
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
99
|
+
P,
|
|
100
|
+
_,
|
|
101
|
+
x.map((o) => o.id).join("|"),
|
|
102
|
+
v,
|
|
103
|
+
W,
|
|
90
104
|
s.getState().pagination
|
|
91
|
-
]),
|
|
92
|
-
const
|
|
93
|
-
clearTimeout(
|
|
105
|
+
]), L(() => {
|
|
106
|
+
const o = () => {
|
|
107
|
+
clearTimeout(o.timeout), o.timeout = setTimeout(() => b(), 100);
|
|
94
108
|
};
|
|
95
|
-
window.addEventListener("resize",
|
|
96
|
-
const e =
|
|
97
|
-
let
|
|
98
|
-
return e && typeof ResizeObserver < "u" && (
|
|
99
|
-
|
|
100
|
-
}),
|
|
101
|
-
window.removeEventListener("resize",
|
|
109
|
+
window.addEventListener("resize", o);
|
|
110
|
+
const e = d.current;
|
|
111
|
+
let t = null;
|
|
112
|
+
return e && typeof ResizeObserver < "u" && (t = new ResizeObserver(() => {
|
|
113
|
+
b();
|
|
114
|
+
}), t.observe(e)), () => {
|
|
115
|
+
window.removeEventListener("resize", o), clearTimeout(o.timeout), t && t.disconnect();
|
|
102
116
|
};
|
|
103
|
-
}, []),
|
|
104
|
-
if (
|
|
105
|
-
const
|
|
106
|
-
const r =
|
|
107
|
-
|
|
117
|
+
}, []), L(() => {
|
|
118
|
+
if (v) {
|
|
119
|
+
const o = () => {
|
|
120
|
+
const r = j();
|
|
121
|
+
$(r);
|
|
108
122
|
};
|
|
109
|
-
|
|
110
|
-
const e =
|
|
111
|
-
let
|
|
112
|
-
return e && typeof ResizeObserver < "u" && (
|
|
113
|
-
|
|
114
|
-
}),
|
|
115
|
-
|
|
123
|
+
o();
|
|
124
|
+
const e = d.current;
|
|
125
|
+
let t = null;
|
|
126
|
+
return e && typeof ResizeObserver < "u" && (t = new ResizeObserver(() => {
|
|
127
|
+
o();
|
|
128
|
+
}), t.observe(e)), () => {
|
|
129
|
+
t && t.disconnect();
|
|
116
130
|
};
|
|
117
131
|
}
|
|
118
|
-
}, [
|
|
119
|
-
const
|
|
120
|
-
const r =
|
|
132
|
+
}, [v, d]);
|
|
133
|
+
const k = (o, e, t) => {
|
|
134
|
+
const r = Q[o];
|
|
121
135
|
if (!r || !e || r.side !== e) return;
|
|
122
|
-
const
|
|
136
|
+
const l = r.side === "left" ? `${r.offset}px` : void 0, c = r.side === "right" ? `${r.offset}px` : void 0;
|
|
123
137
|
return {
|
|
124
138
|
position: "sticky",
|
|
125
|
-
left:
|
|
126
|
-
right:
|
|
127
|
-
zIndex:
|
|
139
|
+
left: l,
|
|
140
|
+
right: c,
|
|
141
|
+
zIndex: t ? 49 : 48,
|
|
128
142
|
background: "var(--d-background)",
|
|
129
143
|
// Use separate shadow for pinned columns to avoid conflicts
|
|
130
|
-
boxShadow: e === "left" ? `inset -1px ${
|
|
144
|
+
boxShadow: e === "left" ? `inset -1px ${t ? "0" : "-1px"} 0 var(--d-border), 2px 0 4px -2px rgba(0,0,0,0.1)` : `inset 1px ${t ? "0" : "-1px"} 0 var(--d-border), -2px 0 4px -2px rgba(0,0,0,0.1)`
|
|
131
145
|
};
|
|
132
146
|
};
|
|
133
147
|
return /* @__PURE__ */ n(
|
|
134
148
|
"div",
|
|
135
149
|
{
|
|
136
150
|
className: "flex max-h-full min-h-0 max-w-full min-w-0 flex-1",
|
|
137
|
-
ref:
|
|
138
|
-
children: /* @__PURE__ */
|
|
139
|
-
/* @__PURE__ */ n(
|
|
140
|
-
/* @__PURE__ */ n(
|
|
141
|
-
/* @__PURE__ */
|
|
142
|
-
/* @__PURE__ */ n(
|
|
143
|
-
|
|
151
|
+
ref: d,
|
|
152
|
+
children: /* @__PURE__ */ i(re, { className: "border-d-border h-full min-h-0 w-full rounded-md border", children: [
|
|
153
|
+
/* @__PURE__ */ n(q, { orientation: "horizontal" }),
|
|
154
|
+
/* @__PURE__ */ n(q, { orientation: "vertical" }),
|
|
155
|
+
/* @__PURE__ */ i(se, { className: "w-full", style: { minWidth: "max-content" }, children: [
|
|
156
|
+
/* @__PURE__ */ n(le, { children: s.getHeaderGroups().map((o) => /* @__PURE__ */ n(y, { children: o.headers.map((e) => /* @__PURE__ */ n(
|
|
157
|
+
ce,
|
|
144
158
|
{
|
|
145
|
-
ref: (
|
|
146
|
-
|
|
159
|
+
ref: (t) => {
|
|
160
|
+
I.current[e.column.id] = t;
|
|
147
161
|
},
|
|
148
|
-
className:
|
|
162
|
+
className: u(
|
|
149
163
|
"bg-d-background sticky top-0 h-8 px-0",
|
|
150
164
|
e.column.columnDef.meta?.pinned ? "z-[49]" : "z-10"
|
|
151
165
|
),
|
|
152
|
-
style:
|
|
166
|
+
style: k(
|
|
153
167
|
e.column.id,
|
|
154
168
|
e.column.columnDef.meta?.pinned,
|
|
155
169
|
!0
|
|
156
170
|
),
|
|
157
|
-
children: e.isPlaceholder ? null : /* @__PURE__ */
|
|
171
|
+
children: e.isPlaceholder ? null : /* @__PURE__ */ i(te, { children: [
|
|
158
172
|
/* @__PURE__ */ n(
|
|
159
|
-
|
|
173
|
+
oe,
|
|
160
174
|
{
|
|
161
175
|
asChild: !0,
|
|
162
|
-
onClick: (
|
|
163
|
-
e.column.columnDef.meta?.sortable || e.column.columnDef.meta?.filterable || (
|
|
176
|
+
onClick: (t) => {
|
|
177
|
+
e.column.columnDef.meta?.sortable || e.column.columnDef.meta?.filterable || (t.preventDefault(), t.stopPropagation());
|
|
164
178
|
},
|
|
165
|
-
children: /* @__PURE__ */
|
|
179
|
+
children: /* @__PURE__ */ i(
|
|
166
180
|
"div",
|
|
167
181
|
{
|
|
168
|
-
className:
|
|
182
|
+
className: u(
|
|
169
183
|
"flex h-full items-center justify-between gap-2 px-2",
|
|
170
184
|
e.column.columnDef.meta?.sortable || e.column.columnDef.meta?.filterable ? "hover:bg-d-secondary-foreground/10 cursor-pointer" : "cursor-not-allowed"
|
|
171
185
|
),
|
|
172
186
|
children: [
|
|
173
|
-
|
|
187
|
+
B(
|
|
174
188
|
e.column.columnDef.header,
|
|
175
189
|
e.getContext()
|
|
176
190
|
),
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
191
|
+
/* @__PURE__ */ i("div", { className: "flex flex-row items-center gap-1", children: [
|
|
192
|
+
e.column.columnDef.meta?.searchable && /* @__PURE__ */ n(
|
|
193
|
+
z,
|
|
194
|
+
{
|
|
195
|
+
name: "Search",
|
|
196
|
+
className: u(
|
|
197
|
+
"text-d-foreground/30 max-h-3.5 max-w-3.5",
|
|
198
|
+
!!J && "text-d-primary"
|
|
199
|
+
)
|
|
186
200
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
onClick: (o) => {
|
|
197
|
-
e.column.toggleSorting(!0, !0), o.stopPropagation(), o.preventDefault();
|
|
201
|
+
),
|
|
202
|
+
e.column.columnDef.meta?.filterable && /* @__PURE__ */ n(
|
|
203
|
+
z,
|
|
204
|
+
{
|
|
205
|
+
name: "Filter",
|
|
206
|
+
className: u(
|
|
207
|
+
"text-d-foreground/30 max-h-3.5 max-w-3.5",
|
|
208
|
+
K(e.column.id) && "text-d-primary"
|
|
209
|
+
)
|
|
198
210
|
}
|
|
199
|
-
|
|
200
|
-
|
|
211
|
+
),
|
|
212
|
+
e.column.columnDef.meta?.sortable && /* @__PURE__ */ i("div", { className: "flex flex-col py-1", children: [
|
|
213
|
+
/* @__PURE__ */ n(
|
|
214
|
+
S,
|
|
215
|
+
{
|
|
216
|
+
iconLeft: "ChevronUp",
|
|
217
|
+
size: "icon",
|
|
218
|
+
className: u(
|
|
219
|
+
"hover:bg-d-foreground/10 max-h-4 max-w-6",
|
|
220
|
+
e.column.getIsSorted() === "asc" && "hover:text-d-destructive hover:bg-d-destructive/20"
|
|
221
|
+
),
|
|
222
|
+
variant: e.column.getIsSorted() === "asc" ? "ghost-accent" : "ghost",
|
|
223
|
+
onClick: (t) => {
|
|
224
|
+
e.column.getIsSorted() === "asc" ? e.column.clearSorting() : e.column.toggleSorting(
|
|
225
|
+
!1,
|
|
226
|
+
!0
|
|
227
|
+
), t.stopPropagation(), t.preventDefault();
|
|
228
|
+
},
|
|
229
|
+
disabled: s.getState().sorting.length >= h && !e.column.getIsSorted()
|
|
230
|
+
}
|
|
231
|
+
),
|
|
232
|
+
/* @__PURE__ */ n(
|
|
233
|
+
S,
|
|
234
|
+
{
|
|
235
|
+
iconLeft: "ChevronDown",
|
|
236
|
+
size: "icon",
|
|
237
|
+
className: u(
|
|
238
|
+
"hover:bg-d-foreground/10 max-h-4 max-w-6",
|
|
239
|
+
e.column.getIsSorted() === "desc" && "hover:text-d-destructive hover:bg-d-destructive/20"
|
|
240
|
+
),
|
|
241
|
+
variant: e.column.getIsSorted() === "desc" ? "ghost-accent" : "ghost",
|
|
242
|
+
onClick: (t) => {
|
|
243
|
+
e.column.getIsSorted() === "desc" ? e.column.clearSorting() : e.column.toggleSorting(
|
|
244
|
+
!0,
|
|
245
|
+
!0
|
|
246
|
+
), t.stopPropagation(), t.preventDefault();
|
|
247
|
+
},
|
|
248
|
+
disabled: s.getState().sorting.length >= h && !e.column.getIsSorted()
|
|
249
|
+
}
|
|
250
|
+
)
|
|
251
|
+
] })
|
|
252
|
+
] })
|
|
201
253
|
]
|
|
202
254
|
}
|
|
203
255
|
)
|
|
204
256
|
}
|
|
205
257
|
),
|
|
206
|
-
/* @__PURE__ */ n(
|
|
207
|
-
e.column.columnDef.meta?.sortable && /* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ n(ne, { className: "w-40 p-0", children: /* @__PURE__ */ i("div", { className: "flex flex-col text-sm", children: [
|
|
259
|
+
e.column.columnDef.meta?.sortable && /* @__PURE__ */ i(
|
|
208
260
|
"div",
|
|
209
261
|
{
|
|
210
|
-
className:
|
|
262
|
+
className: u(
|
|
211
263
|
"group hover:bg-d-secondary-foreground/5 relative flex cursor-pointer items-center justify-between rounded px-2 py-1.5",
|
|
212
264
|
e.column.getIsSorted() && "bg-d-secondary-foreground/5",
|
|
213
|
-
s.getState().sorting.length >=
|
|
265
|
+
s.getState().sorting.length >= h && !e.column.getIsSorted() && "pointer-events-none cursor-not-allowed opacity-60"
|
|
214
266
|
),
|
|
215
|
-
"aria-disabled": s.getState().sorting.length >=
|
|
267
|
+
"aria-disabled": s.getState().sorting.length >= h && !e.column.getIsSorted(),
|
|
216
268
|
children: [
|
|
217
|
-
/* @__PURE__ */ n("span", { className: "text-md", children:
|
|
218
|
-
/* @__PURE__ */ n(
|
|
219
|
-
/* @__PURE__ */
|
|
269
|
+
/* @__PURE__ */ n("span", { className: "text-md", children: w.sorting.sort }),
|
|
270
|
+
/* @__PURE__ */ n(z, { name: "ChevronRight", size: "xs" }),
|
|
271
|
+
/* @__PURE__ */ i("div", { className: "bg-d-background border-d-border absolute top-0 left-full ml-0 hidden w-48 flex-col rounded-md border p-1 shadow-md group-hover:flex", children: [
|
|
220
272
|
/* @__PURE__ */ n(
|
|
221
|
-
|
|
273
|
+
S,
|
|
222
274
|
{
|
|
223
275
|
className: "justify-start",
|
|
224
276
|
variant: "ghost",
|
|
225
277
|
size: "sm",
|
|
226
278
|
iconLeft: e.column.columnDef.meta?.type === "number" ? "ArrowDown01" : e.column.columnDef.meta?.type === "string" ? "ArrowDownAz" : "ArrowDownNarrowWide",
|
|
227
279
|
onClick: () => {
|
|
228
|
-
!e.column.getIsSorted() && s.getState().sorting.length >=
|
|
280
|
+
!e.column.getIsSorted() && s.getState().sorting.length >= h || e.column.toggleSorting(
|
|
229
281
|
!1,
|
|
230
282
|
!0
|
|
231
283
|
);
|
|
232
284
|
},
|
|
233
|
-
children:
|
|
285
|
+
children: w.sorting.ascending
|
|
234
286
|
}
|
|
235
287
|
),
|
|
236
288
|
/* @__PURE__ */ n(
|
|
237
|
-
|
|
289
|
+
S,
|
|
238
290
|
{
|
|
239
291
|
className: "justify-start",
|
|
240
292
|
variant: "ghost",
|
|
241
293
|
size: "sm",
|
|
242
294
|
iconLeft: e.column.columnDef.meta?.type === "number" ? "ArrowUp01" : e.column.columnDef.meta?.type === "string" ? "ArrowUpAz" : "ArrowUpNarrowWide",
|
|
243
295
|
onClick: () => {
|
|
244
|
-
!e.column.getIsSorted() && s.getState().sorting.length >=
|
|
296
|
+
!e.column.getIsSorted() && s.getState().sorting.length >= h || e.column.toggleSorting(!0, !0);
|
|
245
297
|
},
|
|
246
|
-
children:
|
|
298
|
+
children: w.sorting.descending
|
|
247
299
|
}
|
|
248
300
|
),
|
|
249
301
|
e.column.getIsSorted() && /* @__PURE__ */ n(
|
|
250
|
-
|
|
302
|
+
S,
|
|
251
303
|
{
|
|
252
304
|
className: "text-d-destructive/80 hover:text-d-destructive justify-start",
|
|
253
305
|
variant: "ghost",
|
|
254
306
|
size: "sm",
|
|
255
307
|
iconLeft: "CircleX",
|
|
256
308
|
onClick: () => e.column.clearSorting(),
|
|
257
|
-
children:
|
|
309
|
+
children: w.sorting.clearSort
|
|
258
310
|
}
|
|
259
311
|
)
|
|
260
312
|
] })
|
|
261
313
|
]
|
|
262
314
|
}
|
|
263
315
|
),
|
|
264
|
-
e.column.columnDef.meta?.filterable && /* @__PURE__ */
|
|
316
|
+
e.column.columnDef.meta?.filterable && /* @__PURE__ */ i(
|
|
265
317
|
"div",
|
|
266
318
|
{
|
|
267
319
|
className: "hover:bg-d-secondary-foreground/5 relative flex cursor-pointer items-center justify-between rounded px-2 py-1.5",
|
|
268
|
-
onClick: () =>
|
|
320
|
+
onClick: () => V(e),
|
|
269
321
|
children: [
|
|
270
|
-
/* @__PURE__ */ n("span", { className: "text-md", children:
|
|
271
|
-
/* @__PURE__ */ n(
|
|
322
|
+
/* @__PURE__ */ n("span", { className: "text-md", children: w.filters.filter }),
|
|
323
|
+
/* @__PURE__ */ n(z, { name: "Filter", size: "xs" })
|
|
272
324
|
]
|
|
273
325
|
}
|
|
274
326
|
)
|
|
@@ -276,44 +328,58 @@ function ge({
|
|
|
276
328
|
] })
|
|
277
329
|
},
|
|
278
330
|
e.id
|
|
279
|
-
)) },
|
|
280
|
-
/* @__PURE__ */ n(
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
331
|
+
)) }, o.id)) }),
|
|
332
|
+
/* @__PURE__ */ n(ie, { children: v && A ? Array.from({ length: H }).map((o, e) => /* @__PURE__ */ n(y, { children: s.getHeaderGroups()[0].headers.map((t, r) => /* @__PURE__ */ n(
|
|
333
|
+
R,
|
|
334
|
+
{
|
|
335
|
+
"data-column-id": t.column.id,
|
|
336
|
+
className: u(
|
|
337
|
+
"border-0",
|
|
338
|
+
t.column.columnDef.meta?.pinned && "bg-d-background z-[50]"
|
|
339
|
+
),
|
|
340
|
+
style: k(
|
|
341
|
+
t.column.id,
|
|
342
|
+
t.column.columnDef.meta?.pinned,
|
|
343
|
+
!1
|
|
344
|
+
),
|
|
345
|
+
children: /* @__PURE__ */ n(F, { className: "h-6 w-full" })
|
|
346
|
+
},
|
|
347
|
+
`skeleton-cell-${e}-${r}`
|
|
348
|
+
)) }, `skeleton-row-${e}`)) : v && !A ? Array.from({ length: H }).map((o, e) => /* @__PURE__ */ n(y, { children: s.getHeaderGroups()[0].headers.map((t, r) => /* @__PURE__ */ n(
|
|
349
|
+
R,
|
|
350
|
+
{
|
|
351
|
+
"data-column-id": t.column.id,
|
|
352
|
+
className: u(
|
|
353
|
+
"border-0",
|
|
354
|
+
t.column.columnDef.meta?.pinned && "bg-d-background z-[50]"
|
|
355
|
+
),
|
|
356
|
+
style: k(
|
|
357
|
+
t.column.id,
|
|
358
|
+
t.column.columnDef.meta?.pinned,
|
|
359
|
+
!1
|
|
360
|
+
),
|
|
361
|
+
children: /* @__PURE__ */ n(F, { className: "h-6 w-full" })
|
|
362
|
+
},
|
|
363
|
+
`skeleton-cell-${e}-${r}`
|
|
364
|
+
)) }, `skeleton-row-${e}`)) : s.getRowModel().rows?.length ? s.getRowModel().rows.map((o) => /* @__PURE__ */ n(
|
|
365
|
+
y,
|
|
300
366
|
{
|
|
301
|
-
"data-state":
|
|
367
|
+
"data-state": o.getIsSelected() && "selected",
|
|
302
368
|
className: "border-0 shadow-[inset_0_-1px_0_var(--d-border)]",
|
|
303
|
-
children:
|
|
304
|
-
|
|
369
|
+
children: o.getVisibleCells().map((e) => /* @__PURE__ */ n(
|
|
370
|
+
R,
|
|
305
371
|
{
|
|
306
372
|
"data-column-id": e.column.id,
|
|
307
|
-
className:
|
|
373
|
+
className: u(
|
|
308
374
|
"border-0",
|
|
309
375
|
e.column.columnDef.meta?.pinned ? "bg-d-background z-[50]" : "shadow-[inset_-1px_0_0_var(--d-border)]"
|
|
310
376
|
),
|
|
311
|
-
style:
|
|
377
|
+
style: k(
|
|
312
378
|
e.column.id,
|
|
313
379
|
e.column.columnDef.meta?.pinned,
|
|
314
380
|
!1
|
|
315
381
|
),
|
|
316
|
-
children:
|
|
382
|
+
children: B(
|
|
317
383
|
e.column.columnDef.cell,
|
|
318
384
|
e.getContext()
|
|
319
385
|
)
|
|
@@ -321,13 +387,13 @@ function ge({
|
|
|
321
387
|
e.id
|
|
322
388
|
))
|
|
323
389
|
},
|
|
324
|
-
|
|
325
|
-
)) : /* @__PURE__ */ n(
|
|
326
|
-
|
|
390
|
+
o.id
|
|
391
|
+
)) : /* @__PURE__ */ n(y, { children: /* @__PURE__ */ n(
|
|
392
|
+
R,
|
|
327
393
|
{
|
|
328
394
|
colSpan: s?.getHeaderGroups()?.[0]?.headers?.length ?? 1,
|
|
329
395
|
className: "pt-4 text-center",
|
|
330
|
-
children:
|
|
396
|
+
children: U || M
|
|
331
397
|
}
|
|
332
398
|
) }) })
|
|
333
399
|
] })
|
|
@@ -336,5 +402,5 @@ function ge({
|
|
|
336
402
|
);
|
|
337
403
|
}
|
|
338
404
|
export {
|
|
339
|
-
|
|
405
|
+
xe as DataTableBody
|
|
340
406
|
};
|