@devalok/shilp-sutra 0.17.2 → 0.18.0
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/_chunks/avatar.js +21 -19
- package/dist/_chunks/button-group.js +27 -0
- package/dist/_chunks/button.js +53 -35
- package/dist/_chunks/card.js +50 -0
- package/dist/_chunks/checkbox.js +11 -9
- package/dist/_chunks/date-utils.js +13 -0
- package/dist/_chunks/form.js +20 -20
- package/dist/_chunks/link-context.js +19 -0
- package/dist/_chunks/motion.js +1376 -0
- package/dist/_chunks/motion2.js +35 -0
- package/dist/_chunks/primitives.js +3499 -3920
- package/dist/_chunks/sidebar.js +225 -211
- package/dist/_chunks/spinner.js +58 -28
- package/dist/_chunks/tiptap.js +1 -1
- package/dist/_chunks/tooltip.js +27 -10
- package/dist/_chunks/tree-view.js +180 -178
- package/dist/_chunks/use-calendar.js +531 -515
- package/dist/_chunks/utils.js +3 -3
- package/dist/_chunks/vendor-client.js +1792 -1049
- package/dist/_chunks/vendor-utils.js +5123 -1169
- package/dist/composed/activity-feed.d.ts.map +1 -1
- package/dist/composed/activity-feed.js +71 -74
- package/dist/composed/avatar-group.js +36 -36
- package/dist/composed/command-palette.d.ts +1 -1
- package/dist/composed/command-palette.d.ts.map +1 -1
- package/dist/composed/command-palette.js +207 -158
- package/dist/composed/confirm-dialog.d.ts +3 -5
- package/dist/composed/confirm-dialog.d.ts.map +1 -1
- package/dist/composed/confirm-dialog.js +46 -41
- package/dist/composed/content-card.d.ts +1 -1
- package/dist/composed/content-card.js +29 -29
- package/dist/composed/date-picker/calendar-grid.d.ts +1 -1
- package/dist/composed/date-picker/calendar-grid.d.ts.map +1 -1
- package/dist/composed/date-picker/date-picker.d.ts +1 -1
- package/dist/composed/date-picker/date-picker.d.ts.map +1 -1
- package/dist/composed/date-picker/date-range-picker.d.ts +1 -1
- package/dist/composed/date-picker/date-range-picker.d.ts.map +1 -1
- package/dist/composed/date-picker/date-time-picker.d.ts +1 -1
- package/dist/composed/date-picker/date-time-picker.d.ts.map +1 -1
- package/dist/composed/date-picker/month-picker.d.ts +1 -1
- package/dist/composed/date-picker/month-picker.d.ts.map +1 -1
- package/dist/composed/date-picker/presets.d.ts +1 -1
- package/dist/composed/date-picker/presets.d.ts.map +1 -1
- package/dist/composed/date-picker/time-picker.d.ts +1 -1
- package/dist/composed/date-picker/time-picker.d.ts.map +1 -1
- package/dist/composed/date-picker/year-picker.d.ts +1 -1
- package/dist/composed/date-picker/year-picker.d.ts.map +1 -1
- package/dist/composed/empty-state.d.ts +1 -0
- package/dist/composed/empty-state.d.ts.map +1 -1
- package/dist/composed/empty-state.js +51 -47
- package/dist/composed/error-boundary.d.ts +1 -1
- package/dist/composed/error-boundary.d.ts.map +1 -1
- package/dist/composed/error-boundary.js +48 -48
- package/dist/composed/extensions/mention-suggestion.d.ts +1 -1
- package/dist/composed/extensions/mention-suggestion.d.ts.map +1 -1
- package/dist/composed/global-loading.d.ts +1 -1
- package/dist/composed/global-loading.d.ts.map +1 -1
- package/dist/composed/global-loading.js +23 -20
- package/dist/composed/index.d.ts +2 -4
- package/dist/composed/index.d.ts.map +1 -1
- package/dist/composed/index.js +26 -29
- package/dist/composed/loading-skeleton.d.ts +1 -1
- package/dist/composed/loading-skeleton.d.ts.map +1 -1
- package/dist/composed/loading-skeleton.js +92 -87
- package/dist/composed/member-picker.d.ts +1 -1
- package/dist/composed/member-picker.d.ts.map +1 -1
- package/dist/composed/member-picker.js +47 -43
- package/dist/composed/page-header.js +36 -36
- package/dist/composed/page-skeletons.d.ts +9 -3
- package/dist/composed/page-skeletons.d.ts.map +1 -1
- package/dist/composed/page-skeletons.js +58 -58
- package/dist/composed/priority-indicator.js +19 -19
- package/dist/composed/rich-text-editor.d.ts +3 -3
- package/dist/composed/rich-text-editor.d.ts.map +1 -1
- package/dist/composed/rich-text-editor.js +316 -309
- package/dist/composed/schedule-view.js +88 -88
- package/dist/composed/simple-tooltip.d.ts +2 -5
- package/dist/composed/simple-tooltip.d.ts.map +1 -1
- package/dist/composed/simple-tooltip.js +19 -14
- package/dist/composed/status-badge.d.ts +2 -1
- package/dist/composed/status-badge.d.ts.map +1 -1
- package/dist/composed/status-badge.js +76 -63
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +3 -4
- package/dist/hooks/use-toast.d.ts +15 -45
- package/dist/hooks/use-toast.d.ts.map +1 -1
- package/dist/hooks/use-toast.js +2 -95
- package/dist/motion/index.d.ts +4 -0
- package/dist/motion/index.d.ts.map +1 -0
- package/dist/motion/index.js +10 -0
- package/dist/motion/motion-provider.d.ts +18 -0
- package/dist/motion/motion-provider.d.ts.map +1 -0
- package/dist/motion/motion-provider.js +24 -0
- package/dist/motion/primitives-index.d.ts +3 -0
- package/dist/motion/primitives-index.d.ts.map +1 -0
- package/dist/motion/primitives-index.js +11 -0
- package/dist/motion/primitives.d.ts +38 -0
- package/dist/motion/primitives.d.ts.map +1 -0
- package/dist/motion/primitives.js +187 -0
- package/dist/shell/app-command-palette.d.ts +14 -5
- package/dist/shell/app-command-palette.d.ts.map +1 -1
- package/dist/shell/app-command-palette.js +152 -130
- package/dist/shell/bottom-navbar.d.ts.map +1 -1
- package/dist/shell/bottom-navbar.js +90 -92
- package/dist/shell/command-registry.d.ts +23 -0
- package/dist/shell/command-registry.d.ts.map +1 -0
- package/dist/shell/command-registry.js +18 -0
- package/dist/shell/index.d.ts +2 -1
- package/dist/shell/index.d.ts.map +1 -1
- package/dist/shell/index.js +14 -11
- package/dist/shell/link-context.d.ts +6 -10
- package/dist/shell/link-context.d.ts.map +1 -1
- package/dist/shell/link-context.js +3 -16
- package/dist/shell/notification-center.d.ts.map +1 -1
- package/dist/shell/notification-center.js +137 -132
- package/dist/shell/notification-preferences.d.ts +10 -5
- package/dist/shell/notification-preferences.d.ts.map +1 -1
- package/dist/shell/notification-preferences.js +168 -165
- package/dist/shell/sidebar.js +119 -119
- package/dist/shell/top-bar.js +65 -65
- package/dist/tailwind/index.cjs +118 -297
- package/dist/tailwind/preset.d.ts.map +1 -1
- package/dist/tailwind/preset.js +118 -297
- package/dist/tokens/generate-scale.d.ts +86 -0
- package/dist/tokens/generate-scale.d.ts.map +1 -0
- package/dist/tokens/primitives.css +415 -187
- package/dist/tokens/semantic.css +244 -270
- package/dist/tokens/typography.css +6 -6
- package/dist/ui/accordion.d.ts.map +1 -1
- package/dist/ui/accordion.js +32 -22
- package/dist/ui/alert-dialog.d.ts +4 -1
- package/dist/ui/alert-dialog.d.ts.map +1 -1
- package/dist/ui/alert-dialog.js +114 -73
- package/dist/ui/alert.d.ts +6 -1
- package/dist/ui/alert.d.ts.map +1 -1
- package/dist/ui/alert.js +64 -49
- package/dist/ui/aspect-ratio.d.ts +2 -1
- package/dist/ui/aspect-ratio.d.ts.map +1 -1
- package/dist/ui/aspect-ratio.js +14 -4
- package/dist/ui/autocomplete.d.ts +11 -2
- package/dist/ui/autocomplete.d.ts.map +1 -1
- package/dist/ui/autocomplete.js +82 -57
- package/dist/ui/avatar.d.ts.map +1 -1
- package/dist/ui/avatar.js +45 -34
- package/dist/ui/badge.d.ts +1 -1
- package/dist/ui/badge.d.ts.map +1 -1
- package/dist/ui/badge.js +70 -65
- package/dist/ui/banner.d.ts.map +1 -1
- package/dist/ui/banner.js +53 -39
- package/dist/ui/breadcrumb.d.ts +2 -0
- package/dist/ui/breadcrumb.d.ts.map +1 -1
- package/dist/ui/breadcrumb.js +21 -21
- package/dist/ui/button.d.ts +10 -1
- package/dist/ui/button.d.ts.map +1 -1
- package/dist/ui/button.js +103 -67
- package/dist/ui/card.d.ts +2 -2
- package/dist/ui/card.d.ts.map +1 -1
- package/dist/ui/card.js +61 -53
- package/dist/ui/charts/_internal/animation.d.ts +1 -1
- package/dist/ui/charts/_internal/animation.d.ts.map +1 -1
- package/dist/ui/charts/area-chart.d.ts +3 -5
- package/dist/ui/charts/area-chart.d.ts.map +1 -1
- package/dist/ui/charts/bar-chart.d.ts +3 -5
- package/dist/ui/charts/bar-chart.d.ts.map +1 -1
- package/dist/ui/charts/chart-container.d.ts +2 -5
- package/dist/ui/charts/chart-container.d.ts.map +1 -1
- package/dist/ui/charts/gauge-chart.d.ts +3 -5
- package/dist/ui/charts/gauge-chart.d.ts.map +1 -1
- package/dist/ui/charts/index.js +1204 -1095
- package/dist/ui/charts/line-chart.d.ts +3 -5
- package/dist/ui/charts/line-chart.d.ts.map +1 -1
- package/dist/ui/charts/pie-chart.d.ts +2 -5
- package/dist/ui/charts/pie-chart.d.ts.map +1 -1
- package/dist/ui/charts/radar-chart.d.ts +3 -5
- package/dist/ui/charts/radar-chart.d.ts.map +1 -1
- package/dist/ui/charts/sparkline.d.ts +5 -5
- package/dist/ui/charts/sparkline.d.ts.map +1 -1
- package/dist/ui/checkbox.d.ts.map +1 -1
- package/dist/ui/checkbox.js +31 -19
- package/dist/ui/chip.d.ts +3 -2
- package/dist/ui/chip.d.ts.map +1 -1
- package/dist/ui/chip.js +62 -54
- package/dist/ui/code.js +16 -16
- package/dist/ui/collapsible.d.ts.map +1 -1
- package/dist/ui/collapsible.js +23 -15
- package/dist/ui/color-input.d.ts +1 -1
- package/dist/ui/color-input.d.ts.map +1 -1
- package/dist/ui/color-input.js +27 -27
- package/dist/ui/combobox.d.ts +2 -0
- package/dist/ui/combobox.d.ts.map +1 -1
- package/dist/ui/combobox.js +177 -166
- package/dist/ui/context-menu.d.ts +4 -2
- package/dist/ui/context-menu.d.ts.map +1 -1
- package/dist/ui/context-menu.js +146 -86
- package/dist/ui/data-table-toolbar.d.ts +3 -2
- package/dist/ui/data-table-toolbar.d.ts.map +1 -1
- package/dist/ui/data-table-toolbar.js +61 -59
- package/dist/ui/data-table.d.ts.map +1 -1
- package/dist/ui/data-table.js +289 -254
- package/dist/ui/dialog.d.ts +3 -1
- package/dist/ui/dialog.d.ts.map +1 -1
- package/dist/ui/dialog.js +114 -74
- package/dist/ui/dropdown-menu.d.ts +5 -3
- package/dist/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/ui/dropdown-menu.js +150 -89
- package/dist/ui/file-upload.d.ts.map +1 -1
- package/dist/ui/file-upload.js +169 -127
- package/dist/ui/form.d.ts.map +1 -1
- package/dist/ui/form.js +29 -26
- package/dist/ui/hover-card.d.ts +1 -1
- package/dist/ui/hover-card.d.ts.map +1 -1
- package/dist/ui/hover-card.js +53 -21
- package/dist/ui/index.d.ts +18 -18
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +432 -449
- package/dist/ui/input-otp.d.ts +2 -0
- package/dist/ui/input-otp.d.ts.map +1 -1
- package/dist/ui/input-otp.js +7 -7
- package/dist/ui/input.d.ts.map +1 -1
- package/dist/ui/input.js +36 -34
- package/dist/ui/label.js +12 -12
- package/dist/ui/lib/date-utils.d.ts +6 -0
- package/dist/ui/lib/date-utils.d.ts.map +1 -0
- package/dist/ui/lib/index.d.ts +7 -0
- package/dist/ui/lib/index.d.ts.map +1 -0
- package/dist/ui/lib/link-context.d.ts +13 -0
- package/dist/ui/lib/link-context.d.ts.map +1 -0
- package/dist/ui/lib/motion.d.ts +44 -9
- package/dist/ui/lib/motion.d.ts.map +1 -1
- package/dist/ui/lib/use-ripple.d.ts.map +1 -1
- package/dist/ui/lib/utils.js +1 -1
- package/dist/ui/link.js +11 -11
- package/dist/ui/menubar.d.ts +4 -2
- package/dist/ui/menubar.d.ts.map +1 -1
- package/dist/ui/menubar.js +141 -97
- package/dist/ui/navigation-menu.d.ts +2 -0
- package/dist/ui/navigation-menu.d.ts.map +1 -1
- package/dist/ui/navigation-menu.js +176 -73
- package/dist/ui/number-input.d.ts.map +1 -1
- package/dist/ui/number-input.js +56 -49
- package/dist/ui/pagination.js +22 -22
- package/dist/ui/popover.d.ts +2 -1
- package/dist/ui/popover.d.ts.map +1 -1
- package/dist/ui/popover.js +54 -22
- package/dist/ui/progress.d.ts.map +1 -1
- package/dist/ui/progress.js +58 -42
- package/dist/ui/radio.js +19 -19
- package/dist/ui/search-input.d.ts.map +1 -1
- package/dist/ui/search-input.js +28 -33
- package/dist/ui/segmented-control.d.ts +2 -2
- package/dist/ui/segmented-control.d.ts.map +1 -1
- package/dist/ui/segmented-control.js +143 -124
- package/dist/ui/select.d.ts.map +1 -1
- package/dist/ui/select.js +72 -61
- package/dist/ui/separator.js +11 -11
- package/dist/ui/sheet.d.ts +1 -1
- package/dist/ui/sheet.d.ts.map +1 -1
- package/dist/ui/sheet.js +111 -75
- package/dist/ui/sidebar.d.ts +6 -1
- package/dist/ui/sidebar.d.ts.map +1 -1
- package/dist/ui/sidebar.js +27 -25
- package/dist/ui/skeleton.js +1 -1
- package/dist/ui/slider.d.ts +9 -0
- package/dist/ui/slider.d.ts.map +1 -1
- package/dist/ui/slider.js +33 -27
- package/dist/ui/spinner.d.ts +32 -25
- package/dist/ui/spinner.d.ts.map +1 -1
- package/dist/ui/spinner.js +199 -40
- package/dist/ui/stat-card.d.ts.map +1 -1
- package/dist/ui/stat-card.js +183 -116
- package/dist/ui/stepper.d.ts +22 -1
- package/dist/ui/stepper.d.ts.map +1 -1
- package/dist/ui/stepper.js +121 -43
- package/dist/ui/switch.d.ts.map +1 -1
- package/dist/ui/switch.js +39 -26
- package/dist/ui/table.d.ts +3 -0
- package/dist/ui/table.d.ts.map +1 -1
- package/dist/ui/table.js +47 -47
- package/dist/ui/tabs.d.ts +4 -1
- package/dist/ui/tabs.d.ts.map +1 -1
- package/dist/ui/tabs.js +94 -44
- package/dist/ui/text.d.ts +3 -3
- package/dist/ui/text.js +1 -1
- package/dist/ui/textarea.d.ts.map +1 -1
- package/dist/ui/textarea.js +29 -27
- package/dist/ui/toast-types.d.ts +43 -0
- package/dist/ui/toast-types.d.ts.map +1 -0
- package/dist/ui/toast-types.js +2 -0
- package/dist/ui/toast.d.ts +60 -26
- package/dist/ui/toast.d.ts.map +1 -1
- package/dist/ui/toast.js +535 -89
- package/dist/ui/toaster.d.ts +19 -23
- package/dist/ui/toaster.d.ts.map +1 -1
- package/dist/ui/toaster.js +31 -21
- package/dist/ui/toggle-group.d.ts +2 -2
- package/dist/ui/toggle-group.d.ts.map +1 -1
- package/dist/ui/toggle-group.js +29 -26
- package/dist/ui/toggle.d.ts +2 -2
- package/dist/ui/toggle.d.ts.map +1 -1
- package/dist/ui/toggle.js +21 -17
- package/dist/ui/tooltip.d.ts +2 -1
- package/dist/ui/tooltip.d.ts.map +1 -1
- package/dist/ui/tooltip.js +58 -21
- package/dist/ui/tree-view/tree-view.d.ts +1 -1
- package/dist/ui/tree-view/tree-view.d.ts.map +1 -1
- package/llms-full.txt +221 -102
- package/llms.txt +65 -12
- package/package.json +26 -8
- package/dist/_chunks/switch.js +0 -10
- package/dist/composed/upload-progress.d.ts +0 -33
- package/dist/composed/upload-progress.d.ts.map +0 -1
- package/dist/composed/upload-progress.js +0 -386
- package/dist/ui/lib/use-reduced-motion.d.ts +0 -4
- package/dist/ui/lib/use-reduced-motion.d.ts.map +0 -1
- package/dist/ui/transitions.d.ts +0 -17
- package/dist/ui/transitions.d.ts.map +0 -1
- package/dist/ui/transitions.js +0 -111
package/dist/ui/data-table.js
CHANGED
|
@@ -1,33 +1,35 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as d, jsx as n } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import { useReactTable as lt, getExpandedRowModel as
|
|
5
|
-
import { useVirtualizer as
|
|
6
|
-
import { IconArrowUp as
|
|
7
|
-
import { Table as
|
|
8
|
-
import { B as
|
|
9
|
-
import { C as
|
|
10
|
-
import { Skeleton as
|
|
11
|
-
import { c as
|
|
12
|
-
import {
|
|
13
|
-
|
|
3
|
+
import nt, { useState as u, useRef as V, useEffect as D, useCallback as j, useMemo as st } from "react";
|
|
4
|
+
import { useReactTable as lt, getExpandedRowModel as ot, getPaginationRowModel as at, getFilteredRowModel as ct, getSortedRowModel as rt, getCoreRowModel as dt, flexRender as te } from "@tanstack/react-table";
|
|
5
|
+
import { useVirtualizer as it } from "@tanstack/react-virtual";
|
|
6
|
+
import { IconArrowUp as ut, IconArrowDown as ft, IconArrowsSort as mt, IconSearch as gt, IconChevronLeft as pt, IconChevronRight as Ne, IconX as ht } from "@tabler/icons-react";
|
|
7
|
+
import { Table as bt, TableHeader as xt, TableRow as z, TableHead as we, TableBody as A, TableCell as O } from "./table.js";
|
|
8
|
+
import { B as yt } from "../_chunks/button.js";
|
|
9
|
+
import { C as ke } from "../_chunks/checkbox.js";
|
|
10
|
+
import { Skeleton as Re } from "./skeleton.js";
|
|
11
|
+
import { c as a } from "../_chunks/utils.js";
|
|
12
|
+
import { s as ne } from "../_chunks/motion2.js";
|
|
13
|
+
import { DataTableToolbar as St } from "./data-table-toolbar.js";
|
|
14
|
+
import { A as Ct, m as se } from "../_chunks/motion.js";
|
|
15
|
+
const Nt = {
|
|
14
16
|
compact: "py-ds-02",
|
|
15
17
|
standard: "py-ds-05",
|
|
16
18
|
comfortable: "py-ds-07"
|
|
17
19
|
};
|
|
18
|
-
function
|
|
19
|
-
initialValue:
|
|
20
|
-
onSave:
|
|
20
|
+
function wt({
|
|
21
|
+
initialValue: B,
|
|
22
|
+
onSave: f,
|
|
21
23
|
onCancel: K
|
|
22
24
|
}) {
|
|
23
|
-
const [I, S] = u(
|
|
25
|
+
const [I, S] = u(B), p = V(null);
|
|
24
26
|
D(() => {
|
|
25
27
|
var i, E;
|
|
26
28
|
(i = p.current) == null || i.focus(), (E = p.current) == null || E.select();
|
|
27
29
|
}, []);
|
|
28
30
|
const h = j(() => {
|
|
29
|
-
|
|
30
|
-
}, [
|
|
31
|
+
f(I);
|
|
32
|
+
}, [f, I]);
|
|
31
33
|
return /* @__PURE__ */ n(
|
|
32
34
|
"input",
|
|
33
35
|
{
|
|
@@ -39,21 +41,21 @@ function St({
|
|
|
39
41
|
onKeyDown: (i) => {
|
|
40
42
|
i.key === "Enter" ? (i.preventDefault(), h()) : i.key === "Escape" && (i.preventDefault(), K());
|
|
41
43
|
},
|
|
42
|
-
className:
|
|
44
|
+
className: a(
|
|
43
45
|
"h-ds-xs-plus w-full rounded-ds-md",
|
|
44
|
-
"border border-
|
|
46
|
+
"border border-accent-7 bg-surface-3",
|
|
45
47
|
"px-ds-02 text-ds-sm",
|
|
46
|
-
"text-
|
|
47
|
-
"outline-none focus:border-
|
|
48
|
+
"text-surface-fg placeholder:text-surface-fg-subtle",
|
|
49
|
+
"outline-none focus:border-accent-7"
|
|
48
50
|
),
|
|
49
51
|
"aria-label": "Edit cell value"
|
|
50
52
|
}
|
|
51
53
|
);
|
|
52
54
|
}
|
|
53
|
-
const
|
|
54
|
-
function
|
|
55
|
-
columns:
|
|
56
|
-
data:
|
|
55
|
+
const kt = 'button, a, input, select, textarea, [role="checkbox"]';
|
|
56
|
+
function Rt({
|
|
57
|
+
columns: B,
|
|
58
|
+
data: f,
|
|
57
59
|
className: K,
|
|
58
60
|
noResultsText: I,
|
|
59
61
|
sortable: S = !1,
|
|
@@ -61,87 +63,87 @@ function Nt({
|
|
|
61
63
|
globalFilter: h = !1,
|
|
62
64
|
paginated: i = !1,
|
|
63
65
|
pageSize: E,
|
|
64
|
-
pageSizeOptions:
|
|
66
|
+
pageSizeOptions: ze,
|
|
65
67
|
selectable: C = !1,
|
|
66
68
|
onSelectionChange: G,
|
|
67
69
|
toolbar: le = !1,
|
|
68
|
-
density:
|
|
70
|
+
density: De = "standard",
|
|
69
71
|
columnPinning: N,
|
|
70
|
-
editable:
|
|
72
|
+
editable: Ie = !1,
|
|
71
73
|
onCellEdit: L,
|
|
72
74
|
expandable: $ = !1,
|
|
73
|
-
renderExpanded:
|
|
75
|
+
renderExpanded: oe,
|
|
74
76
|
virtualRows: b = !1,
|
|
75
|
-
virtualRowHeight:
|
|
76
|
-
maxHeight:
|
|
77
|
+
virtualRowHeight: Ee = 48,
|
|
78
|
+
maxHeight: Fe = 600,
|
|
77
79
|
onSort: F,
|
|
78
|
-
emptyState:
|
|
79
|
-
loading:
|
|
80
|
+
emptyState: ae,
|
|
81
|
+
loading: Te = !1,
|
|
80
82
|
selectedIds: Y,
|
|
81
|
-
selectableFilter:
|
|
83
|
+
selectableFilter: ce,
|
|
82
84
|
getRowId: g,
|
|
83
|
-
pagination:
|
|
85
|
+
pagination: l,
|
|
84
86
|
singleExpand: U = !1,
|
|
85
|
-
stickyHeader:
|
|
87
|
+
stickyHeader: Me = !1,
|
|
86
88
|
onRowClick: T,
|
|
87
89
|
bulkActions: _
|
|
88
90
|
}) {
|
|
89
|
-
const [
|
|
90
|
-
pageIndex:
|
|
91
|
-
pageSize: (
|
|
92
|
-
}), [x,
|
|
91
|
+
const [Ve, re] = u([]), [je, $e] = u([]), [W, X] = u(""), [_e, q] = u({
|
|
92
|
+
pageIndex: l ? l.page - 1 : 0,
|
|
93
|
+
pageSize: (l == null ? void 0 : l.pageSize) ?? E ?? 10
|
|
94
|
+
}), [x, de] = u({}), [He, Ae] = u({}), [ie, Oe] = u({
|
|
93
95
|
left: (N == null ? void 0 : N.left) ?? [],
|
|
94
96
|
right: (N == null ? void 0 : N.right) ?? []
|
|
95
|
-
}), [
|
|
97
|
+
}), [ue, Be] = u(De), [w, J] = u(null), [Ke, fe] = u({}), me = V(null), Q = V(!1);
|
|
96
98
|
D(() => {
|
|
97
99
|
if (Y) {
|
|
98
100
|
Q.current = !0;
|
|
99
101
|
const e = {};
|
|
100
102
|
Y.forEach((t) => {
|
|
101
103
|
e[t] = !0;
|
|
102
|
-
}),
|
|
104
|
+
}), de(e);
|
|
103
105
|
}
|
|
104
106
|
}, [Y]), D(() => {
|
|
105
|
-
|
|
107
|
+
l && q((e) => ({
|
|
106
108
|
...e,
|
|
107
|
-
pageIndex:
|
|
108
|
-
pageSize:
|
|
109
|
+
pageIndex: l.page - 1,
|
|
110
|
+
pageSize: l.pageSize
|
|
109
111
|
}));
|
|
110
|
-
}, [
|
|
111
|
-
const
|
|
112
|
+
}, [l == null ? void 0 : l.page, l == null ? void 0 : l.pageSize]);
|
|
113
|
+
const Ge = j(
|
|
112
114
|
(e) => {
|
|
113
115
|
re((t) => {
|
|
114
|
-
const
|
|
115
|
-
return F && (
|
|
116
|
+
const s = typeof e == "function" ? e(t) : e;
|
|
117
|
+
return F && (s.length === 0 && t.length > 0 ? F(t[0].id, !1) : s.length > 0 && F(s[0].id, s[0].desc ? "desc" : "asc")), s;
|
|
116
118
|
});
|
|
117
119
|
},
|
|
118
120
|
[F]
|
|
119
|
-
),
|
|
121
|
+
), Le = j(
|
|
120
122
|
(e) => {
|
|
121
|
-
|
|
122
|
-
const
|
|
123
|
-
if (!U ||
|
|
124
|
-
const
|
|
125
|
-
return R.length > 0 ? { [R[R.length - 1]]: !0 } :
|
|
123
|
+
fe((t) => {
|
|
124
|
+
const s = typeof e == "function" ? e(t) : e;
|
|
125
|
+
if (!U || s === !0 || typeof s != "object") return s;
|
|
126
|
+
const o = typeof t == "object" ? Object.keys(t).filter((m) => t[m]) : [], R = Object.keys(s).filter((m) => s[m]).filter((m) => !o.includes(m));
|
|
127
|
+
return R.length > 0 ? { [R[R.length - 1]]: !0 } : s;
|
|
126
128
|
});
|
|
127
129
|
},
|
|
128
130
|
[U]
|
|
129
|
-
), Z = V(
|
|
131
|
+
), Z = V(l == null ? void 0 : l.onPageChange);
|
|
130
132
|
D(() => {
|
|
131
|
-
Z.current =
|
|
132
|
-
}, [
|
|
133
|
-
const
|
|
133
|
+
Z.current = l == null ? void 0 : l.onPageChange;
|
|
134
|
+
}, [l == null ? void 0 : l.onPageChange]);
|
|
135
|
+
const Ye = j(
|
|
134
136
|
(e) => {
|
|
135
137
|
q((t) => {
|
|
136
|
-
const
|
|
137
|
-
return Z.current &&
|
|
138
|
+
const s = typeof e == "function" ? e(t) : e;
|
|
139
|
+
return Z.current && s.pageIndex !== t.pageIndex && Z.current(s.pageIndex + 1), s;
|
|
138
140
|
});
|
|
139
141
|
},
|
|
140
142
|
[]
|
|
141
|
-
),
|
|
143
|
+
), Ue = {
|
|
142
144
|
id: "_select",
|
|
143
145
|
header: ({ table: e }) => /* @__PURE__ */ n(
|
|
144
|
-
|
|
146
|
+
ke,
|
|
145
147
|
{
|
|
146
148
|
checked: e.getIsAllPageRowsSelected(),
|
|
147
149
|
indeterminate: e.getIsSomePageRowsSelected(),
|
|
@@ -150,7 +152,7 @@ function Nt({
|
|
|
150
152
|
}
|
|
151
153
|
),
|
|
152
154
|
cell: ({ row: e }) => /* @__PURE__ */ n(
|
|
153
|
-
|
|
155
|
+
ke,
|
|
154
156
|
{
|
|
155
157
|
checked: e.getIsSelected(),
|
|
156
158
|
disabled: !e.getCanSelect(),
|
|
@@ -161,7 +163,7 @@ function Nt({
|
|
|
161
163
|
enableSorting: !1,
|
|
162
164
|
enableColumnFilter: !1,
|
|
163
165
|
enableHiding: !1
|
|
164
|
-
},
|
|
166
|
+
}, We = {
|
|
165
167
|
id: "_expand",
|
|
166
168
|
header: () => null,
|
|
167
169
|
cell: ({ row: e }) => /* @__PURE__ */ n(
|
|
@@ -170,12 +172,12 @@ function Nt({
|
|
|
170
172
|
type: "button",
|
|
171
173
|
onClick: () => e.toggleExpanded(),
|
|
172
174
|
"aria-label": e.getIsExpanded() ? "Collapse row" : "Expand row",
|
|
173
|
-
className: "flex items-center justify-center p-ds-01 rounded-ds-sm hover:bg-
|
|
175
|
+
className: "flex items-center justify-center p-ds-01 rounded-ds-sm hover:bg-surface-2 transition-colors",
|
|
174
176
|
children: /* @__PURE__ */ n(
|
|
175
|
-
|
|
177
|
+
Ne,
|
|
176
178
|
{
|
|
177
179
|
size: 16,
|
|
178
|
-
className:
|
|
180
|
+
className: a(
|
|
179
181
|
"transition-transform duration-moderate-02",
|
|
180
182
|
e.getIsExpanded() && "rotate-90"
|
|
181
183
|
),
|
|
@@ -188,46 +190,46 @@ function Nt({
|
|
|
188
190
|
enableColumnFilter: !1,
|
|
189
191
|
enableHiding: !1
|
|
190
192
|
}, k = [
|
|
191
|
-
...C ? [
|
|
192
|
-
...$ ? [
|
|
193
|
-
...
|
|
194
|
-
], M = !!
|
|
195
|
-
columnVisibility:
|
|
196
|
-
columnPinning:
|
|
193
|
+
...C ? [Ue] : [],
|
|
194
|
+
...$ ? [We] : [],
|
|
195
|
+
...B
|
|
196
|
+
], M = !!l, v = i || M, y = {
|
|
197
|
+
columnVisibility: He,
|
|
198
|
+
columnPinning: ie
|
|
197
199
|
};
|
|
198
|
-
S && (y.sorting =
|
|
199
|
-
const
|
|
200
|
-
data:
|
|
200
|
+
S && (y.sorting = Ve), (p || h) && (y.columnFilters = je, y.globalFilter = W), v && (y.pagination = _e), C && (y.rowSelection = x), $ && (y.expanded = Ke);
|
|
201
|
+
const ge = S && !!F, c = lt({
|
|
202
|
+
data: f,
|
|
201
203
|
columns: k,
|
|
202
204
|
state: y,
|
|
203
|
-
onColumnVisibilityChange:
|
|
204
|
-
onColumnPinningChange:
|
|
205
|
-
getCoreRowModel:
|
|
205
|
+
onColumnVisibilityChange: Ae,
|
|
206
|
+
onColumnPinningChange: Oe,
|
|
207
|
+
getCoreRowModel: dt(),
|
|
206
208
|
...S && {
|
|
207
|
-
onSortingChange:
|
|
208
|
-
...
|
|
209
|
+
onSortingChange: ge ? Ge : re,
|
|
210
|
+
...ge ? { manualSorting: !0 } : { getSortedRowModel: rt() }
|
|
209
211
|
},
|
|
210
212
|
...(p || h) && {
|
|
211
|
-
onColumnFiltersChange:
|
|
213
|
+
onColumnFiltersChange: $e,
|
|
212
214
|
onGlobalFilterChange: X,
|
|
213
|
-
getFilteredRowModel:
|
|
215
|
+
getFilteredRowModel: ct()
|
|
214
216
|
},
|
|
215
217
|
...v && {
|
|
216
|
-
onPaginationChange: M ?
|
|
218
|
+
onPaginationChange: M ? Ye : q,
|
|
217
219
|
...M ? {
|
|
218
220
|
manualPagination: !0,
|
|
219
221
|
pageCount: Math.ceil(
|
|
220
|
-
|
|
222
|
+
l.total / l.pageSize
|
|
221
223
|
)
|
|
222
|
-
} : { getPaginationRowModel:
|
|
224
|
+
} : { getPaginationRowModel: at() }
|
|
223
225
|
},
|
|
224
226
|
...C && {
|
|
225
|
-
onRowSelectionChange:
|
|
226
|
-
enableRowSelection:
|
|
227
|
+
onRowSelectionChange: de,
|
|
228
|
+
enableRowSelection: ce ? (e) => ce(e.original) : !0
|
|
227
229
|
},
|
|
228
230
|
...$ && {
|
|
229
|
-
onExpandedChange: U ?
|
|
230
|
-
getExpandedRowModel:
|
|
231
|
+
onExpandedChange: U ? Le : fe,
|
|
232
|
+
getExpandedRowModel: ot()
|
|
231
233
|
},
|
|
232
234
|
...g && {
|
|
233
235
|
getRowId: (e) => g(e)
|
|
@@ -241,197 +243,197 @@ function Nt({
|
|
|
241
243
|
return;
|
|
242
244
|
}
|
|
243
245
|
if (!P.current) return;
|
|
244
|
-
const e = Object.keys(x).filter((
|
|
245
|
-
const
|
|
246
|
-
return e.includes(
|
|
246
|
+
const e = Object.keys(x).filter((s) => x[s]), t = f.filter((s, o) => {
|
|
247
|
+
const r = g ? g(f[o]) : String(o);
|
|
248
|
+
return e.includes(r);
|
|
247
249
|
});
|
|
248
250
|
P.current(t);
|
|
249
|
-
}, [x,
|
|
250
|
-
function
|
|
251
|
-
const { left: t = [], right:
|
|
252
|
-
return
|
|
253
|
-
className: "sticky bg-
|
|
251
|
+
}, [x, f, g]);
|
|
252
|
+
function pe(e) {
|
|
253
|
+
const { left: t = [], right: s = [] } = ie, o = t.indexOf(e), r = s.indexOf(e);
|
|
254
|
+
return o !== -1 ? {
|
|
255
|
+
className: "sticky bg-surface-1 z-raised",
|
|
254
256
|
style: { left: 0 }
|
|
255
|
-
} :
|
|
256
|
-
className: "sticky bg-
|
|
257
|
+
} : r !== -1 ? {
|
|
258
|
+
className: "sticky bg-surface-1 z-raised",
|
|
257
259
|
style: { right: 0 }
|
|
258
260
|
} : { className: "", style: {} };
|
|
259
261
|
}
|
|
260
|
-
function
|
|
261
|
-
if (!
|
|
262
|
-
const t =
|
|
262
|
+
function Xe(e) {
|
|
263
|
+
if (!Ie || e === "_select" || e === "_expand") return !1;
|
|
264
|
+
const t = c.getColumn(e);
|
|
263
265
|
if (!t) return !1;
|
|
264
|
-
const
|
|
265
|
-
return (
|
|
266
|
+
const s = t.columnDef.meta;
|
|
267
|
+
return (s == null ? void 0 : s.enableEditing) !== !1;
|
|
266
268
|
}
|
|
267
|
-
const
|
|
269
|
+
const he = Nt[ue], H = c.getRowModel().rows, be = it({
|
|
268
270
|
count: b ? H.length : 0,
|
|
269
|
-
getScrollElement: () =>
|
|
270
|
-
estimateSize: () =>
|
|
271
|
+
getScrollElement: () => me.current,
|
|
272
|
+
estimateSize: () => Ee,
|
|
271
273
|
overscan: 10
|
|
272
|
-
}),
|
|
274
|
+
}), qe = (l == null ? void 0 : l.pageSize) ?? E ?? 5, Je = k.length, Qe = j(
|
|
273
275
|
(e, t) => {
|
|
274
|
-
!T || t.target.closest(
|
|
276
|
+
!T || t.target.closest(kt) || T(e);
|
|
275
277
|
},
|
|
276
278
|
[T]
|
|
277
279
|
);
|
|
278
|
-
function
|
|
279
|
-
const
|
|
280
|
+
function xe(e, t) {
|
|
281
|
+
const s = e.getVisibleCells();
|
|
280
282
|
return /* @__PURE__ */ n(
|
|
281
283
|
z,
|
|
282
284
|
{
|
|
283
285
|
"data-state": e.getIsSelected() && "selected",
|
|
284
286
|
style: t,
|
|
285
|
-
className:
|
|
287
|
+
className: a(
|
|
286
288
|
b ? "absolute w-full flex" : void 0,
|
|
287
289
|
T && "cursor-pointer"
|
|
288
290
|
),
|
|
289
|
-
onClick: T ? (
|
|
290
|
-
children:
|
|
291
|
-
const
|
|
291
|
+
onClick: T ? (o) => Qe(e.original, o) : void 0,
|
|
292
|
+
children: s.map((o) => {
|
|
293
|
+
const r = pe(o.column.id), R = (w == null ? void 0 : w.rowIndex) === e.index && (w == null ? void 0 : w.columnId) === o.column.id;
|
|
292
294
|
return /* @__PURE__ */ n(
|
|
293
|
-
|
|
295
|
+
O,
|
|
294
296
|
{
|
|
295
|
-
className:
|
|
296
|
-
|
|
297
|
-
|
|
297
|
+
className: a(
|
|
298
|
+
he,
|
|
299
|
+
r.className,
|
|
298
300
|
b && "flex-1"
|
|
299
301
|
),
|
|
300
|
-
style:
|
|
302
|
+
style: r.style,
|
|
301
303
|
onDoubleClick: () => {
|
|
302
|
-
|
|
304
|
+
Xe(o.column.id) && J({
|
|
303
305
|
rowIndex: e.index,
|
|
304
|
-
columnId:
|
|
306
|
+
columnId: o.column.id
|
|
305
307
|
});
|
|
306
308
|
},
|
|
307
309
|
children: R ? /* @__PURE__ */ n(
|
|
308
|
-
|
|
310
|
+
wt,
|
|
309
311
|
{
|
|
310
|
-
initialValue: String(
|
|
311
|
-
onSave: (
|
|
312
|
-
L == null || L(e.index,
|
|
312
|
+
initialValue: String(o.getValue() ?? ""),
|
|
313
|
+
onSave: (m) => {
|
|
314
|
+
L == null || L(e.index, o.column.id, m), J(null);
|
|
313
315
|
},
|
|
314
316
|
onCancel: () => J(null)
|
|
315
317
|
}
|
|
316
|
-
) : te(
|
|
318
|
+
) : te(o.column.columnDef.cell, o.getContext())
|
|
317
319
|
},
|
|
318
|
-
|
|
320
|
+
o.id
|
|
319
321
|
);
|
|
320
322
|
})
|
|
321
323
|
},
|
|
322
324
|
e.id
|
|
323
325
|
);
|
|
324
326
|
}
|
|
325
|
-
function
|
|
326
|
-
return !$ || !e.getIsExpanded() || !
|
|
327
|
+
function Ze(e, t) {
|
|
328
|
+
return !$ || !e.getIsExpanded() || !oe ? null : /* @__PURE__ */ n(
|
|
327
329
|
z,
|
|
328
330
|
{
|
|
329
331
|
style: t,
|
|
330
332
|
className: b ? "absolute w-full flex" : void 0,
|
|
331
333
|
children: /* @__PURE__ */ n(
|
|
332
|
-
|
|
334
|
+
O,
|
|
333
335
|
{
|
|
334
336
|
colSpan: k.length,
|
|
335
|
-
className:
|
|
336
|
-
"bg-
|
|
337
|
+
className: a(
|
|
338
|
+
"bg-surface-2 p-ds-05",
|
|
337
339
|
b && "flex-1"
|
|
338
340
|
),
|
|
339
|
-
children:
|
|
341
|
+
children: oe(e.original)
|
|
340
342
|
}
|
|
341
343
|
)
|
|
342
344
|
},
|
|
343
345
|
`${e.id}-expanded`
|
|
344
346
|
);
|
|
345
347
|
}
|
|
346
|
-
function
|
|
348
|
+
function ve() {
|
|
347
349
|
const e = ["w-3/4", "w-1/2", "w-2/3", "w-full"];
|
|
348
|
-
return /* @__PURE__ */ n(
|
|
349
|
-
var
|
|
350
|
-
const
|
|
350
|
+
return /* @__PURE__ */ n(A, { children: Array.from({ length: qe }, (t, s) => /* @__PURE__ */ n(z, { children: Array.from({ length: Je }, (o, r) => {
|
|
351
|
+
var Se, Ce;
|
|
352
|
+
const m = (((Se = k[r]) == null ? void 0 : Se.id) ?? ((Ce = k[r]) == null ? void 0 : Ce.header)) === "_select";
|
|
351
353
|
return /* @__PURE__ */ n(
|
|
352
|
-
|
|
354
|
+
O,
|
|
353
355
|
{
|
|
354
|
-
className:
|
|
355
|
-
children:
|
|
356
|
+
className: he,
|
|
357
|
+
children: m ? /* @__PURE__ */ n(Re, { variant: "text", className: "h-4 w-4", animation: "pulse" }) : /* @__PURE__ */ n(Re, { variant: "text", className: a("h-4", e[r % e.length]), animation: "pulse" })
|
|
356
358
|
},
|
|
357
|
-
`skeleton-${
|
|
359
|
+
`skeleton-${s}-${r}`
|
|
358
360
|
);
|
|
359
|
-
}) }, `skeleton-${
|
|
361
|
+
}) }, `skeleton-${s}`)) });
|
|
360
362
|
}
|
|
361
|
-
function
|
|
362
|
-
if (
|
|
363
|
-
return
|
|
363
|
+
function Pe() {
|
|
364
|
+
if (Te)
|
|
365
|
+
return ve();
|
|
364
366
|
if (!H.length)
|
|
365
|
-
return /* @__PURE__ */ n(
|
|
366
|
-
|
|
367
|
+
return /* @__PURE__ */ n(A, { children: /* @__PURE__ */ n(z, { children: /* @__PURE__ */ n(
|
|
368
|
+
O,
|
|
367
369
|
{
|
|
368
370
|
colSpan: k.length,
|
|
369
|
-
className:
|
|
371
|
+
className: a(
|
|
370
372
|
"h-24 text-center",
|
|
371
|
-
!
|
|
373
|
+
!ae && "text-surface-fg-subtle"
|
|
372
374
|
),
|
|
373
|
-
children:
|
|
375
|
+
children: ae || I || "No results."
|
|
374
376
|
}
|
|
375
377
|
) }) });
|
|
376
378
|
if (b) {
|
|
377
|
-
const e =
|
|
379
|
+
const e = be.getVirtualItems(), t = be.getTotalSize();
|
|
378
380
|
return /* @__PURE__ */ n(
|
|
379
|
-
|
|
381
|
+
A,
|
|
380
382
|
{
|
|
381
383
|
style: {
|
|
382
384
|
height: `${t}px`,
|
|
383
385
|
position: "relative"
|
|
384
386
|
},
|
|
385
|
-
children: e.map((
|
|
386
|
-
const
|
|
387
|
-
return
|
|
387
|
+
children: e.map((s) => {
|
|
388
|
+
const o = H[s.index];
|
|
389
|
+
return xe(o, {
|
|
388
390
|
position: "absolute",
|
|
389
391
|
top: 0,
|
|
390
392
|
left: 0,
|
|
391
393
|
width: "100%",
|
|
392
|
-
height: `${
|
|
393
|
-
transform: `translateY(${
|
|
394
|
+
height: `${s.size}px`,
|
|
395
|
+
transform: `translateY(${s.start}px)`
|
|
394
396
|
});
|
|
395
397
|
})
|
|
396
398
|
}
|
|
397
399
|
);
|
|
398
400
|
}
|
|
399
|
-
return /* @__PURE__ */ n(
|
|
400
|
-
|
|
401
|
-
|
|
401
|
+
return /* @__PURE__ */ n(A, { children: H.map((e) => /* @__PURE__ */ d(nt.Fragment, { children: [
|
|
402
|
+
xe(e),
|
|
403
|
+
Ze(e)
|
|
402
404
|
] }, e.id)) });
|
|
403
405
|
}
|
|
404
|
-
const ee =
|
|
406
|
+
const ee = st(() => {
|
|
405
407
|
if (!_ || !C) return [];
|
|
406
408
|
const e = Object.keys(x).filter((t) => x[t]);
|
|
407
|
-
return
|
|
408
|
-
const
|
|
409
|
-
return e.includes(
|
|
409
|
+
return f.filter((t, s) => {
|
|
410
|
+
const o = g ? g(f[s]) : String(s);
|
|
411
|
+
return e.includes(o);
|
|
410
412
|
});
|
|
411
|
-
}, [_, C, x,
|
|
413
|
+
}, [_, C, x, f, g]), et = ee.length > 0, tt = M ? l.total : c.getFilteredRowModel().rows.length, ye = /* @__PURE__ */ d(bt, { children: [
|
|
412
414
|
/* @__PURE__ */ d(
|
|
413
|
-
|
|
415
|
+
xt,
|
|
414
416
|
{
|
|
415
|
-
className:
|
|
416
|
-
|
|
417
|
+
className: a(
|
|
418
|
+
Me && "sticky top-0 z-10 bg-surface-1"
|
|
417
419
|
),
|
|
418
420
|
children: [
|
|
419
|
-
|
|
420
|
-
const
|
|
421
|
+
c.getHeaderGroups().map((e) => /* @__PURE__ */ n(z, { children: e.headers.map((t) => {
|
|
422
|
+
const s = S && t.column.getCanSort(), o = t.column.getIsSorted(), r = pe(t.column.id);
|
|
421
423
|
return /* @__PURE__ */ n(
|
|
422
|
-
|
|
424
|
+
we,
|
|
423
425
|
{
|
|
424
|
-
className:
|
|
425
|
-
style:
|
|
426
|
-
children: t.isPlaceholder ? null :
|
|
426
|
+
className: r.className,
|
|
427
|
+
style: r.style,
|
|
428
|
+
children: t.isPlaceholder ? null : s ? /* @__PURE__ */ d(
|
|
427
429
|
"button",
|
|
428
430
|
{
|
|
429
431
|
type: "button",
|
|
430
|
-
className:
|
|
432
|
+
className: a(
|
|
431
433
|
"flex items-center gap-ds-01 font-medium",
|
|
432
434
|
"cursor-pointer select-none",
|
|
433
435
|
"-ml-ds-01 rounded-ds-sm px-ds-01 py-ds-01",
|
|
434
|
-
"hover:bg-
|
|
436
|
+
"hover:bg-surface-2 transition-colors"
|
|
435
437
|
),
|
|
436
438
|
onClick: t.column.getToggleSortingHandler(),
|
|
437
439
|
"aria-label": `Sort by ${typeof t.column.columnDef.header == "string" ? t.column.columnDef.header : t.column.id}`,
|
|
@@ -440,25 +442,58 @@ function Nt({
|
|
|
440
442
|
t.column.columnDef.header,
|
|
441
443
|
t.getContext()
|
|
442
444
|
),
|
|
443
|
-
|
|
444
|
-
|
|
445
|
+
/* @__PURE__ */ n(Ct, { mode: "wait", initial: !1, children: o === "asc" ? /* @__PURE__ */ n(
|
|
446
|
+
se.span,
|
|
445
447
|
{
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
448
|
+
initial: { opacity: 0, rotate: 90 },
|
|
449
|
+
animate: { opacity: 1, rotate: 0 },
|
|
450
|
+
exit: { opacity: 0, rotate: -90 },
|
|
451
|
+
transition: ne.snappy,
|
|
452
|
+
className: "inline-flex",
|
|
453
|
+
children: /* @__PURE__ */ n(
|
|
454
|
+
ut,
|
|
455
|
+
{
|
|
456
|
+
className: "h-ico-sm w-ico-sm text-surface-fg-muted",
|
|
457
|
+
"aria-hidden": "true"
|
|
458
|
+
}
|
|
459
|
+
)
|
|
460
|
+
},
|
|
461
|
+
"asc"
|
|
462
|
+
) : o === "desc" ? /* @__PURE__ */ n(
|
|
463
|
+
se.span,
|
|
451
464
|
{
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
465
|
+
initial: { opacity: 0, rotate: -90 },
|
|
466
|
+
animate: { opacity: 1, rotate: 0 },
|
|
467
|
+
exit: { opacity: 0, rotate: 90 },
|
|
468
|
+
transition: ne.snappy,
|
|
469
|
+
className: "inline-flex",
|
|
470
|
+
children: /* @__PURE__ */ n(
|
|
471
|
+
ft,
|
|
472
|
+
{
|
|
473
|
+
className: "h-ico-sm w-ico-sm text-surface-fg-muted",
|
|
474
|
+
"aria-hidden": "true"
|
|
475
|
+
}
|
|
476
|
+
)
|
|
477
|
+
},
|
|
478
|
+
"desc"
|
|
455
479
|
) : /* @__PURE__ */ n(
|
|
456
|
-
|
|
480
|
+
se.span,
|
|
457
481
|
{
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
482
|
+
initial: { opacity: 0 },
|
|
483
|
+
animate: { opacity: 1 },
|
|
484
|
+
exit: { opacity: 0 },
|
|
485
|
+
transition: ne.snappy,
|
|
486
|
+
className: "inline-flex",
|
|
487
|
+
children: /* @__PURE__ */ n(
|
|
488
|
+
mt,
|
|
489
|
+
{
|
|
490
|
+
className: "h-ico-sm w-ico-sm text-surface-fg-subtle",
|
|
491
|
+
"aria-hidden": "true"
|
|
492
|
+
}
|
|
493
|
+
)
|
|
494
|
+
},
|
|
495
|
+
"unsorted"
|
|
496
|
+
) })
|
|
462
497
|
]
|
|
463
498
|
}
|
|
464
499
|
) : te(
|
|
@@ -469,46 +504,46 @@ function Nt({
|
|
|
469
504
|
t.id
|
|
470
505
|
);
|
|
471
506
|
}) }, e.id)),
|
|
472
|
-
p &&
|
|
507
|
+
p && c.getHeaderGroups().map((e) => /* @__PURE__ */ n(z, { children: e.headers.map((t) => /* @__PURE__ */ n(we, { className: "py-ds-01", children: t.isPlaceholder || t.column.columnDef.enableColumnFilter === !1 ? null : /* @__PURE__ */ n(
|
|
473
508
|
"input",
|
|
474
509
|
{
|
|
475
510
|
type: "text",
|
|
476
511
|
value: t.column.getFilterValue() ?? "",
|
|
477
|
-
onChange: (
|
|
512
|
+
onChange: (s) => t.column.setFilterValue(s.target.value),
|
|
478
513
|
placeholder: `Filter ${typeof t.column.columnDef.header == "string" ? t.column.columnDef.header : ""}...`,
|
|
479
514
|
"aria-label": `Filter ${typeof t.column.columnDef.header == "string" ? t.column.columnDef.header : t.column.id}`,
|
|
480
|
-
className:
|
|
515
|
+
className: a(
|
|
481
516
|
"h-ds-xs-plus w-full rounded-ds-md",
|
|
482
|
-
"border border-border bg-
|
|
517
|
+
"border border-surface-border-strong bg-surface-3",
|
|
483
518
|
"px-ds-02 text-ds-sm",
|
|
484
|
-
"text-
|
|
485
|
-
"outline-none focus:border-
|
|
519
|
+
"text-surface-fg placeholder:text-surface-fg-subtle",
|
|
520
|
+
"outline-none focus:border-accent-7"
|
|
486
521
|
)
|
|
487
522
|
}
|
|
488
523
|
) }, `${t.id}-filter`)) }, `${e.id}-filters`))
|
|
489
524
|
]
|
|
490
525
|
}
|
|
491
526
|
),
|
|
492
|
-
|
|
527
|
+
Pe()
|
|
493
528
|
] });
|
|
494
|
-
return /* @__PURE__ */ d("div", { className:
|
|
529
|
+
return /* @__PURE__ */ d("div", { className: a(K), children: [
|
|
495
530
|
le && /* @__PURE__ */ n(
|
|
496
|
-
|
|
531
|
+
St,
|
|
497
532
|
{
|
|
498
|
-
table:
|
|
533
|
+
table: c,
|
|
499
534
|
globalFilter: h,
|
|
500
535
|
globalFilterValue: W,
|
|
501
536
|
onGlobalFilterChange: X,
|
|
502
|
-
density:
|
|
503
|
-
onDensityChange:
|
|
537
|
+
density: ue,
|
|
538
|
+
onDensityChange: Be
|
|
504
539
|
}
|
|
505
540
|
),
|
|
506
|
-
h && !le && /* @__PURE__ */ d("div", { className: "flex items-center gap-ds-03 pb-ds-04 border-b border-border
|
|
541
|
+
h && !le && /* @__PURE__ */ d("div", { className: "flex items-center gap-ds-03 pb-ds-04 border-b border-surface-border mb-ds-04", children: [
|
|
507
542
|
/* @__PURE__ */ n(
|
|
508
|
-
|
|
543
|
+
gt,
|
|
509
544
|
{
|
|
510
545
|
size: 16,
|
|
511
|
-
className: "text-
|
|
546
|
+
className: "text-surface-fg-subtle",
|
|
512
547
|
"aria-hidden": "true"
|
|
513
548
|
}
|
|
514
549
|
),
|
|
@@ -520,9 +555,9 @@ function Nt({
|
|
|
520
555
|
onChange: (e) => X(e.target.value),
|
|
521
556
|
placeholder: "Search all columns...",
|
|
522
557
|
"aria-label": "Search all columns",
|
|
523
|
-
className:
|
|
558
|
+
className: a(
|
|
524
559
|
"flex-1 bg-transparent text-ds-md",
|
|
525
|
-
"text-
|
|
560
|
+
"text-surface-fg placeholder:text-surface-fg-subtle",
|
|
526
561
|
"outline-none"
|
|
527
562
|
)
|
|
528
563
|
}
|
|
@@ -531,32 +566,32 @@ function Nt({
|
|
|
531
566
|
b ? /* @__PURE__ */ n(
|
|
532
567
|
"div",
|
|
533
568
|
{
|
|
534
|
-
ref:
|
|
535
|
-
style: { maxHeight: `${
|
|
536
|
-
children:
|
|
569
|
+
ref: me,
|
|
570
|
+
style: { maxHeight: `${Fe}px`, overflowY: "auto" },
|
|
571
|
+
children: ye
|
|
537
572
|
}
|
|
538
|
-
) :
|
|
539
|
-
v && /* @__PURE__ */ d("div", { className: "flex items-center justify-between px-ds-03 py-ds-04 border-t border-border
|
|
540
|
-
/* @__PURE__ */ d("span", { className: "text-ds-sm text-
|
|
541
|
-
|
|
573
|
+
) : ye,
|
|
574
|
+
v && /* @__PURE__ */ d("div", { className: "flex items-center justify-between px-ds-03 py-ds-04 border-t border-surface-border", children: [
|
|
575
|
+
/* @__PURE__ */ d("span", { className: "text-ds-sm text-surface-fg-muted", children: [
|
|
576
|
+
tt,
|
|
542
577
|
" total rows"
|
|
543
578
|
] }),
|
|
544
579
|
/* @__PURE__ */ d("div", { className: "flex items-center gap-ds-03", children: [
|
|
545
580
|
!M && /* @__PURE__ */ n(
|
|
546
581
|
"select",
|
|
547
582
|
{
|
|
548
|
-
value:
|
|
583
|
+
value: c.getState().pagination.pageSize,
|
|
549
584
|
onChange: (e) => {
|
|
550
|
-
|
|
585
|
+
c.setPageSize(Number(e.target.value));
|
|
551
586
|
},
|
|
552
587
|
"aria-label": "Rows per page",
|
|
553
|
-
className:
|
|
588
|
+
className: a(
|
|
554
589
|
"h-ds-sm rounded-ds-md",
|
|
555
|
-
"border border-border bg-
|
|
590
|
+
"border border-surface-border-strong bg-surface-3",
|
|
556
591
|
"px-ds-03 text-ds-sm",
|
|
557
|
-
"text-
|
|
592
|
+
"text-surface-fg"
|
|
558
593
|
),
|
|
559
|
-
children: (
|
|
594
|
+
children: (ze ?? [10, 20, 50, 100]).map((e) => /* @__PURE__ */ d("option", { value: e, children: [
|
|
560
595
|
e,
|
|
561
596
|
" rows"
|
|
562
597
|
] }, e))
|
|
@@ -566,64 +601,64 @@ function Nt({
|
|
|
566
601
|
"button",
|
|
567
602
|
{
|
|
568
603
|
type: "button",
|
|
569
|
-
disabled: !
|
|
570
|
-
onClick: () =>
|
|
604
|
+
disabled: !c.getCanPreviousPage(),
|
|
605
|
+
onClick: () => c.previousPage(),
|
|
571
606
|
"aria-label": "Previous page",
|
|
572
|
-
className:
|
|
607
|
+
className: a(
|
|
573
608
|
"h-ds-sm w-ds-sm flex items-center justify-center",
|
|
574
|
-
"rounded-ds-md border border-border",
|
|
575
|
-
"enabled:hover:bg-
|
|
576
|
-
"disabled:opacity-
|
|
609
|
+
"rounded-ds-md border border-surface-border-strong",
|
|
610
|
+
"enabled:hover:bg-surface-2",
|
|
611
|
+
"disabled:opacity-action-disabled disabled:cursor-not-allowed",
|
|
577
612
|
"transition-colors"
|
|
578
613
|
),
|
|
579
|
-
children: /* @__PURE__ */ n(
|
|
614
|
+
children: /* @__PURE__ */ n(pt, { size: 16, "aria-hidden": "true" })
|
|
580
615
|
}
|
|
581
616
|
),
|
|
582
|
-
/* @__PURE__ */ d("span", { className: "text-ds-sm text-
|
|
617
|
+
/* @__PURE__ */ d("span", { className: "text-ds-sm text-surface-fg-muted", children: [
|
|
583
618
|
"Page ",
|
|
584
|
-
|
|
619
|
+
c.getState().pagination.pageIndex + 1,
|
|
585
620
|
" of",
|
|
586
621
|
" ",
|
|
587
|
-
|
|
622
|
+
c.getPageCount()
|
|
588
623
|
] }),
|
|
589
624
|
/* @__PURE__ */ n(
|
|
590
625
|
"button",
|
|
591
626
|
{
|
|
592
627
|
type: "button",
|
|
593
|
-
disabled: !
|
|
594
|
-
onClick: () =>
|
|
628
|
+
disabled: !c.getCanNextPage(),
|
|
629
|
+
onClick: () => c.nextPage(),
|
|
595
630
|
"aria-label": "Next page",
|
|
596
|
-
className:
|
|
631
|
+
className: a(
|
|
597
632
|
"h-ds-sm w-ds-sm flex items-center justify-center",
|
|
598
|
-
"rounded-ds-md border border-border",
|
|
599
|
-
"enabled:hover:bg-
|
|
600
|
-
"disabled:opacity-
|
|
633
|
+
"rounded-ds-md border border-surface-border-strong",
|
|
634
|
+
"enabled:hover:bg-surface-2",
|
|
635
|
+
"disabled:opacity-action-disabled disabled:cursor-not-allowed",
|
|
601
636
|
"transition-colors"
|
|
602
637
|
),
|
|
603
|
-
children: /* @__PURE__ */ n(
|
|
638
|
+
children: /* @__PURE__ */ n(Ne, { size: 16, "aria-hidden": "true" })
|
|
604
639
|
}
|
|
605
640
|
)
|
|
606
641
|
] })
|
|
607
642
|
] }),
|
|
608
|
-
_ && C &&
|
|
643
|
+
_ && C && et && /* @__PURE__ */ d(
|
|
609
644
|
"div",
|
|
610
645
|
{
|
|
611
|
-
className:
|
|
646
|
+
className: a(
|
|
612
647
|
"fixed bottom-6 left-1/2 -translate-x-1/2 z-50",
|
|
613
648
|
"flex items-center gap-ds-04 px-ds-05 py-ds-03",
|
|
614
|
-
"rounded-ds-lg border border-border bg-surface shadow-lg",
|
|
649
|
+
"rounded-ds-lg border border-surface-border-strong bg-surface-1 shadow-lg",
|
|
615
650
|
"animate-in slide-in-from-bottom-2"
|
|
616
651
|
),
|
|
617
652
|
role: "toolbar",
|
|
618
653
|
"aria-label": "Bulk actions",
|
|
619
654
|
children: [
|
|
620
|
-
/* @__PURE__ */ d("span", { className: "text-ds-sm font-medium text-
|
|
655
|
+
/* @__PURE__ */ d("span", { className: "text-ds-sm font-medium text-surface-fg whitespace-nowrap", children: [
|
|
621
656
|
ee.length,
|
|
622
657
|
" selected"
|
|
623
658
|
] }),
|
|
624
|
-
/* @__PURE__ */ n("div", { className: "h-5 w-px bg-border", "aria-hidden": "true" }),
|
|
659
|
+
/* @__PURE__ */ n("div", { className: "h-5 w-px bg-surface-border", "aria-hidden": "true" }),
|
|
625
660
|
_.map((e) => /* @__PURE__ */ n(
|
|
626
|
-
|
|
661
|
+
yt,
|
|
627
662
|
{
|
|
628
663
|
size: "sm",
|
|
629
664
|
variant: e.color === "error" ? "destructive" : "outline",
|
|
@@ -637,14 +672,14 @@ function Nt({
|
|
|
637
672
|
"button",
|
|
638
673
|
{
|
|
639
674
|
type: "button",
|
|
640
|
-
onClick: () =>
|
|
675
|
+
onClick: () => c.resetRowSelection(),
|
|
641
676
|
"aria-label": "Clear selection",
|
|
642
|
-
className:
|
|
677
|
+
className: a(
|
|
643
678
|
"flex items-center justify-center p-ds-01",
|
|
644
|
-
"rounded-ds-sm hover:bg-
|
|
645
|
-
"text-
|
|
679
|
+
"rounded-ds-sm hover:bg-surface-2 transition-colors",
|
|
680
|
+
"text-surface-fg-muted hover:text-surface-fg"
|
|
646
681
|
),
|
|
647
|
-
children: /* @__PURE__ */ n(
|
|
682
|
+
children: /* @__PURE__ */ n(ht, { size: 16, "aria-hidden": "true" })
|
|
648
683
|
}
|
|
649
684
|
)
|
|
650
685
|
]
|
|
@@ -652,7 +687,7 @@ function Nt({
|
|
|
652
687
|
)
|
|
653
688
|
] });
|
|
654
689
|
}
|
|
655
|
-
|
|
690
|
+
Rt.displayName = "DataTable";
|
|
656
691
|
export {
|
|
657
|
-
|
|
692
|
+
Rt as DataTable
|
|
658
693
|
};
|