@ledgerhq/lumen-ui-react 0.1.44 → 0.1.46
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/i18n/locales/de.json.d.ts +1 -3
- package/dist/i18n/locales/de.json.js +1 -1
- package/dist/i18n/locales/en.json.d.ts +1 -3
- package/dist/i18n/locales/en.json.js +1 -1
- package/dist/i18n/locales/es.json.d.ts +1 -3
- package/dist/i18n/locales/es.json.js +1 -1
- package/dist/i18n/locales/fr.json.d.ts +1 -3
- package/dist/i18n/locales/fr.json.js +1 -1
- package/dist/i18n/locales/ja.json.d.ts +1 -3
- package/dist/i18n/locales/ja.json.js +2 -2
- package/dist/i18n/locales/ko.json.d.ts +1 -3
- package/dist/i18n/locales/ko.json.js +2 -2
- package/dist/i18n/locales/pt.json.d.ts +1 -3
- package/dist/i18n/locales/pt.json.js +1 -1
- package/dist/i18n/locales/ru.json.d.ts +1 -3
- package/dist/i18n/locales/ru.json.js +1 -1
- package/dist/i18n/locales/th.json.d.ts +1 -3
- package/dist/i18n/locales/th.json.js +2 -2
- package/dist/i18n/locales/tr.json.d.ts +1 -3
- package/dist/i18n/locales/tr.json.js +2 -2
- package/dist/i18n/locales/zh.json.d.ts +1 -3
- package/dist/i18n/locales/zh.json.js +2 -2
- package/dist/index.js +172 -164
- package/dist/lib/Components/AmountDisplay/AmountDisplay.d.ts.map +1 -1
- package/dist/lib/Components/AmountDisplay/AmountDisplay.js +1 -0
- package/dist/lib/Components/AmountInput/AmountInput.d.ts +1 -1
- package/dist/lib/Components/AmountInput/AmountInput.d.ts.map +1 -1
- package/dist/lib/Components/AmountInput/AmountInput.js +34 -32
- package/dist/lib/Components/AmountInput/types.d.ts +8 -0
- package/dist/lib/Components/AmountInput/types.d.ts.map +1 -1
- package/dist/lib/Components/AmountInput/useAmountInputValue/useAmountInputValue.d.ts +1 -0
- package/dist/lib/Components/AmountInput/useAmountInputValue/useAmountInputValue.d.ts.map +1 -1
- package/dist/lib/Components/AmountInput/useAmountInputValue/useAmountInputValue.js +9 -8
- package/dist/lib/Components/Avatar/Avatar.d.ts +1 -4
- package/dist/lib/Components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/lib/Components/Avatar/Avatar.js +33 -40
- package/dist/lib/Components/Avatar/types.d.ts +0 -6
- package/dist/lib/Components/Avatar/types.d.ts.map +1 -1
- package/dist/lib/Components/BaseInput/BaseInput.js +13 -13
- package/dist/lib/Components/Button/BaseButton.d.ts +1 -1
- package/dist/lib/Components/Button/Button.js +9 -9
- package/dist/lib/Components/Card/Card.js +18 -18
- package/dist/lib/Components/DataTable/DataTable.d.ts.map +1 -1
- package/dist/lib/Components/DataTable/DataTable.js +97 -80
- package/dist/lib/Components/DataTable/types.d.ts +2 -1
- package/dist/lib/Components/DataTable/types.d.ts.map +1 -1
- package/dist/lib/Components/Divider/Divider.js +4 -4
- package/dist/lib/Components/DotIcon/DotIcon.js +5 -5
- package/dist/lib/Components/DotIndicator/getDotIndicatorProps.d.ts +24 -0
- package/dist/lib/Components/DotIndicator/getDotIndicatorProps.d.ts.map +1 -0
- package/dist/lib/Components/DotIndicator/getDotIndicatorProps.js +11 -0
- package/dist/lib/Components/DotIndicator/index.d.ts +1 -0
- package/dist/lib/Components/DotIndicator/index.d.ts.map +1 -1
- package/dist/lib/Components/Icon/Icon.js +4 -4
- package/dist/lib/Components/Link/Link.js +6 -6
- package/dist/lib/Components/MediaCard/MediaCard.js +4 -4
- package/dist/lib/Components/MediaImage/MediaImage.js +6 -6
- package/dist/lib/Components/Menu/Menu.d.ts +8 -3
- package/dist/lib/Components/Menu/Menu.d.ts.map +1 -1
- package/dist/lib/Components/Menu/Menu.js +40 -33
- package/dist/lib/Components/Menu/types.d.ts +6 -5
- package/dist/lib/Components/Menu/types.d.ts.map +1 -1
- package/dist/lib/Components/NavBar/NavBar.js +9 -9
- package/dist/lib/Components/Pagination/Pagination.js +10 -10
- package/dist/lib/Components/Popover/Popover.js +10 -10
- package/dist/lib/Components/SegmentedControl/SegmentedControl.d.ts +8 -3
- package/dist/lib/Components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/lib/Components/SegmentedControl/SegmentedControl.js +41 -32
- package/dist/lib/Components/SegmentedControl/types.d.ts +6 -5
- package/dist/lib/Components/SegmentedControl/types.d.ts.map +1 -1
- package/dist/lib/Components/Select/Select.d.ts +19 -5
- package/dist/lib/Components/Select/Select.d.ts.map +1 -1
- package/dist/lib/Components/Select/Select.js +127 -104
- package/dist/lib/Components/Select/index.d.ts +1 -1
- package/dist/lib/Components/Select/index.d.ts.map +1 -1
- package/dist/lib/Components/Select/types.d.ts +20 -19
- package/dist/lib/Components/Select/types.d.ts.map +1 -1
- package/dist/lib/Components/Select/useSelectItems/useSelectItems.d.ts +9 -9
- package/dist/lib/Components/Select/useSelectItems/useSelectItems.d.ts.map +1 -1
- package/dist/lib/Components/Select/utils/groupItems.d.ts +2 -2
- package/dist/lib/Components/Select/utils/groupItems.d.ts.map +1 -1
- package/dist/lib/Components/SideBar/SideBar.d.ts +11 -3
- package/dist/lib/Components/SideBar/SideBar.d.ts.map +1 -1
- package/dist/lib/Components/SideBar/SideBar.js +61 -51
- package/dist/lib/Components/SideBar/index.d.ts +2 -2
- package/dist/lib/Components/SideBar/index.d.ts.map +1 -1
- package/dist/lib/Components/SideBar/types.d.ts +7 -6
- package/dist/lib/Components/SideBar/types.d.ts.map +1 -1
- package/dist/lib/Components/Table/Table.d.ts +17 -1
- package/dist/lib/Components/Table/Table.d.ts.map +1 -1
- package/dist/lib/Components/Table/Table.js +74 -45
- package/dist/lib/Components/Table/types.d.ts +23 -0
- package/dist/lib/Components/Table/types.d.ts.map +1 -1
- package/dist/lib/Components/TileButton/TileButton.js +6 -6
- package/dist/lib/Components/Tooltip/Tooltip.js +4 -4
- package/dist/lib/Symbols/Icons/ChevronAscending.js +1 -1
- package/dist/lib/Symbols/Icons/ChevronDescending.js +1 -1
- package/dist/lib/Symbols/Icons/Contact.d.ts +29 -0
- package/dist/lib/Symbols/Icons/Contact.d.ts.map +1 -0
- package/dist/lib/Symbols/Icons/Contact.js +28 -0
- package/dist/lib/Symbols/index.d.ts +1 -0
- package/dist/lib/Symbols/index.d.ts.map +1 -1
- package/dist/lib/Symbols/index.js +388 -386
- package/dist/libs/utils-shared/dist/index.js +149 -148
- package/dist/package.json +3 -3
- package/package.json +3 -3
- package/dist/lib/Components/Design-tokens/shared.d.ts +0 -20
- package/dist/lib/Components/Design-tokens/shared.d.ts.map +0 -1
|
@@ -11,9 +11,6 @@ import { AvatarProps } from './types';
|
|
|
11
11
|
* import { Avatar } from '@ledgerhq/lumen-ui-react';
|
|
12
12
|
*
|
|
13
13
|
* <Avatar src="https://example.com/photo.jpg" size="md" />
|
|
14
|
-
*
|
|
15
|
-
* // With notification indicator
|
|
16
|
-
* <Avatar src="https://example.com/photo.jpg" showNotification />
|
|
17
14
|
*/
|
|
18
|
-
export declare const Avatar: ({ ref, className, src, alt, appearance, size, imgLoading,
|
|
15
|
+
export declare const Avatar: ({ ref, className, src, alt, appearance, size, imgLoading, ...props }: AvatarProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
16
|
//# sourceMappingURL=Avatar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Avatar/Avatar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Avatar/Avatar.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAiC3C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,MAAM,GAAI,sEASpB,WAAW,4CAwCb,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { cva as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { useCommonTranslation as
|
|
5
|
-
import { User as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
root: h(
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { cva as u } from "class-variance-authority";
|
|
3
|
+
import { useState as v, useEffect as b } from "react";
|
|
4
|
+
import { useCommonTranslation as g } from "../../../i18n/useCommonTranslation.js";
|
|
5
|
+
import { User as z } from "../../Symbols/Icons/User.js";
|
|
6
|
+
const x = {
|
|
7
|
+
root: u(
|
|
9
8
|
"relative inline-flex items-center justify-center rounded-full transition-colors",
|
|
10
9
|
{
|
|
11
10
|
variants: {
|
|
@@ -26,60 +25,54 @@ const k = {
|
|
|
26
25
|
}
|
|
27
26
|
}
|
|
28
27
|
)
|
|
29
|
-
},
|
|
28
|
+
}, h = {
|
|
30
29
|
sm: 16,
|
|
31
30
|
md: 24,
|
|
32
31
|
lg: 32,
|
|
33
32
|
xl: 40
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
size: a = "md",
|
|
44
|
-
imgLoading: f,
|
|
45
|
-
showNotification: p = !1,
|
|
46
|
-
...u
|
|
33
|
+
}, y = ({
|
|
34
|
+
ref: o,
|
|
35
|
+
className: n,
|
|
36
|
+
src: a,
|
|
37
|
+
alt: s,
|
|
38
|
+
appearance: l = "transparent",
|
|
39
|
+
size: r = "md",
|
|
40
|
+
imgLoading: i,
|
|
41
|
+
...m
|
|
47
42
|
}) => {
|
|
48
|
-
const { t:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}, [
|
|
52
|
-
const i = /* @__PURE__ */ t(
|
|
43
|
+
const { t: c } = g(), [d, t] = v(!1), p = !a || d, f = s || c("components.avatar.defaultAriaLabel");
|
|
44
|
+
return b(() => {
|
|
45
|
+
t(!1);
|
|
46
|
+
}, [a]), /* @__PURE__ */ e(
|
|
53
47
|
"div",
|
|
54
48
|
{
|
|
55
|
-
ref:
|
|
56
|
-
className:
|
|
49
|
+
ref: o,
|
|
50
|
+
className: x.root({ appearance: l, size: r, className: n }),
|
|
57
51
|
role: "img",
|
|
58
|
-
"aria-label":
|
|
59
|
-
...
|
|
60
|
-
children:
|
|
61
|
-
|
|
52
|
+
"aria-label": f,
|
|
53
|
+
...m,
|
|
54
|
+
children: p ? /* @__PURE__ */ e(
|
|
55
|
+
z,
|
|
62
56
|
{
|
|
63
57
|
className: "text-base",
|
|
64
|
-
size:
|
|
58
|
+
size: h[r],
|
|
65
59
|
"aria-label": "Fallback Icon",
|
|
66
60
|
"aria-hidden": "true"
|
|
67
61
|
}
|
|
68
|
-
) : /* @__PURE__ */
|
|
62
|
+
) : /* @__PURE__ */ e(
|
|
69
63
|
"img",
|
|
70
64
|
{
|
|
71
|
-
src:
|
|
65
|
+
src: a,
|
|
72
66
|
alt: "",
|
|
73
|
-
loading:
|
|
74
|
-
onError: () =>
|
|
67
|
+
loading: i,
|
|
68
|
+
onError: () => t(!0),
|
|
75
69
|
className: "size-full overflow-hidden rounded-full object-cover",
|
|
76
70
|
"aria-hidden": "true"
|
|
77
71
|
}
|
|
78
72
|
)
|
|
79
73
|
}
|
|
80
74
|
);
|
|
81
|
-
return s ? /* @__PURE__ */ t(j, { size: E[a], appearance: "red", children: i }) : i;
|
|
82
75
|
};
|
|
83
76
|
export {
|
|
84
|
-
|
|
77
|
+
y as Avatar
|
|
85
78
|
};
|
|
@@ -22,12 +22,6 @@ export type AvatarProps = {
|
|
|
22
22
|
* @default md
|
|
23
23
|
*/
|
|
24
24
|
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
25
|
-
/**
|
|
26
|
-
* Whether to show the notifications indicator.
|
|
27
|
-
* @optional
|
|
28
|
-
* @default false
|
|
29
|
-
*/
|
|
30
|
-
showNotification?: boolean;
|
|
31
25
|
/**
|
|
32
26
|
* Additional custom CSS classes to apply. Do not use this prop to modify the component's core appearance.
|
|
33
27
|
* @optional
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Avatar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAC;AAEnD,MAAM,MAAM,WAAW,GAAG;IACxB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC;IAEpC;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACjC
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Avatar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAC;AAEnD,MAAM,MAAM,WAAW,GAAG;IACxB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC;IAEpC;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACjC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAC/B,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -37,7 +37,7 @@ const te = u(
|
|
|
37
37
|
"group-has-disabled:text-disabled",
|
|
38
38
|
"peer-focus:top-6 peer-focus:translate-y-0 peer-focus:body-4",
|
|
39
39
|
"w-[calc(100%-var(--size-56))] truncate"
|
|
40
|
-
),
|
|
40
|
+
), se = u(ae, {
|
|
41
41
|
variants: {
|
|
42
42
|
status: {
|
|
43
43
|
default: "",
|
|
@@ -53,7 +53,7 @@ const te = u(
|
|
|
53
53
|
status: "default",
|
|
54
54
|
floated: !1
|
|
55
55
|
}
|
|
56
|
-
}),
|
|
56
|
+
}), oe = u("mt-8 flex items-center gap-2 body-3", {
|
|
57
57
|
variants: {
|
|
58
58
|
status: {
|
|
59
59
|
default: "text-muted",
|
|
@@ -90,8 +90,8 @@ const te = u(
|
|
|
90
90
|
}), { t: E } = Z(), t = K(null), L = Q(), c = k || `input-${L}`, A = D ?? (e === "error" ? !0 : void 0), i = a.value !== void 0, [H, f] = X(
|
|
91
91
|
a.defaultValue?.toString() || ""
|
|
92
92
|
), M = Y(
|
|
93
|
-
(
|
|
94
|
-
i || f(
|
|
93
|
+
(s) => {
|
|
94
|
+
i || f(s.target.value), h?.(s);
|
|
95
95
|
},
|
|
96
96
|
[i, h]
|
|
97
97
|
), O = i ? !!a.value && a.value.toString().length > 0 : H.length > 0, { inputPlaceholder: T, labelStaysFloatedWithPlaceholder: W } = G({
|
|
@@ -111,17 +111,17 @@ const te = u(
|
|
|
111
111
|
"div",
|
|
112
112
|
{
|
|
113
113
|
className: n(te({ status: e }), S),
|
|
114
|
-
onPointerDown: (
|
|
115
|
-
if (
|
|
116
|
-
const
|
|
117
|
-
if (!
|
|
118
|
-
const x =
|
|
114
|
+
onPointerDown: (s) => {
|
|
115
|
+
if (s.target.closest("input, button, a")) return;
|
|
116
|
+
const o = t.current;
|
|
117
|
+
if (!o) return;
|
|
118
|
+
const x = o.value.length > 0 ? o.value.length : 0;
|
|
119
119
|
window.requestAnimationFrame(() => {
|
|
120
120
|
try {
|
|
121
|
-
|
|
121
|
+
o.setSelectionRange(x, x);
|
|
122
122
|
} catch {
|
|
123
123
|
}
|
|
124
|
-
|
|
124
|
+
o.focus();
|
|
125
125
|
});
|
|
126
126
|
},
|
|
127
127
|
children: [
|
|
@@ -149,7 +149,7 @@ const te = u(
|
|
|
149
149
|
{
|
|
150
150
|
htmlFor: c,
|
|
151
151
|
className: n(
|
|
152
|
-
|
|
152
|
+
se({
|
|
153
153
|
status: e,
|
|
154
154
|
floated: W
|
|
155
155
|
}),
|
|
@@ -176,7 +176,7 @@ const te = u(
|
|
|
176
176
|
"div",
|
|
177
177
|
{
|
|
178
178
|
id: g,
|
|
179
|
-
className:
|
|
179
|
+
className: oe({ status: e }),
|
|
180
180
|
role: e === "error" ? "alert" : void 0,
|
|
181
181
|
children: [
|
|
182
182
|
e === "error" && /* @__PURE__ */ r(y, { size: 16, className: "text-error" }),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseButtonProps } from './types';
|
|
2
2
|
export declare const baseButtonVariants: (props?: ({
|
|
3
|
-
appearance?: "base" | "
|
|
3
|
+
appearance?: "base" | "gray" | "transparent" | "accent" | "no-background" | "red" | null | undefined;
|
|
4
4
|
disabled?: boolean | null | undefined;
|
|
5
5
|
loading?: boolean | null | undefined;
|
|
6
6
|
size?: "md" | "sm" | "lg" | "xs" | null | undefined;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { cn as
|
|
3
|
-
import { cva as
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { cn as d } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
+
import { cva as e } from "class-variance-authority";
|
|
4
4
|
import { BaseButton as b } from "./BaseButton.js";
|
|
5
|
-
const l =
|
|
5
|
+
const l = e("", {
|
|
6
6
|
variants: {
|
|
7
7
|
size: {
|
|
8
8
|
sm: "px-16 py-10 body-2-semi-bold",
|
|
@@ -15,22 +15,22 @@ const l = d("", {
|
|
|
15
15
|
}
|
|
16
16
|
}), x = ({
|
|
17
17
|
ref: t,
|
|
18
|
-
className:
|
|
19
|
-
loading:
|
|
18
|
+
className: s,
|
|
19
|
+
loading: m,
|
|
20
20
|
disabled: r,
|
|
21
21
|
children: a,
|
|
22
22
|
size: o,
|
|
23
23
|
icon: i,
|
|
24
24
|
...p
|
|
25
|
-
}) => /* @__PURE__ */
|
|
25
|
+
}) => /* @__PURE__ */ n(
|
|
26
26
|
b,
|
|
27
27
|
{
|
|
28
28
|
ref: t,
|
|
29
29
|
size: o,
|
|
30
30
|
disabled: r,
|
|
31
31
|
icon: i,
|
|
32
|
-
loading:
|
|
33
|
-
className:
|
|
32
|
+
loading: m,
|
|
33
|
+
className: d(l({ size: o }), "gap-8", s),
|
|
34
34
|
...p,
|
|
35
35
|
children: a
|
|
36
36
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as s, jsxs as f, Fragment as b } from "react/jsx-runtime";
|
|
2
|
-
import { createSafeContext as m, DisabledProvider as
|
|
3
|
-
import { cva as
|
|
2
|
+
import { createSafeContext as m, DisabledProvider as p, cn as o, getButtonA11yProps as C } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
+
import { cva as g } from "class-variance-authority";
|
|
4
4
|
import { useMemo as h } from "react";
|
|
5
5
|
import { ChevronUp as N } from "../../Symbols/Icons/ChevronUp.js";
|
|
6
6
|
import { ChevronDown as w } from "../../Symbols/Icons/ChevronDown.js";
|
|
@@ -46,7 +46,7 @@ const k = ({
|
|
|
46
46
|
}
|
|
47
47
|
), [q, v] = m("CardContentAlign", {
|
|
48
48
|
align: "left"
|
|
49
|
-
}), E =
|
|
49
|
+
}), E = g(
|
|
50
50
|
"flex w-full flex-col overflow-clip rounded-lg bg-surface text-base transition-colors",
|
|
51
51
|
{
|
|
52
52
|
variants: {
|
|
@@ -96,7 +96,7 @@ const k = ({
|
|
|
96
96
|
}),
|
|
97
97
|
[r, e, l, i]
|
|
98
98
|
);
|
|
99
|
-
return /* @__PURE__ */ s(R, { value: u, children: /* @__PURE__ */ s(
|
|
99
|
+
return /* @__PURE__ */ s(R, { value: u, children: /* @__PURE__ */ s(p, { value: { disabled: i }, children: /* @__PURE__ */ s(
|
|
100
100
|
"div",
|
|
101
101
|
{
|
|
102
102
|
ref: t,
|
|
@@ -144,7 +144,7 @@ const k = ({
|
|
|
144
144
|
]
|
|
145
145
|
}
|
|
146
146
|
);
|
|
147
|
-
},
|
|
147
|
+
}, V = ({
|
|
148
148
|
ref: t,
|
|
149
149
|
children: a,
|
|
150
150
|
className: r,
|
|
@@ -157,7 +157,7 @@ const k = ({
|
|
|
157
157
|
...e,
|
|
158
158
|
children: a
|
|
159
159
|
}
|
|
160
|
-
),
|
|
160
|
+
), z = ({
|
|
161
161
|
ref: t,
|
|
162
162
|
children: a,
|
|
163
163
|
className: r,
|
|
@@ -203,7 +203,7 @@ const k = ({
|
|
|
203
203
|
children: a
|
|
204
204
|
}
|
|
205
205
|
);
|
|
206
|
-
},
|
|
206
|
+
}, U = ({
|
|
207
207
|
ref: t,
|
|
208
208
|
children: a,
|
|
209
209
|
className: r,
|
|
@@ -226,7 +226,7 @@ const k = ({
|
|
|
226
226
|
children: a
|
|
227
227
|
}
|
|
228
228
|
);
|
|
229
|
-
},
|
|
229
|
+
}, I = ({
|
|
230
230
|
ref: t,
|
|
231
231
|
children: a,
|
|
232
232
|
className: r,
|
|
@@ -249,7 +249,7 @@ const k = ({
|
|
|
249
249
|
children: a
|
|
250
250
|
}
|
|
251
251
|
);
|
|
252
|
-
},
|
|
252
|
+
}, L = ({
|
|
253
253
|
ref: t,
|
|
254
254
|
children: a,
|
|
255
255
|
className: r,
|
|
@@ -272,7 +272,7 @@ const k = ({
|
|
|
272
272
|
children: a
|
|
273
273
|
}
|
|
274
274
|
) });
|
|
275
|
-
},
|
|
275
|
+
}, M = ({
|
|
276
276
|
ref: t,
|
|
277
277
|
children: a,
|
|
278
278
|
className: r,
|
|
@@ -304,7 +304,7 @@ const k = ({
|
|
|
304
304
|
) })
|
|
305
305
|
}
|
|
306
306
|
);
|
|
307
|
-
},
|
|
307
|
+
}, S = ({
|
|
308
308
|
ref: t,
|
|
309
309
|
children: a,
|
|
310
310
|
className: r,
|
|
@@ -320,14 +320,14 @@ const k = ({
|
|
|
320
320
|
);
|
|
321
321
|
export {
|
|
322
322
|
P as Card,
|
|
323
|
-
|
|
324
|
-
|
|
323
|
+
z as CardContent,
|
|
324
|
+
I as CardContentDescription,
|
|
325
325
|
B as CardContentRow,
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
326
|
+
U as CardContentTitle,
|
|
327
|
+
M as CardFooter,
|
|
328
|
+
S as CardFooterActions,
|
|
329
329
|
T as CardHeader,
|
|
330
|
-
|
|
331
|
-
|
|
330
|
+
V as CardLeading,
|
|
331
|
+
L as CardTrailing,
|
|
332
332
|
k as resolveCardInnerContext
|
|
333
333
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/DataTable/DataTable.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,OAAO,EAER,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/DataTable/DataTable.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,OAAO,EAER,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAkBvD,OAAO,KAAK,EAGV,cAAc,EACd,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAejB;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,GAAI,KAAK,SAAS,OAAO,EAAE,sKAelD,kBAAkB,CAAC,KAAK,CAAC,4CAqB3B,CAAC;AAqFF;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,GAAI,8BAA8B,cAAc,4CA8BrE,CAAC;AAsHF;;;GAGG;AACH,eAAO,MAAM,0BAA0B,GAAI,wBAGxC,gBAAgB,4CAqBlB,CAAC"}
|
|
@@ -1,91 +1,107 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createSafeContext as
|
|
3
|
-
import { flexRender as
|
|
1
|
+
import { jsx as o, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { createSafeContext as f, cn as w } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
+
import { flexRender as d } from "@tanstack/react-table";
|
|
4
4
|
import { useCallback as R, Fragment as x } from "react";
|
|
5
|
-
import { TableRoot as B, Table as
|
|
6
|
-
import { SearchInput as
|
|
7
|
-
const [
|
|
5
|
+
import { TableRoot as B, Table as N, TableLoadingRow as k, TableColGroup as y, TableCol as H, TableHeader as S, TableHeaderRow as G, TableHeaderCell as q, TableSortButton as v, TableBody as b, TableGroupHeaderRow as I, TableRow as F, TableCell as M } from "../Table/Table.js";
|
|
6
|
+
import { SearchInput as V } from "../SearchInput/SearchInput.js";
|
|
7
|
+
const [j, i] = f("DataTableContext"), X = ({
|
|
8
8
|
table: l,
|
|
9
9
|
appearance: n = "no-background",
|
|
10
|
-
paginationMode:
|
|
10
|
+
paginationMode: t = "none",
|
|
11
11
|
loading: e = !1,
|
|
12
|
-
onScrollBottom:
|
|
13
|
-
onRowClick:
|
|
12
|
+
onScrollBottom: a,
|
|
13
|
+
onRowClick: s,
|
|
14
14
|
groupBy: r,
|
|
15
15
|
renderGroupHeader: c,
|
|
16
|
-
hideHeader:
|
|
16
|
+
hideHeader: u = !1,
|
|
17
17
|
stickyHeader: T = !0,
|
|
18
18
|
children: p,
|
|
19
19
|
className: D,
|
|
20
|
-
ref:
|
|
21
|
-
...
|
|
22
|
-
}) => /* @__PURE__ */
|
|
23
|
-
|
|
20
|
+
ref: h,
|
|
21
|
+
...C
|
|
22
|
+
}) => /* @__PURE__ */ o(
|
|
23
|
+
j,
|
|
24
24
|
{
|
|
25
25
|
value: {
|
|
26
|
-
hideHeader:
|
|
26
|
+
hideHeader: u,
|
|
27
27
|
stickyHeader: T,
|
|
28
|
-
paginationMode:
|
|
28
|
+
paginationMode: t,
|
|
29
29
|
table: l,
|
|
30
30
|
appearance: n,
|
|
31
31
|
loading: e,
|
|
32
|
-
onScrollBottom:
|
|
33
|
-
onRowClick:
|
|
32
|
+
onScrollBottom: a,
|
|
33
|
+
onRowClick: s,
|
|
34
34
|
groupBy: r,
|
|
35
35
|
renderGroupHeader: c
|
|
36
36
|
},
|
|
37
|
-
children: /* @__PURE__ */
|
|
37
|
+
children: /* @__PURE__ */ o("div", { ref: h, className: w("flex flex-col", D), ...C, children: p })
|
|
38
38
|
}
|
|
39
|
-
),
|
|
39
|
+
), L = () => {
|
|
40
|
+
const { table: l } = i({
|
|
41
|
+
consumerName: "DataTableColGroup",
|
|
42
|
+
contextRequired: !0
|
|
43
|
+
});
|
|
44
|
+
return /* @__PURE__ */ o(y, { children: l.getVisibleLeafColumns().map((n) => {
|
|
45
|
+
const t = n.columnDef.meta;
|
|
46
|
+
return /* @__PURE__ */ o(
|
|
47
|
+
H,
|
|
48
|
+
{
|
|
49
|
+
hideBelow: t?.hideBelow,
|
|
50
|
+
className: t?.className
|
|
51
|
+
},
|
|
52
|
+
n.id
|
|
53
|
+
);
|
|
54
|
+
}) });
|
|
55
|
+
}, P = ({
|
|
40
56
|
className: l,
|
|
41
57
|
ref: n,
|
|
42
|
-
...
|
|
58
|
+
...t
|
|
43
59
|
}) => {
|
|
44
|
-
const { table: e, stickyHeader:
|
|
60
|
+
const { table: e, stickyHeader: a } = i({
|
|
45
61
|
consumerName: "DataTableHeader",
|
|
46
62
|
contextRequired: !0
|
|
47
63
|
});
|
|
48
|
-
return /* @__PURE__ */
|
|
64
|
+
return /* @__PURE__ */ o(S, { ref: n, className: l, ...t, children: e.getHeaderGroups().map((s) => /* @__PURE__ */ o(G, { stickyHeader: a, children: s.headers.map((r) => {
|
|
49
65
|
const c = r.column.columnDef.meta;
|
|
50
|
-
return /* @__PURE__ */
|
|
51
|
-
|
|
66
|
+
return /* @__PURE__ */ o(
|
|
67
|
+
q,
|
|
52
68
|
{
|
|
53
69
|
align: c?.align,
|
|
54
70
|
hideBelow: c?.hideBelow,
|
|
55
71
|
className: c?.className,
|
|
56
72
|
trailingContent: c?.headerTrailingContent,
|
|
57
|
-
children: r.isPlaceholder ? null : r.column.getCanSort() ? /* @__PURE__ */
|
|
73
|
+
children: r.isPlaceholder ? null : r.column.getCanSort() ? /* @__PURE__ */ o(
|
|
58
74
|
v,
|
|
59
75
|
{
|
|
60
76
|
sortDirection: r.column.getIsSorted() || void 0,
|
|
61
77
|
onClick: r.column.getToggleSortingHandler(),
|
|
62
78
|
align: c?.align,
|
|
63
|
-
children:
|
|
79
|
+
children: d(
|
|
64
80
|
r.column.columnDef.header,
|
|
65
81
|
r.getContext()
|
|
66
82
|
)
|
|
67
83
|
}
|
|
68
|
-
) :
|
|
84
|
+
) : d(
|
|
69
85
|
r.column.columnDef.header,
|
|
70
86
|
r.getContext()
|
|
71
87
|
)
|
|
72
88
|
},
|
|
73
89
|
r.id
|
|
74
90
|
);
|
|
75
|
-
}) },
|
|
76
|
-
},
|
|
91
|
+
}) }, s.id)) });
|
|
92
|
+
}, Y = ({ className: l, ref: n, ...t }) => {
|
|
77
93
|
const {
|
|
78
94
|
appearance: e,
|
|
79
|
-
paginationMode:
|
|
80
|
-
hideHeader:
|
|
95
|
+
paginationMode: a,
|
|
96
|
+
hideHeader: s,
|
|
81
97
|
loading: r,
|
|
82
98
|
onScrollBottom: c,
|
|
83
|
-
groupBy:
|
|
84
|
-
} =
|
|
99
|
+
groupBy: u
|
|
100
|
+
} = i({
|
|
85
101
|
consumerName: "DataTable",
|
|
86
102
|
contextRequired: !0
|
|
87
103
|
});
|
|
88
|
-
return /* @__PURE__ */
|
|
104
|
+
return /* @__PURE__ */ m(
|
|
89
105
|
B,
|
|
90
106
|
{
|
|
91
107
|
ref: n,
|
|
@@ -93,92 +109,93 @@ const [M, u] = w("DataTableContext"), Q = ({
|
|
|
93
109
|
loading: r,
|
|
94
110
|
onScrollBottom: c,
|
|
95
111
|
className: l,
|
|
96
|
-
...
|
|
112
|
+
...t,
|
|
97
113
|
children: [
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
|
|
100
|
-
s
|
|
114
|
+
/* @__PURE__ */ m(N, { children: [
|
|
115
|
+
/* @__PURE__ */ o(L, {}),
|
|
116
|
+
!s && /* @__PURE__ */ o(P, {}),
|
|
117
|
+
u ? /* @__PURE__ */ o(A, {}) : /* @__PURE__ */ o(U, {})
|
|
101
118
|
] }),
|
|
102
|
-
|
|
119
|
+
a === "infinite-scroll" && /* @__PURE__ */ o(k, {})
|
|
103
120
|
]
|
|
104
121
|
}
|
|
105
122
|
);
|
|
106
|
-
},
|
|
107
|
-
const { table: e } =
|
|
123
|
+
}, U = ({ className: l, ref: n, ...t }) => {
|
|
124
|
+
const { table: e } = i({
|
|
108
125
|
consumerName: "DataTableBody",
|
|
109
126
|
contextRequired: !0
|
|
110
127
|
});
|
|
111
|
-
return /* @__PURE__ */
|
|
112
|
-
},
|
|
113
|
-
const
|
|
128
|
+
return /* @__PURE__ */ o(b, { ref: n, className: l, ...t, children: e.getRowModel().rows.map((a) => /* @__PURE__ */ o(g, { row: a }, a.id)) });
|
|
129
|
+
}, z = (l, n) => {
|
|
130
|
+
const t = [];
|
|
114
131
|
let e = null;
|
|
115
|
-
for (const
|
|
116
|
-
const
|
|
117
|
-
(!e || e.key !==
|
|
132
|
+
for (const a of l) {
|
|
133
|
+
const s = n(a);
|
|
134
|
+
(!e || e.key !== s) && (e = { key: s, rows: [], count: 0 }, t.push(e)), e.rows.push(a), e.count++;
|
|
118
135
|
}
|
|
119
|
-
return
|
|
120
|
-
},
|
|
136
|
+
return t;
|
|
137
|
+
}, A = ({
|
|
121
138
|
className: l,
|
|
122
139
|
ref: n,
|
|
123
|
-
...
|
|
140
|
+
...t
|
|
124
141
|
}) => {
|
|
125
|
-
const { table: e, groupBy:
|
|
142
|
+
const { table: e, groupBy: a, renderGroupHeader: s } = i({
|
|
126
143
|
consumerName: "DataTableGroupedBody",
|
|
127
144
|
contextRequired: !0
|
|
128
|
-
}), r =
|
|
129
|
-
return /* @__PURE__ */
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
-
c.rows.map((
|
|
145
|
+
}), r = z(e.getRowModel().rows, a);
|
|
146
|
+
return /* @__PURE__ */ o(b, { ref: n, className: l, ...t, children: r.map((c) => /* @__PURE__ */ m(x, { children: [
|
|
147
|
+
/* @__PURE__ */ o(I, { colSpan: c.rows[0].getVisibleCells().length, children: s ? s({ row: c.rows[0], count: c.count }) : c.key }),
|
|
148
|
+
c.rows.map((u) => /* @__PURE__ */ o(g, { row: u }, u.id))
|
|
132
149
|
] }, c.key)) });
|
|
133
150
|
}, g = ({ row: l }) => {
|
|
134
|
-
const { onRowClick: n } =
|
|
151
|
+
const { onRowClick: n } = i({
|
|
135
152
|
consumerName: "DataTableRow",
|
|
136
153
|
contextRequired: !0
|
|
137
|
-
}),
|
|
138
|
-
return /* @__PURE__ */
|
|
139
|
-
|
|
154
|
+
}), t = !!n;
|
|
155
|
+
return /* @__PURE__ */ o(
|
|
156
|
+
F,
|
|
140
157
|
{
|
|
141
|
-
clickable:
|
|
142
|
-
onClick:
|
|
158
|
+
clickable: t,
|
|
159
|
+
onClick: t ? () => n?.(l) : void 0,
|
|
143
160
|
children: l.getVisibleCells().map((e) => {
|
|
144
|
-
const
|
|
145
|
-
return /* @__PURE__ */
|
|
146
|
-
|
|
161
|
+
const a = e.column.columnDef.meta;
|
|
162
|
+
return /* @__PURE__ */ o(
|
|
163
|
+
M,
|
|
147
164
|
{
|
|
148
|
-
align:
|
|
149
|
-
hideBelow:
|
|
150
|
-
className:
|
|
151
|
-
children:
|
|
165
|
+
align: a?.align,
|
|
166
|
+
hideBelow: a?.hideBelow,
|
|
167
|
+
className: a?.className,
|
|
168
|
+
children: d(e.column.columnDef.cell, e.getContext())
|
|
152
169
|
},
|
|
153
170
|
e.id
|
|
154
171
|
);
|
|
155
172
|
})
|
|
156
173
|
}
|
|
157
174
|
);
|
|
158
|
-
},
|
|
175
|
+
}, Z = ({
|
|
159
176
|
onChange: l,
|
|
160
177
|
...n
|
|
161
178
|
}) => {
|
|
162
|
-
const { table:
|
|
179
|
+
const { table: t } = i({
|
|
163
180
|
consumerName: "DataTableGlobalSearchInput",
|
|
164
181
|
contextRequired: !0
|
|
165
182
|
}), e = R(
|
|
166
|
-
(
|
|
167
|
-
|
|
183
|
+
(a) => {
|
|
184
|
+
t.setGlobalFilter(a.target.value), l?.(a);
|
|
168
185
|
},
|
|
169
|
-
[
|
|
186
|
+
[t, l]
|
|
170
187
|
);
|
|
171
|
-
return /* @__PURE__ */
|
|
172
|
-
|
|
188
|
+
return /* @__PURE__ */ o(
|
|
189
|
+
V,
|
|
173
190
|
{
|
|
174
|
-
value:
|
|
191
|
+
value: t.getState().globalFilter ?? "",
|
|
175
192
|
onChange: e,
|
|
176
193
|
...n
|
|
177
194
|
}
|
|
178
195
|
);
|
|
179
196
|
};
|
|
180
197
|
export {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
198
|
+
Y as DataTable,
|
|
199
|
+
Z as DataTableGlobalSearchInput,
|
|
200
|
+
X as DataTableRoot
|
|
184
201
|
};
|