@yuno-payments/dashboard-design-system 0.0.133 → 0.0.136
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/components/atoms/filter-dropdown/filter-dropdown.js +75 -72
- package/dist/components/organisms/data-table/data-table.d.ts +6 -1
- package/dist/components/organisms/data-table/data-table.js +73 -72
- package/dist/components/organisms/data-table/data-table.types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { j as t } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import { forwardRef as j, useState as
|
|
3
|
-
import { Button as
|
|
4
|
-
import { Separator as
|
|
5
|
-
import { Badge as
|
|
2
|
+
import { forwardRef as j, useState as I, useRef as _, useCallback as K, useEffect as X } from "react";
|
|
3
|
+
import { Button as E } from "../../../vendor/shadcn/button.js";
|
|
4
|
+
import { Separator as S } from "../../../vendor/shadcn/separator.js";
|
|
5
|
+
import { Badge as k } from "../../../vendor/shadcn/badge.js";
|
|
6
6
|
import { Icon as b } from "../icon/icon.js";
|
|
7
|
-
import { FilterSection as
|
|
7
|
+
import { FilterSection as M } from "../filter/filter.js";
|
|
8
8
|
import { FilterDateRange as Y, FilterDateRangeValue as g } from "../filter/filter-date-range.js";
|
|
9
9
|
import { cn as d } from "../../../lib/utils.js";
|
|
10
|
-
const
|
|
11
|
-
({ icon:
|
|
10
|
+
const A = j(
|
|
11
|
+
({ icon: r, label: u, isActive: l = !1, showChevron: m = !1, className: h, ...o }, C) => /* @__PURE__ */ t.jsxs(
|
|
12
12
|
"button",
|
|
13
13
|
{
|
|
14
14
|
ref: C,
|
|
@@ -17,15 +17,15 @@ const M = j(
|
|
|
17
17
|
"hover:bg-secondary",
|
|
18
18
|
h
|
|
19
19
|
),
|
|
20
|
-
...
|
|
20
|
+
...o,
|
|
21
21
|
children: [
|
|
22
|
-
|
|
22
|
+
r && /* @__PURE__ */ t.jsx(
|
|
23
23
|
b,
|
|
24
24
|
{
|
|
25
|
-
name:
|
|
25
|
+
name: r,
|
|
26
26
|
className: d(
|
|
27
27
|
"size-4 shrink-0",
|
|
28
|
-
|
|
28
|
+
l ? "text-primary" : "text-foreground"
|
|
29
29
|
)
|
|
30
30
|
}
|
|
31
31
|
),
|
|
@@ -34,18 +34,18 @@ const M = j(
|
|
|
34
34
|
{
|
|
35
35
|
className: d(
|
|
36
36
|
"flex-1 text-sm font-normal text-left truncate",
|
|
37
|
-
|
|
37
|
+
l ? "font-medium text-primary" : "text-foreground"
|
|
38
38
|
),
|
|
39
39
|
children: u
|
|
40
40
|
}
|
|
41
41
|
),
|
|
42
|
-
(
|
|
42
|
+
(l || m) && /* @__PURE__ */ t.jsx(
|
|
43
43
|
b,
|
|
44
44
|
{
|
|
45
45
|
name: "CaretRight",
|
|
46
46
|
className: d(
|
|
47
47
|
"size-4 shrink-0",
|
|
48
|
-
|
|
48
|
+
l ? "text-primary" : "text-foreground"
|
|
49
49
|
)
|
|
50
50
|
}
|
|
51
51
|
)
|
|
@@ -53,9 +53,9 @@ const M = j(
|
|
|
53
53
|
}
|
|
54
54
|
)
|
|
55
55
|
);
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
({ items:
|
|
56
|
+
A.displayName = "FilterMenuItem";
|
|
57
|
+
const V = j(
|
|
58
|
+
({ items: r, activeItemId: u, onItemClick: l, className: m }, h) => /* @__PURE__ */ t.jsx(
|
|
59
59
|
"div",
|
|
60
60
|
{
|
|
61
61
|
ref: h,
|
|
@@ -63,35 +63,35 @@ const A = j(
|
|
|
63
63
|
"flex flex-col gap-2 w-64 h-full p-2 bg-surface border border-border rounded-md",
|
|
64
64
|
m
|
|
65
65
|
),
|
|
66
|
-
children:
|
|
67
|
-
|
|
66
|
+
children: r.map((o) => /* @__PURE__ */ t.jsx(
|
|
67
|
+
A,
|
|
68
68
|
{
|
|
69
|
-
icon:
|
|
70
|
-
label:
|
|
71
|
-
isActive: u ===
|
|
72
|
-
showChevron:
|
|
73
|
-
onClick: () =>
|
|
69
|
+
icon: o.icon,
|
|
70
|
+
label: o.label,
|
|
71
|
+
isActive: u === o.id,
|
|
72
|
+
showChevron: o.showChevron,
|
|
73
|
+
onClick: () => l?.(o.id)
|
|
74
74
|
},
|
|
75
|
-
|
|
75
|
+
o.id
|
|
76
76
|
))
|
|
77
77
|
}
|
|
78
78
|
)
|
|
79
79
|
);
|
|
80
|
-
|
|
80
|
+
V.displayName = "FilterMenu";
|
|
81
81
|
const $ = j(
|
|
82
82
|
({
|
|
83
|
-
filters:
|
|
83
|
+
filters: r,
|
|
84
84
|
buttonText: u = "Add filter",
|
|
85
|
-
appliedFilters:
|
|
85
|
+
appliedFilters: l = [],
|
|
86
86
|
onRemoveFilter: m,
|
|
87
87
|
onClearAllFilters: h,
|
|
88
|
-
maxVisibleTags:
|
|
88
|
+
maxVisibleTags: o = 4,
|
|
89
89
|
className: C,
|
|
90
|
-
disabled:
|
|
90
|
+
disabled: O = !1
|
|
91
91
|
}, x) => {
|
|
92
|
-
const [f, p] =
|
|
93
|
-
|
|
94
|
-
), w = _(null),
|
|
92
|
+
const [f, p] = I(!1), [v, N] = I(
|
|
93
|
+
r.length > 0 && r[0]?.id || ""
|
|
94
|
+
), w = _(null), R = K(
|
|
95
95
|
(n) => {
|
|
96
96
|
w.current = n, typeof x == "function" ? x(n) : x && (x.current = n);
|
|
97
97
|
},
|
|
@@ -99,45 +99,48 @@ const $ = j(
|
|
|
99
99
|
);
|
|
100
100
|
X(() => {
|
|
101
101
|
if (!f) return;
|
|
102
|
-
const n = (
|
|
103
|
-
const c =
|
|
102
|
+
const n = (s) => {
|
|
103
|
+
const c = s.target;
|
|
104
104
|
w.current?.contains(c) || c.closest?.(
|
|
105
105
|
"[data-radix-popper-content-wrapper], [data-radix-portal]"
|
|
106
106
|
) || c.closest?.(
|
|
107
107
|
".rdp, .rdp-root, [data-calendar]"
|
|
108
108
|
) || p(!1);
|
|
109
|
-
}, a = (
|
|
110
|
-
|
|
111
|
-
},
|
|
109
|
+
}, a = (s) => {
|
|
110
|
+
s.key === "Escape" && p(!1);
|
|
111
|
+
}, i = setTimeout(() => {
|
|
112
112
|
document.addEventListener("mousedown", n), document.addEventListener("keydown", a);
|
|
113
113
|
}, 0);
|
|
114
114
|
return () => {
|
|
115
|
-
clearTimeout(
|
|
115
|
+
clearTimeout(i), document.removeEventListener("mousedown", n), document.removeEventListener("keydown", a);
|
|
116
116
|
};
|
|
117
117
|
}, [f]);
|
|
118
|
-
const
|
|
119
|
-
if (
|
|
120
|
-
const
|
|
121
|
-
if (
|
|
122
|
-
const
|
|
123
|
-
if (
|
|
118
|
+
const z = l.length > 0, L = l.slice(0, o), y = l.length - o, T = (n) => {
|
|
119
|
+
if (r.find((s) => s.id === n)) return n;
|
|
120
|
+
const i = n.split("-");
|
|
121
|
+
if (i.length > 1) {
|
|
122
|
+
const s = i[0];
|
|
123
|
+
if (r.find((F) => F.id === s)) return s;
|
|
124
124
|
}
|
|
125
125
|
return n;
|
|
126
|
+
}, D = (n) => {
|
|
127
|
+
const a = T(n);
|
|
128
|
+
return r.find((s) => s.id === a)?.clearable !== !1;
|
|
126
129
|
}, P = (n) => {
|
|
127
|
-
const a =
|
|
130
|
+
const a = T(n);
|
|
128
131
|
N(a), p(!0);
|
|
129
|
-
}, B =
|
|
130
|
-
(n) =>
|
|
131
|
-
), U =
|
|
132
|
+
}, B = l.some(
|
|
133
|
+
(n) => D(n.id)
|
|
134
|
+
), U = r.map((n) => ({
|
|
132
135
|
id: n.id,
|
|
133
136
|
icon: n.icon,
|
|
134
137
|
label: n.label
|
|
135
|
-
})), e =
|
|
138
|
+
})), e = r.find((n) => n.id === v), H = () => {
|
|
136
139
|
if (!e) return null;
|
|
137
140
|
switch (e.type) {
|
|
138
141
|
case "checkbox":
|
|
139
142
|
return /* @__PURE__ */ t.jsx(
|
|
140
|
-
|
|
143
|
+
M,
|
|
141
144
|
{
|
|
142
145
|
title: e.label,
|
|
143
146
|
items: e.items || [],
|
|
@@ -154,7 +157,7 @@ const $ = j(
|
|
|
154
157
|
);
|
|
155
158
|
case "radio":
|
|
156
159
|
return /* @__PURE__ */ t.jsx(
|
|
157
|
-
|
|
160
|
+
M,
|
|
158
161
|
{
|
|
159
162
|
type: "radio",
|
|
160
163
|
title: e.label,
|
|
@@ -173,10 +176,10 @@ const $ = j(
|
|
|
173
176
|
case "date": {
|
|
174
177
|
const n = (a) => {
|
|
175
178
|
if (e.onDateValueChange?.(a), a === g.CUSTOM && !e.dateInit && !e.dateEnd) {
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
const c = new Date(
|
|
179
|
-
c.setHours(0, 0, 0, 0), e.onDateInitChange?.(c), e.onDateEndChange?.(
|
|
179
|
+
const i = /* @__PURE__ */ new Date(), s = new Date(i);
|
|
180
|
+
s.setHours(23, 59, 59, 999);
|
|
181
|
+
const c = new Date(i);
|
|
182
|
+
c.setHours(0, 0, 0, 0), e.onDateInitChange?.(c), e.onDateEndChange?.(s), e.startTime || e.onStartTimeChange?.("00:00:00"), e.endTime || e.onEndTimeChange?.("23:59:59");
|
|
180
183
|
}
|
|
181
184
|
};
|
|
182
185
|
return /* @__PURE__ */ t.jsx(
|
|
@@ -211,31 +214,31 @@ const $ = j(
|
|
|
211
214
|
return /* @__PURE__ */ t.jsxs(
|
|
212
215
|
"div",
|
|
213
216
|
{
|
|
214
|
-
ref:
|
|
217
|
+
ref: R,
|
|
215
218
|
className: d("flex flex-col gap-1 relative", C),
|
|
216
219
|
children: [
|
|
217
220
|
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-4", children: [
|
|
218
221
|
/* @__PURE__ */ t.jsxs(
|
|
219
|
-
|
|
222
|
+
E,
|
|
220
223
|
{
|
|
221
224
|
variant: "outline",
|
|
222
225
|
size: "sm",
|
|
223
226
|
className: "h-8 gap-2 px-3 py-2",
|
|
224
227
|
onClick: () => p(!f),
|
|
225
|
-
disabled:
|
|
228
|
+
disabled: O,
|
|
226
229
|
children: [
|
|
227
230
|
/* @__PURE__ */ t.jsx(b, { name: "FunnelSimple", className: "size-4" }),
|
|
228
231
|
/* @__PURE__ */ t.jsx("span", { className: "text-xs font-medium leading-none", children: u })
|
|
229
232
|
]
|
|
230
233
|
}
|
|
231
234
|
),
|
|
232
|
-
|
|
233
|
-
/* @__PURE__ */ t.jsx(
|
|
235
|
+
z ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
236
|
+
/* @__PURE__ */ t.jsx(S, { orientation: "vertical", className: "h-5" }),
|
|
234
237
|
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
235
|
-
|
|
236
|
-
const a =
|
|
238
|
+
L.map((n) => {
|
|
239
|
+
const a = D(n.id);
|
|
237
240
|
return /* @__PURE__ */ t.jsxs(
|
|
238
|
-
|
|
241
|
+
k,
|
|
239
242
|
{
|
|
240
243
|
variant: "secondary",
|
|
241
244
|
className: "h-8 gap-2 px-3 py-2 shadow-xs cursor-pointer",
|
|
@@ -245,8 +248,8 @@ const $ = j(
|
|
|
245
248
|
m && a && /* @__PURE__ */ t.jsx(
|
|
246
249
|
"button",
|
|
247
250
|
{
|
|
248
|
-
onClick: (
|
|
249
|
-
|
|
251
|
+
onClick: (i) => {
|
|
252
|
+
i.stopPropagation(), m(n.id);
|
|
250
253
|
},
|
|
251
254
|
className: "inline-flex items-center justify-center",
|
|
252
255
|
"aria-label": `Remove ${n.label} filter`,
|
|
@@ -258,13 +261,13 @@ const $ = j(
|
|
|
258
261
|
n.id
|
|
259
262
|
);
|
|
260
263
|
}),
|
|
261
|
-
y > 0 && /* @__PURE__ */ t.jsx(
|
|
264
|
+
y > 0 && /* @__PURE__ */ t.jsx(k, { variant: "default", className: "h-8 px-3 py-2 shadow-xs", children: /* @__PURE__ */ t.jsxs("span", { className: "text-xs font-medium leading-none", children: [
|
|
262
265
|
"+",
|
|
263
266
|
y,
|
|
264
267
|
" more"
|
|
265
268
|
] }) }),
|
|
266
269
|
h && B && /* @__PURE__ */ t.jsx(
|
|
267
|
-
|
|
270
|
+
E,
|
|
268
271
|
{
|
|
269
272
|
variant: "ghost",
|
|
270
273
|
size: "sm",
|
|
@@ -275,7 +278,7 @@ const $ = j(
|
|
|
275
278
|
)
|
|
276
279
|
] })
|
|
277
280
|
] }) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
278
|
-
/* @__PURE__ */ t.jsx(
|
|
281
|
+
/* @__PURE__ */ t.jsx(S, { orientation: "vertical", className: "h-5" }),
|
|
279
282
|
/* @__PURE__ */ t.jsx("span", { className: "text-sm font-normal text-muted-foreground", children: "No filters applied" })
|
|
280
283
|
] })
|
|
281
284
|
] }),
|
|
@@ -291,7 +294,7 @@ const $ = j(
|
|
|
291
294
|
),
|
|
292
295
|
children: [
|
|
293
296
|
/* @__PURE__ */ t.jsx(
|
|
294
|
-
|
|
297
|
+
V,
|
|
295
298
|
{
|
|
296
299
|
items: U,
|
|
297
300
|
activeItemId: v,
|
|
@@ -310,6 +313,6 @@ const $ = j(
|
|
|
310
313
|
$.displayName = "FilterDropdown";
|
|
311
314
|
export {
|
|
312
315
|
$ as FilterDropdown,
|
|
313
|
-
|
|
314
|
-
|
|
316
|
+
V as FilterMenu,
|
|
317
|
+
A as FilterMenuItem
|
|
315
318
|
};
|
|
@@ -65,6 +65,11 @@ export interface DataTableProps<TData, TValue> {
|
|
|
65
65
|
* @default 'onChange'
|
|
66
66
|
*/
|
|
67
67
|
columnResizeMode?: ColumnResizeMode;
|
|
68
|
+
/**
|
|
69
|
+
* Whether to enable column pinning
|
|
70
|
+
* @default true
|
|
71
|
+
*/
|
|
72
|
+
enableColumnPinning?: boolean;
|
|
68
73
|
/**
|
|
69
74
|
* Callback fired when a row is clicked
|
|
70
75
|
*/
|
|
@@ -121,4 +126,4 @@ export interface DataTableProps<TData, TValue> {
|
|
|
121
126
|
* />
|
|
122
127
|
* ```
|
|
123
128
|
*/
|
|
124
|
-
export declare function DataTable<TData, TValue>({ columns, data, isLoading, empty, checkboxSelection, onRowSelectionChange, enableSorting, manualSorting, sorting: externalSorting, onSortingChange: externalOnSortingChange, enableColumnFilters, enableColumnResizing, columnResizeMode, onRowClick, actions, height, rowHeight, className, persistKey, initialSettings, onUpdate, }: DataTableProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
|
|
129
|
+
export declare function DataTable<TData, TValue>({ columns, data, isLoading, empty, checkboxSelection, onRowSelectionChange, enableSorting, manualSorting, sorting: externalSorting, onSortingChange: externalOnSortingChange, enableColumnFilters, enableColumnResizing, columnResizeMode, enableColumnPinning, onRowClick, actions, height, rowHeight, className, persistKey, initialSettings, onUpdate, }: DataTableProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,102 +1,103 @@
|
|
|
1
1
|
import { j as o } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import * as
|
|
3
|
-
import { useReactTable as
|
|
4
|
-
import { Table as
|
|
2
|
+
import * as U from "react";
|
|
3
|
+
import { useReactTable as V } from "../../../node_modules/@tanstack/react-table/build/lib/index.js";
|
|
4
|
+
import { Table as q } from "../../../vendor/shadcn/table.js";
|
|
5
5
|
import { cn as u } from "../../../lib/utils.js";
|
|
6
|
-
import { DataTableLoading as
|
|
7
|
-
import { DataTableHeader as
|
|
8
|
-
import { DataTableBody as
|
|
9
|
-
import { useDataTableColumns as
|
|
10
|
-
import { useDataTableState as
|
|
11
|
-
import { ROW_HEIGHT_DEFAULT as
|
|
12
|
-
import { getFilteredRowModel as
|
|
13
|
-
import { Empty as
|
|
14
|
-
function
|
|
6
|
+
import { DataTableLoading as J } from "./components/states/data-table-loading.js";
|
|
7
|
+
import { DataTableHeader as K } from "./components/data-table-header.js";
|
|
8
|
+
import { DataTableBody as Q } from "./components/data-table-body.js";
|
|
9
|
+
import { useDataTableColumns as X } from "./hooks/use-data-table-columns.js";
|
|
10
|
+
import { useDataTableState as Y } from "./hooks/use-data-table-state.js";
|
|
11
|
+
import { ROW_HEIGHT_DEFAULT as Z } from "./utils/data-table-constants.js";
|
|
12
|
+
import { getFilteredRowModel as $, getSortedRowModel as k, getCoreRowModel as z } from "../../../node_modules/@tanstack/table-core/build/lib/index.js";
|
|
13
|
+
import { Empty as O } from "../../molecules/empty/empty.js";
|
|
14
|
+
function ge({
|
|
15
15
|
columns: a,
|
|
16
16
|
data: s,
|
|
17
17
|
isLoading: p = !1,
|
|
18
18
|
empty: C,
|
|
19
19
|
checkboxSelection: m = !1,
|
|
20
|
-
onRowSelectionChange:
|
|
21
|
-
enableSorting:
|
|
22
|
-
manualSorting:
|
|
20
|
+
onRowSelectionChange: i,
|
|
21
|
+
enableSorting: h = !0,
|
|
22
|
+
manualSorting: b = !1,
|
|
23
23
|
sorting: x,
|
|
24
24
|
onSortingChange: w,
|
|
25
25
|
enableColumnFilters: y = !1,
|
|
26
|
-
enableColumnResizing:
|
|
26
|
+
enableColumnResizing: n = !0,
|
|
27
27
|
columnResizeMode: S = "onChange",
|
|
28
|
-
|
|
28
|
+
enableColumnPinning: T = !0,
|
|
29
|
+
onRowClick: j,
|
|
29
30
|
actions: r,
|
|
30
|
-
height:
|
|
31
|
-
rowHeight: d =
|
|
32
|
-
className:
|
|
33
|
-
persistKey:
|
|
34
|
-
initialSettings:
|
|
35
|
-
onUpdate:
|
|
31
|
+
height: R,
|
|
32
|
+
rowHeight: d = Z,
|
|
33
|
+
className: D,
|
|
34
|
+
persistKey: F,
|
|
35
|
+
initialSettings: M,
|
|
36
|
+
onUpdate: E
|
|
36
37
|
}) {
|
|
37
|
-
const
|
|
38
|
+
const N = X({
|
|
38
39
|
columns: a,
|
|
39
40
|
checkboxSelection: m,
|
|
40
41
|
actions: r
|
|
41
42
|
}), {
|
|
42
43
|
sorting: f,
|
|
43
44
|
setSorting: g,
|
|
44
|
-
columnFilters:
|
|
45
|
-
setColumnFilters:
|
|
46
|
-
columnVisibility:
|
|
47
|
-
setColumnVisibility:
|
|
45
|
+
columnFilters: v,
|
|
46
|
+
setColumnFilters: P,
|
|
47
|
+
columnVisibility: A,
|
|
48
|
+
setColumnVisibility: H,
|
|
48
49
|
rowSelection: c,
|
|
49
|
-
setRowSelection:
|
|
50
|
-
columnPinning:
|
|
51
|
-
handleColumnPinningChange:
|
|
52
|
-
} =
|
|
53
|
-
persistKey:
|
|
50
|
+
setRowSelection: L,
|
|
51
|
+
columnPinning: W,
|
|
52
|
+
handleColumnPinningChange: _
|
|
53
|
+
} = Y({
|
|
54
|
+
persistKey: F,
|
|
54
55
|
hasActions: !!r,
|
|
55
56
|
externalSorting: x,
|
|
56
57
|
onExternalSortingChange: w,
|
|
57
|
-
initialSettings:
|
|
58
|
-
onUpdate:
|
|
59
|
-
}), t =
|
|
58
|
+
initialSettings: M,
|
|
59
|
+
onUpdate: E
|
|
60
|
+
}), t = V({
|
|
60
61
|
data: s,
|
|
61
|
-
columns:
|
|
62
|
-
getCoreRowModel:
|
|
63
|
-
enableColumnResizing:
|
|
62
|
+
columns: N,
|
|
63
|
+
getCoreRowModel: z(),
|
|
64
|
+
enableColumnResizing: n,
|
|
64
65
|
columnResizeMode: S,
|
|
65
|
-
enableColumnPinning:
|
|
66
|
+
enableColumnPinning: T,
|
|
66
67
|
defaultColumn: {
|
|
67
68
|
enableSorting: !1,
|
|
68
69
|
minSize: 50
|
|
69
70
|
},
|
|
70
|
-
...
|
|
71
|
+
...h && {
|
|
71
72
|
onSortingChange: (e) => {
|
|
72
73
|
g(typeof e == "function" ? e(f) : e);
|
|
73
74
|
},
|
|
74
|
-
getSortedRowModel:
|
|
75
|
-
manualSorting:
|
|
75
|
+
getSortedRowModel: k(),
|
|
76
|
+
manualSorting: b
|
|
76
77
|
},
|
|
77
78
|
...y && {
|
|
78
|
-
onColumnFiltersChange:
|
|
79
|
-
getFilteredRowModel:
|
|
79
|
+
onColumnFiltersChange: P,
|
|
80
|
+
getFilteredRowModel: $()
|
|
80
81
|
},
|
|
81
|
-
onColumnVisibilityChange:
|
|
82
|
-
onRowSelectionChange:
|
|
83
|
-
onColumnPinningChange:
|
|
82
|
+
onColumnVisibilityChange: H,
|
|
83
|
+
onRowSelectionChange: L,
|
|
84
|
+
onColumnPinningChange: _,
|
|
84
85
|
state: {
|
|
85
86
|
sorting: f,
|
|
86
|
-
columnFilters:
|
|
87
|
-
columnVisibility:
|
|
87
|
+
columnFilters: v,
|
|
88
|
+
columnVisibility: A,
|
|
88
89
|
rowSelection: c,
|
|
89
|
-
columnPinning:
|
|
90
|
+
columnPinning: W
|
|
90
91
|
}
|
|
91
92
|
});
|
|
92
|
-
if (
|
|
93
|
-
if (
|
|
93
|
+
if (U.useEffect(() => {
|
|
94
|
+
if (i) {
|
|
94
95
|
const e = t.getFilteredSelectedRowModel().rows.map((l) => l.original);
|
|
95
|
-
|
|
96
|
+
i(e);
|
|
96
97
|
}
|
|
97
|
-
}, [c,
|
|
98
|
+
}, [c, i, t]), p)
|
|
98
99
|
return /* @__PURE__ */ o.jsx(
|
|
99
|
-
|
|
100
|
+
J,
|
|
100
101
|
{
|
|
101
102
|
columns: a,
|
|
102
103
|
checkboxSelection: m,
|
|
@@ -107,44 +108,44 @@ function fe({
|
|
|
107
108
|
if (s.length === 0) {
|
|
108
109
|
const e = C || {}, {
|
|
109
110
|
title: l = "No results",
|
|
110
|
-
description:
|
|
111
|
-
media:
|
|
112
|
-
actions:
|
|
111
|
+
description: B = "No data available",
|
|
112
|
+
media: G,
|
|
113
|
+
actions: I
|
|
113
114
|
} = e;
|
|
114
115
|
return /* @__PURE__ */ o.jsx(
|
|
115
|
-
|
|
116
|
+
O,
|
|
116
117
|
{
|
|
117
|
-
media:
|
|
118
|
+
media: G,
|
|
118
119
|
title: l,
|
|
119
|
-
description:
|
|
120
|
-
actions:
|
|
120
|
+
description: B,
|
|
121
|
+
actions: I
|
|
121
122
|
}
|
|
122
123
|
);
|
|
123
124
|
}
|
|
124
|
-
return /* @__PURE__ */ o.jsx("div", { className: u("space-y-4",
|
|
125
|
+
return /* @__PURE__ */ o.jsx("div", { className: u("space-y-4", D), children: /* @__PURE__ */ o.jsx(
|
|
125
126
|
"div",
|
|
126
127
|
{
|
|
127
128
|
className: "rounded-md border overflow-x-auto",
|
|
128
|
-
style: { height:
|
|
129
|
+
style: { height: R || "auto" },
|
|
129
130
|
children: /* @__PURE__ */ o.jsxs(
|
|
130
|
-
|
|
131
|
+
q,
|
|
131
132
|
{
|
|
132
133
|
className: u("table-fixed"),
|
|
133
134
|
style: { width: "max-content", minWidth: "100%" },
|
|
134
135
|
children: [
|
|
135
136
|
/* @__PURE__ */ o.jsx(
|
|
136
|
-
|
|
137
|
+
K,
|
|
137
138
|
{
|
|
138
139
|
table: t,
|
|
139
|
-
enableColumnResizing:
|
|
140
|
+
enableColumnResizing: n
|
|
140
141
|
}
|
|
141
142
|
),
|
|
142
143
|
/* @__PURE__ */ o.jsx(
|
|
143
|
-
|
|
144
|
+
Q,
|
|
144
145
|
{
|
|
145
146
|
table: t,
|
|
146
|
-
enableColumnResizing:
|
|
147
|
-
onRowClick:
|
|
147
|
+
enableColumnResizing: n,
|
|
148
|
+
onRowClick: j,
|
|
148
149
|
rowHeight: d
|
|
149
150
|
}
|
|
150
151
|
)
|
|
@@ -155,5 +156,5 @@ function fe({
|
|
|
155
156
|
) });
|
|
156
157
|
}
|
|
157
158
|
export {
|
|
158
|
-
|
|
159
|
+
ge as DataTable
|
|
159
160
|
};
|
|
@@ -114,6 +114,7 @@ export interface DataTableProps<TData> {
|
|
|
114
114
|
enableColumnFilters?: boolean;
|
|
115
115
|
columnFilters?: ColumnFiltersState;
|
|
116
116
|
onColumnFiltersChange?: (filters: ColumnFiltersState) => void;
|
|
117
|
+
enableColumnPinning?: boolean;
|
|
117
118
|
columnVisibility?: VisibilityState;
|
|
118
119
|
onColumnVisibilityChange?: (visibility: VisibilityState) => void;
|
|
119
120
|
onRowClick?: (row: TData) => void;
|