@serendie/ui 3.6.0-dev.202606260532 → 3.6.0-dev.202607070300
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,53 +1,57 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useReactTable as
|
|
3
|
-
import { useState as
|
|
1
|
+
import { jsxs as p, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useReactTable as M } from "../../node_modules/@tanstack/react-table/build/lib/index.js";
|
|
3
|
+
import { useState as f } from "react";
|
|
4
4
|
import { DataTable as r } from "./index.js";
|
|
5
|
-
import { getSortedRowModel as
|
|
6
|
-
function
|
|
5
|
+
import { getSortedRowModel as T, getCoreRowModel as S } from "../../node_modules/@tanstack/table-core/build/lib/index.js";
|
|
6
|
+
function g({
|
|
7
7
|
className: s,
|
|
8
|
-
enableRowSelection:
|
|
9
|
-
onRowSelectionChange:
|
|
10
|
-
onSortingChange:
|
|
8
|
+
enableRowSelection: t = !0,
|
|
9
|
+
onRowSelectionChange: d,
|
|
10
|
+
onSortingChange: i,
|
|
11
11
|
state: e,
|
|
12
|
-
...
|
|
12
|
+
...c
|
|
13
13
|
}) {
|
|
14
|
-
const [
|
|
15
|
-
getCoreRowModel:
|
|
16
|
-
getSortedRowModel:
|
|
17
|
-
enableRowSelection:
|
|
18
|
-
...
|
|
14
|
+
const [R, n] = f({}), [u, b] = f([]), m = M({
|
|
15
|
+
getCoreRowModel: S(),
|
|
16
|
+
getSortedRowModel: T(),
|
|
17
|
+
enableRowSelection: t,
|
|
18
|
+
...c,
|
|
19
|
+
defaultColumn: {
|
|
20
|
+
size: void 0,
|
|
21
|
+
...c.defaultColumn
|
|
22
|
+
},
|
|
19
23
|
state: {
|
|
20
|
-
rowSelection: (e == null ? void 0 : e.rowSelection) ??
|
|
21
|
-
sorting: (e == null ? void 0 : e.sorting) ??
|
|
24
|
+
rowSelection: (e == null ? void 0 : e.rowSelection) ?? R,
|
|
25
|
+
sorting: (e == null ? void 0 : e.sorting) ?? u,
|
|
22
26
|
...e
|
|
23
27
|
},
|
|
24
28
|
onRowSelectionChange: (o) => {
|
|
25
|
-
|
|
29
|
+
n(o), d == null || d(o);
|
|
26
30
|
},
|
|
27
31
|
onSortingChange: (o) => {
|
|
28
|
-
|
|
32
|
+
b(o), i == null || i(o);
|
|
29
33
|
}
|
|
30
|
-
}),
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */ l(r.Thead, { children:
|
|
34
|
+
}), w = t !== !1;
|
|
35
|
+
return /* @__PURE__ */ p(r.Root, { className: s, children: [
|
|
36
|
+
/* @__PURE__ */ l(r.Thead, { children: m.getHeaderGroups().map((o) => /* @__PURE__ */ l(
|
|
33
37
|
r.HeaderRow,
|
|
34
38
|
{
|
|
35
39
|
headerGroup: o,
|
|
36
|
-
enableRowSelection:
|
|
37
|
-
table:
|
|
40
|
+
enableRowSelection: w,
|
|
41
|
+
table: m
|
|
38
42
|
},
|
|
39
43
|
o.id
|
|
40
44
|
)) }),
|
|
41
|
-
/* @__PURE__ */ l(r.Tbody, { children:
|
|
45
|
+
/* @__PURE__ */ l(r.Tbody, { children: m.getRowModel().rows.map((o) => /* @__PURE__ */ l(
|
|
42
46
|
r.Row,
|
|
43
47
|
{
|
|
44
48
|
row: o,
|
|
45
|
-
enableRowSelection:
|
|
49
|
+
enableRowSelection: w
|
|
46
50
|
},
|
|
47
51
|
o.id
|
|
48
52
|
)) })
|
|
49
53
|
] });
|
|
50
54
|
}
|
|
51
55
|
export {
|
|
52
|
-
|
|
56
|
+
g as DataTableComponent
|
|
53
57
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as l, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import y from "react";
|
|
3
3
|
import { SerendieSymbol as a } from "@serendie/symbols";
|
|
4
|
-
import { css as
|
|
5
|
-
import { cx as
|
|
6
|
-
import { cva as
|
|
7
|
-
const
|
|
4
|
+
import { css as u } from "../../../styled-system/css/css.js";
|
|
5
|
+
import { cx as g } from "../../../styled-system/css/cx.js";
|
|
6
|
+
import { cva as h } from "../../../styled-system/css/cva.js";
|
|
7
|
+
const x = h({
|
|
8
8
|
base: {
|
|
9
9
|
borderBottomWidth: "1px",
|
|
10
10
|
borderBottomStyle: "solid",
|
|
@@ -22,7 +22,7 @@ const h = g({
|
|
|
22
22
|
whiteSpace: "nowrap"
|
|
23
23
|
},
|
|
24
24
|
defaultVariants: {}
|
|
25
|
-
}),
|
|
25
|
+
}), B = y.forwardRef(
|
|
26
26
|
({
|
|
27
27
|
children: s,
|
|
28
28
|
size: r = "medium",
|
|
@@ -31,11 +31,12 @@ const h = g({
|
|
|
31
31
|
sortDirection: n,
|
|
32
32
|
onSort: o,
|
|
33
33
|
className: i,
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
style: m,
|
|
35
|
+
...c
|
|
36
|
+
}, p) => /* @__PURE__ */ l(
|
|
36
37
|
"th",
|
|
37
38
|
{
|
|
38
|
-
ref:
|
|
39
|
+
ref: p,
|
|
39
40
|
role: "columnheader",
|
|
40
41
|
"aria-sort": n === "asc" ? "ascending" : n === "desc" ? "descending" : e ? "none" : void 0,
|
|
41
42
|
tabIndex: e ? 0 : void 0,
|
|
@@ -43,16 +44,17 @@ const h = g({
|
|
|
43
44
|
onKeyDown: (t) => {
|
|
44
45
|
e && (t.key === "Enter" || t.key === " ") && (t.preventDefault(), o == null || o());
|
|
45
46
|
},
|
|
46
|
-
className:
|
|
47
|
+
className: g(x({ size: r, state: d }), i),
|
|
47
48
|
style: {
|
|
48
49
|
cursor: e ? "pointer" : "default",
|
|
49
|
-
userSelect: "none"
|
|
50
|
+
userSelect: "none",
|
|
51
|
+
...m
|
|
50
52
|
},
|
|
51
|
-
...
|
|
52
|
-
children: /* @__PURE__ */
|
|
53
|
+
...c,
|
|
54
|
+
children: /* @__PURE__ */ f(
|
|
53
55
|
"span",
|
|
54
56
|
{
|
|
55
|
-
className:
|
|
57
|
+
className: u({
|
|
56
58
|
display: "inline-flex",
|
|
57
59
|
alignItems: "center",
|
|
58
60
|
verticalAlign: "middle"
|
|
@@ -85,5 +87,5 @@ const h = g({
|
|
|
85
87
|
)
|
|
86
88
|
);
|
|
87
89
|
export {
|
|
88
|
-
|
|
90
|
+
B as HeaderCell
|
|
89
91
|
};
|
|
@@ -1,42 +1,43 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { flexRender as
|
|
1
|
+
import { jsx as r, jsxs as g } from "react/jsx-runtime";
|
|
2
|
+
import u from "react";
|
|
3
|
+
import { flexRender as f } from "../../../node_modules/@tanstack/react-table/build/lib/index.js";
|
|
4
4
|
import { DataTable as t } from "../index.js";
|
|
5
|
-
import { css as
|
|
6
|
-
const
|
|
7
|
-
headerGroup:
|
|
8
|
-
enableRowSelection:
|
|
5
|
+
import { css as w } from "../../../styled-system/css/css.js";
|
|
6
|
+
const R = ({
|
|
7
|
+
headerGroup: l,
|
|
8
|
+
enableRowSelection: m,
|
|
9
9
|
table: o,
|
|
10
|
-
children:
|
|
10
|
+
children: n,
|
|
11
11
|
className: c
|
|
12
|
-
}, s) =>
|
|
13
|
-
|
|
12
|
+
}, s) => n ? /* @__PURE__ */ r(t.Tr, { ref: s, className: c, children: n }) : !l || !o ? null : /* @__PURE__ */ g(t.Tr, { ref: s, className: c, children: [
|
|
13
|
+
m && /* @__PURE__ */ r(
|
|
14
14
|
t.HeaderCheckbox,
|
|
15
15
|
{
|
|
16
16
|
checked: o.getIsSomeRowsSelected() ? "indeterminate" : !!o.getIsAllRowsSelected(),
|
|
17
17
|
onChange: o.getToggleAllRowsSelectedHandler(),
|
|
18
18
|
value: "select-all",
|
|
19
|
-
className:
|
|
19
|
+
className: w({
|
|
20
20
|
verticalAlign: "middle"
|
|
21
21
|
})
|
|
22
22
|
}
|
|
23
23
|
),
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
return /* @__PURE__ */
|
|
24
|
+
l.headers.map((e) => {
|
|
25
|
+
const d = e.column.getCanSort(), a = e.column.getIsSorted();
|
|
26
|
+
return /* @__PURE__ */ r(
|
|
27
27
|
t.HeaderCell,
|
|
28
28
|
{
|
|
29
|
-
sortable:
|
|
29
|
+
sortable: d,
|
|
30
30
|
sortDirection: a,
|
|
31
31
|
onSort: () => e.column.toggleSorting(),
|
|
32
|
-
|
|
32
|
+
style: e.column.columnDef.size != null ? { width: e.getSize() } : void 0,
|
|
33
|
+
children: f(e.column.columnDef.header, e.getContext())
|
|
33
34
|
},
|
|
34
35
|
e.id
|
|
35
36
|
);
|
|
36
37
|
})
|
|
37
|
-
] },
|
|
38
|
-
|
|
39
|
-
const
|
|
38
|
+
] }, l.id), i = u.forwardRef(R);
|
|
39
|
+
i.displayName = "HeaderRow";
|
|
40
|
+
const D = i;
|
|
40
41
|
export {
|
|
41
|
-
|
|
42
|
+
D as HeaderRow
|
|
42
43
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as n, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import f from "react";
|
|
3
3
|
import { flexRender as y } from "../../../node_modules/@tanstack/react-table/build/lib/index.js";
|
|
4
4
|
import { DataTable as o } from "../index.js";
|
|
5
|
-
import { cx as
|
|
5
|
+
import { cx as m } from "../../../styled-system/css/cx.js";
|
|
6
6
|
import { cva as g } from "../../../styled-system/css/cva.js";
|
|
7
|
-
const
|
|
7
|
+
const l = g({
|
|
8
8
|
base: {
|
|
9
9
|
_hover: {
|
|
10
10
|
_after: {
|
|
@@ -58,18 +58,18 @@ const m = g({
|
|
|
58
58
|
o.Tr,
|
|
59
59
|
{
|
|
60
60
|
ref: i,
|
|
61
|
-
className:
|
|
62
|
-
|
|
61
|
+
className: m(
|
|
62
|
+
l({ state: d ? "selected" : void 0 }),
|
|
63
63
|
s
|
|
64
64
|
),
|
|
65
65
|
children: r
|
|
66
66
|
}
|
|
67
|
-
) : e ? /* @__PURE__ */
|
|
67
|
+
) : e ? /* @__PURE__ */ p(
|
|
68
68
|
o.Tr,
|
|
69
69
|
{
|
|
70
70
|
ref: i,
|
|
71
|
-
className:
|
|
72
|
-
|
|
71
|
+
className: m(
|
|
72
|
+
l({
|
|
73
73
|
state: e.getIsSelected() ? "selected" : void 0
|
|
74
74
|
}),
|
|
75
75
|
s
|
|
@@ -84,17 +84,25 @@ const m = g({
|
|
|
84
84
|
}
|
|
85
85
|
),
|
|
86
86
|
e.getVisibleCells().map((t) => {
|
|
87
|
-
const
|
|
88
|
-
return /* @__PURE__ */ n(
|
|
87
|
+
const u = x(t);
|
|
88
|
+
return /* @__PURE__ */ n(
|
|
89
|
+
o.BodyCell,
|
|
90
|
+
{
|
|
91
|
+
type: u,
|
|
92
|
+
style: t.column.columnDef.size != null ? { width: t.column.getSize() } : void 0,
|
|
93
|
+
children: y(t.column.columnDef.cell, t.getContext())
|
|
94
|
+
},
|
|
95
|
+
t.id
|
|
96
|
+
);
|
|
89
97
|
})
|
|
90
98
|
]
|
|
91
99
|
}
|
|
92
|
-
) : null, a =
|
|
100
|
+
) : null, a = f.forwardRef(v);
|
|
93
101
|
a.displayName = "Row";
|
|
94
|
-
const
|
|
102
|
+
const R = a;
|
|
95
103
|
function x(e) {
|
|
96
104
|
return e.column.columnDef.meta && "getType" in e.column.columnDef.meta && typeof e.column.columnDef.meta.getType == "function" ? e.column.columnDef.meta.getType(e.row.original) : "default";
|
|
97
105
|
}
|
|
98
106
|
export {
|
|
99
|
-
|
|
107
|
+
R as Row
|
|
100
108
|
};
|