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