@konstructio/ui 0.1.2-alpha.61 → 0.1.2-alpha.63
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/chevron-left-BHBf-gQY.js +5 -0
- package/dist/chevron-right-DvXGOiS_.js +5 -0
- package/dist/components/DateRangePicker/components/CalendarPanel/components/NavigationButton/NavigationButton.js +14 -13
- package/dist/components/Datepicker/DatePicker.js +6 -5
- package/dist/components/Select/components/List/List.js +82 -72
- package/dist/components/VirtualizedTable/VirtualizedTable.js +39 -22
- package/dist/components/VirtualizedTable/VirtualizedTable.types.d.ts +21 -1
- package/dist/components/VirtualizedTable/components/Body/Body.js +84 -62
- package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +9 -8
- package/dist/components/VirtualizedTable/components/ExpandableRow/ExpandableRow.d.ts +3 -0
- package/dist/components/VirtualizedTable/components/ExpandableRow/ExpandableRow.js +41 -0
- package/dist/components/VirtualizedTable/components/ExpandableRow/ExpandableRow.types.d.ts +9 -0
- package/dist/components/VirtualizedTable/contexts/table.context.d.ts +4 -0
- package/dist/components/VirtualizedTable/contexts/table.provider.d.ts +3 -17
- package/dist/components/VirtualizedTable/contexts/table.provider.js +126 -68
- package/dist/components/VirtualizedTable/contexts/table.types.d.ts +23 -0
- package/dist/package.json +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/chevron-right-SUh6si0f.js +0 -7
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { cn as e } from "../../../../../../utils/index.js";
|
|
3
|
-
import { calendarNavButtonDisabledVariants as
|
|
4
|
-
import { C as v
|
|
3
|
+
import { calendarNavButtonDisabledVariants as h, calendarNavButtonVariants as b } from "../../CalendarPanel.variants.js";
|
|
4
|
+
import { C as v } from "../../../../../../chevron-left-BHBf-gQY.js";
|
|
5
|
+
import { C as N } from "../../../../../../chevron-right-DvXGOiS_.js";
|
|
5
6
|
const B = ({
|
|
6
7
|
direction: n,
|
|
7
|
-
onClick:
|
|
8
|
-
disabled:
|
|
9
|
-
isAnimating:
|
|
8
|
+
onClick: r,
|
|
9
|
+
disabled: s = !1,
|
|
10
|
+
isAnimating: i = !1,
|
|
10
11
|
canNavigate: t = !0,
|
|
11
12
|
hideWhenDisabled: l = !1,
|
|
12
13
|
className: m,
|
|
@@ -14,23 +15,23 @@ const B = ({
|
|
|
14
15
|
ariaLabel: u,
|
|
15
16
|
size: c = "medium"
|
|
16
17
|
}) => {
|
|
17
|
-
const
|
|
18
|
+
const o = s || i || !t;
|
|
18
19
|
if (l && !t)
|
|
19
20
|
return null;
|
|
20
|
-
const f = n === "prev" ? v : N,
|
|
21
|
-
return /* @__PURE__ */
|
|
21
|
+
const f = n === "prev" ? v : N, p = c === "small" ? "w-4 h-4" : "w-5 h-5";
|
|
22
|
+
return /* @__PURE__ */ a(
|
|
22
23
|
"button",
|
|
23
24
|
{
|
|
24
25
|
type: "button",
|
|
25
|
-
onClick:
|
|
26
|
-
disabled:
|
|
26
|
+
onClick: r,
|
|
27
|
+
disabled: o,
|
|
27
28
|
className: e(
|
|
28
29
|
b(),
|
|
29
30
|
m,
|
|
30
|
-
|
|
31
|
+
o && e(h(), d)
|
|
31
32
|
),
|
|
32
33
|
"aria-label": u,
|
|
33
|
-
children: /* @__PURE__ */
|
|
34
|
+
children: /* @__PURE__ */ a(f, { className: p })
|
|
34
35
|
}
|
|
35
36
|
);
|
|
36
37
|
};
|
|
@@ -4,19 +4,20 @@ import { cn as t } from "../../utils/index.js";
|
|
|
4
4
|
import { datePickerVariants as p } from "./DatePicker.variants.js";
|
|
5
5
|
import '../../style.css';/* empty css */
|
|
6
6
|
import { D as k } from "../../DayPicker-PUEUVAST.js";
|
|
7
|
-
import { C as g
|
|
7
|
+
import { C as g } from "../../chevron-left-BHBf-gQY.js";
|
|
8
|
+
import { C as w } from "../../chevron-right-DvXGOiS_.js";
|
|
8
9
|
const y = ({
|
|
9
10
|
className: l,
|
|
10
11
|
showOutsideDays: n = !0,
|
|
11
12
|
animate: d = !0,
|
|
12
13
|
arrowClassName: s,
|
|
13
14
|
monthsClassName: i,
|
|
14
|
-
defaultSelected:
|
|
15
|
+
defaultSelected: m,
|
|
15
16
|
onSelect: o,
|
|
16
|
-
...
|
|
17
|
+
...u
|
|
17
18
|
}) => {
|
|
18
19
|
const [c, x] = h(
|
|
19
|
-
() =>
|
|
20
|
+
() => m
|
|
20
21
|
), b = f(
|
|
21
22
|
(e) => {
|
|
22
23
|
e && (x(e), o?.(e));
|
|
@@ -129,7 +130,7 @@ const y = ({
|
|
|
129
130
|
components: {
|
|
130
131
|
Chevron: ({ className: e, ...r }) => r.orientation === "left" ? /* @__PURE__ */ a(g, { className: t(e), ...r }) : /* @__PURE__ */ a(w, { className: t(e), ...r })
|
|
131
132
|
},
|
|
132
|
-
...
|
|
133
|
+
...u
|
|
133
134
|
}
|
|
134
135
|
);
|
|
135
136
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { S as
|
|
3
|
-
import { d as
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { Loading as
|
|
1
|
+
import { jsxs as Z, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { S as B } from "../../../../index-BvoZGpli.js";
|
|
3
|
+
import { d as G } from "../../../../debounce-DJveWHr_.js";
|
|
4
|
+
import { forwardRef as J, useRef as C, useState as K, useImperativeHandle as M, useMemo as Q, useEffect as R } from "react";
|
|
5
|
+
import { Loading as W } from "../../../Loading/Loading.js";
|
|
6
6
|
import { cn as o } from "../../../../utils/index.js";
|
|
7
|
-
import { useNavigationUlList as
|
|
7
|
+
import { useNavigationUlList as X } from "../../hooks/useNavigationList.js";
|
|
8
8
|
import { ListItem as b } from "../ListItem/ListItem.js";
|
|
9
|
-
import { listVariants as
|
|
10
|
-
import { DEFAULT_LIST_SIZE as
|
|
11
|
-
import { useSelectContext as
|
|
12
|
-
const
|
|
9
|
+
import { listVariants as Y } from "./List.variants.js";
|
|
10
|
+
import { DEFAULT_LIST_SIZE as $ } from "../../constants/pagination.js";
|
|
11
|
+
import { useSelectContext as ee } from "../../contexts/select.hook.js";
|
|
12
|
+
const me = J(
|
|
13
13
|
({
|
|
14
14
|
additionalOptions: F,
|
|
15
15
|
className: N,
|
|
@@ -19,59 +19,60 @@ const fe = G(
|
|
|
19
19
|
name: I,
|
|
20
20
|
searchable: x = !1,
|
|
21
21
|
listItemSecondRowClassName: c,
|
|
22
|
-
wrapperInputRef:
|
|
22
|
+
wrapperInputRef: O,
|
|
23
23
|
isInfiniteScrollEnabled: u,
|
|
24
24
|
onFetchMoreOptions: f,
|
|
25
25
|
noOptionsText: y
|
|
26
|
-
},
|
|
27
|
-
const n = C(null), m = C(null), [p, L] =
|
|
28
|
-
isOpen: O,
|
|
29
|
-
searchTerm: g,
|
|
30
|
-
canFilter: P,
|
|
26
|
+
}, S) => {
|
|
27
|
+
const n = C(null), m = C(null), [p, L] = K(!1), {
|
|
31
28
|
canContinueFetching: a,
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
canFilter: j,
|
|
30
|
+
isOpen: P,
|
|
34
31
|
isTyping: k,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
options: w,
|
|
33
|
+
page: g,
|
|
34
|
+
searchTerm: d,
|
|
35
|
+
setCanContinueFetching: T,
|
|
36
|
+
setOptions: U,
|
|
37
|
+
setPage: _,
|
|
38
|
+
toggleOpen: q
|
|
39
|
+
} = ee();
|
|
40
|
+
M(S, () => n.current, [n]);
|
|
41
|
+
const h = x && j ? w.filter((e) => {
|
|
42
|
+
const t = d.toLowerCase();
|
|
42
43
|
return (typeof e.label == "string" ? e.label.toLowerCase() : "").includes(t);
|
|
43
44
|
}) : w;
|
|
44
|
-
|
|
45
|
+
X({
|
|
45
46
|
ulRef: n,
|
|
46
|
-
wrapperInputRef:
|
|
47
|
+
wrapperInputRef: O,
|
|
47
48
|
searchable: x,
|
|
48
49
|
filteredOptions: h
|
|
49
50
|
});
|
|
50
|
-
const
|
|
51
|
+
const z = h.filter(
|
|
51
52
|
(e, t, s) => t === s.findIndex((v) => v.value === e.value)
|
|
52
|
-
),
|
|
53
|
-
() =>
|
|
53
|
+
), A = h.length === 0, D = Q(
|
|
54
|
+
() => G(async (e) => {
|
|
54
55
|
const [t] = e;
|
|
55
56
|
if (t.isIntersecting && !p && f && a)
|
|
56
57
|
try {
|
|
57
58
|
L(!0);
|
|
58
|
-
const s =
|
|
59
|
+
const s = g + 1, { data: v, hasMore: H } = await f({
|
|
59
60
|
page: s,
|
|
60
|
-
pageSize:
|
|
61
|
-
termOfSearch:
|
|
61
|
+
pageSize: $,
|
|
62
|
+
termOfSearch: d
|
|
62
63
|
});
|
|
63
|
-
|
|
64
|
+
_(s), T(H), U((V) => [...V, ...v]);
|
|
64
65
|
} catch {
|
|
65
66
|
console.error("Error fetching more options");
|
|
66
67
|
} finally {
|
|
67
68
|
L(!1);
|
|
68
69
|
}
|
|
69
70
|
}, 100),
|
|
70
|
-
[p, f,
|
|
71
|
+
[p, f, d, g]
|
|
71
72
|
);
|
|
72
|
-
return
|
|
73
|
+
return R(() => {
|
|
73
74
|
if (u && a && m.current && !k) {
|
|
74
|
-
const e = new IntersectionObserver(
|
|
75
|
+
const e = new IntersectionObserver(D, {
|
|
75
76
|
threshold: 0.1
|
|
76
77
|
});
|
|
77
78
|
return e.observe(m.current), () => e.disconnect();
|
|
@@ -81,15 +82,15 @@ const fe = G(
|
|
|
81
82
|
a,
|
|
82
83
|
p,
|
|
83
84
|
k,
|
|
84
|
-
|
|
85
|
-
]), /* @__PURE__ */
|
|
85
|
+
g
|
|
86
|
+
]), /* @__PURE__ */ Z(
|
|
86
87
|
"ul",
|
|
87
88
|
{
|
|
88
89
|
ref: n,
|
|
89
90
|
title: I,
|
|
90
91
|
role: "listbox",
|
|
91
|
-
className: o(
|
|
92
|
-
"data-state":
|
|
92
|
+
className: o(Y({ className: N })),
|
|
93
|
+
"data-state": P ? "open" : "closed",
|
|
93
94
|
children: [
|
|
94
95
|
E ? /* @__PURE__ */ r(
|
|
95
96
|
b,
|
|
@@ -101,7 +102,7 @@ const fe = G(
|
|
|
101
102
|
label: "Loading...",
|
|
102
103
|
listItemSecondRowClassName: c
|
|
103
104
|
}
|
|
104
|
-
) :
|
|
105
|
+
) : A ? /* @__PURE__ */ r(
|
|
105
106
|
b,
|
|
106
107
|
{
|
|
107
108
|
isEmpty: !0,
|
|
@@ -112,7 +113,7 @@ const fe = G(
|
|
|
112
113
|
label: y ?? "No options",
|
|
113
114
|
listItemSecondRowClassName: c
|
|
114
115
|
}
|
|
115
|
-
) :
|
|
116
|
+
) : z.map((e) => /* @__PURE__ */ r(
|
|
116
117
|
b,
|
|
117
118
|
{
|
|
118
119
|
className: o("select-none", i),
|
|
@@ -131,42 +132,51 @@ const fe = G(
|
|
|
131
132
|
"data-action": "true",
|
|
132
133
|
className: "flex items-center justify-center py-3",
|
|
133
134
|
onClick: (e) => e.stopPropagation(),
|
|
134
|
-
children: /* @__PURE__ */ r(
|
|
135
|
+
children: /* @__PURE__ */ r(W, { className: "w-4 h-4 text-aurora-500 select-none" })
|
|
135
136
|
}
|
|
136
137
|
),
|
|
137
|
-
F?.map((e, t) => /* @__PURE__ */ r(
|
|
138
|
-
|
|
138
|
+
F?.map((e, t) => /* @__PURE__ */ r(
|
|
139
|
+
"li",
|
|
139
140
|
{
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
141
|
+
role: "option",
|
|
142
|
+
"data-action": "true",
|
|
143
|
+
onClick: () => q(!1),
|
|
144
|
+
children: /* @__PURE__ */ r(
|
|
145
|
+
B,
|
|
146
|
+
{
|
|
147
|
+
className: o(
|
|
148
|
+
"flex",
|
|
149
|
+
"min-h-10",
|
|
150
|
+
"py-2",
|
|
151
|
+
"px-6",
|
|
152
|
+
"w-full",
|
|
153
|
+
"h-full",
|
|
154
|
+
"gap-1",
|
|
155
|
+
"items-center",
|
|
156
|
+
"text-sm",
|
|
157
|
+
"[&>svg]:-ml-1",
|
|
158
|
+
"[&>svg]:w-3.5",
|
|
159
|
+
"[&>svg]:h-3.5",
|
|
160
|
+
"[&>svg]:shrink-0",
|
|
161
|
+
"cursor-pointer",
|
|
162
|
+
"select-none",
|
|
163
|
+
"hover:bg-gray-50",
|
|
164
|
+
"hover:dark:bg-metal-700",
|
|
165
|
+
"focus:outline-0",
|
|
166
|
+
"text-blue-600",
|
|
167
|
+
"dark:text-aurora-500"
|
|
168
|
+
),
|
|
169
|
+
children: e
|
|
170
|
+
}
|
|
171
|
+
)
|
|
172
|
+
},
|
|
173
|
+
t
|
|
174
|
+
))
|
|
165
175
|
]
|
|
166
176
|
}
|
|
167
177
|
);
|
|
168
178
|
}
|
|
169
179
|
);
|
|
170
180
|
export {
|
|
171
|
-
|
|
181
|
+
me as List
|
|
172
182
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as r, jsxs as s } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as
|
|
2
|
+
import { useMemo as G } from "react";
|
|
3
3
|
import { cn as c } from "../../utils/index.js";
|
|
4
|
-
import { TableProvider as
|
|
5
|
-
import { Filter as
|
|
6
|
-
import { WrapperBody as
|
|
7
|
-
import { Header as
|
|
8
|
-
import { Body as
|
|
9
|
-
import { Pagination as
|
|
10
|
-
import { TruncateText as
|
|
11
|
-
import { Actions as
|
|
12
|
-
const
|
|
4
|
+
import { TableProvider as J } from "./contexts/table.provider.js";
|
|
5
|
+
import { Filter as O } from "./components/Filter/Filter.js";
|
|
6
|
+
import { WrapperBody as Q } from "./components/WrapperBody/WrapperBody.js";
|
|
7
|
+
import { Header as R } from "./components/Header/Header.js";
|
|
8
|
+
import { Body as S } from "./components/Body/Body.js";
|
|
9
|
+
import { Pagination as U } from "./components/Pagination/Pagination.js";
|
|
10
|
+
import { TruncateText as X } from "./components/TruncateText/TruncateText.js";
|
|
11
|
+
import { Actions as Y } from "./components/Actions/Actions.js";
|
|
12
|
+
const Z = ({
|
|
13
13
|
id: n,
|
|
14
14
|
ariaLabel: p,
|
|
15
15
|
columns: d,
|
|
@@ -38,9 +38,18 @@ const J = ({
|
|
|
38
38
|
multiSelectFilter: w,
|
|
39
39
|
filterActions: P,
|
|
40
40
|
showResetButton: E = !0,
|
|
41
|
-
resetButtonClassName: H
|
|
41
|
+
resetButtonClassName: H,
|
|
42
|
+
// Expandable rows
|
|
43
|
+
enableExpandedRow: I,
|
|
44
|
+
expandedState: K,
|
|
45
|
+
defaultExpanded: M,
|
|
46
|
+
classNameExpandedRow: W,
|
|
47
|
+
classNameExpandedCell: g,
|
|
48
|
+
classNameExpandedContent: q,
|
|
49
|
+
classNameExpandedHeader: C,
|
|
50
|
+
onExpandedChange: F
|
|
42
51
|
}) => {
|
|
43
|
-
const e =
|
|
52
|
+
const e = G(
|
|
44
53
|
() => B || [
|
|
45
54
|
t,
|
|
46
55
|
i,
|
|
@@ -50,7 +59,7 @@ const J = ({
|
|
|
50
59
|
[]
|
|
51
60
|
);
|
|
52
61
|
return /* @__PURE__ */ r(
|
|
53
|
-
|
|
62
|
+
J,
|
|
54
63
|
{
|
|
55
64
|
id: n,
|
|
56
65
|
columns: d,
|
|
@@ -59,9 +68,17 @@ const J = ({
|
|
|
59
68
|
totalItems: u,
|
|
60
69
|
queryOptions: z,
|
|
61
70
|
isPaginationEnabled: e,
|
|
71
|
+
enableExpandedRow: I,
|
|
72
|
+
expandedState: K,
|
|
73
|
+
onExpandedChange: F,
|
|
74
|
+
defaultExpanded: M,
|
|
75
|
+
classNameExpandedRow: W,
|
|
76
|
+
classNameExpandedCell: g,
|
|
77
|
+
classNameExpandedContent: q,
|
|
78
|
+
classNameExpandedHeader: C,
|
|
62
79
|
children: /* @__PURE__ */ s("section", { className: c("w-full min-w-fit", b), children: [
|
|
63
80
|
j && /* @__PURE__ */ r(
|
|
64
|
-
|
|
81
|
+
O,
|
|
65
82
|
{
|
|
66
83
|
actions: P,
|
|
67
84
|
multiSelectFilter: w,
|
|
@@ -72,7 +89,7 @@ const J = ({
|
|
|
72
89
|
}
|
|
73
90
|
),
|
|
74
91
|
/* @__PURE__ */ r(
|
|
75
|
-
|
|
92
|
+
Q,
|
|
76
93
|
{
|
|
77
94
|
showPagination: e,
|
|
78
95
|
classNameWrapperTable: y,
|
|
@@ -88,21 +105,21 @@ const J = ({
|
|
|
88
105
|
"aria-label": p,
|
|
89
106
|
children: [
|
|
90
107
|
/* @__PURE__ */ r(
|
|
91
|
-
|
|
108
|
+
R,
|
|
92
109
|
{
|
|
93
110
|
className: x,
|
|
94
111
|
classNameArrows: N,
|
|
95
112
|
classNameActiveArrows: T
|
|
96
113
|
}
|
|
97
114
|
),
|
|
98
|
-
/* @__PURE__ */ r(
|
|
115
|
+
/* @__PURE__ */ r(S, { isLoading: a, showPagination: e })
|
|
99
116
|
]
|
|
100
117
|
}
|
|
101
118
|
)
|
|
102
119
|
}
|
|
103
120
|
),
|
|
104
121
|
e && /* @__PURE__ */ r(
|
|
105
|
-
|
|
122
|
+
U,
|
|
106
123
|
{
|
|
107
124
|
showTotalItems: t,
|
|
108
125
|
showDropdownPagination: i,
|
|
@@ -115,11 +132,11 @@ const J = ({
|
|
|
115
132
|
] })
|
|
116
133
|
}
|
|
117
134
|
);
|
|
118
|
-
}, o =
|
|
135
|
+
}, o = Z;
|
|
119
136
|
o.displayName = "KonstructVirtualizedTable";
|
|
120
|
-
o.TruncateText =
|
|
121
|
-
o.Actions =
|
|
137
|
+
o.TruncateText = X;
|
|
138
|
+
o.Actions = Y;
|
|
122
139
|
export {
|
|
123
|
-
|
|
140
|
+
X as TruncateText,
|
|
124
141
|
o as VirtualizedTable
|
|
125
142
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ColumnDef as ColumnDefPrimitive, RowData as RowDataPrimitive } from '@tanstack/react-table';
|
|
1
|
+
import { ColumnDef as ColumnDefPrimitive, ExpandedState, OnChangeFn, RowData as RowDataPrimitive } from '@tanstack/react-table';
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
3
4
|
import { virtualizeTableVariants } from './VirtualizedTable.variants';
|
|
4
5
|
import { FilterAction, Option } from './components/Filter/Filter.types';
|
|
5
6
|
import { UseQueryOptions } from '@tanstack/react-query';
|
|
@@ -16,6 +17,7 @@ declare module '@tanstack/react-table' {
|
|
|
16
17
|
export interface RowMetadata {
|
|
17
18
|
className?: string;
|
|
18
19
|
attributes?: Record<string, string | number | boolean>;
|
|
20
|
+
expandedRow?: ReactNode;
|
|
19
21
|
[key: string]: unknown;
|
|
20
22
|
}
|
|
21
23
|
export type RowDataWithMeta = Record<string, unknown> & {
|
|
@@ -105,4 +107,22 @@ export type Props<TData extends RowDataPrimitive> = VariantProps<typeof virtuali
|
|
|
105
107
|
filterActions?: FilterAction[];
|
|
106
108
|
showResetButton?: never;
|
|
107
109
|
resetButtonClassName?: never;
|
|
110
|
+
}) & ({
|
|
111
|
+
enableExpandedRow: true;
|
|
112
|
+
expandedState?: ExpandedState;
|
|
113
|
+
defaultExpanded?: ExpandedState;
|
|
114
|
+
classNameExpandedRow?: string;
|
|
115
|
+
classNameExpandedCell?: string;
|
|
116
|
+
classNameExpandedContent?: string;
|
|
117
|
+
classNameExpandedHeader?: string;
|
|
118
|
+
onExpandedChange?: OnChangeFn<ExpandedState>;
|
|
119
|
+
} | {
|
|
120
|
+
enableExpandedRow?: false | undefined;
|
|
121
|
+
expandedState?: never;
|
|
122
|
+
defaultExpanded?: never;
|
|
123
|
+
classNameExpandedRow?: never;
|
|
124
|
+
classNameExpandedCell?: never;
|
|
125
|
+
classNameExpandedContent?: never;
|
|
126
|
+
classNameExpandedHeader?: never;
|
|
127
|
+
onExpandedChange?: never;
|
|
108
128
|
});
|
|
@@ -1,77 +1,99 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { f as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsx as t, jsxs as D } from "react/jsx-runtime";
|
|
2
|
+
import { f as F } from "../../../../index-CSWGJT-v.js";
|
|
3
|
+
import { Fragment as S } from "react";
|
|
4
|
+
import { Skeleton as j } from "../Skeleton/Skeleton.js";
|
|
5
|
+
import { cn as l } from "../../../../utils/index.js";
|
|
6
|
+
import { ExpandableRow as M } from "../ExpandableRow/ExpandableRow.js";
|
|
7
|
+
import { useTableContext as v } from "../../contexts/table.hook.js";
|
|
8
|
+
const A = ({
|
|
9
|
+
isLoading: p,
|
|
10
|
+
showPagination: a
|
|
9
11
|
}) => {
|
|
10
|
-
const {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const {
|
|
13
|
+
table: n,
|
|
14
|
+
pageSize: f,
|
|
15
|
+
tableFetching: x,
|
|
16
|
+
enableExpandedRow: g,
|
|
17
|
+
classNameExpandedRow: u,
|
|
18
|
+
classNameExpandedCell: h,
|
|
19
|
+
classNameExpandedContent: N
|
|
20
|
+
} = v();
|
|
21
|
+
if (p || x)
|
|
22
|
+
return /* @__PURE__ */ t(j, { numberOfRows: f, table: n });
|
|
23
|
+
const d = n.getRowModel().rows ?? [];
|
|
24
|
+
return /* @__PURE__ */ t(
|
|
15
25
|
"tbody",
|
|
16
26
|
{
|
|
17
|
-
className:
|
|
27
|
+
className: l(
|
|
18
28
|
"text-slate-800",
|
|
19
29
|
"text-sm",
|
|
20
30
|
"font-normal",
|
|
21
31
|
"relative",
|
|
22
32
|
"dark:border-x"
|
|
23
33
|
),
|
|
24
|
-
children:
|
|
25
|
-
const {
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
34
|
+
children: d.map((m, c) => {
|
|
35
|
+
const { id: s, original: b, getVisibleCells: k } = m, { meta: r = {} } = b, o = k(), E = g && m.getIsExpanded(), R = !!r.expandedRow;
|
|
36
|
+
return /* @__PURE__ */ D(S, { children: [
|
|
37
|
+
/* @__PURE__ */ t(
|
|
38
|
+
"tr",
|
|
39
|
+
{
|
|
40
|
+
className: l(
|
|
41
|
+
"border-b",
|
|
42
|
+
"border-b-gray-200",
|
|
43
|
+
"dark:text-metal-50",
|
|
44
|
+
"dark:border-b-metal-700",
|
|
45
|
+
"bg-transparent",
|
|
46
|
+
r.className
|
|
47
|
+
),
|
|
48
|
+
"data-row-id": s,
|
|
49
|
+
...r.attributes ?? {},
|
|
50
|
+
children: o.map(({ id: w, column: e, getContext: y }, i) => {
|
|
51
|
+
const C = typeof e.columnDef.meta?.className == "function" ? e.columnDef.meta?.className(b) : e.columnDef.meta?.className;
|
|
52
|
+
return /* @__PURE__ */ t(
|
|
53
|
+
"td",
|
|
54
|
+
{
|
|
55
|
+
className: l(
|
|
56
|
+
"px-4",
|
|
57
|
+
"py-1",
|
|
58
|
+
"text-sm",
|
|
59
|
+
"bg-white",
|
|
60
|
+
"dark:bg-metal-900",
|
|
61
|
+
"dark:border-t",
|
|
62
|
+
"dark:border-metal-700",
|
|
63
|
+
"dark:first:border-l",
|
|
64
|
+
"dark:last:border-r",
|
|
65
|
+
C,
|
|
66
|
+
{
|
|
67
|
+
"first:rounded-bl-lg": c === d.length - 1 && i === 0 && !a,
|
|
68
|
+
"last:rounded-br-lg": c === d.length - 1 && i === o.length - 1 && !a,
|
|
69
|
+
"dark:[tr:last-child_&]:border-b": !a
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
...e.columnDef.meta?.attributes ?? {},
|
|
73
|
+
children: F(e.columnDef.cell, y())
|
|
74
|
+
},
|
|
75
|
+
w
|
|
76
|
+
);
|
|
77
|
+
})
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
R && /* @__PURE__ */ t(
|
|
81
|
+
M,
|
|
82
|
+
{
|
|
83
|
+
classNameExpandedCell: h,
|
|
84
|
+
classNameExpandedContent: N,
|
|
85
|
+
classNameExpandedRow: u,
|
|
86
|
+
colSpan: o.length,
|
|
87
|
+
id: s,
|
|
88
|
+
isExpanded: !!E,
|
|
89
|
+
children: r.expandedRow
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
] }, s);
|
|
71
93
|
})
|
|
72
94
|
}
|
|
73
95
|
);
|
|
74
96
|
};
|
|
75
97
|
export {
|
|
76
|
-
|
|
98
|
+
A as Body
|
|
77
99
|
};
|