@brightlocal/ui-components 3.2.0 → 3.3.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/AI_USAGE.md +10 -0
- package/README.md +3 -1
- package/component-meta.json +1271 -428
- package/deprecations.json +44 -0
- package/dist/_virtual/_rolldown/runtime.cjs +1 -0
- package/dist/accordion.cjs +1 -1
- package/dist/accordion.js +73 -102
- package/dist/alert-dialog.cjs +1 -1
- package/dist/alert-dialog.d.ts +6 -4
- package/dist/alert-dialog.d.ts.map +1 -1
- package/dist/alert-dialog.js +85 -133
- package/dist/alert.cjs +1 -1
- package/dist/alert.d.ts +4 -4
- package/dist/alert.d.ts.map +1 -1
- package/dist/alert.js +106 -168
- package/dist/aspect-ratio.cjs +1 -1
- package/dist/aspect-ratio.js +13 -16
- package/dist/avatar.cjs +1 -1
- package/dist/avatar.js +30 -45
- package/dist/badge.cjs +1 -1
- package/dist/badge.d.ts +23 -1
- package/dist/badge.d.ts.map +1 -1
- package/dist/badge.js +90 -91
- package/dist/banner.cjs +1 -1
- package/dist/banner.js +102 -148
- package/dist/blocks/empty-state.cjs +1 -1
- package/dist/blocks/empty-state.d.ts +20 -3
- package/dist/blocks/empty-state.d.ts.map +1 -1
- package/dist/blocks/empty-state.js +73 -140
- package/dist/blocks/input-list.cjs +2 -2
- package/dist/blocks/input-list.d.ts +2 -2
- package/dist/blocks/input-list.d.ts.map +1 -1
- package/dist/blocks/input-list.js +136 -176
- package/dist/blocks/progress-state.cjs +1 -1
- package/dist/blocks/progress-state.js +223 -347
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +11 -6
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +763 -1092
- package/dist/brand-illustration-motif.cjs +1 -1
- package/dist/brand-illustration-motif.js +40 -61
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.js +62 -102
- package/dist/button-group.cjs +1 -1
- package/dist/button-group.js +23 -31
- package/dist/button.cjs +1 -1
- package/dist/button.d.ts +4 -2
- package/dist/button.d.ts.map +1 -1
- package/dist/button.js +149 -189
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.d.ts +87 -3
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +116 -173
- package/dist/callout.cjs +1 -1
- package/dist/callout.js +73 -96
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +10 -4
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +233 -316
- package/dist/carousel.cjs +1 -1
- package/dist/carousel.d.ts +3 -3
- package/dist/carousel.d.ts.map +1 -1
- package/dist/carousel.js +174 -268
- package/dist/centred-layout.cjs +1 -1
- package/dist/centred-layout.js +27 -48
- package/dist/chart-empty.cjs +1 -1
- package/dist/chart-empty.js +18 -27
- package/dist/chart.cjs +7 -7
- package/dist/chart.d.ts +23 -13
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +445 -651
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +36 -69
- package/dist/chip.cjs +1 -1
- package/dist/chip.js +116 -173
- package/dist/collapsible.cjs +1 -1
- package/dist/collapsible.d.ts.map +1 -1
- package/dist/collapsible.js +35 -41
- package/dist/combobox.cjs +3 -3
- package/dist/combobox.d.ts +14 -4
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +439 -638
- package/dist/command.cjs +1 -1
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +273 -420
- package/dist/context-menu.cjs +1 -1
- package/dist/context-menu.d.ts +5 -5
- package/dist/context-menu.d.ts.map +1 -1
- package/dist/context-menu.js +121 -191
- package/dist/data-table.cjs +1 -1
- package/dist/data-table.d.ts +280 -129
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +687 -948
- package/dist/date-picker.cjs +1 -1
- package/dist/date-picker.d.ts +15 -4
- package/dist/date-picker.d.ts.map +1 -1
- package/dist/date-picker.js +156 -231
- package/dist/delta.cjs +1 -0
- package/dist/delta.d.ts +79 -0
- package/dist/delta.d.ts.map +1 -0
- package/dist/delta.js +62 -0
- package/dist/description.cjs +1 -1
- package/dist/description.js +11 -20
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.d.ts +1 -1
- package/dist/dialog.d.ts.map +1 -1
- package/dist/dialog.js +76 -116
- package/dist/drawer.cjs +1 -1
- package/dist/drawer.d.ts +11 -11
- package/dist/drawer.d.ts.map +1 -1
- package/dist/drawer.js +76 -134
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.d.ts +6 -6
- package/dist/dropdown-menu.d.ts.map +1 -1
- package/dist/dropdown-menu.js +179 -300
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts +9 -9
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +166 -286
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.js +203 -342
- package/dist/grid.cjs +1 -1
- package/dist/grid.js +16 -29
- package/dist/header.cjs +1 -1
- package/dist/header.js +21 -38
- package/dist/height-transition.cjs +1 -1
- package/dist/height-transition.js +38 -55
- package/dist/hooks/use-breakpoint.cjs +1 -1
- package/dist/hooks/use-breakpoint.js +9 -9
- package/dist/hooks/use-debounce.cjs +1 -1
- package/dist/hooks/use-debounce.js +12 -11
- package/dist/hooks/use-delayed-pending.cjs +1 -1
- package/dist/hooks/use-delayed-pending.js +8 -9
- package/dist/hooks/use-filter-search-params.cjs +1 -0
- package/dist/hooks/use-filter-search-params.d.ts +93 -0
- package/dist/hooks/use-filter-search-params.d.ts.map +1 -0
- package/dist/hooks/use-filter-search-params.js +122 -0
- package/dist/hooks/use-mobile.cjs +1 -1
- package/dist/hooks/use-mobile.js +6 -6
- package/dist/hooks/use-overlay-pointer-lock.cjs +1 -1
- package/dist/hooks/use-overlay-pointer-lock.js +8 -9
- package/dist/hooks/use-prefers-reduced-motion.cjs +1 -1
- package/dist/hooks/use-prefers-reduced-motion.js +5 -8
- package/dist/hover-card.cjs +1 -1
- package/dist/hover-card.d.ts +1 -1
- package/dist/hover-card.d.ts.map +1 -1
- package/dist/hover-card.js +30 -62
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +630 -608
- package/dist/info-tooltip.cjs +1 -1
- package/dist/info-tooltip.js +22 -36
- package/dist/input-chip.cjs +1 -1
- package/dist/input-chip.d.ts +32 -3
- package/dist/input-chip.d.ts.map +1 -1
- package/dist/input-chip.js +181 -230
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.js +174 -221
- package/dist/input-otp.cjs +1 -1
- package/dist/input-otp.d.ts +3 -3
- package/dist/input-otp.d.ts.map +1 -1
- package/dist/input-otp.js +102 -146
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.d.ts +12 -16
- package/dist/input-password.d.ts.map +1 -1
- package/dist/input-password.js +139 -171
- package/dist/input.cjs +1 -1
- package/dist/input.d.ts.map +1 -1
- package/dist/input.js +51 -73
- package/dist/label.cjs +1 -1
- package/dist/label.js +20 -38
- package/dist/lib/block-illustration.cjs +1 -1
- package/dist/lib/block-illustration.d.ts +1 -1
- package/dist/lib/block-illustration.d.ts.map +1 -1
- package/dist/lib/block-illustration.js +16 -18
- package/dist/lib/compose-event-handlers.cjs +1 -0
- package/dist/lib/compose-event-handlers.d.ts +9 -0
- package/dist/lib/compose-event-handlers.d.ts.map +1 -0
- package/dist/lib/compose-event-handlers.js +8 -0
- package/dist/lib/download-file.cjs +1 -0
- package/dist/lib/download-file.d.ts +14 -0
- package/dist/lib/download-file.d.ts.map +1 -0
- package/dist/lib/download-file.js +40 -0
- package/dist/lib/empty-canvas.cjs +1 -1
- package/dist/lib/empty-canvas.js +28 -56
- package/dist/lib/empty-chip.cjs +1 -1
- package/dist/lib/empty-chip.d.ts +14 -3
- package/dist/lib/empty-chip.d.ts.map +1 -1
- package/dist/lib/empty-chip.js +15 -11
- package/dist/lib/field-aria.cjs +1 -0
- package/dist/lib/field-aria.d.ts +34 -0
- package/dist/lib/field-aria.d.ts.map +1 -0
- package/dist/lib/field-aria.js +52 -0
- package/dist/lib/image-file-info.cjs +1 -0
- package/dist/lib/image-file-info.d.ts +25 -0
- package/dist/lib/image-file-info.d.ts.map +1 -0
- package/dist/lib/image-file-info.js +67 -0
- package/dist/lib/media-viewer-content.cjs +1 -0
- package/dist/lib/media-viewer-content.d.ts +102 -0
- package/dist/lib/media-viewer-content.d.ts.map +1 -0
- package/dist/lib/media-viewer-content.js +650 -0
- package/dist/lib/media-viewer-internal.cjs +1 -0
- package/dist/lib/media-viewer-internal.d.ts +98 -0
- package/dist/lib/media-viewer-internal.d.ts.map +1 -0
- package/dist/lib/media-viewer-internal.js +61 -0
- package/dist/lib/media-viewer-motion.cjs +1 -0
- package/dist/lib/media-viewer-motion.d.ts +40 -0
- package/dist/lib/media-viewer-motion.d.ts.map +1 -0
- package/dist/lib/media-viewer-motion.js +37 -0
- package/dist/lib/motion.cjs +1 -1
- package/dist/lib/motion.d.ts +8 -0
- package/dist/lib/motion.d.ts.map +1 -1
- package/dist/lib/motion.js +11 -10
- package/dist/lib/optical-center.cjs +1 -1
- package/dist/lib/optical-center.d.ts +1 -1
- package/dist/lib/optical-center.d.ts.map +1 -1
- package/dist/lib/optical-center.js +12 -5
- package/dist/lib/spring-settle.cjs +1 -1
- package/dist/lib/spring-settle.js +1 -1
- package/dist/lib/table-internal.cjs +1 -0
- package/dist/lib/table-internal.d.ts +62 -0
- package/dist/lib/table-internal.d.ts.map +1 -0
- package/dist/lib/table-internal.js +18 -0
- package/dist/lib/use-controllable.cjs +1 -0
- package/dist/lib/use-controllable.d.ts +12 -0
- package/dist/lib/use-controllable.d.ts.map +1 -0
- package/dist/lib/use-controllable.js +15 -0
- package/dist/lib/use-dev-warning.cjs +1 -1
- package/dist/lib/utils.cjs +1 -1
- package/dist/lib/utils.js +26 -33
- package/dist/link.cjs +1 -1
- package/dist/link.d.ts +1 -1
- package/dist/link.js +78 -124
- package/dist/list.cjs +1 -1
- package/dist/list.d.ts +8 -0
- package/dist/list.d.ts.map +1 -1
- package/dist/list.js +94 -156
- package/dist/loading.cjs +1 -1
- package/dist/loading.js +124 -151
- package/dist/logo-mark.cjs +1 -0
- package/dist/logo-mark.d.ts +79 -0
- package/dist/logo-mark.d.ts.map +1 -0
- package/dist/logo-mark.js +219 -0
- package/dist/logo.cjs +1 -1
- package/dist/logo.d.ts +1 -1
- package/dist/logo.d.ts.map +1 -1
- package/dist/logo.js +51 -87
- package/dist/map.cjs +1 -1
- package/dist/map.d.ts.map +1 -1
- package/dist/map.js +390 -586
- package/dist/media-empty.cjs +1 -1
- package/dist/media-empty.js +27 -42
- package/dist/media-viewer.cjs +1 -0
- package/dist/media-viewer.d.ts +224 -0
- package/dist/media-viewer.d.ts.map +1 -0
- package/dist/media-viewer.js +295 -0
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.d.ts +14 -14
- package/dist/menubar.d.ts.map +1 -1
- package/dist/menubar.js +130 -267
- package/dist/multi-select-filter.cjs +1 -1
- package/dist/multi-select-filter.d.ts +9 -1
- package/dist/multi-select-filter.d.ts.map +1 -1
- package/dist/multi-select-filter.js +357 -446
- package/dist/navigation-menu.cjs +1 -1
- package/dist/navigation-menu.js +108 -172
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.d.ts +36 -12
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +208 -281
- package/dist/popover.cjs +1 -1
- package/dist/popover.d.ts +1 -1
- package/dist/popover.d.ts.map +1 -1
- package/dist/popover.js +34 -45
- package/dist/progress.cjs +1 -1
- package/dist/progress.d.ts +17 -2
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +116 -162
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +90 -146
- package/dist/rating.cjs +1 -1
- package/dist/rating.d.ts +80 -13
- package/dist/rating.d.ts.map +1 -1
- package/dist/rating.js +70 -65
- package/dist/relative-date.cjs +1 -1
- package/dist/relative-date.d.ts.map +1 -1
- package/dist/relative-date.js +73 -89
- package/dist/resizable.cjs +1 -1
- package/dist/resizable.d.ts +39 -23
- package/dist/resizable.d.ts.map +1 -1
- package/dist/resizable.js +42 -44
- package/dist/result-count.cjs +1 -0
- package/dist/result-count.d.ts +110 -0
- package/dist/result-count.d.ts.map +1 -0
- package/dist/result-count.js +49 -0
- package/dist/route-progress.cjs +1 -1
- package/dist/route-progress.js +58 -102
- package/dist/scroll-area.cjs +1 -1
- package/dist/scroll-area.d.ts +9 -1
- package/dist/scroll-area.d.ts.map +1 -1
- package/dist/scroll-area.js +44 -79
- package/dist/select.cjs +2 -2
- package/dist/select.d.ts +10 -10
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +118 -238
- package/dist/separator.cjs +1 -1
- package/dist/separator.js +90 -78
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +8 -5
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +250 -317
- package/dist/single-select-filter.cjs +1 -1
- package/dist/single-select-filter.d.ts +32 -0
- package/dist/single-select-filter.d.ts.map +1 -1
- package/dist/single-select-filter.js +201 -203
- package/dist/skeleton.cjs +1 -1
- package/dist/skeleton.js +24 -38
- package/dist/slider.cjs +1 -1
- package/dist/slider.js +51 -81
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts +1 -1
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +101 -125
- package/dist/spinner.cjs +1 -1
- package/dist/spinner.js +22 -31
- package/dist/split-layout.cjs +1 -1
- package/dist/split-layout.js +52 -101
- package/dist/status.cjs +1 -0
- package/dist/status.d.ts +51 -0
- package/dist/status.d.ts.map +1 -0
- package/dist/status.js +60 -0
- package/dist/stepper.cjs +1 -1
- package/dist/stepper.js +184 -316
- package/dist/switch.cjs +1 -1
- package/dist/switch.js +17 -32
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts +103 -30
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +170 -209
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.d.ts.map +1 -1
- package/dist/tabs.js +102 -147
- package/dist/text-reveal-motion.cjs +1 -1
- package/dist/text-reveal-motion.js +307 -363
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.d.ts.map +1 -1
- package/dist/textarea.js +22 -35
- package/dist/toggle-group.cjs +1 -1
- package/dist/toggle-group.js +43 -62
- package/dist/toggle.cjs +1 -1
- package/dist/toggle.js +34 -46
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.d.ts +2 -2
- package/dist/tooltip.d.ts.map +1 -1
- package/dist/tooltip.js +157 -249
- package/dist/typography-heading.cjs +1 -1
- package/dist/typography-heading.js +25 -61
- package/dist/typography-text.cjs +1 -1
- package/dist/typography-text.js +27 -57
- package/dist/typography.cjs +1 -1
- package/dist/typography.js +132 -340
- package/package.json +46 -46
- package/src/blocks/empty-state.tsx +34 -18
- package/src/blocks/sidebar.tsx +86 -31
- package/src/components/accordion.tsx +1 -1
- package/src/components/alert-dialog.tsx +4 -2
- package/src/components/badge.tsx +127 -15
- package/src/components/breadcrumb.tsx +1 -1
- package/src/components/button.tsx +8 -6
- package/src/components/calendar.tsx +155 -9
- package/src/components/card.tsx +63 -10
- package/src/components/carousel.tsx +4 -1
- package/src/components/chart.tsx +151 -17
- package/src/components/checkbox.tsx +1 -1
- package/src/components/collapsible.tsx +4 -1
- package/src/components/combobox.tsx +40 -7
- package/src/components/command.tsx +9 -10
- package/src/components/context-menu.tsx +4 -4
- package/src/components/data-table.tsx +619 -237
- package/src/components/date-picker.tsx +31 -4
- package/src/components/delta.tsx +217 -0
- package/src/components/drawer.tsx +5 -5
- package/src/components/dropdown-menu.tsx +4 -4
- package/src/components/field.tsx +36 -15
- package/src/components/global-layout.tsx +1 -1
- package/src/components/input-chip.tsx +51 -7
- package/src/components/input-group.tsx +1 -1
- package/src/components/input-password.tsx +15 -19
- package/src/components/input.tsx +10 -1
- package/src/components/list.tsx +14 -2
- package/src/components/logo-mark.tsx +345 -0
- package/src/components/map.tsx +18 -20
- package/src/components/media-viewer.tsx +908 -0
- package/src/components/multi-select-filter.tsx +255 -121
- package/src/components/navigation-menu.tsx +2 -2
- package/src/components/pagination.tsx +86 -26
- package/src/components/progress.tsx +91 -23
- package/src/components/rating.tsx +200 -74
- package/src/components/relative-date.tsx +19 -11
- package/src/components/resizable.tsx +86 -33
- package/src/components/result-count.tsx +253 -0
- package/src/components/scroll-area.tsx +31 -5
- package/src/components/select.tsx +2 -2
- package/src/components/sheet.tsx +14 -4
- package/src/components/single-select-filter.tsx +136 -41
- package/src/components/slider.tsx +2 -2
- package/src/components/status.tsx +162 -0
- package/src/components/switch.tsx +1 -1
- package/src/components/table.tsx +278 -106
- package/src/components/tabs.tsx +1 -0
- package/src/components/textarea.tsx +20 -2
- package/src/components/toggle.tsx +2 -2
- package/src/components/tooltip.tsx +11 -20
- package/src/hooks/use-filter-search-params.ts +302 -0
- package/src/index.ts +6 -0
- package/src/lib/compose-event-handlers.ts +14 -0
- package/src/lib/download-file.ts +61 -0
- package/src/lib/empty-chip.tsx +52 -0
- package/src/lib/field-aria.tsx +97 -0
- package/src/lib/image-file-info.ts +102 -0
- package/src/lib/media-viewer-content.tsx +1587 -0
- package/src/lib/media-viewer-internal.tsx +191 -0
- package/src/lib/media-viewer-motion.ts +120 -0
- package/src/lib/motion.ts +9 -0
- package/src/lib/table-internal.ts +74 -0
- package/src/lib/use-controllable.ts +43 -0
- package/src/lib/empty-chip.ts +0 -24
package/dist/data-table.js
CHANGED
|
@@ -1,1020 +1,759 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
"use client";
|
|
2
|
+
import { Button as te } from "./button.js";
|
|
3
|
+
import { Checkbox as ae } from "./checkbox.js";
|
|
4
|
+
import { useControllable as _ } from "./lib/use-controllable.js";
|
|
5
|
+
import { InputGroup as me, InputGroupAddon as he, InputGroupClear as ve, InputGroupInput as Se } from "./input-group.js";
|
|
6
|
+
import { ResultCount as xe } from "./result-count.js";
|
|
7
|
+
import { Pagination as we, PaginationContent as Ce, PaginationEllipsis as ye, PaginationItem as G, PaginationLink as ke, PaginationNext as Te, PaginationPrevious as De, usePagination as Pe } from "./pagination.js";
|
|
8
|
+
import { Skeleton as X } from "./skeleton.js";
|
|
9
|
+
import { Spinner as ne } from "./spinner.js";
|
|
10
|
+
import { EmptyState as Re } from "./blocks/empty-state.js";
|
|
11
|
+
import { TABLE_ROW_MIN_HEIGHT as Ne, scrollRegionProps as oe } from "./lib/table-internal.js";
|
|
12
|
+
import { Table as le, TableBody as re, TableCell as L, TableEmpty as se, TableHead as Ee, TableHeader as Ie, TableRow as B } from "./table.js";
|
|
13
|
+
import { TypographyMuted as Ae } from "./typography.js";
|
|
14
|
+
import * as d from "react";
|
|
15
|
+
import { ArrowDown as ze, ArrowUp as Me, ArrowUpDown as Fe, ChevronRight as Be, Search as $e, SearchX as He } from "@brightlocal/icons";
|
|
6
16
|
import { cn as h } from "@brightlocal/ui-components/lib/utils";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
l.current = s;
|
|
20
|
-
});
|
|
21
|
-
const c = e !== void 0, u = g.useCallback(
|
|
22
|
-
(r) => {
|
|
23
|
-
const d = typeof r == "function" ? r(l.current) : r;
|
|
24
|
-
c || o(d), i?.(d);
|
|
25
|
-
},
|
|
26
|
-
[c, i]
|
|
27
|
-
);
|
|
28
|
-
return [s, u];
|
|
29
|
-
}
|
|
30
|
-
function St(e) {
|
|
31
|
-
const {
|
|
17
|
+
import { Fragment as $, jsx as t, jsxs as T } from "react/jsx-runtime";
|
|
18
|
+
import { useVirtualizer as _e } from "@tanstack/react-virtual";
|
|
19
|
+
import { flexRender as ie, getCoreRowModel as Le, getExpandedRowModel as Oe, getFilteredRowModel as Ve, getPaginationRowModel as je, getSortedRowModel as Ge, useReactTable as qe } from "@tanstack/react-table";
|
|
20
|
+
import { useIsBelowBreakpoint as Q } from "@brightlocal/ui-components/hooks/use-breakpoint";
|
|
21
|
+
var ce = "sticky left-0 shadow-[inset_-1px_0_0_var(--border)]", We = h(ce, "z-2"), Ue = h(ce, "z-1 bg-(--dt-row-bg,var(--background))");
|
|
22
|
+
function Mt(e) {
|
|
23
|
+
const { columns: a, data: s, enableSorting: o = !0, enableGlobalFiltering: l = !1, enableRowSelection: r = !1, enablePagination: n = !1, pageSize: c = 20, manualSorting: u = !1, manualFiltering: g = !1, manualPagination: i = !1, rowCount: b, pageCount: p, enableExpanding: v = !1, getSubRows: f, getRowCanExpand: m, paginateExpandedRows: k = !1, getRowId: x, pagination: C, onPaginationChange: w, sorting: A, onSortingChange: z, globalFilter: S, onGlobalFilterChange: y, rowSelection: R, onRowSelectionChange: H, expanded: P, onExpandedChange: D } = e, [N, M] = _(C, {
|
|
24
|
+
pageIndex: 0,
|
|
25
|
+
pageSize: c
|
|
26
|
+
}, w), [E, F] = _(A, [], z), [I, W] = _(S, "", y), [O, V] = _(R, {}, H), [U, j] = _(P, {}, D);
|
|
27
|
+
return qe({
|
|
28
|
+
data: s,
|
|
32
29
|
columns: a,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
pageSize: c = 10,
|
|
39
|
-
manualSorting: u = !1,
|
|
40
|
-
manualFiltering: r = !1,
|
|
41
|
-
manualPagination: d = !1,
|
|
42
|
-
rowCount: b,
|
|
43
|
-
pageCount: f,
|
|
44
|
-
enableExpanding: m = !1,
|
|
45
|
-
getSubRows: v,
|
|
46
|
-
getRowCanExpand: S,
|
|
47
|
-
paginateExpandedRows: w = !1,
|
|
48
|
-
getRowId: C,
|
|
49
|
-
pagination: k,
|
|
50
|
-
onPaginationChange: p,
|
|
51
|
-
sorting: x,
|
|
52
|
-
onSortingChange: D,
|
|
53
|
-
globalFilter: E,
|
|
54
|
-
onGlobalFilterChange: A,
|
|
55
|
-
rowSelection: T,
|
|
56
|
-
onRowSelectionChange: B,
|
|
57
|
-
expanded: I,
|
|
58
|
-
onExpandedChange: $
|
|
59
|
-
} = e, [V, M] = z(
|
|
60
|
-
k,
|
|
61
|
-
{ pageIndex: 0, pageSize: c },
|
|
62
|
-
p
|
|
63
|
-
), [le, oe] = z(
|
|
64
|
-
x,
|
|
65
|
-
[],
|
|
66
|
-
D
|
|
67
|
-
), [se, ie] = z(
|
|
68
|
-
E,
|
|
69
|
-
"",
|
|
70
|
-
A
|
|
71
|
-
), [re, ce] = z(T, {}, B), [de, ue] = z(
|
|
72
|
-
I,
|
|
73
|
-
{},
|
|
74
|
-
$
|
|
75
|
-
);
|
|
76
|
-
return ge({
|
|
77
|
-
data: i,
|
|
78
|
-
columns: a,
|
|
79
|
-
getCoreRowModel: he(),
|
|
80
|
-
...C && { getRowId: C },
|
|
81
|
-
...(l || d) && {
|
|
82
|
-
onPaginationChange: M
|
|
83
|
-
},
|
|
84
|
-
...l && {
|
|
85
|
-
...!d && {
|
|
86
|
-
getPaginationRowModel: me()
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
...d && {
|
|
30
|
+
getCoreRowModel: Le(),
|
|
31
|
+
...x && { getRowId: x },
|
|
32
|
+
...(n || i) && { onPaginationChange: M },
|
|
33
|
+
...n && { ...!i && { getPaginationRowModel: je() } },
|
|
34
|
+
...i && {
|
|
90
35
|
manualPagination: !0,
|
|
91
36
|
...b != null && { rowCount: b },
|
|
92
|
-
...
|
|
37
|
+
...p != null && { pageCount: p }
|
|
93
38
|
},
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
...n && {
|
|
99
|
-
...!u && {
|
|
100
|
-
getSortedRowModel: be()
|
|
101
|
-
},
|
|
102
|
-
onSortingChange: oe,
|
|
39
|
+
enableSorting: o,
|
|
40
|
+
...o && {
|
|
41
|
+
...!u && { getSortedRowModel: Ge() },
|
|
42
|
+
onSortingChange: F,
|
|
103
43
|
...u && { manualSorting: !0 }
|
|
104
44
|
},
|
|
105
|
-
...
|
|
106
|
-
...!
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
...r && { manualFiltering: !0 },
|
|
110
|
-
onGlobalFilterChange: ie,
|
|
45
|
+
...l && {
|
|
46
|
+
...!g && { getFilteredRowModel: Ve() },
|
|
47
|
+
...g && { manualFiltering: !0 },
|
|
48
|
+
onGlobalFilterChange: W,
|
|
111
49
|
globalFilterFn: "includesString"
|
|
112
50
|
},
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
// Always forward the flag — TanStack defaults `enableExpanding` to true,
|
|
123
|
-
// so omitting it would leave `row.getCanExpand()` returning true and
|
|
124
|
-
// `DataTableExpandRowButton` interactive on tables without expanding.
|
|
125
|
-
enableExpanding: m,
|
|
126
|
-
...m && {
|
|
127
|
-
getExpandedRowModel: pe(),
|
|
128
|
-
onExpandedChange: ue,
|
|
129
|
-
getSubRows: v,
|
|
130
|
-
...S && { getRowCanExpand: S },
|
|
131
|
-
// Forward only with client-side pagination: `paginateExpandedRows:
|
|
132
|
-
// false` defers expansion to the pagination row model, so without one
|
|
133
|
-
// it would suppress row expansion entirely.
|
|
134
|
-
...l && !d && { paginateExpandedRows: w }
|
|
51
|
+
enableRowSelection: r,
|
|
52
|
+
...r !== !1 && { onRowSelectionChange: V },
|
|
53
|
+
enableExpanding: v,
|
|
54
|
+
...v && {
|
|
55
|
+
getExpandedRowModel: Oe(),
|
|
56
|
+
onExpandedChange: j,
|
|
57
|
+
getSubRows: f,
|
|
58
|
+
...m && { getRowCanExpand: m },
|
|
59
|
+
...n && !i && { paginateExpandedRows: k }
|
|
135
60
|
},
|
|
136
61
|
state: {
|
|
137
|
-
pagination:
|
|
138
|
-
sorting:
|
|
139
|
-
globalFilter:
|
|
140
|
-
rowSelection:
|
|
141
|
-
expanded:
|
|
62
|
+
pagination: N,
|
|
63
|
+
sorting: E,
|
|
64
|
+
globalFilter: I,
|
|
65
|
+
rowSelection: O,
|
|
66
|
+
expanded: U
|
|
142
67
|
}
|
|
143
68
|
});
|
|
144
69
|
}
|
|
145
|
-
|
|
146
|
-
function
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
getRowClassName: S,
|
|
163
|
-
renderExpandedContent: w
|
|
164
|
-
}) {
|
|
165
|
-
const C = e.getVisibleLeafColumns().length, k = c ?? e.getState().pagination.pageSize ?? 10, p = !!f || r || m !== void 0;
|
|
166
|
-
return /* @__PURE__ */ y(
|
|
167
|
-
"div",
|
|
168
|
-
{
|
|
169
|
-
className: h(
|
|
170
|
-
// `scrollbar` themes the native scrollbar with DS colors — the same
|
|
171
|
-
// treatment Command/Combobox lists use for bounded scroll containers.
|
|
172
|
-
"border-border scrollbar relative overflow-auto rounded-md border",
|
|
173
|
-
p && "focus-visible:shadow-default outline-none",
|
|
174
|
-
d
|
|
175
|
-
),
|
|
176
|
-
"data-hook": a,
|
|
177
|
-
"data-slot": "data-table-view",
|
|
178
|
-
"data-tracking-el": i,
|
|
179
|
-
"data-tracking-label": n,
|
|
180
|
-
...p ? Y(m) : void 0,
|
|
181
|
-
children: [
|
|
182
|
-
/* @__PURE__ */ t("div", { "aria-live": "polite", className: "sr-only", role: "status", children: s ? l ?? "Loading results…" : null }),
|
|
183
|
-
/* @__PURE__ */ t(H.Provider, { value: s, children: /* @__PURE__ */ y(
|
|
184
|
-
Q,
|
|
185
|
-
{
|
|
186
|
-
"aria-busy": o || s || void 0,
|
|
187
|
-
dataHook: `${a}-table`,
|
|
188
|
-
layout: b,
|
|
189
|
-
minWidth: f,
|
|
190
|
-
scrollOwner: "parent",
|
|
191
|
-
children: [
|
|
192
|
-
/* @__PURE__ */ t(Z, { stickyHeader: r, table: e }),
|
|
193
|
-
/* @__PURE__ */ t(X, { children: o ? /* @__PURE__ */ y(N, { children: [
|
|
194
|
-
/* @__PURE__ */ t(
|
|
195
|
-
te,
|
|
196
|
-
{
|
|
197
|
-
colCount: C,
|
|
198
|
-
rowCount: k
|
|
199
|
-
}
|
|
200
|
-
),
|
|
201
|
-
/* @__PURE__ */ t(P, { className: "sr-only", children: /* @__PURE__ */ t(R, { colSpan: C, children: /* @__PURE__ */ t("div", { "aria-live": "polite", role: "status", children: "Loading data…" }) }) })
|
|
202
|
-
] }) : /* @__PURE__ */ t(N, { children: e.getRowModel().rows.length > 0 ? e.getRowModel().rows.map((x) => /* @__PURE__ */ t(
|
|
203
|
-
ee,
|
|
204
|
-
{
|
|
205
|
-
columnCount: C,
|
|
206
|
-
getRowClassName: S,
|
|
207
|
-
renderExpandedContent: w,
|
|
208
|
-
row: x
|
|
209
|
-
},
|
|
210
|
-
x.id
|
|
211
|
-
)) : /* @__PURE__ */ t(P, { children: /* @__PURE__ */ t(R, { align: "center", colSpan: C, size: "lg", children: /* @__PURE__ */ t("div", { "aria-live": "polite", className: "py-6", role: "status", children: u }) }) }) }) }),
|
|
212
|
-
v
|
|
213
|
-
]
|
|
214
|
-
}
|
|
215
|
-
) })
|
|
216
|
-
]
|
|
70
|
+
var q = d.createContext(!1);
|
|
71
|
+
function de({ table: e, dataHook: a, title: s, description: o }) {
|
|
72
|
+
const l = e.getState().globalFilter, r = typeof l == "string" ? l.trim() : "", n = (s ?? (r ? 'No results for "{query}"' : "No results")).replace("{query}", r);
|
|
73
|
+
return /* @__PURE__ */ t(Re, {
|
|
74
|
+
dataHook: `${a}-no-results`,
|
|
75
|
+
description: o ?? "Try a different search, or clear the filters.",
|
|
76
|
+
icon: /* @__PURE__ */ t(He, {}),
|
|
77
|
+
title: n
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function Xe(e, a) {
|
|
81
|
+
const [s, o] = d.useState(!1);
|
|
82
|
+
return d.useLayoutEffect(() => {
|
|
83
|
+
const l = e.current, r = l?.querySelector('[data-slot="table"]');
|
|
84
|
+
if (!a || !l || !r) {
|
|
85
|
+
o(!1);
|
|
86
|
+
return;
|
|
217
87
|
}
|
|
218
|
-
|
|
88
|
+
const n = () => o(r.offsetWidth > l.clientWidth + 1);
|
|
89
|
+
n();
|
|
90
|
+
const c = new ResizeObserver(n);
|
|
91
|
+
return c.observe(l), c.observe(r), () => c.disconnect();
|
|
92
|
+
}, [e, a]), s;
|
|
93
|
+
}
|
|
94
|
+
function Ye({ table: e, dataHook: a, trackingEl: s, trackingLabel: o, size: l = "default", frame: r = "own", rowDividers: n = !1, isLoading: c = !1, refetching: u = !1, refetchingLabel: g, loadingLabel: i, skeletonRowCount: b, noResultsMessage: p, noResultsTitle: v, noResultsDescription: f, stickyHeader: m = !1, className: k, layout: x, minWidth: C, scrollRegionLabel: w, footer: A, getRowClassName: z, renderExpandedContent: S }, y) {
|
|
95
|
+
const R = e.getVisibleLeafColumns().length, H = b ?? e.getState().pagination.pageSize ?? 20, P = m === "page", D = d.useRef(null);
|
|
96
|
+
d.useImperativeHandle(y, () => D.current, []);
|
|
97
|
+
const N = Xe(D, P), M = !P || N, E = P ? N : !!C || m === !0 || w !== void 0;
|
|
98
|
+
return /* @__PURE__ */ T("div", {
|
|
99
|
+
ref: D,
|
|
100
|
+
className: h("relative", M ? "scrollbar overflow-auto" : "overflow-clip", r === "own" && "border-border rounded-md border", E && "focus-visible:shadow-default outline-none", k),
|
|
101
|
+
"data-frame": r,
|
|
102
|
+
"data-hook": a,
|
|
103
|
+
"data-overflowing": P && N ? "" : void 0,
|
|
104
|
+
"data-slot": "data-table-view",
|
|
105
|
+
"data-sticky-header": m === !1 ? void 0 : P ? "page" : "self",
|
|
106
|
+
"data-tracking-el": s,
|
|
107
|
+
"data-tracking-label": o,
|
|
108
|
+
...E ? oe(w) : void 0,
|
|
109
|
+
children: [/* @__PURE__ */ t("div", {
|
|
110
|
+
"aria-live": "polite",
|
|
111
|
+
className: "sr-only",
|
|
112
|
+
role: "status",
|
|
113
|
+
children: u ? g ?? "Loading results…" : null
|
|
114
|
+
}), /* @__PURE__ */ t(q.Provider, {
|
|
115
|
+
value: u,
|
|
116
|
+
children: /* @__PURE__ */ T(le, {
|
|
117
|
+
"aria-busy": c || u || void 0,
|
|
118
|
+
dataHook: `${a}-table`,
|
|
119
|
+
frame: r,
|
|
120
|
+
layout: x,
|
|
121
|
+
minWidth: C,
|
|
122
|
+
rowDividers: n,
|
|
123
|
+
scrollOwner: "parent",
|
|
124
|
+
size: l,
|
|
125
|
+
children: [
|
|
126
|
+
/* @__PURE__ */ t(ue, {
|
|
127
|
+
sticky: P ? !N && "page" : m === !0 && "self",
|
|
128
|
+
table: e
|
|
129
|
+
}),
|
|
130
|
+
/* @__PURE__ */ t(re, { children: c ? /* @__PURE__ */ T($, { children: [/* @__PURE__ */ t(fe, {
|
|
131
|
+
colCount: R,
|
|
132
|
+
rowCount: H
|
|
133
|
+
}), /* @__PURE__ */ t(B, {
|
|
134
|
+
className: "sr-only",
|
|
135
|
+
children: /* @__PURE__ */ t(L, {
|
|
136
|
+
colSpan: R,
|
|
137
|
+
children: /* @__PURE__ */ t("div", {
|
|
138
|
+
"aria-live": "polite",
|
|
139
|
+
role: "status",
|
|
140
|
+
children: i ?? "Loading data…"
|
|
141
|
+
})
|
|
142
|
+
})
|
|
143
|
+
})] }) : /* @__PURE__ */ t($, { children: e.getRowModel().rows.length > 0 ? e.getRowModel().rows.map((F) => /* @__PURE__ */ t(ge, {
|
|
144
|
+
columnCount: R,
|
|
145
|
+
getRowClassName: z,
|
|
146
|
+
renderExpandedContent: S,
|
|
147
|
+
row: F
|
|
148
|
+
}, F.id)) : /* @__PURE__ */ t(se, {
|
|
149
|
+
colSpan: R,
|
|
150
|
+
children: p ?? /* @__PURE__ */ t(de, {
|
|
151
|
+
dataHook: a,
|
|
152
|
+
description: f,
|
|
153
|
+
table: e,
|
|
154
|
+
title: v
|
|
155
|
+
})
|
|
156
|
+
}) }) }),
|
|
157
|
+
A
|
|
158
|
+
]
|
|
159
|
+
})
|
|
160
|
+
})]
|
|
161
|
+
});
|
|
219
162
|
}
|
|
220
|
-
|
|
221
|
-
|
|
163
|
+
var Je = d.forwardRef(Ye);
|
|
164
|
+
Je.displayName = "DataTable";
|
|
165
|
+
var Z = d.createContext(null), Y = () => () => {
|
|
222
166
|
};
|
|
223
|
-
function
|
|
224
|
-
const [e] =
|
|
225
|
-
const a = /* @__PURE__ */ new Map(),
|
|
167
|
+
function Ke() {
|
|
168
|
+
const [e] = d.useState(() => {
|
|
169
|
+
const a = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set(), o = (l) => a.get(l) ?? null;
|
|
226
170
|
return {
|
|
227
|
-
set: (
|
|
228
|
-
const
|
|
229
|
-
|
|
171
|
+
set: (l, r) => {
|
|
172
|
+
const n = o(l);
|
|
173
|
+
n === r || n !== null && r !== null && n.displayed === r.displayed && n.live === r.live || (r === null ? a.delete(l) : a.set(l, r), s.forEach((c) => c()));
|
|
230
174
|
},
|
|
231
|
-
get:
|
|
175
|
+
get: o,
|
|
232
176
|
anyHeld: () => {
|
|
233
|
-
for (const
|
|
234
|
-
if (o.displayed !== o.live)
|
|
235
|
-
return !0;
|
|
177
|
+
for (const l of a.values()) if (l.displayed !== l.live) return !0;
|
|
236
178
|
return !1;
|
|
237
179
|
},
|
|
238
|
-
subscribe: (
|
|
239
|
-
|
|
180
|
+
subscribe: (l) => (s.add(l), () => {
|
|
181
|
+
s.delete(l);
|
|
240
182
|
})
|
|
241
183
|
};
|
|
242
184
|
});
|
|
243
185
|
return e;
|
|
244
186
|
}
|
|
245
|
-
function
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
187
|
+
function ue({ table: e, sticky: a }) {
|
|
188
|
+
const s = Ke();
|
|
189
|
+
return /* @__PURE__ */ t(Z.Provider, {
|
|
190
|
+
value: s,
|
|
191
|
+
children: /* @__PURE__ */ t(Ie, {
|
|
192
|
+
className: h(a === "self" && "sticky top-0 z-10", a === "page" && "sticky top-[var(--content-sticky-top,0px)] z-9"),
|
|
193
|
+
children: e.getHeaderGroups().map((o) => /* @__PURE__ */ t(B, { children: o.headers.map((l) => /* @__PURE__ */ t(Qe, { header: l }, l.id)) }, o.id))
|
|
194
|
+
})
|
|
195
|
+
});
|
|
251
196
|
}
|
|
252
|
-
function
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
{
|
|
264
|
-
"aria-sort": s,
|
|
265
|
-
colSpan: e.colSpan,
|
|
266
|
-
minWidth: l?.minWidth,
|
|
267
|
-
width: l?.width,
|
|
268
|
-
children: e.isPlaceholder ? null : W(e.column.columnDef.header, e.getContext())
|
|
269
|
-
}
|
|
270
|
-
);
|
|
197
|
+
function Qe({ header: e }) {
|
|
198
|
+
const a = d.useContext(Z), s = d.useSyncExternalStore(a ? a.subscribe : Y, () => a ? a.get(e.column.id)?.displayed ?? null : null, () => null), o = e.column.getCanSort(), l = o ? s ?? e.column.getIsSorted() : !1, r = l === "asc" ? "ascending" : l === "desc" ? "descending" : o ? "none" : void 0, n = e.column.columnDef.meta;
|
|
199
|
+
return /* @__PURE__ */ t(Ee, {
|
|
200
|
+
"aria-sort": r,
|
|
201
|
+
className: n?.pinned === "left" ? We : void 0,
|
|
202
|
+
colSpan: e.colSpan,
|
|
203
|
+
"data-pinned": n?.pinned === "left" ? "left" : void 0,
|
|
204
|
+
minWidth: n?.minWidth,
|
|
205
|
+
width: n?.width,
|
|
206
|
+
children: e.isPlaceholder ? null : ie(e.column.columnDef.header, e.getContext())
|
|
207
|
+
});
|
|
271
208
|
}
|
|
272
|
-
function
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
),
|
|
297
|
-
"data-depth": e.depth,
|
|
298
|
-
"data-expanded": o ? String(s) : void 0,
|
|
299
|
-
"data-state": e.getIsSelected() ? "selected" : void 0,
|
|
300
|
-
children: e.getVisibleCells().map((c) => /* @__PURE__ */ t(R, { children: W(c.column.columnDef.cell, c.getContext()) }, c.id))
|
|
301
|
-
}
|
|
302
|
-
),
|
|
303
|
-
l != null && // No data-depth here: panels are not data rows, and sharing the
|
|
304
|
-
// parent's depth would break depth-based selectors and counts.
|
|
305
|
-
/* @__PURE__ */ t(
|
|
306
|
-
P,
|
|
307
|
-
{
|
|
308
|
-
className: "bg-accent/50 [&_[data-slot=button].bg-transparent:hover]:bg-secondary",
|
|
309
|
-
"data-slot": "data-table-expanded-row",
|
|
310
|
-
children: /* @__PURE__ */ t(R, { colSpan: a, children: l })
|
|
311
|
-
}
|
|
312
|
-
)
|
|
313
|
-
] });
|
|
209
|
+
function ge({ row: e, columnCount: a, getRowClassName: s, renderExpandedContent: o }) {
|
|
210
|
+
const l = e.getCanExpand(), r = e.getIsExpanded(), n = o && l && r ? o(e) : null;
|
|
211
|
+
return /* @__PURE__ */ T($, { children: [/* @__PURE__ */ t(B, {
|
|
212
|
+
className: h("[&_[data-slot=button].bg-transparent:hover]:bg-secondary", l && r ? "bg-muted" : e.depth > 0 && "bg-accent/50", "data-[state=selected]:[--dt-row-bg:var(--muted)]", l && r ? "[--dt-row-bg:var(--muted)]" : e.depth > 0 && "[--dt-row-bg:color-mix(in_oklab,var(--accent)_50%,var(--background))]", s?.(e)),
|
|
213
|
+
"data-depth": e.depth,
|
|
214
|
+
"data-expanded": l ? String(r) : void 0,
|
|
215
|
+
"data-state": e.getIsSelected() ? "selected" : void 0,
|
|
216
|
+
children: e.getVisibleCells().map((c) => {
|
|
217
|
+
const u = c.column.columnDef.meta?.pinned === "left";
|
|
218
|
+
return /* @__PURE__ */ t(L, {
|
|
219
|
+
className: u ? Ue : void 0,
|
|
220
|
+
"data-pinned": u ? "left" : void 0,
|
|
221
|
+
groupStart: c.column.columnDef.meta?.groupStart,
|
|
222
|
+
children: ie(c.column.columnDef.cell, c.getContext())
|
|
223
|
+
}, c.id);
|
|
224
|
+
})
|
|
225
|
+
}), n != null && /* @__PURE__ */ t(B, {
|
|
226
|
+
className: "bg-accent/50 [&_[data-slot=button].bg-transparent:hover]:bg-secondary",
|
|
227
|
+
"data-slot": "data-table-expanded-row",
|
|
228
|
+
children: /* @__PURE__ */ t(L, {
|
|
229
|
+
colSpan: a,
|
|
230
|
+
children: n
|
|
231
|
+
})
|
|
232
|
+
})] });
|
|
314
233
|
}
|
|
315
|
-
function
|
|
316
|
-
|
|
317
|
-
colCount: a
|
|
318
|
-
}) {
|
|
319
|
-
return /* @__PURE__ */ t(N, { children: Array.from({ length: e }).map((i, n) => /* @__PURE__ */ t(P, { children: Array.from({ length: a }).map((o, s) => /* @__PURE__ */ t(R, { children: /* @__PURE__ */ t(j, { className: "h-4 w-full" }) }, `skeleton-${n}-${s}`)) }, `skeleton-${n}`)) });
|
|
234
|
+
function fe({ rowCount: e, colCount: a }) {
|
|
235
|
+
return /* @__PURE__ */ t($, { children: Array.from({ length: e }).map((s, o) => /* @__PURE__ */ t(B, { children: Array.from({ length: a }).map((l, r) => /* @__PURE__ */ t(L, { children: /* @__PURE__ */ t(X, { className: "h-4 w-full" }) }, `skeleton-${o}-${r}`)) }, `skeleton-${o}`)) });
|
|
320
236
|
}
|
|
321
|
-
function
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
trackingLabel: n,
|
|
326
|
-
isLoading: o = !1,
|
|
327
|
-
refetching: s = !1,
|
|
328
|
-
refetchingLabel: l,
|
|
329
|
-
skeletonRowCount: c,
|
|
330
|
-
noResultsMessage: u = "No results.",
|
|
331
|
-
stickyHeader: r = !1,
|
|
332
|
-
className: d,
|
|
333
|
-
layout: b,
|
|
334
|
-
minWidth: f,
|
|
335
|
-
scrollRegionLabel: m,
|
|
336
|
-
footer: v,
|
|
337
|
-
getRowClassName: S,
|
|
338
|
-
height: w,
|
|
339
|
-
estimateSize: C = 48,
|
|
340
|
-
overscan: k = 5
|
|
341
|
-
}) {
|
|
342
|
-
const p = e.getVisibleLeafColumns().length, x = c ?? e.getState().pagination.pageSize ?? 10, D = g.useRef(null), E = e.getRowModel().rows, A = Se({
|
|
237
|
+
function Ze({ table: e, dataHook: a, trackingEl: s, trackingLabel: o, size: l = "default", frame: r = "own", rowDividers: n = !1, isLoading: c = !1, refetching: u = !1, refetchingLabel: g, loadingLabel: i, skeletonRowCount: b, noResultsMessage: p, noResultsTitle: v, noResultsDescription: f, stickyHeader: m = !1, className: k, layout: x, minWidth: C, scrollRegionLabel: w, footer: A, getRowClassName: z, height: S, estimateSize: y, overscan: R = 5 }, H) {
|
|
238
|
+
const P = y ?? Ne[l], D = e.getVisibleLeafColumns().length, N = b ?? e.getState().pagination.pageSize ?? 20, M = d.useRef(null);
|
|
239
|
+
d.useImperativeHandle(H, () => M.current, []);
|
|
240
|
+
const E = e.getRowModel().rows, F = _e({
|
|
343
241
|
count: E.length,
|
|
344
|
-
getScrollElement: () =>
|
|
345
|
-
estimateSize: () =>
|
|
346
|
-
overscan:
|
|
347
|
-
}),
|
|
348
|
-
return /* @__PURE__ */
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
"
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
242
|
+
getScrollElement: () => M.current,
|
|
243
|
+
estimateSize: () => P,
|
|
244
|
+
overscan: R
|
|
245
|
+
}), I = F.getVirtualItems(), W = F.getTotalSize(), O = I.length > 0 ? I[0].start : 0, V = I.length > 0 ? W - I[I.length - 1].end : 0;
|
|
246
|
+
return /* @__PURE__ */ T("div", {
|
|
247
|
+
ref: M,
|
|
248
|
+
className: h("scrollbar relative overflow-auto", r === "own" && "border-border rounded-md border", "focus-visible:shadow-default outline-none", k),
|
|
249
|
+
"data-frame": r,
|
|
250
|
+
"data-hook": a,
|
|
251
|
+
"data-slot": "data-table-view",
|
|
252
|
+
"data-tracking-el": s,
|
|
253
|
+
"data-tracking-label": o,
|
|
254
|
+
style: S != null ? { height: S } : void 0,
|
|
255
|
+
...oe(w),
|
|
256
|
+
children: [/* @__PURE__ */ t("div", {
|
|
257
|
+
"aria-live": "polite",
|
|
258
|
+
className: "sr-only",
|
|
259
|
+
role: "status",
|
|
260
|
+
children: u ? g ?? "Loading results…" : null
|
|
261
|
+
}), /* @__PURE__ */ t(q.Provider, {
|
|
262
|
+
value: u,
|
|
263
|
+
children: /* @__PURE__ */ T(le, {
|
|
264
|
+
"aria-busy": c || u || void 0,
|
|
265
|
+
dataHook: `${a}-table`,
|
|
266
|
+
frame: r,
|
|
267
|
+
layout: x,
|
|
268
|
+
minWidth: C,
|
|
269
|
+
rowDividers: n,
|
|
270
|
+
scrollOwner: "parent",
|
|
271
|
+
size: l,
|
|
272
|
+
children: [
|
|
273
|
+
/* @__PURE__ */ t(ue, {
|
|
274
|
+
sticky: m && "self",
|
|
275
|
+
table: e
|
|
276
|
+
}),
|
|
277
|
+
/* @__PURE__ */ t(re, { children: c ? /* @__PURE__ */ T($, { children: [/* @__PURE__ */ t(fe, {
|
|
278
|
+
colCount: D,
|
|
279
|
+
rowCount: N
|
|
280
|
+
}), /* @__PURE__ */ t(B, {
|
|
281
|
+
className: "sr-only",
|
|
282
|
+
children: /* @__PURE__ */ t(L, {
|
|
283
|
+
colSpan: D,
|
|
284
|
+
children: /* @__PURE__ */ t("div", {
|
|
285
|
+
"aria-live": "polite",
|
|
286
|
+
role: "status",
|
|
287
|
+
children: i ?? "Loading data…"
|
|
288
|
+
})
|
|
289
|
+
})
|
|
290
|
+
})] }) : E.length > 0 ? /* @__PURE__ */ T($, { children: [
|
|
291
|
+
O > 0 && /* @__PURE__ */ t("tr", {
|
|
292
|
+
"aria-hidden": "true",
|
|
293
|
+
children: /* @__PURE__ */ t("td", {
|
|
294
|
+
colSpan: D,
|
|
295
|
+
style: { height: O }
|
|
296
|
+
})
|
|
297
|
+
}),
|
|
298
|
+
I.map((U) => {
|
|
299
|
+
const j = E[U.index];
|
|
300
|
+
return /* @__PURE__ */ t(ge, {
|
|
301
|
+
columnCount: D,
|
|
302
|
+
getRowClassName: z,
|
|
303
|
+
row: j
|
|
304
|
+
}, j.id);
|
|
305
|
+
}),
|
|
306
|
+
V > 0 && /* @__PURE__ */ t("tr", {
|
|
307
|
+
"aria-hidden": "true",
|
|
308
|
+
children: /* @__PURE__ */ t("td", {
|
|
309
|
+
colSpan: D,
|
|
310
|
+
style: { height: V }
|
|
311
|
+
})
|
|
312
|
+
})
|
|
313
|
+
] }) : /* @__PURE__ */ t(se, {
|
|
314
|
+
colSpan: D,
|
|
315
|
+
children: p ?? /* @__PURE__ */ t(de, {
|
|
316
|
+
dataHook: a,
|
|
317
|
+
description: f,
|
|
318
|
+
table: e,
|
|
319
|
+
title: v
|
|
320
|
+
})
|
|
321
|
+
}) }),
|
|
322
|
+
A
|
|
323
|
+
]
|
|
324
|
+
})
|
|
325
|
+
})]
|
|
326
|
+
});
|
|
418
327
|
}
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
}) {
|
|
431
|
-
const r = e.getIsSorted(), d = g.useContext(_), b = g.useSyncExternalStore(
|
|
432
|
-
d ? d.subscribe : L,
|
|
433
|
-
() => d ? d.get(e.id)?.displayed ?? null : null,
|
|
434
|
-
() => null
|
|
435
|
-
), [f, m] = g.useState(r);
|
|
436
|
-
!d && !u && f !== r && m(r);
|
|
437
|
-
const S = u ? d ? b ?? r : f : r, w = S !== r, C = g.useSyncExternalStore(
|
|
438
|
-
d ? d.subscribe : L,
|
|
439
|
-
() => d ? d.anyHeld() : !1,
|
|
440
|
-
() => !1
|
|
441
|
-
), p = u && (w || !(d ? C : w) && r !== !1);
|
|
442
|
-
if (g.useLayoutEffect(() => {
|
|
443
|
-
if (d)
|
|
444
|
-
return d.set(e.id, {
|
|
445
|
-
displayed: S,
|
|
446
|
-
live: r
|
|
328
|
+
var et = d.forwardRef(Ze);
|
|
329
|
+
et.displayName = "VirtualizedDataTable";
|
|
330
|
+
function tt({ column: e, title: a, className: s, dataHook: o, trackingEl: l, trackingLabel: r, align: n = "left", getSortLabel: c, loading: u = !1 }) {
|
|
331
|
+
const g = e.getIsSorted(), i = d.useContext(Z), b = d.useSyncExternalStore(i ? i.subscribe : Y, () => i ? i.get(e.id)?.displayed ?? null : null, () => null), [p, v] = d.useState(g);
|
|
332
|
+
!i && !u && p !== g && v(g);
|
|
333
|
+
const f = u ? i ? b ?? g : p : g, m = f !== g, k = d.useSyncExternalStore(i ? i.subscribe : Y, () => i ? i.anyHeld() : !1, () => !1), x = u && (m || !(i ? k : m) && g !== !1);
|
|
334
|
+
if (d.useLayoutEffect(() => {
|
|
335
|
+
if (i)
|
|
336
|
+
return i.set(e.id, {
|
|
337
|
+
displayed: f,
|
|
338
|
+
live: g
|
|
447
339
|
}), () => {
|
|
448
|
-
|
|
340
|
+
i.set(e.id, null);
|
|
449
341
|
};
|
|
450
|
-
}, [
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
342
|
+
}, [
|
|
343
|
+
i,
|
|
344
|
+
e.id,
|
|
345
|
+
f,
|
|
346
|
+
g
|
|
347
|
+
]), !e.getCanSort()) return /* @__PURE__ */ t("div", {
|
|
348
|
+
className: h("text-muted-foreground text-label text-left font-semibold", n === "right" && "text-right", n === "center" && "text-center", s),
|
|
349
|
+
"data-hook": o,
|
|
350
|
+
"data-slot": "data-table-column-header",
|
|
351
|
+
"data-tracking-el": l,
|
|
352
|
+
"data-tracking-label": r,
|
|
353
|
+
children: a
|
|
354
|
+
});
|
|
355
|
+
const C = g === !1 ? e.columnDef.sortDescFirst === !0 : g === "asc", w = c ? c(a, f) : f === "desc" ? `Sort by ${a}, currently descending` : f === "asc" ? `Sort by ${a}, currently ascending` : `Sort by ${a}`;
|
|
356
|
+
return /* @__PURE__ */ t("div", {
|
|
357
|
+
className: h("flex items-center", n === "right" && "justify-end", n === "center" && "justify-center", s),
|
|
358
|
+
"data-slot": "data-table-column-header",
|
|
359
|
+
"data-tracking-el": l,
|
|
360
|
+
"data-tracking-label": r,
|
|
361
|
+
children: /* @__PURE__ */ T(te, {
|
|
362
|
+
"aria-busy": u ? "true" : void 0,
|
|
363
|
+
"aria-label": w,
|
|
364
|
+
className: "text-muted-foreground text-label h-auto p-0 font-semibold",
|
|
365
|
+
dataHook: o || `column-header-${e.id}`,
|
|
366
|
+
size: "sm",
|
|
367
|
+
variant: "ghost",
|
|
368
|
+
onClick: () => {
|
|
369
|
+
u || e.toggleSorting(C);
|
|
370
|
+
},
|
|
371
|
+
children: [/* @__PURE__ */ t("span", {
|
|
372
|
+
"aria-hidden": "true",
|
|
464
373
|
children: a
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
"flex items-center",
|
|
473
|
-
l === "right" && "justify-end",
|
|
474
|
-
l === "center" && "justify-center",
|
|
475
|
-
i
|
|
476
|
-
),
|
|
477
|
-
"data-slot": "data-table-column-header",
|
|
478
|
-
"data-tracking-el": o,
|
|
479
|
-
"data-tracking-label": s,
|
|
480
|
-
children: /* @__PURE__ */ y(
|
|
481
|
-
q,
|
|
482
|
-
{
|
|
483
|
-
"aria-busy": u ? "true" : void 0,
|
|
484
|
-
"aria-label": D,
|
|
485
|
-
className: "text-muted-foreground text-label h-auto p-0 font-semibold",
|
|
486
|
-
dataHook: n || `column-header-${e.id}`,
|
|
487
|
-
size: "sm",
|
|
488
|
-
variant: "ghost",
|
|
489
|
-
onClick: () => {
|
|
490
|
-
u || e.toggleSorting(x);
|
|
491
|
-
},
|
|
492
|
-
children: [
|
|
493
|
-
/* @__PURE__ */ t("span", { "aria-hidden": "true", children: a }),
|
|
494
|
-
/* @__PURE__ */ t(
|
|
495
|
-
"span",
|
|
496
|
-
{
|
|
497
|
-
"aria-hidden": "true",
|
|
498
|
-
className: "flex size-3 items-center justify-center",
|
|
499
|
-
children: p ? /* @__PURE__ */ t(K, { size: "sm" }) : S === "desc" ? /* @__PURE__ */ t(xe, { size: 12 }) : S === "asc" ? /* @__PURE__ */ t(ve, { size: 12 }) : /* @__PURE__ */ t(we, { size: 12 })
|
|
500
|
-
}
|
|
501
|
-
)
|
|
502
|
-
]
|
|
503
|
-
}
|
|
504
|
-
)
|
|
505
|
-
}
|
|
506
|
-
);
|
|
374
|
+
}), /* @__PURE__ */ t("span", {
|
|
375
|
+
"aria-hidden": "true",
|
|
376
|
+
className: "flex size-3 items-center justify-center",
|
|
377
|
+
children: x ? /* @__PURE__ */ t(ne, { size: "sm" }) : f === "desc" ? /* @__PURE__ */ t(ze, { size: 12 }) : f === "asc" ? /* @__PURE__ */ t(Me, { size: 12 }) : /* @__PURE__ */ t(Fe, { size: 12 })
|
|
378
|
+
})]
|
|
379
|
+
})
|
|
380
|
+
});
|
|
507
381
|
}
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
placeholder: i,
|
|
513
|
-
clearSearchAriaLabel: n,
|
|
514
|
-
loading: o = !1,
|
|
515
|
-
debounceMs: s,
|
|
516
|
-
...l
|
|
517
|
-
}) {
|
|
518
|
-
const c = e.getState().globalFilter ?? "", [u, r] = g.useState(c), d = s ?? (e.options.manualFiltering === !0 ? 300 : 0), b = g.useRef(null), f = g.useCallback(() => {
|
|
519
|
-
b.current !== null && (clearTimeout(b.current), b.current = null);
|
|
382
|
+
tt.displayName = "DataTableColumnHeader";
|
|
383
|
+
var at = d.forwardRef(function({ table: a, ariaLabel: s, placeholder: o, clearSearchAriaLabel: l, disabled: r = !1, loading: n = !1, debounceMs: c, ...u }, g) {
|
|
384
|
+
const i = a.getState().globalFilter ?? "", [b, p] = d.useState(i), v = c ?? (a.options.manualFiltering === !0 ? 300 : 0), f = d.useRef(null), m = d.useCallback(() => {
|
|
385
|
+
f.current !== null && (clearTimeout(f.current), f.current = null);
|
|
520
386
|
}, []);
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
387
|
+
d.useEffect(() => m, [m]), d.useEffect(() => {
|
|
388
|
+
r && m();
|
|
389
|
+
}, [r, m]);
|
|
390
|
+
const k = d.useRef(b);
|
|
391
|
+
d.useEffect(() => {
|
|
392
|
+
k.current = b;
|
|
525
393
|
});
|
|
526
|
-
const [
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
394
|
+
const [x, C] = d.useState({
|
|
395
|
+
filter: i,
|
|
396
|
+
pushed: []
|
|
397
|
+
}), w = (S) => {
|
|
398
|
+
(a.getState().globalFilter ?? "") !== S && (C((y) => ({
|
|
399
|
+
filter: y.filter,
|
|
400
|
+
pushed: [...y.pushed, S].slice(-10)
|
|
401
|
+
})), a.setGlobalFilter(S));
|
|
402
|
+
}, A = (S) => {
|
|
403
|
+
m(), v > 0 ? f.current = setTimeout(() => {
|
|
404
|
+
f.current = null, k.current === S && w(S);
|
|
405
|
+
}, v) : w(S);
|
|
535
406
|
};
|
|
536
|
-
if (
|
|
537
|
-
const
|
|
538
|
-
|
|
539
|
-
filter:
|
|
540
|
-
pushed:
|
|
541
|
-
}), !
|
|
407
|
+
if (i !== x.filter) {
|
|
408
|
+
const S = x.pushed.lastIndexOf(i), y = S !== -1;
|
|
409
|
+
C({
|
|
410
|
+
filter: i,
|
|
411
|
+
pushed: y ? x.pushed.slice(S + 1) : x.pushed
|
|
412
|
+
}), !y && i !== b && p(i);
|
|
542
413
|
}
|
|
543
|
-
const
|
|
544
|
-
|
|
414
|
+
const z = () => {
|
|
415
|
+
m(), p(""), w("");
|
|
545
416
|
};
|
|
546
|
-
return /* @__PURE__ */
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
onClear: d > 0 ? k : void 0
|
|
574
|
-
}
|
|
575
|
-
)
|
|
576
|
-
]
|
|
577
|
-
}
|
|
578
|
-
);
|
|
579
|
-
}
|
|
580
|
-
Ge.displayName = "DataTableSearch";
|
|
581
|
-
function _e(e) {
|
|
582
|
-
const { pageIndex: a, pageSize: i } = e.getState().pagination, n = e.getRowCount(), o = e.getPageCount(), s = e.getCanPreviousPage(), l = e.getCanNextPage(), c = a + 1, u = n === 0 ? 0 : a * i + 1, r = Math.min(c * i, n), d = g.useCallback(
|
|
583
|
-
(v) => e.setPageIndex(v - 1),
|
|
584
|
-
[e]
|
|
585
|
-
), b = g.useCallback(() => e.nextPage(), [e]), f = g.useCallback(() => e.previousPage(), [e]), m = g.useCallback(
|
|
586
|
-
(v) => e.setPageSize(v),
|
|
587
|
-
[e]
|
|
588
|
-
);
|
|
589
|
-
return g.useMemo(
|
|
590
|
-
() => ({
|
|
591
|
-
pageIndex: a,
|
|
592
|
-
pageSize: i,
|
|
593
|
-
totalRows: n,
|
|
594
|
-
totalPages: o,
|
|
595
|
-
startRow: u,
|
|
596
|
-
endRow: r,
|
|
597
|
-
currentPage: c,
|
|
598
|
-
canPrev: s,
|
|
599
|
-
canNext: l,
|
|
600
|
-
goToPage: d,
|
|
601
|
-
nextPage: b,
|
|
602
|
-
previousPage: f,
|
|
603
|
-
setPageSize: m
|
|
604
|
-
}),
|
|
605
|
-
[
|
|
606
|
-
a,
|
|
607
|
-
i,
|
|
608
|
-
n,
|
|
609
|
-
o,
|
|
610
|
-
u,
|
|
611
|
-
r,
|
|
612
|
-
c,
|
|
613
|
-
s,
|
|
614
|
-
l,
|
|
615
|
-
d,
|
|
616
|
-
b,
|
|
617
|
-
f,
|
|
618
|
-
m
|
|
417
|
+
return /* @__PURE__ */ T(me, {
|
|
418
|
+
"aria-busy": n ? "true" : void 0,
|
|
419
|
+
"data-slot": "data-table-search",
|
|
420
|
+
...u,
|
|
421
|
+
children: [
|
|
422
|
+
/* @__PURE__ */ t(he, {
|
|
423
|
+
className: "pl-3",
|
|
424
|
+
children: n ? /* @__PURE__ */ t(ne, { dataHook: `${u.dataHook}-loading` }) : /* @__PURE__ */ t($e, {})
|
|
425
|
+
}),
|
|
426
|
+
/* @__PURE__ */ t(Se, {
|
|
427
|
+
ref: g,
|
|
428
|
+
"aria-label": s ?? "Search table",
|
|
429
|
+
disabled: r,
|
|
430
|
+
placeholder: o ?? "Search...",
|
|
431
|
+
type: "text",
|
|
432
|
+
value: b,
|
|
433
|
+
onChange: (S) => {
|
|
434
|
+
const y = S.target.value;
|
|
435
|
+
p(y), A(y);
|
|
436
|
+
}
|
|
437
|
+
}),
|
|
438
|
+
/* @__PURE__ */ t(ve, {
|
|
439
|
+
clearSearchAriaLabel: l,
|
|
440
|
+
"data-slot": "data-table-search-clear",
|
|
441
|
+
dataHook: `${u.dataHook}-clear`,
|
|
442
|
+
onClear: v > 0 ? z : void 0
|
|
443
|
+
})
|
|
619
444
|
]
|
|
620
|
-
);
|
|
445
|
+
});
|
|
446
|
+
});
|
|
447
|
+
at.displayName = "DataTableSearch";
|
|
448
|
+
function nt(e) {
|
|
449
|
+
const { pageIndex: a, pageSize: s } = e.getState().pagination, o = e.getRowCount(), l = e.getPageCount(), r = e.getCanPreviousPage(), n = e.getCanNextPage(), c = a + 1, u = o === 0 ? 0 : a * s + 1, g = Math.min(c * s, o), i = d.useCallback((f) => e.setPageIndex(f - 1), [e]), b = d.useCallback(() => e.nextPage(), [e]), p = d.useCallback(() => e.previousPage(), [e]), v = d.useCallback((f) => e.setPageSize(f), [e]);
|
|
450
|
+
return d.useMemo(() => ({
|
|
451
|
+
pageIndex: a,
|
|
452
|
+
pageSize: s,
|
|
453
|
+
totalRows: o,
|
|
454
|
+
totalPages: l,
|
|
455
|
+
startRow: u,
|
|
456
|
+
endRow: g,
|
|
457
|
+
currentPage: c,
|
|
458
|
+
canPrev: r,
|
|
459
|
+
canNext: n,
|
|
460
|
+
goToPage: i,
|
|
461
|
+
nextPage: b,
|
|
462
|
+
previousPage: p,
|
|
463
|
+
setPageSize: v
|
|
464
|
+
}), [
|
|
465
|
+
a,
|
|
466
|
+
s,
|
|
467
|
+
o,
|
|
468
|
+
l,
|
|
469
|
+
u,
|
|
470
|
+
g,
|
|
471
|
+
c,
|
|
472
|
+
r,
|
|
473
|
+
n,
|
|
474
|
+
i,
|
|
475
|
+
b,
|
|
476
|
+
p,
|
|
477
|
+
v
|
|
478
|
+
]);
|
|
621
479
|
}
|
|
622
|
-
|
|
623
|
-
function
|
|
624
|
-
const e =
|
|
625
|
-
if (!e)
|
|
626
|
-
throw new Error(
|
|
627
|
-
"DataTablePagination sub-components must be used within <DataTablePagination>"
|
|
628
|
-
);
|
|
480
|
+
var J = d.createContext(null);
|
|
481
|
+
function pe() {
|
|
482
|
+
const e = d.useContext(J);
|
|
483
|
+
if (!e) throw new Error("DataTablePagination sub-components must be used within <DataTablePagination>");
|
|
629
484
|
return e;
|
|
630
485
|
}
|
|
631
|
-
function
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
486
|
+
function K({ label: e, labelOne: a, emptyLabel: s, renderText: o, dataHook: l, className: r }) {
|
|
487
|
+
const { info: n, dataHook: c } = pe(), u = Q("sm"), { startRow: g, endRow: i, totalRows: b, pageIndex: p, pageSize: v } = n;
|
|
488
|
+
if (u) return null;
|
|
489
|
+
if (o) {
|
|
490
|
+
const f = o({
|
|
491
|
+
startRow: g,
|
|
492
|
+
endRow: i,
|
|
493
|
+
totalRows: b,
|
|
494
|
+
pageIndex: p,
|
|
495
|
+
pageSize: v
|
|
496
|
+
});
|
|
497
|
+
return f == null ? null : /* @__PURE__ */ t("span", {
|
|
498
|
+
className: h("text-body-sm text-muted-foreground whitespace-nowrap", r),
|
|
499
|
+
"data-hook": l ?? `${c}-row-count`,
|
|
645
500
|
"data-slot": "data-table-pagination-row-count",
|
|
646
|
-
children:
|
|
647
|
-
}
|
|
648
|
-
|
|
501
|
+
children: f
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
return /* @__PURE__ */ t(xe, {
|
|
505
|
+
className: h("whitespace-nowrap", r),
|
|
506
|
+
dataHook: l ?? `${c}-row-count`,
|
|
507
|
+
emptyLabel: s,
|
|
508
|
+
from: g,
|
|
509
|
+
rangeLabel: e,
|
|
510
|
+
rangeLabelOne: a,
|
|
511
|
+
to: i,
|
|
512
|
+
total: b
|
|
513
|
+
});
|
|
649
514
|
}
|
|
650
|
-
|
|
651
|
-
function
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
})
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
515
|
+
K.displayName = "DataTablePaginationRowCount";
|
|
516
|
+
function be({ ariaLabel: e = "Table pagination", dataHook: a, className: s }) {
|
|
517
|
+
const { info: o } = pe(), l = Q("sm"), r = Pe({
|
|
518
|
+
page: o.currentPage,
|
|
519
|
+
totalPages: o.totalPages
|
|
520
|
+
});
|
|
521
|
+
return o.totalPages <= 1 ? null : /* @__PURE__ */ t(we, {
|
|
522
|
+
ariaLabel: e,
|
|
523
|
+
className: h(!l && "mx-0 w-auto justify-end", s),
|
|
524
|
+
dataHook: a ?? "pagination-nav",
|
|
525
|
+
children: /* @__PURE__ */ t(Ce, { children: r.map((n, c) => n === "previous" ? /* @__PURE__ */ t(G, { children: /* @__PURE__ */ t(De, {
|
|
526
|
+
disabled: !o.canPrev,
|
|
527
|
+
onClick: () => o.previousPage()
|
|
528
|
+
}) }, "previous") : n === "next" ? /* @__PURE__ */ t(G, { children: /* @__PURE__ */ t(Te, {
|
|
529
|
+
disabled: !o.canNext,
|
|
530
|
+
onClick: () => o.nextPage()
|
|
531
|
+
}) }, "next") : n === "ellipsis" ? /* @__PURE__ */ t(G, { children: /* @__PURE__ */ t(ye, {}) }, `ellipsis-${c}`) : /* @__PURE__ */ t(G, { children: /* @__PURE__ */ t(ke, {
|
|
532
|
+
isActive: n === o.currentPage,
|
|
533
|
+
page: n,
|
|
534
|
+
onClick: () => o.goToPage(n)
|
|
535
|
+
}) }, n)) })
|
|
659
536
|
});
|
|
660
|
-
return n.totalPages <= 1 ? null : /* @__PURE__ */ t(
|
|
661
|
-
Ne,
|
|
662
|
-
{
|
|
663
|
-
ariaLabel: e,
|
|
664
|
-
className: h(!o && "mx-0 w-auto justify-end", i),
|
|
665
|
-
dataHook: a ?? "pagination-nav",
|
|
666
|
-
children: /* @__PURE__ */ t(Ee, { children: s.map((l, c) => l === "previous" ? /* @__PURE__ */ t(F, { children: /* @__PURE__ */ t(
|
|
667
|
-
ze,
|
|
668
|
-
{
|
|
669
|
-
disabled: !n.canPrev,
|
|
670
|
-
onClick: () => n.previousPage()
|
|
671
|
-
}
|
|
672
|
-
) }, "previous") : l === "next" ? /* @__PURE__ */ t(F, { children: /* @__PURE__ */ t(
|
|
673
|
-
Ae,
|
|
674
|
-
{
|
|
675
|
-
disabled: !n.canNext,
|
|
676
|
-
onClick: () => n.nextPage()
|
|
677
|
-
}
|
|
678
|
-
) }, "next") : l === "ellipsis" ? /* @__PURE__ */ t(F, { children: /* @__PURE__ */ t(Ie, {}) }, `ellipsis-${c}`) : /* @__PURE__ */ t(F, { children: /* @__PURE__ */ t(
|
|
679
|
-
$e,
|
|
680
|
-
{
|
|
681
|
-
isActive: l === n.currentPage,
|
|
682
|
-
page: l,
|
|
683
|
-
onClick: () => n.goToPage(l)
|
|
684
|
-
}
|
|
685
|
-
) }, l)) })
|
|
686
|
-
}
|
|
687
|
-
);
|
|
688
537
|
}
|
|
689
|
-
|
|
690
|
-
function
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
trackingEl: o,
|
|
696
|
-
trackingLabel: s,
|
|
697
|
-
className: l,
|
|
698
|
-
ariaLabel: c = "Table pagination",
|
|
699
|
-
children: u
|
|
700
|
-
}) {
|
|
701
|
-
const r = _e(e), d = G("sm"), b = g.useMemo(
|
|
702
|
-
() => ({ info: r }),
|
|
703
|
-
[r]
|
|
704
|
-
), f = {
|
|
538
|
+
be.displayName = "DataTablePaginationNav";
|
|
539
|
+
function ot({ table: e, dataHook: a, showRowCount: s = !0, rowCountLabel: o, rowCountLabelOne: l, rowCountEmptyLabel: r, renderRowCount: n, trackingEl: c, trackingLabel: u, className: g, ariaLabel: i = "Table pagination", children: b }) {
|
|
540
|
+
const p = nt(e), v = Q("sm"), f = d.useMemo(() => ({
|
|
541
|
+
info: p,
|
|
542
|
+
dataHook: a
|
|
543
|
+
}), [p, a]), m = {
|
|
705
544
|
"data-hook": a,
|
|
706
545
|
"data-slot": "data-table-pagination",
|
|
707
|
-
"data-tracking-el":
|
|
708
|
-
"data-tracking-label":
|
|
546
|
+
"data-tracking-el": c,
|
|
547
|
+
"data-tracking-label": u
|
|
709
548
|
};
|
|
710
|
-
if (
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
ne,
|
|
742
|
-
{
|
|
743
|
-
ariaLabel: c,
|
|
744
|
-
className: "grow",
|
|
745
|
-
dataHook: `${a}-nav`
|
|
746
|
-
}
|
|
747
|
-
)
|
|
748
|
-
]
|
|
749
|
-
}
|
|
750
|
-
) });
|
|
549
|
+
if (b) return /* @__PURE__ */ t(J.Provider, {
|
|
550
|
+
value: f,
|
|
551
|
+
children: /* @__PURE__ */ t("div", {
|
|
552
|
+
className: h("flex w-full flex-wrap items-center gap-x-4 gap-y-2", g),
|
|
553
|
+
...m,
|
|
554
|
+
children: b
|
|
555
|
+
})
|
|
556
|
+
});
|
|
557
|
+
const k = n && s && !v ? n({
|
|
558
|
+
startRow: p.startRow,
|
|
559
|
+
endRow: p.endRow,
|
|
560
|
+
totalRows: p.totalRows,
|
|
561
|
+
pageIndex: p.pageIndex,
|
|
562
|
+
pageSize: p.pageSize
|
|
563
|
+
}) : null, x = !v && s && n !== null && (n ? k != null : !0), C = x && (!!n || p.totalRows > 0), w = p.totalPages > 1;
|
|
564
|
+
return !x && !w ? null : /* @__PURE__ */ t(J.Provider, {
|
|
565
|
+
value: f,
|
|
566
|
+
children: /* @__PURE__ */ T("div", {
|
|
567
|
+
className: h("flex w-full flex-wrap items-center gap-x-4 gap-y-2", (C || w) && "min-h-9", C ? "justify-between" : "justify-end", g),
|
|
568
|
+
...m,
|
|
569
|
+
children: [x && (n ? /* @__PURE__ */ t(K, { renderText: () => k }) : /* @__PURE__ */ t(K, {
|
|
570
|
+
emptyLabel: r,
|
|
571
|
+
label: o,
|
|
572
|
+
labelOne: l
|
|
573
|
+
})), /* @__PURE__ */ t(be, {
|
|
574
|
+
ariaLabel: i,
|
|
575
|
+
className: "grow",
|
|
576
|
+
dataHook: `${a}-nav`
|
|
577
|
+
})]
|
|
578
|
+
})
|
|
579
|
+
});
|
|
751
580
|
}
|
|
752
|
-
|
|
753
|
-
function
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
"aria-disabled": s || void 0,
|
|
765
|
-
"aria-label": o ?? "Select all",
|
|
766
|
-
checked: e.getIsAllPageRowsSelected() || e.getIsSomePageRowsSelected() && "indeterminate",
|
|
767
|
-
dataHook: a || "select-all-checkbox",
|
|
768
|
-
trackingEl: i,
|
|
769
|
-
trackingLabel: n,
|
|
770
|
-
onCheckedChange: (l) => {
|
|
771
|
-
s || e.toggleAllPageRowsSelected(!!l);
|
|
772
|
-
}
|
|
581
|
+
ot.displayName = "DataTablePagination";
|
|
582
|
+
function lt({ table: e, dataHook: a, trackingEl: s, trackingLabel: o, selectAllAriaLabel: l }) {
|
|
583
|
+
const r = d.useContext(q);
|
|
584
|
+
return /* @__PURE__ */ t(ae, {
|
|
585
|
+
"aria-disabled": r || void 0,
|
|
586
|
+
"aria-label": l ?? "Select all",
|
|
587
|
+
checked: e.getIsAllPageRowsSelected(),
|
|
588
|
+
dataHook: a || "select-all-checkbox",
|
|
589
|
+
trackingEl: s,
|
|
590
|
+
trackingLabel: o,
|
|
591
|
+
onCheckedChange: (n) => {
|
|
592
|
+
r || e.toggleAllPageRowsSelected(!!n);
|
|
773
593
|
}
|
|
774
|
-
);
|
|
594
|
+
});
|
|
775
595
|
}
|
|
776
|
-
|
|
777
|
-
function
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
{
|
|
788
|
-
|
|
789
|
-
"aria-label": o ?? "Select row",
|
|
790
|
-
checked: e.getIsSelected(),
|
|
791
|
-
dataHook: a || `select-row-${e.id}`,
|
|
792
|
-
disabled: !e.getCanSelect(),
|
|
793
|
-
trackingEl: i,
|
|
794
|
-
trackingLabel: n,
|
|
795
|
-
onCheckedChange: (l) => {
|
|
796
|
-
s || e.toggleSelected(!!l);
|
|
797
|
-
}
|
|
596
|
+
lt.displayName = "DataTableSelectAllCheckbox";
|
|
597
|
+
function rt({ row: e, dataHook: a, trackingEl: s, trackingLabel: o, selectRowAriaLabel: l }) {
|
|
598
|
+
const r = d.useContext(q);
|
|
599
|
+
return /* @__PURE__ */ t(ae, {
|
|
600
|
+
"aria-disabled": r || void 0,
|
|
601
|
+
"aria-label": l ?? "Select row",
|
|
602
|
+
checked: e.getIsSelected(),
|
|
603
|
+
dataHook: a || `select-row-${e.id}`,
|
|
604
|
+
disabled: !e.getCanSelect(),
|
|
605
|
+
trackingEl: s,
|
|
606
|
+
trackingLabel: o,
|
|
607
|
+
onCheckedChange: (n) => {
|
|
608
|
+
r || e.toggleSelected(!!n);
|
|
798
609
|
}
|
|
799
|
-
);
|
|
610
|
+
});
|
|
800
611
|
}
|
|
801
|
-
|
|
802
|
-
function
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
"aria-expanded": u,
|
|
828
|
-
"aria-label": d,
|
|
829
|
-
className: c,
|
|
830
|
-
"data-state": u ? "open" : "closed",
|
|
831
|
-
dataHook: i || `expand-row-${e.id}`,
|
|
832
|
-
size: "sm",
|
|
833
|
-
trackingEl: n,
|
|
834
|
-
trackingLabel: o,
|
|
835
|
-
variant: "ghost",
|
|
836
|
-
onClick: e.getToggleExpandedHandler(),
|
|
837
|
-
children: /* @__PURE__ */ t(
|
|
838
|
-
Ce,
|
|
839
|
-
{
|
|
840
|
-
"aria-hidden": "true",
|
|
841
|
-
className: h(
|
|
842
|
-
"duration-base transition-transform ease-in-out",
|
|
843
|
-
u && "rotate-90"
|
|
844
|
-
)
|
|
845
|
-
}
|
|
846
|
-
)
|
|
847
|
-
}
|
|
848
|
-
);
|
|
612
|
+
rt.displayName = "DataTableSelectRowCheckbox";
|
|
613
|
+
function st({ row: e, rowName: a, dataHook: s, trackingEl: o, trackingLabel: l, expandLabel: r, collapseLabel: n, className: c }) {
|
|
614
|
+
if (!e.getCanExpand()) return /* @__PURE__ */ t("span", {
|
|
615
|
+
"aria-hidden": "true",
|
|
616
|
+
className: h("inline-block size-9", c),
|
|
617
|
+
"data-slot": "data-table-expand-row-spacer"
|
|
618
|
+
});
|
|
619
|
+
const u = e.getIsExpanded(), g = u ? n : r;
|
|
620
|
+
let i;
|
|
621
|
+
return g && (a !== void 0 || !g.includes("{name}")) ? i = g.replaceAll("{name}", a ?? "") : a !== void 0 ? i = u ? `Collapse details for ${a}` : `Expand details for ${a}` : i = u ? "Collapse row" : "Expand row", /* @__PURE__ */ t(te, {
|
|
622
|
+
iconOnly: !0,
|
|
623
|
+
"aria-expanded": u,
|
|
624
|
+
"aria-label": i,
|
|
625
|
+
className: c,
|
|
626
|
+
"data-state": u ? "open" : "closed",
|
|
627
|
+
dataHook: s || `expand-row-${e.id}`,
|
|
628
|
+
size: "sm",
|
|
629
|
+
trackingEl: o,
|
|
630
|
+
trackingLabel: l,
|
|
631
|
+
variant: "ghost",
|
|
632
|
+
onClick: e.getToggleExpandedHandler(),
|
|
633
|
+
children: /* @__PURE__ */ t(Be, {
|
|
634
|
+
"aria-hidden": "true",
|
|
635
|
+
className: h("duration-base transition-transform ease-in-out", u && "rotate-90")
|
|
636
|
+
})
|
|
637
|
+
});
|
|
849
638
|
}
|
|
850
|
-
|
|
851
|
-
function
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
"
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
Array.from({ length: e }, (o, s) => /* @__PURE__ */ y("div", { "aria-hidden": "true", className: "flex items-center gap-4", children: [
|
|
867
|
-
/* @__PURE__ */ t(j, { className: "h-4 w-24 shrink-0" }),
|
|
868
|
-
/* @__PURE__ */ t(j, { className: "h-4 w-48 max-w-full" })
|
|
869
|
-
] }, s))
|
|
870
|
-
]
|
|
871
|
-
}
|
|
872
|
-
);
|
|
639
|
+
st.displayName = "DataTableExpandRowButton";
|
|
640
|
+
function it({ fields: e = 3, loadingLabel: a, dataHook: s, className: o }) {
|
|
641
|
+
return /* @__PURE__ */ T("div", {
|
|
642
|
+
className: h("relative flex flex-col gap-2 py-1", o),
|
|
643
|
+
"data-hook": s || "data-table-expanded-skeleton",
|
|
644
|
+
"data-slot": "data-table-expanded-skeleton",
|
|
645
|
+
role: "status",
|
|
646
|
+
children: [/* @__PURE__ */ t("span", {
|
|
647
|
+
className: "sr-only",
|
|
648
|
+
children: a ?? "Loading details"
|
|
649
|
+
}), Array.from({ length: e }, (l, r) => /* @__PURE__ */ T("div", {
|
|
650
|
+
"aria-hidden": "true",
|
|
651
|
+
className: "flex items-center gap-4",
|
|
652
|
+
children: [/* @__PURE__ */ t(X, { className: "h-4 w-24 shrink-0" }), /* @__PURE__ */ t(X, { className: "h-4 w-48 max-w-full" })]
|
|
653
|
+
}, r))]
|
|
654
|
+
});
|
|
873
655
|
}
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
function
|
|
877
|
-
const e =
|
|
878
|
-
if (!e)
|
|
879
|
-
throw new Error(
|
|
880
|
-
"DataTableBulkActions components must be used within <DataTableBulkActions>"
|
|
881
|
-
);
|
|
656
|
+
it.displayName = "DataTableExpandedSkeleton";
|
|
657
|
+
var ee = d.createContext(null);
|
|
658
|
+
function ct() {
|
|
659
|
+
const e = d.useContext(ee);
|
|
660
|
+
if (!e) throw new Error("DataTableBulkActions components must be used within <DataTableBulkActions>");
|
|
882
661
|
return e;
|
|
883
662
|
}
|
|
884
|
-
function
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
{
|
|
900
|
-
"aria-busy": l || void 0,
|
|
901
|
-
className: h("flex items-center gap-2.5", o),
|
|
663
|
+
function dt({ table: e, dataHook: a, trackingEl: s, trackingLabel: o, className: l, children: r, refetching: n = !1 }) {
|
|
664
|
+
const c = e.getFilteredSelectedRowModel().rows.length, u = e.getRowCount(), g = d.useMemo(() => ({
|
|
665
|
+
selectedCount: c,
|
|
666
|
+
totalCount: u,
|
|
667
|
+
refetching: n
|
|
668
|
+
}), [
|
|
669
|
+
c,
|
|
670
|
+
u,
|
|
671
|
+
n
|
|
672
|
+
]);
|
|
673
|
+
return c === 0 ? null : /* @__PURE__ */ t(ee.Provider, {
|
|
674
|
+
value: g,
|
|
675
|
+
children: /* @__PURE__ */ t("div", {
|
|
676
|
+
"aria-busy": n || void 0,
|
|
677
|
+
className: h("flex items-center gap-2.5", l),
|
|
902
678
|
"data-hook": a,
|
|
903
679
|
"data-slot": "data-table-bulk-actions",
|
|
904
|
-
"data-tracking-el":
|
|
905
|
-
"data-tracking-label":
|
|
906
|
-
children:
|
|
907
|
-
}
|
|
908
|
-
|
|
680
|
+
"data-tracking-el": s ?? "data-table-bulk-actions",
|
|
681
|
+
"data-tracking-label": o,
|
|
682
|
+
children: r
|
|
683
|
+
})
|
|
684
|
+
});
|
|
909
685
|
}
|
|
910
|
-
|
|
911
|
-
function
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
children: /* @__PURE__ */ t("span", { "data-slot": "data-table-bulk-actions-summary", role: "status", children: l })
|
|
925
|
-
}
|
|
926
|
-
);
|
|
686
|
+
dt.displayName = "DataTableBulkActions";
|
|
687
|
+
function ut({ dataHook: e = "data-table-bulk-actions-summary", className: a, children: s }) {
|
|
688
|
+
const o = ct(), { selectedCount: l, totalCount: r } = o;
|
|
689
|
+
let n;
|
|
690
|
+
return typeof s == "function" ? n = s(o) : s != null ? n = s : n = `${l} of ${r} row(s) selected.`, /* @__PURE__ */ t(Ae, {
|
|
691
|
+
asChild: !0,
|
|
692
|
+
className: h("min-w-0", a),
|
|
693
|
+
dataHook: e,
|
|
694
|
+
children: /* @__PURE__ */ t("span", {
|
|
695
|
+
"data-slot": "data-table-bulk-actions-summary",
|
|
696
|
+
role: "status",
|
|
697
|
+
children: n
|
|
698
|
+
})
|
|
699
|
+
});
|
|
927
700
|
}
|
|
928
|
-
|
|
929
|
-
function
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
className: h("flex shrink-0 items-center gap-2", a),
|
|
939
|
-
"data-hook": e,
|
|
940
|
-
"data-slot": "data-table-bulk-actions-actions",
|
|
941
|
-
inert: n || void 0,
|
|
942
|
-
children: i
|
|
943
|
-
}
|
|
944
|
-
);
|
|
701
|
+
ut.displayName = "DataTableBulkActionsSummary";
|
|
702
|
+
function gt({ dataHook: e = "data-table-bulk-actions-actions", className: a, children: s }) {
|
|
703
|
+
const o = d.useContext(ee)?.refetching ?? !1;
|
|
704
|
+
return /* @__PURE__ */ t("div", {
|
|
705
|
+
className: h("flex shrink-0 items-center gap-2", a),
|
|
706
|
+
"data-hook": e,
|
|
707
|
+
"data-slot": "data-table-bulk-actions-actions",
|
|
708
|
+
inert: o || void 0,
|
|
709
|
+
children: s
|
|
710
|
+
});
|
|
945
711
|
}
|
|
946
|
-
|
|
947
|
-
function
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
{
|
|
955
|
-
className: h(
|
|
956
|
-
"flex flex-col gap-3 py-4 sm:flex-row sm:items-center",
|
|
957
|
-
a
|
|
958
|
-
),
|
|
959
|
-
"data-hook": e,
|
|
960
|
-
"data-slot": "data-table-toolbar",
|
|
961
|
-
children: i
|
|
962
|
-
}
|
|
963
|
-
);
|
|
712
|
+
gt.displayName = "DataTableBulkActionsActions";
|
|
713
|
+
function ft({ dataHook: e, className: a, children: s }) {
|
|
714
|
+
return /* @__PURE__ */ t("div", {
|
|
715
|
+
className: h("flex flex-col gap-3 py-4 sm:flex-row sm:flex-wrap sm:items-center", a),
|
|
716
|
+
"data-hook": e,
|
|
717
|
+
"data-slot": "data-table-toolbar",
|
|
718
|
+
children: s
|
|
719
|
+
});
|
|
964
720
|
}
|
|
965
|
-
|
|
966
|
-
function
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
{
|
|
973
|
-
className: h(
|
|
974
|
-
"flex w-full min-w-0 items-center gap-2 sm:w-auto sm:flex-1",
|
|
975
|
-
e
|
|
976
|
-
),
|
|
977
|
-
"data-slot": "data-table-toolbar-left",
|
|
978
|
-
children: a
|
|
979
|
-
}
|
|
980
|
-
);
|
|
721
|
+
ft.displayName = "DataTableToolbar";
|
|
722
|
+
function pt({ className: e, children: a }) {
|
|
723
|
+
return /* @__PURE__ */ t("div", {
|
|
724
|
+
className: h("flex w-full min-w-0 items-center gap-2 sm:w-auto sm:flex-auto", e),
|
|
725
|
+
"data-slot": "data-table-toolbar-left",
|
|
726
|
+
children: a
|
|
727
|
+
});
|
|
981
728
|
}
|
|
982
|
-
|
|
983
|
-
function
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
{
|
|
990
|
-
className: h(
|
|
991
|
-
"flex w-full items-center justify-end gap-2 sm:w-auto",
|
|
992
|
-
e
|
|
993
|
-
),
|
|
994
|
-
"data-slot": "data-table-toolbar-right",
|
|
995
|
-
children: a
|
|
996
|
-
}
|
|
997
|
-
);
|
|
729
|
+
pt.displayName = "DataTableToolbarLeft";
|
|
730
|
+
function bt({ className: e, children: a }) {
|
|
731
|
+
return /* @__PURE__ */ t("div", {
|
|
732
|
+
className: h("flex w-full items-center justify-end gap-2 sm:ml-auto sm:w-auto", e),
|
|
733
|
+
"data-slot": "data-table-toolbar-right",
|
|
734
|
+
children: a
|
|
735
|
+
});
|
|
998
736
|
}
|
|
999
|
-
|
|
737
|
+
bt.displayName = "DataTableToolbarRight";
|
|
1000
738
|
export {
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
739
|
+
Je as DataTable,
|
|
740
|
+
dt as DataTableBulkActions,
|
|
741
|
+
gt as DataTableBulkActionsActions,
|
|
742
|
+
ut as DataTableBulkActionsSummary,
|
|
743
|
+
tt as DataTableColumnHeader,
|
|
744
|
+
st as DataTableExpandRowButton,
|
|
745
|
+
it as DataTableExpandedSkeleton,
|
|
746
|
+
ot as DataTablePagination,
|
|
747
|
+
be as DataTablePaginationNav,
|
|
748
|
+
K as DataTablePaginationRowCount,
|
|
749
|
+
at as DataTableSearch,
|
|
750
|
+
lt as DataTableSelectAllCheckbox,
|
|
751
|
+
rt as DataTableSelectRowCheckbox,
|
|
752
|
+
ft as DataTableToolbar,
|
|
753
|
+
pt as DataTableToolbarLeft,
|
|
754
|
+
bt as DataTableToolbarRight,
|
|
755
|
+
et as VirtualizedDataTable,
|
|
756
|
+
Mt as useDataTable,
|
|
757
|
+
ct as useDataTableBulkActionsContext,
|
|
758
|
+
nt as useDataTablePagination
|
|
1020
759
|
};
|