@konstructio/ui 0.1.2-alpha.65 → 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/assets/icons/components/AlertOutline.d.ts +3 -0
- package/dist/assets/icons/components/AlertOutline.js +28 -0
- package/dist/assets/icons/components/index.d.ts +1 -0
- package/dist/assets/icons/components/index.js +126 -124
- package/dist/assets/icons/index.js +122 -120
- package/dist/components/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Breadcrumb/components/Item/Item.js +1 -1
- package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
- package/dist/components/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.js +1 -1
- package/dist/components/Checkbox/Checkbox.js +51 -51
- package/dist/components/Command/Command.js +1 -1
- package/dist/components/Command/components/Command.js +1 -1
- package/dist/components/Command/components/CommandEmpty.js +1 -1
- package/dist/components/Command/components/CommandGroup.js +1 -1
- package/dist/components/Command/components/CommandInput.js +1 -1
- package/dist/components/Command/components/CommandItem.js +1 -1
- package/dist/components/Command/components/CommandList.js +1 -1
- package/dist/components/Command/components/CommandSeparator.js +1 -1
- package/dist/components/Command/components/DialogContent.js +1 -1
- package/dist/components/Command/components/DialogOverlay.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/CalendarMonth.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/IndependentModeCalendar/IndependentModeCalendar.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.js +1 -1
- package/dist/components/Datepicker/DatePicker.js +1 -1
- package/dist/components/Drawer/components/index.js +6 -6
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +1 -0
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +1 -1
- package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +1 -1
- package/dist/components/PhoneNumberInput/utils/index.js +1 -1
- package/dist/components/ProgressBar/ProgressBar.d.ts +0 -17
- package/dist/components/ProgressBar/ProgressBar.js +38 -59
- package/dist/components/ProgressBar/ProgressBar.types.d.ts +12 -28
- package/dist/components/ProgressBar/ProgressBar.variants.d.ts +3 -3
- package/dist/components/ProgressBar/ProgressBar.variants.js +23 -24
- package/dist/components/Range/Range.js +1 -1
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Spinner/Spinner.d.ts +4 -0
- package/dist/components/Spinner/Spinner.js +57 -0
- package/dist/components/Spinner/Spinner.types.d.ts +13 -0
- package/dist/components/Spinner/Spinner.variants.d.ts +6 -0
- package/dist/components/Spinner/Spinner.variants.js +54 -0
- package/dist/components/Switch/Switch.js +47 -47
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/Tabs/components/Content.js +1 -1
- package/dist/components/Tabs/components/List.js +1 -1
- package/dist/components/Tabs/components/Trigger.js +1 -1
- package/dist/components/Toast/Toast.js +9 -9
- package/dist/components/VirtualizedTable/VirtualizedTable.d.ts +5 -0
- package/dist/components/VirtualizedTable/VirtualizedTable.js +83 -71
- package/dist/components/VirtualizedTable/VirtualizedTable.types.d.ts +5 -0
- package/dist/components/VirtualizedTable/components/Body/Body.js +56 -53
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +1 -1
- package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +2 -2
- package/dist/components/VirtualizedTable/contexts/table.context.d.ts +4 -1
- package/dist/components/VirtualizedTable/contexts/table.provider.d.ts +1 -1
- package/dist/components/VirtualizedTable/contexts/table.provider.js +192 -108
- package/dist/components/VirtualizedTable/contexts/table.types.d.ts +4 -1
- package/dist/components/VirtualizedTable/events/index.d.ts +12 -0
- package/dist/components/VirtualizedTable/events/index.js +29 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +98 -91
- package/dist/icons.d.ts +1 -1
- package/dist/icons.js +122 -120
- package/dist/{index-DKfEnhKr.js → index--l0zux8V.js} +2 -2
- package/dist/{index-AV6ZtGhy.js → index-3fEdeexs.js} +1 -1
- package/dist/{index-CeZcoQDw.js → index-9a-FL_6D.js} +6 -6
- package/dist/{index-Dy59FQl5.js → index-BKMaItIC.js} +1 -1
- package/dist/{index-DtEcCIrM.js → index-BRXMsxSL.js} +1 -1
- package/dist/{index-DMb4KD0b.js → index-CESXsoMn.js} +1 -1
- package/dist/{index-BG8O18ZY.js → index-CJnS4BVW.js} +1 -1
- package/dist/{index-vcSp8YRZ.js → index-Cmf-IG4l.js} +10 -10
- package/dist/{index-Byr10W8m.js → index-DPcwqB8q.js} +618 -613
- package/dist/{index-BqhYevy7.js → index-Dd_ZmIqU.js} +19 -19
- package/dist/{index-D9SSJ6om.js → index-Dfq4O3b4.js} +3 -3
- package/dist/{index-gSPwC-1I.js → index-Jr0cra7i.js} +9 -9
- package/dist/{index-BlSRBdPy.js → index-URQGEGX7.js} +1 -1
- package/dist/index.js +142 -135
- package/dist/{libphonenumber-C9G59k5J.js → libphonenumber-aZ-2KWIf.js} +3 -3
- package/dist/package.json +21 -21
- package/dist/{proxy-BhEKW5n7.js → proxy-BIRlSMN_.js} +856 -851
- package/dist/styles.css +1 -1
- package/dist/useBreadcrumb-C_Wb2cXs.js +1435 -0
- package/dist/utils/index.js +514 -355
- package/package.json +21 -21
- package/dist/useBreadcrumb-vSs0pRo3.js +0 -1412
|
@@ -3,12 +3,12 @@ import { S as B } from "../../index-BvoZGpli.js";
|
|
|
3
3
|
import * as n from "react";
|
|
4
4
|
import { useRef as xe, useEffect as be, useMemo as re, isValidElement as ne, useCallback as ge } from "react";
|
|
5
5
|
import * as Se from "react-dom";
|
|
6
|
-
import { P as D,
|
|
6
|
+
import { P as D, a as Ne, c as x, b as Ie, d as Ae, u as De } from "../../index--l0zux8V.js";
|
|
7
7
|
import { u as ie } from "../../index-DLcqcWxM.js";
|
|
8
|
-
import { c as _e } from "../../index-
|
|
9
|
-
import { B as Fe, R as Le } from "../../index-
|
|
10
|
-
import { P as Me } from "../../index-
|
|
11
|
-
import { P as Oe } from "../../index-
|
|
8
|
+
import { c as _e } from "../../index-CJnS4BVW.js";
|
|
9
|
+
import { B as Fe, R as Le } from "../../index-URQGEGX7.js";
|
|
10
|
+
import { P as Me } from "../../index-CESXsoMn.js";
|
|
11
|
+
import { P as Oe } from "../../index-3fEdeexs.js";
|
|
12
12
|
import { u as X } from "../../index-0ioNhtNM.js";
|
|
13
13
|
import { R as ke } from "../../index-BKjcReYh.js";
|
|
14
14
|
import { cn as j } from "../../utils/index.js";
|
|
@@ -37,7 +37,7 @@ var Ue = Object.freeze({
|
|
|
37
37
|
)
|
|
38
38
|
);
|
|
39
39
|
Q.displayName = Xe;
|
|
40
|
-
var Z = "ToastProvider", [ee, Ye, $e] = _e("Toast"), [ce
|
|
40
|
+
var Z = "ToastProvider", [ee, Ye, $e] = _e("Toast"), [ce] = Ie("Toast", [$e]), [Be, Y] = ce(Z), ue = (e) => {
|
|
41
41
|
const {
|
|
42
42
|
__scopeToast: o,
|
|
43
43
|
label: r = "Notification",
|
|
@@ -192,7 +192,7 @@ var fe = "ToastFocusProxy", J = n.forwardRef(
|
|
|
192
192
|
J.displayName = fe;
|
|
193
193
|
var O = "Toast", qe = "toast.swipeStart", ze = "toast.swipeMove", Ge = "toast.swipeCancel", Je = "toast.swipeEnd", pe = n.forwardRef(
|
|
194
194
|
(e, o) => {
|
|
195
|
-
const { forceMount: r, open: t, defaultOpen: u, onOpenChange: d, ...f } = e, [w, v] =
|
|
195
|
+
const { forceMount: r, open: t, defaultOpen: u, onOpenChange: d, ...f } = e, [w, v] = Ne({
|
|
196
196
|
prop: t,
|
|
197
197
|
defaultProp: u ?? !0,
|
|
198
198
|
onChange: d,
|
|
@@ -448,7 +448,7 @@ function q(e) {
|
|
|
448
448
|
return e.some((r) => r === o ? !0 : (r.focus(), document.activeElement !== o));
|
|
449
449
|
}
|
|
450
450
|
var it = ue, ct = de, ut = pe, lt = me, dt = we, ft = ve;
|
|
451
|
-
const
|
|
451
|
+
const St = ({
|
|
452
452
|
title: e,
|
|
453
453
|
duration: o = 5e3,
|
|
454
454
|
titleClassName: r,
|
|
@@ -502,5 +502,5 @@ const Nt = ({
|
|
|
502
502
|
] });
|
|
503
503
|
};
|
|
504
504
|
export {
|
|
505
|
-
|
|
505
|
+
St as Toast
|
|
506
506
|
};
|
|
@@ -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,60 +1,64 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { cn as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { jsx as r, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as U } from "react";
|
|
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
|
-
|
|
26
|
-
|
|
26
|
+
getRowId: w,
|
|
27
|
+
fetchData: A,
|
|
28
|
+
queryOptions: y,
|
|
27
29
|
// Pagination
|
|
28
|
-
showPagination:
|
|
30
|
+
showPagination: h,
|
|
29
31
|
showTotalItems: t,
|
|
30
32
|
showDropdownPagination: i,
|
|
31
33
|
showDotPagination: l,
|
|
32
34
|
showFormPagination: m,
|
|
33
|
-
pageSizes:
|
|
35
|
+
pageSizes: z,
|
|
34
36
|
// Filter
|
|
35
|
-
showFilter:
|
|
36
|
-
showFilterInput:
|
|
37
|
-
filterSearchPlaceholder:
|
|
38
|
-
multiSelectFilter:
|
|
39
|
-
filterActions:
|
|
40
|
-
showResetButton:
|
|
41
|
-
resetButtonClassName:
|
|
37
|
+
showFilter: B = !1,
|
|
38
|
+
showFilterInput: R,
|
|
39
|
+
filterSearchPlaceholder: V = "",
|
|
40
|
+
multiSelectFilter: g,
|
|
41
|
+
filterActions: j,
|
|
42
|
+
showResetButton: k = !0,
|
|
43
|
+
resetButtonClassName: P,
|
|
42
44
|
// Hover row
|
|
43
|
-
enableHoverRow:
|
|
44
|
-
classNameHoverRow:
|
|
45
|
+
enableHoverRow: C,
|
|
46
|
+
classNameHoverRow: H,
|
|
45
47
|
// Expandable rows
|
|
46
|
-
enableExpandedRow:
|
|
47
|
-
expandedState:
|
|
48
|
-
defaultExpanded:
|
|
49
|
-
classNameExpandedRow:
|
|
50
|
-
classNameExpandedCell:
|
|
48
|
+
enableExpandedRow: I,
|
|
49
|
+
expandedState: K,
|
|
50
|
+
defaultExpanded: M,
|
|
51
|
+
classNameExpandedRow: W,
|
|
52
|
+
classNameExpandedCell: q,
|
|
51
53
|
classNameExpandedContent: F,
|
|
52
54
|
classNameExpandedHeader: G,
|
|
53
55
|
classNameActiveExpandedRow: J,
|
|
54
|
-
onExpandedChange: O
|
|
56
|
+
onExpandedChange: O,
|
|
57
|
+
renderExpandedRow: Q,
|
|
58
|
+
keepExpandColumnVisible: S
|
|
55
59
|
}) => {
|
|
56
|
-
const e =
|
|
57
|
-
() =>
|
|
60
|
+
const e = U(
|
|
61
|
+
() => h || [
|
|
58
62
|
t,
|
|
59
63
|
i,
|
|
60
64
|
l,
|
|
@@ -63,87 +67,95 @@ const D = ({
|
|
|
63
67
|
[]
|
|
64
68
|
);
|
|
65
69
|
return /* @__PURE__ */ r(
|
|
66
|
-
|
|
70
|
+
_,
|
|
67
71
|
{
|
|
68
|
-
id:
|
|
72
|
+
id: c,
|
|
69
73
|
columns: d,
|
|
70
74
|
data: f,
|
|
71
|
-
|
|
75
|
+
getRowId: w,
|
|
76
|
+
fetchData: A,
|
|
72
77
|
totalItems: u,
|
|
73
|
-
queryOptions:
|
|
78
|
+
queryOptions: y,
|
|
74
79
|
isPaginationEnabled: e,
|
|
75
|
-
enableExpandedRow:
|
|
76
|
-
expandedState:
|
|
80
|
+
enableExpandedRow: I,
|
|
81
|
+
expandedState: K,
|
|
77
82
|
onExpandedChange: O,
|
|
78
|
-
defaultExpanded:
|
|
79
|
-
classNameExpandedRow:
|
|
80
|
-
classNameExpandedCell:
|
|
83
|
+
defaultExpanded: M,
|
|
84
|
+
classNameExpandedRow: W,
|
|
85
|
+
classNameExpandedCell: q,
|
|
81
86
|
classNameExpandedContent: F,
|
|
82
87
|
classNameExpandedHeader: G,
|
|
83
88
|
classNameActiveExpandedRow: J,
|
|
84
|
-
enableHoverRow:
|
|
85
|
-
classNameHoverRow:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
+
enableHoverRow: C,
|
|
90
|
+
classNameHoverRow: H,
|
|
91
|
+
renderExpandedRow: Q,
|
|
92
|
+
keepExpandColumnVisible: S,
|
|
93
|
+
children: /* @__PURE__ */ n("section", { className: s("w-full min-w-fit", b), children: [
|
|
94
|
+
B && /* @__PURE__ */ r(
|
|
95
|
+
$,
|
|
89
96
|
{
|
|
90
|
-
actions:
|
|
91
|
-
multiSelectFilter:
|
|
92
|
-
placeholder:
|
|
93
|
-
showFilterInput:
|
|
94
|
-
showResetButton:
|
|
95
|
-
resetButtonClassName:
|
|
97
|
+
actions: j,
|
|
98
|
+
multiSelectFilter: g,
|
|
99
|
+
placeholder: V,
|
|
100
|
+
showFilterInput: R,
|
|
101
|
+
showResetButton: k,
|
|
102
|
+
resetButtonClassName: P
|
|
96
103
|
}
|
|
97
104
|
),
|
|
98
105
|
/* @__PURE__ */ r(
|
|
99
|
-
|
|
106
|
+
D,
|
|
100
107
|
{
|
|
101
108
|
showPagination: e,
|
|
102
|
-
classNameWrapperTable:
|
|
109
|
+
classNameWrapperTable: N,
|
|
103
110
|
isLoading: a,
|
|
104
|
-
children: /* @__PURE__ */
|
|
111
|
+
children: /* @__PURE__ */ n(
|
|
105
112
|
"table",
|
|
106
113
|
{
|
|
107
|
-
className:
|
|
114
|
+
className: s(
|
|
108
115
|
"w-full border-collapse table-auto",
|
|
109
116
|
"dark:border-separate dark:border-spacing-0",
|
|
110
|
-
|
|
117
|
+
E
|
|
111
118
|
),
|
|
112
119
|
"aria-label": p,
|
|
113
120
|
children: [
|
|
114
121
|
/* @__PURE__ */ r(
|
|
115
|
-
|
|
122
|
+
L,
|
|
116
123
|
{
|
|
117
124
|
className: x,
|
|
118
|
-
classNameArrows:
|
|
125
|
+
classNameArrows: v,
|
|
119
126
|
classNameActiveArrows: T
|
|
120
127
|
}
|
|
121
128
|
),
|
|
122
|
-
/* @__PURE__ */ r(
|
|
129
|
+
/* @__PURE__ */ r(rr, { isLoading: a, showPagination: e })
|
|
123
130
|
]
|
|
124
131
|
}
|
|
125
132
|
)
|
|
126
133
|
}
|
|
127
134
|
),
|
|
128
135
|
e && /* @__PURE__ */ r(
|
|
129
|
-
|
|
136
|
+
er,
|
|
130
137
|
{
|
|
131
138
|
showTotalItems: t,
|
|
132
139
|
showDropdownPagination: i,
|
|
133
140
|
showDotPagination: l,
|
|
134
141
|
showFormPagination: m,
|
|
135
|
-
pageSizes:
|
|
142
|
+
pageSizes: z,
|
|
136
143
|
isLoading: a
|
|
137
144
|
}
|
|
138
145
|
)
|
|
139
146
|
] })
|
|
140
147
|
}
|
|
141
148
|
);
|
|
142
|
-
}, o =
|
|
149
|
+
}, o = tr;
|
|
143
150
|
o.displayName = "KonstructVirtualizedTable";
|
|
144
|
-
o.TruncateText =
|
|
145
|
-
o.Actions =
|
|
151
|
+
o.TruncateText = or;
|
|
152
|
+
o.Actions = ar;
|
|
153
|
+
o.Events = {
|
|
154
|
+
sendExpandRowEvent: Z,
|
|
155
|
+
sendCollapseRowEvent: Y,
|
|
156
|
+
sendToggleRowEvent: X
|
|
157
|
+
};
|
|
146
158
|
export {
|
|
147
|
-
|
|
159
|
+
or as TruncateText,
|
|
148
160
|
o as VirtualizedTable
|
|
149
161
|
};
|
|
@@ -73,6 +73,7 @@ export type Props<TData extends RowDataPrimitive> = VariantProps<typeof virtuali
|
|
|
73
73
|
classNameHoverRow?: string;
|
|
74
74
|
queryOptions?: Omit<UseQueryOptions<any, any, any, any>, 'queryKey' | 'queryFn'>;
|
|
75
75
|
isLoading?: boolean;
|
|
76
|
+
getRowId?: (originalRow: TData, index: number) => string;
|
|
76
77
|
fetchData?: (params: Record<string, string | number | string[] | number[] | undefined>) => Promise<{
|
|
77
78
|
data: TData[];
|
|
78
79
|
totalItemsCount?: number;
|
|
@@ -119,6 +120,8 @@ export type Props<TData extends RowDataPrimitive> = VariantProps<typeof virtuali
|
|
|
119
120
|
classNameExpandedHeader?: string;
|
|
120
121
|
classNameActiveExpandedRow?: string;
|
|
121
122
|
onExpandedChange?: OnChangeFn<ExpandedState>;
|
|
123
|
+
renderExpandedRow?: (data: TData) => ReactNode;
|
|
124
|
+
keepExpandColumnVisible?: boolean | Record<string, boolean>;
|
|
122
125
|
} | {
|
|
123
126
|
enableExpandedRow?: false | undefined;
|
|
124
127
|
expandedState?: never;
|
|
@@ -129,4 +132,6 @@ export type Props<TData extends RowDataPrimitive> = VariantProps<typeof virtuali
|
|
|
129
132
|
classNameExpandedHeader?: never;
|
|
130
133
|
classNameActiveExpandedRow?: never;
|
|
131
134
|
onExpandedChange?: never;
|
|
135
|
+
renderExpandedRow?: never;
|
|
136
|
+
keepExpandColumnVisible?: never;
|
|
132
137
|
});
|
|
@@ -1,62 +1,65 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import { f as
|
|
3
|
-
import { Fragment as
|
|
4
|
-
import { Skeleton as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { ExpandableRow as
|
|
7
|
-
import { useTableContext as
|
|
8
|
-
const
|
|
9
|
-
isLoading:
|
|
1
|
+
import { jsx as a, jsxs as A } from "react/jsx-runtime";
|
|
2
|
+
import { f as B } from "../../../../index-CSWGJT-v.js";
|
|
3
|
+
import { Fragment as H } from "react";
|
|
4
|
+
import { Skeleton as M } from "../Skeleton/Skeleton.js";
|
|
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:
|
|
13
|
+
table: i,
|
|
14
|
+
pageSize: h,
|
|
15
|
+
tableFetching: w,
|
|
16
|
+
enableExpandedRow: N,
|
|
17
|
+
classNameExpandedRow: R,
|
|
18
18
|
classNameExpandedCell: k,
|
|
19
|
-
classNameExpandedContent:
|
|
20
|
-
enableHoverRow:
|
|
21
|
-
classNameHoverRow:
|
|
22
|
-
classNameActiveExpandedRow:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
classNameExpandedContent: E,
|
|
20
|
+
enableHoverRow: p,
|
|
21
|
+
classNameHoverRow: C,
|
|
22
|
+
classNameActiveExpandedRow: v,
|
|
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 ?? [];
|
|
27
30
|
return /* @__PURE__ */ a(
|
|
28
31
|
"tbody",
|
|
29
32
|
{
|
|
30
|
-
className:
|
|
33
|
+
className: l(
|
|
31
34
|
"text-slate-800",
|
|
32
35
|
"text-sm",
|
|
33
36
|
"font-normal",
|
|
34
37
|
"relative",
|
|
35
38
|
"dark:border-x"
|
|
36
39
|
),
|
|
37
|
-
children:
|
|
38
|
-
const { id:
|
|
39
|
-
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: [
|
|
40
43
|
/* @__PURE__ */ a(
|
|
41
44
|
"tr",
|
|
42
45
|
{
|
|
43
|
-
className:
|
|
44
|
-
{ "group/row":
|
|
46
|
+
className: l(
|
|
47
|
+
{ "group/row": p },
|
|
45
48
|
"border-b",
|
|
46
49
|
"border-b-gray-200",
|
|
47
50
|
"dark:text-metal-50",
|
|
48
51
|
"dark:border-b-metal-700",
|
|
49
52
|
"bg-transparent",
|
|
50
|
-
|
|
53
|
+
o.className
|
|
51
54
|
),
|
|
52
|
-
"data-row-id":
|
|
53
|
-
...
|
|
54
|
-
children:
|
|
55
|
-
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;
|
|
56
59
|
return /* @__PURE__ */ a(
|
|
57
60
|
"td",
|
|
58
61
|
{
|
|
59
|
-
className:
|
|
62
|
+
className: l(
|
|
60
63
|
"px-4",
|
|
61
64
|
"py-1",
|
|
62
65
|
"text-sm",
|
|
@@ -67,47 +70,47 @@ const G = ({
|
|
|
67
70
|
"dark:first:border-l",
|
|
68
71
|
"dark:last:border-r",
|
|
69
72
|
{
|
|
70
|
-
"group-hover/row:bg-zinc-100 dark:group-hover/row:bg-metal-800":
|
|
71
|
-
[
|
|
73
|
+
"group-hover/row:bg-zinc-100 dark:group-hover/row:bg-metal-800": p,
|
|
74
|
+
[l(
|
|
72
75
|
"bg-zinc-100 dark:bg-metal-800",
|
|
73
|
-
|
|
76
|
+
v
|
|
74
77
|
)]: !!e
|
|
75
78
|
},
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
C,
|
|
80
|
+
_,
|
|
78
81
|
{
|
|
79
|
-
"
|
|
80
|
-
"
|
|
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,
|
|
81
84
|
"dark:[tr:last-child_&]:border-b": !t
|
|
82
85
|
}
|
|
83
86
|
),
|
|
84
87
|
"data-expanded": e ? !0 : void 0,
|
|
85
88
|
...r.columnDef.meta?.attributes ?? {},
|
|
86
|
-
children:
|
|
89
|
+
children: B(r.columnDef.cell, S())
|
|
87
90
|
},
|
|
88
|
-
|
|
91
|
+
F
|
|
89
92
|
);
|
|
90
93
|
})
|
|
91
94
|
}
|
|
92
95
|
),
|
|
93
|
-
|
|
94
|
-
|
|
96
|
+
z && /* @__PURE__ */ a(
|
|
97
|
+
O,
|
|
95
98
|
{
|
|
96
99
|
classNameExpandedCell: k,
|
|
97
|
-
classNameExpandedContent:
|
|
98
|
-
classNameExpandedRow:
|
|
99
|
-
colSpan:
|
|
100
|
-
id:
|
|
100
|
+
classNameExpandedContent: E,
|
|
101
|
+
classNameExpandedRow: R,
|
|
102
|
+
colSpan: n.length,
|
|
103
|
+
id: m,
|
|
101
104
|
isExpanded: !!e,
|
|
102
|
-
isLastRow:
|
|
103
|
-
children:
|
|
105
|
+
isLastRow: s === d.length - 1 && !t,
|
|
106
|
+
children: o.expandedRow ?? b?.(c)
|
|
104
107
|
}
|
|
105
108
|
)
|
|
106
|
-
] },
|
|
109
|
+
] }, m);
|
|
107
110
|
})
|
|
108
111
|
}
|
|
109
112
|
);
|
|
110
113
|
};
|
|
111
114
|
export {
|
|
112
|
-
|
|
115
|
+
U as Body
|
|
113
116
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as r, jsxs as d } from "react/jsx-runtime";
|
|
2
|
-
import { P as u, R as b, T as m, C as p } from "../../../../index-
|
|
2
|
+
import { P as u, R as b, T as m, C as p } from "../../../../index-DPcwqB8q.js";
|
|
3
3
|
import { d as h } from "../../../../debounce-DJveWHr_.js";
|
|
4
4
|
import { useRef as x, useState as w, useCallback as g, useEffect as s } from "react";
|
|
5
5
|
const v = ({ getValue: l, value: i }) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ColumnSort, SortingState, Table } from '@tanstack/react-table';
|
|
2
|
-
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { Dispatch, ReactNode, SetStateAction } from 'react';
|
|
3
3
|
import { RowData } from '../VirtualizedTable.types';
|
|
4
4
|
export type ContextType<TData extends RowData = RowData> = {
|
|
5
5
|
sortedData: ColumnSort[];
|
|
@@ -20,6 +20,9 @@ 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;
|
|
25
|
+
renderExpandedRow?: (data: RowData) => ReactNode;
|
|
23
26
|
handlePage: (newPage: number) => void;
|
|
24
27
|
onPageSize: (newPageSize: number) => void;
|
|
25
28
|
onSorting: Dispatch<SetStateAction<SortingState>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { RowData } from '../VirtualizedTable.types';
|
|
2
2
|
import { Props } from './table.types';
|
|
3
|
-
export declare const TableProvider: <TData extends RowData = RowData>({ children, classNameExpandedCell, classNameExpandedContent, classNameExpandedRow, classNameExpandedHeader, classNameActiveExpandedRow, classNameHoverRow, columns, data: defaultData, defaultExpanded, enableExpandedRow, enableHoverRow, expandedState, id, isPaginationEnabled, queryOptions, totalItems, fetchData, onExpandedChange, }: Props<TData>) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const TableProvider: <TData extends RowData = RowData>({ children, classNameExpandedCell, classNameExpandedContent, classNameExpandedRow, classNameExpandedHeader, classNameActiveExpandedRow, classNameHoverRow, columns, data: defaultData, defaultExpanded, enableExpandedRow, enableHoverRow, expandedState, id, isPaginationEnabled, queryOptions, totalItems, getRowId, fetchData, onExpandedChange, renderExpandedRow, keepExpandColumnVisible, }: Props<TData>) => import("react/jsx-runtime").JSX.Element;
|