@yuno-payments/dashboard-design-system 0.0.151 → 0.0.154
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/components/atoms/checkbox/checkbox.d.ts +8 -0
- package/dist/components/atoms/checkbox/checkbox.js +26 -14
- package/dist/components/atoms/combobox/combobox.js +1 -1
- package/dist/components/atoms/label/index.d.ts +1 -1
- package/dist/components/atoms/label/label.d.ts +11 -0
- package/dist/components/atoms/label/label.js +28 -0
- package/dist/components/atoms/password-field/password-field.js +1 -1
- package/dist/components/atoms/radio-group/radio-group-option.js +1 -1
- package/dist/components/atoms/search-field/search-field.js +1 -1
- package/dist/components/atoms/select/select.js +1 -1
- package/dist/components/atoms/switch/switch.d.ts +8 -0
- package/dist/components/atoms/switch/switch.js +35 -32
- package/dist/components/atoms/textarea/textarea.js +1 -1
- package/dist/components/organisms/data-table/data-table.d.ts +6 -1
- package/dist/components/organisms/data-table/data-table.js +97 -94
- package/dist/components/organisms/data-table/data-table.types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -17,6 +17,14 @@ export interface CheckboxProps extends Omit<ComponentProps<typeof ShadcnCheckbox
|
|
|
17
17
|
* Provides a synthetic ChangeEvent compatible with react-hook-form
|
|
18
18
|
*/
|
|
19
19
|
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Additional CSS classes to apply to the label element
|
|
22
|
+
*/
|
|
23
|
+
labelClassName?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Optional info icon with tooltip
|
|
26
|
+
*/
|
|
27
|
+
info?: string;
|
|
20
28
|
}
|
|
21
29
|
/**
|
|
22
30
|
* Checkbox component with optional label and description.
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import { j as e } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { Checkbox as
|
|
2
|
+
import { forwardRef as g, useId as C } from "react";
|
|
3
|
+
import { Checkbox as j } from "../../../vendor/shadcn/checkbox.js";
|
|
4
4
|
import { cn as x } from "../../../lib/utils.js";
|
|
5
|
-
import { Label as
|
|
6
|
-
const
|
|
7
|
-
({
|
|
8
|
-
|
|
5
|
+
import { Label as k } from "../label/label.js";
|
|
6
|
+
const v = g(
|
|
7
|
+
({
|
|
8
|
+
label: n,
|
|
9
|
+
description: c,
|
|
10
|
+
id: i,
|
|
11
|
+
name: t,
|
|
12
|
+
disabled: s,
|
|
13
|
+
onChange: a,
|
|
14
|
+
labelClassName: f,
|
|
15
|
+
info: l,
|
|
16
|
+
...p
|
|
17
|
+
}, h) => {
|
|
18
|
+
const u = C(), o = i || t || u, d = (r) => {
|
|
9
19
|
if (!a) return;
|
|
10
20
|
a({
|
|
11
21
|
target: {
|
|
@@ -26,14 +36,14 @@ const j = u(
|
|
|
26
36
|
}
|
|
27
37
|
});
|
|
28
38
|
}, m = /* @__PURE__ */ e.jsx(
|
|
29
|
-
|
|
39
|
+
j,
|
|
30
40
|
{
|
|
31
|
-
ref:
|
|
41
|
+
ref: h,
|
|
32
42
|
id: o,
|
|
33
43
|
name: t,
|
|
34
44
|
disabled: s,
|
|
35
|
-
onCheckedChange:
|
|
36
|
-
...
|
|
45
|
+
onCheckedChange: d,
|
|
46
|
+
...p,
|
|
37
47
|
className: "size-3.5 cursor-pointer"
|
|
38
48
|
}
|
|
39
49
|
);
|
|
@@ -41,12 +51,14 @@ const j = u(
|
|
|
41
51
|
m,
|
|
42
52
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
43
53
|
/* @__PURE__ */ e.jsx(
|
|
44
|
-
|
|
54
|
+
k,
|
|
45
55
|
{
|
|
46
56
|
htmlFor: o,
|
|
57
|
+
info: l,
|
|
47
58
|
className: x(
|
|
48
59
|
"text-sm leading-none cursor-pointer",
|
|
49
|
-
s && "text-muted-foreground"
|
|
60
|
+
s && "text-muted-foreground",
|
|
61
|
+
f
|
|
50
62
|
),
|
|
51
63
|
children: n
|
|
52
64
|
}
|
|
@@ -65,7 +77,7 @@ const j = u(
|
|
|
65
77
|
] }) : m;
|
|
66
78
|
}
|
|
67
79
|
);
|
|
68
|
-
|
|
80
|
+
v.displayName = "Checkbox";
|
|
69
81
|
export {
|
|
70
|
-
|
|
82
|
+
v as Checkbox
|
|
71
83
|
};
|
|
@@ -3,7 +3,7 @@ import { forwardRef as Y, useState as y, useRef as Z, useEffect as I } from "rea
|
|
|
3
3
|
import { cn as m } from "../../../lib/utils.js";
|
|
4
4
|
import { Combobox as _, ComboboxTrigger as A, ComboboxContent as W } from "../../../vendor/shadcn/combobox.js";
|
|
5
5
|
import { Icon as $ } from "../icon/icon.js";
|
|
6
|
-
import { Label as P } from "
|
|
6
|
+
import { Label as P } from "../label/label.js";
|
|
7
7
|
import { Typography as C } from "../typography/typography.js";
|
|
8
8
|
import { Badge as N } from "../badge/badge.js";
|
|
9
9
|
import { Checkbox as ee } from "../checkbox/checkbox.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Label } from '
|
|
1
|
+
export { Label } from './label';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Label as ShadcnLabel } from '../../../vendor/shadcn/label';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
interface LabelProps extends ComponentProps<typeof ShadcnLabel> {
|
|
4
|
+
info?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const Label: {
|
|
8
|
+
({ htmlFor, className, info, ...props }: LabelProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
export { Label };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { j as e } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { cn as o } from "../../../lib/utils.js";
|
|
3
|
+
import { Label as a } from "../../../vendor/shadcn/label.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { Icon as i } from "../icon/icon.js";
|
|
6
|
+
const l = ({ htmlFor: r, className: t, info: s, ...m }) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
7
|
+
/* @__PURE__ */ e.jsx(
|
|
8
|
+
a,
|
|
9
|
+
{
|
|
10
|
+
htmlFor: r,
|
|
11
|
+
className: o("text-sm leading-[18.39px] cursor-pointer", t),
|
|
12
|
+
...m
|
|
13
|
+
}
|
|
14
|
+
),
|
|
15
|
+
s && /* @__PURE__ */ e.jsx(
|
|
16
|
+
i,
|
|
17
|
+
{
|
|
18
|
+
name: "Info",
|
|
19
|
+
size: "sm",
|
|
20
|
+
className: "text-muted-foreground",
|
|
21
|
+
tooltip: s
|
|
22
|
+
}
|
|
23
|
+
)
|
|
24
|
+
] });
|
|
25
|
+
l.displayName = "Label";
|
|
26
|
+
export {
|
|
27
|
+
l as Label
|
|
28
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as s } from "../../../_virtual/jsx-runtime.js";
|
|
2
2
|
import { forwardRef as m, useState as p } from "react";
|
|
3
3
|
import { cn as x } from "../../../lib/utils.js";
|
|
4
|
-
import { Label as f } from "
|
|
4
|
+
import { Label as f } from "../label/label.js";
|
|
5
5
|
import { Link as w } from "../link/link.js";
|
|
6
6
|
import { Field as d } from "../field/field.js";
|
|
7
7
|
const u = m(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as r } from "../../../_virtual/jsx-runtime.js";
|
|
2
2
|
import { RadioGroupItem as d } from "../../../vendor/shadcn/radio-group.js";
|
|
3
3
|
import { cn as a } from "../../../lib/utils.js";
|
|
4
|
-
import { Label as l } from "
|
|
4
|
+
import { Label as l } from "../label/label.js";
|
|
5
5
|
const o = ({
|
|
6
6
|
option: e,
|
|
7
7
|
radioId: s,
|
|
@@ -4,7 +4,7 @@ import { cn as r } from "../../../lib/utils.js";
|
|
|
4
4
|
import { Input as Z } from "../../../vendor/shadcn/input.js";
|
|
5
5
|
import { Icon as w } from "../icon/icon.js";
|
|
6
6
|
import { cva as D } from "../../../node_modules/class-variance-authority/dist/index.js";
|
|
7
|
-
import { Label as K } from "
|
|
7
|
+
import { Label as K } from "../label/label.js";
|
|
8
8
|
const P = D("flex gap-2 w-full", {
|
|
9
9
|
variants: {
|
|
10
10
|
layout: {
|
|
@@ -2,7 +2,7 @@ import { j as e } from "../../../_virtual/jsx-runtime.js";
|
|
|
2
2
|
import * as y from "react";
|
|
3
3
|
import { cn as c } from "../../../lib/utils.js";
|
|
4
4
|
import { Select as w, SelectTrigger as C, SelectValue as G, SelectContent as L, SelectGroup as O, SelectLabel as R, SelectItem as d } from "../../../vendor/shadcn/select.js";
|
|
5
|
-
import { Label as T } from "
|
|
5
|
+
import { Label as T } from "../label/label.js";
|
|
6
6
|
import { Typography as n } from "../typography/typography.js";
|
|
7
7
|
const V = y.forwardRef(
|
|
8
8
|
({
|
|
@@ -37,6 +37,14 @@ export interface SwitchProps extends Omit<ComponentProps<typeof ShadcnSwitch>, "
|
|
|
37
37
|
* Additional CSS classes to apply to the switch element itself
|
|
38
38
|
*/
|
|
39
39
|
switchClassName?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Additional CSS classes to apply to the label element
|
|
42
|
+
*/
|
|
43
|
+
labelClassName?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Optional info icon with tooltip
|
|
46
|
+
*/
|
|
47
|
+
info?: string;
|
|
40
48
|
}
|
|
41
49
|
/**
|
|
42
50
|
* Toggle switch component with label and optional description.
|
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
import { j as e } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import { Switch as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { Label as
|
|
6
|
-
const
|
|
2
|
+
import { Switch as v } from "../../../vendor/shadcn/switch.js";
|
|
3
|
+
import { forwardRef as N, useId as y } from "react";
|
|
4
|
+
import { cn as o } from "../../../lib/utils.js";
|
|
5
|
+
import { Label as S } from "../label/label.js";
|
|
6
|
+
const C = N(
|
|
7
7
|
({
|
|
8
8
|
label: c,
|
|
9
|
-
description:
|
|
9
|
+
description: a,
|
|
10
10
|
side: i = "left",
|
|
11
11
|
variant: l = "default",
|
|
12
12
|
id: d,
|
|
13
13
|
name: t,
|
|
14
|
-
onChange:
|
|
15
|
-
className:
|
|
16
|
-
switchClassName:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
onChange: n,
|
|
15
|
+
className: m,
|
|
16
|
+
switchClassName: x,
|
|
17
|
+
info: f,
|
|
18
|
+
labelClassName: p,
|
|
19
|
+
...h
|
|
20
|
+
}, u) => {
|
|
21
|
+
const g = y(), r = d || t || g, w = (s) => {
|
|
22
|
+
if (!n) return;
|
|
23
|
+
n({
|
|
22
24
|
target: {
|
|
23
25
|
name: t || r,
|
|
24
26
|
checked: s,
|
|
@@ -36,41 +38,42 @@ const N = j(
|
|
|
36
38
|
stopPropagation: () => {
|
|
37
39
|
}
|
|
38
40
|
});
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
+
}, b = /* @__PURE__ */ e.jsx(
|
|
42
|
+
v,
|
|
41
43
|
{
|
|
42
|
-
ref:
|
|
44
|
+
ref: u,
|
|
43
45
|
id: r,
|
|
44
46
|
name: t,
|
|
45
|
-
className:
|
|
46
|
-
onCheckedChange:
|
|
47
|
-
...
|
|
47
|
+
className: o("cursor-pointer", x),
|
|
48
|
+
onCheckedChange: w,
|
|
49
|
+
...h
|
|
48
50
|
}
|
|
49
|
-
),
|
|
50
|
-
"flex gap-
|
|
51
|
+
), j = o(
|
|
52
|
+
"flex gap-2 items-start",
|
|
51
53
|
{
|
|
52
54
|
"flex-row-reverse": i === "right",
|
|
53
55
|
"bg-background box-border justify-start p-4 rounded-lg border shadow-xs": l === "box"
|
|
54
56
|
},
|
|
55
|
-
|
|
57
|
+
m
|
|
56
58
|
);
|
|
57
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
58
|
-
|
|
59
|
+
return /* @__PURE__ */ e.jsxs("div", { className: j, children: [
|
|
60
|
+
b,
|
|
59
61
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2 flex-1", children: [
|
|
60
|
-
/* @__PURE__ */ e.jsx(
|
|
61
|
-
|
|
62
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(
|
|
63
|
+
S,
|
|
62
64
|
{
|
|
63
65
|
htmlFor: r,
|
|
64
|
-
|
|
66
|
+
info: f,
|
|
67
|
+
className: o("text-sm leading-[18.39px] cursor-pointer", p),
|
|
65
68
|
children: c
|
|
66
69
|
}
|
|
67
|
-
),
|
|
68
|
-
|
|
70
|
+
) }),
|
|
71
|
+
a && /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: a })
|
|
69
72
|
] })
|
|
70
73
|
] });
|
|
71
74
|
}
|
|
72
75
|
);
|
|
73
|
-
|
|
76
|
+
C.displayName = "Switch";
|
|
74
77
|
export {
|
|
75
|
-
|
|
78
|
+
C as Switch
|
|
76
79
|
};
|
|
@@ -3,7 +3,7 @@ import { forwardRef as p, useId as h } from "react";
|
|
|
3
3
|
import { cva as d } from "../../../node_modules/class-variance-authority/dist/index.js";
|
|
4
4
|
import { Textarea as j } from "../../../vendor/shadcn/textarea.js";
|
|
5
5
|
import { cn as s } from "../../../lib/utils.js";
|
|
6
|
-
import { Label as N } from "
|
|
6
|
+
import { Label as N } from "../label/label.js";
|
|
7
7
|
const b = d("flex gap-2 w-full", {
|
|
8
8
|
variants: {
|
|
9
9
|
layout: {
|
|
@@ -27,6 +27,11 @@ export interface DataTableProps<TData, TValue> {
|
|
|
27
27
|
* @default false
|
|
28
28
|
*/
|
|
29
29
|
checkboxSelection?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Key to force reset of row selection. Change this value to clear all selections.
|
|
32
|
+
* Useful when parent needs to programmatically clear selections.
|
|
33
|
+
*/
|
|
34
|
+
selectionResetKey?: string | number;
|
|
30
35
|
/**
|
|
31
36
|
* Callback fired when row selection changes
|
|
32
37
|
*/
|
|
@@ -126,4 +131,4 @@ export interface DataTableProps<TData, TValue> {
|
|
|
126
131
|
* />
|
|
127
132
|
* ```
|
|
128
133
|
*/
|
|
129
|
-
export declare function DataTable<TData, TValue>({ columns, data, isLoading, empty, checkboxSelection, onRowSelectionChange, enableSorting, manualSorting, sorting: externalSorting, onSortingChange: externalOnSortingChange, enableColumnFilters, enableColumnResizing, columnResizeMode, enableColumnPinning, onRowClick, actions, height, rowHeight, className, persistKey, initialSettings, onUpdate, }: DataTableProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
|
|
134
|
+
export declare function DataTable<TData, TValue>({ columns, data, isLoading, empty, checkboxSelection, selectionResetKey, onRowSelectionChange, enableSorting, manualSorting, sorting: externalSorting, onSortingChange: externalOnSortingChange, enableColumnFilters, enableColumnResizing, columnResizeMode, enableColumnPinning, onRowClick, actions, height, rowHeight, className, persistKey, initialSettings, onUpdate, }: DataTableProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,136 +1,139 @@
|
|
|
1
1
|
import { j as e } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import * as
|
|
3
|
-
import { useReactTable as
|
|
4
|
-
import { Table as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { DataTableLoading as
|
|
7
|
-
import { DataTableHeader as
|
|
8
|
-
import { DataTableBody as
|
|
9
|
-
import { useDataTableColumns as
|
|
10
|
-
import { useDataTableState as
|
|
11
|
-
import { ROW_HEIGHT_DEFAULT as
|
|
12
|
-
import { getFilteredRowModel as
|
|
13
|
-
import { Empty as
|
|
14
|
-
function
|
|
2
|
+
import * as b from "react";
|
|
3
|
+
import { useReactTable as U } from "../../../node_modules/@tanstack/react-table/build/lib/index.js";
|
|
4
|
+
import { Table as V } from "../../../vendor/shadcn/table.js";
|
|
5
|
+
import { cn as h } from "../../../lib/utils.js";
|
|
6
|
+
import { DataTableLoading as q } from "./components/states/data-table-loading.js";
|
|
7
|
+
import { DataTableHeader as J } from "./components/data-table-header.js";
|
|
8
|
+
import { DataTableBody as Q } from "./components/data-table-body.js";
|
|
9
|
+
import { useDataTableColumns as X } from "./hooks/use-data-table-columns.js";
|
|
10
|
+
import { useDataTableState as Y } from "./hooks/use-data-table-state.js";
|
|
11
|
+
import { ROW_HEIGHT_DEFAULT as Z } from "./utils/data-table-constants.js";
|
|
12
|
+
import { getFilteredRowModel as k, getSortedRowModel as K, getCoreRowModel as O } from "../../../node_modules/@tanstack/table-core/build/lib/index.js";
|
|
13
|
+
import { Empty as oo } from "../../molecules/empty/empty.js";
|
|
14
|
+
function go({
|
|
15
15
|
columns: m,
|
|
16
16
|
data: d,
|
|
17
|
-
isLoading:
|
|
18
|
-
empty:
|
|
19
|
-
checkboxSelection:
|
|
17
|
+
isLoading: S = !1,
|
|
18
|
+
empty: j,
|
|
19
|
+
checkboxSelection: u = !1,
|
|
20
|
+
selectionResetKey: c,
|
|
20
21
|
onRowSelectionChange: l,
|
|
21
|
-
enableSorting:
|
|
22
|
-
manualSorting:
|
|
23
|
-
sorting:
|
|
24
|
-
onSortingChange:
|
|
25
|
-
enableColumnFilters:
|
|
26
|
-
enableColumnResizing:
|
|
27
|
-
columnResizeMode:
|
|
28
|
-
enableColumnPinning:
|
|
29
|
-
onRowClick:
|
|
30
|
-
actions:
|
|
31
|
-
height:
|
|
32
|
-
rowHeight:
|
|
33
|
-
className:
|
|
34
|
-
persistKey:
|
|
35
|
-
initialSettings:
|
|
36
|
-
onUpdate:
|
|
22
|
+
enableSorting: w = !0,
|
|
23
|
+
manualSorting: y = !1,
|
|
24
|
+
sorting: T,
|
|
25
|
+
onSortingChange: R,
|
|
26
|
+
enableColumnFilters: D = !1,
|
|
27
|
+
enableColumnResizing: r = !0,
|
|
28
|
+
columnResizeMode: F = "onChange",
|
|
29
|
+
enableColumnPinning: v = !0,
|
|
30
|
+
onRowClick: E,
|
|
31
|
+
actions: s,
|
|
32
|
+
height: M,
|
|
33
|
+
rowHeight: f = Z,
|
|
34
|
+
className: N,
|
|
35
|
+
persistKey: H,
|
|
36
|
+
initialSettings: P,
|
|
37
|
+
onUpdate: W
|
|
37
38
|
}) {
|
|
38
|
-
const
|
|
39
|
+
const _ = X({
|
|
39
40
|
columns: m,
|
|
40
|
-
checkboxSelection:
|
|
41
|
-
actions:
|
|
41
|
+
checkboxSelection: u,
|
|
42
|
+
actions: s
|
|
42
43
|
}), {
|
|
43
|
-
sorting:
|
|
44
|
-
setSorting:
|
|
45
|
-
columnFilters:
|
|
46
|
-
setColumnFilters:
|
|
47
|
-
columnVisibility:
|
|
48
|
-
setColumnVisibility:
|
|
49
|
-
rowSelection:
|
|
50
|
-
setRowSelection:
|
|
51
|
-
columnPinning:
|
|
52
|
-
handleColumnPinningChange:
|
|
53
|
-
} =
|
|
54
|
-
persistKey:
|
|
55
|
-
hasActions: !!
|
|
56
|
-
externalSorting:
|
|
57
|
-
onExternalSortingChange:
|
|
58
|
-
initialSettings:
|
|
59
|
-
onUpdate:
|
|
60
|
-
}), i =
|
|
44
|
+
sorting: g,
|
|
45
|
+
setSorting: p,
|
|
46
|
+
columnFilters: $,
|
|
47
|
+
setColumnFilters: z,
|
|
48
|
+
columnVisibility: A,
|
|
49
|
+
setColumnVisibility: G,
|
|
50
|
+
rowSelection: x,
|
|
51
|
+
setRowSelection: C,
|
|
52
|
+
columnPinning: L,
|
|
53
|
+
handleColumnPinningChange: B
|
|
54
|
+
} = Y({
|
|
55
|
+
persistKey: H,
|
|
56
|
+
hasActions: !!s,
|
|
57
|
+
externalSorting: T,
|
|
58
|
+
onExternalSortingChange: R,
|
|
59
|
+
initialSettings: P,
|
|
60
|
+
onUpdate: W
|
|
61
|
+
}), i = U({
|
|
61
62
|
data: d,
|
|
62
|
-
columns:
|
|
63
|
-
getCoreRowModel:
|
|
64
|
-
enableColumnResizing:
|
|
65
|
-
columnResizeMode:
|
|
66
|
-
enableColumnPinning:
|
|
63
|
+
columns: _,
|
|
64
|
+
getCoreRowModel: O(),
|
|
65
|
+
enableColumnResizing: r,
|
|
66
|
+
columnResizeMode: F,
|
|
67
|
+
enableColumnPinning: v,
|
|
67
68
|
defaultColumn: {
|
|
68
69
|
enableSorting: !1,
|
|
69
70
|
minSize: 50
|
|
70
71
|
},
|
|
71
|
-
...
|
|
72
|
+
...w && {
|
|
72
73
|
onSortingChange: (o) => {
|
|
73
|
-
|
|
74
|
+
p(typeof o == "function" ? o(g) : o);
|
|
74
75
|
},
|
|
75
|
-
getSortedRowModel:
|
|
76
|
-
manualSorting:
|
|
76
|
+
getSortedRowModel: K(),
|
|
77
|
+
manualSorting: y
|
|
77
78
|
},
|
|
78
|
-
...
|
|
79
|
-
onColumnFiltersChange:
|
|
80
|
-
getFilteredRowModel:
|
|
79
|
+
...D && {
|
|
80
|
+
onColumnFiltersChange: z,
|
|
81
|
+
getFilteredRowModel: k()
|
|
81
82
|
},
|
|
82
|
-
onColumnVisibilityChange:
|
|
83
|
-
onRowSelectionChange:
|
|
84
|
-
onColumnPinningChange:
|
|
83
|
+
onColumnVisibilityChange: G,
|
|
84
|
+
onRowSelectionChange: C,
|
|
85
|
+
onColumnPinningChange: B,
|
|
85
86
|
state: {
|
|
86
|
-
sorting:
|
|
87
|
-
columnFilters:
|
|
88
|
-
columnVisibility:
|
|
89
|
-
rowSelection:
|
|
90
|
-
columnPinning:
|
|
87
|
+
sorting: g,
|
|
88
|
+
columnFilters: $,
|
|
89
|
+
columnVisibility: A,
|
|
90
|
+
rowSelection: x,
|
|
91
|
+
columnPinning: L
|
|
91
92
|
}
|
|
92
93
|
});
|
|
93
|
-
if (
|
|
94
|
+
if (b.useEffect(() => {
|
|
95
|
+
c !== void 0 && C({});
|
|
96
|
+
}, [c]), b.useEffect(() => {
|
|
94
97
|
if (l) {
|
|
95
98
|
const o = i.getFilteredSelectedRowModel().rows.map((t) => t.original);
|
|
96
99
|
l(o);
|
|
97
100
|
}
|
|
98
|
-
}, [
|
|
101
|
+
}, [x, l, i]), S)
|
|
99
102
|
return /* @__PURE__ */ e.jsx(
|
|
100
|
-
|
|
103
|
+
q,
|
|
101
104
|
{
|
|
102
105
|
columns: m,
|
|
103
|
-
checkboxSelection:
|
|
104
|
-
actions:
|
|
105
|
-
rowHeight:
|
|
106
|
+
checkboxSelection: u,
|
|
107
|
+
actions: s,
|
|
108
|
+
rowHeight: f
|
|
106
109
|
}
|
|
107
110
|
);
|
|
108
111
|
if (d.length === 0) {
|
|
109
|
-
const o =
|
|
112
|
+
const o = j || {}, {
|
|
110
113
|
title: t = "No results",
|
|
111
114
|
description: a = "No data available",
|
|
112
115
|
media: n,
|
|
113
|
-
actions:
|
|
116
|
+
actions: I
|
|
114
117
|
} = o;
|
|
115
118
|
return /* @__PURE__ */ e.jsx(
|
|
116
|
-
|
|
119
|
+
oo,
|
|
117
120
|
{
|
|
118
121
|
media: n,
|
|
119
122
|
title: t,
|
|
120
123
|
description: a,
|
|
121
|
-
actions:
|
|
124
|
+
actions: I
|
|
122
125
|
}
|
|
123
126
|
);
|
|
124
127
|
}
|
|
125
|
-
return /* @__PURE__ */ e.jsx("div", { className:
|
|
128
|
+
return /* @__PURE__ */ e.jsx("div", { className: h("yuno-data-table space-y-4", N), children: /* @__PURE__ */ e.jsx(
|
|
126
129
|
"div",
|
|
127
130
|
{
|
|
128
131
|
className: "rounded-md border overflow-x-auto",
|
|
129
|
-
style: { height:
|
|
132
|
+
style: { height: M || "auto" },
|
|
130
133
|
children: /* @__PURE__ */ e.jsxs(
|
|
131
|
-
|
|
134
|
+
V,
|
|
132
135
|
{
|
|
133
|
-
className:
|
|
136
|
+
className: h("table-fixed"),
|
|
134
137
|
children: [
|
|
135
138
|
/* @__PURE__ */ e.jsx("colgroup", { children: i.getHeaderGroups()[0]?.headers.map((o) => {
|
|
136
139
|
const t = o.column.columnDef.enableResizing === !1, a = o.column.id === "_spacer", n = o.column.getSize();
|
|
@@ -147,19 +150,19 @@ function fo({
|
|
|
147
150
|
);
|
|
148
151
|
}) }),
|
|
149
152
|
/* @__PURE__ */ e.jsx(
|
|
150
|
-
|
|
153
|
+
J,
|
|
151
154
|
{
|
|
152
155
|
table: i,
|
|
153
|
-
enableColumnResizing:
|
|
156
|
+
enableColumnResizing: r
|
|
154
157
|
}
|
|
155
158
|
),
|
|
156
159
|
/* @__PURE__ */ e.jsx(
|
|
157
|
-
|
|
160
|
+
Q,
|
|
158
161
|
{
|
|
159
162
|
table: i,
|
|
160
|
-
enableColumnResizing:
|
|
161
|
-
onRowClick:
|
|
162
|
-
rowHeight:
|
|
163
|
+
enableColumnResizing: r,
|
|
164
|
+
onRowClick: E,
|
|
165
|
+
rowHeight: f
|
|
163
166
|
}
|
|
164
167
|
)
|
|
165
168
|
]
|
|
@@ -169,5 +172,5 @@ function fo({
|
|
|
169
172
|
) });
|
|
170
173
|
}
|
|
171
174
|
export {
|
|
172
|
-
|
|
175
|
+
go as DataTable
|
|
173
176
|
};
|
|
@@ -100,6 +100,7 @@ export interface DataTableProps<TData> {
|
|
|
100
100
|
isLoading?: boolean;
|
|
101
101
|
empty?: EmptyProps;
|
|
102
102
|
checkboxSelection?: boolean;
|
|
103
|
+
selectionResetKey?: string | number;
|
|
103
104
|
onRowSelectionChange?: (selectedRows: TData[]) => void;
|
|
104
105
|
enablePagination?: boolean;
|
|
105
106
|
pageSize?: number;
|