@yuno-payments/dashboard-design-system 0.0.170 → 0.0.172
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/access-denied-alert/access-denied-alert.d.ts +16 -0
- package/dist/components/atoms/accordion/accordion.d.ts +66 -0
- package/dist/components/atoms/alert/alert.d.ts +26 -1
- package/dist/components/atoms/alert/alert.js +9 -8
- package/dist/components/atoms/avatar/avatar-group.d.ts +28 -0
- package/dist/components/atoms/avatar/avatar.d.ts +25 -0
- package/dist/components/atoms/avatar/avatar.js +9 -9
- package/dist/components/atoms/badge/badge.d.ts +30 -2
- package/dist/components/atoms/badge/badge.js +27 -11
- package/dist/components/atoms/button/button.d.ts +44 -0
- package/dist/components/atoms/card/card.d.ts +137 -3
- package/dist/components/atoms/card/card.js +56 -28
- package/dist/components/atoms/checkbox/checkbox.d.ts +38 -2
- package/dist/components/atoms/checkbox/checkbox.js +61 -27
- package/dist/components/atoms/combobox/combobox.d.ts +18 -0
- package/dist/components/atoms/combobox/combobox.js +41 -41
- package/dist/components/atoms/combobox/types.d.ts +90 -1
- package/dist/components/atoms/currency-field/currency-field.d.ts +38 -0
- package/dist/components/atoms/currency-field/currency-field.js +22 -19
- package/dist/components/atoms/date-picker/date-picker.d.ts +15 -0
- package/dist/components/atoms/date-range-picker/date-range-picker.d.ts +15 -0
- package/dist/components/atoms/dots-menu/dots-menu.d.ts +16 -0
- package/dist/components/atoms/dots-menu/dots-menu.js +8 -8
- package/dist/components/atoms/dots-menu/dots-menu.types.d.ts +52 -0
- package/dist/components/atoms/dropdown-menu/dropdown-menu.d.ts +50 -0
- package/dist/components/atoms/field/field.d.ts +55 -0
- package/dist/components/atoms/field/field.js +53 -46
- package/dist/components/atoms/filter/filter-date-range.d.ts +12 -2
- package/dist/components/atoms/filter/filter-date-range.js +203 -168
- package/dist/components/atoms/filter/filter.d.ts +6 -0
- package/dist/components/atoms/filter/filter.js +91 -76
- package/dist/components/atoms/filter/index.d.ts +1 -1
- package/dist/components/atoms/filter-dropdown/filter-dropdown.d.ts +208 -2
- package/dist/components/atoms/filter-dropdown/filter-dropdown.js +214 -160
- package/dist/components/atoms/icon/aida-logo.d.ts +3 -0
- package/dist/components/atoms/icon/aida-logo.js +64 -0
- package/dist/components/atoms/icon/icon-list.d.ts +5 -0
- package/dist/components/atoms/icon/icon-list.js +394 -384
- package/dist/components/atoms/icon/icon.d.ts +29 -0
- package/dist/components/atoms/index.d.ts +3 -2
- 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/link/link.d.ts +20 -0
- package/dist/components/atoms/loading/index.d.ts +1 -0
- package/dist/components/atoms/loading/loading.d.ts +39 -0
- package/dist/components/atoms/loading/loading.js +37 -0
- package/dist/components/atoms/multi-select/multi-select.d.ts +1 -1
- package/dist/components/atoms/multi-select/multi-select.js +6 -6
- package/dist/components/atoms/multi-values-field/multi-values-field.d.ts +16 -0
- package/dist/components/atoms/multi-values-field/multi-values-field.js +109 -87
- package/dist/components/atoms/multi-values-field/multi-values-field.types.d.ts +81 -0
- package/dist/components/atoms/otp-field/otp-field.d.ts +32 -0
- package/dist/components/atoms/password-field/password-field.d.ts +23 -0
- package/dist/components/atoms/password-field/password-field.js +1 -1
- package/dist/components/atoms/progress/progress.d.ts +15 -0
- package/dist/components/atoms/protected-field/protected-field.d.ts +10 -0
- package/dist/components/atoms/protected-field/protected-field.types.d.ts +14 -0
- package/dist/components/atoms/radio-group/radio-group-option.js +11 -11
- package/dist/components/atoms/radio-group/radio-group.d.ts +50 -1
- package/dist/components/atoms/radio-group/radio-group.js +13 -12
- package/dist/components/atoms/search-field/search-field.d.ts +14 -0
- package/dist/components/atoms/search-field/search-field.js +17 -17
- package/dist/components/atoms/search-field/search-field.types.d.ts +57 -0
- package/dist/components/atoms/select/index.d.ts +2 -0
- package/dist/components/atoms/select/search-select.d.ts +22 -0
- package/dist/components/atoms/select/search-select.js +201 -0
- package/dist/components/atoms/select/select.d.ts +83 -1
- package/dist/components/atoms/select/select.js +21 -21
- package/dist/components/atoms/separator/separator.d.ts +17 -0
- package/dist/components/atoms/skeleton/index.d.ts +9 -0
- package/dist/components/atoms/switch/switch.d.ts +56 -2
- package/dist/components/atoms/switch/switch.js +64 -32
- package/dist/components/atoms/tabs/index.d.ts +16 -0
- package/dist/components/atoms/textarea/textarea.d.ts +32 -0
- package/dist/components/atoms/textarea/textarea.js +1 -1
- package/dist/components/atoms/time-picker/time-picker.d.ts +73 -2
- package/dist/components/atoms/time-picker/time-picker.js +218 -3
- package/dist/components/atoms/toaster/index.d.ts +15 -0
- package/dist/components/atoms/toggle-group/toggle-group.d.ts +26 -1
- package/dist/components/atoms/toggle-group/toggle-group.js +15 -14
- package/dist/components/atoms/tooltip/tooltip.d.ts +53 -2
- package/dist/components/atoms/typography/typography.d.ts +18 -0
- package/dist/components/molecules/breadcrumb/breadcrumb.d.ts +50 -0
- package/dist/components/molecules/breadcrumb/breadcrumb.js +17 -17
- package/dist/components/molecules/dialog-content/dialog-content.d.ts +16 -0
- package/dist/components/molecules/dialog-footer/dialog-footer.d.ts +20 -0
- package/dist/components/molecules/dialog-header/dialog-header.d.ts +31 -0
- package/dist/components/molecules/empty/empty-icon.js +6 -6
- package/dist/components/molecules/empty/empty.d.ts +16 -1
- package/dist/components/molecules/empty/empty.js +37 -34
- package/dist/components/molecules/highlight-banner/highlight-banner.d.ts +17 -0
- package/dist/components/molecules/pagination/pagination.d.ts +49 -0
- package/dist/components/organisms/data-table/components/cells/data-table-list-cell.d.ts +41 -0
- package/dist/components/organisms/data-table/components/column-header/data-table-column-header-content.js +1 -1
- package/dist/components/organisms/data-table/components/column-header/data-table-column-header-menu.js +18 -18
- package/dist/components/organisms/data-table/components/column-header/data-table-column-header.d.ts +18 -0
- package/dist/components/organisms/data-table/components/column-header/data-table-column-header.js +10 -10
- package/dist/components/organisms/data-table/components/data-table-body.d.ts +18 -0
- package/dist/components/organisms/data-table/components/data-table-header.d.ts +12 -0
- package/dist/components/organisms/data-table/components/data-table-header.js +7 -7
- package/dist/components/organisms/data-table/components/states/data-table-loading.d.ts +24 -0
- package/dist/components/organisms/data-table/components/states/data-table-loading.js +6 -6
- package/dist/components/organisms/data-table/data-table.d.ts +133 -4
- package/dist/components/organisms/data-table/data-table.js +132 -100
- package/dist/components/organisms/data-table/data-table.types.d.ts +35 -26
- package/dist/components/organisms/data-table/hooks/use-data-table-columns.js +57 -41
- package/dist/components/organisms/data-table/hooks/use-data-table-state.d.ts +8 -2
- package/dist/components/organisms/data-table/hooks/use-data-table-state.js +82 -47
- package/dist/components/organisms/data-table/utils/data-table-constants.d.ts +8 -2
- package/dist/components/organisms/data-table/utils/data-table-constants.js +16 -10
- package/dist/components/organisms/data-table/utils/data-table-styles.d.ts +1652 -0
- package/dist/components/organisms/data-table/utils/data-table-styles.js +29 -14
- package/dist/components/organisms/dialog/dialog.d.ts +67 -1
- package/dist/components/organisms/dialog/dialog.js +78 -61
- package/dist/components/organisms/index.d.ts +2 -0
- package/dist/components/organisms/sheet/sheet.d.ts +69 -0
- package/dist/components/organisms/sheet/sheet.js +34 -33
- package/dist/components/organisms/tutorial/index.d.ts +2 -0
- package/dist/components/organisms/tutorial/tutorial.d.ts +16 -0
- package/dist/components/organisms/tutorial/tutorial.js +114 -0
- package/dist/components/organisms/tutorial/tutorial.types.d.ts +15 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/use-body-scroll-lock.d.ts +13 -0
- package/dist/hooks/use-escape-key.d.ts +14 -0
- package/dist/hooks/use-media-query.d.ts +20 -0
- package/dist/hooks/use-media-query.js +21 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +173 -162
- package/dist/lib/notification-alert.d.ts +42 -0
- package/dist/lib/notification-alert.js +75 -0
- package/dist/node_modules/@phosphor-icons/react/dist/csr/File.es.js +8 -0
- package/dist/node_modules/@phosphor-icons/react/dist/csr/Microphone.es.js +8 -0
- package/dist/node_modules/@phosphor-icons/react/dist/csr/Stop.es.js +8 -0
- package/dist/node_modules/@phosphor-icons/react/dist/csr/Table.es.js +8 -0
- package/dist/node_modules/@phosphor-icons/react/dist/defs/File.es.js +30 -0
- package/dist/node_modules/@phosphor-icons/react/dist/defs/Microphone.es.js +36 -0
- package/dist/node_modules/@phosphor-icons/react/dist/defs/Stop.es.js +36 -0
- package/dist/node_modules/@phosphor-icons/react/dist/defs/Table.es.js +30 -0
- package/dist/vendor/shadcn/avatar.js +19 -19
- package/dist/vendor/shadcn/badge.js +15 -15
- package/dist/vendor/shadcn/card.js +7 -7
- package/dist/vendor/shadcn/date-picker.d.ts +2 -2
- package/dist/vendor/shadcn/date-picker.js +1 -1
- package/dist/vendor/shadcn/date-range-picker.d.ts +2 -2
- package/dist/vendor/shadcn/date-range-picker.js +1 -1
- package/dist/vendor/shadcn/dialog.js +2 -2
- package/dist/vendor/shadcn/input-group.js +17 -17
- package/dist/vendor/shadcn/input.js +7 -7
- package/dist/vendor/shadcn/popover.js +1 -1
- package/dist/vendor/shadcn/select.js +2 -2
- package/dist/vendor/shadcn/sonner.d.ts +26 -1
- package/dist/vendor/shadcn/sonner.js +12 -8
- package/dist/vendor/shadcn/table.js +30 -30
- package/dist/vendor/shadcn/textarea.js +9 -9
- package/dist/vendor/shadcn/time-picker.d.ts +1 -2
- package/dist/vendor/shadcn/time-picker.js +17 -23
- package/dist/vendor/shadcn/toggle.js +13 -13
- package/dist/vendor/shadcn/tooltip.js +25 -15
- package/package.json +1 -1
|
@@ -1,78 +1,82 @@
|
|
|
1
|
-
import { j as
|
|
1
|
+
import { j as a } from "../../../../_virtual/jsx-runtime.js";
|
|
2
2
|
import * as C from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
function
|
|
9
|
-
columns:
|
|
3
|
+
import { Button as b } from "../../../atoms/button/button.js";
|
|
4
|
+
import { DataTableColumnHeader as S } from "../components/column-header/data-table-column-header.js";
|
|
5
|
+
import { isHeaderConfig as h } from "../utils/data-table-utils.js";
|
|
6
|
+
import { COLUMN_MIN_SIZE_DEFAULT as p, CHECKBOX_COLUMN_CONFIG as c, ACTIONS_COLUMN_CONFIG as g } from "../utils/data-table-constants.js";
|
|
7
|
+
import { Checkbox as z } from "../../../atoms/checkbox/checkbox.js";
|
|
8
|
+
function _({
|
|
9
|
+
columns: f,
|
|
10
10
|
checkboxSelection: d = !1,
|
|
11
|
-
actions:
|
|
11
|
+
actions: l
|
|
12
12
|
}) {
|
|
13
13
|
return C.useMemo(() => {
|
|
14
|
-
let
|
|
15
|
-
const { header: e, enablePinning: i = !0, ...
|
|
14
|
+
let n = f.map((t) => {
|
|
15
|
+
const { header: e, enablePinning: i = !0, ...r } = t, s = r.size !== void 0 ? { ...r, minSize: r.minSize ?? p } : r;
|
|
16
16
|
return typeof e == "string" ? {
|
|
17
|
-
...
|
|
17
|
+
...s,
|
|
18
18
|
enablePinning: i,
|
|
19
|
-
header: ({ column:
|
|
20
|
-
|
|
19
|
+
header: ({ column: o, table: m }) => /* @__PURE__ */ a.jsx(
|
|
20
|
+
S,
|
|
21
21
|
{
|
|
22
|
-
column:
|
|
22
|
+
column: o,
|
|
23
23
|
table: m,
|
|
24
24
|
title: e
|
|
25
25
|
}
|
|
26
26
|
)
|
|
27
|
-
} :
|
|
28
|
-
...
|
|
27
|
+
} : h(e) ? {
|
|
28
|
+
...s,
|
|
29
29
|
enablePinning: i,
|
|
30
|
-
header: ({ column:
|
|
31
|
-
|
|
30
|
+
header: ({ column: o, table: m }) => /* @__PURE__ */ a.jsx(
|
|
31
|
+
S,
|
|
32
32
|
{
|
|
33
|
-
column:
|
|
33
|
+
column: o,
|
|
34
34
|
table: m,
|
|
35
35
|
title: e.title,
|
|
36
36
|
info: e.info,
|
|
37
37
|
className: e.className
|
|
38
38
|
}
|
|
39
39
|
)
|
|
40
|
-
} : { ...
|
|
40
|
+
} : { ...s, header: e, enablePinning: i };
|
|
41
41
|
});
|
|
42
|
-
if (d && (
|
|
42
|
+
if (d && (n = [{
|
|
43
43
|
id: "select",
|
|
44
|
-
header: ({ table: e }) => /* @__PURE__ */
|
|
45
|
-
|
|
44
|
+
header: ({ table: e }) => /* @__PURE__ */ a.jsx(
|
|
45
|
+
z,
|
|
46
46
|
{
|
|
47
47
|
checked: e.getIsAllPageRowsSelected() || (e.getIsSomePageRowsSelected() ? "indeterminate" : !1),
|
|
48
|
-
|
|
48
|
+
onChange: (i) => e.toggleAllPageRowsSelected(i.target.checked),
|
|
49
49
|
"aria-label": "Select all"
|
|
50
50
|
}
|
|
51
51
|
),
|
|
52
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
53
|
-
|
|
52
|
+
cell: ({ row: e }) => /* @__PURE__ */ a.jsx(
|
|
53
|
+
z,
|
|
54
54
|
{
|
|
55
55
|
checked: e.getIsSelected(),
|
|
56
|
-
|
|
56
|
+
onChange: (i) => e.toggleSelected(i.target.checked),
|
|
57
57
|
"aria-label": "Select row"
|
|
58
58
|
}
|
|
59
59
|
),
|
|
60
60
|
enableSorting: !1,
|
|
61
61
|
enableHiding: !1,
|
|
62
|
-
enablePinning: !1
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
enablePinning: !1,
|
|
63
|
+
enableResizing: !1,
|
|
64
|
+
size: c.size,
|
|
65
|
+
minSize: c.minSize,
|
|
66
|
+
maxSize: c.maxSize
|
|
67
|
+
}, ...n]), l) {
|
|
68
|
+
const t = {
|
|
65
69
|
id: "actions",
|
|
66
70
|
header: "",
|
|
67
|
-
cell: ({ row: e }) =>
|
|
68
|
-
|
|
71
|
+
cell: ({ row: e }) => l.render ? /* @__PURE__ */ a.jsx(a.Fragment, { children: l.render(e.original) }) : /* @__PURE__ */ a.jsx(
|
|
72
|
+
b,
|
|
69
73
|
{
|
|
70
74
|
variant: "ghost",
|
|
71
75
|
size: "icon",
|
|
72
76
|
startIcon: "Eye",
|
|
73
77
|
"aria-label": "Actions",
|
|
74
78
|
onClick: (i) => {
|
|
75
|
-
i.stopPropagation(),
|
|
79
|
+
i.stopPropagation(), l.onClick?.(e.original);
|
|
76
80
|
}
|
|
77
81
|
}
|
|
78
82
|
),
|
|
@@ -80,15 +84,27 @@ function P({
|
|
|
80
84
|
enableHiding: !1,
|
|
81
85
|
enablePinning: !1,
|
|
82
86
|
enableResizing: !1,
|
|
83
|
-
size:
|
|
84
|
-
minSize:
|
|
85
|
-
maxSize:
|
|
87
|
+
size: g.size,
|
|
88
|
+
minSize: g.minSize,
|
|
89
|
+
maxSize: g.maxSize
|
|
86
90
|
};
|
|
87
|
-
|
|
91
|
+
n = [...n, t];
|
|
88
92
|
}
|
|
89
|
-
|
|
90
|
-
|
|
93
|
+
const u = {
|
|
94
|
+
id: "_spacer",
|
|
95
|
+
header: "",
|
|
96
|
+
cell: () => null,
|
|
97
|
+
enableSorting: !1,
|
|
98
|
+
enableHiding: !1,
|
|
99
|
+
enablePinning: !1,
|
|
100
|
+
enableResizing: !1,
|
|
101
|
+
size: 100,
|
|
102
|
+
// Arbitrary value, colgroup will override with auto
|
|
103
|
+
minSize: 0
|
|
104
|
+
};
|
|
105
|
+
return n = [...n, u], n;
|
|
106
|
+
}, [d, l, f]);
|
|
91
107
|
}
|
|
92
108
|
export {
|
|
93
|
-
|
|
109
|
+
_ as useDataTableColumns
|
|
94
110
|
};
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { ColumnFiltersState, SortingState, VisibilityState, RowSelectionState, ColumnPinningState } from '@tanstack/react-table';
|
|
2
|
+
import { DataTableSettings } from '../data-table.types';
|
|
2
3
|
import * as React from "react";
|
|
3
4
|
interface UseDataTableStateProps {
|
|
4
5
|
persistKey?: string;
|
|
5
6
|
hasActions?: boolean;
|
|
7
|
+
externalSorting?: SortingState;
|
|
8
|
+
onExternalSortingChange?: (sorting: SortingState) => void;
|
|
9
|
+
externalRowSelection?: RowSelectionState;
|
|
10
|
+
initialSettings?: DataTableSettings;
|
|
11
|
+
onUpdate?: (settings: DataTableSettings) => void;
|
|
6
12
|
}
|
|
7
|
-
export declare function useDataTableState({ persistKey, hasActions, }: UseDataTableStateProps): {
|
|
13
|
+
export declare function useDataTableState({ persistKey, hasActions, externalSorting, onExternalSortingChange, externalRowSelection, initialSettings, onUpdate, }: UseDataTableStateProps): {
|
|
8
14
|
sorting: SortingState;
|
|
9
|
-
setSorting:
|
|
15
|
+
setSorting: (sorting: SortingState) => void;
|
|
10
16
|
columnFilters: ColumnFiltersState;
|
|
11
17
|
setColumnFilters: React.Dispatch<React.SetStateAction<ColumnFiltersState>>;
|
|
12
18
|
columnVisibility: VisibilityState;
|
|
@@ -1,74 +1,109 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
function
|
|
3
|
-
persistKey:
|
|
4
|
-
hasActions:
|
|
1
|
+
import * as i from "react";
|
|
2
|
+
function $({
|
|
3
|
+
persistKey: r,
|
|
4
|
+
hasActions: s = !1,
|
|
5
|
+
externalSorting: P,
|
|
6
|
+
onExternalSortingChange: l,
|
|
7
|
+
externalRowSelection: y,
|
|
8
|
+
initialSettings: o,
|
|
9
|
+
onUpdate: m
|
|
5
10
|
}) {
|
|
6
|
-
const [
|
|
11
|
+
const [c, a] = i.useState([]), [w, I] = i.useState(
|
|
7
12
|
[]
|
|
8
|
-
), [
|
|
13
|
+
), [u, d] = i.useState({}), [V, C] = i.useState({}), [f, g] = i.useState({
|
|
9
14
|
left: [],
|
|
10
|
-
right:
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
if (
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
right: s ? ["actions"] : []
|
|
16
|
+
}), F = P ?? c, O = l ?? a, R = y ?? V, v = C;
|
|
17
|
+
i.useEffect(() => {
|
|
18
|
+
if (o) {
|
|
19
|
+
if (o.hide || o.show) {
|
|
20
|
+
const e = {};
|
|
21
|
+
o.hide?.forEach((t) => {
|
|
22
|
+
e[t] = !1;
|
|
23
|
+
}), d(e);
|
|
24
|
+
}
|
|
25
|
+
o.pinnedColumns && g({
|
|
26
|
+
left: o.pinnedColumns.left || [],
|
|
27
|
+
right: [
|
|
28
|
+
...(o.pinnedColumns.right || []).filter(
|
|
29
|
+
(e) => e !== "actions"
|
|
30
|
+
),
|
|
31
|
+
...s ? ["actions"] : []
|
|
32
|
+
]
|
|
33
|
+
}), !l && o.sorting && a(o.sorting);
|
|
34
|
+
}
|
|
35
|
+
}, [o, s, l]), i.useEffect(() => {
|
|
36
|
+
if (!r) return;
|
|
37
|
+
const e = localStorage.getItem(`datatable-${r}`);
|
|
38
|
+
if (e)
|
|
16
39
|
try {
|
|
17
|
-
const t = JSON.parse(
|
|
18
|
-
t.columnVisibility &&
|
|
40
|
+
const t = JSON.parse(e);
|
|
41
|
+
t.columnVisibility && d(t.columnVisibility), t.columnPinning && g({
|
|
19
42
|
left: t.columnPinning.left || [],
|
|
20
43
|
right: [
|
|
21
44
|
...(t.columnPinning.right || []).filter(
|
|
22
|
-
(
|
|
45
|
+
(n) => n !== "actions"
|
|
23
46
|
),
|
|
24
|
-
...
|
|
47
|
+
...s ? ["actions"] : []
|
|
25
48
|
]
|
|
26
|
-
});
|
|
49
|
+
}), !l && t.sorting && a(t.sorting);
|
|
27
50
|
} catch (t) {
|
|
28
51
|
console.error("Failed to load table state", t);
|
|
29
52
|
}
|
|
30
|
-
}, [
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
53
|
+
}, [r, s, l]), i.useEffect(() => {
|
|
54
|
+
const e = Object.entries(u).filter(([, n]) => !n).map(([n]) => n), t = {
|
|
55
|
+
hide: e.length > 0 ? e : void 0,
|
|
56
|
+
pinnedColumns: {
|
|
57
|
+
left: f.left || [],
|
|
58
|
+
right: f.right || []
|
|
59
|
+
},
|
|
60
|
+
// Only include sorting if not controlled externally
|
|
61
|
+
...!l && c.length > 0 && { sorting: c }
|
|
35
62
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
63
|
+
if (r) {
|
|
64
|
+
const n = {
|
|
65
|
+
columnVisibility: u,
|
|
66
|
+
columnPinning: f,
|
|
67
|
+
...!l && { sorting: c }
|
|
68
|
+
};
|
|
69
|
+
localStorage.setItem(`datatable-${r}`, JSON.stringify(n));
|
|
70
|
+
}
|
|
71
|
+
m && m(t);
|
|
72
|
+
}, [u, f, c, r, l, m]);
|
|
73
|
+
const J = i.useCallback(
|
|
74
|
+
(e) => {
|
|
75
|
+
g((t) => {
|
|
76
|
+
const n = typeof e == "function" ? e(t) : e, h = Array.isArray(n.left) ? n.left : [], b = Array.isArray(n.right) ? n.right : [];
|
|
77
|
+
if (s) {
|
|
78
|
+
const N = b.filter(
|
|
79
|
+
(S) => S !== "actions"
|
|
45
80
|
);
|
|
46
81
|
return {
|
|
47
|
-
left:
|
|
48
|
-
right: [...
|
|
82
|
+
left: h,
|
|
83
|
+
right: [...N, "actions"]
|
|
49
84
|
};
|
|
50
85
|
}
|
|
51
86
|
return {
|
|
52
|
-
left:
|
|
53
|
-
right:
|
|
87
|
+
left: h,
|
|
88
|
+
right: b
|
|
54
89
|
};
|
|
55
90
|
});
|
|
56
91
|
},
|
|
57
|
-
[
|
|
92
|
+
[s]
|
|
58
93
|
);
|
|
59
94
|
return {
|
|
60
|
-
sorting:
|
|
61
|
-
setSorting:
|
|
62
|
-
columnFilters:
|
|
63
|
-
setColumnFilters:
|
|
64
|
-
columnVisibility:
|
|
65
|
-
setColumnVisibility:
|
|
66
|
-
rowSelection:
|
|
67
|
-
setRowSelection:
|
|
68
|
-
columnPinning:
|
|
69
|
-
handleColumnPinningChange:
|
|
95
|
+
sorting: F,
|
|
96
|
+
setSorting: O,
|
|
97
|
+
columnFilters: w,
|
|
98
|
+
setColumnFilters: I,
|
|
99
|
+
columnVisibility: u,
|
|
100
|
+
setColumnVisibility: d,
|
|
101
|
+
rowSelection: R,
|
|
102
|
+
setRowSelection: v,
|
|
103
|
+
columnPinning: f,
|
|
104
|
+
handleColumnPinningChange: J
|
|
70
105
|
};
|
|
71
106
|
}
|
|
72
107
|
export {
|
|
73
|
-
|
|
108
|
+
$ as useDataTableState
|
|
74
109
|
};
|
|
@@ -10,14 +10,20 @@ export declare const RESIZE_HANDLE_CONFIG: {
|
|
|
10
10
|
readonly lineHeight: "h-5";
|
|
11
11
|
readonly lineWidth: "w-[1px]";
|
|
12
12
|
};
|
|
13
|
+
export declare const CHECKBOX_COLUMN_CONFIG: {
|
|
14
|
+
readonly size: 50;
|
|
15
|
+
readonly minSize: 50;
|
|
16
|
+
readonly maxSize: 50;
|
|
17
|
+
};
|
|
13
18
|
export declare const ACTIONS_COLUMN_CONFIG: {
|
|
14
19
|
readonly size: 50;
|
|
15
20
|
readonly minSize: 50;
|
|
16
21
|
readonly maxSize: 50;
|
|
17
22
|
};
|
|
18
23
|
export declare const CELL_BACKGROUND_COLORS: {
|
|
19
|
-
readonly header: "
|
|
20
|
-
readonly body: "
|
|
24
|
+
readonly header: "hsl(var(--sidebar))";
|
|
25
|
+
readonly body: "hsl(var(--background))";
|
|
21
26
|
};
|
|
22
27
|
export declare const ROW_HEIGHT_DEFAULT = 66;
|
|
28
|
+
export declare const COLUMN_MIN_SIZE_DEFAULT = 50;
|
|
23
29
|
export declare const PINNED_SHADOW_CLASS = "shadow-[-4px_0_4px_-2px_rgba(0,0,0,0.1)]";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _ = {
|
|
2
2
|
height: "h-8",
|
|
3
3
|
gap: "gap-1.5",
|
|
4
4
|
roundedClass: "rounded-md",
|
|
@@ -8,19 +8,25 @@ const t = {
|
|
|
8
8
|
width: "w-2",
|
|
9
9
|
lineHeight: "h-5",
|
|
10
10
|
lineWidth: "w-[1px]"
|
|
11
|
-
},
|
|
11
|
+
}, t = {
|
|
12
12
|
size: 50,
|
|
13
13
|
minSize: 50,
|
|
14
14
|
maxSize: 50
|
|
15
15
|
}, i = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
size: 50,
|
|
17
|
+
minSize: 50,
|
|
18
|
+
maxSize: 50
|
|
19
|
+
}, n = {
|
|
20
|
+
header: "hsl(var(--sidebar))",
|
|
21
|
+
body: "hsl(var(--background))"
|
|
22
|
+
}, o = 66, s = 50, C = "shadow-[-4px_0_4px_-2px_rgba(0,0,0,0.1)]";
|
|
19
23
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
t as
|
|
23
|
-
|
|
24
|
+
i as ACTIONS_COLUMN_CONFIG,
|
|
25
|
+
n as CELL_BACKGROUND_COLORS,
|
|
26
|
+
t as CHECKBOX_COLUMN_CONFIG,
|
|
27
|
+
_ as COLUMN_HEADER_CONFIG,
|
|
28
|
+
s as COLUMN_MIN_SIZE_DEFAULT,
|
|
29
|
+
C as PINNED_SHADOW_CLASS,
|
|
24
30
|
e as RESIZE_HANDLE_CONFIG,
|
|
25
|
-
|
|
31
|
+
o as ROW_HEIGHT_DEFAULT
|
|
26
32
|
};
|