@ledgerhq/lumen-ui-react 0.0.82 → 0.0.84
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/ai-rules/RULES.md +1 -0
- package/dist/index.js +134 -126
- package/dist/lib/Components/Button/BaseButton.js +9 -9
- package/dist/lib/Components/DataTable/DataTable.d.ts +39 -0
- package/dist/lib/Components/DataTable/DataTable.d.ts.map +1 -0
- package/dist/lib/Components/DataTable/DataTable.js +195 -0
- package/dist/lib/Components/DataTable/index.d.ts +4 -0
- package/dist/lib/Components/DataTable/index.d.ts.map +1 -0
- package/dist/lib/Components/DataTable/types.d.ts +111 -0
- package/dist/lib/Components/DataTable/types.d.ts.map +1 -0
- package/dist/lib/Components/DataTable/useLumenDataTable/index.d.ts +2 -0
- package/dist/lib/Components/DataTable/useLumenDataTable/index.d.ts.map +1 -0
- package/dist/lib/Components/DataTable/useLumenDataTable/useLumenDataTable.d.ts +38 -0
- package/dist/lib/Components/DataTable/useLumenDataTable/useLumenDataTable.d.ts.map +1 -0
- package/dist/lib/Components/DataTable/useLumenDataTable/useLumenDataTable.js +10 -0
- package/dist/lib/Components/Skeleton/Skeleton.d.ts +4 -1
- package/dist/lib/Components/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/lib/Components/Skeleton/Skeleton.js +84 -98
- package/dist/lib/Components/Skeleton/types.d.ts +3 -3
- package/dist/lib/Components/Skeleton/types.d.ts.map +1 -1
- package/dist/lib/Components/Spot/Spot.d.ts +4 -1
- package/dist/lib/Components/Spot/Spot.d.ts.map +1 -1
- package/dist/lib/Components/Spot/Spot.js +23 -23
- package/dist/lib/Components/Spot/types.d.ts +2 -2
- package/dist/lib/Components/Spot/types.d.ts.map +1 -1
- package/dist/lib/Components/Stepper/Stepper.d.ts +17 -0
- package/dist/lib/Components/Stepper/Stepper.d.ts.map +1 -0
- package/dist/lib/Components/Stepper/Stepper.js +100 -0
- package/dist/lib/Components/Stepper/index.d.ts +3 -0
- package/dist/lib/Components/Stepper/index.d.ts.map +1 -0
- package/dist/lib/Components/Stepper/types.d.ts +21 -0
- package/dist/lib/Components/Stepper/types.d.ts.map +1 -0
- package/dist/lib/Components/Table/Table.d.ts +65 -81
- package/dist/lib/Components/Table/Table.d.ts.map +1 -1
- package/dist/lib/Components/Table/Table.js +306 -267
- package/dist/lib/Components/Table/types.d.ts +17 -17
- package/dist/lib/Components/Table/types.d.ts.map +1 -1
- package/dist/lib/Components/index.d.ts +2 -0
- package/dist/lib/Components/index.d.ts.map +1 -1
- package/dist/libs/utils-shared/dist/index.js +114 -90
- package/dist/package.json +2 -2
- package/package.json +2 -2
package/ai-rules/RULES.md
CHANGED
|
@@ -267,6 +267,7 @@ Below is a complete list of all available Lumen components. Click any component
|
|
|
267
267
|
- [Stepper](https://ldls.vercel.app/?path=/docs/feedback-stepper--docs) - Multi-step progress indicator
|
|
268
268
|
- [Subheader](https://ldls.vercel.app/?path=/docs/communication-subheader--docs) - Section subheader component
|
|
269
269
|
- [Switch](https://ldls.vercel.app/?path=/docs/selection-switch--docs) - Toggle switch component
|
|
270
|
+
- [Table](https://ldls.vercel.app/?path=/docs/communication-tag--docs) - Table component
|
|
270
271
|
- [Tag](https://ldls.vercel.app/?path=/docs/communication-tag--docs) - Label and tag component
|
|
271
272
|
- [TextInput](https://ldls.vercel.app/?path=/docs/input-textinput--docs) - Text input field
|
|
272
273
|
- [Tile](https://ldls.vercel.app/?path=/docs/containment-tile--docs) - Content container tile
|
package/dist/index.js
CHANGED
|
@@ -1,39 +1,42 @@
|
|
|
1
|
-
import { Languages as
|
|
1
|
+
import { Languages as t } from "./i18n/languages.js";
|
|
2
2
|
import { AddressInput as a } from "./lib/Components/AddressInput/AddressInput.js";
|
|
3
3
|
import { AmountInput as i } from "./lib/Components/AmountInput/AmountInput.js";
|
|
4
4
|
import { AmountDisplay as p } from "./lib/Components/AmountDisplay/AmountDisplay.js";
|
|
5
5
|
import { Avatar as T } from "./lib/Components/Avatar/Avatar.js";
|
|
6
6
|
import { Banner as x } from "./lib/Components/Banner/Banner.js";
|
|
7
7
|
import { BaseInput as S } from "./lib/Components/BaseInput/BaseInput.js";
|
|
8
|
-
import { Button as
|
|
8
|
+
import { Button as d } from "./lib/Components/Button/Button.js";
|
|
9
9
|
import { BaseButton as c } from "./lib/Components/Button/BaseButton.js";
|
|
10
10
|
import { CardButton as B } from "./lib/Components/CardButton/CardButton.js";
|
|
11
11
|
import { Checkbox as C } from "./lib/Components/Checkbox/Checkbox.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
12
|
+
import { DataTable as h, DataTableGlobalSearchInput as D, DataTableRoot as M } from "./lib/Components/DataTable/DataTable.js";
|
|
13
|
+
import { useLumenDataTable as A } from "./lib/Components/DataTable/useLumenDataTable/useLumenDataTable.js";
|
|
14
|
+
import { Dialog as w, DialogBody as k, DialogContent as G, DialogFooter as H, DialogTrigger as N } from "./lib/Components/Dialog/Dialog.js";
|
|
15
|
+
import { DialogHeader as P } from "./lib/Components/Dialog/DialogHeader/DialogHeader.js";
|
|
16
|
+
import { Divider as j } from "./lib/Components/Divider/Divider.js";
|
|
17
|
+
import { IconButton as z } from "./lib/Components/IconButton/IconButton.js";
|
|
18
|
+
import { InteractiveIcon as J } from "./lib/Components/InteractiveIcon/InteractiveIcon.js";
|
|
19
|
+
import { Link as O } from "./lib/Components/Link/Link.js";
|
|
20
|
+
import { ListItem as U, ListItemContent as V, ListItemDescription as W, ListItemIcon as X, ListItemLeading as Y, ListItemSpot as Z, ListItemTitle as _, ListItemTrailing as $, ListItemTruncate as ee } from "./lib/Components/ListItem/ListItem.js";
|
|
21
|
+
import { Menu as te, MenuCheckboxItem as re, MenuContent as ae, MenuGroup as ne, MenuItem as ie, MenuLabel as le, MenuPortal as pe, MenuRadioGroup as me, MenuRadioItem as Te, MenuSeparator as ue, MenuSub as xe, MenuSubContent as fe, MenuSubTrigger as Se, MenuTrigger as be } from "./lib/Components/Menu/Menu.js";
|
|
22
|
+
import { NavBar as ge, NavBarBackButton as ce, NavBarCoinCapsule as Ie, NavBarTitle as Be, NavBarTrailing as se } from "./lib/Components/NavBar/NavBar.js";
|
|
23
|
+
import { PageIndicator as Le } from "./lib/Components/PageIndicator/PageIndicator.js";
|
|
24
|
+
import { SearchInput as De } from "./lib/Components/SearchInput/SearchInput.js";
|
|
25
|
+
import { Select as ve, SelectContent as Ae, SelectGroup as Re, SelectItem as we, SelectItemText as ke, SelectLabel as Ge, SelectSeparator as He, SelectTrigger as Ne } from "./lib/Components/Select/Select.js";
|
|
26
|
+
import { SideBar as Pe, SideBarCollapseToggle as Fe, SideBarItem as je, SideBarLeading as qe, SideBarTrailing as ze } from "./lib/Components/SideBar/SideBar.js";
|
|
27
|
+
import { Skeleton as Je } from "./lib/Components/Skeleton/Skeleton.js";
|
|
28
|
+
import { Spinner as Oe } from "./lib/Components/Spinner/Spinner.js";
|
|
29
|
+
import { Spot as Ue } from "./lib/Components/Spot/Spot.js";
|
|
30
|
+
import { Stepper as We } from "./lib/Components/Stepper/Stepper.js";
|
|
31
|
+
import { Subheader as Ye, SubheaderAction as Ze, SubheaderCount as _e, SubheaderDescription as $e, SubheaderInfo as eo, SubheaderRow as oo, SubheaderShowMore as to, SubheaderTitle as ro } from "./lib/Components/Subheader/Subheader.js";
|
|
32
|
+
import { Switch as no } from "./lib/Components/Switch/Switch.js";
|
|
33
|
+
import { Table as lo, TableActionBar as po, TableActionBarLeading as mo, TableActionBarTrailing as To, TableBody as uo, TableCell as xo, TableCellContent as fo, TableGroupHeaderRow as So, TableHeader as bo, TableHeaderCell as go, TableHeaderRow as co, TableInfoIcon as Io, TableLoadingRow as Bo, TableRoot as so, TableRow as Co, TableSortButton as Lo } from "./lib/Components/Table/Table.js";
|
|
34
|
+
import { Tag as Do } from "./lib/Components/Tag/Tag.js";
|
|
35
|
+
import { TextInput as vo } from "./lib/Components/TextInput/TextInput.js";
|
|
36
|
+
import { Tile as Ro, TileContent as wo, TileDescription as ko, TileSecondaryAction as Go, TileSpot as Ho, TileTitle as No, TileTrailingContent as yo } from "./lib/Components/Tile/Tile.js";
|
|
37
|
+
import { TileButton as Fo } from "./lib/Components/TileButton/TileButton.js";
|
|
38
|
+
import { Tooltip as qo, TooltipContent as zo, TooltipProvider as Eo, TooltipTrigger as Jo } from "./lib/Components/Tooltip/Tooltip.js";
|
|
39
|
+
import { ThemeProvider as Oo, useTheme as Qo } from "./lib/Components/ThemeProvider/ThemeProvider.js";
|
|
37
40
|
export {
|
|
38
41
|
a as AddressInput,
|
|
39
42
|
p as AmountDisplay,
|
|
@@ -42,105 +45,110 @@ export {
|
|
|
42
45
|
x as Banner,
|
|
43
46
|
c as BaseButton,
|
|
44
47
|
S as BaseInput,
|
|
45
|
-
|
|
48
|
+
d as Button,
|
|
46
49
|
B as CardButton,
|
|
47
50
|
C as Checkbox,
|
|
48
|
-
h as
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
H as
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
se as
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
ze as
|
|
105
|
-
Je as
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
Ho as
|
|
143
|
-
No as
|
|
144
|
-
yo as
|
|
145
|
-
|
|
51
|
+
h as DataTable,
|
|
52
|
+
D as DataTableGlobalSearchInput,
|
|
53
|
+
M as DataTableRoot,
|
|
54
|
+
w as Dialog,
|
|
55
|
+
k as DialogBody,
|
|
56
|
+
G as DialogContent,
|
|
57
|
+
H as DialogFooter,
|
|
58
|
+
P as DialogHeader,
|
|
59
|
+
N as DialogTrigger,
|
|
60
|
+
j as Divider,
|
|
61
|
+
z as IconButton,
|
|
62
|
+
J as InteractiveIcon,
|
|
63
|
+
t as Languages,
|
|
64
|
+
O as Link,
|
|
65
|
+
U as ListItem,
|
|
66
|
+
V as ListItemContent,
|
|
67
|
+
W as ListItemDescription,
|
|
68
|
+
X as ListItemIcon,
|
|
69
|
+
Y as ListItemLeading,
|
|
70
|
+
Z as ListItemSpot,
|
|
71
|
+
_ as ListItemTitle,
|
|
72
|
+
$ as ListItemTrailing,
|
|
73
|
+
ee as ListItemTruncate,
|
|
74
|
+
te as Menu,
|
|
75
|
+
re as MenuCheckboxItem,
|
|
76
|
+
ae as MenuContent,
|
|
77
|
+
ne as MenuGroup,
|
|
78
|
+
ie as MenuItem,
|
|
79
|
+
le as MenuLabel,
|
|
80
|
+
pe as MenuPortal,
|
|
81
|
+
me as MenuRadioGroup,
|
|
82
|
+
Te as MenuRadioItem,
|
|
83
|
+
ue as MenuSeparator,
|
|
84
|
+
xe as MenuSub,
|
|
85
|
+
fe as MenuSubContent,
|
|
86
|
+
Se as MenuSubTrigger,
|
|
87
|
+
be as MenuTrigger,
|
|
88
|
+
ge as NavBar,
|
|
89
|
+
ce as NavBarBackButton,
|
|
90
|
+
Ie as NavBarCoinCapsule,
|
|
91
|
+
Be as NavBarTitle,
|
|
92
|
+
se as NavBarTrailing,
|
|
93
|
+
Le as PageIndicator,
|
|
94
|
+
De as SearchInput,
|
|
95
|
+
ve as Select,
|
|
96
|
+
Ae as SelectContent,
|
|
97
|
+
Re as SelectGroup,
|
|
98
|
+
we as SelectItem,
|
|
99
|
+
ke as SelectItemText,
|
|
100
|
+
Ge as SelectLabel,
|
|
101
|
+
He as SelectSeparator,
|
|
102
|
+
Ne as SelectTrigger,
|
|
103
|
+
Pe as SideBar,
|
|
104
|
+
Fe as SideBarCollapseToggle,
|
|
105
|
+
je as SideBarItem,
|
|
106
|
+
qe as SideBarLeading,
|
|
107
|
+
ze as SideBarTrailing,
|
|
108
|
+
Je as Skeleton,
|
|
109
|
+
Oe as Spinner,
|
|
110
|
+
Ue as Spot,
|
|
111
|
+
We as Stepper,
|
|
112
|
+
Ye as Subheader,
|
|
113
|
+
Ze as SubheaderAction,
|
|
114
|
+
_e as SubheaderCount,
|
|
115
|
+
$e as SubheaderDescription,
|
|
116
|
+
eo as SubheaderInfo,
|
|
117
|
+
oo as SubheaderRow,
|
|
118
|
+
to as SubheaderShowMore,
|
|
119
|
+
ro as SubheaderTitle,
|
|
120
|
+
no as Switch,
|
|
121
|
+
lo as Table,
|
|
122
|
+
po as TableActionBar,
|
|
123
|
+
mo as TableActionBarLeading,
|
|
124
|
+
To as TableActionBarTrailing,
|
|
125
|
+
uo as TableBody,
|
|
126
|
+
xo as TableCell,
|
|
127
|
+
fo as TableCellContent,
|
|
128
|
+
So as TableGroupHeaderRow,
|
|
129
|
+
bo as TableHeader,
|
|
130
|
+
go as TableHeaderCell,
|
|
131
|
+
co as TableHeaderRow,
|
|
132
|
+
Io as TableInfoIcon,
|
|
133
|
+
Bo as TableLoadingRow,
|
|
134
|
+
so as TableRoot,
|
|
135
|
+
Co as TableRow,
|
|
136
|
+
Lo as TableSortButton,
|
|
137
|
+
Do as Tag,
|
|
138
|
+
vo as TextInput,
|
|
139
|
+
Oo as ThemeProvider,
|
|
140
|
+
Ro as Tile,
|
|
141
|
+
Fo as TileButton,
|
|
142
|
+
wo as TileContent,
|
|
143
|
+
ko as TileDescription,
|
|
144
|
+
Go as TileSecondaryAction,
|
|
145
|
+
Ho as TileSpot,
|
|
146
|
+
No as TileTitle,
|
|
147
|
+
yo as TileTrailingContent,
|
|
148
|
+
qo as Tooltip,
|
|
149
|
+
zo as TooltipContent,
|
|
150
|
+
Eo as TooltipProvider,
|
|
151
|
+
Jo as TooltipTrigger,
|
|
152
|
+
A as useLumenDataTable,
|
|
153
|
+
Qo as useTheme
|
|
146
154
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as m, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { cn as
|
|
3
|
-
import { Slot as
|
|
2
|
+
import { cn as x } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
+
import { Slot as f, Slottable as h } from "@radix-ui/react-slot";
|
|
4
4
|
import { cva as d } from "class-variance-authority";
|
|
5
5
|
import { Spinner as z } from "../Spinner/Spinner.js";
|
|
6
6
|
const S = d(
|
|
@@ -37,12 +37,12 @@ const S = d(
|
|
|
37
37
|
{
|
|
38
38
|
disabled: !0,
|
|
39
39
|
loading: !1,
|
|
40
|
-
class: "cursor-
|
|
40
|
+
class: "cursor-not-allowed bg-disabled text-disabled hover:bg-disabled hover:text-disabled active:bg-disabled active:text-disabled"
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
disabled: !0,
|
|
44
44
|
loading: !0,
|
|
45
|
-
class: "cursor-
|
|
45
|
+
class: "cursor-not-allowed bg-disabled text-disabled hover:bg-disabled hover:text-disabled active:bg-disabled active:text-disabled"
|
|
46
46
|
}
|
|
47
47
|
],
|
|
48
48
|
defaultVariants: {
|
|
@@ -72,10 +72,10 @@ const S = d(
|
|
|
72
72
|
size: s,
|
|
73
73
|
isFull: v,
|
|
74
74
|
disabled: e = !1,
|
|
75
|
-
asChild:
|
|
75
|
+
asChild: i = !1,
|
|
76
76
|
icon: n,
|
|
77
77
|
loading: r = !1,
|
|
78
|
-
children:
|
|
78
|
+
children: o,
|
|
79
79
|
onClick: p,
|
|
80
80
|
...g
|
|
81
81
|
}) => {
|
|
@@ -86,9 +86,9 @@ const S = d(
|
|
|
86
86
|
lg: 24
|
|
87
87
|
}[s] : 24;
|
|
88
88
|
return /* @__PURE__ */ m(
|
|
89
|
-
|
|
89
|
+
i ? f : "button",
|
|
90
90
|
{
|
|
91
|
-
className:
|
|
91
|
+
className: x(
|
|
92
92
|
S({ disabled: e, loading: r, appearance: a, size: s, isFull: v }),
|
|
93
93
|
u
|
|
94
94
|
),
|
|
@@ -112,7 +112,7 @@ const S = d(
|
|
|
112
112
|
className: c({ appearance: a, disabled: e })
|
|
113
113
|
}
|
|
114
114
|
),
|
|
115
|
-
|
|
115
|
+
o && (i ? /* @__PURE__ */ t(h, { children: o }) : /* @__PURE__ */ t("span", { className: "line-clamp-2 text-left", children: o }))
|
|
116
116
|
]
|
|
117
117
|
}
|
|
118
118
|
);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { RowData } from '@tanstack/react-table';
|
|
2
|
+
import { SearchInputProps } from '../SearchInput';
|
|
3
|
+
import { DataTableProps, DataTableRootProps } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Context provider for the DataTable compound.
|
|
6
|
+
* Accepts a TanStack table instance and visual options, then makes them
|
|
7
|
+
* available to `DataTable` and future children like `DataTableActionBar`.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* <DataTableRoot table={table} appearance="plain">
|
|
11
|
+
* <DataTable />
|
|
12
|
+
* </DataTableRoot>
|
|
13
|
+
*/
|
|
14
|
+
export declare const DataTableRoot: {
|
|
15
|
+
<TData extends RowData>({ table, appearance, paginationMode, loading, onScrollBottom, onRowClick, groupBy, renderGroupHeader, hideHeader, children, className, ref, ...props }: DataTableRootProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
displayName: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Renders the full table (header + body) from the TanStack table instance
|
|
20
|
+
* provided by `DataTableRoot`. Internally composes the pure-UI Table building blocks.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* <DataTableRoot table={table}>
|
|
24
|
+
* <DataTable />
|
|
25
|
+
* </DataTableRoot>
|
|
26
|
+
*/
|
|
27
|
+
export declare const DataTable: {
|
|
28
|
+
({ className, ref, ...props }: DataTableProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
displayName: string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* A search input that connects to the TanStack table's `globalFilter` state
|
|
33
|
+
* via the `DataTableRoot` context. No external state management is required.
|
|
34
|
+
*/
|
|
35
|
+
export declare const DataTableGlobalSearchInput: {
|
|
36
|
+
({ onChange, ...props }: SearchInputProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
displayName: string;
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=DataTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/DataTable/DataTable.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,OAAO,EAER,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAe,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAe/D,OAAO,EAGL,cAAc,EACd,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAcjB;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa;KAAI,KAAK,SAAS,OAAO,0JAchD,kBAAkB,CAAC,KAAK,CAAC;;CAoB3B,CAAC;AA2DF;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS;mCAAkC,cAAc;;CA6BrE,CAAC;AA0HF;;;GAGG;AACH,eAAO,MAAM,0BAA0B;6BAGpC,gBAAgB;;CAqBlB,CAAC"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { jsx as c, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { createSafeContext as h, cn as x } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
+
import { flexRender as b } from "@tanstack/react-table";
|
|
4
|
+
import { useCallback as N, Fragment as B } from "react";
|
|
5
|
+
import { TableRoot as C, Table as S, TableLoadingRow as H, TableHeader as k, TableHeaderRow as G, TableHeaderCell as v, TableSortButton as q, TableBody as T, TableGroupHeaderRow as I, TableRow as F, TableCell as M } from "../Table/Table.js";
|
|
6
|
+
import { SearchInput as j } from "../SearchInput/SearchInput.js";
|
|
7
|
+
const [P, d] = h("DataTableContext"), V = ({
|
|
8
|
+
table: t,
|
|
9
|
+
appearance: r = "no-background",
|
|
10
|
+
paginationMode: n = "none",
|
|
11
|
+
loading: a = !1,
|
|
12
|
+
onScrollBottom: e,
|
|
13
|
+
onRowClick: l,
|
|
14
|
+
groupBy: o,
|
|
15
|
+
renderGroupHeader: s,
|
|
16
|
+
hideHeader: i = !1,
|
|
17
|
+
children: f,
|
|
18
|
+
className: y,
|
|
19
|
+
ref: w,
|
|
20
|
+
...R
|
|
21
|
+
}) => /* @__PURE__ */ c(
|
|
22
|
+
P,
|
|
23
|
+
{
|
|
24
|
+
value: {
|
|
25
|
+
hideHeader: i,
|
|
26
|
+
paginationMode: n,
|
|
27
|
+
table: t,
|
|
28
|
+
appearance: r,
|
|
29
|
+
loading: a,
|
|
30
|
+
onScrollBottom: e,
|
|
31
|
+
onRowClick: l,
|
|
32
|
+
groupBy: o,
|
|
33
|
+
renderGroupHeader: s
|
|
34
|
+
},
|
|
35
|
+
children: /* @__PURE__ */ c("div", { ref: w, className: x("flex flex-col", y), ...R, children: f })
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
V.displayName = "DataTableRoot";
|
|
39
|
+
const p = ({
|
|
40
|
+
className: t,
|
|
41
|
+
ref: r,
|
|
42
|
+
...n
|
|
43
|
+
}) => {
|
|
44
|
+
const { table: a } = d({
|
|
45
|
+
consumerName: "DataTableHeader",
|
|
46
|
+
contextRequired: !0
|
|
47
|
+
});
|
|
48
|
+
return /* @__PURE__ */ c(k, { ref: r, className: t, ...n, children: a.getHeaderGroups().map((e) => /* @__PURE__ */ c(G, { children: e.headers.map((l) => {
|
|
49
|
+
const o = l.column.columnDef.meta;
|
|
50
|
+
return /* @__PURE__ */ c(
|
|
51
|
+
v,
|
|
52
|
+
{
|
|
53
|
+
align: o == null ? void 0 : o.align,
|
|
54
|
+
hideBelow: o == null ? void 0 : o.hideBelow,
|
|
55
|
+
className: o == null ? void 0 : o.className,
|
|
56
|
+
trailingContent: o == null ? void 0 : o.headerTrailingContent,
|
|
57
|
+
children: l.isPlaceholder ? null : l.column.getCanSort() ? /* @__PURE__ */ c(
|
|
58
|
+
q,
|
|
59
|
+
{
|
|
60
|
+
sortDirection: l.column.getIsSorted() || void 0,
|
|
61
|
+
onClick: l.column.getToggleSortingHandler(),
|
|
62
|
+
align: o == null ? void 0 : o.align,
|
|
63
|
+
children: b(
|
|
64
|
+
l.column.columnDef.header,
|
|
65
|
+
l.getContext()
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
) : b(
|
|
69
|
+
l.column.columnDef.header,
|
|
70
|
+
l.getContext()
|
|
71
|
+
)
|
|
72
|
+
},
|
|
73
|
+
l.id
|
|
74
|
+
);
|
|
75
|
+
}) }, e.id)) });
|
|
76
|
+
};
|
|
77
|
+
p.displayName = "DataTableHeader";
|
|
78
|
+
const J = ({ className: t, ref: r, ...n }) => {
|
|
79
|
+
const {
|
|
80
|
+
appearance: a,
|
|
81
|
+
paginationMode: e,
|
|
82
|
+
hideHeader: l,
|
|
83
|
+
loading: o,
|
|
84
|
+
onScrollBottom: s,
|
|
85
|
+
groupBy: i
|
|
86
|
+
} = d({
|
|
87
|
+
consumerName: "DataTable",
|
|
88
|
+
contextRequired: !0
|
|
89
|
+
});
|
|
90
|
+
return /* @__PURE__ */ u(
|
|
91
|
+
C,
|
|
92
|
+
{
|
|
93
|
+
ref: r,
|
|
94
|
+
appearance: a,
|
|
95
|
+
loading: o,
|
|
96
|
+
onScrollBottom: s,
|
|
97
|
+
className: t,
|
|
98
|
+
...n,
|
|
99
|
+
children: [
|
|
100
|
+
/* @__PURE__ */ u(S, { children: [
|
|
101
|
+
!l && /* @__PURE__ */ c(p, {}),
|
|
102
|
+
i ? /* @__PURE__ */ c(g, {}) : /* @__PURE__ */ c(D, {})
|
|
103
|
+
] }),
|
|
104
|
+
e === "infinite-scroll" && /* @__PURE__ */ c(H, {})
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
);
|
|
108
|
+
};
|
|
109
|
+
J.displayName = "DataTable";
|
|
110
|
+
const D = ({ className: t, ref: r, ...n }) => {
|
|
111
|
+
const { table: a } = d({
|
|
112
|
+
consumerName: "DataTableBody",
|
|
113
|
+
contextRequired: !0
|
|
114
|
+
});
|
|
115
|
+
return /* @__PURE__ */ c(T, { ref: r, className: t, ...n, children: a.getRowModel().rows.map((e) => /* @__PURE__ */ c(m, { row: e }, e.id)) });
|
|
116
|
+
};
|
|
117
|
+
D.displayName = "DataTableBody";
|
|
118
|
+
const K = (t, r) => {
|
|
119
|
+
const n = [];
|
|
120
|
+
let a = null;
|
|
121
|
+
for (const e of t) {
|
|
122
|
+
const l = r(e);
|
|
123
|
+
(!a || a.key !== l) && (a = { key: l, rows: [], count: 0 }, n.push(a)), a.rows.push(e), a.count++;
|
|
124
|
+
}
|
|
125
|
+
return n;
|
|
126
|
+
}, g = ({
|
|
127
|
+
className: t,
|
|
128
|
+
ref: r,
|
|
129
|
+
...n
|
|
130
|
+
}) => {
|
|
131
|
+
const { table: a, groupBy: e, renderGroupHeader: l } = d({
|
|
132
|
+
consumerName: "DataTableGroupedBody",
|
|
133
|
+
contextRequired: !0
|
|
134
|
+
}), o = K(a.getRowModel().rows, e);
|
|
135
|
+
return /* @__PURE__ */ c(T, { ref: r, className: t, ...n, children: o.map((s) => /* @__PURE__ */ u(B, { children: [
|
|
136
|
+
/* @__PURE__ */ c(I, { colSpan: s.rows[0].getVisibleCells().length, children: l ? l({ row: s.rows[0], count: s.count }) : s.key }),
|
|
137
|
+
s.rows.map((i) => /* @__PURE__ */ c(m, { row: i }, i.id))
|
|
138
|
+
] }, s.key)) });
|
|
139
|
+
};
|
|
140
|
+
g.displayName = "DataTableGroupedBody";
|
|
141
|
+
const m = ({ row: t }) => {
|
|
142
|
+
const { onRowClick: r } = d({
|
|
143
|
+
consumerName: "DataTableRow",
|
|
144
|
+
contextRequired: !0
|
|
145
|
+
}), n = !!r;
|
|
146
|
+
return /* @__PURE__ */ c(
|
|
147
|
+
F,
|
|
148
|
+
{
|
|
149
|
+
clickable: n,
|
|
150
|
+
onClick: n ? () => r == null ? void 0 : r(t) : void 0,
|
|
151
|
+
children: t.getVisibleCells().map((a) => {
|
|
152
|
+
const e = a.column.columnDef.meta;
|
|
153
|
+
return /* @__PURE__ */ c(
|
|
154
|
+
M,
|
|
155
|
+
{
|
|
156
|
+
align: e == null ? void 0 : e.align,
|
|
157
|
+
hideBelow: e == null ? void 0 : e.hideBelow,
|
|
158
|
+
className: e == null ? void 0 : e.className,
|
|
159
|
+
children: b(a.column.columnDef.cell, a.getContext())
|
|
160
|
+
},
|
|
161
|
+
a.id
|
|
162
|
+
);
|
|
163
|
+
})
|
|
164
|
+
}
|
|
165
|
+
);
|
|
166
|
+
};
|
|
167
|
+
m.displayName = "DataTableRow";
|
|
168
|
+
const L = ({
|
|
169
|
+
onChange: t,
|
|
170
|
+
...r
|
|
171
|
+
}) => {
|
|
172
|
+
const { table: n } = d({
|
|
173
|
+
consumerName: "DataTableGlobalSearchInput",
|
|
174
|
+
contextRequired: !0
|
|
175
|
+
}), a = N(
|
|
176
|
+
(e) => {
|
|
177
|
+
n.setGlobalFilter(e.target.value), t == null || t(e);
|
|
178
|
+
},
|
|
179
|
+
[n, t]
|
|
180
|
+
);
|
|
181
|
+
return /* @__PURE__ */ c(
|
|
182
|
+
j,
|
|
183
|
+
{
|
|
184
|
+
value: n.getState().globalFilter ?? "",
|
|
185
|
+
onChange: a,
|
|
186
|
+
...r
|
|
187
|
+
}
|
|
188
|
+
);
|
|
189
|
+
};
|
|
190
|
+
L.displayName = "DataTableGlobalSearchInput";
|
|
191
|
+
export {
|
|
192
|
+
J as DataTable,
|
|
193
|
+
L as DataTableGlobalSearchInput,
|
|
194
|
+
V as DataTableRoot
|
|
195
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/DataTable/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,uCAAuC,CAAC"}
|