@krak-stack/registry 0.11.3 → 0.11.5
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 +18 -0
- 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 +555 -1265
- 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/html.d.ts +12 -12
- package/dist/components/data-table/html.js +200 -174
- package/dist/components/data-table/react.js +549 -1259
- 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/hint/react.d.ts +15 -0
- package/dist/components/hint/react.js +133 -0
- 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 +211 -184
- package/dist/components/webhook-delivery-table/react.js +585 -1362
- 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 +4 -8
- 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 {
|
|
@@ -2622,14 +1912,14 @@ var dataTableBehaviours = {
|
|
|
2622
1912
|
};
|
|
2623
1913
|
|
|
2624
1914
|
// ../../src/components/data-table/react.tsx
|
|
2625
|
-
import { jsx as
|
|
1915
|
+
import { jsx as jsx3, jsxs as jsxs3, Fragment } from "react/jsx-runtime";
|
|
2626
1916
|
var DataTableStylesContext = createContext(undefined);
|
|
2627
1917
|
var DataTableSlotClassesContext = createContext(resolveTableClasses());
|
|
2628
1918
|
var styledTablePart = (Part, slot, style) => {
|
|
2629
1919
|
const StyledPart = (props) => {
|
|
2630
1920
|
const styles = useContext(DataTableStylesContext);
|
|
2631
1921
|
const className = cn(props.className, style(styles));
|
|
2632
|
-
return /* @__PURE__ */
|
|
1922
|
+
return /* @__PURE__ */ jsx3(Part, {
|
|
2633
1923
|
"data-table-slot": slot,
|
|
2634
1924
|
...props,
|
|
2635
1925
|
className
|
|
@@ -2637,32 +1927,32 @@ var styledTablePart = (Part, slot, style) => {
|
|
|
2637
1927
|
};
|
|
2638
1928
|
return StyledPart;
|
|
2639
1929
|
};
|
|
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
|
|
1930
|
+
var Table = styledTablePart(PrimitiveTable, "table", (s) => s?.table?.content);
|
|
1931
|
+
var TableHeader = styledTablePart(PrimitiveTableHeader, "header", (s) => s?.table?.header);
|
|
1932
|
+
var TableBody = styledTablePart(PrimitiveTableBody, "body", (s) => s?.table?.body);
|
|
1933
|
+
var TableRow = styledTablePart(PrimitiveTableRow, "row", (s) => s?.table?.row);
|
|
1934
|
+
var TableHead = styledTablePart(PrimitiveTableHead, "head", (s) => s?.table?.head);
|
|
1935
|
+
var TableCell = styledTablePart(PrimitiveTableCell, "cell", (s) => s?.table?.cell);
|
|
1936
|
+
var Input = styledTablePart(PrimitiveInput, "input", (s) => s?.toolbar?.search);
|
|
1937
|
+
var Menubar = styledTablePart(PrimitiveMenubar, "menubar", (s) => s?.toolbar?.content);
|
|
1938
|
+
var MenubarTrigger = styledTablePart(PrimitiveMenubarTrigger, "menu-trigger", (s) => s?.toolbar?.trigger);
|
|
1939
|
+
var MenubarContent = styledTablePart(PrimitiveMenubarContent, "menu", (s) => s?.menu?.content);
|
|
1940
|
+
var MenubarSubContent = styledTablePart(PrimitiveMenubarSubContent, "submenu", (s) => s?.menu?.subContent);
|
|
1941
|
+
var MenubarSubTrigger = styledTablePart(PrimitiveMenubarSubTrigger, "submenu-trigger", (s) => s?.menu?.subTrigger);
|
|
1942
|
+
var MenubarItem = styledTablePart(PrimitiveMenubarItem, "menu-item", (s) => s?.menu?.item);
|
|
1943
|
+
var MenubarCheckboxItem = styledTablePart(PrimitiveMenubarCheckboxItem, "menu-checkbox-item", (s) => s?.menu?.item);
|
|
1944
|
+
var MenubarRadioItem = styledTablePart(PrimitiveMenubarRadioItem, "menu-radio-item", (s) => s?.menu?.item);
|
|
1945
|
+
var MenubarLabel = styledTablePart(PrimitiveMenubarLabel, "menu-label", (s) => s?.menu?.label);
|
|
1946
|
+
var MenubarSeparator = styledTablePart(PrimitiveMenubarSeparator, "menu-separator", (s) => s?.menu?.separator);
|
|
1947
|
+
var DropdownMenuTrigger = styledTablePart(PrimitiveDropdownMenuTrigger, "row-menu-trigger", (s) => s?.toolbar?.trigger);
|
|
1948
|
+
var DropdownMenuContent = styledTablePart(PrimitiveDropdownMenuContent, "row-menu", (s) => s?.menu?.content);
|
|
1949
|
+
var DropdownMenuSubContent = styledTablePart(PrimitiveDropdownMenuSubContent, "row-submenu", (s) => s?.menu?.subContent);
|
|
1950
|
+
var DropdownMenuSubTrigger = styledTablePart(PrimitiveDropdownMenuSubTrigger, "row-submenu-trigger", (s) => s?.menu?.subTrigger);
|
|
1951
|
+
var DropdownMenuItem = styledTablePart(PrimitiveDropdownMenuItem, "row-menu-item", (s) => s?.menu?.item);
|
|
1952
|
+
var DropdownMenuLabel = styledTablePart(PrimitiveDropdownMenuLabel, "row-menu-label", (s) => s?.menu?.label);
|
|
1953
|
+
var DropdownMenuSeparator = styledTablePart(PrimitiveDropdownMenuSeparator, "row-menu-separator", (s) => s?.menu?.separator);
|
|
1954
|
+
var SelectContent2 = styledTablePart(PrimitiveSelectContent, "select-popup", (s) => s?.popup?.select);
|
|
1955
|
+
var TooltipContent = styledTablePart(PrimitiveTooltipContent, "tooltip", (s) => s?.popup?.tooltip);
|
|
2666
1956
|
var DataTableReferenceCell = ({
|
|
2667
1957
|
item,
|
|
2668
1958
|
emptyLabel = "—",
|
|
@@ -2673,33 +1963,33 @@ var DataTableReferenceCell = ({
|
|
|
2673
1963
|
if (!item)
|
|
2674
1964
|
return emptyLabel;
|
|
2675
1965
|
const initials = tableInitials(item.label);
|
|
2676
|
-
return /* @__PURE__ */
|
|
1966
|
+
return /* @__PURE__ */ jsxs3("div", {
|
|
2677
1967
|
className: tableClasses.reference,
|
|
2678
1968
|
children: [
|
|
2679
|
-
/* @__PURE__ */
|
|
1969
|
+
/* @__PURE__ */ jsx3("div", {
|
|
2680
1970
|
className: cn(tableClasses.referenceAvatar, imageVariant === "circle" ? "rounded-full" : "rounded-md", item.iconClassName),
|
|
2681
|
-
children: item.icon ? /* @__PURE__ */
|
|
1971
|
+
children: item.icon ? /* @__PURE__ */ jsx3("span", {
|
|
2682
1972
|
"aria-hidden": "true",
|
|
2683
1973
|
className: "[&_svg]:size-4",
|
|
2684
1974
|
children: item.icon
|
|
2685
|
-
}) : item.imageSrc && item.imageSrc !== failedImage ? /* @__PURE__ */
|
|
1975
|
+
}) : item.imageSrc && item.imageSrc !== failedImage ? /* @__PURE__ */ jsx3("img", {
|
|
2686
1976
|
src: item.imageSrc,
|
|
2687
1977
|
alt: item.label,
|
|
2688
1978
|
className: "size-full object-cover",
|
|
2689
1979
|
onError: () => setFailedImage(item.imageSrc ?? undefined)
|
|
2690
|
-
}) : /* @__PURE__ */
|
|
1980
|
+
}) : /* @__PURE__ */ jsx3("span", {
|
|
2691
1981
|
"aria-hidden": "true",
|
|
2692
1982
|
children: initials
|
|
2693
1983
|
})
|
|
2694
1984
|
}),
|
|
2695
|
-
/* @__PURE__ */
|
|
1985
|
+
/* @__PURE__ */ jsxs3("div", {
|
|
2696
1986
|
className: tableClasses.referenceText,
|
|
2697
1987
|
children: [
|
|
2698
|
-
/* @__PURE__ */
|
|
1988
|
+
/* @__PURE__ */ jsx3("span", {
|
|
2699
1989
|
className: tableClasses.referenceName,
|
|
2700
1990
|
children: item.label
|
|
2701
1991
|
}),
|
|
2702
|
-
item.description ? /* @__PURE__ */
|
|
1992
|
+
item.description ? /* @__PURE__ */ jsx3("span", {
|
|
2703
1993
|
className: tableClasses.referenceDescription,
|
|
2704
1994
|
children: item.description
|
|
2705
1995
|
}) : null
|
|
@@ -3075,14 +2365,14 @@ var renderCell = (row, column, locale = "en", labels = dataTableMessages(locale)
|
|
|
3075
2365
|
};
|
|
3076
2366
|
const CellRenderer = column.colDef.cellRenderer;
|
|
3077
2367
|
if (CellRenderer)
|
|
3078
|
-
return /* @__PURE__ */
|
|
2368
|
+
return /* @__PURE__ */ jsx3(CellRenderer, {
|
|
3079
2369
|
...params
|
|
3080
2370
|
});
|
|
3081
2371
|
const colDef = column.colDef;
|
|
3082
2372
|
if (colDef.type === "reference") {
|
|
3083
2373
|
if (colDef.valueFormatter)
|
|
3084
2374
|
return colDef.valueFormatter(params);
|
|
3085
|
-
return /* @__PURE__ */
|
|
2375
|
+
return /* @__PURE__ */ jsx3(DataTableReferenceCell, {
|
|
3086
2376
|
item: colDef.typeOptions.getItem(row.data),
|
|
3087
2377
|
emptyLabel: colDef.typeOptions.emptyLabel,
|
|
3088
2378
|
...colDef.typeOptions.imageVariant ? { imageVariant: colDef.typeOptions.imageVariant } : {}
|
|
@@ -3092,7 +2382,7 @@ var renderCell = (row, column, locale = "en", labels = dataTableMessages(locale)
|
|
|
3092
2382
|
if (colDef.valueFormatter)
|
|
3093
2383
|
return colDef.valueFormatter(params);
|
|
3094
2384
|
const number = Option4.getOrUndefined(decodeNumberValue(value));
|
|
3095
|
-
return /* @__PURE__ */
|
|
2385
|
+
return /* @__PURE__ */ jsx3("span", {
|
|
3096
2386
|
className: "block text-left tabular-nums",
|
|
3097
2387
|
children: number === undefined ? colDef.typeOptions?.emptyLabel ?? "—" : formatNumberValue(number, colDef.typeOptions, locale)
|
|
3098
2388
|
});
|
|
@@ -3104,12 +2394,12 @@ var renderCell = (row, column, locale = "en", labels = dataTableMessages(locale)
|
|
|
3104
2394
|
if (boolean === undefined)
|
|
3105
2395
|
return colDef.typeOptions?.emptyLabel ?? "—";
|
|
3106
2396
|
const options = colDef.typeOptions;
|
|
3107
|
-
return /* @__PURE__ */
|
|
2397
|
+
return /* @__PURE__ */ jsx3("label", {
|
|
3108
2398
|
"data-slot": "data-table-boolean-cell",
|
|
3109
2399
|
className: cn("focus-within:border-ring focus-within:ring-ring/50 flex min-h-16 w-full items-center justify-start border border-transparent px-2 outline-none focus-within:ring-3 focus-within:ring-inset in-[[data-slot=table-cell]]:absolute in-[[data-slot=table-cell]]:inset-0 in-[[data-slot=table-cell]]:min-h-0", options?.onChange && !options.disabled?.(row.data) && "hover:bg-muted/50 cursor-pointer"),
|
|
3110
2400
|
onClick: (event) => event.stopPropagation(),
|
|
3111
2401
|
onPointerDown: (event) => event.stopPropagation(),
|
|
3112
|
-
children: /* @__PURE__ */
|
|
2402
|
+
children: /* @__PURE__ */ jsx3(Checkbox, {
|
|
3113
2403
|
"aria-label": options?.getAriaLabel?.(row.data) ?? columnLabel(column),
|
|
3114
2404
|
className: "focus-visible:ring-0 focus-visible:outline-none",
|
|
3115
2405
|
checked: boolean,
|
|
@@ -3123,7 +2413,7 @@ var renderCell = (row, column, locale = "en", labels = dataTableMessages(locale)
|
|
|
3123
2413
|
if (colDef.valueFormatter)
|
|
3124
2414
|
return colDef.valueFormatter(params);
|
|
3125
2415
|
const date = resolveDate(value, colDef.type);
|
|
3126
|
-
return date ? /* @__PURE__ */
|
|
2416
|
+
return date ? /* @__PURE__ */ jsx3("time", {
|
|
3127
2417
|
dateTime: dateIsoValue(date),
|
|
3128
2418
|
children: formatDateValue(date, colDef, locale)
|
|
3129
2419
|
}) : colDef.typeOptions?.emptyLabel ?? "—";
|
|
@@ -3137,7 +2427,7 @@ var renderCell = (row, column, locale = "en", labels = dataTableMessages(locale)
|
|
|
3137
2427
|
disabled: (item) => action.disabled?.({ item, row: row.data }) ?? false
|
|
3138
2428
|
}));
|
|
3139
2429
|
if (config.getOptions) {
|
|
3140
|
-
return /* @__PURE__ */
|
|
2430
|
+
return /* @__PURE__ */ jsx3(DataTableListCell, {
|
|
3141
2431
|
...config,
|
|
3142
2432
|
itemActions,
|
|
3143
2433
|
onItemClick: config.onItemClick ? (item) => config.onItemClick?.({ item, row: row.data }) : undefined,
|
|
@@ -3150,7 +2440,7 @@ var renderCell = (row, column, locale = "en", labels = dataTableMessages(locale)
|
|
|
3150
2440
|
onRemove: config.onRemove ? (value) => config.onRemove?.({ value, row: row.data }) : undefined
|
|
3151
2441
|
});
|
|
3152
2442
|
}
|
|
3153
|
-
return /* @__PURE__ */
|
|
2443
|
+
return /* @__PURE__ */ jsx3(DataTableListCell, {
|
|
3154
2444
|
...config,
|
|
3155
2445
|
itemActions,
|
|
3156
2446
|
onItemClick: config.onItemClick ? (item) => config.onItemClick?.({ item, row: row.data }) : undefined,
|
|
@@ -3185,33 +2475,33 @@ var DataTableRowActions = ({
|
|
|
3185
2475
|
const visible = actions.filter((action) => !action.visible || action.visible(row));
|
|
3186
2476
|
if (!visible.length)
|
|
3187
2477
|
return null;
|
|
3188
|
-
return /* @__PURE__ */
|
|
2478
|
+
return /* @__PURE__ */ jsxs3(DropdownMenu, {
|
|
3189
2479
|
children: [
|
|
3190
|
-
/* @__PURE__ */
|
|
2480
|
+
/* @__PURE__ */ jsx3(DropdownMenuTrigger, {
|
|
3191
2481
|
onClick: (event) => event.stopPropagation(),
|
|
3192
|
-
render: /* @__PURE__ */
|
|
2482
|
+
render: /* @__PURE__ */ jsxs3(Button2, {
|
|
3193
2483
|
className: cn(tableClasses.actionTrigger, "[&_svg:not([class*='size-'])]:size-4"),
|
|
3194
2484
|
size: "icon",
|
|
3195
2485
|
variant: "ghost",
|
|
3196
2486
|
children: [
|
|
3197
|
-
/* @__PURE__ */
|
|
2487
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3198
2488
|
className: "sr-only",
|
|
3199
2489
|
children: title
|
|
3200
2490
|
}),
|
|
3201
|
-
/* @__PURE__ */
|
|
2491
|
+
/* @__PURE__ */ jsx3(MoreHorizontal, {})
|
|
3202
2492
|
]
|
|
3203
2493
|
})
|
|
3204
2494
|
}),
|
|
3205
|
-
/* @__PURE__ */
|
|
2495
|
+
/* @__PURE__ */ jsx3(DropdownMenuContent, {
|
|
3206
2496
|
align: "end",
|
|
3207
2497
|
className: "w-max",
|
|
3208
|
-
children: /* @__PURE__ */
|
|
2498
|
+
children: /* @__PURE__ */ jsxs3(DropdownMenuGroup, {
|
|
3209
2499
|
children: [
|
|
3210
|
-
/* @__PURE__ */
|
|
2500
|
+
/* @__PURE__ */ jsx3(DropdownMenuLabel, {
|
|
3211
2501
|
children: title
|
|
3212
2502
|
}),
|
|
3213
|
-
/* @__PURE__ */
|
|
3214
|
-
visible.map((action) => /* @__PURE__ */
|
|
2503
|
+
/* @__PURE__ */ jsx3(DropdownMenuSeparator, {}),
|
|
2504
|
+
visible.map((action) => /* @__PURE__ */ jsxs3(DropdownMenuItem, {
|
|
3215
2505
|
onClick: (event) => {
|
|
3216
2506
|
event.stopPropagation();
|
|
3217
2507
|
action.onClick(row);
|
|
@@ -3246,7 +2536,7 @@ var DataTableRowActionMenu = ({
|
|
|
3246
2536
|
reorderActions.push({
|
|
3247
2537
|
id: "data-table-move-up",
|
|
3248
2538
|
name: store.config.labels.moveUp,
|
|
3249
|
-
icon: /* @__PURE__ */
|
|
2539
|
+
icon: /* @__PURE__ */ jsx3(ArrowUp, {}),
|
|
3250
2540
|
onClick: () => move(rowIndex - 1)
|
|
3251
2541
|
});
|
|
3252
2542
|
}
|
|
@@ -3254,12 +2544,12 @@ var DataTableRowActionMenu = ({
|
|
|
3254
2544
|
reorderActions.push({
|
|
3255
2545
|
id: "data-table-move-down",
|
|
3256
2546
|
name: store.config.labels.moveDown,
|
|
3257
|
-
icon: /* @__PURE__ */
|
|
2547
|
+
icon: /* @__PURE__ */ jsx3(ArrowDown, {}),
|
|
3258
2548
|
onClick: () => move(rowIndex + 1)
|
|
3259
2549
|
});
|
|
3260
2550
|
}
|
|
3261
2551
|
}
|
|
3262
|
-
return /* @__PURE__ */
|
|
2552
|
+
return /* @__PURE__ */ jsx3(DataTableRowActions, {
|
|
3263
2553
|
actions: [...reorderActions, ...rowActions ? rowActions.items : []],
|
|
3264
2554
|
row: row.data,
|
|
3265
2555
|
title: rowActions?.label ?? store.config.labels.actions
|
|
@@ -3305,60 +2595,60 @@ var DataTableToolbar = ({
|
|
|
3305
2595
|
send(DataTableMessage.ExportFinished({ failed }));
|
|
3306
2596
|
}
|
|
3307
2597
|
};
|
|
3308
|
-
return /* @__PURE__ */
|
|
2598
|
+
return /* @__PURE__ */ jsxs3("div", {
|
|
3309
2599
|
className: cn(tableClasses.toolbar, "pb-4"),
|
|
3310
2600
|
children: [
|
|
3311
|
-
features.search !== false ? /* @__PURE__ */
|
|
2601
|
+
features.search !== false ? /* @__PURE__ */ jsxs3("div", {
|
|
3312
2602
|
className: tableClasses.toolbarSearch,
|
|
3313
2603
|
children: [
|
|
3314
|
-
/* @__PURE__ */
|
|
2604
|
+
/* @__PURE__ */ jsx3(Search, {
|
|
3315
2605
|
className: "text-muted-foreground pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2"
|
|
3316
2606
|
}),
|
|
3317
|
-
/* @__PURE__ */
|
|
2607
|
+
/* @__PURE__ */ jsx3(Input, {
|
|
3318
2608
|
className: "px-9",
|
|
3319
2609
|
onChange: (event) => send(DataTableMessage.SearchChanged({ value: event.target.value })),
|
|
3320
2610
|
placeholder: labels.filter,
|
|
3321
2611
|
value: store.state.globalFilter ?? ""
|
|
3322
2612
|
}),
|
|
3323
|
-
store.state.globalFilter ? /* @__PURE__ */
|
|
2613
|
+
store.state.globalFilter ? /* @__PURE__ */ jsx3(Button2, {
|
|
3324
2614
|
"aria-label": labels.filter,
|
|
3325
2615
|
className: "absolute top-1/2 right-1 size-7 -translate-y-1/2 active:not-aria-[haspopup]:-translate-y-1/2",
|
|
3326
2616
|
onClick: () => send(DataTableMessage.SearchChanged({ value: "" })),
|
|
3327
2617
|
size: "icon",
|
|
3328
2618
|
variant: "ghost",
|
|
3329
|
-
children: /* @__PURE__ */
|
|
2619
|
+
children: /* @__PURE__ */ jsx3(X, {})
|
|
3330
2620
|
}) : null
|
|
3331
2621
|
]
|
|
3332
2622
|
}) : null,
|
|
3333
|
-
/* @__PURE__ */
|
|
2623
|
+
/* @__PURE__ */ jsx3("div", {
|
|
3334
2624
|
className: tableClasses.toolbarMenus,
|
|
3335
|
-
children: /* @__PURE__ */
|
|
2625
|
+
children: /* @__PURE__ */ jsxs3(Menubar, {
|
|
3336
2626
|
modal: false,
|
|
3337
2627
|
className: cn(tableClasses.menubar, "[&_[data-slot=menubar-trigger]]:gap-2 [&_[data-slot=menubar-trigger]_svg]:size-4"),
|
|
3338
2628
|
children: [
|
|
3339
|
-
visibleBulkActions.length ? /* @__PURE__ */
|
|
2629
|
+
visibleBulkActions.length ? /* @__PURE__ */ jsxs3(MenubarMenu, {
|
|
3340
2630
|
children: [
|
|
3341
|
-
/* @__PURE__ */
|
|
2631
|
+
/* @__PURE__ */ jsxs3(MenubarTrigger, {
|
|
3342
2632
|
className: cn(tableClasses.selectedTrigger, "aria-expanded:bg-primary/90"),
|
|
3343
2633
|
children: [
|
|
3344
2634
|
labels.selected,
|
|
3345
|
-
/* @__PURE__ */
|
|
2635
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3346
2636
|
className: tableClasses.count,
|
|
3347
2637
|
children: selectedRows.length
|
|
3348
2638
|
}),
|
|
3349
|
-
/* @__PURE__ */
|
|
2639
|
+
/* @__PURE__ */ jsx3(ChevronDown, {})
|
|
3350
2640
|
]
|
|
3351
2641
|
}),
|
|
3352
|
-
/* @__PURE__ */
|
|
2642
|
+
/* @__PURE__ */ jsx3(MenubarContent, {
|
|
3353
2643
|
align: "end",
|
|
3354
2644
|
className: "w-max",
|
|
3355
|
-
children: /* @__PURE__ */
|
|
2645
|
+
children: /* @__PURE__ */ jsxs3(MenubarGroup, {
|
|
3356
2646
|
children: [
|
|
3357
|
-
/* @__PURE__ */
|
|
2647
|
+
/* @__PURE__ */ jsx3(MenubarLabel, {
|
|
3358
2648
|
children: bulkActions && bulkActions.label ? bulkActions.label : labels.actions
|
|
3359
2649
|
}),
|
|
3360
|
-
/* @__PURE__ */
|
|
3361
|
-
visibleBulkActions.map((action) => /* @__PURE__ */
|
|
2650
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
2651
|
+
visibleBulkActions.map((action) => /* @__PURE__ */ jsxs3(MenubarItem, {
|
|
3362
2652
|
onClick: () => action.onClick(selectedRows),
|
|
3363
2653
|
variant: action.variant ?? "default",
|
|
3364
2654
|
children: [
|
|
@@ -3372,30 +2662,30 @@ var DataTableToolbar = ({
|
|
|
3372
2662
|
]
|
|
3373
2663
|
}) : null,
|
|
3374
2664
|
toolbar && toolbar.items,
|
|
3375
|
-
features.filtering !== false ? /* @__PURE__ */
|
|
2665
|
+
features.filtering !== false ? /* @__PURE__ */ jsx3(FilterMenu, {
|
|
3376
2666
|
table
|
|
3377
2667
|
}) : null,
|
|
3378
|
-
grouping ? /* @__PURE__ */
|
|
2668
|
+
grouping ? /* @__PURE__ */ jsxs3(MenubarMenu, {
|
|
3379
2669
|
children: [
|
|
3380
|
-
/* @__PURE__ */
|
|
2670
|
+
/* @__PURE__ */ jsxs3(MenubarTrigger, {
|
|
3381
2671
|
"aria-label": labels.groupBy,
|
|
3382
2672
|
children: [
|
|
3383
|
-
/* @__PURE__ */
|
|
3384
|
-
/* @__PURE__ */
|
|
2673
|
+
/* @__PURE__ */ jsx3(Rows3, {}),
|
|
2674
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3385
2675
|
className: "hidden sm:inline",
|
|
3386
2676
|
children: labels.groupBy
|
|
3387
2677
|
})
|
|
3388
2678
|
]
|
|
3389
2679
|
}),
|
|
3390
|
-
/* @__PURE__ */
|
|
2680
|
+
/* @__PURE__ */ jsx3(MenubarContent, {
|
|
3391
2681
|
align: "end",
|
|
3392
|
-
children: /* @__PURE__ */
|
|
2682
|
+
children: /* @__PURE__ */ jsxs3(MenubarGroup, {
|
|
3393
2683
|
children: [
|
|
3394
|
-
/* @__PURE__ */
|
|
2684
|
+
/* @__PURE__ */ jsx3(MenubarLabel, {
|
|
3395
2685
|
children: labels.groupBy
|
|
3396
2686
|
}),
|
|
3397
|
-
/* @__PURE__ */
|
|
3398
|
-
grouping.fields.map((field) => /* @__PURE__ */
|
|
2687
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
2688
|
+
grouping.fields.map((field) => /* @__PURE__ */ jsx3(MenubarCheckboxItem, {
|
|
3399
2689
|
checked: store.state.grouping.includes(field.id),
|
|
3400
2690
|
onCheckedChange: () => send(DataTableMessage.GroupingToggled({ fieldId: field.id })),
|
|
3401
2691
|
children: field.label
|
|
@@ -3405,77 +2695,77 @@ var DataTableToolbar = ({
|
|
|
3405
2695
|
})
|
|
3406
2696
|
]
|
|
3407
2697
|
}) : null,
|
|
3408
|
-
features.sorting !== false ? /* @__PURE__ */
|
|
2698
|
+
features.sorting !== false ? /* @__PURE__ */ jsx3(SortMenu, {
|
|
3409
2699
|
table
|
|
3410
2700
|
}) : null,
|
|
3411
|
-
features.gallery ? /* @__PURE__ */
|
|
2701
|
+
features.gallery ? /* @__PURE__ */ jsx3(ViewMenu, {
|
|
3412
2702
|
table
|
|
3413
2703
|
}) : null,
|
|
3414
|
-
features.columnVisibility !== false ? /* @__PURE__ */
|
|
2704
|
+
features.columnVisibility !== false ? /* @__PURE__ */ jsx3(ColumnMenu, {
|
|
3415
2705
|
table
|
|
3416
2706
|
}) : null,
|
|
3417
|
-
features.refresh ? /* @__PURE__ */
|
|
3418
|
-
children: /* @__PURE__ */
|
|
2707
|
+
features.refresh ? /* @__PURE__ */ jsx3(MenubarMenu, {
|
|
2708
|
+
children: /* @__PURE__ */ jsxs3(MenubarTrigger, {
|
|
3419
2709
|
"aria-label": labels.refresh,
|
|
3420
2710
|
onClick: features.refresh,
|
|
3421
2711
|
children: [
|
|
3422
|
-
/* @__PURE__ */
|
|
3423
|
-
/* @__PURE__ */
|
|
2712
|
+
/* @__PURE__ */ jsx3(RefreshCw, {}),
|
|
2713
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3424
2714
|
className: "hidden sm:inline",
|
|
3425
2715
|
children: labels.refresh
|
|
3426
2716
|
})
|
|
3427
2717
|
]
|
|
3428
2718
|
})
|
|
3429
2719
|
}) : null,
|
|
3430
|
-
features.export ? /* @__PURE__ */
|
|
2720
|
+
features.export ? /* @__PURE__ */ jsxs3(MenubarMenu, {
|
|
3431
2721
|
children: [
|
|
3432
|
-
/* @__PURE__ */
|
|
2722
|
+
/* @__PURE__ */ jsxs3(MenubarTrigger, {
|
|
3433
2723
|
"aria-label": labels.export,
|
|
3434
2724
|
"aria-busy": exporting,
|
|
3435
2725
|
disabled: exporting || !canExport,
|
|
3436
2726
|
children: [
|
|
3437
|
-
exporting ? /* @__PURE__ */
|
|
2727
|
+
exporting ? /* @__PURE__ */ jsx3(RefreshCw, {
|
|
3438
2728
|
className: "animate-spin"
|
|
3439
|
-
}) : /* @__PURE__ */
|
|
3440
|
-
/* @__PURE__ */
|
|
2729
|
+
}) : /* @__PURE__ */ jsx3(Download, {}),
|
|
2730
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3441
2731
|
className: "hidden sm:inline",
|
|
3442
2732
|
children: exporting ? labels.loading : labels.export
|
|
3443
2733
|
})
|
|
3444
2734
|
]
|
|
3445
2735
|
}),
|
|
3446
|
-
/* @__PURE__ */
|
|
2736
|
+
/* @__PURE__ */ jsx3(MenubarContent, {
|
|
3447
2737
|
align: "end",
|
|
3448
|
-
children: /* @__PURE__ */
|
|
2738
|
+
children: /* @__PURE__ */ jsxs3(MenubarGroup, {
|
|
3449
2739
|
children: [
|
|
3450
|
-
/* @__PURE__ */
|
|
2740
|
+
/* @__PURE__ */ jsx3(MenubarLabel, {
|
|
3451
2741
|
children: labels.export
|
|
3452
2742
|
}),
|
|
3453
|
-
/* @__PURE__ */
|
|
3454
|
-
builtInExport ? /* @__PURE__ */
|
|
2743
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
2744
|
+
builtInExport ? /* @__PURE__ */ jsxs3(Fragment, {
|
|
3455
2745
|
children: [
|
|
3456
|
-
/* @__PURE__ */
|
|
2746
|
+
/* @__PURE__ */ jsxs3(MenubarItem, {
|
|
3457
2747
|
disabled: exporting || !exportRows.length,
|
|
3458
2748
|
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
2749
|
children: [
|
|
3460
|
-
/* @__PURE__ */
|
|
2750
|
+
/* @__PURE__ */ jsx3(FileText, {}),
|
|
3461
2751
|
labels.exportCsv
|
|
3462
2752
|
]
|
|
3463
2753
|
}),
|
|
3464
|
-
/* @__PURE__ */
|
|
2754
|
+
/* @__PURE__ */ jsxs3(MenubarItem, {
|
|
3465
2755
|
disabled: exporting || !exportRows.length,
|
|
3466
2756
|
onClick: () => downloadJson(exportRows.map((row) => Object.fromEntries(exportColumns.map((column) => [
|
|
3467
2757
|
column.id,
|
|
3468
2758
|
getDataTableExportValue(row, column, store.config.locale)
|
|
3469
2759
|
]))), features.export ? features.export.baseName : "table"),
|
|
3470
2760
|
children: [
|
|
3471
|
-
/* @__PURE__ */
|
|
2761
|
+
/* @__PURE__ */ jsx3(FileJson, {}),
|
|
3472
2762
|
labels.exportJson
|
|
3473
2763
|
]
|
|
3474
2764
|
})
|
|
3475
2765
|
]
|
|
3476
2766
|
}) : null,
|
|
3477
|
-
builtInExport && exportActions.length ? /* @__PURE__ */
|
|
3478
|
-
exportActions.map((action) => /* @__PURE__ */
|
|
2767
|
+
builtInExport && exportActions.length ? /* @__PURE__ */ jsx3(MenubarSeparator, {}) : null,
|
|
2768
|
+
exportActions.map((action) => /* @__PURE__ */ jsxs3(MenubarItem, {
|
|
3479
2769
|
disabled: exporting || action.disabled,
|
|
3480
2770
|
onClick: () => void runExport(action),
|
|
3481
2771
|
children: [
|
|
@@ -3491,7 +2781,7 @@ var DataTableToolbar = ({
|
|
|
3491
2781
|
]
|
|
3492
2782
|
})
|
|
3493
2783
|
}),
|
|
3494
|
-
exportFeature && exportFailed ? /* @__PURE__ */
|
|
2784
|
+
exportFeature && exportFailed ? /* @__PURE__ */ jsx3("p", {
|
|
3495
2785
|
role: "alert",
|
|
3496
2786
|
className: "text-destructive basis-full text-sm",
|
|
3497
2787
|
children: labels.exportFailed ?? dataTableMessages(store.config.locale).exportFailed
|
|
@@ -3528,26 +2818,26 @@ var FilterEditor = ({
|
|
|
3528
2818
|
onChange(decoded.value);
|
|
3529
2819
|
};
|
|
3530
2820
|
if (kind === "boolean") {
|
|
3531
|
-
return /* @__PURE__ */
|
|
2821
|
+
return /* @__PURE__ */ jsxs3(MenubarGroup, {
|
|
3532
2822
|
children: [
|
|
3533
|
-
/* @__PURE__ */
|
|
2823
|
+
/* @__PURE__ */ jsxs3(MenubarRadioGroup, {
|
|
3534
2824
|
value: current?.kind === "boolean" ? String(current.value) : "",
|
|
3535
2825
|
onValueChange: (value) => apply({ ...draft, primary: value }),
|
|
3536
2826
|
children: [
|
|
3537
|
-
/* @__PURE__ */
|
|
2827
|
+
/* @__PURE__ */ jsx3(MenubarRadioItem, {
|
|
3538
2828
|
value: "true",
|
|
3539
2829
|
closeOnClick: false,
|
|
3540
2830
|
children: column.colDef.type === "boolean" ? column.colDef.typeOptions?.trueLabel ?? labels.filterTrue : labels.filterTrue
|
|
3541
2831
|
}),
|
|
3542
|
-
/* @__PURE__ */
|
|
2832
|
+
/* @__PURE__ */ jsx3(MenubarRadioItem, {
|
|
3543
2833
|
value: "false",
|
|
3544
2834
|
closeOnClick: false,
|
|
3545
2835
|
children: column.colDef.type === "boolean" ? column.colDef.typeOptions?.falseLabel ?? labels.filterFalse : labels.filterFalse
|
|
3546
2836
|
})
|
|
3547
2837
|
]
|
|
3548
2838
|
}),
|
|
3549
|
-
/* @__PURE__ */
|
|
3550
|
-
/* @__PURE__ */
|
|
2839
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
2840
|
+
/* @__PURE__ */ jsx3(MenubarItem, {
|
|
3551
2841
|
closeOnClick: false,
|
|
3552
2842
|
onClick: () => onChange(undefined),
|
|
3553
2843
|
children: labels.filterClear
|
|
@@ -3559,11 +2849,11 @@ var FilterEditor = ({
|
|
|
3559
2849
|
const selected = current?.kind === "values" ? current.values : [];
|
|
3560
2850
|
const options = getDataTableFilterOptions(rows, column);
|
|
3561
2851
|
const filteredOptions = options.filter((option) => option.label.toLocaleLowerCase().includes(optionSearch.trim().toLocaleLowerCase()));
|
|
3562
|
-
return /* @__PURE__ */
|
|
2852
|
+
return /* @__PURE__ */ jsxs3(MenubarGroup, {
|
|
3563
2853
|
children: [
|
|
3564
|
-
options.length > 8 ? /* @__PURE__ */
|
|
2854
|
+
options.length > 8 ? /* @__PURE__ */ jsx3("div", {
|
|
3565
2855
|
className: "p-1",
|
|
3566
|
-
children: /* @__PURE__ */
|
|
2856
|
+
children: /* @__PURE__ */ jsx3(Input, {
|
|
3567
2857
|
"aria-label": labels.filter,
|
|
3568
2858
|
placeholder: labels.filter,
|
|
3569
2859
|
value: optionSearch,
|
|
@@ -3574,7 +2864,7 @@ var FilterEditor = ({
|
|
|
3574
2864
|
}
|
|
3575
2865
|
})
|
|
3576
2866
|
}) : null,
|
|
3577
|
-
filteredOptions.map((option) => /* @__PURE__ */
|
|
2867
|
+
filteredOptions.map((option) => /* @__PURE__ */ jsxs3(MenubarCheckboxItem, {
|
|
3578
2868
|
checked: selected.includes(option.value),
|
|
3579
2869
|
closeOnClick: false,
|
|
3580
2870
|
onCheckedChange: (checked) => {
|
|
@@ -3585,23 +2875,23 @@ var FilterEditor = ({
|
|
|
3585
2875
|
onChange(undefined);
|
|
3586
2876
|
},
|
|
3587
2877
|
children: [
|
|
3588
|
-
/* @__PURE__ */
|
|
2878
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3589
2879
|
className: "min-w-0 flex-1 truncate",
|
|
3590
2880
|
children: option.label
|
|
3591
2881
|
}),
|
|
3592
|
-
option.count !== undefined ? /* @__PURE__ */
|
|
2882
|
+
option.count !== undefined ? /* @__PURE__ */ jsx3(Badge, {
|
|
3593
2883
|
variant: "secondary",
|
|
3594
2884
|
className: "ml-auto shrink-0",
|
|
3595
2885
|
children: option.count
|
|
3596
2886
|
}) : null
|
|
3597
2887
|
]
|
|
3598
2888
|
}, option.value)),
|
|
3599
|
-
!filteredOptions.length ? /* @__PURE__ */
|
|
2889
|
+
!filteredOptions.length ? /* @__PURE__ */ jsx3("div", {
|
|
3600
2890
|
className: "text-muted-foreground px-2 py-1.5 text-sm",
|
|
3601
2891
|
children: labels.empty
|
|
3602
2892
|
}) : null,
|
|
3603
|
-
/* @__PURE__ */
|
|
3604
|
-
/* @__PURE__ */
|
|
2893
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
2894
|
+
/* @__PURE__ */ jsx3(MenubarItem, {
|
|
3605
2895
|
closeOnClick: false,
|
|
3606
2896
|
onClick: () => onChange(undefined),
|
|
3607
2897
|
children: labels.filterClear
|
|
@@ -3609,7 +2899,7 @@ var FilterEditor = ({
|
|
|
3609
2899
|
]
|
|
3610
2900
|
});
|
|
3611
2901
|
}
|
|
3612
|
-
return /* @__PURE__ */
|
|
2902
|
+
return /* @__PURE__ */ jsxs3("form", {
|
|
3613
2903
|
className: "flex flex-col gap-3 p-2",
|
|
3614
2904
|
onKeyDown: (event) => {
|
|
3615
2905
|
if (event.key !== "Escape")
|
|
@@ -3620,15 +2910,15 @@ var FilterEditor = ({
|
|
|
3620
2910
|
apply(draft);
|
|
3621
2911
|
},
|
|
3622
2912
|
children: [
|
|
3623
|
-
/* @__PURE__ */
|
|
2913
|
+
/* @__PURE__ */ jsxs3(FieldGroup, {
|
|
3624
2914
|
children: [
|
|
3625
|
-
kind === "text" ? /* @__PURE__ */
|
|
2915
|
+
kind === "text" ? /* @__PURE__ */ jsxs3(Field, {
|
|
3626
2916
|
children: [
|
|
3627
|
-
/* @__PURE__ */
|
|
2917
|
+
/* @__PURE__ */ jsx3(FieldLabel, {
|
|
3628
2918
|
htmlFor: `${inputId}-operator`,
|
|
3629
2919
|
children: labels.filterOperator
|
|
3630
2920
|
}),
|
|
3631
|
-
/* @__PURE__ */
|
|
2921
|
+
/* @__PURE__ */ jsxs3(Select2, {
|
|
3632
2922
|
items: operatorOptions,
|
|
3633
2923
|
value: operator,
|
|
3634
2924
|
onValueChange: (value) => {
|
|
@@ -3637,13 +2927,13 @@ var FilterEditor = ({
|
|
|
3637
2927
|
setDraft({ ...draft, operator: decoded.value });
|
|
3638
2928
|
},
|
|
3639
2929
|
children: [
|
|
3640
|
-
/* @__PURE__ */
|
|
2930
|
+
/* @__PURE__ */ jsx3(SelectTrigger2, {
|
|
3641
2931
|
id: `${inputId}-operator`,
|
|
3642
|
-
children: /* @__PURE__ */
|
|
2932
|
+
children: /* @__PURE__ */ jsx3(SelectValue2, {})
|
|
3643
2933
|
}),
|
|
3644
|
-
/* @__PURE__ */
|
|
3645
|
-
children: /* @__PURE__ */
|
|
3646
|
-
children: operatorOptions.map((option) => /* @__PURE__ */
|
|
2934
|
+
/* @__PURE__ */ jsx3(SelectContent2, {
|
|
2935
|
+
children: /* @__PURE__ */ jsx3(SelectGroup, {
|
|
2936
|
+
children: operatorOptions.map((option) => /* @__PURE__ */ jsx3(SelectItem2, {
|
|
3647
2937
|
value: option.value,
|
|
3648
2938
|
children: option.label
|
|
3649
2939
|
}, option.value))
|
|
@@ -3653,14 +2943,14 @@ var FilterEditor = ({
|
|
|
3653
2943
|
})
|
|
3654
2944
|
]
|
|
3655
2945
|
}) : null,
|
|
3656
|
-
/* @__PURE__ */
|
|
2946
|
+
/* @__PURE__ */ jsxs3(Field, {
|
|
3657
2947
|
"data-invalid": invalid || undefined,
|
|
3658
2948
|
children: [
|
|
3659
|
-
/* @__PURE__ */
|
|
2949
|
+
/* @__PURE__ */ jsx3(FieldLabel, {
|
|
3660
2950
|
htmlFor: `${inputId}-primary`,
|
|
3661
2951
|
children: kind === "text" ? labels.filterValue : kind === "date" ? labels.filterFrom : labels.filterMin
|
|
3662
2952
|
}),
|
|
3663
|
-
/* @__PURE__ */
|
|
2953
|
+
/* @__PURE__ */ jsx3(Input, {
|
|
3664
2954
|
id: `${inputId}-primary`,
|
|
3665
2955
|
type: kind === "text" ? "text" : kind === "date" ? "date" : "number",
|
|
3666
2956
|
step: kind === "number" ? "any" : undefined,
|
|
@@ -3673,14 +2963,14 @@ var FilterEditor = ({
|
|
|
3673
2963
|
})
|
|
3674
2964
|
]
|
|
3675
2965
|
}),
|
|
3676
|
-
kind !== "text" ? /* @__PURE__ */
|
|
2966
|
+
kind !== "text" ? /* @__PURE__ */ jsxs3(Field, {
|
|
3677
2967
|
"data-invalid": invalid || undefined,
|
|
3678
2968
|
children: [
|
|
3679
|
-
/* @__PURE__ */
|
|
2969
|
+
/* @__PURE__ */ jsx3(FieldLabel, {
|
|
3680
2970
|
htmlFor: `${inputId}-secondary`,
|
|
3681
2971
|
children: kind === "date" ? labels.filterTo : labels.filterMax
|
|
3682
2972
|
}),
|
|
3683
|
-
/* @__PURE__ */
|
|
2973
|
+
/* @__PURE__ */ jsx3(Input, {
|
|
3684
2974
|
id: `${inputId}-secondary`,
|
|
3685
2975
|
type: kind === "date" ? "date" : "number",
|
|
3686
2976
|
step: kind === "number" ? "any" : undefined,
|
|
@@ -3695,20 +2985,20 @@ var FilterEditor = ({
|
|
|
3695
2985
|
}) : null
|
|
3696
2986
|
]
|
|
3697
2987
|
}),
|
|
3698
|
-
invalid ? /* @__PURE__ */
|
|
2988
|
+
invalid ? /* @__PURE__ */ jsx3("p", {
|
|
3699
2989
|
role: "alert",
|
|
3700
2990
|
className: "text-destructive text-sm",
|
|
3701
2991
|
children: labels.filterInvalid
|
|
3702
2992
|
}) : null,
|
|
3703
|
-
/* @__PURE__ */
|
|
2993
|
+
/* @__PURE__ */ jsxs3("div", {
|
|
3704
2994
|
className: "flex gap-2",
|
|
3705
2995
|
children: [
|
|
3706
|
-
/* @__PURE__ */
|
|
2996
|
+
/* @__PURE__ */ jsx3(Button2, {
|
|
3707
2997
|
type: "submit",
|
|
3708
2998
|
size: "sm",
|
|
3709
2999
|
children: labels.filterApply
|
|
3710
3000
|
}),
|
|
3711
|
-
/* @__PURE__ */
|
|
3001
|
+
/* @__PURE__ */ jsx3(Button2, {
|
|
3712
3002
|
type: "button",
|
|
3713
3003
|
size: "sm",
|
|
3714
3004
|
variant: "outline",
|
|
@@ -3737,45 +3027,45 @@ var FilterMenu = ({
|
|
|
3737
3027
|
return null;
|
|
3738
3028
|
const filters = store.state.filters ?? [];
|
|
3739
3029
|
const update = (id, filter) => send(DataTableMessage.ColumnFilterChanged({ id, filter: filter ?? null }));
|
|
3740
|
-
return /* @__PURE__ */
|
|
3030
|
+
return /* @__PURE__ */ jsxs3(MenubarMenu, {
|
|
3741
3031
|
children: [
|
|
3742
|
-
/* @__PURE__ */
|
|
3032
|
+
/* @__PURE__ */ jsxs3(MenubarTrigger, {
|
|
3743
3033
|
"aria-label": store.config.labels.filters,
|
|
3744
3034
|
children: [
|
|
3745
|
-
/* @__PURE__ */
|
|
3746
|
-
/* @__PURE__ */
|
|
3035
|
+
/* @__PURE__ */ jsx3(ListFilter, {}),
|
|
3036
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3747
3037
|
className: "hidden sm:inline",
|
|
3748
3038
|
children: store.config.labels.filters
|
|
3749
3039
|
}),
|
|
3750
|
-
filters.length ? /* @__PURE__ */
|
|
3040
|
+
filters.length ? /* @__PURE__ */ jsx3(Badge, {
|
|
3751
3041
|
variant: "secondary",
|
|
3752
3042
|
children: filters.length
|
|
3753
3043
|
}) : null
|
|
3754
3044
|
]
|
|
3755
3045
|
}),
|
|
3756
|
-
/* @__PURE__ */
|
|
3046
|
+
/* @__PURE__ */ jsx3(MenubarContent, {
|
|
3757
3047
|
align: "end",
|
|
3758
3048
|
className: "w-80 max-w-[calc(100vw-2rem)]",
|
|
3759
|
-
children: /* @__PURE__ */
|
|
3049
|
+
children: /* @__PURE__ */ jsxs3(MenubarGroup, {
|
|
3760
3050
|
children: [
|
|
3761
|
-
/* @__PURE__ */
|
|
3051
|
+
/* @__PURE__ */ jsx3(MenubarLabel, {
|
|
3762
3052
|
children: store.config.labels.filters
|
|
3763
3053
|
}),
|
|
3764
|
-
/* @__PURE__ */
|
|
3765
|
-
columns.map(({ column, label }) => /* @__PURE__ */
|
|
3054
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
3055
|
+
columns.map(({ column, label }) => /* @__PURE__ */ jsxs3(MenubarSub, {
|
|
3766
3056
|
children: [
|
|
3767
|
-
/* @__PURE__ */
|
|
3057
|
+
/* @__PURE__ */ jsxs3(MenubarSubTrigger, {
|
|
3768
3058
|
children: [
|
|
3769
|
-
/* @__PURE__ */
|
|
3059
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3770
3060
|
className: "min-w-0 flex-1 truncate",
|
|
3771
3061
|
children: label
|
|
3772
3062
|
}),
|
|
3773
|
-
filters.some((filter) => filter.id === column.id) ? /* @__PURE__ */
|
|
3063
|
+
filters.some((filter) => filter.id === column.id) ? /* @__PURE__ */ jsx3(Check, {}) : null
|
|
3774
3064
|
]
|
|
3775
3065
|
}),
|
|
3776
|
-
/* @__PURE__ */
|
|
3066
|
+
/* @__PURE__ */ jsx3(MenubarSubContent, {
|
|
3777
3067
|
className: "w-80 max-w-[calc(100vw-2rem)]",
|
|
3778
|
-
children: /* @__PURE__ */
|
|
3068
|
+
children: /* @__PURE__ */ jsx3(FilterEditor, {
|
|
3779
3069
|
column,
|
|
3780
3070
|
rows: model.rows,
|
|
3781
3071
|
current: filters.find((filter) => filter.id === column.id),
|
|
@@ -3785,13 +3075,13 @@ var FilterMenu = ({
|
|
|
3785
3075
|
})
|
|
3786
3076
|
]
|
|
3787
3077
|
}, column.id)),
|
|
3788
|
-
filters.length ? /* @__PURE__ */
|
|
3078
|
+
filters.length ? /* @__PURE__ */ jsxs3(Fragment, {
|
|
3789
3079
|
children: [
|
|
3790
|
-
/* @__PURE__ */
|
|
3791
|
-
/* @__PURE__ */
|
|
3080
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
3081
|
+
/* @__PURE__ */ jsxs3(MenubarItem, {
|
|
3792
3082
|
onClick: () => send(DataTableMessage.FiltersCleared()),
|
|
3793
3083
|
children: [
|
|
3794
|
-
/* @__PURE__ */
|
|
3084
|
+
/* @__PURE__ */ jsx3(X, {}),
|
|
3795
3085
|
store.config.labels.filtersClear
|
|
3796
3086
|
]
|
|
3797
3087
|
})
|
|
@@ -3818,65 +3108,65 @@ var SortMenu = ({
|
|
|
3818
3108
|
return null;
|
|
3819
3109
|
const current = store.state.sort?.[0];
|
|
3820
3110
|
const sort = (id, direction) => send(DataTableMessage.SortRequested({ columnId: id, direction }));
|
|
3821
|
-
return /* @__PURE__ */
|
|
3111
|
+
return /* @__PURE__ */ jsxs3(MenubarMenu, {
|
|
3822
3112
|
children: [
|
|
3823
|
-
/* @__PURE__ */
|
|
3113
|
+
/* @__PURE__ */ jsxs3(MenubarTrigger, {
|
|
3824
3114
|
"aria-label": store.config.labels.sortBy,
|
|
3825
3115
|
children: [
|
|
3826
|
-
current ? current.direction === "desc" ? /* @__PURE__ */
|
|
3827
|
-
/* @__PURE__ */
|
|
3116
|
+
current ? current.direction === "desc" ? /* @__PURE__ */ jsx3(ArrowDown, {}) : /* @__PURE__ */ jsx3(ArrowUp, {}) : /* @__PURE__ */ jsx3(ChevronsUpDown, {}),
|
|
3117
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3828
3118
|
className: "hidden sm:inline",
|
|
3829
3119
|
children: store.config.labels.sortBy
|
|
3830
3120
|
})
|
|
3831
3121
|
]
|
|
3832
3122
|
}),
|
|
3833
|
-
/* @__PURE__ */
|
|
3123
|
+
/* @__PURE__ */ jsx3(MenubarContent, {
|
|
3834
3124
|
align: "end",
|
|
3835
3125
|
className: "w-52",
|
|
3836
|
-
children: /* @__PURE__ */
|
|
3126
|
+
children: /* @__PURE__ */ jsxs3(MenubarGroup, {
|
|
3837
3127
|
children: [
|
|
3838
|
-
/* @__PURE__ */
|
|
3128
|
+
/* @__PURE__ */ jsx3(MenubarLabel, {
|
|
3839
3129
|
children: store.config.labels.sortBy
|
|
3840
3130
|
}),
|
|
3841
|
-
/* @__PURE__ */
|
|
3131
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
3842
3132
|
columns.map((column) => {
|
|
3843
3133
|
const sortState = store.state.sort?.find(({ id }) => id === column.id);
|
|
3844
|
-
return /* @__PURE__ */
|
|
3134
|
+
return /* @__PURE__ */ jsxs3(MenubarSub, {
|
|
3845
3135
|
children: [
|
|
3846
|
-
/* @__PURE__ */
|
|
3136
|
+
/* @__PURE__ */ jsxs3(MenubarSubTrigger, {
|
|
3847
3137
|
children: [
|
|
3848
|
-
sortState ? sortState.direction === "desc" ? /* @__PURE__ */
|
|
3138
|
+
sortState ? sortState.direction === "desc" ? /* @__PURE__ */ jsx3(ArrowDown, {}) : /* @__PURE__ */ jsx3(ArrowUp, {}) : null,
|
|
3849
3139
|
columnLabel(column)
|
|
3850
3140
|
]
|
|
3851
3141
|
}),
|
|
3852
|
-
/* @__PURE__ */
|
|
3142
|
+
/* @__PURE__ */ jsxs3(MenubarSubContent, {
|
|
3853
3143
|
children: [
|
|
3854
|
-
/* @__PURE__ */
|
|
3144
|
+
/* @__PURE__ */ jsxs3(MenubarItem, {
|
|
3855
3145
|
onClick: () => sort(column.id, "asc"),
|
|
3856
3146
|
children: [
|
|
3857
|
-
/* @__PURE__ */
|
|
3147
|
+
/* @__PURE__ */ jsx3(ArrowUp, {}),
|
|
3858
3148
|
" ",
|
|
3859
3149
|
store.config.labels.sortAsc
|
|
3860
3150
|
]
|
|
3861
3151
|
}),
|
|
3862
|
-
/* @__PURE__ */
|
|
3152
|
+
/* @__PURE__ */ jsxs3(MenubarItem, {
|
|
3863
3153
|
onClick: () => sort(column.id, "desc"),
|
|
3864
3154
|
children: [
|
|
3865
|
-
/* @__PURE__ */
|
|
3155
|
+
/* @__PURE__ */ jsx3(ArrowDown, {}),
|
|
3866
3156
|
" ",
|
|
3867
3157
|
store.config.labels.sortDesc
|
|
3868
3158
|
]
|
|
3869
3159
|
}),
|
|
3870
|
-
sortState ? /* @__PURE__ */
|
|
3160
|
+
sortState ? /* @__PURE__ */ jsxs3(Fragment, {
|
|
3871
3161
|
children: [
|
|
3872
|
-
/* @__PURE__ */
|
|
3873
|
-
/* @__PURE__ */
|
|
3162
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
3163
|
+
/* @__PURE__ */ jsxs3(MenubarItem, {
|
|
3874
3164
|
onClick: () => send(DataTableMessage.SortRequested({
|
|
3875
3165
|
columnId: column.id,
|
|
3876
3166
|
direction: null
|
|
3877
3167
|
})),
|
|
3878
3168
|
children: [
|
|
3879
|
-
/* @__PURE__ */
|
|
3169
|
+
/* @__PURE__ */ jsx3(X, {}),
|
|
3880
3170
|
" ",
|
|
3881
3171
|
store.config.labels.sortClear
|
|
3882
3172
|
]
|
|
@@ -3898,27 +3188,27 @@ var ViewMenu = ({
|
|
|
3898
3188
|
table
|
|
3899
3189
|
}) => {
|
|
3900
3190
|
const [store, send] = table;
|
|
3901
|
-
return /* @__PURE__ */
|
|
3191
|
+
return /* @__PURE__ */ jsxs3(MenubarMenu, {
|
|
3902
3192
|
children: [
|
|
3903
|
-
/* @__PURE__ */
|
|
3193
|
+
/* @__PURE__ */ jsxs3(MenubarTrigger, {
|
|
3904
3194
|
"aria-label": store.config.labels.view,
|
|
3905
3195
|
children: [
|
|
3906
|
-
store.state.view === "gallery" ? /* @__PURE__ */
|
|
3907
|
-
/* @__PURE__ */
|
|
3196
|
+
store.state.view === "gallery" ? /* @__PURE__ */ jsx3(LayoutGrid, {}) : /* @__PURE__ */ jsx3(Rows3, {}),
|
|
3197
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3908
3198
|
className: "hidden sm:inline",
|
|
3909
3199
|
children: store.config.labels.view
|
|
3910
3200
|
})
|
|
3911
3201
|
]
|
|
3912
3202
|
}),
|
|
3913
|
-
/* @__PURE__ */
|
|
3203
|
+
/* @__PURE__ */ jsx3(MenubarContent, {
|
|
3914
3204
|
align: "end",
|
|
3915
|
-
children: /* @__PURE__ */
|
|
3205
|
+
children: /* @__PURE__ */ jsxs3(MenubarGroup, {
|
|
3916
3206
|
children: [
|
|
3917
|
-
/* @__PURE__ */
|
|
3207
|
+
/* @__PURE__ */ jsx3(MenubarLabel, {
|
|
3918
3208
|
children: store.config.labels.view
|
|
3919
3209
|
}),
|
|
3920
|
-
/* @__PURE__ */
|
|
3921
|
-
/* @__PURE__ */
|
|
3210
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
3211
|
+
/* @__PURE__ */ jsxs3(MenubarRadioGroup, {
|
|
3922
3212
|
onValueChange: (input) => {
|
|
3923
3213
|
const view = Schema6.decodeUnknownOption(DataTableViewSchema)(input);
|
|
3924
3214
|
if (Option4.isSome(view)) {
|
|
@@ -3927,18 +3217,18 @@ var ViewMenu = ({
|
|
|
3927
3217
|
},
|
|
3928
3218
|
value: store.state.view,
|
|
3929
3219
|
children: [
|
|
3930
|
-
/* @__PURE__ */
|
|
3220
|
+
/* @__PURE__ */ jsxs3(MenubarRadioItem, {
|
|
3931
3221
|
value: "table",
|
|
3932
3222
|
children: [
|
|
3933
|
-
/* @__PURE__ */
|
|
3223
|
+
/* @__PURE__ */ jsx3(Rows3, {}),
|
|
3934
3224
|
" ",
|
|
3935
3225
|
store.config.labels.tableView
|
|
3936
3226
|
]
|
|
3937
3227
|
}),
|
|
3938
|
-
/* @__PURE__ */
|
|
3228
|
+
/* @__PURE__ */ jsxs3(MenubarRadioItem, {
|
|
3939
3229
|
value: "gallery",
|
|
3940
3230
|
children: [
|
|
3941
|
-
/* @__PURE__ */
|
|
3231
|
+
/* @__PURE__ */ jsx3(LayoutGrid, {}),
|
|
3942
3232
|
" ",
|
|
3943
3233
|
store.config.labels.galleryView
|
|
3944
3234
|
]
|
|
@@ -3958,27 +3248,27 @@ var ColumnMenu = ({
|
|
|
3958
3248
|
const columns = deriveModel(store).columns.filter(({ colDef }) => colDef.hideable !== false);
|
|
3959
3249
|
if (!columns.length)
|
|
3960
3250
|
return null;
|
|
3961
|
-
return /* @__PURE__ */
|
|
3251
|
+
return /* @__PURE__ */ jsxs3(MenubarMenu, {
|
|
3962
3252
|
children: [
|
|
3963
|
-
/* @__PURE__ */
|
|
3253
|
+
/* @__PURE__ */ jsxs3(MenubarTrigger, {
|
|
3964
3254
|
"aria-label": store.config.labels.columns,
|
|
3965
3255
|
children: [
|
|
3966
|
-
/* @__PURE__ */
|
|
3967
|
-
/* @__PURE__ */
|
|
3256
|
+
/* @__PURE__ */ jsx3(Settings2, {}),
|
|
3257
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3968
3258
|
className: "hidden sm:inline",
|
|
3969
3259
|
children: store.config.labels.columns
|
|
3970
3260
|
})
|
|
3971
3261
|
]
|
|
3972
3262
|
}),
|
|
3973
|
-
/* @__PURE__ */
|
|
3263
|
+
/* @__PURE__ */ jsx3(MenubarContent, {
|
|
3974
3264
|
align: "end",
|
|
3975
|
-
children: /* @__PURE__ */
|
|
3265
|
+
children: /* @__PURE__ */ jsxs3(MenubarGroup, {
|
|
3976
3266
|
children: [
|
|
3977
|
-
/* @__PURE__ */
|
|
3267
|
+
/* @__PURE__ */ jsx3(MenubarLabel, {
|
|
3978
3268
|
children: store.config.labels.columns
|
|
3979
3269
|
}),
|
|
3980
|
-
/* @__PURE__ */
|
|
3981
|
-
columns.map((column) => /* @__PURE__ */
|
|
3270
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
3271
|
+
columns.map((column) => /* @__PURE__ */ jsx3(MenubarCheckboxItem, {
|
|
3982
3272
|
checked: store.state.columnVisibility[column.id] !== false,
|
|
3983
3273
|
onCheckedChange: (visible) => send(DataTableMessage.ColumnVisibilityChanged({ id: column.id, visible })),
|
|
3984
3274
|
children: columnLabel(column)
|
|
@@ -4014,7 +3304,7 @@ var ResizeHandle = ({
|
|
|
4014
3304
|
send(DataTableMessage.ResizeMoved({ x: event.clientX, pointerId: event.pointerId }));
|
|
4015
3305
|
};
|
|
4016
3306
|
const reset = (event) => send(DataTableMessage.ResizeEnded({ pointerId: event.pointerId }));
|
|
4017
|
-
return /* @__PURE__ */
|
|
3307
|
+
return /* @__PURE__ */ jsx3("button", {
|
|
4018
3308
|
"aria-label": store.config.labels.resizeColumn(columnLabel(column)),
|
|
4019
3309
|
"aria-orientation": "vertical",
|
|
4020
3310
|
"aria-valuemax": max,
|
|
@@ -4136,9 +3426,9 @@ var DragHandle = ({
|
|
|
4136
3426
|
reordering.onReorder(reorderDataTableRows(model.rows, rowId, target.id));
|
|
4137
3427
|
}
|
|
4138
3428
|
};
|
|
4139
|
-
return /* @__PURE__ */
|
|
3429
|
+
return /* @__PURE__ */ jsxs3(Fragment, {
|
|
4140
3430
|
children: [
|
|
4141
|
-
/* @__PURE__ */
|
|
3431
|
+
/* @__PURE__ */ jsx3(Button2, {
|
|
4142
3432
|
"aria-label": store.config.features.reordering && store.config.features.reordering.handleLabel ? store.config.features.reordering.handleLabel : store.config.labels.reorder,
|
|
4143
3433
|
className: "size-8 cursor-grab touch-none active:cursor-grabbing",
|
|
4144
3434
|
onClick: (event) => event.stopPropagation(),
|
|
@@ -4156,9 +3446,9 @@ var DragHandle = ({
|
|
|
4156
3446
|
onPointerUp: finish,
|
|
4157
3447
|
size: "icon",
|
|
4158
3448
|
variant: "ghost",
|
|
4159
|
-
children: /* @__PURE__ */
|
|
3449
|
+
children: /* @__PURE__ */ jsx3(GripVertical, {})
|
|
4160
3450
|
}),
|
|
4161
|
-
overlay ? createPortal(/* @__PURE__ */
|
|
3451
|
+
overlay ? createPortal(/* @__PURE__ */ jsx3("div", {
|
|
4162
3452
|
"aria-hidden": "true",
|
|
4163
3453
|
className: "bg-background pointer-events-none fixed z-[100] rounded-md border px-3 py-2 text-sm shadow-lg",
|
|
4164
3454
|
style: { left: overlay.x + 12, top: overlay.y + 12 },
|
|
@@ -4180,7 +3470,7 @@ var TableDataRow = ({
|
|
|
4180
3470
|
const selection = store.config.features.selection;
|
|
4181
3471
|
const selectable = !!selection && (selection.isRowSelectable?.(row.data) ?? true);
|
|
4182
3472
|
const draggable = canDragRows(store);
|
|
4183
|
-
return /* @__PURE__ */
|
|
3473
|
+
return /* @__PURE__ */ jsxs3(TableRow, {
|
|
4184
3474
|
ref: measureRef,
|
|
4185
3475
|
"data-index": virtualIndex,
|
|
4186
3476
|
"aria-rowindex": virtualIndex === undefined ? undefined : virtualIndex + 2,
|
|
@@ -4196,12 +3486,12 @@ var TableDataRow = ({
|
|
|
4196
3486
|
},
|
|
4197
3487
|
tabIndex: store.config.onRowClicked ? 0 : undefined,
|
|
4198
3488
|
children: [
|
|
4199
|
-
selection ? /* @__PURE__ */
|
|
3489
|
+
selection ? /* @__PURE__ */ jsx3(TableCell, {
|
|
4200
3490
|
className: tableClasses.selectionCell,
|
|
4201
3491
|
onClick: (event) => event.stopPropagation(),
|
|
4202
|
-
children: /* @__PURE__ */
|
|
3492
|
+
children: /* @__PURE__ */ jsx3("div", {
|
|
4203
3493
|
className: tableClasses.selectionCenter,
|
|
4204
|
-
children: /* @__PURE__ */
|
|
3494
|
+
children: /* @__PURE__ */ jsx3(Checkbox, {
|
|
4205
3495
|
"aria-label": store.config.labels.selectRow,
|
|
4206
3496
|
checked: !!store.state.rowSelection[row.id],
|
|
4207
3497
|
disabled: !selectable,
|
|
@@ -4209,26 +3499,26 @@ var TableDataRow = ({
|
|
|
4209
3499
|
})
|
|
4210
3500
|
})
|
|
4211
3501
|
}) : null,
|
|
4212
|
-
draggable ? /* @__PURE__ */
|
|
3502
|
+
draggable ? /* @__PURE__ */ jsx3(TableCell, {
|
|
4213
3503
|
className: "w-10 pr-0",
|
|
4214
|
-
children: /* @__PURE__ */
|
|
3504
|
+
children: /* @__PURE__ */ jsx3(DragHandle, {
|
|
4215
3505
|
table
|
|
4216
3506
|
})
|
|
4217
3507
|
}) : null,
|
|
4218
|
-
model.visibleColumns.map((column) => /* @__PURE__ */
|
|
3508
|
+
model.visibleColumns.map((column) => /* @__PURE__ */ jsx3(TableCell, {
|
|
4219
3509
|
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
3510
|
style: { width: column.width },
|
|
4221
|
-
children: /* @__PURE__ */
|
|
3511
|
+
children: /* @__PURE__ */ jsx3("div", {
|
|
4222
3512
|
className: cn(tableClasses.cellContent, column.colDef.truncate && "truncate"),
|
|
4223
3513
|
children: renderCell(row, column, store.config.locale, store.config.labels)
|
|
4224
3514
|
})
|
|
4225
3515
|
}, column.id)),
|
|
4226
|
-
hasRowActionMenu(store) ? /* @__PURE__ */
|
|
3516
|
+
hasRowActionMenu(store) ? /* @__PURE__ */ jsx3(TableCell, {
|
|
4227
3517
|
className: cn(tableClasses.actionsCell, "group-data-[state=selected]/row:bg-muted"),
|
|
4228
3518
|
onClick: (event) => event.stopPropagation(),
|
|
4229
|
-
children: /* @__PURE__ */
|
|
3519
|
+
children: /* @__PURE__ */ jsx3("div", {
|
|
4230
3520
|
className: tableClasses.actionsAlign,
|
|
4231
|
-
children: /* @__PURE__ */
|
|
3521
|
+
children: /* @__PURE__ */ jsx3(DataTableRowActionMenu, {
|
|
4232
3522
|
row,
|
|
4233
3523
|
table
|
|
4234
3524
|
})
|
|
@@ -4245,27 +3535,27 @@ var GroupActions = ({
|
|
|
4245
3535
|
const visible = actions?.filter((action) => !action.visible || action.visible(groupId));
|
|
4246
3536
|
if (!visible?.length)
|
|
4247
3537
|
return null;
|
|
4248
|
-
return /* @__PURE__ */
|
|
3538
|
+
return /* @__PURE__ */ jsxs3(DropdownMenu, {
|
|
4249
3539
|
children: [
|
|
4250
|
-
/* @__PURE__ */
|
|
3540
|
+
/* @__PURE__ */ jsx3(DropdownMenuTrigger, {
|
|
4251
3541
|
onClick: (event) => event.stopPropagation(),
|
|
4252
|
-
render: /* @__PURE__ */
|
|
3542
|
+
render: /* @__PURE__ */ jsxs3(Button2, {
|
|
4253
3543
|
size: "icon-sm",
|
|
4254
3544
|
variant: "ghost",
|
|
4255
3545
|
children: [
|
|
4256
|
-
/* @__PURE__ */
|
|
3546
|
+
/* @__PURE__ */ jsx3("span", {
|
|
4257
3547
|
className: "sr-only",
|
|
4258
3548
|
children: title
|
|
4259
3549
|
}),
|
|
4260
|
-
/* @__PURE__ */
|
|
3550
|
+
/* @__PURE__ */ jsx3(MoreHorizontal, {})
|
|
4261
3551
|
]
|
|
4262
3552
|
})
|
|
4263
3553
|
}),
|
|
4264
|
-
/* @__PURE__ */
|
|
3554
|
+
/* @__PURE__ */ jsx3(DropdownMenuContent, {
|
|
4265
3555
|
align: "end",
|
|
4266
3556
|
onClick: (event) => event.stopPropagation(),
|
|
4267
|
-
children: /* @__PURE__ */
|
|
4268
|
-
children: visible.map((action) => /* @__PURE__ */
|
|
3557
|
+
children: /* @__PURE__ */ jsx3(DropdownMenuGroup, {
|
|
3558
|
+
children: visible.map((action) => /* @__PURE__ */ jsxs3(DropdownMenuItem, {
|
|
4269
3559
|
onClick: () => action.onClick(groupId),
|
|
4270
3560
|
variant: action.variant ?? "default",
|
|
4271
3561
|
children: [
|
|
@@ -4289,40 +3579,40 @@ var GroupHeaderRow = ({
|
|
|
4289
3579
|
const tableClasses = useContext(DataTableSlotClassesContext);
|
|
4290
3580
|
const [store, send] = table;
|
|
4291
3581
|
const collapsed = !!store.state.collapsedGroups[section.key];
|
|
4292
|
-
return /* @__PURE__ */
|
|
3582
|
+
return /* @__PURE__ */ jsx3(TableRow, {
|
|
4293
3583
|
ref: measureRef,
|
|
4294
3584
|
"data-index": virtualIndex,
|
|
4295
3585
|
"aria-rowindex": virtualIndex === undefined ? undefined : virtualIndex + 2,
|
|
4296
3586
|
className: cn(tableClasses.group, "cursor-pointer"),
|
|
4297
3587
|
onClick: () => send(DataTableMessage.GroupToggled({ key: section.key })),
|
|
4298
|
-
children: /* @__PURE__ */
|
|
3588
|
+
children: /* @__PURE__ */ jsx3(TableCell, {
|
|
4299
3589
|
className: "p-0",
|
|
4300
3590
|
colSpan,
|
|
4301
|
-
children: /* @__PURE__ */
|
|
3591
|
+
children: /* @__PURE__ */ jsxs3("div", {
|
|
4302
3592
|
className: cn(tableClasses.groupContent, tableClasses.groupSticky),
|
|
4303
3593
|
children: [
|
|
4304
|
-
/* @__PURE__ */
|
|
3594
|
+
/* @__PURE__ */ jsxs3("button", {
|
|
4305
3595
|
"aria-expanded": !collapsed,
|
|
4306
3596
|
className: tableClasses.groupTrigger,
|
|
4307
3597
|
style: { paddingLeft: section.depth * 20 },
|
|
4308
3598
|
type: "button",
|
|
4309
3599
|
children: [
|
|
4310
|
-
collapsed ? /* @__PURE__ */
|
|
3600
|
+
collapsed ? /* @__PURE__ */ jsx3(ChevronRight2, {
|
|
4311
3601
|
className: "size-4 shrink-0"
|
|
4312
|
-
}) : /* @__PURE__ */
|
|
3602
|
+
}) : /* @__PURE__ */ jsx3(ChevronDown, {
|
|
4313
3603
|
className: "size-4 shrink-0"
|
|
4314
3604
|
}),
|
|
4315
|
-
/* @__PURE__ */
|
|
3605
|
+
/* @__PURE__ */ jsx3("span", {
|
|
4316
3606
|
className: "min-w-0 flex-1 truncate",
|
|
4317
3607
|
children: section.field.renderGroupLabel?.(section.groupId, section.rows.map((row) => row.data)) ?? section.groupId
|
|
4318
3608
|
})
|
|
4319
3609
|
]
|
|
4320
3610
|
}),
|
|
4321
|
-
/* @__PURE__ */
|
|
3611
|
+
/* @__PURE__ */ jsx3("span", {
|
|
4322
3612
|
className: tableClasses.count,
|
|
4323
3613
|
children: section.rows.length
|
|
4324
3614
|
}),
|
|
4325
|
-
/* @__PURE__ */
|
|
3615
|
+
/* @__PURE__ */ jsx3(GroupActions, {
|
|
4326
3616
|
actions: section.field.actions,
|
|
4327
3617
|
groupId: section.groupId,
|
|
4328
3618
|
title: section.field.actionsLabel ?? store.config.labels.actions
|
|
@@ -4342,24 +3632,24 @@ var GroupedTable = ({
|
|
|
4342
3632
|
const renderSections = (items) => items.flatMap((section) => {
|
|
4343
3633
|
const collapsed = !!store.state.collapsedGroups[section.key];
|
|
4344
3634
|
const targetKey = getGroupDropKey(section.field.id, section.groupId);
|
|
4345
|
-
const body = /* @__PURE__ */
|
|
3635
|
+
const body = /* @__PURE__ */ jsxs3(TableBody, {
|
|
4346
3636
|
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
3637
|
"data-table-group": section.field.onMoveToGroup ? targetKey : undefined,
|
|
4348
3638
|
children: [
|
|
4349
|
-
/* @__PURE__ */
|
|
3639
|
+
/* @__PURE__ */ jsx3(GroupHeaderRow, {
|
|
4350
3640
|
table,
|
|
4351
3641
|
section,
|
|
4352
3642
|
colSpan: model.visibleColumns.length + extra
|
|
4353
3643
|
}),
|
|
4354
|
-
!collapsed && !section.children.length ? section.rows.length ? section.rows.map((row) => /* @__PURE__ */
|
|
3644
|
+
!collapsed && !section.children.length ? section.rows.length ? section.rows.map((row) => /* @__PURE__ */ jsx3(RowIdContext.Provider, {
|
|
4355
3645
|
value: row.id,
|
|
4356
|
-
children: /* @__PURE__ */
|
|
3646
|
+
children: /* @__PURE__ */ jsx3(TableDataRow, {
|
|
4357
3647
|
row,
|
|
4358
3648
|
table
|
|
4359
3649
|
})
|
|
4360
3650
|
}, `${section.key}:${row.id}`)) : [
|
|
4361
|
-
/* @__PURE__ */
|
|
4362
|
-
children: /* @__PURE__ */
|
|
3651
|
+
/* @__PURE__ */ jsx3(TableRow, {
|
|
3652
|
+
children: /* @__PURE__ */ jsx3(TableCell, {
|
|
4363
3653
|
className: "text-muted-foreground h-16",
|
|
4364
3654
|
colSpan: model.visibleColumns.length + extra,
|
|
4365
3655
|
children: section.field.renderEmptyGroup?.(section.groupId) ?? store.config.labels.empty
|
|
@@ -4370,7 +3660,7 @@ var GroupedTable = ({
|
|
|
4370
3660
|
}, section.key);
|
|
4371
3661
|
return !collapsed && section.children.length ? [body, renderSections(section.children)] : [body];
|
|
4372
3662
|
});
|
|
4373
|
-
return /* @__PURE__ */
|
|
3663
|
+
return /* @__PURE__ */ jsx3(Fragment, {
|
|
4374
3664
|
children: renderSections(sections)
|
|
4375
3665
|
});
|
|
4376
3666
|
};
|
|
@@ -4389,7 +3679,7 @@ var ColumnHeaderMenu = ({
|
|
|
4389
3679
|
const filteringEnabled = store.config.features.filtering !== false && filterColumns.length > 0;
|
|
4390
3680
|
const ownsFilter = (id) => id === column.id || getDataTableFieldColumns(column).some((field) => field.id === id);
|
|
4391
3681
|
const activeFilters = (store.state.filters ?? []).filter(({ id }) => ownsFilter(id));
|
|
4392
|
-
const filterEditor = (field) => /* @__PURE__ */
|
|
3682
|
+
const filterEditor = (field) => /* @__PURE__ */ jsx3(FilterEditor, {
|
|
4393
3683
|
column: field,
|
|
4394
3684
|
rows: model.rows,
|
|
4395
3685
|
current: store.state.filters?.find((filter) => filter.id === field.id),
|
|
@@ -4402,20 +3692,20 @@ var ColumnHeaderMenu = ({
|
|
|
4402
3692
|
const sort = store.state.sort?.find(({ id }) => ownsSort(id));
|
|
4403
3693
|
const setSort = (id, direction) => send(DataTableMessage.SortRequested({ columnId: id, direction }));
|
|
4404
3694
|
const label = columnLabel(column);
|
|
4405
|
-
const sortItems = (field) => /* @__PURE__ */
|
|
3695
|
+
const sortItems = (field) => /* @__PURE__ */ jsxs3(Fragment, {
|
|
4406
3696
|
children: [
|
|
4407
|
-
/* @__PURE__ */
|
|
3697
|
+
/* @__PURE__ */ jsxs3(DropdownMenuItem, {
|
|
4408
3698
|
onClick: () => setSort(field.id, "asc"),
|
|
4409
3699
|
children: [
|
|
4410
|
-
/* @__PURE__ */
|
|
3700
|
+
/* @__PURE__ */ jsx3(ArrowUp, {}),
|
|
4411
3701
|
" ",
|
|
4412
3702
|
store.config.labels.sortAsc
|
|
4413
3703
|
]
|
|
4414
3704
|
}),
|
|
4415
|
-
/* @__PURE__ */
|
|
3705
|
+
/* @__PURE__ */ jsxs3(DropdownMenuItem, {
|
|
4416
3706
|
onClick: () => setSort(field.id, "desc"),
|
|
4417
3707
|
children: [
|
|
4418
|
-
/* @__PURE__ */
|
|
3708
|
+
/* @__PURE__ */ jsx3(ArrowDown, {}),
|
|
4419
3709
|
" ",
|
|
4420
3710
|
store.config.labels.sortDesc
|
|
4421
3711
|
]
|
|
@@ -4423,81 +3713,81 @@ var ColumnHeaderMenu = ({
|
|
|
4423
3713
|
]
|
|
4424
3714
|
});
|
|
4425
3715
|
if (!sortingEnabled && !hidingEnabled && !filteringEnabled) {
|
|
4426
|
-
return /* @__PURE__ */
|
|
3716
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
4427
3717
|
className: "truncate px-2",
|
|
4428
3718
|
children: column.colDef.headerName
|
|
4429
3719
|
});
|
|
4430
3720
|
}
|
|
4431
|
-
return /* @__PURE__ */
|
|
3721
|
+
return /* @__PURE__ */ jsxs3(DropdownMenu, {
|
|
4432
3722
|
children: [
|
|
4433
|
-
/* @__PURE__ */
|
|
4434
|
-
render: /* @__PURE__ */
|
|
3723
|
+
/* @__PURE__ */ jsx3(DropdownMenuTrigger, {
|
|
3724
|
+
render: /* @__PURE__ */ jsxs3(Button2, {
|
|
4435
3725
|
"aria-label": label,
|
|
4436
3726
|
"aria-description": activeFilters.length ? `${store.config.labels.filters}: ${activeFilters.length}` : undefined,
|
|
4437
3727
|
className: tableClasses.headerTrigger,
|
|
4438
3728
|
variant: "ghost",
|
|
4439
3729
|
children: [
|
|
4440
|
-
/* @__PURE__ */
|
|
3730
|
+
/* @__PURE__ */ jsx3("span", {
|
|
4441
3731
|
className: "truncate",
|
|
4442
3732
|
children: column.colDef.headerName
|
|
4443
3733
|
}),
|
|
4444
|
-
activeFilters.length ? /* @__PURE__ */
|
|
4445
|
-
sort ? sort.direction === "desc" ? /* @__PURE__ */
|
|
3734
|
+
activeFilters.length ? /* @__PURE__ */ jsx3(ListFilter, {}) : null,
|
|
3735
|
+
sort ? sort.direction === "desc" ? /* @__PURE__ */ jsx3(ArrowDown, {}) : /* @__PURE__ */ jsx3(ArrowUp, {}) : null
|
|
4446
3736
|
]
|
|
4447
3737
|
})
|
|
4448
3738
|
}),
|
|
4449
|
-
/* @__PURE__ */
|
|
3739
|
+
/* @__PURE__ */ jsx3(DropdownMenuContent, {
|
|
4450
3740
|
align: "start",
|
|
4451
3741
|
className: "w-48",
|
|
4452
|
-
children: /* @__PURE__ */
|
|
3742
|
+
children: /* @__PURE__ */ jsxs3(DropdownMenuGroup, {
|
|
4453
3743
|
children: [
|
|
4454
|
-
sortingEnabled ? /* @__PURE__ */
|
|
3744
|
+
sortingEnabled ? /* @__PURE__ */ jsxs3(Fragment, {
|
|
4455
3745
|
children: [
|
|
4456
|
-
column.colDef.fields?.length ? sortColumns.map((field) => /* @__PURE__ */
|
|
3746
|
+
column.colDef.fields?.length ? sortColumns.map((field) => /* @__PURE__ */ jsxs3(DropdownMenuSub, {
|
|
4457
3747
|
children: [
|
|
4458
|
-
/* @__PURE__ */
|
|
3748
|
+
/* @__PURE__ */ jsx3(DropdownMenuSubTrigger, {
|
|
4459
3749
|
children: columnLabel(field)
|
|
4460
3750
|
}),
|
|
4461
|
-
/* @__PURE__ */
|
|
4462
|
-
children: /* @__PURE__ */
|
|
3751
|
+
/* @__PURE__ */ jsx3(DropdownMenuSubContent, {
|
|
3752
|
+
children: /* @__PURE__ */ jsx3(DropdownMenuGroup, {
|
|
4463
3753
|
children: sortItems(field)
|
|
4464
3754
|
})
|
|
4465
3755
|
})
|
|
4466
3756
|
]
|
|
4467
3757
|
}, field.id)) : sortItems(column),
|
|
4468
|
-
sort ? /* @__PURE__ */
|
|
3758
|
+
sort ? /* @__PURE__ */ jsxs3(DropdownMenuItem, {
|
|
4469
3759
|
onClick: () => send(DataTableMessage.ColumnSortCleared({ id: column.id })),
|
|
4470
3760
|
children: [
|
|
4471
|
-
/* @__PURE__ */
|
|
3761
|
+
/* @__PURE__ */ jsx3(X, {}),
|
|
4472
3762
|
" ",
|
|
4473
3763
|
store.config.labels.sortClear
|
|
4474
3764
|
]
|
|
4475
3765
|
}) : null
|
|
4476
3766
|
]
|
|
4477
3767
|
}) : null,
|
|
4478
|
-
sortingEnabled && filteringEnabled ? /* @__PURE__ */
|
|
4479
|
-
filteringEnabled ? /* @__PURE__ */
|
|
3768
|
+
sortingEnabled && filteringEnabled ? /* @__PURE__ */ jsx3(DropdownMenuSeparator, {}) : null,
|
|
3769
|
+
filteringEnabled ? /* @__PURE__ */ jsxs3(Fragment, {
|
|
4480
3770
|
children: [
|
|
4481
|
-
/* @__PURE__ */
|
|
3771
|
+
/* @__PURE__ */ jsxs3(DropdownMenuSub, {
|
|
4482
3772
|
children: [
|
|
4483
|
-
/* @__PURE__ */
|
|
3773
|
+
/* @__PURE__ */ jsxs3(DropdownMenuSubTrigger, {
|
|
4484
3774
|
children: [
|
|
4485
|
-
/* @__PURE__ */
|
|
3775
|
+
/* @__PURE__ */ jsx3(ListFilter, {}),
|
|
4486
3776
|
store.config.labels.filters
|
|
4487
3777
|
]
|
|
4488
3778
|
}),
|
|
4489
|
-
/* @__PURE__ */
|
|
3779
|
+
/* @__PURE__ */ jsx3(DropdownMenuSubContent, {
|
|
4490
3780
|
className: "w-80 max-w-[calc(100vw-2rem)]",
|
|
4491
|
-
children: column.colDef.fields?.length ? /* @__PURE__ */
|
|
4492
|
-
children: filterColumns.map((field) => /* @__PURE__ */
|
|
3781
|
+
children: column.colDef.fields?.length ? /* @__PURE__ */ jsx3(DropdownMenuGroup, {
|
|
3782
|
+
children: filterColumns.map((field) => /* @__PURE__ */ jsxs3(DropdownMenuSub, {
|
|
4493
3783
|
children: [
|
|
4494
|
-
/* @__PURE__ */
|
|
3784
|
+
/* @__PURE__ */ jsxs3(DropdownMenuSubTrigger, {
|
|
4495
3785
|
children: [
|
|
4496
3786
|
columnLabel(field),
|
|
4497
|
-
activeFilters.some((filter) => filter.id === field.id) ? /* @__PURE__ */
|
|
3787
|
+
activeFilters.some((filter) => filter.id === field.id) ? /* @__PURE__ */ jsx3(Check, {}) : null
|
|
4498
3788
|
]
|
|
4499
3789
|
}),
|
|
4500
|
-
/* @__PURE__ */
|
|
3790
|
+
/* @__PURE__ */ jsx3(DropdownMenuSubContent, {
|
|
4501
3791
|
className: "w-80 max-w-[calc(100vw-2rem)]",
|
|
4502
3792
|
children: filterEditor(field)
|
|
4503
3793
|
})
|
|
@@ -4507,23 +3797,23 @@ var ColumnHeaderMenu = ({
|
|
|
4507
3797
|
})
|
|
4508
3798
|
]
|
|
4509
3799
|
}),
|
|
4510
|
-
activeFilters.length ? /* @__PURE__ */
|
|
3800
|
+
activeFilters.length ? /* @__PURE__ */ jsxs3(DropdownMenuItem, {
|
|
4511
3801
|
onClick: () => send(DataTableMessage.ColumnFiltersCleared({ id: column.id })),
|
|
4512
3802
|
children: [
|
|
4513
|
-
/* @__PURE__ */
|
|
3803
|
+
/* @__PURE__ */ jsx3(X, {}),
|
|
4514
3804
|
store.config.labels.filterClear
|
|
4515
3805
|
]
|
|
4516
3806
|
}) : null
|
|
4517
3807
|
]
|
|
4518
3808
|
}) : null,
|
|
4519
|
-
(sortingEnabled || filteringEnabled) && hidingEnabled ? /* @__PURE__ */
|
|
4520
|
-
hidingEnabled ? /* @__PURE__ */
|
|
3809
|
+
(sortingEnabled || filteringEnabled) && hidingEnabled ? /* @__PURE__ */ jsx3(DropdownMenuSeparator, {}) : null,
|
|
3810
|
+
hidingEnabled ? /* @__PURE__ */ jsxs3(DropdownMenuItem, {
|
|
4521
3811
|
onClick: () => send(DataTableMessage.ColumnVisibilityChanged({
|
|
4522
3812
|
id: column.id,
|
|
4523
3813
|
visible: false
|
|
4524
3814
|
})),
|
|
4525
3815
|
children: [
|
|
4526
|
-
/* @__PURE__ */
|
|
3816
|
+
/* @__PURE__ */ jsx3(EyeOff, {}),
|
|
4527
3817
|
" ",
|
|
4528
3818
|
store.config.labels.hideColumn
|
|
4529
3819
|
]
|
|
@@ -4546,16 +3836,16 @@ var DataTableHeader = ({
|
|
|
4546
3836
|
const selectableRows = model.pageRows.filter((row) => !selection || (selection.isRowSelectable?.(row.data) ?? true));
|
|
4547
3837
|
const allSelected = selectableRows.length > 0 && selectableRows.every((row) => store.state.rowSelection[row.id]);
|
|
4548
3838
|
const someSelected = selectableRows.some((row) => store.state.rowSelection[row.id]);
|
|
4549
|
-
return /* @__PURE__ */
|
|
3839
|
+
return /* @__PURE__ */ jsx3(TableHeader, {
|
|
4550
3840
|
className: sticky ? cn(tableClasses.stickyHeader, tableClasses.stickyHeaderRule, "[&_tr]:border-b-0") : undefined,
|
|
4551
|
-
children: /* @__PURE__ */
|
|
3841
|
+
children: /* @__PURE__ */ jsxs3(TableRow, {
|
|
4552
3842
|
"aria-rowindex": sticky ? 1 : undefined,
|
|
4553
3843
|
children: [
|
|
4554
|
-
selection ? /* @__PURE__ */
|
|
3844
|
+
selection ? /* @__PURE__ */ jsx3(TableHead, {
|
|
4555
3845
|
className: tableClasses.selectionCell,
|
|
4556
|
-
children: /* @__PURE__ */
|
|
3846
|
+
children: /* @__PURE__ */ jsx3("div", {
|
|
4557
3847
|
className: tableClasses.selectionCenter,
|
|
4558
|
-
children: /* @__PURE__ */
|
|
3848
|
+
children: /* @__PURE__ */ jsx3(Checkbox, {
|
|
4559
3849
|
"aria-label": store.config.labels.selectAllRows,
|
|
4560
3850
|
checked: allSelected,
|
|
4561
3851
|
indeterminate: someSelected && !allSelected,
|
|
@@ -4568,30 +3858,30 @@ var DataTableHeader = ({
|
|
|
4568
3858
|
})
|
|
4569
3859
|
})
|
|
4570
3860
|
}) : null,
|
|
4571
|
-
draggable ? /* @__PURE__ */
|
|
3861
|
+
draggable ? /* @__PURE__ */ jsx3(TableHead, {
|
|
4572
3862
|
className: "w-10"
|
|
4573
3863
|
}) : null,
|
|
4574
3864
|
model.visibleColumns.map((column) => {
|
|
4575
3865
|
const direction = store.state.sort?.find(({ id }) => id === column.id)?.direction;
|
|
4576
|
-
return /* @__PURE__ */
|
|
3866
|
+
return /* @__PURE__ */ jsx3(TableHead, {
|
|
4577
3867
|
"aria-sort": direction === "asc" ? "ascending" : direction === "desc" ? "descending" : undefined,
|
|
4578
3868
|
className: tableClasses.header,
|
|
4579
3869
|
scope: "col",
|
|
4580
3870
|
style: { width: column.width },
|
|
4581
|
-
children: /* @__PURE__ */
|
|
3871
|
+
children: /* @__PURE__ */ jsxs3(ColumnIdContext.Provider, {
|
|
4582
3872
|
value: column.id,
|
|
4583
3873
|
children: [
|
|
4584
|
-
/* @__PURE__ */
|
|
3874
|
+
/* @__PURE__ */ jsx3(ColumnHeaderMenu, {
|
|
4585
3875
|
table
|
|
4586
3876
|
}),
|
|
4587
|
-
/* @__PURE__ */
|
|
3877
|
+
/* @__PURE__ */ jsx3(ResizeHandle, {
|
|
4588
3878
|
table
|
|
4589
3879
|
})
|
|
4590
3880
|
]
|
|
4591
3881
|
})
|
|
4592
3882
|
}, column.id);
|
|
4593
3883
|
}),
|
|
4594
|
-
hasRowActionMenu(store) ? /* @__PURE__ */
|
|
3884
|
+
hasRowActionMenu(store) ? /* @__PURE__ */ jsx3(TableHead, {
|
|
4595
3885
|
className: "w-10"
|
|
4596
3886
|
}) : null
|
|
4597
3887
|
]
|
|
@@ -4609,7 +3899,7 @@ var VirtualTableRows = ({
|
|
|
4609
3899
|
const { element: scrollElement, headerHeight } = viewport;
|
|
4610
3900
|
const pageScroll = viewport.options.scroll === "page";
|
|
4611
3901
|
const scrollMargin = viewport.pageOffset ?? headerHeight;
|
|
4612
|
-
const entries =
|
|
3902
|
+
const entries = useMemo(() => {
|
|
4613
3903
|
const result = [];
|
|
4614
3904
|
const addSections = (groups) => {
|
|
4615
3905
|
for (const section of groups) {
|
|
@@ -4673,39 +3963,39 @@ var VirtualTableRows = ({
|
|
|
4673
3963
|
const last = items.at(-1);
|
|
4674
3964
|
const before = first ? first.start - scrollMargin : 0;
|
|
4675
3965
|
const after = virtualizer.getTotalSize() - (last ? last.end - scrollMargin : 0);
|
|
4676
|
-
const spacer = (height) => height > 0 ? /* @__PURE__ */
|
|
3966
|
+
const spacer = (height) => height > 0 ? /* @__PURE__ */ jsx3("tr", {
|
|
4677
3967
|
"aria-hidden": "true",
|
|
4678
|
-
children: /* @__PURE__ */
|
|
3968
|
+
children: /* @__PURE__ */ jsx3("td", {
|
|
4679
3969
|
colSpan: Math.max(1, colSpan),
|
|
4680
3970
|
className: "border-0 p-0",
|
|
4681
3971
|
style: { height }
|
|
4682
3972
|
})
|
|
4683
3973
|
}) : null;
|
|
4684
|
-
return /* @__PURE__ */
|
|
3974
|
+
return /* @__PURE__ */ jsxs3(Fragment, {
|
|
4685
3975
|
children: [
|
|
4686
3976
|
spacer(before),
|
|
4687
3977
|
items.map(({ index, key }) => {
|
|
4688
3978
|
const entry = entries[index];
|
|
4689
3979
|
if (entry.kind === "data")
|
|
4690
|
-
return /* @__PURE__ */
|
|
3980
|
+
return /* @__PURE__ */ jsx3(TableDataRow, {
|
|
4691
3981
|
measureRef: virtualizer.measureElement,
|
|
4692
3982
|
row: entry.row,
|
|
4693
3983
|
table,
|
|
4694
3984
|
virtualIndex: index
|
|
4695
3985
|
}, key);
|
|
4696
3986
|
if (entry.kind === "header")
|
|
4697
|
-
return /* @__PURE__ */
|
|
3987
|
+
return /* @__PURE__ */ jsx3(GroupHeaderRow, {
|
|
4698
3988
|
measureRef: virtualizer.measureElement,
|
|
4699
3989
|
section: entry.section,
|
|
4700
3990
|
colSpan,
|
|
4701
3991
|
table,
|
|
4702
3992
|
virtualIndex: index
|
|
4703
3993
|
}, key);
|
|
4704
|
-
return /* @__PURE__ */
|
|
3994
|
+
return /* @__PURE__ */ jsx3(TableRow, {
|
|
4705
3995
|
ref: virtualizer.measureElement,
|
|
4706
3996
|
"data-index": index,
|
|
4707
3997
|
"aria-rowindex": index + 2,
|
|
4708
|
-
children: /* @__PURE__ */
|
|
3998
|
+
children: /* @__PURE__ */ jsx3(TableCell, {
|
|
4709
3999
|
className: "text-muted-foreground h-16",
|
|
4710
4000
|
colSpan,
|
|
4711
4001
|
children: entry.section.field.renderEmptyGroup?.(entry.section.groupId) ?? config.labels.empty
|
|
@@ -4725,42 +4015,42 @@ var DataTableBody = ({
|
|
|
4725
4015
|
const model = deriveModel(store);
|
|
4726
4016
|
const fields = getActiveGrouping(store);
|
|
4727
4017
|
const rows = model.pageRows;
|
|
4728
|
-
const sections =
|
|
4018
|
+
const sections = useMemo(() => groupDataTableRows(rows, fields), [rows, fields]);
|
|
4729
4019
|
const colSpan = model.visibleColumns.length + (store.config.features.selection ? 1 : 0) + (hasRowActionMenu(store) ? 1 : 0) + (canDragRows(store) ? 1 : 0);
|
|
4730
4020
|
const showGroups = sections.length && (rows.length || !store.config.status.loading) && !store.config.status.error;
|
|
4731
4021
|
if (showGroups && !viewport) {
|
|
4732
|
-
return /* @__PURE__ */
|
|
4022
|
+
return /* @__PURE__ */ jsx3(GroupedTable, {
|
|
4733
4023
|
table,
|
|
4734
4024
|
sections
|
|
4735
4025
|
});
|
|
4736
4026
|
}
|
|
4737
|
-
return /* @__PURE__ */
|
|
4738
|
-
children: store.config.status.error || !showGroups && !rows.length && !store.config.status.loading ? /* @__PURE__ */
|
|
4739
|
-
children: /* @__PURE__ */
|
|
4027
|
+
return /* @__PURE__ */ jsx3(TableBody, {
|
|
4028
|
+
children: store.config.status.error || !showGroups && !rows.length && !store.config.status.loading ? /* @__PURE__ */ jsx3(TableRow, {
|
|
4029
|
+
children: /* @__PURE__ */ jsx3(TableCell, {
|
|
4740
4030
|
"data-table-slot": store.config.status.error ? "error" : "empty",
|
|
4741
4031
|
className: cn("h-24 text-center", store.config.status.error ? styles?.feedback?.error : styles?.feedback?.empty),
|
|
4742
4032
|
colSpan: Math.max(colSpan, 1),
|
|
4743
4033
|
children: store.config.status.error ?? store.config.status.empty ?? store.config.labels.empty
|
|
4744
4034
|
})
|
|
4745
|
-
}) : !showGroups && store.config.status.loading && !rows.length ? /* @__PURE__ */
|
|
4746
|
-
children: /* @__PURE__ */
|
|
4035
|
+
}) : !showGroups && store.config.status.loading && !rows.length ? /* @__PURE__ */ jsx3(TableRow, {
|
|
4036
|
+
children: /* @__PURE__ */ jsx3(TableCell, {
|
|
4747
4037
|
"data-table-slot": "loading",
|
|
4748
4038
|
className: cn("h-24 p-0", styles?.feedback?.loading),
|
|
4749
4039
|
colSpan: Math.max(colSpan, 1),
|
|
4750
|
-
children: /* @__PURE__ */
|
|
4040
|
+
children: /* @__PURE__ */ jsx3(Loading, {
|
|
4751
4041
|
className: "sticky left-0 w-[100cqw] max-w-full px-2",
|
|
4752
4042
|
label: store.config.labels.loading
|
|
4753
4043
|
})
|
|
4754
4044
|
})
|
|
4755
|
-
}) : viewport ? /* @__PURE__ */
|
|
4045
|
+
}) : viewport ? /* @__PURE__ */ jsx3(VirtualTableRows, {
|
|
4756
4046
|
colSpan,
|
|
4757
4047
|
rows,
|
|
4758
4048
|
sections,
|
|
4759
4049
|
table,
|
|
4760
4050
|
viewport
|
|
4761
|
-
}) : rows.map((row) => /* @__PURE__ */
|
|
4051
|
+
}) : rows.map((row) => /* @__PURE__ */ jsx3(RowIdContext.Provider, {
|
|
4762
4052
|
value: row.id,
|
|
4763
|
-
children: /* @__PURE__ */
|
|
4053
|
+
children: /* @__PURE__ */ jsx3(TableDataRow, {
|
|
4764
4054
|
row,
|
|
4765
4055
|
table
|
|
4766
4056
|
})
|
|
@@ -4778,13 +4068,13 @@ var GalleryTag = ({
|
|
|
4778
4068
|
if ((value == null || value === "") && !column.colDef.cellRenderer)
|
|
4779
4069
|
return null;
|
|
4780
4070
|
const content = renderCell(row, column, locale, labels);
|
|
4781
|
-
return column.colDef.cellRenderer || column.colDef.valueFormatter ? /* @__PURE__ */
|
|
4071
|
+
return column.colDef.cellRenderer || column.colDef.valueFormatter ? /* @__PURE__ */ jsxs3("div", {
|
|
4782
4072
|
className: "flex min-w-0 items-center gap-1",
|
|
4783
4073
|
children: [
|
|
4784
4074
|
icon,
|
|
4785
4075
|
content
|
|
4786
4076
|
]
|
|
4787
|
-
}) : /* @__PURE__ */
|
|
4077
|
+
}) : /* @__PURE__ */ jsxs3(Badge, {
|
|
4788
4078
|
variant: "secondary",
|
|
4789
4079
|
children: [
|
|
4790
4080
|
icon,
|
|
@@ -4812,7 +4102,7 @@ var GalleryCard = ({
|
|
|
4812
4102
|
const selection = store.config.features.selection;
|
|
4813
4103
|
const selectable = !!selection && (selection.isRowSelectable?.(row.data) ?? true);
|
|
4814
4104
|
const draggable = canDragRows(store);
|
|
4815
|
-
return /* @__PURE__ */
|
|
4105
|
+
return /* @__PURE__ */ jsxs3(Card, {
|
|
4816
4106
|
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
4107
|
"data-table-row": row.id,
|
|
4818
4108
|
onClick: () => store.config.onRowClicked?.(row.data),
|
|
@@ -4824,7 +4114,7 @@ var GalleryCard = ({
|
|
|
4824
4114
|
},
|
|
4825
4115
|
tabIndex: store.config.onRowClicked ? 0 : undefined,
|
|
4826
4116
|
children: [
|
|
4827
|
-
imageSrc && !store.ui.failedImages.includes(imageSrc) ? /* @__PURE__ */
|
|
4117
|
+
imageSrc && !store.ui.failedImages.includes(imageSrc) ? /* @__PURE__ */ jsx3("img", {
|
|
4828
4118
|
src: imageSrc,
|
|
4829
4119
|
alt: gallery.image?.getAlt?.(row.data) ?? "",
|
|
4830
4120
|
loading: "lazy",
|
|
@@ -4832,32 +4122,32 @@ var GalleryCard = ({
|
|
|
4832
4122
|
className: "aspect-video w-full object-cover",
|
|
4833
4123
|
onError: () => send(DataTableMessage.ReferenceImageFailed({ src: imageSrc }))
|
|
4834
4124
|
}) : null,
|
|
4835
|
-
/* @__PURE__ */
|
|
4125
|
+
/* @__PURE__ */ jsxs3(CardHeader, {
|
|
4836
4126
|
className: cn("relative", hasRowActionMenu(store) && "pr-12"),
|
|
4837
4127
|
children: [
|
|
4838
|
-
selection || draggable ? /* @__PURE__ */
|
|
4128
|
+
selection || draggable ? /* @__PURE__ */ jsxs3("div", {
|
|
4839
4129
|
className: "flex items-center gap-2",
|
|
4840
4130
|
children: [
|
|
4841
|
-
selection ? /* @__PURE__ */
|
|
4131
|
+
selection ? /* @__PURE__ */ jsx3(Checkbox, {
|
|
4842
4132
|
"aria-label": store.config.labels.selectRow,
|
|
4843
4133
|
checked: !!store.state.rowSelection[row.id],
|
|
4844
4134
|
disabled: !selectable,
|
|
4845
4135
|
onCheckedChange: (checked) => toggleRow(send, row.id, checked),
|
|
4846
4136
|
onClick: (event) => event.stopPropagation()
|
|
4847
4137
|
}) : null,
|
|
4848
|
-
draggable ? /* @__PURE__ */
|
|
4138
|
+
draggable ? /* @__PURE__ */ jsx3(DragHandle, {
|
|
4849
4139
|
table
|
|
4850
4140
|
}) : null
|
|
4851
4141
|
]
|
|
4852
4142
|
}) : null,
|
|
4853
|
-
/* @__PURE__ */
|
|
4143
|
+
/* @__PURE__ */ jsx3(CardTitle, {
|
|
4854
4144
|
children: name ? renderCell(row, name, store.config.locale, store.config.labels) : row.id
|
|
4855
4145
|
}),
|
|
4856
|
-
tagIds.length ? /* @__PURE__ */
|
|
4146
|
+
tagIds.length ? /* @__PURE__ */ jsx3("div", {
|
|
4857
4147
|
className: "flex flex-wrap items-center gap-2",
|
|
4858
4148
|
children: tagIds.map((id) => {
|
|
4859
4149
|
const column = find(id);
|
|
4860
|
-
return column ? /* @__PURE__ */
|
|
4150
|
+
return column ? /* @__PURE__ */ jsx3(GalleryTag, {
|
|
4861
4151
|
row,
|
|
4862
4152
|
column,
|
|
4863
4153
|
locale: store.config.locale,
|
|
@@ -4866,14 +4156,14 @@ var GalleryCard = ({
|
|
|
4866
4156
|
}, id) : null;
|
|
4867
4157
|
})
|
|
4868
4158
|
}) : null,
|
|
4869
|
-
description ? /* @__PURE__ */
|
|
4159
|
+
description ? /* @__PURE__ */ jsx3("div", {
|
|
4870
4160
|
className: "text-muted-foreground line-clamp-3 text-sm",
|
|
4871
4161
|
children: renderCell(row, description, store.config.locale, store.config.labels)
|
|
4872
4162
|
}) : null,
|
|
4873
|
-
hasRowActionMenu(store) ? /* @__PURE__ */
|
|
4163
|
+
hasRowActionMenu(store) ? /* @__PURE__ */ jsx3("div", {
|
|
4874
4164
|
className: "absolute top-0 right-4",
|
|
4875
4165
|
onClick: (event) => event.stopPropagation(),
|
|
4876
|
-
children: /* @__PURE__ */
|
|
4166
|
+
children: /* @__PURE__ */ jsx3(DataTableRowActionMenu, {
|
|
4877
4167
|
row,
|
|
4878
4168
|
table
|
|
4879
4169
|
})
|
|
@@ -4893,35 +4183,35 @@ var DataTableGallery = ({
|
|
|
4893
4183
|
const rows = model.pageRows;
|
|
4894
4184
|
const sections = groupDataTableRows(rows, fields);
|
|
4895
4185
|
if (store.config.status.error) {
|
|
4896
|
-
return /* @__PURE__ */
|
|
4186
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
4897
4187
|
"data-table-slot": "error",
|
|
4898
4188
|
className: cn("text-destructive rounded-lg border border-dashed p-10 text-center", styles?.feedback?.error),
|
|
4899
4189
|
children: store.config.status.error
|
|
4900
4190
|
});
|
|
4901
4191
|
}
|
|
4902
4192
|
if (store.config.status.loading && !rows.length) {
|
|
4903
|
-
return /* @__PURE__ */
|
|
4193
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
4904
4194
|
"data-table-slot": "loading",
|
|
4905
4195
|
className: cn("rounded-lg border border-dashed p-10 text-center", styles?.feedback?.loading),
|
|
4906
|
-
children: /* @__PURE__ */
|
|
4196
|
+
children: /* @__PURE__ */ jsx3(Loading, {
|
|
4907
4197
|
label: store.config.labels.loading
|
|
4908
4198
|
})
|
|
4909
4199
|
});
|
|
4910
4200
|
}
|
|
4911
4201
|
if (!rows.length && !sections.length) {
|
|
4912
|
-
return /* @__PURE__ */
|
|
4202
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
4913
4203
|
"data-table-slot": "empty",
|
|
4914
4204
|
className: cn("text-muted-foreground rounded-lg border border-dashed p-10 text-center", styles?.feedback?.empty),
|
|
4915
4205
|
children: store.config.status.empty ?? store.config.labels.empty
|
|
4916
4206
|
});
|
|
4917
4207
|
}
|
|
4918
4208
|
if (!fields.length) {
|
|
4919
|
-
return /* @__PURE__ */
|
|
4209
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
4920
4210
|
"data-table-slot": "gallery",
|
|
4921
4211
|
className: cn("grid gap-3 sm:grid-cols-2 xl:grid-cols-3", styles?.gallery),
|
|
4922
|
-
children: rows.map((row) => /* @__PURE__ */
|
|
4212
|
+
children: rows.map((row) => /* @__PURE__ */ jsx3(RowIdContext.Provider, {
|
|
4923
4213
|
value: row.id,
|
|
4924
|
-
children: /* @__PURE__ */
|
|
4214
|
+
children: /* @__PURE__ */ jsx3(GalleryCard, {
|
|
4925
4215
|
table
|
|
4926
4216
|
})
|
|
4927
4217
|
}, row.id))
|
|
@@ -4931,58 +4221,58 @@ var DataTableGallery = ({
|
|
|
4931
4221
|
const collapsed = !!store.state.collapsedGroups[section.key];
|
|
4932
4222
|
const targetKey = getGroupDropKey(section.field.id, section.groupId);
|
|
4933
4223
|
const toggleCollapsed = () => send(DataTableMessage.GroupToggled({ key: section.key }));
|
|
4934
|
-
return /* @__PURE__ */
|
|
4224
|
+
return /* @__PURE__ */ jsxs3("section", {
|
|
4935
4225
|
className: "data-[drop-target=true]:ring-primary space-y-3 rounded-lg transition-shadow data-[drop-target=true]:ring-2",
|
|
4936
4226
|
"data-table-group": section.field.onMoveToGroup ? targetKey : undefined,
|
|
4937
4227
|
children: [
|
|
4938
|
-
/* @__PURE__ */
|
|
4228
|
+
/* @__PURE__ */ jsxs3("div", {
|
|
4939
4229
|
className: "hover:bg-accent flex cursor-pointer items-center gap-2 rounded-lg border p-3 transition-colors",
|
|
4940
4230
|
onClick: toggleCollapsed,
|
|
4941
4231
|
children: [
|
|
4942
|
-
/* @__PURE__ */
|
|
4232
|
+
/* @__PURE__ */ jsxs3("button", {
|
|
4943
4233
|
"aria-expanded": !collapsed,
|
|
4944
4234
|
className: "flex flex-1 cursor-pointer items-center gap-2 text-left font-medium",
|
|
4945
4235
|
type: "button",
|
|
4946
4236
|
children: [
|
|
4947
|
-
collapsed ? /* @__PURE__ */
|
|
4237
|
+
collapsed ? /* @__PURE__ */ jsx3(ChevronRight2, {
|
|
4948
4238
|
className: "size-4"
|
|
4949
|
-
}) : /* @__PURE__ */
|
|
4239
|
+
}) : /* @__PURE__ */ jsx3(ChevronDown, {
|
|
4950
4240
|
className: "size-4"
|
|
4951
4241
|
}),
|
|
4952
|
-
/* @__PURE__ */
|
|
4242
|
+
/* @__PURE__ */ jsx3("span", {
|
|
4953
4243
|
className: "flex-1",
|
|
4954
4244
|
children: section.field.renderGroupLabel?.(section.groupId, section.rows.map((row) => row.data)) ?? section.groupId
|
|
4955
4245
|
}),
|
|
4956
|
-
/* @__PURE__ */
|
|
4246
|
+
/* @__PURE__ */ jsx3(Badge, {
|
|
4957
4247
|
variant: "secondary",
|
|
4958
4248
|
children: section.rows.length
|
|
4959
4249
|
})
|
|
4960
4250
|
]
|
|
4961
4251
|
}),
|
|
4962
|
-
/* @__PURE__ */
|
|
4252
|
+
/* @__PURE__ */ jsx3(GroupActions, {
|
|
4963
4253
|
actions: section.field.actions,
|
|
4964
4254
|
groupId: section.groupId,
|
|
4965
4255
|
title: section.field.actionsLabel ?? store.config.labels.actions
|
|
4966
4256
|
})
|
|
4967
4257
|
]
|
|
4968
4258
|
}),
|
|
4969
|
-
!collapsed ? section.children.length ? renderSections(section.children) : section.rows.length ? /* @__PURE__ */
|
|
4259
|
+
!collapsed ? section.children.length ? renderSections(section.children) : section.rows.length ? /* @__PURE__ */ jsx3("div", {
|
|
4970
4260
|
"data-table-slot": "gallery",
|
|
4971
4261
|
className: cn("grid gap-3 sm:grid-cols-2 xl:grid-cols-3", styles?.gallery),
|
|
4972
|
-
children: section.rows.map((row) => /* @__PURE__ */
|
|
4262
|
+
children: section.rows.map((row) => /* @__PURE__ */ jsx3(RowIdContext.Provider, {
|
|
4973
4263
|
value: row.id,
|
|
4974
|
-
children: /* @__PURE__ */
|
|
4264
|
+
children: /* @__PURE__ */ jsx3(GalleryCard, {
|
|
4975
4265
|
table
|
|
4976
4266
|
})
|
|
4977
4267
|
}, `${section.key}:${row.id}`))
|
|
4978
|
-
}) : /* @__PURE__ */
|
|
4268
|
+
}) : /* @__PURE__ */ jsx3("div", {
|
|
4979
4269
|
className: "text-muted-foreground rounded-lg border border-dashed p-8 text-center",
|
|
4980
4270
|
children: section.field.renderEmptyGroup?.(section.groupId) ?? store.config.labels.empty
|
|
4981
4271
|
}) : null
|
|
4982
4272
|
]
|
|
4983
4273
|
}, section.key);
|
|
4984
4274
|
});
|
|
4985
|
-
return /* @__PURE__ */
|
|
4275
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
4986
4276
|
className: "space-y-4",
|
|
4987
4277
|
children: renderSections(sections)
|
|
4988
4278
|
});
|
|
@@ -5004,10 +4294,10 @@ var DataTablePagination = ({
|
|
|
5004
4294
|
if (!paginationVisible || !pagination)
|
|
5005
4295
|
return null;
|
|
5006
4296
|
const selected = model.rows.filter((row) => store.state.rowSelection[row.id]).length;
|
|
5007
|
-
return /* @__PURE__ */
|
|
4297
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
5008
4298
|
"data-table-slot": "pagination",
|
|
5009
4299
|
className: cn("shrink-0 pt-4", styles?.pagination),
|
|
5010
|
-
children: /* @__PURE__ */
|
|
4300
|
+
children: /* @__PURE__ */ jsx3(Pagination, {
|
|
5011
4301
|
pageSizeContentClassName: styles?.popup?.select,
|
|
5012
4302
|
locale: store.config.locale,
|
|
5013
4303
|
messages: { [store.config.locale]: store.config.labels },
|
|
@@ -5056,10 +4346,10 @@ var modelColumns = (definitions) => normalizeDataTableColumns(definitions).map((
|
|
|
5056
4346
|
});
|
|
5057
4347
|
var getTableLayoutClass = (virtualization) => virtualization && virtualization !== true && virtualization.scroll === "internal" ? "flex min-h-0 flex-1 flex-col" : undefined;
|
|
5058
4348
|
var HydratedDataTable = (props) => {
|
|
5059
|
-
const config =
|
|
5060
|
-
const columns =
|
|
4349
|
+
const config = useMemo(() => resolveConfig(props), [props]);
|
|
4350
|
+
const columns = useMemo(() => modelColumns(props.columnDefs), [props.columnDefs]);
|
|
5061
4351
|
const selection = config.features.selection;
|
|
5062
|
-
const modelProps =
|
|
4352
|
+
const modelProps = useMemo(() => {
|
|
5063
4353
|
const { features } = config;
|
|
5064
4354
|
const grouping = features.grouping;
|
|
5065
4355
|
const pagination = features.pagination;
|
|
@@ -5157,7 +4447,7 @@ var HydratedDataTable = (props) => {
|
|
|
5157
4447
|
const query = modelProps.state ?? model.query;
|
|
5158
4448
|
const { collapsedGroups, selectedRowIds } = model;
|
|
5159
4449
|
const galleryEnabled = !!props.features?.gallery;
|
|
5160
|
-
const state =
|
|
4450
|
+
const state = useMemo(() => ({
|
|
5161
4451
|
...query,
|
|
5162
4452
|
columnVisibility,
|
|
5163
4453
|
columnSizing,
|
|
@@ -5175,7 +4465,7 @@ var HydratedDataTable = (props) => {
|
|
|
5175
4465
|
collapsedGroups,
|
|
5176
4466
|
selectedRowIds
|
|
5177
4467
|
]);
|
|
5178
|
-
const store =
|
|
4468
|
+
const store = useMemo(() => {
|
|
5179
4469
|
const source = {
|
|
5180
4470
|
rowData: props.rowData,
|
|
5181
4471
|
columnDefs: props.columnDefs,
|
|
@@ -5186,20 +4476,20 @@ var HydratedDataTable = (props) => {
|
|
|
5186
4476
|
}, [props.rowData, props.columnDefs, config, state]);
|
|
5187
4477
|
const table = [{ ...store, ui: model }, send];
|
|
5188
4478
|
if (!preferencesLoaded)
|
|
5189
|
-
return /* @__PURE__ */
|
|
4479
|
+
return /* @__PURE__ */ jsx3(TablePlaceholder, {
|
|
5190
4480
|
props
|
|
5191
4481
|
});
|
|
5192
|
-
return /* @__PURE__ */
|
|
4482
|
+
return /* @__PURE__ */ jsxs3("div", {
|
|
5193
4483
|
className: cn("w-full max-w-full min-w-0 rounded-md", getTableLayoutClass(props.features?.virtualization), props.className),
|
|
5194
4484
|
"data-table-root": "",
|
|
5195
4485
|
children: [
|
|
5196
|
-
/* @__PURE__ */
|
|
4486
|
+
/* @__PURE__ */ jsx3(DataTableToolbar, {
|
|
5197
4487
|
table
|
|
5198
4488
|
}),
|
|
5199
|
-
/* @__PURE__ */
|
|
4489
|
+
/* @__PURE__ */ jsx3(DataTableContent, {
|
|
5200
4490
|
table
|
|
5201
4491
|
}),
|
|
5202
|
-
/* @__PURE__ */
|
|
4492
|
+
/* @__PURE__ */ jsx3(DataTablePagination, {
|
|
5203
4493
|
table
|
|
5204
4494
|
})
|
|
5205
4495
|
]
|
|
@@ -5210,7 +4500,7 @@ var clientSnapshot = () => true;
|
|
|
5210
4500
|
var serverSnapshot = () => false;
|
|
5211
4501
|
var TablePlaceholder = ({
|
|
5212
4502
|
props
|
|
5213
|
-
}) => /* @__PURE__ */
|
|
4503
|
+
}) => /* @__PURE__ */ jsx3("div", {
|
|
5214
4504
|
"aria-busy": "true",
|
|
5215
4505
|
className: cn("invisible w-full max-w-full min-w-0 rounded-md", getTableLayoutClass(props.features?.virtualization), props.className),
|
|
5216
4506
|
"data-table-root": ""
|
|
@@ -5219,14 +4509,14 @@ var DataTable = (props) => {
|
|
|
5219
4509
|
const locale = useKrakstackLocale3(props.locale);
|
|
5220
4510
|
const hydrated = useSyncExternalStore(subscribeToHydration, clientSnapshot, serverSnapshot);
|
|
5221
4511
|
if (!hydrated)
|
|
5222
|
-
return /* @__PURE__ */
|
|
4512
|
+
return /* @__PURE__ */ jsx3(TablePlaceholder, {
|
|
5223
4513
|
props
|
|
5224
4514
|
});
|
|
5225
|
-
return /* @__PURE__ */
|
|
4515
|
+
return /* @__PURE__ */ jsx3(DataTableStylesContext.Provider, {
|
|
5226
4516
|
value: props.classNames,
|
|
5227
|
-
children: /* @__PURE__ */
|
|
4517
|
+
children: /* @__PURE__ */ jsx3(DataTableSlotClassesContext.Provider, {
|
|
5228
4518
|
value: resolveTableClasses(props.classes),
|
|
5229
|
-
children: /* @__PURE__ */
|
|
4519
|
+
children: /* @__PURE__ */ jsx3(HydratedDataTable, {
|
|
5230
4520
|
...props,
|
|
5231
4521
|
locale
|
|
5232
4522
|
})
|
|
@@ -5269,7 +4559,7 @@ var DataTableContent = ({
|
|
|
5269
4559
|
return () => observer.disconnect();
|
|
5270
4560
|
}, [scrollElement]);
|
|
5271
4561
|
if (store.config.features.gallery && store.state.view === "gallery") {
|
|
5272
|
-
return /* @__PURE__ */
|
|
4562
|
+
return /* @__PURE__ */ jsx3(DataTableGallery, {
|
|
5273
4563
|
table
|
|
5274
4564
|
});
|
|
5275
4565
|
}
|
|
@@ -5283,22 +4573,22 @@ var DataTableContent = ({
|
|
|
5283
4573
|
const options = virtualization && virtualization !== true ? virtualization : {};
|
|
5284
4574
|
const rowCount = !getActiveGrouping(store).length && model.pageRows.length && !store.config.status.error ? model.pageRows.length + 1 : undefined;
|
|
5285
4575
|
if (options.scroll === "page") {
|
|
5286
|
-
return /* @__PURE__ */
|
|
4576
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
5287
4577
|
ref: setPageTable,
|
|
5288
4578
|
"data-table-page-virtualization": "",
|
|
5289
4579
|
className: "[overflow-anchor:none]",
|
|
5290
|
-
children: /* @__PURE__ */
|
|
4580
|
+
children: /* @__PURE__ */ jsxs3(ScrollArea, {
|
|
5291
4581
|
className: "@container max-w-full min-w-0",
|
|
5292
4582
|
children: [
|
|
5293
|
-
/* @__PURE__ */
|
|
4583
|
+
/* @__PURE__ */ jsxs3(Table, {
|
|
5294
4584
|
"aria-rowcount": rowCount,
|
|
5295
4585
|
className: "table-fixed",
|
|
5296
4586
|
style: { width: `max(100%, ${width}px)` },
|
|
5297
4587
|
children: [
|
|
5298
|
-
/* @__PURE__ */
|
|
4588
|
+
/* @__PURE__ */ jsx3(DataTableHeader, {
|
|
5299
4589
|
table
|
|
5300
4590
|
}),
|
|
5301
|
-
/* @__PURE__ */
|
|
4591
|
+
/* @__PURE__ */ jsx3(DataTableBody, {
|
|
5302
4592
|
table,
|
|
5303
4593
|
viewport: {
|
|
5304
4594
|
element: null,
|
|
@@ -5309,7 +4599,7 @@ var DataTableContent = ({
|
|
|
5309
4599
|
})
|
|
5310
4600
|
]
|
|
5311
4601
|
}),
|
|
5312
|
-
/* @__PURE__ */
|
|
4602
|
+
/* @__PURE__ */ jsx3(ScrollBar, {
|
|
5313
4603
|
orientation: "horizontal"
|
|
5314
4604
|
})
|
|
5315
4605
|
]
|
|
@@ -5317,10 +4607,10 @@ var DataTableContent = ({
|
|
|
5317
4607
|
});
|
|
5318
4608
|
}
|
|
5319
4609
|
const fillHeight = options.scroll === "internal";
|
|
5320
|
-
return /* @__PURE__ */
|
|
4610
|
+
return /* @__PURE__ */ jsxs3(ScrollAreaPrimitive.Root, {
|
|
5321
4611
|
className: cn("relative isolate max-w-full min-w-0", fillHeight && "flex min-h-0 flex-1 flex-col"),
|
|
5322
4612
|
children: [
|
|
5323
|
-
/* @__PURE__ */
|
|
4613
|
+
/* @__PURE__ */ jsx3(ScrollAreaPrimitive.Viewport, {
|
|
5324
4614
|
ref: setScrollElement,
|
|
5325
4615
|
"data-table-virtual-viewport": "",
|
|
5326
4616
|
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 +4618,17 @@ var DataTableContent = ({
|
|
|
5328
4618
|
maxHeight: fillHeight ? undefined : options.height ?? 480,
|
|
5329
4619
|
scrollPaddingTop: headerHeight
|
|
5330
4620
|
},
|
|
5331
|
-
children: /* @__PURE__ */
|
|
5332
|
-
children: /* @__PURE__ */
|
|
4621
|
+
children: /* @__PURE__ */ jsx3(ScrollAreaPrimitive.Content, {
|
|
4622
|
+
children: /* @__PURE__ */ jsxs3(Table, {
|
|
5333
4623
|
"aria-rowcount": rowCount,
|
|
5334
4624
|
className: "table-fixed",
|
|
5335
4625
|
style: { width: `max(100%, ${width}px)` },
|
|
5336
4626
|
children: [
|
|
5337
|
-
/* @__PURE__ */
|
|
4627
|
+
/* @__PURE__ */ jsx3(DataTableHeader, {
|
|
5338
4628
|
sticky: true,
|
|
5339
4629
|
table
|
|
5340
4630
|
}),
|
|
5341
|
-
/* @__PURE__ */
|
|
4631
|
+
/* @__PURE__ */ jsx3(DataTableBody, {
|
|
5342
4632
|
table,
|
|
5343
4633
|
viewport: { element: scrollElement, headerHeight, options }
|
|
5344
4634
|
})
|
|
@@ -5346,33 +4636,33 @@ var DataTableContent = ({
|
|
|
5346
4636
|
})
|
|
5347
4637
|
})
|
|
5348
4638
|
}),
|
|
5349
|
-
/* @__PURE__ */
|
|
4639
|
+
/* @__PURE__ */ jsx3(ScrollBar, {
|
|
5350
4640
|
className: "data-vertical:h-auto",
|
|
5351
4641
|
style: { top: headerHeight }
|
|
5352
4642
|
}),
|
|
5353
|
-
/* @__PURE__ */
|
|
4643
|
+
/* @__PURE__ */ jsx3(ScrollBar, {
|
|
5354
4644
|
orientation: "horizontal"
|
|
5355
4645
|
}),
|
|
5356
|
-
/* @__PURE__ */
|
|
4646
|
+
/* @__PURE__ */ jsx3(ScrollAreaPrimitive.Corner, {})
|
|
5357
4647
|
]
|
|
5358
4648
|
});
|
|
5359
4649
|
}
|
|
5360
|
-
return /* @__PURE__ */
|
|
4650
|
+
return /* @__PURE__ */ jsxs3(ScrollArea, {
|
|
5361
4651
|
className: "@container max-w-full min-w-0",
|
|
5362
4652
|
children: [
|
|
5363
|
-
/* @__PURE__ */
|
|
4653
|
+
/* @__PURE__ */ jsxs3(Table, {
|
|
5364
4654
|
className: "table-fixed",
|
|
5365
4655
|
style: { width: `max(100%, ${width}px)` },
|
|
5366
4656
|
children: [
|
|
5367
|
-
/* @__PURE__ */
|
|
4657
|
+
/* @__PURE__ */ jsx3(DataTableHeader, {
|
|
5368
4658
|
table
|
|
5369
4659
|
}),
|
|
5370
|
-
/* @__PURE__ */
|
|
4660
|
+
/* @__PURE__ */ jsx3(DataTableBody, {
|
|
5371
4661
|
table
|
|
5372
4662
|
})
|
|
5373
4663
|
]
|
|
5374
4664
|
}),
|
|
5375
|
-
/* @__PURE__ */
|
|
4665
|
+
/* @__PURE__ */ jsx3(ScrollBar, {
|
|
5376
4666
|
orientation: "horizontal"
|
|
5377
4667
|
})
|
|
5378
4668
|
]
|
|
@@ -5383,7 +4673,7 @@ var DataTableListCell = (props) => {
|
|
|
5383
4673
|
const locale = useKrakstackLocale3(props.locale);
|
|
5384
4674
|
const resolvedProps = { ...props, locale };
|
|
5385
4675
|
if (resolvedProps.options && (resolvedProps.onAdd || resolvedProps.onRemove)) {
|
|
5386
|
-
return /* @__PURE__ */
|
|
4676
|
+
return /* @__PURE__ */ jsx3(EditableDataTableListCell, {
|
|
5387
4677
|
...resolvedProps
|
|
5388
4678
|
});
|
|
5389
4679
|
}
|
|
@@ -5391,17 +4681,17 @@ var DataTableListCell = (props) => {
|
|
|
5391
4681
|
const labels = dataTableMessages(locale, resolvedProps.messages);
|
|
5392
4682
|
const hasItems = resolvedProps.items.length > 0;
|
|
5393
4683
|
if (!itemActions?.length && !hasItems) {
|
|
5394
|
-
return /* @__PURE__ */
|
|
4684
|
+
return /* @__PURE__ */ jsx3(DataTableListSummary, {
|
|
5395
4685
|
...summaryProps
|
|
5396
4686
|
});
|
|
5397
4687
|
}
|
|
5398
4688
|
const menuLabel = actionsLabel ?? (itemActions?.length ? labels.actions : labels.listDetails);
|
|
5399
|
-
return /* @__PURE__ */
|
|
4689
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
5400
4690
|
className: tableClasses.relationshipCell,
|
|
5401
4691
|
"data-slot": "data-table-list-cell",
|
|
5402
4692
|
onClick: (event) => event.stopPropagation(),
|
|
5403
4693
|
onPointerDown: (event) => event.stopPropagation(),
|
|
5404
|
-
children: /* @__PURE__ */
|
|
4694
|
+
children: /* @__PURE__ */ jsx3(DataTableListMenu, {
|
|
5405
4695
|
actions: itemActions ?? [],
|
|
5406
4696
|
display: resolvedProps.display,
|
|
5407
4697
|
force: hasItems,
|
|
@@ -5410,16 +4700,16 @@ var DataTableListCell = (props) => {
|
|
|
5410
4700
|
locale,
|
|
5411
4701
|
messages: resolvedProps.messages,
|
|
5412
4702
|
onItemClick,
|
|
5413
|
-
trigger: /* @__PURE__ */
|
|
4703
|
+
trigger: /* @__PURE__ */ jsxs3(Button2, {
|
|
5414
4704
|
"aria-label": menuLabel,
|
|
5415
4705
|
className: tableClasses.relationshipTrigger,
|
|
5416
4706
|
variant: "ghost",
|
|
5417
4707
|
children: [
|
|
5418
|
-
/* @__PURE__ */
|
|
4708
|
+
/* @__PURE__ */ jsx3(DataTableListSummaryContent, {
|
|
5419
4709
|
...summaryProps,
|
|
5420
4710
|
showMenu: false
|
|
5421
4711
|
}),
|
|
5422
|
-
/* @__PURE__ */
|
|
4712
|
+
/* @__PURE__ */ jsx3(ChevronDown, {})
|
|
5423
4713
|
]
|
|
5424
4714
|
})
|
|
5425
4715
|
})
|
|
@@ -5460,7 +4750,7 @@ var EditableDataTableListCell = ({
|
|
|
5460
4750
|
id: "data-table-list-remove",
|
|
5461
4751
|
closeOnClick: false,
|
|
5462
4752
|
name: labels.removeItem,
|
|
5463
|
-
icon: /* @__PURE__ */
|
|
4753
|
+
icon: /* @__PURE__ */ jsx3(Trash2, {}),
|
|
5464
4754
|
variant: "destructive",
|
|
5465
4755
|
onClick: (item) => {
|
|
5466
4756
|
if (item.value === undefined)
|
|
@@ -5471,12 +4761,12 @@ var EditableDataTableListCell = ({
|
|
|
5471
4761
|
}
|
|
5472
4762
|
] : []
|
|
5473
4763
|
];
|
|
5474
|
-
return /* @__PURE__ */
|
|
4764
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
5475
4765
|
"data-slot": "data-table-list-cell",
|
|
5476
4766
|
className: tableClasses.relationshipCell,
|
|
5477
4767
|
onClick: (event) => event.stopPropagation(),
|
|
5478
4768
|
onPointerDown: (event) => event.stopPropagation(),
|
|
5479
|
-
children: /* @__PURE__ */
|
|
4769
|
+
children: /* @__PURE__ */ jsx3(DataTableListMenu, {
|
|
5480
4770
|
actions,
|
|
5481
4771
|
addEmptyLabel: emptyLabel,
|
|
5482
4772
|
addLabel: labels.addItem,
|
|
@@ -5493,12 +4783,12 @@ var EditableDataTableListCell = ({
|
|
|
5493
4783
|
onAdd(item.value);
|
|
5494
4784
|
setSelected((current) => [...current, item]);
|
|
5495
4785
|
} : undefined,
|
|
5496
|
-
trigger: /* @__PURE__ */
|
|
4786
|
+
trigger: /* @__PURE__ */ jsxs3(Button2, {
|
|
5497
4787
|
"aria-label": manageLabel,
|
|
5498
4788
|
className: "h-full w-full min-w-0 justify-between rounded-none px-2 focus-visible:ring-inset",
|
|
5499
4789
|
variant: "ghost",
|
|
5500
4790
|
children: [
|
|
5501
|
-
/* @__PURE__ */
|
|
4791
|
+
/* @__PURE__ */ jsx3(DataTableListSummaryContent, {
|
|
5502
4792
|
emptyLabel,
|
|
5503
4793
|
items: selected,
|
|
5504
4794
|
display,
|
|
@@ -5506,7 +4796,7 @@ var EditableDataTableListCell = ({
|
|
|
5506
4796
|
visibleCount,
|
|
5507
4797
|
totalCount: selectedTotal
|
|
5508
4798
|
}),
|
|
5509
|
-
/* @__PURE__ */
|
|
4799
|
+
/* @__PURE__ */ jsx3(ChevronDown, {})
|
|
5510
4800
|
]
|
|
5511
4801
|
})
|
|
5512
4802
|
})
|
|
@@ -5539,42 +4829,42 @@ var DataTableListMenu = ({
|
|
|
5539
4829
|
return null;
|
|
5540
4830
|
const labels = dataTableMessages(locale, messages);
|
|
5541
4831
|
const resolvedLabel = label ?? (hasActions ? labels.actions : labels.listDetails);
|
|
5542
|
-
return /* @__PURE__ */
|
|
4832
|
+
return /* @__PURE__ */ jsxs3(DropdownMenu, {
|
|
5543
4833
|
modal: false,
|
|
5544
4834
|
children: [
|
|
5545
|
-
/* @__PURE__ */
|
|
4835
|
+
/* @__PURE__ */ jsx3(DropdownMenuTrigger, {
|
|
5546
4836
|
onClick: (event) => event.stopPropagation(),
|
|
5547
4837
|
onPointerDown: (event) => event.stopPropagation(),
|
|
5548
|
-
render: trigger ?? /* @__PURE__ */
|
|
4838
|
+
render: trigger ?? /* @__PURE__ */ jsx3(Button2, {
|
|
5549
4839
|
"aria-label": resolvedLabel,
|
|
5550
4840
|
className: cn("size-8 shrink-0", className),
|
|
5551
4841
|
size: "icon",
|
|
5552
4842
|
variant: "ghost",
|
|
5553
|
-
children: /* @__PURE__ */
|
|
4843
|
+
children: /* @__PURE__ */ jsx3(MoreHorizontal, {})
|
|
5554
4844
|
})
|
|
5555
4845
|
}),
|
|
5556
|
-
/* @__PURE__ */
|
|
4846
|
+
/* @__PURE__ */ jsx3(DropdownMenuContent, {
|
|
5557
4847
|
align: "end",
|
|
5558
4848
|
className: "max-h-[min(18rem,var(--available-height))] w-72 max-w-[calc(100vw-2rem)]",
|
|
5559
4849
|
onClick: (event) => event.stopPropagation(),
|
|
5560
4850
|
onPointerDown: (event) => event.stopPropagation(),
|
|
5561
|
-
children: /* @__PURE__ */
|
|
4851
|
+
children: /* @__PURE__ */ jsxs3(DropdownMenuGroup, {
|
|
5562
4852
|
children: [
|
|
5563
|
-
/* @__PURE__ */
|
|
4853
|
+
/* @__PURE__ */ jsx3(DropdownMenuLabel, {
|
|
5564
4854
|
children: resolvedLabel
|
|
5565
4855
|
}),
|
|
5566
|
-
/* @__PURE__ */
|
|
5567
|
-
entries.map(({ item, visibleActions }, index) => visibleActions.length ? /* @__PURE__ */
|
|
4856
|
+
/* @__PURE__ */ jsx3(DropdownMenuSeparator, {}),
|
|
4857
|
+
entries.map(({ item, visibleActions }, index) => visibleActions.length ? /* @__PURE__ */ jsxs3(DropdownMenuSub, {
|
|
5568
4858
|
children: [
|
|
5569
|
-
/* @__PURE__ */
|
|
5570
|
-
children: /* @__PURE__ */
|
|
4859
|
+
/* @__PURE__ */ jsx3(DropdownMenuSubTrigger, {
|
|
4860
|
+
children: /* @__PURE__ */ jsx3(DataTableListEntry, {
|
|
5571
4861
|
item,
|
|
5572
4862
|
appearance: display === "icon" ? "detail" : "list"
|
|
5573
4863
|
})
|
|
5574
4864
|
}),
|
|
5575
|
-
/* @__PURE__ */
|
|
4865
|
+
/* @__PURE__ */ jsx3(DropdownMenuSubContent, {
|
|
5576
4866
|
className: "w-max",
|
|
5577
|
-
children: visibleActions.map((action) => /* @__PURE__ */
|
|
4867
|
+
children: visibleActions.map((action) => /* @__PURE__ */ jsxs3(DropdownMenuItem, {
|
|
5578
4868
|
closeOnClick: action.closeOnClick,
|
|
5579
4869
|
disabled: action.disabled?.(item),
|
|
5580
4870
|
onClick: (event) => {
|
|
@@ -5589,21 +4879,21 @@ var DataTableListMenu = ({
|
|
|
5589
4879
|
}, action.id ?? action.name))
|
|
5590
4880
|
})
|
|
5591
4881
|
]
|
|
5592
|
-
}, item.value ?? `${item.label}-${index}`) : /* @__PURE__ */
|
|
4882
|
+
}, item.value ?? `${item.label}-${index}`) : /* @__PURE__ */ jsx3(DropdownMenuItem, {
|
|
5593
4883
|
closeOnClick: Boolean(onItemClick),
|
|
5594
4884
|
onClick: (event) => {
|
|
5595
4885
|
event.stopPropagation();
|
|
5596
4886
|
onItemClick?.(item);
|
|
5597
4887
|
},
|
|
5598
|
-
children: /* @__PURE__ */
|
|
4888
|
+
children: /* @__PURE__ */ jsx3(DataTableListEntry, {
|
|
5599
4889
|
item,
|
|
5600
4890
|
appearance: display === "icon" ? "detail" : "list"
|
|
5601
4891
|
})
|
|
5602
4892
|
}, item.value ?? `${item.label}-${index}`)),
|
|
5603
|
-
onAdd && addOptions?.length ? /* @__PURE__ */
|
|
4893
|
+
onAdd && addOptions?.length ? /* @__PURE__ */ jsxs3(Fragment, {
|
|
5604
4894
|
children: [
|
|
5605
|
-
entries.length ? /* @__PURE__ */
|
|
5606
|
-
/* @__PURE__ */
|
|
4895
|
+
entries.length ? /* @__PURE__ */ jsx3(DropdownMenuSeparator, {}) : null,
|
|
4896
|
+
/* @__PURE__ */ jsx3(DataTableListAddMenu, {
|
|
5607
4897
|
emptyLabel: addEmptyLabel,
|
|
5608
4898
|
label: addLabel ?? labels.addItem,
|
|
5609
4899
|
locale,
|
|
@@ -5638,28 +4928,28 @@ var DataTableListAddMenu = ({
|
|
|
5638
4928
|
const labels = dataTableMessages(locale, messages);
|
|
5639
4929
|
const normalizedSearch = search.trim().toLocaleLowerCase(locale);
|
|
5640
4930
|
const filtered = normalizedSearch ? options.filter((item) => item.label.toLocaleLowerCase(locale).includes(normalizedSearch)) : options;
|
|
5641
|
-
return /* @__PURE__ */
|
|
4931
|
+
return /* @__PURE__ */ jsxs3(DropdownMenuSub, {
|
|
5642
4932
|
onOpenChange: (open) => {
|
|
5643
4933
|
if (!open)
|
|
5644
4934
|
setSearch("");
|
|
5645
4935
|
},
|
|
5646
4936
|
children: [
|
|
5647
|
-
/* @__PURE__ */
|
|
4937
|
+
/* @__PURE__ */ jsxs3(DropdownMenuSubTrigger, {
|
|
5648
4938
|
children: [
|
|
5649
|
-
/* @__PURE__ */
|
|
4939
|
+
/* @__PURE__ */ jsx3(Plus, {}),
|
|
5650
4940
|
label
|
|
5651
4941
|
]
|
|
5652
4942
|
}),
|
|
5653
|
-
/* @__PURE__ */
|
|
4943
|
+
/* @__PURE__ */ jsxs3(DropdownMenuSubContent, {
|
|
5654
4944
|
className: "w-64",
|
|
5655
4945
|
children: [
|
|
5656
|
-
/* @__PURE__ */
|
|
4946
|
+
/* @__PURE__ */ jsxs3("div", {
|
|
5657
4947
|
className: "relative p-1",
|
|
5658
4948
|
children: [
|
|
5659
|
-
/* @__PURE__ */
|
|
4949
|
+
/* @__PURE__ */ jsx3(Search, {
|
|
5660
4950
|
className: "text-muted-foreground pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2"
|
|
5661
4951
|
}),
|
|
5662
|
-
/* @__PURE__ */
|
|
4952
|
+
/* @__PURE__ */ jsx3(Input, {
|
|
5663
4953
|
"aria-label": searchLabel,
|
|
5664
4954
|
className: "h-8 pl-8",
|
|
5665
4955
|
onChange: (event) => setSearch(event.target.value),
|
|
@@ -5673,15 +4963,15 @@ var DataTableListAddMenu = ({
|
|
|
5673
4963
|
})
|
|
5674
4964
|
]
|
|
5675
4965
|
}),
|
|
5676
|
-
/* @__PURE__ */
|
|
5677
|
-
filtered.length ? filtered.map((item) => /* @__PURE__ */
|
|
4966
|
+
/* @__PURE__ */ jsx3(DropdownMenuSeparator, {}),
|
|
4967
|
+
filtered.length ? filtered.map((item) => /* @__PURE__ */ jsx3(DropdownMenuItem, {
|
|
5678
4968
|
closeOnClick: false,
|
|
5679
4969
|
onClick: () => onAdd(item),
|
|
5680
|
-
children: /* @__PURE__ */
|
|
4970
|
+
children: /* @__PURE__ */ jsx3(DataTableListEntry, {
|
|
5681
4971
|
item,
|
|
5682
4972
|
appearance: display === "icon" ? "detail" : "list"
|
|
5683
4973
|
})
|
|
5684
|
-
}, item.value)) : /* @__PURE__ */
|
|
4974
|
+
}, item.value)) : /* @__PURE__ */ jsx3("div", {
|
|
5685
4975
|
className: "text-muted-foreground px-2 py-1.5 text-sm",
|
|
5686
4976
|
children: emptyLabel
|
|
5687
4977
|
})
|
|
@@ -5702,29 +4992,29 @@ var DataTableListSummaryContent = ({
|
|
|
5702
4992
|
}) => {
|
|
5703
4993
|
const normalized = items.map((item) => Schema6.is(Schema6.String)(item) ? { label: item } : item);
|
|
5704
4994
|
if (!normalized.length)
|
|
5705
|
-
return /* @__PURE__ */
|
|
4995
|
+
return /* @__PURE__ */ jsx3("span", {
|
|
5706
4996
|
className: "text-muted-foreground",
|
|
5707
4997
|
children: emptyLabel
|
|
5708
4998
|
});
|
|
5709
4999
|
const visible = normalized.slice(0, Math.max(0, visibleCount));
|
|
5710
5000
|
const remaining = Math.max(totalCount - visible.length, 0);
|
|
5711
5001
|
if (display === "icon") {
|
|
5712
|
-
return /* @__PURE__ */
|
|
5713
|
-
children: /* @__PURE__ */
|
|
5002
|
+
return /* @__PURE__ */ jsx3(TooltipProvider, {
|
|
5003
|
+
children: /* @__PURE__ */ jsxs3("span", {
|
|
5714
5004
|
className: "flex items-center",
|
|
5715
5005
|
children: [
|
|
5716
|
-
visible.map((item, index) => /* @__PURE__ */
|
|
5006
|
+
visible.map((item, index) => /* @__PURE__ */ jsx3(DataTableListEntry, {
|
|
5717
5007
|
item,
|
|
5718
5008
|
appearance: "icon"
|
|
5719
5009
|
}, item.value ?? `${item.label}-${index}`)),
|
|
5720
|
-
remaining ? /* @__PURE__ */
|
|
5010
|
+
remaining ? /* @__PURE__ */ jsxs3("span", {
|
|
5721
5011
|
className: "bg-secondary text-secondary-foreground -ml-1 flex size-8 items-center justify-center rounded-full",
|
|
5722
5012
|
children: [
|
|
5723
5013
|
"+",
|
|
5724
5014
|
remaining
|
|
5725
5015
|
]
|
|
5726
5016
|
}) : null,
|
|
5727
|
-
remaining && showMenu ? /* @__PURE__ */
|
|
5017
|
+
remaining && showMenu ? /* @__PURE__ */ jsx3(DataTableListMenu, {
|
|
5728
5018
|
actions: [],
|
|
5729
5019
|
display,
|
|
5730
5020
|
force: true,
|
|
@@ -5736,17 +5026,17 @@ var DataTableListSummaryContent = ({
|
|
|
5736
5026
|
})
|
|
5737
5027
|
});
|
|
5738
5028
|
}
|
|
5739
|
-
return /* @__PURE__ */
|
|
5029
|
+
return /* @__PURE__ */ jsxs3("span", {
|
|
5740
5030
|
className: "inline-flex min-w-0 items-center gap-2 text-sm",
|
|
5741
5031
|
children: [
|
|
5742
|
-
/* @__PURE__ */
|
|
5032
|
+
/* @__PURE__ */ jsxs3("span", {
|
|
5743
5033
|
className: "truncate",
|
|
5744
5034
|
children: [
|
|
5745
5035
|
visible.map((item) => item.label).join(", "),
|
|
5746
5036
|
remaining ? ` +${remaining}` : ""
|
|
5747
5037
|
]
|
|
5748
5038
|
}),
|
|
5749
|
-
remaining && showMenu ? /* @__PURE__ */
|
|
5039
|
+
remaining && showMenu ? /* @__PURE__ */ jsx3(DataTableListMenu, {
|
|
5750
5040
|
actions: [],
|
|
5751
5041
|
display,
|
|
5752
5042
|
force: true,
|
|
@@ -5757,7 +5047,7 @@ var DataTableListSummaryContent = ({
|
|
|
5757
5047
|
]
|
|
5758
5048
|
});
|
|
5759
5049
|
};
|
|
5760
|
-
var DataTableListSummary = (props) => /* @__PURE__ */
|
|
5050
|
+
var DataTableListSummary = (props) => /* @__PURE__ */ jsx3(DataTableListSummaryContent, {
|
|
5761
5051
|
...props,
|
|
5762
5052
|
showMenu: true
|
|
5763
5053
|
});
|
|
@@ -5765,47 +5055,51 @@ var DataTableListEntry = ({
|
|
|
5765
5055
|
item,
|
|
5766
5056
|
appearance
|
|
5767
5057
|
}) => {
|
|
5768
|
-
const icon = /* @__PURE__ */
|
|
5058
|
+
const icon = /* @__PURE__ */ jsx3("span", {
|
|
5769
5059
|
"aria-hidden": "true",
|
|
5770
5060
|
className: "bg-secondary text-secondary-foreground flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-full",
|
|
5771
|
-
children: item.imageSrc ? /* @__PURE__ */
|
|
5061
|
+
children: item.imageSrc ? /* @__PURE__ */ jsx3("img", {
|
|
5772
5062
|
alt: "",
|
|
5773
5063
|
src: item.imageSrc,
|
|
5774
5064
|
className: "size-full object-cover"
|
|
5775
5065
|
}) : item.icon ?? item.label.slice(0, 2).toUpperCase()
|
|
5776
5066
|
});
|
|
5777
5067
|
if (appearance === "list") {
|
|
5778
|
-
return /* @__PURE__ */
|
|
5068
|
+
return /* @__PURE__ */ jsx3("span", {
|
|
5779
5069
|
className: "min-w-0 flex-1 truncate",
|
|
5780
5070
|
title: item.label,
|
|
5781
5071
|
children: item.label
|
|
5782
5072
|
});
|
|
5783
5073
|
}
|
|
5784
|
-
return appearance === "icon" ? /* @__PURE__ */
|
|
5074
|
+
return appearance === "icon" ? /* @__PURE__ */ jsxs3(Tooltip, {
|
|
5785
5075
|
children: [
|
|
5786
|
-
/* @__PURE__ */
|
|
5787
|
-
render: /* @__PURE__ */
|
|
5076
|
+
/* @__PURE__ */ jsx3(TooltipTrigger, {
|
|
5077
|
+
render: /* @__PURE__ */ jsx3("span", {
|
|
5788
5078
|
className: "-ml-1 inline-flex rounded-full",
|
|
5789
5079
|
"aria-label": item.label
|
|
5790
5080
|
}),
|
|
5791
5081
|
children: icon
|
|
5792
5082
|
}),
|
|
5793
|
-
/* @__PURE__ */
|
|
5083
|
+
/* @__PURE__ */ jsx3(TooltipContent, {
|
|
5794
5084
|
children: item.label
|
|
5795
5085
|
})
|
|
5796
5086
|
]
|
|
5797
|
-
}) : /* @__PURE__ */
|
|
5087
|
+
}) : /* @__PURE__ */ jsxs3("span", {
|
|
5798
5088
|
className: "flex min-w-0 flex-1 items-center gap-2 text-left",
|
|
5799
5089
|
children: [
|
|
5800
5090
|
icon,
|
|
5801
|
-
/* @__PURE__ */
|
|
5091
|
+
/* @__PURE__ */ jsx3("span", {
|
|
5802
5092
|
className: "truncate",
|
|
5803
5093
|
children: item.label
|
|
5804
5094
|
})
|
|
5805
5095
|
]
|
|
5806
5096
|
});
|
|
5807
5097
|
};
|
|
5098
|
+
// ../../src/components/webhook-delivery-table/react.tsx
|
|
5099
|
+
import { Button as Button4 } from "@/components/ui/button";
|
|
5100
|
+
|
|
5808
5101
|
// ../../src/components/copy-button/react.tsx
|
|
5102
|
+
import { Button as Button3 } from "@/components/ui/button";
|
|
5809
5103
|
import { Check as Check2, Copy, TriangleAlert } from "lucide-react";
|
|
5810
5104
|
import { Redacted as Redacted3 } from "effect";
|
|
5811
5105
|
import { Component as Component5 } from "effect/ui";
|
|
@@ -5908,7 +5202,7 @@ var copyButtonStatus = (status, copy, description) => {
|
|
|
5908
5202
|
};
|
|
5909
5203
|
|
|
5910
5204
|
// ../../src/components/copy-button/react.tsx
|
|
5911
|
-
import { jsx as
|
|
5205
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
5912
5206
|
"use client";
|
|
5913
5207
|
function CopyButton({
|
|
5914
5208
|
value,
|
|
@@ -5959,29 +5253,29 @@ function CopyButton({
|
|
|
5959
5253
|
const accessibleLabel = ariaLabel ?? copyButtonLabel(labels.copy, valueDescription);
|
|
5960
5254
|
const isLarge = copyVariant === "large";
|
|
5961
5255
|
const defaultSize = copyVariant === "sm" ? "icon-xs" : isLarge ? "sm" : "icon-sm";
|
|
5962
|
-
return /* @__PURE__ */
|
|
5256
|
+
return /* @__PURE__ */ jsxs4(Button3, {
|
|
5963
5257
|
"aria-label": accessibleLabel,
|
|
5964
5258
|
disabled,
|
|
5965
5259
|
onClick: () => send(CopyButtonMessage.Pressed()),
|
|
5966
5260
|
size: size ?? defaultSize,
|
|
5967
5261
|
...props,
|
|
5968
5262
|
children: [
|
|
5969
|
-
/* @__PURE__ */
|
|
5263
|
+
/* @__PURE__ */ jsx4("span", {
|
|
5970
5264
|
"aria-live": "polite",
|
|
5971
5265
|
className: "sr-only",
|
|
5972
5266
|
role: "status",
|
|
5973
5267
|
children: copyButtonStatus(status, labels, valueDescription)
|
|
5974
5268
|
}),
|
|
5975
|
-
status === "copied" ? /* @__PURE__ */
|
|
5269
|
+
status === "copied" ? /* @__PURE__ */ jsx4(Check2, {
|
|
5976
5270
|
"aria-hidden": "true"
|
|
5977
5271
|
}) : null,
|
|
5978
|
-
status === "failed" ? /* @__PURE__ */
|
|
5272
|
+
status === "failed" ? /* @__PURE__ */ jsx4(TriangleAlert, {
|
|
5979
5273
|
"aria-hidden": "true"
|
|
5980
5274
|
}) : null,
|
|
5981
|
-
status === "idle" ? /* @__PURE__ */
|
|
5275
|
+
status === "idle" ? /* @__PURE__ */ jsx4(Copy, {
|
|
5982
5276
|
"aria-hidden": "true"
|
|
5983
5277
|
}) : null,
|
|
5984
|
-
isLarge ? /* @__PURE__ */
|
|
5278
|
+
isLarge ? /* @__PURE__ */ jsx4("span", {
|
|
5985
5279
|
children: labels.copy
|
|
5986
5280
|
}) : null
|
|
5987
5281
|
]
|
|
@@ -6049,7 +5343,7 @@ var codeBlockMessages = (locale = "en", translations) => ({
|
|
|
6049
5343
|
var codeLanguage = (language = "text") => language.toLowerCase() || "text";
|
|
6050
5344
|
|
|
6051
5345
|
// ../../src/components/code-block/react.tsx
|
|
6052
|
-
import { jsx as
|
|
5346
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
6053
5347
|
function CodeBlock({
|
|
6054
5348
|
classes: classOverrides,
|
|
6055
5349
|
code,
|
|
@@ -6062,21 +5356,21 @@ function CodeBlock({
|
|
|
6062
5356
|
const normalizedLanguage = codeLanguage(language);
|
|
6063
5357
|
const highlighted = highlight(code, { lang: normalizedLanguage });
|
|
6064
5358
|
const labels = codeBlockMessages(locale, messages);
|
|
6065
|
-
return /* @__PURE__ */
|
|
5359
|
+
return /* @__PURE__ */ jsxs5("div", {
|
|
6066
5360
|
className: codeBlockClasses.root,
|
|
6067
5361
|
"data-code-theme": true,
|
|
6068
5362
|
children: [
|
|
6069
|
-
/* @__PURE__ */
|
|
5363
|
+
/* @__PURE__ */ jsx5("style", {
|
|
6070
5364
|
children: codeThemeCss
|
|
6071
5365
|
}),
|
|
6072
|
-
/* @__PURE__ */
|
|
5366
|
+
/* @__PURE__ */ jsxs5("div", {
|
|
6073
5367
|
className: codeBlockClasses.header,
|
|
6074
5368
|
children: [
|
|
6075
|
-
/* @__PURE__ */
|
|
5369
|
+
/* @__PURE__ */ jsx5("span", {
|
|
6076
5370
|
className: codeBlockClasses.language,
|
|
6077
5371
|
children: highlighted.lang
|
|
6078
5372
|
}),
|
|
6079
|
-
/* @__PURE__ */
|
|
5373
|
+
/* @__PURE__ */ jsx5(CopyButton, {
|
|
6080
5374
|
value: code,
|
|
6081
5375
|
valueDescription: labels.codeDescription(highlighted.lang),
|
|
6082
5376
|
variant: "ghost",
|
|
@@ -6085,91 +5379,20 @@ function CodeBlock({
|
|
|
6085
5379
|
})
|
|
6086
5380
|
]
|
|
6087
5381
|
}),
|
|
6088
|
-
/* @__PURE__ */
|
|
5382
|
+
/* @__PURE__ */ jsx5("div", {
|
|
6089
5383
|
className: codeBlockClasses.viewport,
|
|
6090
5384
|
dangerouslySetInnerHTML: { __html: highlighted.html }
|
|
6091
5385
|
})
|
|
6092
5386
|
]
|
|
6093
5387
|
});
|
|
6094
5388
|
}
|
|
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
5389
|
// ../../src/components/webhook-delivery-table/react.tsx
|
|
5390
|
+
import {
|
|
5391
|
+
Dialog,
|
|
5392
|
+
DialogContent,
|
|
5393
|
+
DialogHeader,
|
|
5394
|
+
DialogTitle
|
|
5395
|
+
} from "@/components/ui/dialog";
|
|
6173
5396
|
import { useKrakstackLocale as useKrakstackLocale6 } from "@krak-stack/registry/krakstack-provider/react";
|
|
6174
5397
|
import { useModel as useModel3 } from "@krak-stack/registry/effect-ui-adapter/react";
|
|
6175
5398
|
|
|
@@ -6335,7 +5558,7 @@ var webhookDeliveryTableBehaviours = {
|
|
|
6335
5558
|
};
|
|
6336
5559
|
|
|
6337
5560
|
// ../../src/components/webhook-delivery-table/react.tsx
|
|
6338
|
-
import { jsx as
|
|
5561
|
+
import { jsx as jsx6, jsxs as jsxs6, Fragment as Fragment2 } from "react/jsx-runtime";
|
|
6339
5562
|
var DeliveryTableModel = Component7.define(webhookDeliveryTableOptions).make({
|
|
6340
5563
|
...webhookDeliveryTableBehaviours,
|
|
6341
5564
|
view: () => View3.text("")
|
|
@@ -6395,7 +5618,7 @@ var WebhookDeliveryTable = ({
|
|
|
6395
5618
|
return {
|
|
6396
5619
|
label: statusLabels[displayStatus],
|
|
6397
5620
|
description: webhookDeliveryStatusDetails(delivery, labels, dateFormatter),
|
|
6398
|
-
icon: displayStatus === "failed" ? /* @__PURE__ */
|
|
5621
|
+
icon: displayStatus === "failed" ? /* @__PURE__ */ jsx6(X2, {}) : displayStatus === "success" ? /* @__PURE__ */ jsx6(Check3, {}) : /* @__PURE__ */ jsx6(Clock, {}),
|
|
6399
5622
|
iconClassName: displayStatus === "failed" ? "bg-destructive/10 text-destructive" : displayStatus === "success" ? "bg-success/10 text-success" : "bg-primary/10 text-primary"
|
|
6400
5623
|
};
|
|
6401
5624
|
}
|
|
@@ -6407,7 +5630,7 @@ var WebhookDeliveryTable = ({
|
|
|
6407
5630
|
headerName: labels.payload,
|
|
6408
5631
|
sortable: false,
|
|
6409
5632
|
filterable: false,
|
|
6410
|
-
cellRenderer: ({ data }) => /* @__PURE__ */
|
|
5633
|
+
cellRenderer: ({ data }) => /* @__PURE__ */ jsxs6(Button4, {
|
|
6411
5634
|
variant: "outline",
|
|
6412
5635
|
size: "sm",
|
|
6413
5636
|
onClick: (event) => {
|
|
@@ -6415,7 +5638,7 @@ var WebhookDeliveryTable = ({
|
|
|
6415
5638
|
send(WebhookDeliveryTableMessage.OpenPayload({ id: data.id }));
|
|
6416
5639
|
},
|
|
6417
5640
|
children: [
|
|
6418
|
-
/* @__PURE__ */
|
|
5641
|
+
/* @__PURE__ */ jsx6(FileJson2, {
|
|
6419
5642
|
"data-icon": "inline-start"
|
|
6420
5643
|
}),
|
|
6421
5644
|
labels.viewPayload
|
|
@@ -6425,9 +5648,9 @@ var WebhookDeliveryTable = ({
|
|
|
6425
5648
|
{ field: "createdAt", headerName: labels.createdAt, type: "dateTime" },
|
|
6426
5649
|
{ field: "completedAt", headerName: labels.completedAt, type: "dateTime" }
|
|
6427
5650
|
];
|
|
6428
|
-
return /* @__PURE__ */
|
|
5651
|
+
return /* @__PURE__ */ jsxs6(Fragment2, {
|
|
6429
5652
|
children: [
|
|
6430
|
-
/* @__PURE__ */
|
|
5653
|
+
/* @__PURE__ */ jsx6(DataTable, {
|
|
6431
5654
|
locale,
|
|
6432
5655
|
rowData: entries,
|
|
6433
5656
|
getRowId: (row) => row.id,
|
|
@@ -6442,23 +5665,23 @@ var WebhookDeliveryTable = ({
|
|
|
6442
5665
|
pagination: { mode: "server", rowCount }
|
|
6443
5666
|
}
|
|
6444
5667
|
}),
|
|
6445
|
-
/* @__PURE__ */
|
|
5668
|
+
/* @__PURE__ */ jsx6(Dialog, {
|
|
6446
5669
|
open: selected !== undefined,
|
|
6447
5670
|
onOpenChange: (open) => {
|
|
6448
5671
|
if (!open)
|
|
6449
5672
|
send(WebhookDeliveryTableMessage.ClosePayload());
|
|
6450
5673
|
},
|
|
6451
|
-
children: /* @__PURE__ */
|
|
5674
|
+
children: /* @__PURE__ */ jsxs6(DialogContent, {
|
|
6452
5675
|
className: "grid max-h-[calc(100svh-2rem)] grid-rows-[auto_minmax(0,1fr)] overflow-hidden sm:max-w-4xl",
|
|
6453
5676
|
children: [
|
|
6454
|
-
/* @__PURE__ */
|
|
6455
|
-
children: /* @__PURE__ */
|
|
5677
|
+
/* @__PURE__ */ jsx6(DialogHeader, {
|
|
5678
|
+
children: /* @__PURE__ */ jsx6(DialogTitle, {
|
|
6456
5679
|
children: labels.payload
|
|
6457
5680
|
})
|
|
6458
5681
|
}),
|
|
6459
|
-
/* @__PURE__ */
|
|
5682
|
+
/* @__PURE__ */ jsx6("div", {
|
|
6460
5683
|
className: "min-h-0 overflow-auto",
|
|
6461
|
-
children: /* @__PURE__ */
|
|
5684
|
+
children: /* @__PURE__ */ jsx6(CodeBlock, {
|
|
6462
5685
|
code: JSON.stringify(selected?.data ?? null, null, 2),
|
|
6463
5686
|
language: "json",
|
|
6464
5687
|
locale
|