@krak-stack/registry 0.11.4 → 0.11.6
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/CHANGELOG.md +23 -1
- package/README.md +23 -9
- package/dist/components/agent/react.js +226 -1072
- package/dist/components/app-switcher/html.js +10 -53
- package/dist/components/app-switcher/react.js +29 -139
- package/dist/components/async-action-button/html.js +3 -34
- package/dist/components/async-action-button/react.d.ts +1 -1
- package/dist/components/async-action-button/react.js +8 -54
- package/dist/components/audit-log-table/react.js +706 -1279
- package/dist/components/bulk-list-input/html.js +3 -40
- package/dist/components/bulk-list-input/react.d.ts +1 -1
- package/dist/components/bulk-list-input/react.js +6 -59
- package/dist/components/code-block/html.js +1 -35
- package/dist/components/code-block/react.js +12 -59
- package/dist/components/color-input/html.js +2 -19
- package/dist/components/color-input/react.js +6 -97
- package/dist/components/copy-button/html.js +1 -35
- package/dist/components/copy-button/react.d.ts +1 -1
- package/dist/components/copy-button/react.js +7 -54
- package/dist/components/copy-value/html.js +11 -52
- package/dist/components/copy-value/react.js +25 -165
- package/dist/components/cron-input/html.js +2 -18
- package/dist/components/cron-input/react.js +15 -30
- package/dist/components/danger-confirmation/html.js +11 -57
- package/dist/components/danger-confirmation/react.js +26 -187
- package/dist/components/data-table/classes.d.ts +9 -3
- package/dist/components/data-table/html.d.ts +93 -21
- package/dist/components/data-table/html.js +309 -196
- package/dist/components/data-table/index.d.ts +97 -9
- package/dist/components/data-table/react.d.ts +14 -3
- package/dist/components/data-table/react.js +700 -1273
- package/dist/components/data-table/schema.d.ts +175 -16
- package/dist/components/date-input/html.js +19 -74
- package/dist/components/date-input/react.d.ts +1 -1
- package/dist/components/date-input/react.js +28 -313
- package/dist/components/docs/classes.d.ts +15 -0
- package/dist/components/docs/html.d.ts +55 -0
- package/dist/components/docs/html.js +837 -0
- package/dist/components/docs/index.d.ts +49 -0
- package/dist/components/docs/react.d.ts +10 -0
- package/dist/components/docs/react.js +949 -0
- package/dist/components/docs/schema.d.ts +49 -0
- package/dist/components/editable-text/html.js +6 -52
- package/dist/components/editable-text/react.js +13 -83
- package/dist/components/editing-locale-switcher/html.d.ts +2 -2
- package/dist/components/editing-locale-switcher/html.js +13 -43
- package/dist/components/editing-locale-switcher/react.js +17 -141
- package/dist/components/effect-form/react.js +249 -812
- package/dist/components/email-composer/react.js +62 -279
- package/dist/components/email-editor/html.js +13 -58
- package/dist/components/email-editor/react.js +187 -483
- package/dist/components/error-component/html.js +2 -47
- package/dist/components/error-component/react.js +33 -137
- package/dist/components/file-input/html.js +9 -40
- package/dist/components/file-input/react.js +39 -208
- package/dist/components/form/react.js +212 -777
- package/dist/components/icon-input/html.js +9 -56
- package/dist/components/icon-input/react.js +43 -143
- package/dist/components/image-crop-editor/html.js +1 -35
- package/dist/components/image-crop-editor/react.js +21 -66
- package/dist/components/locale-switcher/html.js +8 -55
- package/dist/components/locale-switcher/react.js +21 -146
- package/dist/components/map-menu/html.d.ts +8 -8
- package/dist/components/map-menu/html.js +13 -72
- package/dist/components/map-menu/react.js +92 -309
- package/dist/components/markdown/html.js +1 -35
- package/dist/components/markdown/react.js +20 -64
- package/dist/components/notification-menu/html.js +14 -50
- package/dist/components/notification-menu/react.js +73 -343
- package/dist/components/pagination/html.js +17 -73
- package/dist/components/pagination/react.js +37 -200
- package/dist/components/phone-number-input/html.js +19 -57
- package/dist/components/phone-number-input/react.d.ts +1 -1
- package/dist/components/phone-number-input/react.js +43 -142
- package/dist/components/presence-transition/index.d.ts +2 -2
- package/dist/components/registry-previews/component-example.js +26 -126
- package/dist/components/rich-text-editor/html.d.ts +12 -12
- package/dist/components/rich-text-editor/html.js +12 -85
- package/dist/components/rich-text-editor/react.js +55 -272
- package/dist/components/search-menu/classes.d.ts +2 -0
- package/dist/components/search-menu/html.d.ts +2 -0
- package/dist/components/search-menu/html.js +40 -73
- package/dist/components/search-menu/index.d.ts +27 -2
- package/dist/components/search-menu/react.d.ts +1 -1
- package/dist/components/search-menu/react.js +59 -280
- package/dist/components/search-menu/schema.d.ts +1 -0
- package/dist/components/select-with-custom-input/html.d.ts +2 -2
- package/dist/components/select-with-custom-input/html.js +13 -48
- package/dist/components/select-with-custom-input/react.js +22 -146
- package/dist/components/sidebar-layout/html.d.ts +16 -6
- package/dist/components/sidebar-layout/html.js +83 -69
- package/dist/components/sidebar-layout/index.d.ts +16 -0
- package/dist/components/sidebar-layout/react.js +105 -698
- package/dist/components/stats-card/react.js +13 -58
- package/dist/components/support/html.js +14 -69
- package/dist/components/support/react.js +74 -320
- package/dist/components/theme-switcher/html.js +11 -55
- package/dist/components/theme-switcher/react.js +28 -152
- package/dist/components/time-input/html.d.ts +2 -2
- package/dist/components/time-input/html.js +8 -53
- package/dist/components/time-input/react.js +34 -188
- package/dist/components/timezone-input/html.js +11 -67
- package/dist/components/timezone-input/react.js +41 -143
- package/dist/components/toast/html.d.ts +6 -6
- package/dist/components/toast/html.js +13 -46
- package/dist/components/tracking-notice/react.js +39 -188
- package/dist/components/unsaved-changes-guard/html.js +9 -43
- package/dist/components/unsaved-changes-guard/react.js +19 -169
- package/dist/components/upload-attachment/html.d.ts +4 -4
- package/dist/components/upload-attachment/html.js +4 -35
- package/dist/components/upload-attachment/react.js +25 -164
- package/dist/components/virtualized-combobox/html.js +10 -35
- package/dist/components/virtualized-combobox/react.js +28 -129
- package/dist/components/webhook-delivery-table/html.js +320 -206
- package/dist/components/webhook-delivery-table/react.js +736 -1376
- package/dist/lib/docs.integrations.server.js +150 -202
- package/dist/lib/docs.js +305 -1085
- package/dist/lib/docs.server.js +134 -186
- package/dist/lib/documentation-toolkit.js +144 -196
- package/dist/services/agent/client/index.js +226 -1072
- package/dist/services/notification/client/index.js +73 -343
- package/dist/services/notification/public.js +73 -343
- package/package.json +5 -13
- package/dist/components/effectcn/alert-dialog.d.ts +0 -13
- package/dist/components/effectcn/button.d.ts +0 -31
- package/dist/components/effectcn/calendar.d.ts +0 -12
- package/dist/components/effectcn/checkbox.d.ts +0 -10
- package/dist/components/effectcn/combobox.d.ts +0 -25
- package/dist/components/effectcn/dialog.d.ts +0 -19
- package/dist/components/effectcn/field.d.ts +0 -11
- package/dist/components/effectcn/file-drop.d.ts +0 -8
- package/dist/components/effectcn/input.d.ts +0 -26
- package/dist/components/effectcn/menu.d.ts +0 -85
- package/dist/components/effectcn/menubar.d.ts +0 -8
- package/dist/components/effectcn/popover.d.ts +0 -18
- package/dist/components/effectcn/scroll-area.d.ts +0 -12
- package/dist/components/effectcn/select.d.ts +0 -68
- package/dist/components/effectcn/toast.d.ts +0 -29
- package/dist/components/ui/alert-dialog.d.ts +0 -18
- package/dist/components/ui/alert.d.ts +0 -10
- package/dist/components/ui/attachment.d.ts +0 -23
- package/dist/components/ui/badge.d.ts +0 -7
- package/dist/components/ui/bubble.d.ts +0 -16
- package/dist/components/ui/button.d.ts +0 -8
- package/dist/components/ui/calendar.d.ts +0 -10
- package/dist/components/ui/card.d.ts +0 -11
- package/dist/components/ui/checkbox.d.ts +0 -3
- package/dist/components/ui/collapsible.d.ts +0 -5
- package/dist/components/ui/command.d.ts +0 -18
- package/dist/components/ui/dialog.d.ts +0 -17
- package/dist/components/ui/dropdown-menu.d.ts +0 -29
- package/dist/components/ui/empty.d.ts +0 -11
- package/dist/components/ui/field.d.ts +0 -24
- package/dist/components/ui/input-group.d.ts +0 -17
- package/dist/components/ui/input.d.ts +0 -3
- package/dist/components/ui/item.d.ts +0 -22
- package/dist/components/ui/label.d.ts +0 -3
- package/dist/components/ui/menubar.d.ts +0 -29
- package/dist/components/ui/message-scroller.d.ts +0 -10
- package/dist/components/ui/message.d.ts +0 -10
- package/dist/components/ui/popover.d.ts +0 -9
- package/dist/components/ui/scroll-area.d.ts +0 -4
- package/dist/components/ui/select.d.ts +0 -15
- package/dist/components/ui/select.js +0 -159
- package/dist/components/ui/separator.d.ts +0 -3
- package/dist/components/ui/sheet.d.ts +0 -14
- package/dist/components/ui/sidebar.d.ts +0 -63
- package/dist/components/ui/skeleton.d.ts +0 -2
- package/dist/components/ui/table.d.ts +0 -10
- package/dist/components/ui/tabs.d.ts +0 -10
- package/dist/components/ui/textarea.d.ts +0 -3
- package/dist/components/ui/tooltip.d.ts +0 -6
- package/dist/components/ui/trace.d.ts +0 -18
- package/dist/lib/effectcn-form.d.ts +0 -3
- package/dist/lib/effectcn-form.js +0 -54
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// ../../src/components/data-table/react.tsx
|
|
2
|
-
import { ScrollArea as
|
|
2
|
+
import { ScrollArea as ScrollAreaPrimitive } from "@base-ui/react/scroll-area";
|
|
3
3
|
import { useVirtualizer, useWindowVirtualizer } from "@tanstack/react-virtual";
|
|
4
4
|
import { Formatter, Option as Option4, Schema as Schema6 } from "effect";
|
|
5
5
|
import { Component as Component3, View } from "effect/ui";
|
|
@@ -34,479 +34,46 @@ import {
|
|
|
34
34
|
useEffect,
|
|
35
35
|
useId as useId2,
|
|
36
36
|
useLayoutEffect,
|
|
37
|
-
useMemo
|
|
37
|
+
useMemo,
|
|
38
38
|
useRef,
|
|
39
39
|
useState,
|
|
40
40
|
useSyncExternalStore
|
|
41
41
|
} from "react";
|
|
42
42
|
import { createPortal } from "react-dom";
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
className,
|
|
70
|
-
variant = "default",
|
|
71
|
-
render,
|
|
72
|
-
...props
|
|
73
|
-
}) {
|
|
74
|
-
return useRender({
|
|
75
|
-
defaultTagName: "span",
|
|
76
|
-
props: mergeProps({
|
|
77
|
-
className: cn(badgeVariants({ variant }), className)
|
|
78
|
-
}, props),
|
|
79
|
-
render,
|
|
80
|
-
state: {
|
|
81
|
-
slot: "badge",
|
|
82
|
-
variant
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// ../../src/components/ui/button.tsx
|
|
88
|
-
import { Button as ButtonPrimitive } from "@base-ui/react/button";
|
|
89
|
-
import { cva as cva2 } from "class-variance-authority";
|
|
90
|
-
import { jsx } from "react/jsx-runtime";
|
|
91
|
-
var buttonVariants = cva2("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
92
|
-
variants: {
|
|
93
|
-
variant: {
|
|
94
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
95
|
-
outline: "border-border bg-background shadow-xs hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
|
96
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
97
|
-
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
98
|
-
destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
|
|
99
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
100
|
-
},
|
|
101
|
-
size: {
|
|
102
|
-
default: "h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
103
|
-
xs: "h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
104
|
-
sm: "h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",
|
|
105
|
-
lg: "h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
106
|
-
icon: "size-9",
|
|
107
|
-
"icon-xs": "size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3",
|
|
108
|
-
"icon-sm": "size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md",
|
|
109
|
-
"icon-lg": "size-10"
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
defaultVariants: {
|
|
113
|
-
variant: "default",
|
|
114
|
-
size: "default"
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
function Button({
|
|
118
|
-
className,
|
|
119
|
-
variant = "default",
|
|
120
|
-
size = "default",
|
|
121
|
-
...props
|
|
122
|
-
}) {
|
|
123
|
-
return /* @__PURE__ */ jsx(ButtonPrimitive, {
|
|
124
|
-
"data-slot": "button",
|
|
125
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
126
|
-
...props
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
// ../../src/components/ui/card.tsx
|
|
131
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
132
|
-
function Card({
|
|
133
|
-
className,
|
|
134
|
-
size = "default",
|
|
135
|
-
...props
|
|
136
|
-
}) {
|
|
137
|
-
return /* @__PURE__ */ jsx2("div", {
|
|
138
|
-
"data-slot": "card",
|
|
139
|
-
"data-size": size,
|
|
140
|
-
className: cn("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground shadow-xs ring-1 ring-foreground/10 [--card-spacing:--spacing(6)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl", className),
|
|
141
|
-
...props
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
function CardHeader({ className, ...props }) {
|
|
145
|
-
return /* @__PURE__ */ jsx2("div", {
|
|
146
|
-
"data-slot": "card-header",
|
|
147
|
-
className: cn("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)", className),
|
|
148
|
-
...props
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
function CardTitle({ className, ...props }) {
|
|
152
|
-
return /* @__PURE__ */ jsx2("div", {
|
|
153
|
-
"data-slot": "card-title",
|
|
154
|
-
className: cn("text-base leading-normal font-medium group-data-[size=sm]/card:text-sm", className),
|
|
155
|
-
...props
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
// ../../src/components/ui/checkbox.tsx
|
|
160
|
-
import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox";
|
|
161
|
-
import { CheckIcon } from "lucide-react";
|
|
162
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
163
|
-
"use client";
|
|
164
|
-
function Checkbox({ className, ...props }) {
|
|
165
|
-
return /* @__PURE__ */ jsx3(CheckboxPrimitive.Root, {
|
|
166
|
-
"data-slot": "checkbox",
|
|
167
|
-
className: cn("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input shadow-xs transition-shadow outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary", className),
|
|
168
|
-
...props,
|
|
169
|
-
children: /* @__PURE__ */ jsx3(CheckboxPrimitive.Indicator, {
|
|
170
|
-
"data-slot": "checkbox-indicator",
|
|
171
|
-
className: "grid place-content-center text-current transition-none [&>svg]:size-3.5",
|
|
172
|
-
children: /* @__PURE__ */ jsx3(CheckIcon, {})
|
|
173
|
-
})
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
// ../../src/components/ui/dropdown-menu.tsx
|
|
178
|
-
import { Menu as MenuPrimitive } from "@base-ui/react/menu";
|
|
179
|
-
import { ChevronRightIcon, CheckIcon as CheckIcon2 } from "lucide-react";
|
|
180
|
-
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
181
|
-
function DropdownMenu({ ...props }) {
|
|
182
|
-
return /* @__PURE__ */ jsx4(MenuPrimitive.Root, {
|
|
183
|
-
"data-slot": "dropdown-menu",
|
|
184
|
-
...props
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
function DropdownMenuTrigger({ ...props }) {
|
|
188
|
-
return /* @__PURE__ */ jsx4(MenuPrimitive.Trigger, {
|
|
189
|
-
"data-slot": "dropdown-menu-trigger",
|
|
190
|
-
...props
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
function DropdownMenuContent({
|
|
194
|
-
align = "start",
|
|
195
|
-
alignOffset = 0,
|
|
196
|
-
side = "bottom",
|
|
197
|
-
sideOffset = 4,
|
|
198
|
-
className,
|
|
199
|
-
...props
|
|
200
|
-
}) {
|
|
201
|
-
return /* @__PURE__ */ jsx4(MenuPrimitive.Portal, {
|
|
202
|
-
children: /* @__PURE__ */ jsx4(MenuPrimitive.Positioner, {
|
|
203
|
-
className: "isolate z-50 outline-none",
|
|
204
|
-
align,
|
|
205
|
-
alignOffset,
|
|
206
|
-
side,
|
|
207
|
-
sideOffset,
|
|
208
|
-
children: /* @__PURE__ */ jsx4(MenuPrimitive.Popup, {
|
|
209
|
-
"data-slot": "dropdown-menu-content",
|
|
210
|
-
className: cn("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
211
|
-
...props
|
|
212
|
-
})
|
|
213
|
-
})
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
function DropdownMenuGroup({ ...props }) {
|
|
217
|
-
return /* @__PURE__ */ jsx4(MenuPrimitive.Group, {
|
|
218
|
-
"data-slot": "dropdown-menu-group",
|
|
219
|
-
...props
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
function DropdownMenuLabel({
|
|
223
|
-
className,
|
|
224
|
-
inset,
|
|
225
|
-
...props
|
|
226
|
-
}) {
|
|
227
|
-
return /* @__PURE__ */ jsx4(MenuPrimitive.GroupLabel, {
|
|
228
|
-
"data-slot": "dropdown-menu-label",
|
|
229
|
-
"data-inset": inset,
|
|
230
|
-
className: cn("px-2 py-1.5 text-xs font-medium text-muted-foreground data-inset:pl-8", className),
|
|
231
|
-
...props
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
function DropdownMenuItem({
|
|
235
|
-
className,
|
|
236
|
-
inset,
|
|
237
|
-
variant = "default",
|
|
238
|
-
...props
|
|
239
|
-
}) {
|
|
240
|
-
return /* @__PURE__ */ jsx4(MenuPrimitive.Item, {
|
|
241
|
-
"data-slot": "dropdown-menu-item",
|
|
242
|
-
"data-inset": inset,
|
|
243
|
-
"data-variant": variant,
|
|
244
|
-
className: cn("group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive", className),
|
|
245
|
-
...props
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
function DropdownMenuSub({ ...props }) {
|
|
249
|
-
return /* @__PURE__ */ jsx4(MenuPrimitive.SubmenuRoot, {
|
|
250
|
-
"data-slot": "dropdown-menu-sub",
|
|
251
|
-
...props
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
function DropdownMenuSubTrigger({
|
|
255
|
-
className,
|
|
256
|
-
inset,
|
|
257
|
-
children,
|
|
258
|
-
...props
|
|
259
|
-
}) {
|
|
260
|
-
return /* @__PURE__ */ jsxs(MenuPrimitive.SubmenuTrigger, {
|
|
261
|
-
"data-slot": "dropdown-menu-sub-trigger",
|
|
262
|
-
"data-inset": inset,
|
|
263
|
-
className: cn("flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-8 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
264
|
-
...props,
|
|
265
|
-
children: [
|
|
266
|
-
children,
|
|
267
|
-
/* @__PURE__ */ jsx4(ChevronRightIcon, {
|
|
268
|
-
className: "ml-auto"
|
|
269
|
-
})
|
|
270
|
-
]
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
function DropdownMenuSubContent({
|
|
274
|
-
align = "start",
|
|
275
|
-
alignOffset = -3,
|
|
276
|
-
side = "right",
|
|
277
|
-
sideOffset = 0,
|
|
278
|
-
className,
|
|
279
|
-
...props
|
|
280
|
-
}) {
|
|
281
|
-
return /* @__PURE__ */ jsx4(DropdownMenuContent, {
|
|
282
|
-
"data-slot": "dropdown-menu-sub-content",
|
|
283
|
-
className: cn("w-auto min-w-[96px] rounded-md bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
284
|
-
align,
|
|
285
|
-
alignOffset,
|
|
286
|
-
side,
|
|
287
|
-
sideOffset,
|
|
288
|
-
...props
|
|
289
|
-
});
|
|
290
|
-
}
|
|
291
|
-
function DropdownMenuRadioGroup({ ...props }) {
|
|
292
|
-
return /* @__PURE__ */ jsx4(MenuPrimitive.RadioGroup, {
|
|
293
|
-
"data-slot": "dropdown-menu-radio-group",
|
|
294
|
-
...props
|
|
295
|
-
});
|
|
296
|
-
}
|
|
297
|
-
function DropdownMenuSeparator({
|
|
298
|
-
className,
|
|
299
|
-
...props
|
|
300
|
-
}) {
|
|
301
|
-
return /* @__PURE__ */ jsx4(MenuPrimitive.Separator, {
|
|
302
|
-
"data-slot": "dropdown-menu-separator",
|
|
303
|
-
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
304
|
-
...props
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
// ../../src/components/ui/input.tsx
|
|
309
|
-
import { Input as InputPrimitive } from "@base-ui/react/input";
|
|
310
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
311
|
-
function Input({ className, type, ...props }) {
|
|
312
|
-
return /* @__PURE__ */ jsx5(InputPrimitive, {
|
|
313
|
-
type,
|
|
314
|
-
"data-slot": "input",
|
|
315
|
-
className: cn("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className),
|
|
316
|
-
...props
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
// ../../src/components/ui/field.tsx
|
|
321
|
-
import { useMemo } from "react";
|
|
322
|
-
import { cva as cva3 } from "class-variance-authority";
|
|
323
|
-
|
|
324
|
-
// ../../src/components/ui/label.tsx
|
|
325
|
-
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
326
|
-
"use client";
|
|
327
|
-
function Label({ className, ...props }) {
|
|
328
|
-
return /* @__PURE__ */ jsx6("label", {
|
|
329
|
-
"data-slot": "label",
|
|
330
|
-
className: cn("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", className),
|
|
331
|
-
...props
|
|
332
|
-
});
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
// ../../src/components/ui/separator.tsx
|
|
336
|
-
import { Separator as SeparatorPrimitive } from "@base-ui/react/separator";
|
|
337
|
-
|
|
338
|
-
// ../../src/components/ui/field.tsx
|
|
339
|
-
import { jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
340
|
-
function FieldGroup({ className, ...props }) {
|
|
341
|
-
return /* @__PURE__ */ jsx7("div", {
|
|
342
|
-
"data-slot": "field-group",
|
|
343
|
-
className: cn("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4", className),
|
|
344
|
-
...props
|
|
345
|
-
});
|
|
346
|
-
}
|
|
347
|
-
var fieldVariants = cva3("group/field flex w-full gap-3 data-[invalid=true]:text-destructive", {
|
|
348
|
-
variants: {
|
|
349
|
-
orientation: {
|
|
350
|
-
vertical: "flex-col *:w-full [&>.sr-only]:w-auto",
|
|
351
|
-
horizontal: "flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
352
|
-
responsive: "flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
353
|
-
}
|
|
354
|
-
},
|
|
355
|
-
defaultVariants: {
|
|
356
|
-
orientation: "vertical"
|
|
357
|
-
}
|
|
358
|
-
});
|
|
359
|
-
function Field({
|
|
360
|
-
className,
|
|
361
|
-
orientation = "vertical",
|
|
362
|
-
...props
|
|
363
|
-
}) {
|
|
364
|
-
return /* @__PURE__ */ jsx7("div", {
|
|
365
|
-
role: "group",
|
|
366
|
-
"data-slot": "field",
|
|
367
|
-
"data-orientation": orientation,
|
|
368
|
-
className: cn(fieldVariants({ orientation }), className),
|
|
369
|
-
...props
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
function FieldLabel({
|
|
373
|
-
className,
|
|
374
|
-
...props
|
|
375
|
-
}) {
|
|
376
|
-
return /* @__PURE__ */ jsx7(Label, {
|
|
377
|
-
"data-slot": "field-label",
|
|
378
|
-
className: cn("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border *:data-[slot=field]:p-3 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col", className),
|
|
379
|
-
...props
|
|
380
|
-
});
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
// ../../src/components/ui/select.tsx
|
|
384
|
-
import { Select as SelectPrimitive } from "@base-ui/react/select";
|
|
385
|
-
import { ChevronDownIcon, CheckIcon as CheckIcon3, ChevronUpIcon } from "lucide-react";
|
|
386
|
-
import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
387
|
-
"use client";
|
|
388
|
-
var Select = SelectPrimitive.Root;
|
|
389
|
-
function SelectGroup({ className, ...props }) {
|
|
390
|
-
return /* @__PURE__ */ jsx8(SelectPrimitive.Group, {
|
|
391
|
-
"data-slot": "select-group",
|
|
392
|
-
className: cn("scroll-my-1 p-1", className),
|
|
393
|
-
...props
|
|
394
|
-
});
|
|
395
|
-
}
|
|
396
|
-
function SelectValue({ className, ...props }) {
|
|
397
|
-
return /* @__PURE__ */ jsx8(SelectPrimitive.Value, {
|
|
398
|
-
"data-slot": "select-value",
|
|
399
|
-
className: cn("flex flex-1 text-left", className),
|
|
400
|
-
...props
|
|
401
|
-
});
|
|
402
|
-
}
|
|
403
|
-
function SelectTrigger({
|
|
404
|
-
className,
|
|
405
|
-
size = "default",
|
|
406
|
-
children,
|
|
407
|
-
...props
|
|
408
|
-
}) {
|
|
409
|
-
return /* @__PURE__ */ jsxs3(SelectPrimitive.Trigger, {
|
|
410
|
-
"data-slot": "select-trigger",
|
|
411
|
-
"data-size": size,
|
|
412
|
-
className: cn("border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 flex w-fit items-center justify-between gap-1.5 rounded-md border bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
413
|
-
...props,
|
|
414
|
-
children: [
|
|
415
|
-
children,
|
|
416
|
-
/* @__PURE__ */ jsx8(SelectPrimitive.Icon, {
|
|
417
|
-
render: /* @__PURE__ */ jsx8(ChevronDownIcon, {
|
|
418
|
-
className: "text-muted-foreground pointer-events-none size-4"
|
|
419
|
-
})
|
|
420
|
-
})
|
|
421
|
-
]
|
|
422
|
-
});
|
|
423
|
-
}
|
|
424
|
-
function SelectContent({
|
|
425
|
-
className,
|
|
426
|
-
children,
|
|
427
|
-
side = "bottom",
|
|
428
|
-
sideOffset = 4,
|
|
429
|
-
align = "start",
|
|
430
|
-
alignOffset = 0,
|
|
431
|
-
alignItemWithTrigger = false,
|
|
432
|
-
...props
|
|
433
|
-
}) {
|
|
434
|
-
return /* @__PURE__ */ jsx8(SelectPrimitive.Portal, {
|
|
435
|
-
children: /* @__PURE__ */ jsx8(SelectPrimitive.Positioner, {
|
|
436
|
-
side,
|
|
437
|
-
sideOffset,
|
|
438
|
-
align,
|
|
439
|
-
alignOffset,
|
|
440
|
-
alignItemWithTrigger,
|
|
441
|
-
className: "isolate z-50",
|
|
442
|
-
children: /* @__PURE__ */ jsxs3(SelectPrimitive.Popup, {
|
|
443
|
-
"data-slot": "select-content",
|
|
444
|
-
"data-align-trigger": alignItemWithTrigger,
|
|
445
|
-
className: cn("bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-0 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md shadow-md ring-1 duration-100 data-[align-trigger=true]:animate-none", className),
|
|
446
|
-
...props,
|
|
447
|
-
children: [
|
|
448
|
-
/* @__PURE__ */ jsx8(SelectScrollUpButton, {}),
|
|
449
|
-
/* @__PURE__ */ jsx8(SelectPrimitive.List, {
|
|
450
|
-
children
|
|
451
|
-
}),
|
|
452
|
-
/* @__PURE__ */ jsx8(SelectScrollDownButton, {})
|
|
453
|
-
]
|
|
454
|
-
})
|
|
455
|
-
})
|
|
456
|
-
});
|
|
457
|
-
}
|
|
458
|
-
function SelectItem({
|
|
459
|
-
className,
|
|
460
|
-
children,
|
|
461
|
-
...props
|
|
462
|
-
}) {
|
|
463
|
-
return /* @__PURE__ */ jsxs3(SelectPrimitive.Item, {
|
|
464
|
-
"data-slot": "select-item",
|
|
465
|
-
className: cn("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
|
|
466
|
-
...props,
|
|
467
|
-
children: [
|
|
468
|
-
/* @__PURE__ */ jsx8(SelectPrimitive.ItemText, {
|
|
469
|
-
className: "flex flex-1 shrink-0 gap-2 whitespace-nowrap",
|
|
470
|
-
children
|
|
471
|
-
}),
|
|
472
|
-
/* @__PURE__ */ jsx8(SelectPrimitive.ItemIndicator, {
|
|
473
|
-
render: /* @__PURE__ */ jsx8("span", {
|
|
474
|
-
className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center"
|
|
475
|
-
}),
|
|
476
|
-
children: /* @__PURE__ */ jsx8(CheckIcon3, {
|
|
477
|
-
className: "pointer-events-none"
|
|
478
|
-
})
|
|
479
|
-
})
|
|
480
|
-
]
|
|
481
|
-
});
|
|
482
|
-
}
|
|
483
|
-
function SelectScrollUpButton({
|
|
484
|
-
className,
|
|
485
|
-
...props
|
|
486
|
-
}) {
|
|
487
|
-
return /* @__PURE__ */ jsx8(SelectPrimitive.ScrollUpArrow, {
|
|
488
|
-
"data-slot": "select-scroll-up-button",
|
|
489
|
-
className: cn("bg-popover top-0 z-10 flex w-full cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4", className),
|
|
490
|
-
...props,
|
|
491
|
-
children: /* @__PURE__ */ jsx8(ChevronUpIcon, {})
|
|
492
|
-
});
|
|
493
|
-
}
|
|
494
|
-
function SelectScrollDownButton({
|
|
495
|
-
className,
|
|
496
|
-
...props
|
|
497
|
-
}) {
|
|
498
|
-
return /* @__PURE__ */ jsx8(SelectPrimitive.ScrollDownArrow, {
|
|
499
|
-
"data-slot": "select-scroll-down-button",
|
|
500
|
-
className: cn("bg-popover bottom-0 z-10 flex w-full cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4", className),
|
|
501
|
-
...props,
|
|
502
|
-
children: /* @__PURE__ */ jsx8(ChevronDownIcon, {})
|
|
503
|
-
});
|
|
504
|
-
}
|
|
43
|
+
import { Badge } from "@/components/ui/badge";
|
|
44
|
+
import { Button as Button2 } from "@/components/ui/button";
|
|
45
|
+
import { Card, CardHeader, CardTitle } from "@/components/ui/card";
|
|
46
|
+
import { Checkbox } from "@/components/ui/checkbox";
|
|
47
|
+
import {
|
|
48
|
+
DropdownMenu,
|
|
49
|
+
DropdownMenuContent as PrimitiveDropdownMenuContent,
|
|
50
|
+
DropdownMenuGroup,
|
|
51
|
+
DropdownMenuItem as PrimitiveDropdownMenuItem,
|
|
52
|
+
DropdownMenuLabel as PrimitiveDropdownMenuLabel,
|
|
53
|
+
DropdownMenuSeparator as PrimitiveDropdownMenuSeparator,
|
|
54
|
+
DropdownMenuSub,
|
|
55
|
+
DropdownMenuSubContent as PrimitiveDropdownMenuSubContent,
|
|
56
|
+
DropdownMenuSubTrigger as PrimitiveDropdownMenuSubTrigger,
|
|
57
|
+
DropdownMenuTrigger as PrimitiveDropdownMenuTrigger
|
|
58
|
+
} from "@/components/ui/dropdown-menu";
|
|
59
|
+
import { Input as PrimitiveInput } from "@/components/ui/input";
|
|
60
|
+
import { Field, FieldGroup, FieldLabel } from "@/components/ui/field";
|
|
61
|
+
import {
|
|
62
|
+
Select as Select2,
|
|
63
|
+
SelectContent as PrimitiveSelectContent,
|
|
64
|
+
SelectGroup,
|
|
65
|
+
SelectItem as SelectItem2,
|
|
66
|
+
SelectTrigger as SelectTrigger2,
|
|
67
|
+
SelectValue as SelectValue2
|
|
68
|
+
} from "@/components/ui/select";
|
|
505
69
|
|
|
506
70
|
// ../../src/components/loading/react.tsx
|
|
507
71
|
import { Loader2 } from "lucide-react";
|
|
508
72
|
import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider/react";
|
|
509
73
|
|
|
74
|
+
// ../../src/lib/utils.ts
|
|
75
|
+
import { cn } from "cn";
|
|
76
|
+
|
|
510
77
|
// ../../src/components/loading/classes.ts
|
|
511
78
|
var resolveLoadingClasses = ({
|
|
512
79
|
classes,
|
|
@@ -525,7 +92,7 @@ var labels = {
|
|
|
525
92
|
var loadingLabel = (locale, messages) => messages?.[locale]?.loading ?? messages?.[locale.split("-")[0] ?? locale]?.loading ?? (locale.startsWith("fr") ? labels.fr : labels.en);
|
|
526
93
|
|
|
527
94
|
// ../../src/components/loading/react.tsx
|
|
528
|
-
import { jsx
|
|
95
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
529
96
|
function Loading({
|
|
530
97
|
className,
|
|
531
98
|
classes,
|
|
@@ -536,11 +103,11 @@ function Loading({
|
|
|
536
103
|
}) {
|
|
537
104
|
const locale = useKrakstackLocale(localeOverride);
|
|
538
105
|
const slots = resolveLoadingClasses({ classes, variant, className });
|
|
539
|
-
return /* @__PURE__ */
|
|
106
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
540
107
|
role: "status",
|
|
541
108
|
className: slots.root,
|
|
542
109
|
children: [
|
|
543
|
-
/* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ jsx(Loader2, {
|
|
544
111
|
"aria-hidden": "true",
|
|
545
112
|
className: slots.icon
|
|
546
113
|
}),
|
|
@@ -548,179 +115,23 @@ function Loading({
|
|
|
548
115
|
]
|
|
549
116
|
});
|
|
550
117
|
}
|
|
551
|
-
// ../../src/components/
|
|
552
|
-
import {
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
});
|
|
569
|
-
}
|
|
570
|
-
function MenubarGroup({
|
|
571
|
-
...props
|
|
572
|
-
}) {
|
|
573
|
-
return /* @__PURE__ */ jsx10(DropdownMenuGroup, {
|
|
574
|
-
"data-slot": "menubar-group",
|
|
575
|
-
...props
|
|
576
|
-
});
|
|
577
|
-
}
|
|
578
|
-
function MenubarTrigger({
|
|
579
|
-
className,
|
|
580
|
-
...props
|
|
581
|
-
}) {
|
|
582
|
-
return /* @__PURE__ */ jsx10(DropdownMenuTrigger, {
|
|
583
|
-
"data-slot": "menubar-trigger",
|
|
584
|
-
className: cn("flex items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none hover:bg-muted aria-expanded:bg-muted", className),
|
|
585
|
-
...props
|
|
586
|
-
});
|
|
587
|
-
}
|
|
588
|
-
function MenubarContent({
|
|
589
|
-
className,
|
|
590
|
-
align = "start",
|
|
591
|
-
alignOffset = -4,
|
|
592
|
-
sideOffset = 8,
|
|
593
|
-
...props
|
|
594
|
-
}) {
|
|
595
|
-
return /* @__PURE__ */ jsx10(DropdownMenuContent, {
|
|
596
|
-
"data-slot": "menubar-content",
|
|
597
|
-
align,
|
|
598
|
-
alignOffset,
|
|
599
|
-
sideOffset,
|
|
600
|
-
className: cn("min-w-36 rounded-md bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95", className),
|
|
601
|
-
...props
|
|
602
|
-
});
|
|
603
|
-
}
|
|
604
|
-
function MenubarItem({
|
|
605
|
-
className,
|
|
606
|
-
inset,
|
|
607
|
-
variant = "default",
|
|
608
|
-
...props
|
|
609
|
-
}) {
|
|
610
|
-
return /* @__PURE__ */ jsx10(DropdownMenuItem, {
|
|
611
|
-
"data-slot": "menubar-item",
|
|
612
|
-
"data-inset": inset,
|
|
613
|
-
"data-variant": variant,
|
|
614
|
-
className: cn("group/menubar-item gap-2 rounded-sm px-2 py-1.5 text-sm focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive!", className),
|
|
615
|
-
...props
|
|
616
|
-
});
|
|
617
|
-
}
|
|
618
|
-
function MenubarCheckboxItem({
|
|
619
|
-
className,
|
|
620
|
-
children,
|
|
621
|
-
checked,
|
|
622
|
-
inset,
|
|
623
|
-
...props
|
|
624
|
-
}) {
|
|
625
|
-
return /* @__PURE__ */ jsxs5(MenuPrimitive2.CheckboxItem, {
|
|
626
|
-
"data-slot": "menubar-checkbox-item",
|
|
627
|
-
"data-inset": inset,
|
|
628
|
-
className: cn("relative flex cursor-default items-center gap-2 rounded-md py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", className),
|
|
629
|
-
checked,
|
|
630
|
-
...props,
|
|
631
|
-
children: [
|
|
632
|
-
/* @__PURE__ */ jsx10("span", {
|
|
633
|
-
className: "pointer-events-none absolute left-2 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4",
|
|
634
|
-
children: /* @__PURE__ */ jsx10(MenuPrimitive2.CheckboxItemIndicator, {
|
|
635
|
-
children: /* @__PURE__ */ jsx10(CheckIcon4, {})
|
|
636
|
-
})
|
|
637
|
-
}),
|
|
638
|
-
children
|
|
639
|
-
]
|
|
640
|
-
});
|
|
641
|
-
}
|
|
642
|
-
function MenubarRadioGroup({
|
|
643
|
-
...props
|
|
644
|
-
}) {
|
|
645
|
-
return /* @__PURE__ */ jsx10(DropdownMenuRadioGroup, {
|
|
646
|
-
"data-slot": "menubar-radio-group",
|
|
647
|
-
...props
|
|
648
|
-
});
|
|
649
|
-
}
|
|
650
|
-
function MenubarRadioItem({
|
|
651
|
-
className,
|
|
652
|
-
children,
|
|
653
|
-
inset,
|
|
654
|
-
...props
|
|
655
|
-
}) {
|
|
656
|
-
return /* @__PURE__ */ jsxs5(MenuPrimitive2.RadioItem, {
|
|
657
|
-
"data-slot": "menubar-radio-item",
|
|
658
|
-
"data-inset": inset,
|
|
659
|
-
className: cn("relative flex cursor-default items-center gap-2 rounded-md py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
660
|
-
...props,
|
|
661
|
-
children: [
|
|
662
|
-
/* @__PURE__ */ jsx10("span", {
|
|
663
|
-
className: "pointer-events-none absolute left-2 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4",
|
|
664
|
-
children: /* @__PURE__ */ jsx10(MenuPrimitive2.RadioItemIndicator, {
|
|
665
|
-
children: /* @__PURE__ */ jsx10(CheckIcon4, {})
|
|
666
|
-
})
|
|
667
|
-
}),
|
|
668
|
-
children
|
|
669
|
-
]
|
|
670
|
-
});
|
|
671
|
-
}
|
|
672
|
-
function MenubarLabel({
|
|
673
|
-
className,
|
|
674
|
-
inset,
|
|
675
|
-
...props
|
|
676
|
-
}) {
|
|
677
|
-
return /* @__PURE__ */ jsx10(DropdownMenuLabel, {
|
|
678
|
-
"data-slot": "menubar-label",
|
|
679
|
-
"data-inset": inset,
|
|
680
|
-
className: cn("px-2 py-1.5 text-sm font-medium data-inset:pl-8", className),
|
|
681
|
-
...props
|
|
682
|
-
});
|
|
683
|
-
}
|
|
684
|
-
function MenubarSeparator({
|
|
685
|
-
className,
|
|
686
|
-
...props
|
|
687
|
-
}) {
|
|
688
|
-
return /* @__PURE__ */ jsx10(DropdownMenuSeparator, {
|
|
689
|
-
"data-slot": "menubar-separator",
|
|
690
|
-
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
691
|
-
...props
|
|
692
|
-
});
|
|
693
|
-
}
|
|
694
|
-
function MenubarSub({
|
|
695
|
-
...props
|
|
696
|
-
}) {
|
|
697
|
-
return /* @__PURE__ */ jsx10(DropdownMenuSub, {
|
|
698
|
-
"data-slot": "menubar-sub",
|
|
699
|
-
...props
|
|
700
|
-
});
|
|
701
|
-
}
|
|
702
|
-
function MenubarSubTrigger({
|
|
703
|
-
className,
|
|
704
|
-
inset,
|
|
705
|
-
...props
|
|
706
|
-
}) {
|
|
707
|
-
return /* @__PURE__ */ jsx10(DropdownMenuSubTrigger, {
|
|
708
|
-
"data-slot": "menubar-sub-trigger",
|
|
709
|
-
"data-inset": inset,
|
|
710
|
-
className: cn("gap-2 rounded-sm px-2 py-1.5 text-sm focus:bg-accent focus:text-accent-foreground data-inset:pl-8 data-open:bg-accent data-open:text-accent-foreground [&_svg:not([class*='size-'])]:size-4", className),
|
|
711
|
-
...props
|
|
712
|
-
});
|
|
713
|
-
}
|
|
714
|
-
function MenubarSubContent({
|
|
715
|
-
className,
|
|
716
|
-
...props
|
|
717
|
-
}) {
|
|
718
|
-
return /* @__PURE__ */ jsx10(DropdownMenuSubContent, {
|
|
719
|
-
"data-slot": "menubar-sub-content",
|
|
720
|
-
className: cn("min-w-32 rounded-md bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
721
|
-
...props
|
|
722
|
-
});
|
|
723
|
-
}
|
|
118
|
+
// ../../src/components/data-table/react.tsx
|
|
119
|
+
import {
|
|
120
|
+
Menubar as PrimitiveMenubar,
|
|
121
|
+
MenubarCheckboxItem as PrimitiveMenubarCheckboxItem,
|
|
122
|
+
MenubarContent as PrimitiveMenubarContent,
|
|
123
|
+
MenubarGroup,
|
|
124
|
+
MenubarItem as PrimitiveMenubarItem,
|
|
125
|
+
MenubarLabel as PrimitiveMenubarLabel,
|
|
126
|
+
MenubarMenu,
|
|
127
|
+
MenubarRadioGroup,
|
|
128
|
+
MenubarRadioItem as PrimitiveMenubarRadioItem,
|
|
129
|
+
MenubarSeparator as PrimitiveMenubarSeparator,
|
|
130
|
+
MenubarSub,
|
|
131
|
+
MenubarSubContent as PrimitiveMenubarSubContent,
|
|
132
|
+
MenubarSubTrigger as PrimitiveMenubarSubTrigger,
|
|
133
|
+
MenubarTrigger as PrimitiveMenubarTrigger
|
|
134
|
+
} from "@/components/ui/menubar";
|
|
724
135
|
|
|
725
136
|
// ../../src/components/pagination/react.tsx
|
|
726
137
|
import {
|
|
@@ -730,6 +141,15 @@ import {
|
|
|
730
141
|
ChevronsRight
|
|
731
142
|
} from "lucide-react";
|
|
732
143
|
import { useId } from "react";
|
|
144
|
+
import { Button } from "@/components/ui/button";
|
|
145
|
+
import { Label } from "@/components/ui/label";
|
|
146
|
+
import {
|
|
147
|
+
Select,
|
|
148
|
+
SelectContent,
|
|
149
|
+
SelectItem,
|
|
150
|
+
SelectTrigger,
|
|
151
|
+
SelectValue
|
|
152
|
+
} from "@/components/ui/select";
|
|
733
153
|
import { useKrakstackLocale as useKrakstackLocale2 } from "@krak-stack/registry/krakstack-provider/react";
|
|
734
154
|
|
|
735
155
|
// ../../src/components/pagination/classes.ts
|
|
@@ -856,7 +276,7 @@ var paginationNavigation = (page, pageCount) => ({
|
|
|
856
276
|
});
|
|
857
277
|
|
|
858
278
|
// ../../src/components/pagination/react.tsx
|
|
859
|
-
import { jsx as
|
|
279
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
860
280
|
function Pagination({
|
|
861
281
|
classes: classOverrides,
|
|
862
282
|
className,
|
|
@@ -880,33 +300,33 @@ function Pagination({
|
|
|
880
300
|
const pageSizeId = useId();
|
|
881
301
|
const navigation = paginationNavigation(page, pageCount);
|
|
882
302
|
const pageLabel = paginationPageLabel(page, pageCount, labels.pageOf);
|
|
883
|
-
return /* @__PURE__ */
|
|
303
|
+
return /* @__PURE__ */ jsxs2("div", {
|
|
884
304
|
"data-slot": "pagination",
|
|
885
305
|
className: cn(paginationClasses.root, compact && paginationClasses.compactRoot, className),
|
|
886
306
|
children: [
|
|
887
|
-
showResults ? /* @__PURE__ */
|
|
307
|
+
showResults ? /* @__PURE__ */ jsxs2("div", {
|
|
888
308
|
className: paginationClasses.summary,
|
|
889
309
|
children: [
|
|
890
|
-
/* @__PURE__ */
|
|
310
|
+
/* @__PURE__ */ jsx2("span", {
|
|
891
311
|
children: labels.results(totalRows)
|
|
892
312
|
}),
|
|
893
|
-
selectedRows > 0 ? /* @__PURE__ */
|
|
313
|
+
selectedRows > 0 ? /* @__PURE__ */ jsx2("span", {
|
|
894
314
|
children: labels.selectedOf(selectedRows, totalRows)
|
|
895
315
|
}) : null
|
|
896
316
|
]
|
|
897
317
|
}) : null,
|
|
898
|
-
/* @__PURE__ */
|
|
318
|
+
/* @__PURE__ */ jsxs2("div", {
|
|
899
319
|
className: cn(paginationClasses.controls, compact && paginationClasses.compactControls),
|
|
900
320
|
children: [
|
|
901
|
-
/* @__PURE__ */
|
|
321
|
+
/* @__PURE__ */ jsxs2("div", {
|
|
902
322
|
className: paginationClasses.controlGroup,
|
|
903
323
|
children: [
|
|
904
|
-
/* @__PURE__ */
|
|
324
|
+
/* @__PURE__ */ jsx2(Label, {
|
|
905
325
|
htmlFor: pageSizeId,
|
|
906
326
|
className: cn("hidden text-sm sm:block", compact && "block"),
|
|
907
327
|
children: labels.pageSize
|
|
908
328
|
}),
|
|
909
|
-
/* @__PURE__ */
|
|
329
|
+
/* @__PURE__ */ jsxs2(Select, {
|
|
910
330
|
items: pageSizes.map((size) => ({
|
|
911
331
|
label: size.toString(),
|
|
912
332
|
value: size.toString()
|
|
@@ -914,17 +334,17 @@ function Pagination({
|
|
|
914
334
|
value: `${pageSize}`,
|
|
915
335
|
onValueChange: (value) => onPageSizeChange(Number(value)),
|
|
916
336
|
children: [
|
|
917
|
-
/* @__PURE__ */
|
|
337
|
+
/* @__PURE__ */ jsx2(SelectTrigger, {
|
|
918
338
|
className: "h-8 w-[70px]",
|
|
919
339
|
id: pageSizeId,
|
|
920
|
-
children: /* @__PURE__ */
|
|
340
|
+
children: /* @__PURE__ */ jsx2(SelectValue, {
|
|
921
341
|
placeholder: pageSize
|
|
922
342
|
})
|
|
923
343
|
}),
|
|
924
|
-
/* @__PURE__ */
|
|
344
|
+
/* @__PURE__ */ jsx2(SelectContent, {
|
|
925
345
|
side: "top",
|
|
926
346
|
className: pageSizeContentClassName,
|
|
927
|
-
children: pageSizes.map((size) => /* @__PURE__ */
|
|
347
|
+
children: pageSizes.map((size) => /* @__PURE__ */ jsx2(SelectItem, {
|
|
928
348
|
value: `${size}`,
|
|
929
349
|
children: size
|
|
930
350
|
}, size))
|
|
@@ -933,66 +353,66 @@ function Pagination({
|
|
|
933
353
|
})
|
|
934
354
|
]
|
|
935
355
|
}),
|
|
936
|
-
/* @__PURE__ */
|
|
356
|
+
/* @__PURE__ */ jsxs2("div", {
|
|
937
357
|
className: paginationClasses.controlGroup,
|
|
938
358
|
children: [
|
|
939
|
-
pageLabel !== undefined && /* @__PURE__ */
|
|
359
|
+
pageLabel !== undefined && /* @__PURE__ */ jsx2("div", {
|
|
940
360
|
className: "flex items-center justify-center text-sm font-medium sm:block",
|
|
941
361
|
children: pageLabel
|
|
942
362
|
}),
|
|
943
|
-
/* @__PURE__ */
|
|
363
|
+
/* @__PURE__ */ jsxs2("div", {
|
|
944
364
|
className: paginationClasses.navigation,
|
|
945
365
|
children: [
|
|
946
|
-
/* @__PURE__ */
|
|
366
|
+
/* @__PURE__ */ jsxs2(Button, {
|
|
947
367
|
className: cn("hidden h-8 w-8 p-0 lg:flex", compact && "!hidden"),
|
|
948
368
|
disabled: navigation.goToFirstPage.disabled,
|
|
949
369
|
onClick: () => onPageChange(navigation.goToFirstPage.page),
|
|
950
370
|
type: "button",
|
|
951
371
|
children: [
|
|
952
|
-
/* @__PURE__ */
|
|
372
|
+
/* @__PURE__ */ jsx2("span", {
|
|
953
373
|
className: "sr-only",
|
|
954
374
|
children: labels.goToFirstPage
|
|
955
375
|
}),
|
|
956
|
-
/* @__PURE__ */
|
|
376
|
+
/* @__PURE__ */ jsx2(ChevronsLeft, {})
|
|
957
377
|
]
|
|
958
378
|
}),
|
|
959
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ jsxs2(Button, {
|
|
960
380
|
className: "h-8 w-8 p-0",
|
|
961
381
|
disabled: navigation.goToPreviousPage.disabled,
|
|
962
382
|
onClick: () => onPageChange(navigation.goToPreviousPage.page),
|
|
963
383
|
type: "button",
|
|
964
384
|
children: [
|
|
965
|
-
/* @__PURE__ */
|
|
385
|
+
/* @__PURE__ */ jsx2("span", {
|
|
966
386
|
className: "sr-only",
|
|
967
387
|
children: labels.goToPreviousPage
|
|
968
388
|
}),
|
|
969
|
-
/* @__PURE__ */
|
|
389
|
+
/* @__PURE__ */ jsx2(ChevronLeft, {})
|
|
970
390
|
]
|
|
971
391
|
}),
|
|
972
|
-
/* @__PURE__ */
|
|
392
|
+
/* @__PURE__ */ jsxs2(Button, {
|
|
973
393
|
className: "h-8 w-8 p-0",
|
|
974
394
|
disabled: navigation.goToNextPage.disabled,
|
|
975
395
|
onClick: () => onPageChange(navigation.goToNextPage.page),
|
|
976
396
|
type: "button",
|
|
977
397
|
children: [
|
|
978
|
-
/* @__PURE__ */
|
|
398
|
+
/* @__PURE__ */ jsx2("span", {
|
|
979
399
|
className: "sr-only",
|
|
980
400
|
children: labels.goToNextPage
|
|
981
401
|
}),
|
|
982
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ jsx2(ChevronRight, {})
|
|
983
403
|
]
|
|
984
404
|
}),
|
|
985
|
-
/* @__PURE__ */
|
|
405
|
+
/* @__PURE__ */ jsxs2(Button, {
|
|
986
406
|
className: cn("hidden h-8 w-8 p-0 lg:flex", compact && "!hidden"),
|
|
987
407
|
disabled: navigation.goToLastPage.disabled,
|
|
988
408
|
onClick: () => onPageChange(navigation.goToLastPage.page),
|
|
989
409
|
type: "button",
|
|
990
410
|
children: [
|
|
991
|
-
/* @__PURE__ */
|
|
411
|
+
/* @__PURE__ */ jsx2("span", {
|
|
992
412
|
className: "sr-only",
|
|
993
413
|
children: labels.goToLastPage
|
|
994
414
|
}),
|
|
995
|
-
/* @__PURE__ */
|
|
415
|
+
/* @__PURE__ */ jsx2(ChevronsRight, {})
|
|
996
416
|
]
|
|
997
417
|
})
|
|
998
418
|
]
|
|
@@ -1004,152 +424,22 @@ function Pagination({
|
|
|
1004
424
|
]
|
|
1005
425
|
});
|
|
1006
426
|
}
|
|
1007
|
-
// ../../src/components/
|
|
1008
|
-
import { ScrollArea
|
|
1009
|
-
import {
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
children
|
|
1024
|
-
}),
|
|
1025
|
-
/* @__PURE__ */ jsx12(ScrollBar, {}),
|
|
1026
|
-
/* @__PURE__ */ jsx12(ScrollAreaPrimitive.Corner, {})
|
|
1027
|
-
]
|
|
1028
|
-
});
|
|
1029
|
-
}
|
|
1030
|
-
function ScrollBar({
|
|
1031
|
-
className,
|
|
1032
|
-
orientation = "vertical",
|
|
1033
|
-
...props
|
|
1034
|
-
}) {
|
|
1035
|
-
return /* @__PURE__ */ jsx12(ScrollAreaPrimitive.Scrollbar, {
|
|
1036
|
-
"data-slot": "scroll-area-scrollbar",
|
|
1037
|
-
"data-orientation": orientation,
|
|
1038
|
-
orientation,
|
|
1039
|
-
className: cn("flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent", className),
|
|
1040
|
-
...props,
|
|
1041
|
-
children: /* @__PURE__ */ jsx12(ScrollAreaPrimitive.Thumb, {
|
|
1042
|
-
"data-slot": "scroll-area-thumb",
|
|
1043
|
-
className: "bg-border relative flex-1 rounded-full"
|
|
1044
|
-
})
|
|
1045
|
-
});
|
|
1046
|
-
}
|
|
1047
|
-
|
|
1048
|
-
// ../../src/components/ui/table.tsx
|
|
1049
|
-
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1050
|
-
function Table({ className, ...props }) {
|
|
1051
|
-
return /* @__PURE__ */ jsx13("div", {
|
|
1052
|
-
"data-slot": "table-container",
|
|
1053
|
-
className: "relative w-full overflow-x-auto",
|
|
1054
|
-
children: /* @__PURE__ */ jsx13("table", {
|
|
1055
|
-
"data-slot": "table",
|
|
1056
|
-
className: cn("w-full caption-bottom text-sm", className),
|
|
1057
|
-
...props
|
|
1058
|
-
})
|
|
1059
|
-
});
|
|
1060
|
-
}
|
|
1061
|
-
function TableHeader({ className, ...props }) {
|
|
1062
|
-
return /* @__PURE__ */ jsx13("thead", {
|
|
1063
|
-
"data-slot": "table-header",
|
|
1064
|
-
className: cn("[&_tr]:border-b", className),
|
|
1065
|
-
...props
|
|
1066
|
-
});
|
|
1067
|
-
}
|
|
1068
|
-
function TableBody({ className, ...props }) {
|
|
1069
|
-
return /* @__PURE__ */ jsx13("tbody", {
|
|
1070
|
-
"data-slot": "table-body",
|
|
1071
|
-
className: cn("[&_tr:last-child]:border-0", className),
|
|
1072
|
-
...props
|
|
1073
|
-
});
|
|
1074
|
-
}
|
|
1075
|
-
function TableRow({ className, ...props }) {
|
|
1076
|
-
return /* @__PURE__ */ jsx13("tr", {
|
|
1077
|
-
"data-slot": "table-row",
|
|
1078
|
-
className: cn("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted", className),
|
|
1079
|
-
...props
|
|
1080
|
-
});
|
|
1081
|
-
}
|
|
1082
|
-
function TableHead({ className, ...props }) {
|
|
1083
|
-
return /* @__PURE__ */ jsx13("th", {
|
|
1084
|
-
"data-slot": "table-head",
|
|
1085
|
-
className: cn("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0", className),
|
|
1086
|
-
...props
|
|
1087
|
-
});
|
|
1088
|
-
}
|
|
1089
|
-
function TableCell({ className, ...props }) {
|
|
1090
|
-
return /* @__PURE__ */ jsx13("td", {
|
|
1091
|
-
"data-slot": "table-cell",
|
|
1092
|
-
className: cn("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0", className),
|
|
1093
|
-
...props
|
|
1094
|
-
});
|
|
1095
|
-
}
|
|
1096
|
-
|
|
1097
|
-
// ../../src/components/ui/tooltip.tsx
|
|
1098
|
-
import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip";
|
|
1099
|
-
import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1100
|
-
"use client";
|
|
1101
|
-
function TooltipProvider({
|
|
1102
|
-
delay = 0,
|
|
1103
|
-
...props
|
|
1104
|
-
}) {
|
|
1105
|
-
return /* @__PURE__ */ jsx14(TooltipPrimitive.Provider, {
|
|
1106
|
-
"data-slot": "tooltip-provider",
|
|
1107
|
-
delay,
|
|
1108
|
-
...props
|
|
1109
|
-
});
|
|
1110
|
-
}
|
|
1111
|
-
function Tooltip({ ...props }) {
|
|
1112
|
-
return /* @__PURE__ */ jsx14(TooltipPrimitive.Root, {
|
|
1113
|
-
"data-slot": "tooltip",
|
|
1114
|
-
...props
|
|
1115
|
-
});
|
|
1116
|
-
}
|
|
1117
|
-
function TooltipTrigger({ ...props }) {
|
|
1118
|
-
return /* @__PURE__ */ jsx14(TooltipPrimitive.Trigger, {
|
|
1119
|
-
"data-slot": "tooltip-trigger",
|
|
1120
|
-
...props
|
|
1121
|
-
});
|
|
1122
|
-
}
|
|
1123
|
-
function TooltipContent({
|
|
1124
|
-
className,
|
|
1125
|
-
side = "top",
|
|
1126
|
-
sideOffset = 4,
|
|
1127
|
-
align = "center",
|
|
1128
|
-
alignOffset = 0,
|
|
1129
|
-
children,
|
|
1130
|
-
...props
|
|
1131
|
-
}) {
|
|
1132
|
-
return /* @__PURE__ */ jsx14(TooltipPrimitive.Portal, {
|
|
1133
|
-
children: /* @__PURE__ */ jsx14(TooltipPrimitive.Positioner, {
|
|
1134
|
-
align,
|
|
1135
|
-
alignOffset,
|
|
1136
|
-
side,
|
|
1137
|
-
sideOffset,
|
|
1138
|
-
className: "isolate z-50",
|
|
1139
|
-
children: /* @__PURE__ */ jsxs8(TooltipPrimitive.Popup, {
|
|
1140
|
-
"data-slot": "tooltip-content",
|
|
1141
|
-
className: cn("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
1142
|
-
...props,
|
|
1143
|
-
children: [
|
|
1144
|
-
children,
|
|
1145
|
-
/* @__PURE__ */ jsx14(TooltipPrimitive.Arrow, {
|
|
1146
|
-
className: "bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"
|
|
1147
|
-
})
|
|
1148
|
-
]
|
|
1149
|
-
})
|
|
1150
|
-
})
|
|
1151
|
-
});
|
|
1152
|
-
}
|
|
427
|
+
// ../../src/components/data-table/react.tsx
|
|
428
|
+
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
|
|
429
|
+
import {
|
|
430
|
+
Table as PrimitiveTable,
|
|
431
|
+
TableBody as PrimitiveTableBody,
|
|
432
|
+
TableCell as PrimitiveTableCell,
|
|
433
|
+
TableHead as PrimitiveTableHead,
|
|
434
|
+
TableHeader as PrimitiveTableHeader,
|
|
435
|
+
TableRow as PrimitiveTableRow
|
|
436
|
+
} from "@/components/ui/table";
|
|
437
|
+
import {
|
|
438
|
+
Tooltip,
|
|
439
|
+
TooltipContent as PrimitiveTooltipContent,
|
|
440
|
+
TooltipProvider,
|
|
441
|
+
TooltipTrigger
|
|
442
|
+
} from "@/components/ui/tooltip";
|
|
1153
443
|
|
|
1154
444
|
// ../../src/lib/query.ts
|
|
1155
445
|
import {
|
|
@@ -1324,6 +614,13 @@ import { useModel } from "@krak-stack/registry/effect-ui-adapter/react";
|
|
|
1324
614
|
import { useKrakstackLocale as useKrakstackLocale3 } from "@krak-stack/registry/krakstack-provider/react";
|
|
1325
615
|
|
|
1326
616
|
// ../../src/components/data-table/classes.ts
|
|
617
|
+
var booleanCellControl = "flex min-h-16 w-full items-center justify-start px-2 in-[[data-slot=table-cell]]:absolute in-[[data-slot=table-cell]]:inset-0 in-[[data-slot=table-cell]]:min-h-0 has-[:focus-visible]:outline-2 has-[:focus-visible]:-outline-offset-2 has-[:focus-visible]:outline-ring";
|
|
618
|
+
var cellTriggerFocus = "focus-visible:ring-0 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring";
|
|
619
|
+
var tableBadgeTones = {
|
|
620
|
+
success: "border-emerald-200 bg-emerald-100 text-emerald-900 dark:border-emerald-900/50 dark:bg-emerald-950/50 dark:text-emerald-200",
|
|
621
|
+
info: "border-blue-200 bg-blue-100 text-blue-900 dark:border-blue-900/50 dark:bg-blue-950/50 dark:text-blue-200",
|
|
622
|
+
muted: "border-muted bg-muted text-muted-foreground dark:bg-muted/50"
|
|
623
|
+
};
|
|
1327
624
|
var tableClasses = {
|
|
1328
625
|
selectionCell: "w-10 p-0 align-middle",
|
|
1329
626
|
selectionCenter: "grid place-items-center",
|
|
@@ -1335,16 +632,16 @@ var tableClasses = {
|
|
|
1335
632
|
menubar: "h-auto w-full flex-wrap justify-start border border-input bg-transparent",
|
|
1336
633
|
cell: "overflow-hidden",
|
|
1337
634
|
cellContent: "min-w-0 wrap-anywhere",
|
|
1338
|
-
actionTrigger:
|
|
635
|
+
actionTrigger: `size-8 ${cellTriggerFocus}`,
|
|
1339
636
|
actionsCell: "sticky right-0 z-20 w-10 min-w-10 cursor-default bg-background p-0 transition-colors group-hover/row:bg-[color-mix(in_oklab,var(--muted)_50%,var(--background))]",
|
|
1340
637
|
actionsAlign: "flex min-h-12 items-center justify-end pe-1",
|
|
1341
638
|
header: "relative h-12 p-0",
|
|
1342
639
|
stickyHeader: "sticky top-0 z-30 bg-background",
|
|
1343
640
|
stickyHeaderRule: "after:border-border after:pointer-events-none after:absolute after:inset-x-0 after:bottom-0 after:border-b",
|
|
1344
|
-
headerTrigger:
|
|
641
|
+
headerTrigger: `absolute inset-0 h-full w-full min-w-0 justify-start rounded-none px-2 pe-4 ${cellTriggerFocus}`,
|
|
1345
642
|
resizeHandle: "absolute inset-y-0 right-0 z-10 w-2 cursor-col-resize touch-none outline-none after:absolute after:inset-y-3 after:right-0 after:w-px after:bg-border hover:after:w-0.5 hover:after:bg-primary/60 focus-visible:after:w-0.5 focus-visible:after:bg-ring",
|
|
1346
643
|
relationshipCell: "grid min-h-16 in-[[data-slot=table-cell]]:absolute in-[[data-slot=table-cell]]:inset-0 in-[[data-slot=table-cell]]:min-h-0",
|
|
1347
|
-
relationshipTrigger:
|
|
644
|
+
relationshipTrigger: `h-full w-full min-w-0 justify-between rounded-none px-2 text-start ${cellTriggerFocus}`,
|
|
1348
645
|
reference: "flex min-w-0 items-center gap-2",
|
|
1349
646
|
referenceAvatar: "relative grid size-8 shrink-0 place-items-center overflow-hidden bg-muted text-xs font-medium",
|
|
1350
647
|
referenceText: "flex min-w-0 flex-col leading-tight",
|
|
@@ -1366,7 +663,7 @@ import { Csv } from "effect/encoding";
|
|
|
1366
663
|
import { Command, Component as Component2, Subscription, UiSchema as UiSchema2 } from "effect/ui";
|
|
1367
664
|
|
|
1368
665
|
// ../../src/components/data-table/schema.ts
|
|
1369
|
-
import { DateTime as DateTime2, Option as Option2, Schema as Schema4, Struct as Struct2, Tuple } from "effect";
|
|
666
|
+
import { DateTime as DateTime2, Option as Option2, Predicate, Schema as Schema4, Struct as Struct2, Tuple } from "effect";
|
|
1370
667
|
var TableClassesOverridesSchema = Schema4.Record(Schema4.Literals(Struct2.keys(tableClasses)), Schema4.optionalKey(Schema4.String)).annotate({ identifier: "TableClassesOverrides" });
|
|
1371
668
|
var DataTableCommonPropsSchema = Schema4.Struct({
|
|
1372
669
|
classes: Schema4.optional(TableClassesOverridesSchema),
|
|
@@ -1474,8 +771,33 @@ var column = {
|
|
|
1474
771
|
emptyLabel: Schema4.optionalKey(Schema4.String),
|
|
1475
772
|
nulls: Schema4.optionalKey(Schema4.Literals(["first", "last"]))
|
|
1476
773
|
};
|
|
774
|
+
var DataTableBadgeOptionSchema = Schema4.Struct({
|
|
775
|
+
value: Schema4.NonEmptyString,
|
|
776
|
+
label: Schema4.optionalKey(Schema4.String),
|
|
777
|
+
variant: Schema4.optionalKey(Schema4.Literals([
|
|
778
|
+
"default",
|
|
779
|
+
"secondary",
|
|
780
|
+
"outline",
|
|
781
|
+
"destructive",
|
|
782
|
+
"success",
|
|
783
|
+
"info",
|
|
784
|
+
"muted"
|
|
785
|
+
]))
|
|
786
|
+
}).annotate({ identifier: "DataTableBadgeOption" });
|
|
787
|
+
var BadgeIcon = Schema4.declare((value) => Predicate.isFunction(value)).annotate({ identifier: "DataTableBadgeIcon" });
|
|
788
|
+
var DataTableBadgeOptionsSchema = Schema4.Struct({
|
|
789
|
+
options: Schema4.optionalKey(Schema4.Array(DataTableBadgeOptionSchema.mapFields((fields) => ({
|
|
790
|
+
...fields,
|
|
791
|
+
icon: Schema4.optionalKey(BadgeIcon)
|
|
792
|
+
}))))
|
|
793
|
+
}).annotate({ identifier: "DataTableBadgeOptions" });
|
|
1477
794
|
var DataTableFieldSchema = Schema4.Union([
|
|
1478
|
-
Schema4.Struct({
|
|
795
|
+
Schema4.Struct({
|
|
796
|
+
...column,
|
|
797
|
+
type: Schema4.Literal("text"),
|
|
798
|
+
display: Schema4.optionalKey(Schema4.Literal("badge")),
|
|
799
|
+
typeOptions: Schema4.optionalKey(DataTableBadgeOptionsSchema)
|
|
800
|
+
}),
|
|
1479
801
|
Schema4.Struct({
|
|
1480
802
|
...column,
|
|
1481
803
|
type: Schema4.Literal("number"),
|
|
@@ -1518,7 +840,7 @@ var DataTableFieldSchema = Schema4.Union([
|
|
|
1518
840
|
options: Schema4.optionalKey(Schema4.Array(DataTableItemSchema)),
|
|
1519
841
|
allowRemove: Schema4.optionalKey(Schema4.Boolean),
|
|
1520
842
|
itemActions: Schema4.optionalKey(Schema4.Array(DataTableActionSchema)),
|
|
1521
|
-
display: Schema4.optionalKey(Schema4.Literals(["list", "icon"])),
|
|
843
|
+
display: Schema4.optionalKey(Schema4.Literals(["list", "icon", "badge"])),
|
|
1522
844
|
visibleCount: Schema4.optionalKey(Schema4.Int.check(Schema4.isGreaterThanOrEqualTo(0))),
|
|
1523
845
|
actionsLabel: Schema4.optionalKey(Schema4.String),
|
|
1524
846
|
manageLabel: Schema4.optionalKey(Schema4.String)
|
|
@@ -1812,7 +1134,33 @@ var matchesFilterText = (value, filter) => {
|
|
|
1812
1134
|
return text.endsWith(query);
|
|
1813
1135
|
}
|
|
1814
1136
|
};
|
|
1815
|
-
var tableFilterKind = (column, hasOptions = false) => hasOptions || column.type === "list" ? "values" : column.type === "reference" ? "text" : column.type === "dateTime" ? "date" : column.type ?? "text";
|
|
1137
|
+
var tableFilterKind = (column, hasOptions = false) => hasOptions || column.type === "list" || column.display === "badge" ? "values" : column.type === "reference" ? "text" : column.type === "dateTime" ? "date" : column.type ?? "text";
|
|
1138
|
+
var tableBadgeValue = (value) => isTableText(value) && value !== "" ? value : null;
|
|
1139
|
+
var tableBadge = (input, config) => {
|
|
1140
|
+
const value = tableBadgeValue(input);
|
|
1141
|
+
if (value === null)
|
|
1142
|
+
return null;
|
|
1143
|
+
const option = config?.options?.find((option) => option.value === value);
|
|
1144
|
+
return {
|
|
1145
|
+
value,
|
|
1146
|
+
label: option?.label ?? value,
|
|
1147
|
+
variant: option?.variant ?? "secondary",
|
|
1148
|
+
option
|
|
1149
|
+
};
|
|
1150
|
+
};
|
|
1151
|
+
var tableBadgeFilterOptions = (values, config) => {
|
|
1152
|
+
const options = new Map(config?.options?.map(({ value, label }) => [value, label ?? value]));
|
|
1153
|
+
for (const input of values) {
|
|
1154
|
+
const value = tableBadgeValue(input);
|
|
1155
|
+
if (value !== null && !options.has(value))
|
|
1156
|
+
options.set(value, value);
|
|
1157
|
+
}
|
|
1158
|
+
return [...options].map(([value, label]) => ({ value, label }));
|
|
1159
|
+
};
|
|
1160
|
+
var tableBadgeSearchText = (value, config) => {
|
|
1161
|
+
const badge = tableBadge(value, config);
|
|
1162
|
+
return badge ? `${badge.label} ${badge.value}` : "";
|
|
1163
|
+
};
|
|
1816
1164
|
var matchesTableFilter = (filter, value, type, text, values) => {
|
|
1817
1165
|
switch (filter.kind) {
|
|
1818
1166
|
case "text":
|
|
@@ -1846,13 +1194,20 @@ var filterTableColumns = (rows, columns, filters) => {
|
|
|
1846
1194
|
return rows;
|
|
1847
1195
|
return rows.filter((row) => active.every((filter) => {
|
|
1848
1196
|
const value = row.cells[filter.id];
|
|
1849
|
-
|
|
1197
|
+
const column = byId.get(filter.id);
|
|
1198
|
+
return matchesTableFilter(filter, value, column?.type, () => isTableText(value) ? value : isTableReference(value) ? `${value.label} ${value.description ?? ""}`.trim() : "", () => {
|
|
1199
|
+
if (column?.type === "text" && column.display === "badge") {
|
|
1200
|
+
const key = tableBadgeValue(value);
|
|
1201
|
+
return key === null ? [] : [key];
|
|
1202
|
+
}
|
|
1203
|
+
return isTableList(value) ? value.map(({ value }) => value) : [];
|
|
1204
|
+
});
|
|
1850
1205
|
}));
|
|
1851
1206
|
};
|
|
1852
1207
|
var columnValue = (column, value) => {
|
|
1853
1208
|
switch (column.type) {
|
|
1854
1209
|
case "text":
|
|
1855
|
-
return isTableText(value) ? value : null;
|
|
1210
|
+
return column.display === "badge" ? tableBadgeValue(value) : isTableText(value) ? value : null;
|
|
1856
1211
|
case "number":
|
|
1857
1212
|
case "boolean":
|
|
1858
1213
|
case "date":
|
|
@@ -1906,6 +1261,8 @@ var filterTableRows = (rows, columns, search, locale) => {
|
|
|
1906
1261
|
const searchable = columns.filter(({ searchable }) => searchable !== false);
|
|
1907
1262
|
return rows.filter((row) => searchable.some((column) => {
|
|
1908
1263
|
const value = row.cells[column.id];
|
|
1264
|
+
if (column.type === "text" && column.display === "badge")
|
|
1265
|
+
return tableBadgeSearchText(value, column.typeOptions).toLocaleLowerCase(locale).includes(query);
|
|
1909
1266
|
if (column.type === "date" || column.type === "dateTime") {
|
|
1910
1267
|
const date = resolveDate(value, column.type);
|
|
1911
1268
|
return !!date && `${formatDateValue(date, column, locale)} ${dateIsoValue(date)}`.toLocaleLowerCase(locale).includes(query);
|
|
@@ -2618,14 +1975,14 @@ var dataTableBehaviours = {
|
|
|
2618
1975
|
};
|
|
2619
1976
|
|
|
2620
1977
|
// ../../src/components/data-table/react.tsx
|
|
2621
|
-
import { jsx as
|
|
1978
|
+
import { jsx as jsx3, jsxs as jsxs3, Fragment } from "react/jsx-runtime";
|
|
2622
1979
|
var DataTableStylesContext = createContext(undefined);
|
|
2623
1980
|
var DataTableSlotClassesContext = createContext(resolveTableClasses());
|
|
2624
1981
|
var styledTablePart = (Part, slot, style) => {
|
|
2625
1982
|
const StyledPart = (props) => {
|
|
2626
1983
|
const styles = useContext(DataTableStylesContext);
|
|
2627
1984
|
const className = cn(props.className, style(styles));
|
|
2628
|
-
return /* @__PURE__ */
|
|
1985
|
+
return /* @__PURE__ */ jsx3(Part, {
|
|
2629
1986
|
"data-table-slot": slot,
|
|
2630
1987
|
...props,
|
|
2631
1988
|
className
|
|
@@ -2633,32 +1990,32 @@ var styledTablePart = (Part, slot, style) => {
|
|
|
2633
1990
|
};
|
|
2634
1991
|
return StyledPart;
|
|
2635
1992
|
};
|
|
2636
|
-
var
|
|
2637
|
-
var
|
|
2638
|
-
var
|
|
2639
|
-
var
|
|
2640
|
-
var
|
|
2641
|
-
var
|
|
2642
|
-
var
|
|
2643
|
-
var
|
|
2644
|
-
var
|
|
2645
|
-
var
|
|
2646
|
-
var
|
|
2647
|
-
var
|
|
2648
|
-
var
|
|
2649
|
-
var
|
|
2650
|
-
var
|
|
2651
|
-
var
|
|
2652
|
-
var
|
|
2653
|
-
var
|
|
2654
|
-
var
|
|
2655
|
-
var
|
|
2656
|
-
var
|
|
2657
|
-
var
|
|
2658
|
-
var
|
|
2659
|
-
var
|
|
2660
|
-
var SelectContent2 = styledTablePart(
|
|
2661
|
-
var
|
|
1993
|
+
var Table = styledTablePart(PrimitiveTable, "table", (s) => s?.table?.content);
|
|
1994
|
+
var TableHeader = styledTablePart(PrimitiveTableHeader, "header", (s) => s?.table?.header);
|
|
1995
|
+
var TableBody = styledTablePart(PrimitiveTableBody, "body", (s) => s?.table?.body);
|
|
1996
|
+
var TableRow = styledTablePart(PrimitiveTableRow, "row", (s) => s?.table?.row);
|
|
1997
|
+
var TableHead = styledTablePart(PrimitiveTableHead, "head", (s) => s?.table?.head);
|
|
1998
|
+
var TableCell = styledTablePart(PrimitiveTableCell, "cell", (s) => s?.table?.cell);
|
|
1999
|
+
var Input = styledTablePart(PrimitiveInput, "input", (s) => s?.toolbar?.search);
|
|
2000
|
+
var Menubar = styledTablePart(PrimitiveMenubar, "menubar", (s) => s?.toolbar?.content);
|
|
2001
|
+
var MenubarTrigger = styledTablePart(PrimitiveMenubarTrigger, "menu-trigger", (s) => s?.toolbar?.trigger);
|
|
2002
|
+
var MenubarContent = styledTablePart(PrimitiveMenubarContent, "menu", (s) => s?.menu?.content);
|
|
2003
|
+
var MenubarSubContent = styledTablePart(PrimitiveMenubarSubContent, "submenu", (s) => s?.menu?.subContent);
|
|
2004
|
+
var MenubarSubTrigger = styledTablePart(PrimitiveMenubarSubTrigger, "submenu-trigger", (s) => s?.menu?.subTrigger);
|
|
2005
|
+
var MenubarItem = styledTablePart(PrimitiveMenubarItem, "menu-item", (s) => s?.menu?.item);
|
|
2006
|
+
var MenubarCheckboxItem = styledTablePart(PrimitiveMenubarCheckboxItem, "menu-checkbox-item", (s) => s?.menu?.item);
|
|
2007
|
+
var MenubarRadioItem = styledTablePart(PrimitiveMenubarRadioItem, "menu-radio-item", (s) => s?.menu?.item);
|
|
2008
|
+
var MenubarLabel = styledTablePart(PrimitiveMenubarLabel, "menu-label", (s) => s?.menu?.label);
|
|
2009
|
+
var MenubarSeparator = styledTablePart(PrimitiveMenubarSeparator, "menu-separator", (s) => s?.menu?.separator);
|
|
2010
|
+
var DropdownMenuTrigger = styledTablePart(PrimitiveDropdownMenuTrigger, "row-menu-trigger", (s) => s?.toolbar?.trigger);
|
|
2011
|
+
var DropdownMenuContent = styledTablePart(PrimitiveDropdownMenuContent, "row-menu", (s) => s?.menu?.content);
|
|
2012
|
+
var DropdownMenuSubContent = styledTablePart(PrimitiveDropdownMenuSubContent, "row-submenu", (s) => s?.menu?.subContent);
|
|
2013
|
+
var DropdownMenuSubTrigger = styledTablePart(PrimitiveDropdownMenuSubTrigger, "row-submenu-trigger", (s) => s?.menu?.subTrigger);
|
|
2014
|
+
var DropdownMenuItem = styledTablePart(PrimitiveDropdownMenuItem, "row-menu-item", (s) => s?.menu?.item);
|
|
2015
|
+
var DropdownMenuLabel = styledTablePart(PrimitiveDropdownMenuLabel, "row-menu-label", (s) => s?.menu?.label);
|
|
2016
|
+
var DropdownMenuSeparator = styledTablePart(PrimitiveDropdownMenuSeparator, "row-menu-separator", (s) => s?.menu?.separator);
|
|
2017
|
+
var SelectContent2 = styledTablePart(PrimitiveSelectContent, "select-popup", (s) => s?.popup?.select);
|
|
2018
|
+
var TooltipContent = styledTablePart(PrimitiveTooltipContent, "tooltip", (s) => s?.popup?.tooltip);
|
|
2662
2019
|
var DataTableReferenceCell = ({
|
|
2663
2020
|
item,
|
|
2664
2021
|
emptyLabel = "—",
|
|
@@ -2669,33 +2026,33 @@ var DataTableReferenceCell = ({
|
|
|
2669
2026
|
if (!item)
|
|
2670
2027
|
return emptyLabel;
|
|
2671
2028
|
const initials = tableInitials(item.label);
|
|
2672
|
-
return /* @__PURE__ */
|
|
2029
|
+
return /* @__PURE__ */ jsxs3("div", {
|
|
2673
2030
|
className: tableClasses.reference,
|
|
2674
2031
|
children: [
|
|
2675
|
-
/* @__PURE__ */
|
|
2032
|
+
/* @__PURE__ */ jsx3("div", {
|
|
2676
2033
|
className: cn(tableClasses.referenceAvatar, imageVariant === "circle" ? "rounded-full" : "rounded-md", item.iconClassName),
|
|
2677
|
-
children: item.icon ? /* @__PURE__ */
|
|
2034
|
+
children: item.icon ? /* @__PURE__ */ jsx3("span", {
|
|
2678
2035
|
"aria-hidden": "true",
|
|
2679
2036
|
className: "[&_svg]:size-4",
|
|
2680
2037
|
children: item.icon
|
|
2681
|
-
}) : item.imageSrc && item.imageSrc !== failedImage ? /* @__PURE__ */
|
|
2038
|
+
}) : item.imageSrc && item.imageSrc !== failedImage ? /* @__PURE__ */ jsx3("img", {
|
|
2682
2039
|
src: item.imageSrc,
|
|
2683
2040
|
alt: item.label,
|
|
2684
2041
|
className: "size-full object-cover",
|
|
2685
2042
|
onError: () => setFailedImage(item.imageSrc ?? undefined)
|
|
2686
|
-
}) : /* @__PURE__ */
|
|
2043
|
+
}) : /* @__PURE__ */ jsx3("span", {
|
|
2687
2044
|
"aria-hidden": "true",
|
|
2688
2045
|
children: initials
|
|
2689
2046
|
})
|
|
2690
2047
|
}),
|
|
2691
|
-
/* @__PURE__ */
|
|
2048
|
+
/* @__PURE__ */ jsxs3("div", {
|
|
2692
2049
|
className: tableClasses.referenceText,
|
|
2693
2050
|
children: [
|
|
2694
|
-
/* @__PURE__ */
|
|
2051
|
+
/* @__PURE__ */ jsx3("span", {
|
|
2695
2052
|
className: tableClasses.referenceName,
|
|
2696
2053
|
children: item.label
|
|
2697
2054
|
}),
|
|
2698
|
-
item.description ? /* @__PURE__ */
|
|
2055
|
+
item.description ? /* @__PURE__ */ jsx3("span", {
|
|
2699
2056
|
className: tableClasses.referenceDescription,
|
|
2700
2057
|
children: item.description
|
|
2701
2058
|
}) : null
|
|
@@ -2835,6 +2192,8 @@ var booleanLabel = (value, options) => value ? options?.trueLabel : options?.fal
|
|
|
2835
2192
|
var getDataTableExportValue = (row, column, locale = "en") => {
|
|
2836
2193
|
const value = row.values.get(column.id);
|
|
2837
2194
|
const colDef = column.colDef;
|
|
2195
|
+
if (colDef.type === "text" && colDef.display === "badge")
|
|
2196
|
+
return tableBadgeValue(value);
|
|
2838
2197
|
if (colDef.type === "number") {
|
|
2839
2198
|
const number = Option4.getOrUndefined(decodeNumberValue(value));
|
|
2840
2199
|
if (number === undefined)
|
|
@@ -2863,7 +2222,9 @@ var filterDataTableRows = (rows, columns, globalFilter, locale = "en") => {
|
|
|
2863
2222
|
const value = row.values.get(column.id);
|
|
2864
2223
|
const colDef = column.colDef;
|
|
2865
2224
|
let text = dataTableValueText(value);
|
|
2866
|
-
if (colDef.type === "
|
|
2225
|
+
if (colDef.type === "text" && colDef.display === "badge") {
|
|
2226
|
+
text = tableBadgeSearchText(value, colDef.typeOptions);
|
|
2227
|
+
} else if (colDef.type === "date" || colDef.type === "dateTime") {
|
|
2867
2228
|
const date = resolveDate(value, colDef.type);
|
|
2868
2229
|
text = date ? `${formatDateValue(date, colDef, locale)} ${dateIsoValue(date)}` : "";
|
|
2869
2230
|
} else if (colDef.type === "number") {
|
|
@@ -2879,11 +2240,14 @@ var filterDataTableRows = (rows, columns, globalFilter, locale = "en") => {
|
|
|
2879
2240
|
var getDataTableFilterColumns = (columns) => columns.flatMap((column) => column.colDef.filterable === false ? [] : ((column.colDef.fields?.length) ? getDataTableFieldColumns(column) : [column]).filter(({ colDef }) => colDef.filterable !== false));
|
|
2880
2241
|
var getDataTableFilterKind = ({
|
|
2881
2242
|
colDef
|
|
2882
|
-
}) => tableFilterKind(colDef, !!colDef.filterOptions);
|
|
2243
|
+
}) => tableFilterKind(colDef.type === "text" ? colDef : { type: colDef.type }, !!colDef.filterOptions);
|
|
2883
2244
|
var getDataTableFilterOptions = (rows, column) => {
|
|
2884
2245
|
const { colDef } = column;
|
|
2885
2246
|
if (colDef.filterOptions)
|
|
2886
2247
|
return colDef.filterOptions;
|
|
2248
|
+
if (colDef.type === "text" && colDef.display === "badge") {
|
|
2249
|
+
return tableBadgeFilterOptions(rows.map((row) => row.values.get(column.id)), colDef.typeOptions);
|
|
2250
|
+
}
|
|
2887
2251
|
const options = new Map;
|
|
2888
2252
|
if (colDef.type === "list") {
|
|
2889
2253
|
for (const row of rows) {
|
|
@@ -2908,7 +2272,15 @@ var filterDataTableColumnRows = (rows, columns, filters) => {
|
|
|
2908
2272
|
colDef: column.colDef
|
|
2909
2273
|
}) : row.values.get(column.id);
|
|
2910
2274
|
const { colDef } = column;
|
|
2911
|
-
return matchesTableFilter(filter, value, colDef.type, () => dataTableValueText(value), () =>
|
|
2275
|
+
return matchesTableFilter(filter, value, colDef.type, () => dataTableValueText(value), () => {
|
|
2276
|
+
if (colDef.type === "list")
|
|
2277
|
+
return colDef.typeOptions.getItems(row.data).map((item) => item.value ?? item.label);
|
|
2278
|
+
if (colDef.type === "text" && colDef.display === "badge") {
|
|
2279
|
+
const key = tableBadgeValue(value);
|
|
2280
|
+
return key === null ? [] : [key];
|
|
2281
|
+
}
|
|
2282
|
+
return [dataTableValueText(value)];
|
|
2283
|
+
});
|
|
2912
2284
|
}));
|
|
2913
2285
|
};
|
|
2914
2286
|
var sortDataTableRows = (rows, columns, sorting) => {
|
|
@@ -2924,6 +2296,12 @@ var sortDataTableRows = (rows, columns, sorting) => {
|
|
|
2924
2296
|
const leftValue = left.row.values.get(sort.id);
|
|
2925
2297
|
const rightValue = right.row.values.get(sort.id);
|
|
2926
2298
|
const colDef = column.colDef;
|
|
2299
|
+
if (!colDef.comparator && colDef.type === "text" && colDef.display === "badge") {
|
|
2300
|
+
const comparison = compareTableSortValues(tableBadgeValue(leftValue), tableBadgeValue(rightValue), sort.direction);
|
|
2301
|
+
if (comparison !== 0)
|
|
2302
|
+
return comparison;
|
|
2303
|
+
continue;
|
|
2304
|
+
}
|
|
2927
2305
|
if (!colDef.comparator && (colDef.type === "number" || colDef.type === "boolean" || colDef.type === "date" || colDef.type === "dateTime")) {
|
|
2928
2306
|
const comparison = compareTableSortValues(tableSortScalar(colDef.type, leftValue), tableSortScalar(colDef.type, rightValue), sort.direction, colDef.typeOptions?.nulls);
|
|
2929
2307
|
if (comparison !== 0)
|
|
@@ -3076,14 +2454,35 @@ var renderCell = (row, column, locale = "en", labels = dataTableMessages(locale)
|
|
|
3076
2454
|
};
|
|
3077
2455
|
const CellRenderer = column.colDef.cellRenderer;
|
|
3078
2456
|
if (CellRenderer)
|
|
3079
|
-
return /* @__PURE__ */
|
|
2457
|
+
return /* @__PURE__ */ jsx3(CellRenderer, {
|
|
3080
2458
|
...params
|
|
3081
2459
|
});
|
|
3082
2460
|
const colDef = column.colDef;
|
|
2461
|
+
if (colDef.type === "text" && colDef.display === "badge") {
|
|
2462
|
+
if (colDef.valueFormatter)
|
|
2463
|
+
return colDef.valueFormatter(params);
|
|
2464
|
+
const badge = tableBadge(value, colDef.typeOptions);
|
|
2465
|
+
if (!badge)
|
|
2466
|
+
return colDef.typeOptions?.emptyLabel ?? "—";
|
|
2467
|
+
const { variant, label, option } = badge;
|
|
2468
|
+
const tone = variant === "success" || variant === "info" || variant === "muted" ? tableBadgeTones[variant] : undefined;
|
|
2469
|
+
return /* @__PURE__ */ jsxs3(Badge, {
|
|
2470
|
+
variant: variant === "success" || variant === "info" || variant === "muted" ? "outline" : variant,
|
|
2471
|
+
className: tone,
|
|
2472
|
+
children: [
|
|
2473
|
+
option?.icon && /* @__PURE__ */ jsx3("span", {
|
|
2474
|
+
"aria-hidden": "true",
|
|
2475
|
+
className: "inline-flex shrink-0 [&_svg]:size-3",
|
|
2476
|
+
children: option.icon
|
|
2477
|
+
}),
|
|
2478
|
+
label
|
|
2479
|
+
]
|
|
2480
|
+
});
|
|
2481
|
+
}
|
|
3083
2482
|
if (colDef.type === "reference") {
|
|
3084
2483
|
if (colDef.valueFormatter)
|
|
3085
2484
|
return colDef.valueFormatter(params);
|
|
3086
|
-
return /* @__PURE__ */
|
|
2485
|
+
return /* @__PURE__ */ jsx3(DataTableReferenceCell, {
|
|
3087
2486
|
item: colDef.typeOptions.getItem(row.data),
|
|
3088
2487
|
emptyLabel: colDef.typeOptions.emptyLabel,
|
|
3089
2488
|
...colDef.typeOptions.imageVariant ? { imageVariant: colDef.typeOptions.imageVariant } : {}
|
|
@@ -3093,7 +2492,7 @@ var renderCell = (row, column, locale = "en", labels = dataTableMessages(locale)
|
|
|
3093
2492
|
if (colDef.valueFormatter)
|
|
3094
2493
|
return colDef.valueFormatter(params);
|
|
3095
2494
|
const number = Option4.getOrUndefined(decodeNumberValue(value));
|
|
3096
|
-
return /* @__PURE__ */
|
|
2495
|
+
return /* @__PURE__ */ jsx3("span", {
|
|
3097
2496
|
className: "block text-left tabular-nums",
|
|
3098
2497
|
children: number === undefined ? colDef.typeOptions?.emptyLabel ?? "—" : formatNumberValue(number, colDef.typeOptions, locale)
|
|
3099
2498
|
});
|
|
@@ -3105,12 +2504,12 @@ var renderCell = (row, column, locale = "en", labels = dataTableMessages(locale)
|
|
|
3105
2504
|
if (boolean === undefined)
|
|
3106
2505
|
return colDef.typeOptions?.emptyLabel ?? "—";
|
|
3107
2506
|
const options = colDef.typeOptions;
|
|
3108
|
-
return /* @__PURE__ */
|
|
2507
|
+
return /* @__PURE__ */ jsx3("label", {
|
|
3109
2508
|
"data-slot": "data-table-boolean-cell",
|
|
3110
|
-
className: cn(
|
|
2509
|
+
className: cn(booleanCellControl, options?.onChange && !options.disabled?.(row.data) && "hover:bg-muted/50 cursor-pointer"),
|
|
3111
2510
|
onClick: (event) => event.stopPropagation(),
|
|
3112
2511
|
onPointerDown: (event) => event.stopPropagation(),
|
|
3113
|
-
children: /* @__PURE__ */
|
|
2512
|
+
children: /* @__PURE__ */ jsx3(Checkbox, {
|
|
3114
2513
|
"aria-label": options?.getAriaLabel?.(row.data) ?? columnLabel(column),
|
|
3115
2514
|
className: "focus-visible:ring-0 focus-visible:outline-none",
|
|
3116
2515
|
checked: boolean,
|
|
@@ -3124,7 +2523,7 @@ var renderCell = (row, column, locale = "en", labels = dataTableMessages(locale)
|
|
|
3124
2523
|
if (colDef.valueFormatter)
|
|
3125
2524
|
return colDef.valueFormatter(params);
|
|
3126
2525
|
const date = resolveDate(value, colDef.type);
|
|
3127
|
-
return date ? /* @__PURE__ */
|
|
2526
|
+
return date ? /* @__PURE__ */ jsx3("time", {
|
|
3128
2527
|
dateTime: dateIsoValue(date),
|
|
3129
2528
|
children: formatDateValue(date, colDef, locale)
|
|
3130
2529
|
}) : colDef.typeOptions?.emptyLabel ?? "—";
|
|
@@ -3138,7 +2537,7 @@ var renderCell = (row, column, locale = "en", labels = dataTableMessages(locale)
|
|
|
3138
2537
|
disabled: (item) => action.disabled?.({ item, row: row.data }) ?? false
|
|
3139
2538
|
}));
|
|
3140
2539
|
if (config.getOptions) {
|
|
3141
|
-
return /* @__PURE__ */
|
|
2540
|
+
return /* @__PURE__ */ jsx3(DataTableListCell, {
|
|
3142
2541
|
...config,
|
|
3143
2542
|
itemActions,
|
|
3144
2543
|
onItemClick: config.onItemClick ? (item) => config.onItemClick?.({ item, row: row.data }) : undefined,
|
|
@@ -3151,7 +2550,7 @@ var renderCell = (row, column, locale = "en", labels = dataTableMessages(locale)
|
|
|
3151
2550
|
onRemove: config.onRemove ? (value) => config.onRemove?.({ value, row: row.data }) : undefined
|
|
3152
2551
|
});
|
|
3153
2552
|
}
|
|
3154
|
-
return /* @__PURE__ */
|
|
2553
|
+
return /* @__PURE__ */ jsx3(DataTableListCell, {
|
|
3155
2554
|
...config,
|
|
3156
2555
|
itemActions,
|
|
3157
2556
|
onItemClick: config.onItemClick ? (item) => config.onItemClick?.({ item, row: row.data }) : undefined,
|
|
@@ -3186,33 +2585,33 @@ var DataTableRowActions = ({
|
|
|
3186
2585
|
const visible = actions.filter((action) => !action.visible || action.visible(row));
|
|
3187
2586
|
if (!visible.length)
|
|
3188
2587
|
return null;
|
|
3189
|
-
return /* @__PURE__ */
|
|
2588
|
+
return /* @__PURE__ */ jsxs3(DropdownMenu, {
|
|
3190
2589
|
children: [
|
|
3191
|
-
/* @__PURE__ */
|
|
2590
|
+
/* @__PURE__ */ jsx3(DropdownMenuTrigger, {
|
|
3192
2591
|
onClick: (event) => event.stopPropagation(),
|
|
3193
|
-
render: /* @__PURE__ */
|
|
2592
|
+
render: /* @__PURE__ */ jsxs3(Button2, {
|
|
3194
2593
|
className: cn(tableClasses.actionTrigger, "[&_svg:not([class*='size-'])]:size-4"),
|
|
3195
2594
|
size: "icon",
|
|
3196
2595
|
variant: "ghost",
|
|
3197
2596
|
children: [
|
|
3198
|
-
/* @__PURE__ */
|
|
2597
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3199
2598
|
className: "sr-only",
|
|
3200
2599
|
children: title
|
|
3201
2600
|
}),
|
|
3202
|
-
/* @__PURE__ */
|
|
2601
|
+
/* @__PURE__ */ jsx3(MoreHorizontal, {})
|
|
3203
2602
|
]
|
|
3204
2603
|
})
|
|
3205
2604
|
}),
|
|
3206
|
-
/* @__PURE__ */
|
|
2605
|
+
/* @__PURE__ */ jsx3(DropdownMenuContent, {
|
|
3207
2606
|
align: "end",
|
|
3208
2607
|
className: "w-max",
|
|
3209
|
-
children: /* @__PURE__ */
|
|
2608
|
+
children: /* @__PURE__ */ jsxs3(DropdownMenuGroup, {
|
|
3210
2609
|
children: [
|
|
3211
|
-
/* @__PURE__ */
|
|
2610
|
+
/* @__PURE__ */ jsx3(DropdownMenuLabel, {
|
|
3212
2611
|
children: title
|
|
3213
2612
|
}),
|
|
3214
|
-
/* @__PURE__ */
|
|
3215
|
-
visible.map((action) => /* @__PURE__ */
|
|
2613
|
+
/* @__PURE__ */ jsx3(DropdownMenuSeparator, {}),
|
|
2614
|
+
visible.map((action) => /* @__PURE__ */ jsxs3(DropdownMenuItem, {
|
|
3216
2615
|
onClick: (event) => {
|
|
3217
2616
|
event.stopPropagation();
|
|
3218
2617
|
action.onClick(row);
|
|
@@ -3247,7 +2646,7 @@ var DataTableRowActionMenu = ({
|
|
|
3247
2646
|
reorderActions.push({
|
|
3248
2647
|
id: "data-table-move-up",
|
|
3249
2648
|
name: store.config.labels.moveUp,
|
|
3250
|
-
icon: /* @__PURE__ */
|
|
2649
|
+
icon: /* @__PURE__ */ jsx3(ArrowUp, {}),
|
|
3251
2650
|
onClick: () => move(rowIndex - 1)
|
|
3252
2651
|
});
|
|
3253
2652
|
}
|
|
@@ -3255,12 +2654,12 @@ var DataTableRowActionMenu = ({
|
|
|
3255
2654
|
reorderActions.push({
|
|
3256
2655
|
id: "data-table-move-down",
|
|
3257
2656
|
name: store.config.labels.moveDown,
|
|
3258
|
-
icon: /* @__PURE__ */
|
|
2657
|
+
icon: /* @__PURE__ */ jsx3(ArrowDown, {}),
|
|
3259
2658
|
onClick: () => move(rowIndex + 1)
|
|
3260
2659
|
});
|
|
3261
2660
|
}
|
|
3262
2661
|
}
|
|
3263
|
-
return /* @__PURE__ */
|
|
2662
|
+
return /* @__PURE__ */ jsx3(DataTableRowActions, {
|
|
3264
2663
|
actions: [...reorderActions, ...rowActions ? rowActions.items : []],
|
|
3265
2664
|
row: row.data,
|
|
3266
2665
|
title: rowActions?.label ?? store.config.labels.actions
|
|
@@ -3306,60 +2705,60 @@ var DataTableToolbar = ({
|
|
|
3306
2705
|
send(DataTableMessage.ExportFinished({ failed }));
|
|
3307
2706
|
}
|
|
3308
2707
|
};
|
|
3309
|
-
return /* @__PURE__ */
|
|
2708
|
+
return /* @__PURE__ */ jsxs3("div", {
|
|
3310
2709
|
className: cn(tableClasses.toolbar, "pb-4"),
|
|
3311
2710
|
children: [
|
|
3312
|
-
features.search !== false ? /* @__PURE__ */
|
|
2711
|
+
features.search !== false ? /* @__PURE__ */ jsxs3("div", {
|
|
3313
2712
|
className: tableClasses.toolbarSearch,
|
|
3314
2713
|
children: [
|
|
3315
|
-
/* @__PURE__ */
|
|
2714
|
+
/* @__PURE__ */ jsx3(Search, {
|
|
3316
2715
|
className: "text-muted-foreground pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2"
|
|
3317
2716
|
}),
|
|
3318
|
-
/* @__PURE__ */
|
|
2717
|
+
/* @__PURE__ */ jsx3(Input, {
|
|
3319
2718
|
className: "px-9",
|
|
3320
2719
|
onChange: (event) => send(DataTableMessage.SearchChanged({ value: event.target.value })),
|
|
3321
2720
|
placeholder: labels.filter,
|
|
3322
2721
|
value: store.state.globalFilter ?? ""
|
|
3323
2722
|
}),
|
|
3324
|
-
store.state.globalFilter ? /* @__PURE__ */
|
|
2723
|
+
store.state.globalFilter ? /* @__PURE__ */ jsx3(Button2, {
|
|
3325
2724
|
"aria-label": labels.filter,
|
|
3326
2725
|
className: "absolute top-1/2 right-1 size-7 -translate-y-1/2 active:not-aria-[haspopup]:-translate-y-1/2",
|
|
3327
2726
|
onClick: () => send(DataTableMessage.SearchChanged({ value: "" })),
|
|
3328
2727
|
size: "icon",
|
|
3329
2728
|
variant: "ghost",
|
|
3330
|
-
children: /* @__PURE__ */
|
|
2729
|
+
children: /* @__PURE__ */ jsx3(X, {})
|
|
3331
2730
|
}) : null
|
|
3332
2731
|
]
|
|
3333
2732
|
}) : null,
|
|
3334
|
-
/* @__PURE__ */
|
|
2733
|
+
/* @__PURE__ */ jsx3("div", {
|
|
3335
2734
|
className: tableClasses.toolbarMenus,
|
|
3336
|
-
children: /* @__PURE__ */
|
|
2735
|
+
children: /* @__PURE__ */ jsxs3(Menubar, {
|
|
3337
2736
|
modal: false,
|
|
3338
2737
|
className: cn(tableClasses.menubar, "[&_[data-slot=menubar-trigger]]:gap-2 [&_[data-slot=menubar-trigger]_svg]:size-4"),
|
|
3339
2738
|
children: [
|
|
3340
|
-
visibleBulkActions.length ? /* @__PURE__ */
|
|
2739
|
+
visibleBulkActions.length ? /* @__PURE__ */ jsxs3(MenubarMenu, {
|
|
3341
2740
|
children: [
|
|
3342
|
-
/* @__PURE__ */
|
|
2741
|
+
/* @__PURE__ */ jsxs3(MenubarTrigger, {
|
|
3343
2742
|
className: cn(tableClasses.selectedTrigger, "aria-expanded:bg-primary/90"),
|
|
3344
2743
|
children: [
|
|
3345
2744
|
labels.selected,
|
|
3346
|
-
/* @__PURE__ */
|
|
2745
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3347
2746
|
className: tableClasses.count,
|
|
3348
2747
|
children: selectedRows.length
|
|
3349
2748
|
}),
|
|
3350
|
-
/* @__PURE__ */
|
|
2749
|
+
/* @__PURE__ */ jsx3(ChevronDown, {})
|
|
3351
2750
|
]
|
|
3352
2751
|
}),
|
|
3353
|
-
/* @__PURE__ */
|
|
2752
|
+
/* @__PURE__ */ jsx3(MenubarContent, {
|
|
3354
2753
|
align: "end",
|
|
3355
2754
|
className: "w-max",
|
|
3356
|
-
children: /* @__PURE__ */
|
|
2755
|
+
children: /* @__PURE__ */ jsxs3(MenubarGroup, {
|
|
3357
2756
|
children: [
|
|
3358
|
-
/* @__PURE__ */
|
|
2757
|
+
/* @__PURE__ */ jsx3(MenubarLabel, {
|
|
3359
2758
|
children: bulkActions && bulkActions.label ? bulkActions.label : labels.actions
|
|
3360
2759
|
}),
|
|
3361
|
-
/* @__PURE__ */
|
|
3362
|
-
visibleBulkActions.map((action) => /* @__PURE__ */
|
|
2760
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
2761
|
+
visibleBulkActions.map((action) => /* @__PURE__ */ jsxs3(MenubarItem, {
|
|
3363
2762
|
onClick: () => action.onClick(selectedRows),
|
|
3364
2763
|
variant: action.variant ?? "default",
|
|
3365
2764
|
children: [
|
|
@@ -3373,30 +2772,30 @@ var DataTableToolbar = ({
|
|
|
3373
2772
|
]
|
|
3374
2773
|
}) : null,
|
|
3375
2774
|
toolbar && toolbar.items,
|
|
3376
|
-
features.filtering !== false ? /* @__PURE__ */
|
|
2775
|
+
features.filtering !== false ? /* @__PURE__ */ jsx3(FilterMenu, {
|
|
3377
2776
|
table
|
|
3378
2777
|
}) : null,
|
|
3379
|
-
grouping ? /* @__PURE__ */
|
|
2778
|
+
grouping ? /* @__PURE__ */ jsxs3(MenubarMenu, {
|
|
3380
2779
|
children: [
|
|
3381
|
-
/* @__PURE__ */
|
|
2780
|
+
/* @__PURE__ */ jsxs3(MenubarTrigger, {
|
|
3382
2781
|
"aria-label": labels.groupBy,
|
|
3383
2782
|
children: [
|
|
3384
|
-
/* @__PURE__ */
|
|
3385
|
-
/* @__PURE__ */
|
|
2783
|
+
/* @__PURE__ */ jsx3(Rows3, {}),
|
|
2784
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3386
2785
|
className: "hidden sm:inline",
|
|
3387
2786
|
children: labels.groupBy
|
|
3388
2787
|
})
|
|
3389
2788
|
]
|
|
3390
2789
|
}),
|
|
3391
|
-
/* @__PURE__ */
|
|
2790
|
+
/* @__PURE__ */ jsx3(MenubarContent, {
|
|
3392
2791
|
align: "end",
|
|
3393
|
-
children: /* @__PURE__ */
|
|
2792
|
+
children: /* @__PURE__ */ jsxs3(MenubarGroup, {
|
|
3394
2793
|
children: [
|
|
3395
|
-
/* @__PURE__ */
|
|
2794
|
+
/* @__PURE__ */ jsx3(MenubarLabel, {
|
|
3396
2795
|
children: labels.groupBy
|
|
3397
2796
|
}),
|
|
3398
|
-
/* @__PURE__ */
|
|
3399
|
-
grouping.fields.map((field) => /* @__PURE__ */
|
|
2797
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
2798
|
+
grouping.fields.map((field) => /* @__PURE__ */ jsx3(MenubarCheckboxItem, {
|
|
3400
2799
|
checked: store.state.grouping.includes(field.id),
|
|
3401
2800
|
onCheckedChange: () => send(DataTableMessage.GroupingToggled({ fieldId: field.id })),
|
|
3402
2801
|
children: field.label
|
|
@@ -3406,77 +2805,77 @@ var DataTableToolbar = ({
|
|
|
3406
2805
|
})
|
|
3407
2806
|
]
|
|
3408
2807
|
}) : null,
|
|
3409
|
-
features.sorting !== false ? /* @__PURE__ */
|
|
2808
|
+
features.sorting !== false ? /* @__PURE__ */ jsx3(SortMenu, {
|
|
3410
2809
|
table
|
|
3411
2810
|
}) : null,
|
|
3412
|
-
features.gallery ? /* @__PURE__ */
|
|
2811
|
+
features.gallery ? /* @__PURE__ */ jsx3(ViewMenu, {
|
|
3413
2812
|
table
|
|
3414
2813
|
}) : null,
|
|
3415
|
-
features.columnVisibility !== false ? /* @__PURE__ */
|
|
2814
|
+
features.columnVisibility !== false ? /* @__PURE__ */ jsx3(ColumnMenu, {
|
|
3416
2815
|
table
|
|
3417
2816
|
}) : null,
|
|
3418
|
-
features.refresh ? /* @__PURE__ */
|
|
3419
|
-
children: /* @__PURE__ */
|
|
2817
|
+
features.refresh ? /* @__PURE__ */ jsx3(MenubarMenu, {
|
|
2818
|
+
children: /* @__PURE__ */ jsxs3(MenubarTrigger, {
|
|
3420
2819
|
"aria-label": labels.refresh,
|
|
3421
2820
|
onClick: features.refresh,
|
|
3422
2821
|
children: [
|
|
3423
|
-
/* @__PURE__ */
|
|
3424
|
-
/* @__PURE__ */
|
|
2822
|
+
/* @__PURE__ */ jsx3(RefreshCw, {}),
|
|
2823
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3425
2824
|
className: "hidden sm:inline",
|
|
3426
2825
|
children: labels.refresh
|
|
3427
2826
|
})
|
|
3428
2827
|
]
|
|
3429
2828
|
})
|
|
3430
2829
|
}) : null,
|
|
3431
|
-
features.export ? /* @__PURE__ */
|
|
2830
|
+
features.export ? /* @__PURE__ */ jsxs3(MenubarMenu, {
|
|
3432
2831
|
children: [
|
|
3433
|
-
/* @__PURE__ */
|
|
2832
|
+
/* @__PURE__ */ jsxs3(MenubarTrigger, {
|
|
3434
2833
|
"aria-label": labels.export,
|
|
3435
2834
|
"aria-busy": exporting,
|
|
3436
2835
|
disabled: exporting || !canExport,
|
|
3437
2836
|
children: [
|
|
3438
|
-
exporting ? /* @__PURE__ */
|
|
2837
|
+
exporting ? /* @__PURE__ */ jsx3(RefreshCw, {
|
|
3439
2838
|
className: "animate-spin"
|
|
3440
|
-
}) : /* @__PURE__ */
|
|
3441
|
-
/* @__PURE__ */
|
|
2839
|
+
}) : /* @__PURE__ */ jsx3(Download, {}),
|
|
2840
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3442
2841
|
className: "hidden sm:inline",
|
|
3443
2842
|
children: exporting ? labels.loading : labels.export
|
|
3444
2843
|
})
|
|
3445
2844
|
]
|
|
3446
2845
|
}),
|
|
3447
|
-
/* @__PURE__ */
|
|
2846
|
+
/* @__PURE__ */ jsx3(MenubarContent, {
|
|
3448
2847
|
align: "end",
|
|
3449
|
-
children: /* @__PURE__ */
|
|
2848
|
+
children: /* @__PURE__ */ jsxs3(MenubarGroup, {
|
|
3450
2849
|
children: [
|
|
3451
|
-
/* @__PURE__ */
|
|
2850
|
+
/* @__PURE__ */ jsx3(MenubarLabel, {
|
|
3452
2851
|
children: labels.export
|
|
3453
2852
|
}),
|
|
3454
|
-
/* @__PURE__ */
|
|
3455
|
-
builtInExport ? /* @__PURE__ */
|
|
2853
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
2854
|
+
builtInExport ? /* @__PURE__ */ jsxs3(Fragment, {
|
|
3456
2855
|
children: [
|
|
3457
|
-
/* @__PURE__ */
|
|
2856
|
+
/* @__PURE__ */ jsxs3(MenubarItem, {
|
|
3458
2857
|
disabled: exporting || !exportRows.length,
|
|
3459
2858
|
onClick: () => downloadCsv(exportColumns.map(columnLabel), exportRows.map((row) => exportColumns.map((column) => dataTableValueText(getDataTableExportValue(row, column, store.config.locale) ?? ""))), features.export ? features.export.baseName : "table"),
|
|
3460
2859
|
children: [
|
|
3461
|
-
/* @__PURE__ */
|
|
2860
|
+
/* @__PURE__ */ jsx3(FileText, {}),
|
|
3462
2861
|
labels.exportCsv
|
|
3463
2862
|
]
|
|
3464
2863
|
}),
|
|
3465
|
-
/* @__PURE__ */
|
|
2864
|
+
/* @__PURE__ */ jsxs3(MenubarItem, {
|
|
3466
2865
|
disabled: exporting || !exportRows.length,
|
|
3467
2866
|
onClick: () => downloadJson(exportRows.map((row) => Object.fromEntries(exportColumns.map((column) => [
|
|
3468
2867
|
column.id,
|
|
3469
2868
|
getDataTableExportValue(row, column, store.config.locale)
|
|
3470
2869
|
]))), features.export ? features.export.baseName : "table"),
|
|
3471
2870
|
children: [
|
|
3472
|
-
/* @__PURE__ */
|
|
2871
|
+
/* @__PURE__ */ jsx3(FileJson, {}),
|
|
3473
2872
|
labels.exportJson
|
|
3474
2873
|
]
|
|
3475
2874
|
})
|
|
3476
2875
|
]
|
|
3477
2876
|
}) : null,
|
|
3478
|
-
builtInExport && exportActions.length ? /* @__PURE__ */
|
|
3479
|
-
exportActions.map((action) => /* @__PURE__ */
|
|
2877
|
+
builtInExport && exportActions.length ? /* @__PURE__ */ jsx3(MenubarSeparator, {}) : null,
|
|
2878
|
+
exportActions.map((action) => /* @__PURE__ */ jsxs3(MenubarItem, {
|
|
3480
2879
|
disabled: exporting || action.disabled,
|
|
3481
2880
|
onClick: () => void runExport(action),
|
|
3482
2881
|
children: [
|
|
@@ -3492,7 +2891,7 @@ var DataTableToolbar = ({
|
|
|
3492
2891
|
]
|
|
3493
2892
|
})
|
|
3494
2893
|
}),
|
|
3495
|
-
exportFeature && exportFailed ? /* @__PURE__ */
|
|
2894
|
+
exportFeature && exportFailed ? /* @__PURE__ */ jsx3("p", {
|
|
3496
2895
|
role: "alert",
|
|
3497
2896
|
className: "text-destructive basis-full text-sm",
|
|
3498
2897
|
children: labels.exportFailed ?? dataTableMessages(store.config.locale).exportFailed
|
|
@@ -3529,26 +2928,26 @@ var FilterEditor = ({
|
|
|
3529
2928
|
onChange(decoded.value);
|
|
3530
2929
|
};
|
|
3531
2930
|
if (kind === "boolean") {
|
|
3532
|
-
return /* @__PURE__ */
|
|
2931
|
+
return /* @__PURE__ */ jsxs3(MenubarGroup, {
|
|
3533
2932
|
children: [
|
|
3534
|
-
/* @__PURE__ */
|
|
2933
|
+
/* @__PURE__ */ jsxs3(MenubarRadioGroup, {
|
|
3535
2934
|
value: current?.kind === "boolean" ? String(current.value) : "",
|
|
3536
2935
|
onValueChange: (value) => apply({ ...draft, primary: value }),
|
|
3537
2936
|
children: [
|
|
3538
|
-
/* @__PURE__ */
|
|
2937
|
+
/* @__PURE__ */ jsx3(MenubarRadioItem, {
|
|
3539
2938
|
value: "true",
|
|
3540
2939
|
closeOnClick: false,
|
|
3541
2940
|
children: column.colDef.type === "boolean" ? column.colDef.typeOptions?.trueLabel ?? labels.filterTrue : labels.filterTrue
|
|
3542
2941
|
}),
|
|
3543
|
-
/* @__PURE__ */
|
|
2942
|
+
/* @__PURE__ */ jsx3(MenubarRadioItem, {
|
|
3544
2943
|
value: "false",
|
|
3545
2944
|
closeOnClick: false,
|
|
3546
2945
|
children: column.colDef.type === "boolean" ? column.colDef.typeOptions?.falseLabel ?? labels.filterFalse : labels.filterFalse
|
|
3547
2946
|
})
|
|
3548
2947
|
]
|
|
3549
2948
|
}),
|
|
3550
|
-
/* @__PURE__ */
|
|
3551
|
-
/* @__PURE__ */
|
|
2949
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
2950
|
+
/* @__PURE__ */ jsx3(MenubarItem, {
|
|
3552
2951
|
closeOnClick: false,
|
|
3553
2952
|
onClick: () => onChange(undefined),
|
|
3554
2953
|
children: labels.filterClear
|
|
@@ -3560,11 +2959,11 @@ var FilterEditor = ({
|
|
|
3560
2959
|
const selected = current?.kind === "values" ? current.values : [];
|
|
3561
2960
|
const options = getDataTableFilterOptions(rows, column);
|
|
3562
2961
|
const filteredOptions = options.filter((option) => option.label.toLocaleLowerCase().includes(optionSearch.trim().toLocaleLowerCase()));
|
|
3563
|
-
return /* @__PURE__ */
|
|
2962
|
+
return /* @__PURE__ */ jsxs3(MenubarGroup, {
|
|
3564
2963
|
children: [
|
|
3565
|
-
options.length > 8 ? /* @__PURE__ */
|
|
2964
|
+
options.length > 8 ? /* @__PURE__ */ jsx3("div", {
|
|
3566
2965
|
className: "p-1",
|
|
3567
|
-
children: /* @__PURE__ */
|
|
2966
|
+
children: /* @__PURE__ */ jsx3(Input, {
|
|
3568
2967
|
"aria-label": labels.filter,
|
|
3569
2968
|
placeholder: labels.filter,
|
|
3570
2969
|
value: optionSearch,
|
|
@@ -3575,7 +2974,7 @@ var FilterEditor = ({
|
|
|
3575
2974
|
}
|
|
3576
2975
|
})
|
|
3577
2976
|
}) : null,
|
|
3578
|
-
filteredOptions.map((option) => /* @__PURE__ */
|
|
2977
|
+
filteredOptions.map((option) => /* @__PURE__ */ jsxs3(MenubarCheckboxItem, {
|
|
3579
2978
|
checked: selected.includes(option.value),
|
|
3580
2979
|
closeOnClick: false,
|
|
3581
2980
|
onCheckedChange: (checked) => {
|
|
@@ -3586,23 +2985,23 @@ var FilterEditor = ({
|
|
|
3586
2985
|
onChange(undefined);
|
|
3587
2986
|
},
|
|
3588
2987
|
children: [
|
|
3589
|
-
/* @__PURE__ */
|
|
2988
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3590
2989
|
className: "min-w-0 flex-1 truncate",
|
|
3591
2990
|
children: option.label
|
|
3592
2991
|
}),
|
|
3593
|
-
option.count !== undefined ? /* @__PURE__ */
|
|
2992
|
+
option.count !== undefined ? /* @__PURE__ */ jsx3(Badge, {
|
|
3594
2993
|
variant: "secondary",
|
|
3595
2994
|
className: "ml-auto shrink-0",
|
|
3596
2995
|
children: option.count
|
|
3597
2996
|
}) : null
|
|
3598
2997
|
]
|
|
3599
2998
|
}, option.value)),
|
|
3600
|
-
!filteredOptions.length ? /* @__PURE__ */
|
|
2999
|
+
!filteredOptions.length ? /* @__PURE__ */ jsx3("div", {
|
|
3601
3000
|
className: "text-muted-foreground px-2 py-1.5 text-sm",
|
|
3602
3001
|
children: labels.empty
|
|
3603
3002
|
}) : null,
|
|
3604
|
-
/* @__PURE__ */
|
|
3605
|
-
/* @__PURE__ */
|
|
3003
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
3004
|
+
/* @__PURE__ */ jsx3(MenubarItem, {
|
|
3606
3005
|
closeOnClick: false,
|
|
3607
3006
|
onClick: () => onChange(undefined),
|
|
3608
3007
|
children: labels.filterClear
|
|
@@ -3610,7 +3009,7 @@ var FilterEditor = ({
|
|
|
3610
3009
|
]
|
|
3611
3010
|
});
|
|
3612
3011
|
}
|
|
3613
|
-
return /* @__PURE__ */
|
|
3012
|
+
return /* @__PURE__ */ jsxs3("form", {
|
|
3614
3013
|
className: "flex flex-col gap-3 p-2",
|
|
3615
3014
|
onKeyDown: (event) => {
|
|
3616
3015
|
if (event.key !== "Escape")
|
|
@@ -3621,15 +3020,15 @@ var FilterEditor = ({
|
|
|
3621
3020
|
apply(draft);
|
|
3622
3021
|
},
|
|
3623
3022
|
children: [
|
|
3624
|
-
/* @__PURE__ */
|
|
3023
|
+
/* @__PURE__ */ jsxs3(FieldGroup, {
|
|
3625
3024
|
children: [
|
|
3626
|
-
kind === "text" ? /* @__PURE__ */
|
|
3025
|
+
kind === "text" ? /* @__PURE__ */ jsxs3(Field, {
|
|
3627
3026
|
children: [
|
|
3628
|
-
/* @__PURE__ */
|
|
3027
|
+
/* @__PURE__ */ jsx3(FieldLabel, {
|
|
3629
3028
|
htmlFor: `${inputId}-operator`,
|
|
3630
3029
|
children: labels.filterOperator
|
|
3631
3030
|
}),
|
|
3632
|
-
/* @__PURE__ */
|
|
3031
|
+
/* @__PURE__ */ jsxs3(Select2, {
|
|
3633
3032
|
items: operatorOptions,
|
|
3634
3033
|
value: operator,
|
|
3635
3034
|
onValueChange: (value) => {
|
|
@@ -3638,13 +3037,13 @@ var FilterEditor = ({
|
|
|
3638
3037
|
setDraft({ ...draft, operator: decoded.value });
|
|
3639
3038
|
},
|
|
3640
3039
|
children: [
|
|
3641
|
-
/* @__PURE__ */
|
|
3040
|
+
/* @__PURE__ */ jsx3(SelectTrigger2, {
|
|
3642
3041
|
id: `${inputId}-operator`,
|
|
3643
|
-
children: /* @__PURE__ */
|
|
3042
|
+
children: /* @__PURE__ */ jsx3(SelectValue2, {})
|
|
3644
3043
|
}),
|
|
3645
|
-
/* @__PURE__ */
|
|
3646
|
-
children: /* @__PURE__ */
|
|
3647
|
-
children: operatorOptions.map((option) => /* @__PURE__ */
|
|
3044
|
+
/* @__PURE__ */ jsx3(SelectContent2, {
|
|
3045
|
+
children: /* @__PURE__ */ jsx3(SelectGroup, {
|
|
3046
|
+
children: operatorOptions.map((option) => /* @__PURE__ */ jsx3(SelectItem2, {
|
|
3648
3047
|
value: option.value,
|
|
3649
3048
|
children: option.label
|
|
3650
3049
|
}, option.value))
|
|
@@ -3654,14 +3053,14 @@ var FilterEditor = ({
|
|
|
3654
3053
|
})
|
|
3655
3054
|
]
|
|
3656
3055
|
}) : null,
|
|
3657
|
-
/* @__PURE__ */
|
|
3056
|
+
/* @__PURE__ */ jsxs3(Field, {
|
|
3658
3057
|
"data-invalid": invalid || undefined,
|
|
3659
3058
|
children: [
|
|
3660
|
-
/* @__PURE__ */
|
|
3059
|
+
/* @__PURE__ */ jsx3(FieldLabel, {
|
|
3661
3060
|
htmlFor: `${inputId}-primary`,
|
|
3662
3061
|
children: kind === "text" ? labels.filterValue : kind === "date" ? labels.filterFrom : labels.filterMin
|
|
3663
3062
|
}),
|
|
3664
|
-
/* @__PURE__ */
|
|
3063
|
+
/* @__PURE__ */ jsx3(Input, {
|
|
3665
3064
|
id: `${inputId}-primary`,
|
|
3666
3065
|
type: kind === "text" ? "text" : kind === "date" ? "date" : "number",
|
|
3667
3066
|
step: kind === "number" ? "any" : undefined,
|
|
@@ -3674,14 +3073,14 @@ var FilterEditor = ({
|
|
|
3674
3073
|
})
|
|
3675
3074
|
]
|
|
3676
3075
|
}),
|
|
3677
|
-
kind !== "text" ? /* @__PURE__ */
|
|
3076
|
+
kind !== "text" ? /* @__PURE__ */ jsxs3(Field, {
|
|
3678
3077
|
"data-invalid": invalid || undefined,
|
|
3679
3078
|
children: [
|
|
3680
|
-
/* @__PURE__ */
|
|
3079
|
+
/* @__PURE__ */ jsx3(FieldLabel, {
|
|
3681
3080
|
htmlFor: `${inputId}-secondary`,
|
|
3682
3081
|
children: kind === "date" ? labels.filterTo : labels.filterMax
|
|
3683
3082
|
}),
|
|
3684
|
-
/* @__PURE__ */
|
|
3083
|
+
/* @__PURE__ */ jsx3(Input, {
|
|
3685
3084
|
id: `${inputId}-secondary`,
|
|
3686
3085
|
type: kind === "date" ? "date" : "number",
|
|
3687
3086
|
step: kind === "number" ? "any" : undefined,
|
|
@@ -3696,20 +3095,20 @@ var FilterEditor = ({
|
|
|
3696
3095
|
}) : null
|
|
3697
3096
|
]
|
|
3698
3097
|
}),
|
|
3699
|
-
invalid ? /* @__PURE__ */
|
|
3098
|
+
invalid ? /* @__PURE__ */ jsx3("p", {
|
|
3700
3099
|
role: "alert",
|
|
3701
3100
|
className: "text-destructive text-sm",
|
|
3702
3101
|
children: labels.filterInvalid
|
|
3703
3102
|
}) : null,
|
|
3704
|
-
/* @__PURE__ */
|
|
3103
|
+
/* @__PURE__ */ jsxs3("div", {
|
|
3705
3104
|
className: "flex gap-2",
|
|
3706
3105
|
children: [
|
|
3707
|
-
/* @__PURE__ */
|
|
3106
|
+
/* @__PURE__ */ jsx3(Button2, {
|
|
3708
3107
|
type: "submit",
|
|
3709
3108
|
size: "sm",
|
|
3710
3109
|
children: labels.filterApply
|
|
3711
3110
|
}),
|
|
3712
|
-
/* @__PURE__ */
|
|
3111
|
+
/* @__PURE__ */ jsx3(Button2, {
|
|
3713
3112
|
type: "button",
|
|
3714
3113
|
size: "sm",
|
|
3715
3114
|
variant: "outline",
|
|
@@ -3738,45 +3137,45 @@ var FilterMenu = ({
|
|
|
3738
3137
|
return null;
|
|
3739
3138
|
const filters = store.state.filters ?? [];
|
|
3740
3139
|
const update = (id, filter) => send(DataTableMessage.ColumnFilterChanged({ id, filter: filter ?? null }));
|
|
3741
|
-
return /* @__PURE__ */
|
|
3140
|
+
return /* @__PURE__ */ jsxs3(MenubarMenu, {
|
|
3742
3141
|
children: [
|
|
3743
|
-
/* @__PURE__ */
|
|
3142
|
+
/* @__PURE__ */ jsxs3(MenubarTrigger, {
|
|
3744
3143
|
"aria-label": store.config.labels.filters,
|
|
3745
3144
|
children: [
|
|
3746
|
-
/* @__PURE__ */
|
|
3747
|
-
/* @__PURE__ */
|
|
3145
|
+
/* @__PURE__ */ jsx3(ListFilter, {}),
|
|
3146
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3748
3147
|
className: "hidden sm:inline",
|
|
3749
3148
|
children: store.config.labels.filters
|
|
3750
3149
|
}),
|
|
3751
|
-
filters.length ? /* @__PURE__ */
|
|
3150
|
+
filters.length ? /* @__PURE__ */ jsx3(Badge, {
|
|
3752
3151
|
variant: "secondary",
|
|
3753
3152
|
children: filters.length
|
|
3754
3153
|
}) : null
|
|
3755
3154
|
]
|
|
3756
3155
|
}),
|
|
3757
|
-
/* @__PURE__ */
|
|
3156
|
+
/* @__PURE__ */ jsx3(MenubarContent, {
|
|
3758
3157
|
align: "end",
|
|
3759
3158
|
className: "w-80 max-w-[calc(100vw-2rem)]",
|
|
3760
|
-
children: /* @__PURE__ */
|
|
3159
|
+
children: /* @__PURE__ */ jsxs3(MenubarGroup, {
|
|
3761
3160
|
children: [
|
|
3762
|
-
/* @__PURE__ */
|
|
3161
|
+
/* @__PURE__ */ jsx3(MenubarLabel, {
|
|
3763
3162
|
children: store.config.labels.filters
|
|
3764
3163
|
}),
|
|
3765
|
-
/* @__PURE__ */
|
|
3766
|
-
columns.map(({ column, label }) => /* @__PURE__ */
|
|
3164
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
3165
|
+
columns.map(({ column, label }) => /* @__PURE__ */ jsxs3(MenubarSub, {
|
|
3767
3166
|
children: [
|
|
3768
|
-
/* @__PURE__ */
|
|
3167
|
+
/* @__PURE__ */ jsxs3(MenubarSubTrigger, {
|
|
3769
3168
|
children: [
|
|
3770
|
-
/* @__PURE__ */
|
|
3169
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3771
3170
|
className: "min-w-0 flex-1 truncate",
|
|
3772
3171
|
children: label
|
|
3773
3172
|
}),
|
|
3774
|
-
filters.some((filter) => filter.id === column.id) ? /* @__PURE__ */
|
|
3173
|
+
filters.some((filter) => filter.id === column.id) ? /* @__PURE__ */ jsx3(Check, {}) : null
|
|
3775
3174
|
]
|
|
3776
3175
|
}),
|
|
3777
|
-
/* @__PURE__ */
|
|
3176
|
+
/* @__PURE__ */ jsx3(MenubarSubContent, {
|
|
3778
3177
|
className: "w-80 max-w-[calc(100vw-2rem)]",
|
|
3779
|
-
children: /* @__PURE__ */
|
|
3178
|
+
children: /* @__PURE__ */ jsx3(FilterEditor, {
|
|
3780
3179
|
column,
|
|
3781
3180
|
rows: model.rows,
|
|
3782
3181
|
current: filters.find((filter) => filter.id === column.id),
|
|
@@ -3786,13 +3185,13 @@ var FilterMenu = ({
|
|
|
3786
3185
|
})
|
|
3787
3186
|
]
|
|
3788
3187
|
}, column.id)),
|
|
3789
|
-
filters.length ? /* @__PURE__ */
|
|
3188
|
+
filters.length ? /* @__PURE__ */ jsxs3(Fragment, {
|
|
3790
3189
|
children: [
|
|
3791
|
-
/* @__PURE__ */
|
|
3792
|
-
/* @__PURE__ */
|
|
3190
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
3191
|
+
/* @__PURE__ */ jsxs3(MenubarItem, {
|
|
3793
3192
|
onClick: () => send(DataTableMessage.FiltersCleared()),
|
|
3794
3193
|
children: [
|
|
3795
|
-
/* @__PURE__ */
|
|
3194
|
+
/* @__PURE__ */ jsx3(X, {}),
|
|
3796
3195
|
store.config.labels.filtersClear
|
|
3797
3196
|
]
|
|
3798
3197
|
})
|
|
@@ -3819,65 +3218,65 @@ var SortMenu = ({
|
|
|
3819
3218
|
return null;
|
|
3820
3219
|
const current = store.state.sort?.[0];
|
|
3821
3220
|
const sort = (id, direction) => send(DataTableMessage.SortRequested({ columnId: id, direction }));
|
|
3822
|
-
return /* @__PURE__ */
|
|
3221
|
+
return /* @__PURE__ */ jsxs3(MenubarMenu, {
|
|
3823
3222
|
children: [
|
|
3824
|
-
/* @__PURE__ */
|
|
3223
|
+
/* @__PURE__ */ jsxs3(MenubarTrigger, {
|
|
3825
3224
|
"aria-label": store.config.labels.sortBy,
|
|
3826
3225
|
children: [
|
|
3827
|
-
current ? current.direction === "desc" ? /* @__PURE__ */
|
|
3828
|
-
/* @__PURE__ */
|
|
3226
|
+
current ? current.direction === "desc" ? /* @__PURE__ */ jsx3(ArrowDown, {}) : /* @__PURE__ */ jsx3(ArrowUp, {}) : /* @__PURE__ */ jsx3(ChevronsUpDown, {}),
|
|
3227
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3829
3228
|
className: "hidden sm:inline",
|
|
3830
3229
|
children: store.config.labels.sortBy
|
|
3831
3230
|
})
|
|
3832
3231
|
]
|
|
3833
3232
|
}),
|
|
3834
|
-
/* @__PURE__ */
|
|
3233
|
+
/* @__PURE__ */ jsx3(MenubarContent, {
|
|
3835
3234
|
align: "end",
|
|
3836
3235
|
className: "w-52",
|
|
3837
|
-
children: /* @__PURE__ */
|
|
3236
|
+
children: /* @__PURE__ */ jsxs3(MenubarGroup, {
|
|
3838
3237
|
children: [
|
|
3839
|
-
/* @__PURE__ */
|
|
3238
|
+
/* @__PURE__ */ jsx3(MenubarLabel, {
|
|
3840
3239
|
children: store.config.labels.sortBy
|
|
3841
3240
|
}),
|
|
3842
|
-
/* @__PURE__ */
|
|
3241
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
3843
3242
|
columns.map((column) => {
|
|
3844
3243
|
const sortState = store.state.sort?.find(({ id }) => id === column.id);
|
|
3845
|
-
return /* @__PURE__ */
|
|
3244
|
+
return /* @__PURE__ */ jsxs3(MenubarSub, {
|
|
3846
3245
|
children: [
|
|
3847
|
-
/* @__PURE__ */
|
|
3246
|
+
/* @__PURE__ */ jsxs3(MenubarSubTrigger, {
|
|
3848
3247
|
children: [
|
|
3849
|
-
sortState ? sortState.direction === "desc" ? /* @__PURE__ */
|
|
3248
|
+
sortState ? sortState.direction === "desc" ? /* @__PURE__ */ jsx3(ArrowDown, {}) : /* @__PURE__ */ jsx3(ArrowUp, {}) : null,
|
|
3850
3249
|
columnLabel(column)
|
|
3851
3250
|
]
|
|
3852
3251
|
}),
|
|
3853
|
-
/* @__PURE__ */
|
|
3252
|
+
/* @__PURE__ */ jsxs3(MenubarSubContent, {
|
|
3854
3253
|
children: [
|
|
3855
|
-
/* @__PURE__ */
|
|
3254
|
+
/* @__PURE__ */ jsxs3(MenubarItem, {
|
|
3856
3255
|
onClick: () => sort(column.id, "asc"),
|
|
3857
3256
|
children: [
|
|
3858
|
-
/* @__PURE__ */
|
|
3257
|
+
/* @__PURE__ */ jsx3(ArrowUp, {}),
|
|
3859
3258
|
" ",
|
|
3860
3259
|
store.config.labels.sortAsc
|
|
3861
3260
|
]
|
|
3862
3261
|
}),
|
|
3863
|
-
/* @__PURE__ */
|
|
3262
|
+
/* @__PURE__ */ jsxs3(MenubarItem, {
|
|
3864
3263
|
onClick: () => sort(column.id, "desc"),
|
|
3865
3264
|
children: [
|
|
3866
|
-
/* @__PURE__ */
|
|
3265
|
+
/* @__PURE__ */ jsx3(ArrowDown, {}),
|
|
3867
3266
|
" ",
|
|
3868
3267
|
store.config.labels.sortDesc
|
|
3869
3268
|
]
|
|
3870
3269
|
}),
|
|
3871
|
-
sortState ? /* @__PURE__ */
|
|
3270
|
+
sortState ? /* @__PURE__ */ jsxs3(Fragment, {
|
|
3872
3271
|
children: [
|
|
3873
|
-
/* @__PURE__ */
|
|
3874
|
-
/* @__PURE__ */
|
|
3272
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
3273
|
+
/* @__PURE__ */ jsxs3(MenubarItem, {
|
|
3875
3274
|
onClick: () => send(DataTableMessage.SortRequested({
|
|
3876
3275
|
columnId: column.id,
|
|
3877
3276
|
direction: null
|
|
3878
3277
|
})),
|
|
3879
3278
|
children: [
|
|
3880
|
-
/* @__PURE__ */
|
|
3279
|
+
/* @__PURE__ */ jsx3(X, {}),
|
|
3881
3280
|
" ",
|
|
3882
3281
|
store.config.labels.sortClear
|
|
3883
3282
|
]
|
|
@@ -3899,27 +3298,27 @@ var ViewMenu = ({
|
|
|
3899
3298
|
table
|
|
3900
3299
|
}) => {
|
|
3901
3300
|
const [store, send] = table;
|
|
3902
|
-
return /* @__PURE__ */
|
|
3301
|
+
return /* @__PURE__ */ jsxs3(MenubarMenu, {
|
|
3903
3302
|
children: [
|
|
3904
|
-
/* @__PURE__ */
|
|
3303
|
+
/* @__PURE__ */ jsxs3(MenubarTrigger, {
|
|
3905
3304
|
"aria-label": store.config.labels.view,
|
|
3906
3305
|
children: [
|
|
3907
|
-
store.state.view === "gallery" ? /* @__PURE__ */
|
|
3908
|
-
/* @__PURE__ */
|
|
3306
|
+
store.state.view === "gallery" ? /* @__PURE__ */ jsx3(LayoutGrid, {}) : /* @__PURE__ */ jsx3(Rows3, {}),
|
|
3307
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3909
3308
|
className: "hidden sm:inline",
|
|
3910
3309
|
children: store.config.labels.view
|
|
3911
3310
|
})
|
|
3912
3311
|
]
|
|
3913
3312
|
}),
|
|
3914
|
-
/* @__PURE__ */
|
|
3313
|
+
/* @__PURE__ */ jsx3(MenubarContent, {
|
|
3915
3314
|
align: "end",
|
|
3916
|
-
children: /* @__PURE__ */
|
|
3315
|
+
children: /* @__PURE__ */ jsxs3(MenubarGroup, {
|
|
3917
3316
|
children: [
|
|
3918
|
-
/* @__PURE__ */
|
|
3317
|
+
/* @__PURE__ */ jsx3(MenubarLabel, {
|
|
3919
3318
|
children: store.config.labels.view
|
|
3920
3319
|
}),
|
|
3921
|
-
/* @__PURE__ */
|
|
3922
|
-
/* @__PURE__ */
|
|
3320
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
3321
|
+
/* @__PURE__ */ jsxs3(MenubarRadioGroup, {
|
|
3923
3322
|
onValueChange: (input) => {
|
|
3924
3323
|
const view = Schema6.decodeUnknownOption(DataTableViewSchema)(input);
|
|
3925
3324
|
if (Option4.isSome(view)) {
|
|
@@ -3928,18 +3327,18 @@ var ViewMenu = ({
|
|
|
3928
3327
|
},
|
|
3929
3328
|
value: store.state.view,
|
|
3930
3329
|
children: [
|
|
3931
|
-
/* @__PURE__ */
|
|
3330
|
+
/* @__PURE__ */ jsxs3(MenubarRadioItem, {
|
|
3932
3331
|
value: "table",
|
|
3933
3332
|
children: [
|
|
3934
|
-
/* @__PURE__ */
|
|
3333
|
+
/* @__PURE__ */ jsx3(Rows3, {}),
|
|
3935
3334
|
" ",
|
|
3936
3335
|
store.config.labels.tableView
|
|
3937
3336
|
]
|
|
3938
3337
|
}),
|
|
3939
|
-
/* @__PURE__ */
|
|
3338
|
+
/* @__PURE__ */ jsxs3(MenubarRadioItem, {
|
|
3940
3339
|
value: "gallery",
|
|
3941
3340
|
children: [
|
|
3942
|
-
/* @__PURE__ */
|
|
3341
|
+
/* @__PURE__ */ jsx3(LayoutGrid, {}),
|
|
3943
3342
|
" ",
|
|
3944
3343
|
store.config.labels.galleryView
|
|
3945
3344
|
]
|
|
@@ -3959,27 +3358,27 @@ var ColumnMenu = ({
|
|
|
3959
3358
|
const columns = deriveModel(store).columns.filter(({ colDef }) => colDef.hideable !== false);
|
|
3960
3359
|
if (!columns.length)
|
|
3961
3360
|
return null;
|
|
3962
|
-
return /* @__PURE__ */
|
|
3361
|
+
return /* @__PURE__ */ jsxs3(MenubarMenu, {
|
|
3963
3362
|
children: [
|
|
3964
|
-
/* @__PURE__ */
|
|
3363
|
+
/* @__PURE__ */ jsxs3(MenubarTrigger, {
|
|
3965
3364
|
"aria-label": store.config.labels.columns,
|
|
3966
3365
|
children: [
|
|
3967
|
-
/* @__PURE__ */
|
|
3968
|
-
/* @__PURE__ */
|
|
3366
|
+
/* @__PURE__ */ jsx3(Settings2, {}),
|
|
3367
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3969
3368
|
className: "hidden sm:inline",
|
|
3970
3369
|
children: store.config.labels.columns
|
|
3971
3370
|
})
|
|
3972
3371
|
]
|
|
3973
3372
|
}),
|
|
3974
|
-
/* @__PURE__ */
|
|
3373
|
+
/* @__PURE__ */ jsx3(MenubarContent, {
|
|
3975
3374
|
align: "end",
|
|
3976
|
-
children: /* @__PURE__ */
|
|
3375
|
+
children: /* @__PURE__ */ jsxs3(MenubarGroup, {
|
|
3977
3376
|
children: [
|
|
3978
|
-
/* @__PURE__ */
|
|
3377
|
+
/* @__PURE__ */ jsx3(MenubarLabel, {
|
|
3979
3378
|
children: store.config.labels.columns
|
|
3980
3379
|
}),
|
|
3981
|
-
/* @__PURE__ */
|
|
3982
|
-
columns.map((column) => /* @__PURE__ */
|
|
3380
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
3381
|
+
columns.map((column) => /* @__PURE__ */ jsx3(MenubarCheckboxItem, {
|
|
3983
3382
|
checked: store.state.columnVisibility[column.id] !== false,
|
|
3984
3383
|
onCheckedChange: (visible) => send(DataTableMessage.ColumnVisibilityChanged({ id: column.id, visible })),
|
|
3985
3384
|
children: columnLabel(column)
|
|
@@ -4015,7 +3414,7 @@ var ResizeHandle = ({
|
|
|
4015
3414
|
send(DataTableMessage.ResizeMoved({ x: event.clientX, pointerId: event.pointerId }));
|
|
4016
3415
|
};
|
|
4017
3416
|
const reset = (event) => send(DataTableMessage.ResizeEnded({ pointerId: event.pointerId }));
|
|
4018
|
-
return /* @__PURE__ */
|
|
3417
|
+
return /* @__PURE__ */ jsx3("button", {
|
|
4019
3418
|
"aria-label": store.config.labels.resizeColumn(columnLabel(column)),
|
|
4020
3419
|
"aria-orientation": "vertical",
|
|
4021
3420
|
"aria-valuemax": max,
|
|
@@ -4137,9 +3536,9 @@ var DragHandle = ({
|
|
|
4137
3536
|
reordering.onReorder(reorderDataTableRows(model.rows, rowId, target.id));
|
|
4138
3537
|
}
|
|
4139
3538
|
};
|
|
4140
|
-
return /* @__PURE__ */
|
|
3539
|
+
return /* @__PURE__ */ jsxs3(Fragment, {
|
|
4141
3540
|
children: [
|
|
4142
|
-
/* @__PURE__ */
|
|
3541
|
+
/* @__PURE__ */ jsx3(Button2, {
|
|
4143
3542
|
"aria-label": store.config.features.reordering && store.config.features.reordering.handleLabel ? store.config.features.reordering.handleLabel : store.config.labels.reorder,
|
|
4144
3543
|
className: "size-8 cursor-grab touch-none active:cursor-grabbing",
|
|
4145
3544
|
onClick: (event) => event.stopPropagation(),
|
|
@@ -4157,9 +3556,9 @@ var DragHandle = ({
|
|
|
4157
3556
|
onPointerUp: finish,
|
|
4158
3557
|
size: "icon",
|
|
4159
3558
|
variant: "ghost",
|
|
4160
|
-
children: /* @__PURE__ */
|
|
3559
|
+
children: /* @__PURE__ */ jsx3(GripVertical, {})
|
|
4161
3560
|
}),
|
|
4162
|
-
overlay ? createPortal(/* @__PURE__ */
|
|
3561
|
+
overlay ? createPortal(/* @__PURE__ */ jsx3("div", {
|
|
4163
3562
|
"aria-hidden": "true",
|
|
4164
3563
|
className: "bg-background pointer-events-none fixed z-[100] rounded-md border px-3 py-2 text-sm shadow-lg",
|
|
4165
3564
|
style: { left: overlay.x + 12, top: overlay.y + 12 },
|
|
@@ -4181,7 +3580,7 @@ var TableDataRow = ({
|
|
|
4181
3580
|
const selection = store.config.features.selection;
|
|
4182
3581
|
const selectable = !!selection && (selection.isRowSelectable?.(row.data) ?? true);
|
|
4183
3582
|
const draggable = canDragRows(store);
|
|
4184
|
-
return /* @__PURE__ */
|
|
3583
|
+
return /* @__PURE__ */ jsxs3(TableRow, {
|
|
4185
3584
|
ref: measureRef,
|
|
4186
3585
|
"data-index": virtualIndex,
|
|
4187
3586
|
"aria-rowindex": virtualIndex === undefined ? undefined : virtualIndex + 2,
|
|
@@ -4197,12 +3596,12 @@ var TableDataRow = ({
|
|
|
4197
3596
|
},
|
|
4198
3597
|
tabIndex: store.config.onRowClicked ? 0 : undefined,
|
|
4199
3598
|
children: [
|
|
4200
|
-
selection ? /* @__PURE__ */
|
|
3599
|
+
selection ? /* @__PURE__ */ jsx3(TableCell, {
|
|
4201
3600
|
className: tableClasses.selectionCell,
|
|
4202
3601
|
onClick: (event) => event.stopPropagation(),
|
|
4203
|
-
children: /* @__PURE__ */
|
|
3602
|
+
children: /* @__PURE__ */ jsx3("div", {
|
|
4204
3603
|
className: tableClasses.selectionCenter,
|
|
4205
|
-
children: /* @__PURE__ */
|
|
3604
|
+
children: /* @__PURE__ */ jsx3(Checkbox, {
|
|
4206
3605
|
"aria-label": store.config.labels.selectRow,
|
|
4207
3606
|
checked: !!store.state.rowSelection[row.id],
|
|
4208
3607
|
disabled: !selectable,
|
|
@@ -4210,26 +3609,26 @@ var TableDataRow = ({
|
|
|
4210
3609
|
})
|
|
4211
3610
|
})
|
|
4212
3611
|
}) : null,
|
|
4213
|
-
draggable ? /* @__PURE__ */
|
|
3612
|
+
draggable ? /* @__PURE__ */ jsx3(TableCell, {
|
|
4214
3613
|
className: "w-10 pr-0",
|
|
4215
|
-
children: /* @__PURE__ */
|
|
3614
|
+
children: /* @__PURE__ */ jsx3(DragHandle, {
|
|
4216
3615
|
table
|
|
4217
3616
|
})
|
|
4218
3617
|
}) : null,
|
|
4219
|
-
model.visibleColumns.map((column) => /* @__PURE__ */
|
|
3618
|
+
model.visibleColumns.map((column) => /* @__PURE__ */ jsx3(TableCell, {
|
|
4220
3619
|
className: cn(tableClasses.cell, "min-w-24 has-[[data-slot=data-table-boolean-cell]]:relative has-[[data-slot=data-table-boolean-cell]]:p-0 has-[[data-slot=data-table-list-cell]]:relative has-[[data-slot=data-table-list-cell]]:p-0", column.colDef.truncate ? "whitespace-nowrap" : "whitespace-normal"),
|
|
4221
3620
|
style: { width: column.width },
|
|
4222
|
-
children: /* @__PURE__ */
|
|
3621
|
+
children: /* @__PURE__ */ jsx3("div", {
|
|
4223
3622
|
className: cn(tableClasses.cellContent, column.colDef.truncate && "truncate"),
|
|
4224
3623
|
children: renderCell(row, column, store.config.locale, store.config.labels)
|
|
4225
3624
|
})
|
|
4226
3625
|
}, column.id)),
|
|
4227
|
-
hasRowActionMenu(store) ? /* @__PURE__ */
|
|
3626
|
+
hasRowActionMenu(store) ? /* @__PURE__ */ jsx3(TableCell, {
|
|
4228
3627
|
className: cn(tableClasses.actionsCell, "group-data-[state=selected]/row:bg-muted"),
|
|
4229
3628
|
onClick: (event) => event.stopPropagation(),
|
|
4230
|
-
children: /* @__PURE__ */
|
|
3629
|
+
children: /* @__PURE__ */ jsx3("div", {
|
|
4231
3630
|
className: tableClasses.actionsAlign,
|
|
4232
|
-
children: /* @__PURE__ */
|
|
3631
|
+
children: /* @__PURE__ */ jsx3(DataTableRowActionMenu, {
|
|
4233
3632
|
row,
|
|
4234
3633
|
table
|
|
4235
3634
|
})
|
|
@@ -4246,27 +3645,27 @@ var GroupActions = ({
|
|
|
4246
3645
|
const visible = actions?.filter((action) => !action.visible || action.visible(groupId));
|
|
4247
3646
|
if (!visible?.length)
|
|
4248
3647
|
return null;
|
|
4249
|
-
return /* @__PURE__ */
|
|
3648
|
+
return /* @__PURE__ */ jsxs3(DropdownMenu, {
|
|
4250
3649
|
children: [
|
|
4251
|
-
/* @__PURE__ */
|
|
3650
|
+
/* @__PURE__ */ jsx3(DropdownMenuTrigger, {
|
|
4252
3651
|
onClick: (event) => event.stopPropagation(),
|
|
4253
|
-
render: /* @__PURE__ */
|
|
3652
|
+
render: /* @__PURE__ */ jsxs3(Button2, {
|
|
4254
3653
|
size: "icon-sm",
|
|
4255
3654
|
variant: "ghost",
|
|
4256
3655
|
children: [
|
|
4257
|
-
/* @__PURE__ */
|
|
3656
|
+
/* @__PURE__ */ jsx3("span", {
|
|
4258
3657
|
className: "sr-only",
|
|
4259
3658
|
children: title
|
|
4260
3659
|
}),
|
|
4261
|
-
/* @__PURE__ */
|
|
3660
|
+
/* @__PURE__ */ jsx3(MoreHorizontal, {})
|
|
4262
3661
|
]
|
|
4263
3662
|
})
|
|
4264
3663
|
}),
|
|
4265
|
-
/* @__PURE__ */
|
|
3664
|
+
/* @__PURE__ */ jsx3(DropdownMenuContent, {
|
|
4266
3665
|
align: "end",
|
|
4267
3666
|
onClick: (event) => event.stopPropagation(),
|
|
4268
|
-
children: /* @__PURE__ */
|
|
4269
|
-
children: visible.map((action) => /* @__PURE__ */
|
|
3667
|
+
children: /* @__PURE__ */ jsx3(DropdownMenuGroup, {
|
|
3668
|
+
children: visible.map((action) => /* @__PURE__ */ jsxs3(DropdownMenuItem, {
|
|
4270
3669
|
onClick: () => action.onClick(groupId),
|
|
4271
3670
|
variant: action.variant ?? "default",
|
|
4272
3671
|
children: [
|
|
@@ -4290,40 +3689,40 @@ var GroupHeaderRow = ({
|
|
|
4290
3689
|
const tableClasses = useContext(DataTableSlotClassesContext);
|
|
4291
3690
|
const [store, send] = table;
|
|
4292
3691
|
const collapsed = !!store.state.collapsedGroups[section.key];
|
|
4293
|
-
return /* @__PURE__ */
|
|
3692
|
+
return /* @__PURE__ */ jsx3(TableRow, {
|
|
4294
3693
|
ref: measureRef,
|
|
4295
3694
|
"data-index": virtualIndex,
|
|
4296
3695
|
"aria-rowindex": virtualIndex === undefined ? undefined : virtualIndex + 2,
|
|
4297
3696
|
className: cn(tableClasses.group, "cursor-pointer"),
|
|
4298
3697
|
onClick: () => send(DataTableMessage.GroupToggled({ key: section.key })),
|
|
4299
|
-
children: /* @__PURE__ */
|
|
3698
|
+
children: /* @__PURE__ */ jsx3(TableCell, {
|
|
4300
3699
|
className: "p-0",
|
|
4301
3700
|
colSpan,
|
|
4302
|
-
children: /* @__PURE__ */
|
|
3701
|
+
children: /* @__PURE__ */ jsxs3("div", {
|
|
4303
3702
|
className: cn(tableClasses.groupContent, tableClasses.groupSticky),
|
|
4304
3703
|
children: [
|
|
4305
|
-
/* @__PURE__ */
|
|
3704
|
+
/* @__PURE__ */ jsxs3("button", {
|
|
4306
3705
|
"aria-expanded": !collapsed,
|
|
4307
3706
|
className: tableClasses.groupTrigger,
|
|
4308
3707
|
style: { paddingLeft: section.depth * 20 },
|
|
4309
3708
|
type: "button",
|
|
4310
3709
|
children: [
|
|
4311
|
-
collapsed ? /* @__PURE__ */
|
|
3710
|
+
collapsed ? /* @__PURE__ */ jsx3(ChevronRight2, {
|
|
4312
3711
|
className: "size-4 shrink-0"
|
|
4313
|
-
}) : /* @__PURE__ */
|
|
3712
|
+
}) : /* @__PURE__ */ jsx3(ChevronDown, {
|
|
4314
3713
|
className: "size-4 shrink-0"
|
|
4315
3714
|
}),
|
|
4316
|
-
/* @__PURE__ */
|
|
3715
|
+
/* @__PURE__ */ jsx3("span", {
|
|
4317
3716
|
className: "min-w-0 flex-1 truncate",
|
|
4318
3717
|
children: section.field.renderGroupLabel?.(section.groupId, section.rows.map((row) => row.data)) ?? section.groupId
|
|
4319
3718
|
})
|
|
4320
3719
|
]
|
|
4321
3720
|
}),
|
|
4322
|
-
/* @__PURE__ */
|
|
3721
|
+
/* @__PURE__ */ jsx3("span", {
|
|
4323
3722
|
className: tableClasses.count,
|
|
4324
3723
|
children: section.rows.length
|
|
4325
3724
|
}),
|
|
4326
|
-
/* @__PURE__ */
|
|
3725
|
+
/* @__PURE__ */ jsx3(GroupActions, {
|
|
4327
3726
|
actions: section.field.actions,
|
|
4328
3727
|
groupId: section.groupId,
|
|
4329
3728
|
title: section.field.actionsLabel ?? store.config.labels.actions
|
|
@@ -4343,24 +3742,24 @@ var GroupedTable = ({
|
|
|
4343
3742
|
const renderSections = (items) => items.flatMap((section) => {
|
|
4344
3743
|
const collapsed = !!store.state.collapsedGroups[section.key];
|
|
4345
3744
|
const targetKey = getGroupDropKey(section.field.id, section.groupId);
|
|
4346
|
-
const body = /* @__PURE__ */
|
|
3745
|
+
const body = /* @__PURE__ */ jsxs3(TableBody, {
|
|
4347
3746
|
className: "data-[drop-target=true]:outline-primary relative data-[drop-target=true]:z-30 data-[drop-target=true]:outline-2 data-[drop-target=true]:-outline-offset-2 data-[drop-target=true]:[&>tr]:border-transparent data-[drop-target=true]:[&>tr>td:last-child]:z-0",
|
|
4348
3747
|
"data-table-group": section.field.onMoveToGroup ? targetKey : undefined,
|
|
4349
3748
|
children: [
|
|
4350
|
-
/* @__PURE__ */
|
|
3749
|
+
/* @__PURE__ */ jsx3(GroupHeaderRow, {
|
|
4351
3750
|
table,
|
|
4352
3751
|
section,
|
|
4353
3752
|
colSpan: model.visibleColumns.length + extra
|
|
4354
3753
|
}),
|
|
4355
|
-
!collapsed && !section.children.length ? section.rows.length ? section.rows.map((row) => /* @__PURE__ */
|
|
3754
|
+
!collapsed && !section.children.length ? section.rows.length ? section.rows.map((row) => /* @__PURE__ */ jsx3(RowIdContext.Provider, {
|
|
4356
3755
|
value: row.id,
|
|
4357
|
-
children: /* @__PURE__ */
|
|
3756
|
+
children: /* @__PURE__ */ jsx3(TableDataRow, {
|
|
4358
3757
|
row,
|
|
4359
3758
|
table
|
|
4360
3759
|
})
|
|
4361
3760
|
}, `${section.key}:${row.id}`)) : [
|
|
4362
|
-
/* @__PURE__ */
|
|
4363
|
-
children: /* @__PURE__ */
|
|
3761
|
+
/* @__PURE__ */ jsx3(TableRow, {
|
|
3762
|
+
children: /* @__PURE__ */ jsx3(TableCell, {
|
|
4364
3763
|
className: "text-muted-foreground h-16",
|
|
4365
3764
|
colSpan: model.visibleColumns.length + extra,
|
|
4366
3765
|
children: section.field.renderEmptyGroup?.(section.groupId) ?? store.config.labels.empty
|
|
@@ -4371,7 +3770,7 @@ var GroupedTable = ({
|
|
|
4371
3770
|
}, section.key);
|
|
4372
3771
|
return !collapsed && section.children.length ? [body, renderSections(section.children)] : [body];
|
|
4373
3772
|
});
|
|
4374
|
-
return /* @__PURE__ */
|
|
3773
|
+
return /* @__PURE__ */ jsx3(Fragment, {
|
|
4375
3774
|
children: renderSections(sections)
|
|
4376
3775
|
});
|
|
4377
3776
|
};
|
|
@@ -4390,7 +3789,7 @@ var ColumnHeaderMenu = ({
|
|
|
4390
3789
|
const filteringEnabled = store.config.features.filtering !== false && filterColumns.length > 0;
|
|
4391
3790
|
const ownsFilter = (id) => id === column.id || getDataTableFieldColumns(column).some((field) => field.id === id);
|
|
4392
3791
|
const activeFilters = (store.state.filters ?? []).filter(({ id }) => ownsFilter(id));
|
|
4393
|
-
const filterEditor = (field) => /* @__PURE__ */
|
|
3792
|
+
const filterEditor = (field) => /* @__PURE__ */ jsx3(FilterEditor, {
|
|
4394
3793
|
column: field,
|
|
4395
3794
|
rows: model.rows,
|
|
4396
3795
|
current: store.state.filters?.find((filter) => filter.id === field.id),
|
|
@@ -4403,20 +3802,20 @@ var ColumnHeaderMenu = ({
|
|
|
4403
3802
|
const sort = store.state.sort?.find(({ id }) => ownsSort(id));
|
|
4404
3803
|
const setSort = (id, direction) => send(DataTableMessage.SortRequested({ columnId: id, direction }));
|
|
4405
3804
|
const label = columnLabel(column);
|
|
4406
|
-
const sortItems = (field) => /* @__PURE__ */
|
|
3805
|
+
const sortItems = (field) => /* @__PURE__ */ jsxs3(Fragment, {
|
|
4407
3806
|
children: [
|
|
4408
|
-
/* @__PURE__ */
|
|
3807
|
+
/* @__PURE__ */ jsxs3(DropdownMenuItem, {
|
|
4409
3808
|
onClick: () => setSort(field.id, "asc"),
|
|
4410
3809
|
children: [
|
|
4411
|
-
/* @__PURE__ */
|
|
3810
|
+
/* @__PURE__ */ jsx3(ArrowUp, {}),
|
|
4412
3811
|
" ",
|
|
4413
3812
|
store.config.labels.sortAsc
|
|
4414
3813
|
]
|
|
4415
3814
|
}),
|
|
4416
|
-
/* @__PURE__ */
|
|
3815
|
+
/* @__PURE__ */ jsxs3(DropdownMenuItem, {
|
|
4417
3816
|
onClick: () => setSort(field.id, "desc"),
|
|
4418
3817
|
children: [
|
|
4419
|
-
/* @__PURE__ */
|
|
3818
|
+
/* @__PURE__ */ jsx3(ArrowDown, {}),
|
|
4420
3819
|
" ",
|
|
4421
3820
|
store.config.labels.sortDesc
|
|
4422
3821
|
]
|
|
@@ -4424,81 +3823,81 @@ var ColumnHeaderMenu = ({
|
|
|
4424
3823
|
]
|
|
4425
3824
|
});
|
|
4426
3825
|
if (!sortingEnabled && !hidingEnabled && !filteringEnabled) {
|
|
4427
|
-
return /* @__PURE__ */
|
|
3826
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
4428
3827
|
className: "truncate px-2",
|
|
4429
3828
|
children: column.colDef.headerName
|
|
4430
3829
|
});
|
|
4431
3830
|
}
|
|
4432
|
-
return /* @__PURE__ */
|
|
3831
|
+
return /* @__PURE__ */ jsxs3(DropdownMenu, {
|
|
4433
3832
|
children: [
|
|
4434
|
-
/* @__PURE__ */
|
|
4435
|
-
render: /* @__PURE__ */
|
|
3833
|
+
/* @__PURE__ */ jsx3(DropdownMenuTrigger, {
|
|
3834
|
+
render: /* @__PURE__ */ jsxs3(Button2, {
|
|
4436
3835
|
"aria-label": label,
|
|
4437
3836
|
"aria-description": activeFilters.length ? `${store.config.labels.filters}: ${activeFilters.length}` : undefined,
|
|
4438
3837
|
className: tableClasses.headerTrigger,
|
|
4439
3838
|
variant: "ghost",
|
|
4440
3839
|
children: [
|
|
4441
|
-
/* @__PURE__ */
|
|
3840
|
+
/* @__PURE__ */ jsx3("span", {
|
|
4442
3841
|
className: "truncate",
|
|
4443
3842
|
children: column.colDef.headerName
|
|
4444
3843
|
}),
|
|
4445
|
-
activeFilters.length ? /* @__PURE__ */
|
|
4446
|
-
sort ? sort.direction === "desc" ? /* @__PURE__ */
|
|
3844
|
+
activeFilters.length ? /* @__PURE__ */ jsx3(ListFilter, {}) : null,
|
|
3845
|
+
sort ? sort.direction === "desc" ? /* @__PURE__ */ jsx3(ArrowDown, {}) : /* @__PURE__ */ jsx3(ArrowUp, {}) : null
|
|
4447
3846
|
]
|
|
4448
3847
|
})
|
|
4449
3848
|
}),
|
|
4450
|
-
/* @__PURE__ */
|
|
3849
|
+
/* @__PURE__ */ jsx3(DropdownMenuContent, {
|
|
4451
3850
|
align: "start",
|
|
4452
3851
|
className: "w-48",
|
|
4453
|
-
children: /* @__PURE__ */
|
|
3852
|
+
children: /* @__PURE__ */ jsxs3(DropdownMenuGroup, {
|
|
4454
3853
|
children: [
|
|
4455
|
-
sortingEnabled ? /* @__PURE__ */
|
|
3854
|
+
sortingEnabled ? /* @__PURE__ */ jsxs3(Fragment, {
|
|
4456
3855
|
children: [
|
|
4457
|
-
column.colDef.fields?.length ? sortColumns.map((field) => /* @__PURE__ */
|
|
3856
|
+
column.colDef.fields?.length ? sortColumns.map((field) => /* @__PURE__ */ jsxs3(DropdownMenuSub, {
|
|
4458
3857
|
children: [
|
|
4459
|
-
/* @__PURE__ */
|
|
3858
|
+
/* @__PURE__ */ jsx3(DropdownMenuSubTrigger, {
|
|
4460
3859
|
children: columnLabel(field)
|
|
4461
3860
|
}),
|
|
4462
|
-
/* @__PURE__ */
|
|
4463
|
-
children: /* @__PURE__ */
|
|
3861
|
+
/* @__PURE__ */ jsx3(DropdownMenuSubContent, {
|
|
3862
|
+
children: /* @__PURE__ */ jsx3(DropdownMenuGroup, {
|
|
4464
3863
|
children: sortItems(field)
|
|
4465
3864
|
})
|
|
4466
3865
|
})
|
|
4467
3866
|
]
|
|
4468
3867
|
}, field.id)) : sortItems(column),
|
|
4469
|
-
sort ? /* @__PURE__ */
|
|
3868
|
+
sort ? /* @__PURE__ */ jsxs3(DropdownMenuItem, {
|
|
4470
3869
|
onClick: () => send(DataTableMessage.ColumnSortCleared({ id: column.id })),
|
|
4471
3870
|
children: [
|
|
4472
|
-
/* @__PURE__ */
|
|
3871
|
+
/* @__PURE__ */ jsx3(X, {}),
|
|
4473
3872
|
" ",
|
|
4474
3873
|
store.config.labels.sortClear
|
|
4475
3874
|
]
|
|
4476
3875
|
}) : null
|
|
4477
3876
|
]
|
|
4478
3877
|
}) : null,
|
|
4479
|
-
sortingEnabled && filteringEnabled ? /* @__PURE__ */
|
|
4480
|
-
filteringEnabled ? /* @__PURE__ */
|
|
3878
|
+
sortingEnabled && filteringEnabled ? /* @__PURE__ */ jsx3(DropdownMenuSeparator, {}) : null,
|
|
3879
|
+
filteringEnabled ? /* @__PURE__ */ jsxs3(Fragment, {
|
|
4481
3880
|
children: [
|
|
4482
|
-
/* @__PURE__ */
|
|
3881
|
+
/* @__PURE__ */ jsxs3(DropdownMenuSub, {
|
|
4483
3882
|
children: [
|
|
4484
|
-
/* @__PURE__ */
|
|
3883
|
+
/* @__PURE__ */ jsxs3(DropdownMenuSubTrigger, {
|
|
4485
3884
|
children: [
|
|
4486
|
-
/* @__PURE__ */
|
|
3885
|
+
/* @__PURE__ */ jsx3(ListFilter, {}),
|
|
4487
3886
|
store.config.labels.filters
|
|
4488
3887
|
]
|
|
4489
3888
|
}),
|
|
4490
|
-
/* @__PURE__ */
|
|
3889
|
+
/* @__PURE__ */ jsx3(DropdownMenuSubContent, {
|
|
4491
3890
|
className: "w-80 max-w-[calc(100vw-2rem)]",
|
|
4492
|
-
children: column.colDef.fields?.length ? /* @__PURE__ */
|
|
4493
|
-
children: filterColumns.map((field) => /* @__PURE__ */
|
|
3891
|
+
children: column.colDef.fields?.length ? /* @__PURE__ */ jsx3(DropdownMenuGroup, {
|
|
3892
|
+
children: filterColumns.map((field) => /* @__PURE__ */ jsxs3(DropdownMenuSub, {
|
|
4494
3893
|
children: [
|
|
4495
|
-
/* @__PURE__ */
|
|
3894
|
+
/* @__PURE__ */ jsxs3(DropdownMenuSubTrigger, {
|
|
4496
3895
|
children: [
|
|
4497
3896
|
columnLabel(field),
|
|
4498
|
-
activeFilters.some((filter) => filter.id === field.id) ? /* @__PURE__ */
|
|
3897
|
+
activeFilters.some((filter) => filter.id === field.id) ? /* @__PURE__ */ jsx3(Check, {}) : null
|
|
4499
3898
|
]
|
|
4500
3899
|
}),
|
|
4501
|
-
/* @__PURE__ */
|
|
3900
|
+
/* @__PURE__ */ jsx3(DropdownMenuSubContent, {
|
|
4502
3901
|
className: "w-80 max-w-[calc(100vw-2rem)]",
|
|
4503
3902
|
children: filterEditor(field)
|
|
4504
3903
|
})
|
|
@@ -4508,23 +3907,23 @@ var ColumnHeaderMenu = ({
|
|
|
4508
3907
|
})
|
|
4509
3908
|
]
|
|
4510
3909
|
}),
|
|
4511
|
-
activeFilters.length ? /* @__PURE__ */
|
|
3910
|
+
activeFilters.length ? /* @__PURE__ */ jsxs3(DropdownMenuItem, {
|
|
4512
3911
|
onClick: () => send(DataTableMessage.ColumnFiltersCleared({ id: column.id })),
|
|
4513
3912
|
children: [
|
|
4514
|
-
/* @__PURE__ */
|
|
3913
|
+
/* @__PURE__ */ jsx3(X, {}),
|
|
4515
3914
|
store.config.labels.filterClear
|
|
4516
3915
|
]
|
|
4517
3916
|
}) : null
|
|
4518
3917
|
]
|
|
4519
3918
|
}) : null,
|
|
4520
|
-
(sortingEnabled || filteringEnabled) && hidingEnabled ? /* @__PURE__ */
|
|
4521
|
-
hidingEnabled ? /* @__PURE__ */
|
|
3919
|
+
(sortingEnabled || filteringEnabled) && hidingEnabled ? /* @__PURE__ */ jsx3(DropdownMenuSeparator, {}) : null,
|
|
3920
|
+
hidingEnabled ? /* @__PURE__ */ jsxs3(DropdownMenuItem, {
|
|
4522
3921
|
onClick: () => send(DataTableMessage.ColumnVisibilityChanged({
|
|
4523
3922
|
id: column.id,
|
|
4524
3923
|
visible: false
|
|
4525
3924
|
})),
|
|
4526
3925
|
children: [
|
|
4527
|
-
/* @__PURE__ */
|
|
3926
|
+
/* @__PURE__ */ jsx3(EyeOff, {}),
|
|
4528
3927
|
" ",
|
|
4529
3928
|
store.config.labels.hideColumn
|
|
4530
3929
|
]
|
|
@@ -4547,16 +3946,16 @@ var DataTableHeader = ({
|
|
|
4547
3946
|
const selectableRows = model.pageRows.filter((row) => !selection || (selection.isRowSelectable?.(row.data) ?? true));
|
|
4548
3947
|
const allSelected = selectableRows.length > 0 && selectableRows.every((row) => store.state.rowSelection[row.id]);
|
|
4549
3948
|
const someSelected = selectableRows.some((row) => store.state.rowSelection[row.id]);
|
|
4550
|
-
return /* @__PURE__ */
|
|
3949
|
+
return /* @__PURE__ */ jsx3(TableHeader, {
|
|
4551
3950
|
className: sticky ? cn(tableClasses.stickyHeader, tableClasses.stickyHeaderRule, "[&_tr]:border-b-0") : undefined,
|
|
4552
|
-
children: /* @__PURE__ */
|
|
3951
|
+
children: /* @__PURE__ */ jsxs3(TableRow, {
|
|
4553
3952
|
"aria-rowindex": sticky ? 1 : undefined,
|
|
4554
3953
|
children: [
|
|
4555
|
-
selection ? /* @__PURE__ */
|
|
3954
|
+
selection ? /* @__PURE__ */ jsx3(TableHead, {
|
|
4556
3955
|
className: tableClasses.selectionCell,
|
|
4557
|
-
children: /* @__PURE__ */
|
|
3956
|
+
children: /* @__PURE__ */ jsx3("div", {
|
|
4558
3957
|
className: tableClasses.selectionCenter,
|
|
4559
|
-
children: /* @__PURE__ */
|
|
3958
|
+
children: /* @__PURE__ */ jsx3(Checkbox, {
|
|
4560
3959
|
"aria-label": store.config.labels.selectAllRows,
|
|
4561
3960
|
checked: allSelected,
|
|
4562
3961
|
indeterminate: someSelected && !allSelected,
|
|
@@ -4569,30 +3968,30 @@ var DataTableHeader = ({
|
|
|
4569
3968
|
})
|
|
4570
3969
|
})
|
|
4571
3970
|
}) : null,
|
|
4572
|
-
draggable ? /* @__PURE__ */
|
|
3971
|
+
draggable ? /* @__PURE__ */ jsx3(TableHead, {
|
|
4573
3972
|
className: "w-10"
|
|
4574
3973
|
}) : null,
|
|
4575
3974
|
model.visibleColumns.map((column) => {
|
|
4576
3975
|
const direction = store.state.sort?.find(({ id }) => id === column.id)?.direction;
|
|
4577
|
-
return /* @__PURE__ */
|
|
3976
|
+
return /* @__PURE__ */ jsx3(TableHead, {
|
|
4578
3977
|
"aria-sort": direction === "asc" ? "ascending" : direction === "desc" ? "descending" : undefined,
|
|
4579
3978
|
className: tableClasses.header,
|
|
4580
3979
|
scope: "col",
|
|
4581
3980
|
style: { width: column.width },
|
|
4582
|
-
children: /* @__PURE__ */
|
|
3981
|
+
children: /* @__PURE__ */ jsxs3(ColumnIdContext.Provider, {
|
|
4583
3982
|
value: column.id,
|
|
4584
3983
|
children: [
|
|
4585
|
-
/* @__PURE__ */
|
|
3984
|
+
/* @__PURE__ */ jsx3(ColumnHeaderMenu, {
|
|
4586
3985
|
table
|
|
4587
3986
|
}),
|
|
4588
|
-
/* @__PURE__ */
|
|
3987
|
+
/* @__PURE__ */ jsx3(ResizeHandle, {
|
|
4589
3988
|
table
|
|
4590
3989
|
})
|
|
4591
3990
|
]
|
|
4592
3991
|
})
|
|
4593
3992
|
}, column.id);
|
|
4594
3993
|
}),
|
|
4595
|
-
hasRowActionMenu(store) ? /* @__PURE__ */
|
|
3994
|
+
hasRowActionMenu(store) ? /* @__PURE__ */ jsx3(TableHead, {
|
|
4596
3995
|
className: "w-10"
|
|
4597
3996
|
}) : null
|
|
4598
3997
|
]
|
|
@@ -4610,7 +4009,7 @@ var VirtualTableRows = ({
|
|
|
4610
4009
|
const { element: scrollElement, headerHeight } = viewport;
|
|
4611
4010
|
const pageScroll = viewport.options.scroll === "page";
|
|
4612
4011
|
const scrollMargin = viewport.pageOffset ?? headerHeight;
|
|
4613
|
-
const entries =
|
|
4012
|
+
const entries = useMemo(() => {
|
|
4614
4013
|
const result = [];
|
|
4615
4014
|
const addSections = (groups) => {
|
|
4616
4015
|
for (const section of groups) {
|
|
@@ -4674,39 +4073,39 @@ var VirtualTableRows = ({
|
|
|
4674
4073
|
const last = items.at(-1);
|
|
4675
4074
|
const before = first ? first.start - scrollMargin : 0;
|
|
4676
4075
|
const after = virtualizer.getTotalSize() - (last ? last.end - scrollMargin : 0);
|
|
4677
|
-
const spacer = (height) => height > 0 ? /* @__PURE__ */
|
|
4076
|
+
const spacer = (height) => height > 0 ? /* @__PURE__ */ jsx3("tr", {
|
|
4678
4077
|
"aria-hidden": "true",
|
|
4679
|
-
children: /* @__PURE__ */
|
|
4078
|
+
children: /* @__PURE__ */ jsx3("td", {
|
|
4680
4079
|
colSpan: Math.max(1, colSpan),
|
|
4681
4080
|
className: "border-0 p-0",
|
|
4682
4081
|
style: { height }
|
|
4683
4082
|
})
|
|
4684
4083
|
}) : null;
|
|
4685
|
-
return /* @__PURE__ */
|
|
4084
|
+
return /* @__PURE__ */ jsxs3(Fragment, {
|
|
4686
4085
|
children: [
|
|
4687
4086
|
spacer(before),
|
|
4688
4087
|
items.map(({ index, key }) => {
|
|
4689
4088
|
const entry = entries[index];
|
|
4690
4089
|
if (entry.kind === "data")
|
|
4691
|
-
return /* @__PURE__ */
|
|
4090
|
+
return /* @__PURE__ */ jsx3(TableDataRow, {
|
|
4692
4091
|
measureRef: virtualizer.measureElement,
|
|
4693
4092
|
row: entry.row,
|
|
4694
4093
|
table,
|
|
4695
4094
|
virtualIndex: index
|
|
4696
4095
|
}, key);
|
|
4697
4096
|
if (entry.kind === "header")
|
|
4698
|
-
return /* @__PURE__ */
|
|
4097
|
+
return /* @__PURE__ */ jsx3(GroupHeaderRow, {
|
|
4699
4098
|
measureRef: virtualizer.measureElement,
|
|
4700
4099
|
section: entry.section,
|
|
4701
4100
|
colSpan,
|
|
4702
4101
|
table,
|
|
4703
4102
|
virtualIndex: index
|
|
4704
4103
|
}, key);
|
|
4705
|
-
return /* @__PURE__ */
|
|
4104
|
+
return /* @__PURE__ */ jsx3(TableRow, {
|
|
4706
4105
|
ref: virtualizer.measureElement,
|
|
4707
4106
|
"data-index": index,
|
|
4708
4107
|
"aria-rowindex": index + 2,
|
|
4709
|
-
children: /* @__PURE__ */
|
|
4108
|
+
children: /* @__PURE__ */ jsx3(TableCell, {
|
|
4710
4109
|
className: "text-muted-foreground h-16",
|
|
4711
4110
|
colSpan,
|
|
4712
4111
|
children: entry.section.field.renderEmptyGroup?.(entry.section.groupId) ?? config.labels.empty
|
|
@@ -4726,42 +4125,42 @@ var DataTableBody = ({
|
|
|
4726
4125
|
const model = deriveModel(store);
|
|
4727
4126
|
const fields = getActiveGrouping(store);
|
|
4728
4127
|
const rows = model.pageRows;
|
|
4729
|
-
const sections =
|
|
4128
|
+
const sections = useMemo(() => groupDataTableRows(rows, fields), [rows, fields]);
|
|
4730
4129
|
const colSpan = model.visibleColumns.length + (store.config.features.selection ? 1 : 0) + (hasRowActionMenu(store) ? 1 : 0) + (canDragRows(store) ? 1 : 0);
|
|
4731
4130
|
const showGroups = sections.length && (rows.length || !store.config.status.loading) && !store.config.status.error;
|
|
4732
4131
|
if (showGroups && !viewport) {
|
|
4733
|
-
return /* @__PURE__ */
|
|
4132
|
+
return /* @__PURE__ */ jsx3(GroupedTable, {
|
|
4734
4133
|
table,
|
|
4735
4134
|
sections
|
|
4736
4135
|
});
|
|
4737
4136
|
}
|
|
4738
|
-
return /* @__PURE__ */
|
|
4739
|
-
children: store.config.status.error || !showGroups && !rows.length && !store.config.status.loading ? /* @__PURE__ */
|
|
4740
|
-
children: /* @__PURE__ */
|
|
4137
|
+
return /* @__PURE__ */ jsx3(TableBody, {
|
|
4138
|
+
children: store.config.status.error || !showGroups && !rows.length && !store.config.status.loading ? /* @__PURE__ */ jsx3(TableRow, {
|
|
4139
|
+
children: /* @__PURE__ */ jsx3(TableCell, {
|
|
4741
4140
|
"data-table-slot": store.config.status.error ? "error" : "empty",
|
|
4742
4141
|
className: cn("h-24 text-center", store.config.status.error ? styles?.feedback?.error : styles?.feedback?.empty),
|
|
4743
4142
|
colSpan: Math.max(colSpan, 1),
|
|
4744
4143
|
children: store.config.status.error ?? store.config.status.empty ?? store.config.labels.empty
|
|
4745
4144
|
})
|
|
4746
|
-
}) : !showGroups && store.config.status.loading && !rows.length ? /* @__PURE__ */
|
|
4747
|
-
children: /* @__PURE__ */
|
|
4145
|
+
}) : !showGroups && store.config.status.loading && !rows.length ? /* @__PURE__ */ jsx3(TableRow, {
|
|
4146
|
+
children: /* @__PURE__ */ jsx3(TableCell, {
|
|
4748
4147
|
"data-table-slot": "loading",
|
|
4749
4148
|
className: cn("h-24 p-0", styles?.feedback?.loading),
|
|
4750
4149
|
colSpan: Math.max(colSpan, 1),
|
|
4751
|
-
children: /* @__PURE__ */
|
|
4150
|
+
children: /* @__PURE__ */ jsx3(Loading, {
|
|
4752
4151
|
className: "sticky left-0 w-[100cqw] max-w-full px-2",
|
|
4753
4152
|
label: store.config.labels.loading
|
|
4754
4153
|
})
|
|
4755
4154
|
})
|
|
4756
|
-
}) : viewport ? /* @__PURE__ */
|
|
4155
|
+
}) : viewport ? /* @__PURE__ */ jsx3(VirtualTableRows, {
|
|
4757
4156
|
colSpan,
|
|
4758
4157
|
rows,
|
|
4759
4158
|
sections,
|
|
4760
4159
|
table,
|
|
4761
4160
|
viewport
|
|
4762
|
-
}) : rows.map((row) => /* @__PURE__ */
|
|
4161
|
+
}) : rows.map((row) => /* @__PURE__ */ jsx3(RowIdContext.Provider, {
|
|
4763
4162
|
value: row.id,
|
|
4764
|
-
children: /* @__PURE__ */
|
|
4163
|
+
children: /* @__PURE__ */ jsx3(TableDataRow, {
|
|
4765
4164
|
row,
|
|
4766
4165
|
table
|
|
4767
4166
|
})
|
|
@@ -4779,13 +4178,15 @@ var GalleryTag = ({
|
|
|
4779
4178
|
if ((value == null || value === "") && !column.colDef.cellRenderer)
|
|
4780
4179
|
return null;
|
|
4781
4180
|
const content = renderCell(row, column, locale, labels);
|
|
4782
|
-
|
|
4181
|
+
const { colDef } = column;
|
|
4182
|
+
const displaysBadges = colDef.type === "text" && colDef.display === "badge" || colDef.type === "list" && colDef.typeOptions.display === "badge";
|
|
4183
|
+
return colDef.cellRenderer || colDef.valueFormatter || displaysBadges ? /* @__PURE__ */ jsxs3("div", {
|
|
4783
4184
|
className: "flex min-w-0 items-center gap-1",
|
|
4784
4185
|
children: [
|
|
4785
4186
|
icon,
|
|
4786
4187
|
content
|
|
4787
4188
|
]
|
|
4788
|
-
}) : /* @__PURE__ */
|
|
4189
|
+
}) : /* @__PURE__ */ jsxs3(Badge, {
|
|
4789
4190
|
variant: "secondary",
|
|
4790
4191
|
children: [
|
|
4791
4192
|
icon,
|
|
@@ -4813,7 +4214,7 @@ var GalleryCard = ({
|
|
|
4813
4214
|
const selection = store.config.features.selection;
|
|
4814
4215
|
const selectable = !!selection && (selection.isRowSelectable?.(row.data) ?? true);
|
|
4815
4216
|
const draggable = canDragRows(store);
|
|
4816
|
-
return /* @__PURE__ */
|
|
4217
|
+
return /* @__PURE__ */ jsxs3(Card, {
|
|
4817
4218
|
className: cn("data-[drop-position=before]:border-t-primary data-[drop-position=after]:border-b-primary relative gap-3 data-[drag-source=true]:opacity-40 data-[drop-position=after]:border-b-2 data-[drop-position=before]:border-t-2", store.config.onRowClicked && "cursor-pointer"),
|
|
4818
4219
|
"data-table-row": row.id,
|
|
4819
4220
|
onClick: () => store.config.onRowClicked?.(row.data),
|
|
@@ -4825,7 +4226,7 @@ var GalleryCard = ({
|
|
|
4825
4226
|
},
|
|
4826
4227
|
tabIndex: store.config.onRowClicked ? 0 : undefined,
|
|
4827
4228
|
children: [
|
|
4828
|
-
imageSrc && !store.ui.failedImages.includes(imageSrc) ? /* @__PURE__ */
|
|
4229
|
+
imageSrc && !store.ui.failedImages.includes(imageSrc) ? /* @__PURE__ */ jsx3("img", {
|
|
4829
4230
|
src: imageSrc,
|
|
4830
4231
|
alt: gallery.image?.getAlt?.(row.data) ?? "",
|
|
4831
4232
|
loading: "lazy",
|
|
@@ -4833,32 +4234,32 @@ var GalleryCard = ({
|
|
|
4833
4234
|
className: "aspect-video w-full object-cover",
|
|
4834
4235
|
onError: () => send(DataTableMessage.ReferenceImageFailed({ src: imageSrc }))
|
|
4835
4236
|
}) : null,
|
|
4836
|
-
/* @__PURE__ */
|
|
4237
|
+
/* @__PURE__ */ jsxs3(CardHeader, {
|
|
4837
4238
|
className: cn("relative", hasRowActionMenu(store) && "pr-12"),
|
|
4838
4239
|
children: [
|
|
4839
|
-
selection || draggable ? /* @__PURE__ */
|
|
4240
|
+
selection || draggable ? /* @__PURE__ */ jsxs3("div", {
|
|
4840
4241
|
className: "flex items-center gap-2",
|
|
4841
4242
|
children: [
|
|
4842
|
-
selection ? /* @__PURE__ */
|
|
4243
|
+
selection ? /* @__PURE__ */ jsx3(Checkbox, {
|
|
4843
4244
|
"aria-label": store.config.labels.selectRow,
|
|
4844
4245
|
checked: !!store.state.rowSelection[row.id],
|
|
4845
4246
|
disabled: !selectable,
|
|
4846
4247
|
onCheckedChange: (checked) => toggleRow(send, row.id, checked),
|
|
4847
4248
|
onClick: (event) => event.stopPropagation()
|
|
4848
4249
|
}) : null,
|
|
4849
|
-
draggable ? /* @__PURE__ */
|
|
4250
|
+
draggable ? /* @__PURE__ */ jsx3(DragHandle, {
|
|
4850
4251
|
table
|
|
4851
4252
|
}) : null
|
|
4852
4253
|
]
|
|
4853
4254
|
}) : null,
|
|
4854
|
-
/* @__PURE__ */
|
|
4255
|
+
/* @__PURE__ */ jsx3(CardTitle, {
|
|
4855
4256
|
children: name ? renderCell(row, name, store.config.locale, store.config.labels) : row.id
|
|
4856
4257
|
}),
|
|
4857
|
-
tagIds.length ? /* @__PURE__ */
|
|
4258
|
+
tagIds.length ? /* @__PURE__ */ jsx3("div", {
|
|
4858
4259
|
className: "flex flex-wrap items-center gap-2",
|
|
4859
4260
|
children: tagIds.map((id) => {
|
|
4860
4261
|
const column = find(id);
|
|
4861
|
-
return column ? /* @__PURE__ */
|
|
4262
|
+
return column ? /* @__PURE__ */ jsx3(GalleryTag, {
|
|
4862
4263
|
row,
|
|
4863
4264
|
column,
|
|
4864
4265
|
locale: store.config.locale,
|
|
@@ -4867,14 +4268,14 @@ var GalleryCard = ({
|
|
|
4867
4268
|
}, id) : null;
|
|
4868
4269
|
})
|
|
4869
4270
|
}) : null,
|
|
4870
|
-
description ? /* @__PURE__ */
|
|
4271
|
+
description ? /* @__PURE__ */ jsx3("div", {
|
|
4871
4272
|
className: "text-muted-foreground line-clamp-3 text-sm",
|
|
4872
4273
|
children: renderCell(row, description, store.config.locale, store.config.labels)
|
|
4873
4274
|
}) : null,
|
|
4874
|
-
hasRowActionMenu(store) ? /* @__PURE__ */
|
|
4275
|
+
hasRowActionMenu(store) ? /* @__PURE__ */ jsx3("div", {
|
|
4875
4276
|
className: "absolute top-0 right-4",
|
|
4876
4277
|
onClick: (event) => event.stopPropagation(),
|
|
4877
|
-
children: /* @__PURE__ */
|
|
4278
|
+
children: /* @__PURE__ */ jsx3(DataTableRowActionMenu, {
|
|
4878
4279
|
row,
|
|
4879
4280
|
table
|
|
4880
4281
|
})
|
|
@@ -4894,35 +4295,35 @@ var DataTableGallery = ({
|
|
|
4894
4295
|
const rows = model.pageRows;
|
|
4895
4296
|
const sections = groupDataTableRows(rows, fields);
|
|
4896
4297
|
if (store.config.status.error) {
|
|
4897
|
-
return /* @__PURE__ */
|
|
4298
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
4898
4299
|
"data-table-slot": "error",
|
|
4899
4300
|
className: cn("text-destructive rounded-lg border border-dashed p-10 text-center", styles?.feedback?.error),
|
|
4900
4301
|
children: store.config.status.error
|
|
4901
4302
|
});
|
|
4902
4303
|
}
|
|
4903
4304
|
if (store.config.status.loading && !rows.length) {
|
|
4904
|
-
return /* @__PURE__ */
|
|
4305
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
4905
4306
|
"data-table-slot": "loading",
|
|
4906
4307
|
className: cn("rounded-lg border border-dashed p-10 text-center", styles?.feedback?.loading),
|
|
4907
|
-
children: /* @__PURE__ */
|
|
4308
|
+
children: /* @__PURE__ */ jsx3(Loading, {
|
|
4908
4309
|
label: store.config.labels.loading
|
|
4909
4310
|
})
|
|
4910
4311
|
});
|
|
4911
4312
|
}
|
|
4912
4313
|
if (!rows.length && !sections.length) {
|
|
4913
|
-
return /* @__PURE__ */
|
|
4314
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
4914
4315
|
"data-table-slot": "empty",
|
|
4915
4316
|
className: cn("text-muted-foreground rounded-lg border border-dashed p-10 text-center", styles?.feedback?.empty),
|
|
4916
4317
|
children: store.config.status.empty ?? store.config.labels.empty
|
|
4917
4318
|
});
|
|
4918
4319
|
}
|
|
4919
4320
|
if (!fields.length) {
|
|
4920
|
-
return /* @__PURE__ */
|
|
4321
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
4921
4322
|
"data-table-slot": "gallery",
|
|
4922
4323
|
className: cn("grid gap-3 sm:grid-cols-2 xl:grid-cols-3", styles?.gallery),
|
|
4923
|
-
children: rows.map((row) => /* @__PURE__ */
|
|
4324
|
+
children: rows.map((row) => /* @__PURE__ */ jsx3(RowIdContext.Provider, {
|
|
4924
4325
|
value: row.id,
|
|
4925
|
-
children: /* @__PURE__ */
|
|
4326
|
+
children: /* @__PURE__ */ jsx3(GalleryCard, {
|
|
4926
4327
|
table
|
|
4927
4328
|
})
|
|
4928
4329
|
}, row.id))
|
|
@@ -4932,58 +4333,58 @@ var DataTableGallery = ({
|
|
|
4932
4333
|
const collapsed = !!store.state.collapsedGroups[section.key];
|
|
4933
4334
|
const targetKey = getGroupDropKey(section.field.id, section.groupId);
|
|
4934
4335
|
const toggleCollapsed = () => send(DataTableMessage.GroupToggled({ key: section.key }));
|
|
4935
|
-
return /* @__PURE__ */
|
|
4336
|
+
return /* @__PURE__ */ jsxs3("section", {
|
|
4936
4337
|
className: "data-[drop-target=true]:ring-primary space-y-3 rounded-lg transition-shadow data-[drop-target=true]:ring-2",
|
|
4937
4338
|
"data-table-group": section.field.onMoveToGroup ? targetKey : undefined,
|
|
4938
4339
|
children: [
|
|
4939
|
-
/* @__PURE__ */
|
|
4340
|
+
/* @__PURE__ */ jsxs3("div", {
|
|
4940
4341
|
className: "hover:bg-accent flex cursor-pointer items-center gap-2 rounded-lg border p-3 transition-colors",
|
|
4941
4342
|
onClick: toggleCollapsed,
|
|
4942
4343
|
children: [
|
|
4943
|
-
/* @__PURE__ */
|
|
4344
|
+
/* @__PURE__ */ jsxs3("button", {
|
|
4944
4345
|
"aria-expanded": !collapsed,
|
|
4945
4346
|
className: "flex flex-1 cursor-pointer items-center gap-2 text-left font-medium",
|
|
4946
4347
|
type: "button",
|
|
4947
4348
|
children: [
|
|
4948
|
-
collapsed ? /* @__PURE__ */
|
|
4349
|
+
collapsed ? /* @__PURE__ */ jsx3(ChevronRight2, {
|
|
4949
4350
|
className: "size-4"
|
|
4950
|
-
}) : /* @__PURE__ */
|
|
4351
|
+
}) : /* @__PURE__ */ jsx3(ChevronDown, {
|
|
4951
4352
|
className: "size-4"
|
|
4952
4353
|
}),
|
|
4953
|
-
/* @__PURE__ */
|
|
4354
|
+
/* @__PURE__ */ jsx3("span", {
|
|
4954
4355
|
className: "flex-1",
|
|
4955
4356
|
children: section.field.renderGroupLabel?.(section.groupId, section.rows.map((row) => row.data)) ?? section.groupId
|
|
4956
4357
|
}),
|
|
4957
|
-
/* @__PURE__ */
|
|
4358
|
+
/* @__PURE__ */ jsx3(Badge, {
|
|
4958
4359
|
variant: "secondary",
|
|
4959
4360
|
children: section.rows.length
|
|
4960
4361
|
})
|
|
4961
4362
|
]
|
|
4962
4363
|
}),
|
|
4963
|
-
/* @__PURE__ */
|
|
4364
|
+
/* @__PURE__ */ jsx3(GroupActions, {
|
|
4964
4365
|
actions: section.field.actions,
|
|
4965
4366
|
groupId: section.groupId,
|
|
4966
4367
|
title: section.field.actionsLabel ?? store.config.labels.actions
|
|
4967
4368
|
})
|
|
4968
4369
|
]
|
|
4969
4370
|
}),
|
|
4970
|
-
!collapsed ? section.children.length ? renderSections(section.children) : section.rows.length ? /* @__PURE__ */
|
|
4371
|
+
!collapsed ? section.children.length ? renderSections(section.children) : section.rows.length ? /* @__PURE__ */ jsx3("div", {
|
|
4971
4372
|
"data-table-slot": "gallery",
|
|
4972
4373
|
className: cn("grid gap-3 sm:grid-cols-2 xl:grid-cols-3", styles?.gallery),
|
|
4973
|
-
children: section.rows.map((row) => /* @__PURE__ */
|
|
4374
|
+
children: section.rows.map((row) => /* @__PURE__ */ jsx3(RowIdContext.Provider, {
|
|
4974
4375
|
value: row.id,
|
|
4975
|
-
children: /* @__PURE__ */
|
|
4376
|
+
children: /* @__PURE__ */ jsx3(GalleryCard, {
|
|
4976
4377
|
table
|
|
4977
4378
|
})
|
|
4978
4379
|
}, `${section.key}:${row.id}`))
|
|
4979
|
-
}) : /* @__PURE__ */
|
|
4380
|
+
}) : /* @__PURE__ */ jsx3("div", {
|
|
4980
4381
|
className: "text-muted-foreground rounded-lg border border-dashed p-8 text-center",
|
|
4981
4382
|
children: section.field.renderEmptyGroup?.(section.groupId) ?? store.config.labels.empty
|
|
4982
4383
|
}) : null
|
|
4983
4384
|
]
|
|
4984
4385
|
}, section.key);
|
|
4985
4386
|
});
|
|
4986
|
-
return /* @__PURE__ */
|
|
4387
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
4987
4388
|
className: "space-y-4",
|
|
4988
4389
|
children: renderSections(sections)
|
|
4989
4390
|
});
|
|
@@ -5005,10 +4406,10 @@ var DataTablePagination = ({
|
|
|
5005
4406
|
if (!paginationVisible || !pagination)
|
|
5006
4407
|
return null;
|
|
5007
4408
|
const selected = model.rows.filter((row) => store.state.rowSelection[row.id]).length;
|
|
5008
|
-
return /* @__PURE__ */
|
|
4409
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
5009
4410
|
"data-table-slot": "pagination",
|
|
5010
4411
|
className: cn("shrink-0 pt-4", styles?.pagination),
|
|
5011
|
-
children: /* @__PURE__ */
|
|
4412
|
+
children: /* @__PURE__ */ jsx3(Pagination, {
|
|
5012
4413
|
pageSizeContentClassName: styles?.popup?.select,
|
|
5013
4414
|
locale: store.config.locale,
|
|
5014
4415
|
messages: { [store.config.locale]: store.config.labels },
|
|
@@ -5057,10 +4458,10 @@ var modelColumns = (definitions) => normalizeDataTableColumns(definitions).map((
|
|
|
5057
4458
|
});
|
|
5058
4459
|
var getTableLayoutClass = (virtualization) => virtualization && virtualization !== true && virtualization.scroll === "internal" ? "flex min-h-0 flex-1 flex-col" : undefined;
|
|
5059
4460
|
var HydratedDataTable = (props) => {
|
|
5060
|
-
const config =
|
|
5061
|
-
const columns =
|
|
4461
|
+
const config = useMemo(() => resolveConfig(props), [props]);
|
|
4462
|
+
const columns = useMemo(() => modelColumns(props.columnDefs), [props.columnDefs]);
|
|
5062
4463
|
const selection = config.features.selection;
|
|
5063
|
-
const modelProps =
|
|
4464
|
+
const modelProps = useMemo(() => {
|
|
5064
4465
|
const { features } = config;
|
|
5065
4466
|
const grouping = features.grouping;
|
|
5066
4467
|
const pagination = features.pagination;
|
|
@@ -5158,7 +4559,7 @@ var HydratedDataTable = (props) => {
|
|
|
5158
4559
|
const query = modelProps.state ?? model.query;
|
|
5159
4560
|
const { collapsedGroups, selectedRowIds } = model;
|
|
5160
4561
|
const galleryEnabled = !!props.features?.gallery;
|
|
5161
|
-
const state =
|
|
4562
|
+
const state = useMemo(() => ({
|
|
5162
4563
|
...query,
|
|
5163
4564
|
columnVisibility,
|
|
5164
4565
|
columnSizing,
|
|
@@ -5176,7 +4577,7 @@ var HydratedDataTable = (props) => {
|
|
|
5176
4577
|
collapsedGroups,
|
|
5177
4578
|
selectedRowIds
|
|
5178
4579
|
]);
|
|
5179
|
-
const store =
|
|
4580
|
+
const store = useMemo(() => {
|
|
5180
4581
|
const source = {
|
|
5181
4582
|
rowData: props.rowData,
|
|
5182
4583
|
columnDefs: props.columnDefs,
|
|
@@ -5187,20 +4588,20 @@ var HydratedDataTable = (props) => {
|
|
|
5187
4588
|
}, [props.rowData, props.columnDefs, config, state]);
|
|
5188
4589
|
const table = [{ ...store, ui: model }, send];
|
|
5189
4590
|
if (!preferencesLoaded)
|
|
5190
|
-
return /* @__PURE__ */
|
|
4591
|
+
return /* @__PURE__ */ jsx3(TablePlaceholder, {
|
|
5191
4592
|
props
|
|
5192
4593
|
});
|
|
5193
|
-
return /* @__PURE__ */
|
|
4594
|
+
return /* @__PURE__ */ jsxs3("div", {
|
|
5194
4595
|
className: cn("w-full max-w-full min-w-0 rounded-md", getTableLayoutClass(props.features?.virtualization), props.className),
|
|
5195
4596
|
"data-table-root": "",
|
|
5196
4597
|
children: [
|
|
5197
|
-
/* @__PURE__ */
|
|
4598
|
+
/* @__PURE__ */ jsx3(DataTableToolbar, {
|
|
5198
4599
|
table
|
|
5199
4600
|
}),
|
|
5200
|
-
/* @__PURE__ */
|
|
4601
|
+
/* @__PURE__ */ jsx3(DataTableContent, {
|
|
5201
4602
|
table
|
|
5202
4603
|
}),
|
|
5203
|
-
/* @__PURE__ */
|
|
4604
|
+
/* @__PURE__ */ jsx3(DataTablePagination, {
|
|
5204
4605
|
table
|
|
5205
4606
|
})
|
|
5206
4607
|
]
|
|
@@ -5211,7 +4612,7 @@ var clientSnapshot = () => true;
|
|
|
5211
4612
|
var serverSnapshot = () => false;
|
|
5212
4613
|
var TablePlaceholder = ({
|
|
5213
4614
|
props
|
|
5214
|
-
}) => /* @__PURE__ */
|
|
4615
|
+
}) => /* @__PURE__ */ jsx3("div", {
|
|
5215
4616
|
"aria-busy": "true",
|
|
5216
4617
|
className: cn("invisible w-full max-w-full min-w-0 rounded-md", getTableLayoutClass(props.features?.virtualization), props.className),
|
|
5217
4618
|
"data-table-root": ""
|
|
@@ -5220,14 +4621,14 @@ var DataTable = (props) => {
|
|
|
5220
4621
|
const locale = useKrakstackLocale3(props.locale);
|
|
5221
4622
|
const hydrated = useSyncExternalStore(subscribeToHydration, clientSnapshot, serverSnapshot);
|
|
5222
4623
|
if (!hydrated)
|
|
5223
|
-
return /* @__PURE__ */
|
|
4624
|
+
return /* @__PURE__ */ jsx3(TablePlaceholder, {
|
|
5224
4625
|
props
|
|
5225
4626
|
});
|
|
5226
|
-
return /* @__PURE__ */
|
|
4627
|
+
return /* @__PURE__ */ jsx3(DataTableStylesContext.Provider, {
|
|
5227
4628
|
value: props.classNames,
|
|
5228
|
-
children: /* @__PURE__ */
|
|
4629
|
+
children: /* @__PURE__ */ jsx3(DataTableSlotClassesContext.Provider, {
|
|
5229
4630
|
value: resolveTableClasses(props.classes),
|
|
5230
|
-
children: /* @__PURE__ */
|
|
4631
|
+
children: /* @__PURE__ */ jsx3(HydratedDataTable, {
|
|
5231
4632
|
...props,
|
|
5232
4633
|
locale
|
|
5233
4634
|
})
|
|
@@ -5270,7 +4671,7 @@ var DataTableContent = ({
|
|
|
5270
4671
|
return () => observer.disconnect();
|
|
5271
4672
|
}, [scrollElement]);
|
|
5272
4673
|
if (store.config.features.gallery && store.state.view === "gallery") {
|
|
5273
|
-
return /* @__PURE__ */
|
|
4674
|
+
return /* @__PURE__ */ jsx3(DataTableGallery, {
|
|
5274
4675
|
table
|
|
5275
4676
|
});
|
|
5276
4677
|
}
|
|
@@ -5284,22 +4685,22 @@ var DataTableContent = ({
|
|
|
5284
4685
|
const options = virtualization && virtualization !== true ? virtualization : {};
|
|
5285
4686
|
const rowCount = !getActiveGrouping(store).length && model.pageRows.length && !store.config.status.error ? model.pageRows.length + 1 : undefined;
|
|
5286
4687
|
if (options.scroll === "page") {
|
|
5287
|
-
return /* @__PURE__ */
|
|
4688
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
5288
4689
|
ref: setPageTable,
|
|
5289
4690
|
"data-table-page-virtualization": "",
|
|
5290
4691
|
className: "[overflow-anchor:none]",
|
|
5291
|
-
children: /* @__PURE__ */
|
|
4692
|
+
children: /* @__PURE__ */ jsxs3(ScrollArea, {
|
|
5292
4693
|
className: "@container max-w-full min-w-0",
|
|
5293
4694
|
children: [
|
|
5294
|
-
/* @__PURE__ */
|
|
4695
|
+
/* @__PURE__ */ jsxs3(Table, {
|
|
5295
4696
|
"aria-rowcount": rowCount,
|
|
5296
4697
|
className: "table-fixed",
|
|
5297
4698
|
style: { width: `max(100%, ${width}px)` },
|
|
5298
4699
|
children: [
|
|
5299
|
-
/* @__PURE__ */
|
|
4700
|
+
/* @__PURE__ */ jsx3(DataTableHeader, {
|
|
5300
4701
|
table
|
|
5301
4702
|
}),
|
|
5302
|
-
/* @__PURE__ */
|
|
4703
|
+
/* @__PURE__ */ jsx3(DataTableBody, {
|
|
5303
4704
|
table,
|
|
5304
4705
|
viewport: {
|
|
5305
4706
|
element: null,
|
|
@@ -5310,7 +4711,7 @@ var DataTableContent = ({
|
|
|
5310
4711
|
})
|
|
5311
4712
|
]
|
|
5312
4713
|
}),
|
|
5313
|
-
/* @__PURE__ */
|
|
4714
|
+
/* @__PURE__ */ jsx3(ScrollBar, {
|
|
5314
4715
|
orientation: "horizontal"
|
|
5315
4716
|
})
|
|
5316
4717
|
]
|
|
@@ -5318,10 +4719,10 @@ var DataTableContent = ({
|
|
|
5318
4719
|
});
|
|
5319
4720
|
}
|
|
5320
4721
|
const fillHeight = options.scroll === "internal";
|
|
5321
|
-
return /* @__PURE__ */
|
|
4722
|
+
return /* @__PURE__ */ jsxs3(ScrollAreaPrimitive.Root, {
|
|
5322
4723
|
className: cn("relative isolate max-w-full min-w-0", fillHeight && "flex min-h-0 flex-1 flex-col"),
|
|
5323
4724
|
children: [
|
|
5324
|
-
/* @__PURE__ */
|
|
4725
|
+
/* @__PURE__ */ jsx3(ScrollAreaPrimitive.Viewport, {
|
|
5325
4726
|
ref: setScrollElement,
|
|
5326
4727
|
"data-table-virtual-viewport": "",
|
|
5327
4728
|
className: cn("@container [overflow-anchor:none] data-has-overflow-y:me-2.5 [&_[data-slot=table-container]]:overflow-visible", fillHeight && "min-h-0 flex-1"),
|
|
@@ -5329,17 +4730,17 @@ var DataTableContent = ({
|
|
|
5329
4730
|
maxHeight: fillHeight ? undefined : options.height ?? 480,
|
|
5330
4731
|
scrollPaddingTop: headerHeight
|
|
5331
4732
|
},
|
|
5332
|
-
children: /* @__PURE__ */
|
|
5333
|
-
children: /* @__PURE__ */
|
|
4733
|
+
children: /* @__PURE__ */ jsx3(ScrollAreaPrimitive.Content, {
|
|
4734
|
+
children: /* @__PURE__ */ jsxs3(Table, {
|
|
5334
4735
|
"aria-rowcount": rowCount,
|
|
5335
4736
|
className: "table-fixed",
|
|
5336
4737
|
style: { width: `max(100%, ${width}px)` },
|
|
5337
4738
|
children: [
|
|
5338
|
-
/* @__PURE__ */
|
|
4739
|
+
/* @__PURE__ */ jsx3(DataTableHeader, {
|
|
5339
4740
|
sticky: true,
|
|
5340
4741
|
table
|
|
5341
4742
|
}),
|
|
5342
|
-
/* @__PURE__ */
|
|
4743
|
+
/* @__PURE__ */ jsx3(DataTableBody, {
|
|
5343
4744
|
table,
|
|
5344
4745
|
viewport: { element: scrollElement, headerHeight, options }
|
|
5345
4746
|
})
|
|
@@ -5347,33 +4748,33 @@ var DataTableContent = ({
|
|
|
5347
4748
|
})
|
|
5348
4749
|
})
|
|
5349
4750
|
}),
|
|
5350
|
-
/* @__PURE__ */
|
|
4751
|
+
/* @__PURE__ */ jsx3(ScrollBar, {
|
|
5351
4752
|
className: "data-vertical:h-auto",
|
|
5352
4753
|
style: { top: headerHeight }
|
|
5353
4754
|
}),
|
|
5354
|
-
/* @__PURE__ */
|
|
4755
|
+
/* @__PURE__ */ jsx3(ScrollBar, {
|
|
5355
4756
|
orientation: "horizontal"
|
|
5356
4757
|
}),
|
|
5357
|
-
/* @__PURE__ */
|
|
4758
|
+
/* @__PURE__ */ jsx3(ScrollAreaPrimitive.Corner, {})
|
|
5358
4759
|
]
|
|
5359
4760
|
});
|
|
5360
4761
|
}
|
|
5361
|
-
return /* @__PURE__ */
|
|
4762
|
+
return /* @__PURE__ */ jsxs3(ScrollArea, {
|
|
5362
4763
|
className: "@container max-w-full min-w-0",
|
|
5363
4764
|
children: [
|
|
5364
|
-
/* @__PURE__ */
|
|
4765
|
+
/* @__PURE__ */ jsxs3(Table, {
|
|
5365
4766
|
className: "table-fixed",
|
|
5366
4767
|
style: { width: `max(100%, ${width}px)` },
|
|
5367
4768
|
children: [
|
|
5368
|
-
/* @__PURE__ */
|
|
4769
|
+
/* @__PURE__ */ jsx3(DataTableHeader, {
|
|
5369
4770
|
table
|
|
5370
4771
|
}),
|
|
5371
|
-
/* @__PURE__ */
|
|
4772
|
+
/* @__PURE__ */ jsx3(DataTableBody, {
|
|
5372
4773
|
table
|
|
5373
4774
|
})
|
|
5374
4775
|
]
|
|
5375
4776
|
}),
|
|
5376
|
-
/* @__PURE__ */
|
|
4777
|
+
/* @__PURE__ */ jsx3(ScrollBar, {
|
|
5377
4778
|
orientation: "horizontal"
|
|
5378
4779
|
})
|
|
5379
4780
|
]
|
|
@@ -5384,7 +4785,7 @@ var DataTableListCell = (props) => {
|
|
|
5384
4785
|
const locale = useKrakstackLocale3(props.locale);
|
|
5385
4786
|
const resolvedProps = { ...props, locale };
|
|
5386
4787
|
if (resolvedProps.options && (resolvedProps.onAdd || resolvedProps.onRemove)) {
|
|
5387
|
-
return /* @__PURE__ */
|
|
4788
|
+
return /* @__PURE__ */ jsx3(EditableDataTableListCell, {
|
|
5388
4789
|
...resolvedProps
|
|
5389
4790
|
});
|
|
5390
4791
|
}
|
|
@@ -5392,17 +4793,17 @@ var DataTableListCell = (props) => {
|
|
|
5392
4793
|
const labels = dataTableMessages(locale, resolvedProps.messages);
|
|
5393
4794
|
const hasItems = resolvedProps.items.length > 0;
|
|
5394
4795
|
if (!itemActions?.length && !hasItems) {
|
|
5395
|
-
return /* @__PURE__ */
|
|
4796
|
+
return /* @__PURE__ */ jsx3(DataTableListSummary, {
|
|
5396
4797
|
...summaryProps
|
|
5397
4798
|
});
|
|
5398
4799
|
}
|
|
5399
4800
|
const menuLabel = actionsLabel ?? (itemActions?.length ? labels.actions : labels.listDetails);
|
|
5400
|
-
return /* @__PURE__ */
|
|
4801
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
5401
4802
|
className: tableClasses.relationshipCell,
|
|
5402
4803
|
"data-slot": "data-table-list-cell",
|
|
5403
4804
|
onClick: (event) => event.stopPropagation(),
|
|
5404
4805
|
onPointerDown: (event) => event.stopPropagation(),
|
|
5405
|
-
children: /* @__PURE__ */
|
|
4806
|
+
children: /* @__PURE__ */ jsx3(DataTableListMenu, {
|
|
5406
4807
|
actions: itemActions ?? [],
|
|
5407
4808
|
display: resolvedProps.display,
|
|
5408
4809
|
force: hasItems,
|
|
@@ -5411,16 +4812,16 @@ var DataTableListCell = (props) => {
|
|
|
5411
4812
|
locale,
|
|
5412
4813
|
messages: resolvedProps.messages,
|
|
5413
4814
|
onItemClick,
|
|
5414
|
-
trigger: /* @__PURE__ */
|
|
4815
|
+
trigger: /* @__PURE__ */ jsxs3(Button2, {
|
|
5415
4816
|
"aria-label": menuLabel,
|
|
5416
4817
|
className: tableClasses.relationshipTrigger,
|
|
5417
4818
|
variant: "ghost",
|
|
5418
4819
|
children: [
|
|
5419
|
-
/* @__PURE__ */
|
|
4820
|
+
/* @__PURE__ */ jsx3(DataTableListSummaryContent, {
|
|
5420
4821
|
...summaryProps,
|
|
5421
4822
|
showMenu: false
|
|
5422
4823
|
}),
|
|
5423
|
-
/* @__PURE__ */
|
|
4824
|
+
/* @__PURE__ */ jsx3(ChevronDown, {})
|
|
5424
4825
|
]
|
|
5425
4826
|
})
|
|
5426
4827
|
})
|
|
@@ -5461,7 +4862,7 @@ var EditableDataTableListCell = ({
|
|
|
5461
4862
|
id: "data-table-list-remove",
|
|
5462
4863
|
closeOnClick: false,
|
|
5463
4864
|
name: labels.removeItem,
|
|
5464
|
-
icon: /* @__PURE__ */
|
|
4865
|
+
icon: /* @__PURE__ */ jsx3(Trash2, {}),
|
|
5465
4866
|
variant: "destructive",
|
|
5466
4867
|
onClick: (item) => {
|
|
5467
4868
|
if (item.value === undefined)
|
|
@@ -5472,12 +4873,12 @@ var EditableDataTableListCell = ({
|
|
|
5472
4873
|
}
|
|
5473
4874
|
] : []
|
|
5474
4875
|
];
|
|
5475
|
-
return /* @__PURE__ */
|
|
4876
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
5476
4877
|
"data-slot": "data-table-list-cell",
|
|
5477
4878
|
className: tableClasses.relationshipCell,
|
|
5478
4879
|
onClick: (event) => event.stopPropagation(),
|
|
5479
4880
|
onPointerDown: (event) => event.stopPropagation(),
|
|
5480
|
-
children: /* @__PURE__ */
|
|
4881
|
+
children: /* @__PURE__ */ jsx3(DataTableListMenu, {
|
|
5481
4882
|
actions,
|
|
5482
4883
|
addEmptyLabel: emptyLabel,
|
|
5483
4884
|
addLabel: labels.addItem,
|
|
@@ -5494,12 +4895,12 @@ var EditableDataTableListCell = ({
|
|
|
5494
4895
|
onAdd(item.value);
|
|
5495
4896
|
setSelected((current) => [...current, item]);
|
|
5496
4897
|
} : undefined,
|
|
5497
|
-
trigger: /* @__PURE__ */
|
|
4898
|
+
trigger: /* @__PURE__ */ jsxs3(Button2, {
|
|
5498
4899
|
"aria-label": manageLabel,
|
|
5499
|
-
className:
|
|
4900
|
+
className: tableClasses.relationshipTrigger,
|
|
5500
4901
|
variant: "ghost",
|
|
5501
4902
|
children: [
|
|
5502
|
-
/* @__PURE__ */
|
|
4903
|
+
/* @__PURE__ */ jsx3(DataTableListSummaryContent, {
|
|
5503
4904
|
emptyLabel,
|
|
5504
4905
|
items: selected,
|
|
5505
4906
|
display,
|
|
@@ -5507,7 +4908,7 @@ var EditableDataTableListCell = ({
|
|
|
5507
4908
|
visibleCount,
|
|
5508
4909
|
totalCount: selectedTotal
|
|
5509
4910
|
}),
|
|
5510
|
-
/* @__PURE__ */
|
|
4911
|
+
/* @__PURE__ */ jsx3(ChevronDown, {})
|
|
5511
4912
|
]
|
|
5512
4913
|
})
|
|
5513
4914
|
})
|
|
@@ -5540,42 +4941,42 @@ var DataTableListMenu = ({
|
|
|
5540
4941
|
return null;
|
|
5541
4942
|
const labels = dataTableMessages(locale, messages);
|
|
5542
4943
|
const resolvedLabel = label ?? (hasActions ? labels.actions : labels.listDetails);
|
|
5543
|
-
return /* @__PURE__ */
|
|
4944
|
+
return /* @__PURE__ */ jsxs3(DropdownMenu, {
|
|
5544
4945
|
modal: false,
|
|
5545
4946
|
children: [
|
|
5546
|
-
/* @__PURE__ */
|
|
4947
|
+
/* @__PURE__ */ jsx3(DropdownMenuTrigger, {
|
|
5547
4948
|
onClick: (event) => event.stopPropagation(),
|
|
5548
4949
|
onPointerDown: (event) => event.stopPropagation(),
|
|
5549
|
-
render: trigger ?? /* @__PURE__ */
|
|
4950
|
+
render: trigger ?? /* @__PURE__ */ jsx3(Button2, {
|
|
5550
4951
|
"aria-label": resolvedLabel,
|
|
5551
4952
|
className: cn("size-8 shrink-0", className),
|
|
5552
4953
|
size: "icon",
|
|
5553
4954
|
variant: "ghost",
|
|
5554
|
-
children: /* @__PURE__ */
|
|
4955
|
+
children: /* @__PURE__ */ jsx3(MoreHorizontal, {})
|
|
5555
4956
|
})
|
|
5556
4957
|
}),
|
|
5557
|
-
/* @__PURE__ */
|
|
4958
|
+
/* @__PURE__ */ jsx3(DropdownMenuContent, {
|
|
5558
4959
|
align: "end",
|
|
5559
4960
|
className: "max-h-[min(18rem,var(--available-height))] w-72 max-w-[calc(100vw-2rem)]",
|
|
5560
4961
|
onClick: (event) => event.stopPropagation(),
|
|
5561
4962
|
onPointerDown: (event) => event.stopPropagation(),
|
|
5562
|
-
children: /* @__PURE__ */
|
|
4963
|
+
children: /* @__PURE__ */ jsxs3(DropdownMenuGroup, {
|
|
5563
4964
|
children: [
|
|
5564
|
-
/* @__PURE__ */
|
|
4965
|
+
/* @__PURE__ */ jsx3(DropdownMenuLabel, {
|
|
5565
4966
|
children: resolvedLabel
|
|
5566
4967
|
}),
|
|
5567
|
-
/* @__PURE__ */
|
|
5568
|
-
entries.map(({ item, visibleActions }, index) => visibleActions.length ? /* @__PURE__ */
|
|
4968
|
+
/* @__PURE__ */ jsx3(DropdownMenuSeparator, {}),
|
|
4969
|
+
entries.map(({ item, visibleActions }, index) => visibleActions.length ? /* @__PURE__ */ jsxs3(DropdownMenuSub, {
|
|
5569
4970
|
children: [
|
|
5570
|
-
/* @__PURE__ */
|
|
5571
|
-
children: /* @__PURE__ */
|
|
4971
|
+
/* @__PURE__ */ jsx3(DropdownMenuSubTrigger, {
|
|
4972
|
+
children: /* @__PURE__ */ jsx3(DataTableListEntry, {
|
|
5572
4973
|
item,
|
|
5573
4974
|
appearance: display === "icon" ? "detail" : "list"
|
|
5574
4975
|
})
|
|
5575
4976
|
}),
|
|
5576
|
-
/* @__PURE__ */
|
|
4977
|
+
/* @__PURE__ */ jsx3(DropdownMenuSubContent, {
|
|
5577
4978
|
className: "w-max",
|
|
5578
|
-
children: visibleActions.map((action) => /* @__PURE__ */
|
|
4979
|
+
children: visibleActions.map((action) => /* @__PURE__ */ jsxs3(DropdownMenuItem, {
|
|
5579
4980
|
closeOnClick: action.closeOnClick,
|
|
5580
4981
|
disabled: action.disabled?.(item),
|
|
5581
4982
|
onClick: (event) => {
|
|
@@ -5590,21 +4991,21 @@ var DataTableListMenu = ({
|
|
|
5590
4991
|
}, action.id ?? action.name))
|
|
5591
4992
|
})
|
|
5592
4993
|
]
|
|
5593
|
-
}, item.value ?? `${item.label}-${index}`) : /* @__PURE__ */
|
|
4994
|
+
}, item.value ?? `${item.label}-${index}`) : /* @__PURE__ */ jsx3(DropdownMenuItem, {
|
|
5594
4995
|
closeOnClick: Boolean(onItemClick),
|
|
5595
4996
|
onClick: (event) => {
|
|
5596
4997
|
event.stopPropagation();
|
|
5597
4998
|
onItemClick?.(item);
|
|
5598
4999
|
},
|
|
5599
|
-
children: /* @__PURE__ */
|
|
5000
|
+
children: /* @__PURE__ */ jsx3(DataTableListEntry, {
|
|
5600
5001
|
item,
|
|
5601
5002
|
appearance: display === "icon" ? "detail" : "list"
|
|
5602
5003
|
})
|
|
5603
5004
|
}, item.value ?? `${item.label}-${index}`)),
|
|
5604
|
-
onAdd && addOptions?.length ? /* @__PURE__ */
|
|
5005
|
+
onAdd && addOptions?.length ? /* @__PURE__ */ jsxs3(Fragment, {
|
|
5605
5006
|
children: [
|
|
5606
|
-
entries.length ? /* @__PURE__ */
|
|
5607
|
-
/* @__PURE__ */
|
|
5007
|
+
entries.length ? /* @__PURE__ */ jsx3(DropdownMenuSeparator, {}) : null,
|
|
5008
|
+
/* @__PURE__ */ jsx3(DataTableListAddMenu, {
|
|
5608
5009
|
emptyLabel: addEmptyLabel,
|
|
5609
5010
|
label: addLabel ?? labels.addItem,
|
|
5610
5011
|
locale,
|
|
@@ -5639,28 +5040,28 @@ var DataTableListAddMenu = ({
|
|
|
5639
5040
|
const labels = dataTableMessages(locale, messages);
|
|
5640
5041
|
const normalizedSearch = search.trim().toLocaleLowerCase(locale);
|
|
5641
5042
|
const filtered = normalizedSearch ? options.filter((item) => item.label.toLocaleLowerCase(locale).includes(normalizedSearch)) : options;
|
|
5642
|
-
return /* @__PURE__ */
|
|
5043
|
+
return /* @__PURE__ */ jsxs3(DropdownMenuSub, {
|
|
5643
5044
|
onOpenChange: (open) => {
|
|
5644
5045
|
if (!open)
|
|
5645
5046
|
setSearch("");
|
|
5646
5047
|
},
|
|
5647
5048
|
children: [
|
|
5648
|
-
/* @__PURE__ */
|
|
5049
|
+
/* @__PURE__ */ jsxs3(DropdownMenuSubTrigger, {
|
|
5649
5050
|
children: [
|
|
5650
|
-
/* @__PURE__ */
|
|
5051
|
+
/* @__PURE__ */ jsx3(Plus, {}),
|
|
5651
5052
|
label
|
|
5652
5053
|
]
|
|
5653
5054
|
}),
|
|
5654
|
-
/* @__PURE__ */
|
|
5055
|
+
/* @__PURE__ */ jsxs3(DropdownMenuSubContent, {
|
|
5655
5056
|
className: "w-64",
|
|
5656
5057
|
children: [
|
|
5657
|
-
/* @__PURE__ */
|
|
5058
|
+
/* @__PURE__ */ jsxs3("div", {
|
|
5658
5059
|
className: "relative p-1",
|
|
5659
5060
|
children: [
|
|
5660
|
-
/* @__PURE__ */
|
|
5061
|
+
/* @__PURE__ */ jsx3(Search, {
|
|
5661
5062
|
className: "text-muted-foreground pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2"
|
|
5662
5063
|
}),
|
|
5663
|
-
/* @__PURE__ */
|
|
5064
|
+
/* @__PURE__ */ jsx3(Input, {
|
|
5664
5065
|
"aria-label": searchLabel,
|
|
5665
5066
|
className: "h-8 pl-8",
|
|
5666
5067
|
onChange: (event) => setSearch(event.target.value),
|
|
@@ -5674,15 +5075,15 @@ var DataTableListAddMenu = ({
|
|
|
5674
5075
|
})
|
|
5675
5076
|
]
|
|
5676
5077
|
}),
|
|
5677
|
-
/* @__PURE__ */
|
|
5678
|
-
filtered.length ? filtered.map((item) => /* @__PURE__ */
|
|
5078
|
+
/* @__PURE__ */ jsx3(DropdownMenuSeparator, {}),
|
|
5079
|
+
filtered.length ? filtered.map((item) => /* @__PURE__ */ jsx3(DropdownMenuItem, {
|
|
5679
5080
|
closeOnClick: false,
|
|
5680
5081
|
onClick: () => onAdd(item),
|
|
5681
|
-
children: /* @__PURE__ */
|
|
5082
|
+
children: /* @__PURE__ */ jsx3(DataTableListEntry, {
|
|
5682
5083
|
item,
|
|
5683
5084
|
appearance: display === "icon" ? "detail" : "list"
|
|
5684
5085
|
})
|
|
5685
|
-
}, item.value)) : /* @__PURE__ */
|
|
5086
|
+
}, item.value)) : /* @__PURE__ */ jsx3("div", {
|
|
5686
5087
|
className: "text-muted-foreground px-2 py-1.5 text-sm",
|
|
5687
5088
|
children: emptyLabel
|
|
5688
5089
|
})
|
|
@@ -5703,29 +5104,29 @@ var DataTableListSummaryContent = ({
|
|
|
5703
5104
|
}) => {
|
|
5704
5105
|
const normalized = items.map((item) => Schema6.is(Schema6.String)(item) ? { label: item } : item);
|
|
5705
5106
|
if (!normalized.length)
|
|
5706
|
-
return /* @__PURE__ */
|
|
5107
|
+
return /* @__PURE__ */ jsx3("span", {
|
|
5707
5108
|
className: "text-muted-foreground",
|
|
5708
5109
|
children: emptyLabel
|
|
5709
5110
|
});
|
|
5710
5111
|
const visible = normalized.slice(0, Math.max(0, visibleCount));
|
|
5711
5112
|
const remaining = Math.max(totalCount - visible.length, 0);
|
|
5712
5113
|
if (display === "icon") {
|
|
5713
|
-
return /* @__PURE__ */
|
|
5714
|
-
children: /* @__PURE__ */
|
|
5114
|
+
return /* @__PURE__ */ jsx3(TooltipProvider, {
|
|
5115
|
+
children: /* @__PURE__ */ jsxs3("span", {
|
|
5715
5116
|
className: "flex items-center",
|
|
5716
5117
|
children: [
|
|
5717
|
-
visible.map((item, index) => /* @__PURE__ */
|
|
5118
|
+
visible.map((item, index) => /* @__PURE__ */ jsx3(DataTableListEntry, {
|
|
5718
5119
|
item,
|
|
5719
5120
|
appearance: "icon"
|
|
5720
5121
|
}, item.value ?? `${item.label}-${index}`)),
|
|
5721
|
-
remaining ? /* @__PURE__ */
|
|
5122
|
+
remaining ? /* @__PURE__ */ jsxs3("span", {
|
|
5722
5123
|
className: "bg-secondary text-secondary-foreground -ml-1 flex size-8 items-center justify-center rounded-full",
|
|
5723
5124
|
children: [
|
|
5724
5125
|
"+",
|
|
5725
5126
|
remaining
|
|
5726
5127
|
]
|
|
5727
5128
|
}) : null,
|
|
5728
|
-
remaining && showMenu ? /* @__PURE__ */
|
|
5129
|
+
remaining && showMenu ? /* @__PURE__ */ jsx3(DataTableListMenu, {
|
|
5729
5130
|
actions: [],
|
|
5730
5131
|
display,
|
|
5731
5132
|
force: true,
|
|
@@ -5737,17 +5138,43 @@ var DataTableListSummaryContent = ({
|
|
|
5737
5138
|
})
|
|
5738
5139
|
});
|
|
5739
5140
|
}
|
|
5740
|
-
|
|
5141
|
+
if (display === "badge") {
|
|
5142
|
+
return /* @__PURE__ */ jsxs3("span", {
|
|
5143
|
+
className: "inline-flex min-w-0 flex-wrap items-center gap-1",
|
|
5144
|
+
children: [
|
|
5145
|
+
visible.map((item, index) => /* @__PURE__ */ jsx3(Badge, {
|
|
5146
|
+
variant: "secondary",
|
|
5147
|
+
children: item.label
|
|
5148
|
+
}, item.value ?? `${item.label}-${index}`)),
|
|
5149
|
+
remaining ? /* @__PURE__ */ jsxs3(Badge, {
|
|
5150
|
+
variant: "secondary",
|
|
5151
|
+
children: [
|
|
5152
|
+
"+",
|
|
5153
|
+
remaining
|
|
5154
|
+
]
|
|
5155
|
+
}) : null,
|
|
5156
|
+
remaining && showMenu ? /* @__PURE__ */ jsx3(DataTableListMenu, {
|
|
5157
|
+
actions: [],
|
|
5158
|
+
display,
|
|
5159
|
+
force: true,
|
|
5160
|
+
items: normalized,
|
|
5161
|
+
locale,
|
|
5162
|
+
messages
|
|
5163
|
+
}) : null
|
|
5164
|
+
]
|
|
5165
|
+
});
|
|
5166
|
+
}
|
|
5167
|
+
return /* @__PURE__ */ jsxs3("span", {
|
|
5741
5168
|
className: "inline-flex min-w-0 items-center gap-2 text-sm",
|
|
5742
5169
|
children: [
|
|
5743
|
-
/* @__PURE__ */
|
|
5170
|
+
/* @__PURE__ */ jsxs3("span", {
|
|
5744
5171
|
className: "truncate",
|
|
5745
5172
|
children: [
|
|
5746
5173
|
visible.map((item) => item.label).join(", "),
|
|
5747
5174
|
remaining ? ` +${remaining}` : ""
|
|
5748
5175
|
]
|
|
5749
5176
|
}),
|
|
5750
|
-
remaining && showMenu ? /* @__PURE__ */
|
|
5177
|
+
remaining && showMenu ? /* @__PURE__ */ jsx3(DataTableListMenu, {
|
|
5751
5178
|
actions: [],
|
|
5752
5179
|
display,
|
|
5753
5180
|
force: true,
|
|
@@ -5758,7 +5185,7 @@ var DataTableListSummaryContent = ({
|
|
|
5758
5185
|
]
|
|
5759
5186
|
});
|
|
5760
5187
|
};
|
|
5761
|
-
var DataTableListSummary = (props) => /* @__PURE__ */
|
|
5188
|
+
var DataTableListSummary = (props) => /* @__PURE__ */ jsx3(DataTableListSummaryContent, {
|
|
5762
5189
|
...props,
|
|
5763
5190
|
showMenu: true
|
|
5764
5191
|
});
|
|
@@ -5766,40 +5193,40 @@ var DataTableListEntry = ({
|
|
|
5766
5193
|
item,
|
|
5767
5194
|
appearance
|
|
5768
5195
|
}) => {
|
|
5769
|
-
const icon = /* @__PURE__ */
|
|
5196
|
+
const icon = /* @__PURE__ */ jsx3("span", {
|
|
5770
5197
|
"aria-hidden": "true",
|
|
5771
5198
|
className: "bg-secondary text-secondary-foreground flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-full",
|
|
5772
|
-
children: item.imageSrc ? /* @__PURE__ */
|
|
5199
|
+
children: item.imageSrc ? /* @__PURE__ */ jsx3("img", {
|
|
5773
5200
|
alt: "",
|
|
5774
5201
|
src: item.imageSrc,
|
|
5775
5202
|
className: "size-full object-cover"
|
|
5776
5203
|
}) : item.icon ?? item.label.slice(0, 2).toUpperCase()
|
|
5777
5204
|
});
|
|
5778
5205
|
if (appearance === "list") {
|
|
5779
|
-
return /* @__PURE__ */
|
|
5206
|
+
return /* @__PURE__ */ jsx3("span", {
|
|
5780
5207
|
className: "min-w-0 flex-1 truncate",
|
|
5781
5208
|
title: item.label,
|
|
5782
5209
|
children: item.label
|
|
5783
5210
|
});
|
|
5784
5211
|
}
|
|
5785
|
-
return appearance === "icon" ? /* @__PURE__ */
|
|
5212
|
+
return appearance === "icon" ? /* @__PURE__ */ jsxs3(Tooltip, {
|
|
5786
5213
|
children: [
|
|
5787
|
-
/* @__PURE__ */
|
|
5788
|
-
render: /* @__PURE__ */
|
|
5214
|
+
/* @__PURE__ */ jsx3(TooltipTrigger, {
|
|
5215
|
+
render: /* @__PURE__ */ jsx3("span", {
|
|
5789
5216
|
className: "-ml-1 inline-flex rounded-full",
|
|
5790
5217
|
"aria-label": item.label
|
|
5791
5218
|
}),
|
|
5792
5219
|
children: icon
|
|
5793
5220
|
}),
|
|
5794
|
-
/* @__PURE__ */
|
|
5221
|
+
/* @__PURE__ */ jsx3(TooltipContent, {
|
|
5795
5222
|
children: item.label
|
|
5796
5223
|
})
|
|
5797
5224
|
]
|
|
5798
|
-
}) : /* @__PURE__ */
|
|
5225
|
+
}) : /* @__PURE__ */ jsxs3("span", {
|
|
5799
5226
|
className: "flex min-w-0 flex-1 items-center gap-2 text-left",
|
|
5800
5227
|
children: [
|
|
5801
5228
|
icon,
|
|
5802
|
-
/* @__PURE__ */
|
|
5229
|
+
/* @__PURE__ */ jsx3("span", {
|
|
5803
5230
|
className: "truncate",
|
|
5804
5231
|
children: item.label
|
|
5805
5232
|
})
|