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