@konstructio/ui 0.1.2-alpha.66 → 0.1.2-alpha.67
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/{DayPicker-PUEUVAST.js → DayPicker-CaeUXRCF.js} +475 -470
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/CalendarMonth.js +1 -1
- package/dist/components/Datepicker/DatePicker.js +1 -1
- package/dist/components/VirtualizedTable/VirtualizedTable.d.ts +5 -0
- package/dist/components/VirtualizedTable/VirtualizedTable.js +86 -80
- package/dist/components/VirtualizedTable/components/Body/Body.js +51 -49
- package/dist/components/VirtualizedTable/contexts/table.context.d.ts +2 -0
- package/dist/components/VirtualizedTable/contexts/table.provider.js +69 -67
- package/dist/components/VirtualizedTable/events/index.d.ts +3 -3
- package/dist/components/VirtualizedTable/events/index.js +22 -16
- package/dist/package.json +21 -21
- package/dist/styles.css +1 -1
- package/package.json +21 -21
|
@@ -4,7 +4,7 @@ import { cn as d } from "../../../../../../utils/index.js";
|
|
|
4
4
|
import { calendarMonthTitleVariants as f } from "../../CalendarPanel.variants.js";
|
|
5
5
|
import { createDayPickerClassNames as h, SINGLE_MONTH_WIDTH as p } from "../../constants/index.js";
|
|
6
6
|
import { getMonthName as M } from "../../../../utils/validation.js";
|
|
7
|
-
import { D as y } from "../../../../../../DayPicker-
|
|
7
|
+
import { D as y } from "../../../../../../DayPicker-CaeUXRCF.js";
|
|
8
8
|
const N = (e) => `${M(e.getMonth())} ${e.getFullYear()}`, g = ({
|
|
9
9
|
month: e,
|
|
10
10
|
range: a,
|
|
@@ -3,7 +3,7 @@ import { useState as h, useCallback as f } from "react";
|
|
|
3
3
|
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
|
-
import { D as k } from "../../DayPicker-
|
|
6
|
+
import { D as k } from "../../DayPicker-CaeUXRCF.js";
|
|
7
7
|
import { C as g } from "../../chevron-left-BHBf-gQY.js";
|
|
8
8
|
import { C as w } from "../../chevron-right-DvXGOiS_.js";
|
|
9
9
|
const y = ({
|
|
@@ -5,6 +5,11 @@ import { Props as ActionProps } from './components/Actions/Actions.types';
|
|
|
5
5
|
type VirtualizedTableCompound = (<TData extends RowData>(props: Props<TData>) => JSX.Element) & {
|
|
6
6
|
TruncateText: typeof TruncateText;
|
|
7
7
|
Actions: <TData extends RowData>(props: ActionProps<TData>) => JSX.Element | null;
|
|
8
|
+
Events: {
|
|
9
|
+
sendExpandRowEvent: (tableId: string, rowId: string) => void;
|
|
10
|
+
sendCollapseRowEvent: (tableId: string, rowId: string) => void;
|
|
11
|
+
sendToggleRowEvent: (tableId: string, rowId: string) => void;
|
|
12
|
+
};
|
|
8
13
|
displayName?: string;
|
|
9
14
|
};
|
|
10
15
|
declare const VirtualizedTable: VirtualizedTableCompound;
|
|
@@ -1,63 +1,64 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
1
|
+
import { jsx as r, jsxs as n } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as U } from "react";
|
|
3
|
-
import { cn as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
import { cn as s } from "../../utils/index.js";
|
|
4
|
+
import { sendToggleRowEvent as X, sendCollapseRowEvent as Y, sendExpandRowEvent as Z } from "./events/index.js";
|
|
5
|
+
import { TableProvider as _ } from "./contexts/table.provider.js";
|
|
6
|
+
import { Filter as $ } from "./components/Filter/Filter.js";
|
|
7
|
+
import { WrapperBody as D } from "./components/WrapperBody/WrapperBody.js";
|
|
8
|
+
import { Header as L } from "./components/Header/Header.js";
|
|
9
|
+
import { Body as rr } from "./components/Body/Body.js";
|
|
10
|
+
import { Pagination as er } from "./components/Pagination/Pagination.js";
|
|
11
|
+
import { TruncateText as or } from "./components/TruncateText/TruncateText.js";
|
|
12
|
+
import { Actions as ar } from "./components/Actions/Actions.js";
|
|
13
|
+
const tr = ({
|
|
14
|
+
id: c,
|
|
14
15
|
ariaLabel: p,
|
|
15
16
|
columns: d,
|
|
16
17
|
data: f,
|
|
17
18
|
totalItems: u = -1 / 0,
|
|
18
19
|
className: b,
|
|
19
20
|
classNameHeaderActiveArrows: T,
|
|
20
|
-
classNameHeaderArrows:
|
|
21
|
+
classNameHeaderArrows: v,
|
|
21
22
|
classNameHeaderTable: x,
|
|
22
|
-
classNameTable:
|
|
23
|
-
classNameWrapperTable:
|
|
23
|
+
classNameTable: E,
|
|
24
|
+
classNameWrapperTable: N,
|
|
24
25
|
isLoading: a,
|
|
25
|
-
getRowId:
|
|
26
|
-
fetchData:
|
|
27
|
-
queryOptions:
|
|
26
|
+
getRowId: w,
|
|
27
|
+
fetchData: A,
|
|
28
|
+
queryOptions: y,
|
|
28
29
|
// Pagination
|
|
29
|
-
showPagination:
|
|
30
|
+
showPagination: h,
|
|
30
31
|
showTotalItems: t,
|
|
31
32
|
showDropdownPagination: i,
|
|
32
33
|
showDotPagination: l,
|
|
33
34
|
showFormPagination: m,
|
|
34
|
-
pageSizes:
|
|
35
|
+
pageSizes: z,
|
|
35
36
|
// Filter
|
|
36
|
-
showFilter:
|
|
37
|
-
showFilterInput:
|
|
38
|
-
filterSearchPlaceholder:
|
|
39
|
-
multiSelectFilter:
|
|
40
|
-
filterActions:
|
|
41
|
-
showResetButton:
|
|
42
|
-
resetButtonClassName:
|
|
37
|
+
showFilter: B = !1,
|
|
38
|
+
showFilterInput: R,
|
|
39
|
+
filterSearchPlaceholder: V = "",
|
|
40
|
+
multiSelectFilter: g,
|
|
41
|
+
filterActions: j,
|
|
42
|
+
showResetButton: k = !0,
|
|
43
|
+
resetButtonClassName: P,
|
|
43
44
|
// Hover row
|
|
44
|
-
enableHoverRow:
|
|
45
|
-
classNameHoverRow:
|
|
45
|
+
enableHoverRow: C,
|
|
46
|
+
classNameHoverRow: H,
|
|
46
47
|
// Expandable rows
|
|
47
|
-
enableExpandedRow:
|
|
48
|
-
expandedState:
|
|
49
|
-
defaultExpanded:
|
|
50
|
-
classNameExpandedRow:
|
|
51
|
-
classNameExpandedCell:
|
|
52
|
-
classNameExpandedContent:
|
|
53
|
-
classNameExpandedHeader:
|
|
54
|
-
classNameActiveExpandedRow:
|
|
55
|
-
onExpandedChange:
|
|
56
|
-
renderExpandedRow:
|
|
48
|
+
enableExpandedRow: I,
|
|
49
|
+
expandedState: K,
|
|
50
|
+
defaultExpanded: M,
|
|
51
|
+
classNameExpandedRow: W,
|
|
52
|
+
classNameExpandedCell: q,
|
|
53
|
+
classNameExpandedContent: F,
|
|
54
|
+
classNameExpandedHeader: G,
|
|
55
|
+
classNameActiveExpandedRow: J,
|
|
56
|
+
onExpandedChange: O,
|
|
57
|
+
renderExpandedRow: Q,
|
|
57
58
|
keepExpandColumnVisible: S
|
|
58
59
|
}) => {
|
|
59
60
|
const e = U(
|
|
60
|
-
() =>
|
|
61
|
+
() => h || [
|
|
61
62
|
t,
|
|
62
63
|
i,
|
|
63
64
|
l,
|
|
@@ -66,90 +67,95 @@ const er = ({
|
|
|
66
67
|
[]
|
|
67
68
|
);
|
|
68
69
|
return /* @__PURE__ */ r(
|
|
69
|
-
|
|
70
|
+
_,
|
|
70
71
|
{
|
|
71
|
-
id:
|
|
72
|
+
id: c,
|
|
72
73
|
columns: d,
|
|
73
74
|
data: f,
|
|
74
|
-
getRowId:
|
|
75
|
-
fetchData:
|
|
75
|
+
getRowId: w,
|
|
76
|
+
fetchData: A,
|
|
76
77
|
totalItems: u,
|
|
77
|
-
queryOptions:
|
|
78
|
+
queryOptions: y,
|
|
78
79
|
isPaginationEnabled: e,
|
|
79
|
-
enableExpandedRow:
|
|
80
|
-
expandedState:
|
|
81
|
-
onExpandedChange:
|
|
82
|
-
defaultExpanded:
|
|
83
|
-
classNameExpandedRow:
|
|
84
|
-
classNameExpandedCell:
|
|
85
|
-
classNameExpandedContent:
|
|
86
|
-
classNameExpandedHeader:
|
|
87
|
-
classNameActiveExpandedRow:
|
|
88
|
-
enableHoverRow:
|
|
89
|
-
classNameHoverRow:
|
|
90
|
-
renderExpandedRow:
|
|
80
|
+
enableExpandedRow: I,
|
|
81
|
+
expandedState: K,
|
|
82
|
+
onExpandedChange: O,
|
|
83
|
+
defaultExpanded: M,
|
|
84
|
+
classNameExpandedRow: W,
|
|
85
|
+
classNameExpandedCell: q,
|
|
86
|
+
classNameExpandedContent: F,
|
|
87
|
+
classNameExpandedHeader: G,
|
|
88
|
+
classNameActiveExpandedRow: J,
|
|
89
|
+
enableHoverRow: C,
|
|
90
|
+
classNameHoverRow: H,
|
|
91
|
+
renderExpandedRow: Q,
|
|
91
92
|
keepExpandColumnVisible: S,
|
|
92
|
-
children: /* @__PURE__ */
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
children: /* @__PURE__ */ n("section", { className: s("w-full min-w-fit", b), children: [
|
|
94
|
+
B && /* @__PURE__ */ r(
|
|
95
|
+
$,
|
|
95
96
|
{
|
|
96
|
-
actions:
|
|
97
|
-
multiSelectFilter:
|
|
98
|
-
placeholder:
|
|
99
|
-
showFilterInput:
|
|
100
|
-
showResetButton:
|
|
101
|
-
resetButtonClassName:
|
|
97
|
+
actions: j,
|
|
98
|
+
multiSelectFilter: g,
|
|
99
|
+
placeholder: V,
|
|
100
|
+
showFilterInput: R,
|
|
101
|
+
showResetButton: k,
|
|
102
|
+
resetButtonClassName: P
|
|
102
103
|
}
|
|
103
104
|
),
|
|
104
105
|
/* @__PURE__ */ r(
|
|
105
|
-
|
|
106
|
+
D,
|
|
106
107
|
{
|
|
107
108
|
showPagination: e,
|
|
108
|
-
classNameWrapperTable:
|
|
109
|
+
classNameWrapperTable: N,
|
|
109
110
|
isLoading: a,
|
|
110
|
-
children: /* @__PURE__ */
|
|
111
|
+
children: /* @__PURE__ */ n(
|
|
111
112
|
"table",
|
|
112
113
|
{
|
|
113
|
-
className:
|
|
114
|
+
className: s(
|
|
114
115
|
"w-full border-collapse table-auto",
|
|
115
116
|
"dark:border-separate dark:border-spacing-0",
|
|
116
|
-
|
|
117
|
+
E
|
|
117
118
|
),
|
|
118
119
|
"aria-label": p,
|
|
119
120
|
children: [
|
|
120
121
|
/* @__PURE__ */ r(
|
|
121
|
-
|
|
122
|
+
L,
|
|
122
123
|
{
|
|
123
124
|
className: x,
|
|
124
|
-
classNameArrows:
|
|
125
|
+
classNameArrows: v,
|
|
125
126
|
classNameActiveArrows: T
|
|
126
127
|
}
|
|
127
128
|
),
|
|
128
|
-
/* @__PURE__ */ r(
|
|
129
|
+
/* @__PURE__ */ r(rr, { isLoading: a, showPagination: e })
|
|
129
130
|
]
|
|
130
131
|
}
|
|
131
132
|
)
|
|
132
133
|
}
|
|
133
134
|
),
|
|
134
135
|
e && /* @__PURE__ */ r(
|
|
135
|
-
|
|
136
|
+
er,
|
|
136
137
|
{
|
|
137
138
|
showTotalItems: t,
|
|
138
139
|
showDropdownPagination: i,
|
|
139
140
|
showDotPagination: l,
|
|
140
141
|
showFormPagination: m,
|
|
141
|
-
pageSizes:
|
|
142
|
+
pageSizes: z,
|
|
142
143
|
isLoading: a
|
|
143
144
|
}
|
|
144
145
|
)
|
|
145
146
|
] })
|
|
146
147
|
}
|
|
147
148
|
);
|
|
148
|
-
}, o =
|
|
149
|
+
}, o = tr;
|
|
149
150
|
o.displayName = "KonstructVirtualizedTable";
|
|
150
|
-
o.TruncateText =
|
|
151
|
-
o.Actions =
|
|
151
|
+
o.TruncateText = or;
|
|
152
|
+
o.Actions = ar;
|
|
153
|
+
o.Events = {
|
|
154
|
+
sendExpandRowEvent: Z,
|
|
155
|
+
sendCollapseRowEvent: Y,
|
|
156
|
+
sendToggleRowEvent: X
|
|
157
|
+
};
|
|
152
158
|
export {
|
|
153
|
-
|
|
159
|
+
or as TruncateText,
|
|
154
160
|
o as VirtualizedTable
|
|
155
161
|
};
|
|
@@ -1,63 +1,65 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import { f as
|
|
1
|
+
import { jsx as a, jsxs as A } from "react/jsx-runtime";
|
|
2
|
+
import { f as B } from "../../../../index-CSWGJT-v.js";
|
|
3
3
|
import { Fragment as H } from "react";
|
|
4
4
|
import { Skeleton as M } from "../Skeleton/Skeleton.js";
|
|
5
|
-
import { cn as
|
|
6
|
-
import { ExpandableRow as
|
|
7
|
-
import { useTableContext as
|
|
8
|
-
const
|
|
9
|
-
isLoading:
|
|
5
|
+
import { cn as l } from "../../../../utils/index.js";
|
|
6
|
+
import { ExpandableRow as O } from "../ExpandableRow/ExpandableRow.js";
|
|
7
|
+
import { useTableContext as V } from "../../contexts/table.hook.js";
|
|
8
|
+
const U = ({
|
|
9
|
+
isLoading: g,
|
|
10
10
|
showPagination: t
|
|
11
11
|
}) => {
|
|
12
12
|
const {
|
|
13
|
-
table:
|
|
14
|
-
pageSize:
|
|
15
|
-
tableFetching:
|
|
16
|
-
enableExpandedRow:
|
|
17
|
-
classNameExpandedRow:
|
|
18
|
-
classNameExpandedCell:
|
|
19
|
-
classNameExpandedContent:
|
|
13
|
+
table: i,
|
|
14
|
+
pageSize: h,
|
|
15
|
+
tableFetching: w,
|
|
16
|
+
enableExpandedRow: N,
|
|
17
|
+
classNameExpandedRow: R,
|
|
18
|
+
classNameExpandedCell: k,
|
|
19
|
+
classNameExpandedContent: E,
|
|
20
20
|
enableHoverRow: p,
|
|
21
|
-
classNameHoverRow:
|
|
21
|
+
classNameHoverRow: C,
|
|
22
22
|
classNameActiveExpandedRow: v,
|
|
23
|
-
renderExpandedRow:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
renderExpandedRow: b,
|
|
24
|
+
isBorderOnAdjacentCell: D,
|
|
25
|
+
isExpandColumnVisible: y
|
|
26
|
+
} = V();
|
|
27
|
+
if (g || w)
|
|
28
|
+
return /* @__PURE__ */ a(M, { numberOfRows: h, table: i });
|
|
29
|
+
const d = i.getRowModel().rows ?? [];
|
|
28
30
|
return /* @__PURE__ */ a(
|
|
29
31
|
"tbody",
|
|
30
32
|
{
|
|
31
|
-
className:
|
|
33
|
+
className: l(
|
|
32
34
|
"text-slate-800",
|
|
33
35
|
"text-sm",
|
|
34
36
|
"font-normal",
|
|
35
37
|
"relative",
|
|
36
38
|
"dark:border-x"
|
|
37
39
|
),
|
|
38
|
-
children:
|
|
39
|
-
const { id:
|
|
40
|
-
return /* @__PURE__ */
|
|
40
|
+
children: d.map((x, s) => {
|
|
41
|
+
const { id: m, original: c, getVisibleCells: j } = x, { meta: o = {} } = c, n = j(), e = N && x.getIsExpanded(), z = !!o.expandedRow || !!b, u = n[0]?.column.id !== "__expand" || y ? 0 : D ? 1 : null;
|
|
42
|
+
return /* @__PURE__ */ A(H, { children: [
|
|
41
43
|
/* @__PURE__ */ a(
|
|
42
44
|
"tr",
|
|
43
45
|
{
|
|
44
|
-
className:
|
|
46
|
+
className: l(
|
|
45
47
|
{ "group/row": p },
|
|
46
48
|
"border-b",
|
|
47
49
|
"border-b-gray-200",
|
|
48
50
|
"dark:text-metal-50",
|
|
49
51
|
"dark:border-b-metal-700",
|
|
50
52
|
"bg-transparent",
|
|
51
|
-
|
|
53
|
+
o.className
|
|
52
54
|
),
|
|
53
|
-
"data-row-id":
|
|
54
|
-
...
|
|
55
|
-
children:
|
|
56
|
-
const
|
|
55
|
+
"data-row-id": m,
|
|
56
|
+
...o.attributes ?? {},
|
|
57
|
+
children: n.map(({ id: F, column: r, getContext: S }, f) => {
|
|
58
|
+
const _ = typeof r.columnDef.meta?.className == "function" ? r.columnDef.meta?.className(c) : r.columnDef.meta?.className;
|
|
57
59
|
return /* @__PURE__ */ a(
|
|
58
60
|
"td",
|
|
59
61
|
{
|
|
60
|
-
className:
|
|
62
|
+
className: l(
|
|
61
63
|
"px-4",
|
|
62
64
|
"py-1",
|
|
63
65
|
"text-sm",
|
|
@@ -69,46 +71,46 @@ const J = ({
|
|
|
69
71
|
"dark:last:border-r",
|
|
70
72
|
{
|
|
71
73
|
"group-hover/row:bg-zinc-100 dark:group-hover/row:bg-metal-800": p,
|
|
72
|
-
[
|
|
74
|
+
[l(
|
|
73
75
|
"bg-zinc-100 dark:bg-metal-800",
|
|
74
76
|
v
|
|
75
77
|
)]: !!e
|
|
76
78
|
},
|
|
77
|
-
|
|
78
|
-
|
|
79
|
+
C,
|
|
80
|
+
_,
|
|
79
81
|
{
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
+
"rounded-bl-lg": s === d.length - 1 && u !== null && f === u && !t && !e,
|
|
83
|
+
"rounded-br-lg": s === d.length - 1 && f === n.length - 1 && !t && !e,
|
|
82
84
|
"dark:[tr:last-child_&]:border-b": !t
|
|
83
85
|
}
|
|
84
86
|
),
|
|
85
87
|
"data-expanded": e ? !0 : void 0,
|
|
86
88
|
...r.columnDef.meta?.attributes ?? {},
|
|
87
|
-
children:
|
|
89
|
+
children: B(r.columnDef.cell, S())
|
|
88
90
|
},
|
|
89
|
-
|
|
91
|
+
F
|
|
90
92
|
);
|
|
91
93
|
})
|
|
92
94
|
}
|
|
93
95
|
),
|
|
94
|
-
|
|
95
|
-
|
|
96
|
+
z && /* @__PURE__ */ a(
|
|
97
|
+
O,
|
|
96
98
|
{
|
|
97
|
-
classNameExpandedCell:
|
|
98
|
-
classNameExpandedContent:
|
|
99
|
-
classNameExpandedRow:
|
|
100
|
-
colSpan:
|
|
101
|
-
id:
|
|
99
|
+
classNameExpandedCell: k,
|
|
100
|
+
classNameExpandedContent: E,
|
|
101
|
+
classNameExpandedRow: R,
|
|
102
|
+
colSpan: n.length,
|
|
103
|
+
id: m,
|
|
102
104
|
isExpanded: !!e,
|
|
103
|
-
isLastRow:
|
|
104
|
-
children:
|
|
105
|
+
isLastRow: s === d.length - 1 && !t,
|
|
106
|
+
children: o.expandedRow ?? b?.(c)
|
|
105
107
|
}
|
|
106
108
|
)
|
|
107
|
-
] },
|
|
109
|
+
] }, m);
|
|
108
110
|
})
|
|
109
111
|
}
|
|
110
112
|
);
|
|
111
113
|
};
|
|
112
114
|
export {
|
|
113
|
-
|
|
115
|
+
U as Body
|
|
114
116
|
};
|
|
@@ -20,6 +20,8 @@ export type ContextType<TData extends RowData = RowData> = {
|
|
|
20
20
|
classNameActiveExpandedRow?: string;
|
|
21
21
|
enableHoverRow?: boolean;
|
|
22
22
|
classNameHoverRow?: string;
|
|
23
|
+
isBorderOnAdjacentCell?: boolean;
|
|
24
|
+
isExpandColumnVisible?: boolean;
|
|
23
25
|
renderExpandedRow?: (data: RowData) => ReactNode;
|
|
24
26
|
handlePage: (newPage: number) => void;
|
|
25
27
|
onPageSize: (newPageSize: number) => void;
|