@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// ../../src/components/data-table/react.tsx
|
|
2
|
-
import { ScrollArea as
|
|
2
|
+
import { ScrollArea as ScrollAreaPrimitive } from "@base-ui/react/scroll-area";
|
|
3
3
|
import { useVirtualizer, useWindowVirtualizer } from "@tanstack/react-virtual";
|
|
4
4
|
import { Formatter, Option as Option4, Schema as Schema6 } from "effect";
|
|
5
5
|
import { Component as Component3, View } from "effect/ui";
|
|
@@ -34,479 +34,46 @@ import {
|
|
|
34
34
|
useEffect,
|
|
35
35
|
useId as useId2,
|
|
36
36
|
useLayoutEffect,
|
|
37
|
-
useMemo
|
|
37
|
+
useMemo,
|
|
38
38
|
useRef,
|
|
39
39
|
useState,
|
|
40
40
|
useSyncExternalStore
|
|
41
41
|
} from "react";
|
|
42
42
|
import { createPortal } from "react-dom";
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
className,
|
|
70
|
-
variant = "default",
|
|
71
|
-
render,
|
|
72
|
-
...props
|
|
73
|
-
}) {
|
|
74
|
-
return useRender({
|
|
75
|
-
defaultTagName: "span",
|
|
76
|
-
props: mergeProps({
|
|
77
|
-
className: cn(badgeVariants({ variant }), className)
|
|
78
|
-
}, props),
|
|
79
|
-
render,
|
|
80
|
-
state: {
|
|
81
|
-
slot: "badge",
|
|
82
|
-
variant
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// ../../src/components/ui/button.tsx
|
|
88
|
-
import { Button as ButtonPrimitive } from "@base-ui/react/button";
|
|
89
|
-
import { cva as cva2 } from "class-variance-authority";
|
|
90
|
-
import { jsx } from "react/jsx-runtime";
|
|
91
|
-
var buttonVariants = cva2("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
92
|
-
variants: {
|
|
93
|
-
variant: {
|
|
94
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
95
|
-
outline: "border-border bg-background shadow-xs hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
|
96
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
97
|
-
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
98
|
-
destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
|
|
99
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
100
|
-
},
|
|
101
|
-
size: {
|
|
102
|
-
default: "h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
103
|
-
xs: "h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
104
|
-
sm: "h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",
|
|
105
|
-
lg: "h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
106
|
-
icon: "size-9",
|
|
107
|
-
"icon-xs": "size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3",
|
|
108
|
-
"icon-sm": "size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md",
|
|
109
|
-
"icon-lg": "size-10"
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
defaultVariants: {
|
|
113
|
-
variant: "default",
|
|
114
|
-
size: "default"
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
function Button({
|
|
118
|
-
className,
|
|
119
|
-
variant = "default",
|
|
120
|
-
size = "default",
|
|
121
|
-
...props
|
|
122
|
-
}) {
|
|
123
|
-
return /* @__PURE__ */ jsx(ButtonPrimitive, {
|
|
124
|
-
"data-slot": "button",
|
|
125
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
126
|
-
...props
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
// ../../src/components/ui/card.tsx
|
|
131
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
132
|
-
function Card({
|
|
133
|
-
className,
|
|
134
|
-
size = "default",
|
|
135
|
-
...props
|
|
136
|
-
}) {
|
|
137
|
-
return /* @__PURE__ */ jsx2("div", {
|
|
138
|
-
"data-slot": "card",
|
|
139
|
-
"data-size": size,
|
|
140
|
-
className: cn("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground shadow-xs ring-1 ring-foreground/10 [--card-spacing:--spacing(6)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl", className),
|
|
141
|
-
...props
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
function CardHeader({ className, ...props }) {
|
|
145
|
-
return /* @__PURE__ */ jsx2("div", {
|
|
146
|
-
"data-slot": "card-header",
|
|
147
|
-
className: cn("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)", className),
|
|
148
|
-
...props
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
function CardTitle({ className, ...props }) {
|
|
152
|
-
return /* @__PURE__ */ jsx2("div", {
|
|
153
|
-
"data-slot": "card-title",
|
|
154
|
-
className: cn("text-base leading-normal font-medium group-data-[size=sm]/card:text-sm", className),
|
|
155
|
-
...props
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
// ../../src/components/ui/checkbox.tsx
|
|
160
|
-
import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox";
|
|
161
|
-
import { CheckIcon } from "lucide-react";
|
|
162
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
163
|
-
"use client";
|
|
164
|
-
function Checkbox({ className, ...props }) {
|
|
165
|
-
return /* @__PURE__ */ jsx3(CheckboxPrimitive.Root, {
|
|
166
|
-
"data-slot": "checkbox",
|
|
167
|
-
className: cn("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input shadow-xs transition-shadow outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary", className),
|
|
168
|
-
...props,
|
|
169
|
-
children: /* @__PURE__ */ jsx3(CheckboxPrimitive.Indicator, {
|
|
170
|
-
"data-slot": "checkbox-indicator",
|
|
171
|
-
className: "grid place-content-center text-current transition-none [&>svg]:size-3.5",
|
|
172
|
-
children: /* @__PURE__ */ jsx3(CheckIcon, {})
|
|
173
|
-
})
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
// ../../src/components/ui/dropdown-menu.tsx
|
|
178
|
-
import { Menu as MenuPrimitive } from "@base-ui/react/menu";
|
|
179
|
-
import { ChevronRightIcon, CheckIcon as CheckIcon2 } from "lucide-react";
|
|
180
|
-
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
181
|
-
function DropdownMenu({ ...props }) {
|
|
182
|
-
return /* @__PURE__ */ jsx4(MenuPrimitive.Root, {
|
|
183
|
-
"data-slot": "dropdown-menu",
|
|
184
|
-
...props
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
function DropdownMenuTrigger({ ...props }) {
|
|
188
|
-
return /* @__PURE__ */ jsx4(MenuPrimitive.Trigger, {
|
|
189
|
-
"data-slot": "dropdown-menu-trigger",
|
|
190
|
-
...props
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
function DropdownMenuContent({
|
|
194
|
-
align = "start",
|
|
195
|
-
alignOffset = 0,
|
|
196
|
-
side = "bottom",
|
|
197
|
-
sideOffset = 4,
|
|
198
|
-
className,
|
|
199
|
-
...props
|
|
200
|
-
}) {
|
|
201
|
-
return /* @__PURE__ */ jsx4(MenuPrimitive.Portal, {
|
|
202
|
-
children: /* @__PURE__ */ jsx4(MenuPrimitive.Positioner, {
|
|
203
|
-
className: "isolate z-50 outline-none",
|
|
204
|
-
align,
|
|
205
|
-
alignOffset,
|
|
206
|
-
side,
|
|
207
|
-
sideOffset,
|
|
208
|
-
children: /* @__PURE__ */ jsx4(MenuPrimitive.Popup, {
|
|
209
|
-
"data-slot": "dropdown-menu-content",
|
|
210
|
-
className: cn("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
211
|
-
...props
|
|
212
|
-
})
|
|
213
|
-
})
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
function DropdownMenuGroup({ ...props }) {
|
|
217
|
-
return /* @__PURE__ */ jsx4(MenuPrimitive.Group, {
|
|
218
|
-
"data-slot": "dropdown-menu-group",
|
|
219
|
-
...props
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
function DropdownMenuLabel({
|
|
223
|
-
className,
|
|
224
|
-
inset,
|
|
225
|
-
...props
|
|
226
|
-
}) {
|
|
227
|
-
return /* @__PURE__ */ jsx4(MenuPrimitive.GroupLabel, {
|
|
228
|
-
"data-slot": "dropdown-menu-label",
|
|
229
|
-
"data-inset": inset,
|
|
230
|
-
className: cn("px-2 py-1.5 text-xs font-medium text-muted-foreground data-inset:pl-8", className),
|
|
231
|
-
...props
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
function DropdownMenuItem({
|
|
235
|
-
className,
|
|
236
|
-
inset,
|
|
237
|
-
variant = "default",
|
|
238
|
-
...props
|
|
239
|
-
}) {
|
|
240
|
-
return /* @__PURE__ */ jsx4(MenuPrimitive.Item, {
|
|
241
|
-
"data-slot": "dropdown-menu-item",
|
|
242
|
-
"data-inset": inset,
|
|
243
|
-
"data-variant": variant,
|
|
244
|
-
className: cn("group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive", className),
|
|
245
|
-
...props
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
function DropdownMenuSub({ ...props }) {
|
|
249
|
-
return /* @__PURE__ */ jsx4(MenuPrimitive.SubmenuRoot, {
|
|
250
|
-
"data-slot": "dropdown-menu-sub",
|
|
251
|
-
...props
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
function DropdownMenuSubTrigger({
|
|
255
|
-
className,
|
|
256
|
-
inset,
|
|
257
|
-
children,
|
|
258
|
-
...props
|
|
259
|
-
}) {
|
|
260
|
-
return /* @__PURE__ */ jsxs(MenuPrimitive.SubmenuTrigger, {
|
|
261
|
-
"data-slot": "dropdown-menu-sub-trigger",
|
|
262
|
-
"data-inset": inset,
|
|
263
|
-
className: cn("flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-8 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
264
|
-
...props,
|
|
265
|
-
children: [
|
|
266
|
-
children,
|
|
267
|
-
/* @__PURE__ */ jsx4(ChevronRightIcon, {
|
|
268
|
-
className: "ml-auto"
|
|
269
|
-
})
|
|
270
|
-
]
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
function DropdownMenuSubContent({
|
|
274
|
-
align = "start",
|
|
275
|
-
alignOffset = -3,
|
|
276
|
-
side = "right",
|
|
277
|
-
sideOffset = 0,
|
|
278
|
-
className,
|
|
279
|
-
...props
|
|
280
|
-
}) {
|
|
281
|
-
return /* @__PURE__ */ jsx4(DropdownMenuContent, {
|
|
282
|
-
"data-slot": "dropdown-menu-sub-content",
|
|
283
|
-
className: cn("w-auto min-w-[96px] rounded-md bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
284
|
-
align,
|
|
285
|
-
alignOffset,
|
|
286
|
-
side,
|
|
287
|
-
sideOffset,
|
|
288
|
-
...props
|
|
289
|
-
});
|
|
290
|
-
}
|
|
291
|
-
function DropdownMenuRadioGroup({ ...props }) {
|
|
292
|
-
return /* @__PURE__ */ jsx4(MenuPrimitive.RadioGroup, {
|
|
293
|
-
"data-slot": "dropdown-menu-radio-group",
|
|
294
|
-
...props
|
|
295
|
-
});
|
|
296
|
-
}
|
|
297
|
-
function DropdownMenuSeparator({
|
|
298
|
-
className,
|
|
299
|
-
...props
|
|
300
|
-
}) {
|
|
301
|
-
return /* @__PURE__ */ jsx4(MenuPrimitive.Separator, {
|
|
302
|
-
"data-slot": "dropdown-menu-separator",
|
|
303
|
-
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
304
|
-
...props
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
// ../../src/components/ui/input.tsx
|
|
309
|
-
import { Input as InputPrimitive } from "@base-ui/react/input";
|
|
310
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
311
|
-
function Input({ className, type, ...props }) {
|
|
312
|
-
return /* @__PURE__ */ jsx5(InputPrimitive, {
|
|
313
|
-
type,
|
|
314
|
-
"data-slot": "input",
|
|
315
|
-
className: cn("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className),
|
|
316
|
-
...props
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
// ../../src/components/ui/field.tsx
|
|
321
|
-
import { useMemo } from "react";
|
|
322
|
-
import { cva as cva3 } from "class-variance-authority";
|
|
323
|
-
|
|
324
|
-
// ../../src/components/ui/label.tsx
|
|
325
|
-
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
326
|
-
"use client";
|
|
327
|
-
function Label({ className, ...props }) {
|
|
328
|
-
return /* @__PURE__ */ jsx6("label", {
|
|
329
|
-
"data-slot": "label",
|
|
330
|
-
className: cn("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", className),
|
|
331
|
-
...props
|
|
332
|
-
});
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
// ../../src/components/ui/separator.tsx
|
|
336
|
-
import { Separator as SeparatorPrimitive } from "@base-ui/react/separator";
|
|
337
|
-
|
|
338
|
-
// ../../src/components/ui/field.tsx
|
|
339
|
-
import { jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
340
|
-
function FieldGroup({ className, ...props }) {
|
|
341
|
-
return /* @__PURE__ */ jsx7("div", {
|
|
342
|
-
"data-slot": "field-group",
|
|
343
|
-
className: cn("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4", className),
|
|
344
|
-
...props
|
|
345
|
-
});
|
|
346
|
-
}
|
|
347
|
-
var fieldVariants = cva3("group/field flex w-full gap-3 data-[invalid=true]:text-destructive", {
|
|
348
|
-
variants: {
|
|
349
|
-
orientation: {
|
|
350
|
-
vertical: "flex-col *:w-full [&>.sr-only]:w-auto",
|
|
351
|
-
horizontal: "flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
352
|
-
responsive: "flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
353
|
-
}
|
|
354
|
-
},
|
|
355
|
-
defaultVariants: {
|
|
356
|
-
orientation: "vertical"
|
|
357
|
-
}
|
|
358
|
-
});
|
|
359
|
-
function Field({
|
|
360
|
-
className,
|
|
361
|
-
orientation = "vertical",
|
|
362
|
-
...props
|
|
363
|
-
}) {
|
|
364
|
-
return /* @__PURE__ */ jsx7("div", {
|
|
365
|
-
role: "group",
|
|
366
|
-
"data-slot": "field",
|
|
367
|
-
"data-orientation": orientation,
|
|
368
|
-
className: cn(fieldVariants({ orientation }), className),
|
|
369
|
-
...props
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
function FieldLabel({
|
|
373
|
-
className,
|
|
374
|
-
...props
|
|
375
|
-
}) {
|
|
376
|
-
return /* @__PURE__ */ jsx7(Label, {
|
|
377
|
-
"data-slot": "field-label",
|
|
378
|
-
className: cn("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border *:data-[slot=field]:p-3 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col", className),
|
|
379
|
-
...props
|
|
380
|
-
});
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
// ../../src/components/ui/select.tsx
|
|
384
|
-
import { Select as SelectPrimitive } from "@base-ui/react/select";
|
|
385
|
-
import { ChevronDownIcon, CheckIcon as CheckIcon3, ChevronUpIcon } from "lucide-react";
|
|
386
|
-
import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
387
|
-
"use client";
|
|
388
|
-
var Select = SelectPrimitive.Root;
|
|
389
|
-
function SelectGroup({ className, ...props }) {
|
|
390
|
-
return /* @__PURE__ */ jsx8(SelectPrimitive.Group, {
|
|
391
|
-
"data-slot": "select-group",
|
|
392
|
-
className: cn("scroll-my-1 p-1", className),
|
|
393
|
-
...props
|
|
394
|
-
});
|
|
395
|
-
}
|
|
396
|
-
function SelectValue({ className, ...props }) {
|
|
397
|
-
return /* @__PURE__ */ jsx8(SelectPrimitive.Value, {
|
|
398
|
-
"data-slot": "select-value",
|
|
399
|
-
className: cn("flex flex-1 text-left", className),
|
|
400
|
-
...props
|
|
401
|
-
});
|
|
402
|
-
}
|
|
403
|
-
function SelectTrigger({
|
|
404
|
-
className,
|
|
405
|
-
size = "default",
|
|
406
|
-
children,
|
|
407
|
-
...props
|
|
408
|
-
}) {
|
|
409
|
-
return /* @__PURE__ */ jsxs3(SelectPrimitive.Trigger, {
|
|
410
|
-
"data-slot": "select-trigger",
|
|
411
|
-
"data-size": size,
|
|
412
|
-
className: cn("border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 flex w-fit items-center justify-between gap-1.5 rounded-md border bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
413
|
-
...props,
|
|
414
|
-
children: [
|
|
415
|
-
children,
|
|
416
|
-
/* @__PURE__ */ jsx8(SelectPrimitive.Icon, {
|
|
417
|
-
render: /* @__PURE__ */ jsx8(ChevronDownIcon, {
|
|
418
|
-
className: "text-muted-foreground pointer-events-none size-4"
|
|
419
|
-
})
|
|
420
|
-
})
|
|
421
|
-
]
|
|
422
|
-
});
|
|
423
|
-
}
|
|
424
|
-
function SelectContent({
|
|
425
|
-
className,
|
|
426
|
-
children,
|
|
427
|
-
side = "bottom",
|
|
428
|
-
sideOffset = 4,
|
|
429
|
-
align = "start",
|
|
430
|
-
alignOffset = 0,
|
|
431
|
-
alignItemWithTrigger = false,
|
|
432
|
-
...props
|
|
433
|
-
}) {
|
|
434
|
-
return /* @__PURE__ */ jsx8(SelectPrimitive.Portal, {
|
|
435
|
-
children: /* @__PURE__ */ jsx8(SelectPrimitive.Positioner, {
|
|
436
|
-
side,
|
|
437
|
-
sideOffset,
|
|
438
|
-
align,
|
|
439
|
-
alignOffset,
|
|
440
|
-
alignItemWithTrigger,
|
|
441
|
-
className: "isolate z-50",
|
|
442
|
-
children: /* @__PURE__ */ jsxs3(SelectPrimitive.Popup, {
|
|
443
|
-
"data-slot": "select-content",
|
|
444
|
-
"data-align-trigger": alignItemWithTrigger,
|
|
445
|
-
className: cn("bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-0 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md shadow-md ring-1 duration-100 data-[align-trigger=true]:animate-none", className),
|
|
446
|
-
...props,
|
|
447
|
-
children: [
|
|
448
|
-
/* @__PURE__ */ jsx8(SelectScrollUpButton, {}),
|
|
449
|
-
/* @__PURE__ */ jsx8(SelectPrimitive.List, {
|
|
450
|
-
children
|
|
451
|
-
}),
|
|
452
|
-
/* @__PURE__ */ jsx8(SelectScrollDownButton, {})
|
|
453
|
-
]
|
|
454
|
-
})
|
|
455
|
-
})
|
|
456
|
-
});
|
|
457
|
-
}
|
|
458
|
-
function SelectItem({
|
|
459
|
-
className,
|
|
460
|
-
children,
|
|
461
|
-
...props
|
|
462
|
-
}) {
|
|
463
|
-
return /* @__PURE__ */ jsxs3(SelectPrimitive.Item, {
|
|
464
|
-
"data-slot": "select-item",
|
|
465
|
-
className: cn("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
|
|
466
|
-
...props,
|
|
467
|
-
children: [
|
|
468
|
-
/* @__PURE__ */ jsx8(SelectPrimitive.ItemText, {
|
|
469
|
-
className: "flex flex-1 shrink-0 gap-2 whitespace-nowrap",
|
|
470
|
-
children
|
|
471
|
-
}),
|
|
472
|
-
/* @__PURE__ */ jsx8(SelectPrimitive.ItemIndicator, {
|
|
473
|
-
render: /* @__PURE__ */ jsx8("span", {
|
|
474
|
-
className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center"
|
|
475
|
-
}),
|
|
476
|
-
children: /* @__PURE__ */ jsx8(CheckIcon3, {
|
|
477
|
-
className: "pointer-events-none"
|
|
478
|
-
})
|
|
479
|
-
})
|
|
480
|
-
]
|
|
481
|
-
});
|
|
482
|
-
}
|
|
483
|
-
function SelectScrollUpButton({
|
|
484
|
-
className,
|
|
485
|
-
...props
|
|
486
|
-
}) {
|
|
487
|
-
return /* @__PURE__ */ jsx8(SelectPrimitive.ScrollUpArrow, {
|
|
488
|
-
"data-slot": "select-scroll-up-button",
|
|
489
|
-
className: cn("bg-popover top-0 z-10 flex w-full cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4", className),
|
|
490
|
-
...props,
|
|
491
|
-
children: /* @__PURE__ */ jsx8(ChevronUpIcon, {})
|
|
492
|
-
});
|
|
493
|
-
}
|
|
494
|
-
function SelectScrollDownButton({
|
|
495
|
-
className,
|
|
496
|
-
...props
|
|
497
|
-
}) {
|
|
498
|
-
return /* @__PURE__ */ jsx8(SelectPrimitive.ScrollDownArrow, {
|
|
499
|
-
"data-slot": "select-scroll-down-button",
|
|
500
|
-
className: cn("bg-popover bottom-0 z-10 flex w-full cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4", className),
|
|
501
|
-
...props,
|
|
502
|
-
children: /* @__PURE__ */ jsx8(ChevronDownIcon, {})
|
|
503
|
-
});
|
|
504
|
-
}
|
|
43
|
+
import { Badge } from "@/components/ui/badge";
|
|
44
|
+
import { Button as Button2 } from "@/components/ui/button";
|
|
45
|
+
import { Card, CardHeader, CardTitle } from "@/components/ui/card";
|
|
46
|
+
import { Checkbox } from "@/components/ui/checkbox";
|
|
47
|
+
import {
|
|
48
|
+
DropdownMenu,
|
|
49
|
+
DropdownMenuContent as PrimitiveDropdownMenuContent,
|
|
50
|
+
DropdownMenuGroup,
|
|
51
|
+
DropdownMenuItem as PrimitiveDropdownMenuItem,
|
|
52
|
+
DropdownMenuLabel as PrimitiveDropdownMenuLabel,
|
|
53
|
+
DropdownMenuSeparator as PrimitiveDropdownMenuSeparator,
|
|
54
|
+
DropdownMenuSub,
|
|
55
|
+
DropdownMenuSubContent as PrimitiveDropdownMenuSubContent,
|
|
56
|
+
DropdownMenuSubTrigger as PrimitiveDropdownMenuSubTrigger,
|
|
57
|
+
DropdownMenuTrigger as PrimitiveDropdownMenuTrigger
|
|
58
|
+
} from "@/components/ui/dropdown-menu";
|
|
59
|
+
import { Input as PrimitiveInput } from "@/components/ui/input";
|
|
60
|
+
import { Field, FieldGroup, FieldLabel } from "@/components/ui/field";
|
|
61
|
+
import {
|
|
62
|
+
Select as Select2,
|
|
63
|
+
SelectContent as PrimitiveSelectContent,
|
|
64
|
+
SelectGroup,
|
|
65
|
+
SelectItem as SelectItem2,
|
|
66
|
+
SelectTrigger as SelectTrigger2,
|
|
67
|
+
SelectValue as SelectValue2
|
|
68
|
+
} from "@/components/ui/select";
|
|
505
69
|
|
|
506
70
|
// ../../src/components/loading/react.tsx
|
|
507
71
|
import { Loader2 } from "lucide-react";
|
|
508
72
|
import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider/react";
|
|
509
73
|
|
|
74
|
+
// ../../src/lib/utils.ts
|
|
75
|
+
import { cn } from "cn";
|
|
76
|
+
|
|
510
77
|
// ../../src/components/loading/classes.ts
|
|
511
78
|
var resolveLoadingClasses = ({
|
|
512
79
|
classes,
|
|
@@ -525,7 +92,7 @@ var labels = {
|
|
|
525
92
|
var loadingLabel = (locale, messages) => messages?.[locale]?.loading ?? messages?.[locale.split("-")[0] ?? locale]?.loading ?? (locale.startsWith("fr") ? labels.fr : labels.en);
|
|
526
93
|
|
|
527
94
|
// ../../src/components/loading/react.tsx
|
|
528
|
-
import { jsx
|
|
95
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
529
96
|
function Loading({
|
|
530
97
|
className,
|
|
531
98
|
classes,
|
|
@@ -536,11 +103,11 @@ function Loading({
|
|
|
536
103
|
}) {
|
|
537
104
|
const locale = useKrakstackLocale(localeOverride);
|
|
538
105
|
const slots = resolveLoadingClasses({ classes, variant, className });
|
|
539
|
-
return /* @__PURE__ */
|
|
106
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
540
107
|
role: "status",
|
|
541
108
|
className: slots.root,
|
|
542
109
|
children: [
|
|
543
|
-
/* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ jsx(Loader2, {
|
|
544
111
|
"aria-hidden": "true",
|
|
545
112
|
className: slots.icon
|
|
546
113
|
}),
|
|
@@ -548,179 +115,23 @@ function Loading({
|
|
|
548
115
|
]
|
|
549
116
|
});
|
|
550
117
|
}
|
|
551
|
-
// ../../src/components/
|
|
552
|
-
import {
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
});
|
|
569
|
-
}
|
|
570
|
-
function MenubarGroup({
|
|
571
|
-
...props
|
|
572
|
-
}) {
|
|
573
|
-
return /* @__PURE__ */ jsx10(DropdownMenuGroup, {
|
|
574
|
-
"data-slot": "menubar-group",
|
|
575
|
-
...props
|
|
576
|
-
});
|
|
577
|
-
}
|
|
578
|
-
function MenubarTrigger({
|
|
579
|
-
className,
|
|
580
|
-
...props
|
|
581
|
-
}) {
|
|
582
|
-
return /* @__PURE__ */ jsx10(DropdownMenuTrigger, {
|
|
583
|
-
"data-slot": "menubar-trigger",
|
|
584
|
-
className: cn("flex items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none hover:bg-muted aria-expanded:bg-muted", className),
|
|
585
|
-
...props
|
|
586
|
-
});
|
|
587
|
-
}
|
|
588
|
-
function MenubarContent({
|
|
589
|
-
className,
|
|
590
|
-
align = "start",
|
|
591
|
-
alignOffset = -4,
|
|
592
|
-
sideOffset = 8,
|
|
593
|
-
...props
|
|
594
|
-
}) {
|
|
595
|
-
return /* @__PURE__ */ jsx10(DropdownMenuContent, {
|
|
596
|
-
"data-slot": "menubar-content",
|
|
597
|
-
align,
|
|
598
|
-
alignOffset,
|
|
599
|
-
sideOffset,
|
|
600
|
-
className: cn("min-w-36 rounded-md bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95", className),
|
|
601
|
-
...props
|
|
602
|
-
});
|
|
603
|
-
}
|
|
604
|
-
function MenubarItem({
|
|
605
|
-
className,
|
|
606
|
-
inset,
|
|
607
|
-
variant = "default",
|
|
608
|
-
...props
|
|
609
|
-
}) {
|
|
610
|
-
return /* @__PURE__ */ jsx10(DropdownMenuItem, {
|
|
611
|
-
"data-slot": "menubar-item",
|
|
612
|
-
"data-inset": inset,
|
|
613
|
-
"data-variant": variant,
|
|
614
|
-
className: cn("group/menubar-item gap-2 rounded-sm px-2 py-1.5 text-sm focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive!", className),
|
|
615
|
-
...props
|
|
616
|
-
});
|
|
617
|
-
}
|
|
618
|
-
function MenubarCheckboxItem({
|
|
619
|
-
className,
|
|
620
|
-
children,
|
|
621
|
-
checked,
|
|
622
|
-
inset,
|
|
623
|
-
...props
|
|
624
|
-
}) {
|
|
625
|
-
return /* @__PURE__ */ jsxs5(MenuPrimitive2.CheckboxItem, {
|
|
626
|
-
"data-slot": "menubar-checkbox-item",
|
|
627
|
-
"data-inset": inset,
|
|
628
|
-
className: cn("relative flex cursor-default items-center gap-2 rounded-md py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", className),
|
|
629
|
-
checked,
|
|
630
|
-
...props,
|
|
631
|
-
children: [
|
|
632
|
-
/* @__PURE__ */ jsx10("span", {
|
|
633
|
-
className: "pointer-events-none absolute left-2 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4",
|
|
634
|
-
children: /* @__PURE__ */ jsx10(MenuPrimitive2.CheckboxItemIndicator, {
|
|
635
|
-
children: /* @__PURE__ */ jsx10(CheckIcon4, {})
|
|
636
|
-
})
|
|
637
|
-
}),
|
|
638
|
-
children
|
|
639
|
-
]
|
|
640
|
-
});
|
|
641
|
-
}
|
|
642
|
-
function MenubarRadioGroup({
|
|
643
|
-
...props
|
|
644
|
-
}) {
|
|
645
|
-
return /* @__PURE__ */ jsx10(DropdownMenuRadioGroup, {
|
|
646
|
-
"data-slot": "menubar-radio-group",
|
|
647
|
-
...props
|
|
648
|
-
});
|
|
649
|
-
}
|
|
650
|
-
function MenubarRadioItem({
|
|
651
|
-
className,
|
|
652
|
-
children,
|
|
653
|
-
inset,
|
|
654
|
-
...props
|
|
655
|
-
}) {
|
|
656
|
-
return /* @__PURE__ */ jsxs5(MenuPrimitive2.RadioItem, {
|
|
657
|
-
"data-slot": "menubar-radio-item",
|
|
658
|
-
"data-inset": inset,
|
|
659
|
-
className: cn("relative flex cursor-default items-center gap-2 rounded-md py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
660
|
-
...props,
|
|
661
|
-
children: [
|
|
662
|
-
/* @__PURE__ */ jsx10("span", {
|
|
663
|
-
className: "pointer-events-none absolute left-2 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4",
|
|
664
|
-
children: /* @__PURE__ */ jsx10(MenuPrimitive2.RadioItemIndicator, {
|
|
665
|
-
children: /* @__PURE__ */ jsx10(CheckIcon4, {})
|
|
666
|
-
})
|
|
667
|
-
}),
|
|
668
|
-
children
|
|
669
|
-
]
|
|
670
|
-
});
|
|
671
|
-
}
|
|
672
|
-
function MenubarLabel({
|
|
673
|
-
className,
|
|
674
|
-
inset,
|
|
675
|
-
...props
|
|
676
|
-
}) {
|
|
677
|
-
return /* @__PURE__ */ jsx10(DropdownMenuLabel, {
|
|
678
|
-
"data-slot": "menubar-label",
|
|
679
|
-
"data-inset": inset,
|
|
680
|
-
className: cn("px-2 py-1.5 text-sm font-medium data-inset:pl-8", className),
|
|
681
|
-
...props
|
|
682
|
-
});
|
|
683
|
-
}
|
|
684
|
-
function MenubarSeparator({
|
|
685
|
-
className,
|
|
686
|
-
...props
|
|
687
|
-
}) {
|
|
688
|
-
return /* @__PURE__ */ jsx10(DropdownMenuSeparator, {
|
|
689
|
-
"data-slot": "menubar-separator",
|
|
690
|
-
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
691
|
-
...props
|
|
692
|
-
});
|
|
693
|
-
}
|
|
694
|
-
function MenubarSub({
|
|
695
|
-
...props
|
|
696
|
-
}) {
|
|
697
|
-
return /* @__PURE__ */ jsx10(DropdownMenuSub, {
|
|
698
|
-
"data-slot": "menubar-sub",
|
|
699
|
-
...props
|
|
700
|
-
});
|
|
701
|
-
}
|
|
702
|
-
function MenubarSubTrigger({
|
|
703
|
-
className,
|
|
704
|
-
inset,
|
|
705
|
-
...props
|
|
706
|
-
}) {
|
|
707
|
-
return /* @__PURE__ */ jsx10(DropdownMenuSubTrigger, {
|
|
708
|
-
"data-slot": "menubar-sub-trigger",
|
|
709
|
-
"data-inset": inset,
|
|
710
|
-
className: cn("gap-2 rounded-sm px-2 py-1.5 text-sm focus:bg-accent focus:text-accent-foreground data-inset:pl-8 data-open:bg-accent data-open:text-accent-foreground [&_svg:not([class*='size-'])]:size-4", className),
|
|
711
|
-
...props
|
|
712
|
-
});
|
|
713
|
-
}
|
|
714
|
-
function MenubarSubContent({
|
|
715
|
-
className,
|
|
716
|
-
...props
|
|
717
|
-
}) {
|
|
718
|
-
return /* @__PURE__ */ jsx10(DropdownMenuSubContent, {
|
|
719
|
-
"data-slot": "menubar-sub-content",
|
|
720
|
-
className: cn("min-w-32 rounded-md bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
721
|
-
...props
|
|
722
|
-
});
|
|
723
|
-
}
|
|
118
|
+
// ../../src/components/data-table/react.tsx
|
|
119
|
+
import {
|
|
120
|
+
Menubar as PrimitiveMenubar,
|
|
121
|
+
MenubarCheckboxItem as PrimitiveMenubarCheckboxItem,
|
|
122
|
+
MenubarContent as PrimitiveMenubarContent,
|
|
123
|
+
MenubarGroup,
|
|
124
|
+
MenubarItem as PrimitiveMenubarItem,
|
|
125
|
+
MenubarLabel as PrimitiveMenubarLabel,
|
|
126
|
+
MenubarMenu,
|
|
127
|
+
MenubarRadioGroup,
|
|
128
|
+
MenubarRadioItem as PrimitiveMenubarRadioItem,
|
|
129
|
+
MenubarSeparator as PrimitiveMenubarSeparator,
|
|
130
|
+
MenubarSub,
|
|
131
|
+
MenubarSubContent as PrimitiveMenubarSubContent,
|
|
132
|
+
MenubarSubTrigger as PrimitiveMenubarSubTrigger,
|
|
133
|
+
MenubarTrigger as PrimitiveMenubarTrigger
|
|
134
|
+
} from "@/components/ui/menubar";
|
|
724
135
|
|
|
725
136
|
// ../../src/components/pagination/react.tsx
|
|
726
137
|
import {
|
|
@@ -730,6 +141,15 @@ import {
|
|
|
730
141
|
ChevronsRight
|
|
731
142
|
} from "lucide-react";
|
|
732
143
|
import { useId } from "react";
|
|
144
|
+
import { Button } from "@/components/ui/button";
|
|
145
|
+
import { Label } from "@/components/ui/label";
|
|
146
|
+
import {
|
|
147
|
+
Select,
|
|
148
|
+
SelectContent,
|
|
149
|
+
SelectItem,
|
|
150
|
+
SelectTrigger,
|
|
151
|
+
SelectValue
|
|
152
|
+
} from "@/components/ui/select";
|
|
733
153
|
import { useKrakstackLocale as useKrakstackLocale2 } from "@krak-stack/registry/krakstack-provider/react";
|
|
734
154
|
|
|
735
155
|
// ../../src/components/pagination/classes.ts
|
|
@@ -856,7 +276,7 @@ var paginationNavigation = (page, pageCount) => ({
|
|
|
856
276
|
});
|
|
857
277
|
|
|
858
278
|
// ../../src/components/pagination/react.tsx
|
|
859
|
-
import { jsx as
|
|
279
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
860
280
|
function Pagination({
|
|
861
281
|
classes: classOverrides,
|
|
862
282
|
className,
|
|
@@ -880,33 +300,33 @@ function Pagination({
|
|
|
880
300
|
const pageSizeId = useId();
|
|
881
301
|
const navigation = paginationNavigation(page, pageCount);
|
|
882
302
|
const pageLabel = paginationPageLabel(page, pageCount, labels.pageOf);
|
|
883
|
-
return /* @__PURE__ */
|
|
303
|
+
return /* @__PURE__ */ jsxs2("div", {
|
|
884
304
|
"data-slot": "pagination",
|
|
885
305
|
className: cn(paginationClasses.root, compact && paginationClasses.compactRoot, className),
|
|
886
306
|
children: [
|
|
887
|
-
showResults ? /* @__PURE__ */
|
|
307
|
+
showResults ? /* @__PURE__ */ jsxs2("div", {
|
|
888
308
|
className: paginationClasses.summary,
|
|
889
309
|
children: [
|
|
890
|
-
/* @__PURE__ */
|
|
310
|
+
/* @__PURE__ */ jsx2("span", {
|
|
891
311
|
children: labels.results(totalRows)
|
|
892
312
|
}),
|
|
893
|
-
selectedRows > 0 ? /* @__PURE__ */
|
|
313
|
+
selectedRows > 0 ? /* @__PURE__ */ jsx2("span", {
|
|
894
314
|
children: labels.selectedOf(selectedRows, totalRows)
|
|
895
315
|
}) : null
|
|
896
316
|
]
|
|
897
317
|
}) : null,
|
|
898
|
-
/* @__PURE__ */
|
|
318
|
+
/* @__PURE__ */ jsxs2("div", {
|
|
899
319
|
className: cn(paginationClasses.controls, compact && paginationClasses.compactControls),
|
|
900
320
|
children: [
|
|
901
|
-
/* @__PURE__ */
|
|
321
|
+
/* @__PURE__ */ jsxs2("div", {
|
|
902
322
|
className: paginationClasses.controlGroup,
|
|
903
323
|
children: [
|
|
904
|
-
/* @__PURE__ */
|
|
324
|
+
/* @__PURE__ */ jsx2(Label, {
|
|
905
325
|
htmlFor: pageSizeId,
|
|
906
326
|
className: cn("hidden text-sm sm:block", compact && "block"),
|
|
907
327
|
children: labels.pageSize
|
|
908
328
|
}),
|
|
909
|
-
/* @__PURE__ */
|
|
329
|
+
/* @__PURE__ */ jsxs2(Select, {
|
|
910
330
|
items: pageSizes.map((size) => ({
|
|
911
331
|
label: size.toString(),
|
|
912
332
|
value: size.toString()
|
|
@@ -914,17 +334,17 @@ function Pagination({
|
|
|
914
334
|
value: `${pageSize}`,
|
|
915
335
|
onValueChange: (value) => onPageSizeChange(Number(value)),
|
|
916
336
|
children: [
|
|
917
|
-
/* @__PURE__ */
|
|
337
|
+
/* @__PURE__ */ jsx2(SelectTrigger, {
|
|
918
338
|
className: "h-8 w-[70px]",
|
|
919
339
|
id: pageSizeId,
|
|
920
|
-
children: /* @__PURE__ */
|
|
340
|
+
children: /* @__PURE__ */ jsx2(SelectValue, {
|
|
921
341
|
placeholder: pageSize
|
|
922
342
|
})
|
|
923
343
|
}),
|
|
924
|
-
/* @__PURE__ */
|
|
344
|
+
/* @__PURE__ */ jsx2(SelectContent, {
|
|
925
345
|
side: "top",
|
|
926
346
|
className: pageSizeContentClassName,
|
|
927
|
-
children: pageSizes.map((size) => /* @__PURE__ */
|
|
347
|
+
children: pageSizes.map((size) => /* @__PURE__ */ jsx2(SelectItem, {
|
|
928
348
|
value: `${size}`,
|
|
929
349
|
children: size
|
|
930
350
|
}, size))
|
|
@@ -933,66 +353,66 @@ function Pagination({
|
|
|
933
353
|
})
|
|
934
354
|
]
|
|
935
355
|
}),
|
|
936
|
-
/* @__PURE__ */
|
|
356
|
+
/* @__PURE__ */ jsxs2("div", {
|
|
937
357
|
className: paginationClasses.controlGroup,
|
|
938
358
|
children: [
|
|
939
|
-
pageLabel !== undefined && /* @__PURE__ */
|
|
359
|
+
pageLabel !== undefined && /* @__PURE__ */ jsx2("div", {
|
|
940
360
|
className: "flex items-center justify-center text-sm font-medium sm:block",
|
|
941
361
|
children: pageLabel
|
|
942
362
|
}),
|
|
943
|
-
/* @__PURE__ */
|
|
363
|
+
/* @__PURE__ */ jsxs2("div", {
|
|
944
364
|
className: paginationClasses.navigation,
|
|
945
365
|
children: [
|
|
946
|
-
/* @__PURE__ */
|
|
366
|
+
/* @__PURE__ */ jsxs2(Button, {
|
|
947
367
|
className: cn("hidden h-8 w-8 p-0 lg:flex", compact && "!hidden"),
|
|
948
368
|
disabled: navigation.goToFirstPage.disabled,
|
|
949
369
|
onClick: () => onPageChange(navigation.goToFirstPage.page),
|
|
950
370
|
type: "button",
|
|
951
371
|
children: [
|
|
952
|
-
/* @__PURE__ */
|
|
372
|
+
/* @__PURE__ */ jsx2("span", {
|
|
953
373
|
className: "sr-only",
|
|
954
374
|
children: labels.goToFirstPage
|
|
955
375
|
}),
|
|
956
|
-
/* @__PURE__ */
|
|
376
|
+
/* @__PURE__ */ jsx2(ChevronsLeft, {})
|
|
957
377
|
]
|
|
958
378
|
}),
|
|
959
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ jsxs2(Button, {
|
|
960
380
|
className: "h-8 w-8 p-0",
|
|
961
381
|
disabled: navigation.goToPreviousPage.disabled,
|
|
962
382
|
onClick: () => onPageChange(navigation.goToPreviousPage.page),
|
|
963
383
|
type: "button",
|
|
964
384
|
children: [
|
|
965
|
-
/* @__PURE__ */
|
|
385
|
+
/* @__PURE__ */ jsx2("span", {
|
|
966
386
|
className: "sr-only",
|
|
967
387
|
children: labels.goToPreviousPage
|
|
968
388
|
}),
|
|
969
|
-
/* @__PURE__ */
|
|
389
|
+
/* @__PURE__ */ jsx2(ChevronLeft, {})
|
|
970
390
|
]
|
|
971
391
|
}),
|
|
972
|
-
/* @__PURE__ */
|
|
392
|
+
/* @__PURE__ */ jsxs2(Button, {
|
|
973
393
|
className: "h-8 w-8 p-0",
|
|
974
394
|
disabled: navigation.goToNextPage.disabled,
|
|
975
395
|
onClick: () => onPageChange(navigation.goToNextPage.page),
|
|
976
396
|
type: "button",
|
|
977
397
|
children: [
|
|
978
|
-
/* @__PURE__ */
|
|
398
|
+
/* @__PURE__ */ jsx2("span", {
|
|
979
399
|
className: "sr-only",
|
|
980
400
|
children: labels.goToNextPage
|
|
981
401
|
}),
|
|
982
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ jsx2(ChevronRight, {})
|
|
983
403
|
]
|
|
984
404
|
}),
|
|
985
|
-
/* @__PURE__ */
|
|
405
|
+
/* @__PURE__ */ jsxs2(Button, {
|
|
986
406
|
className: cn("hidden h-8 w-8 p-0 lg:flex", compact && "!hidden"),
|
|
987
407
|
disabled: navigation.goToLastPage.disabled,
|
|
988
408
|
onClick: () => onPageChange(navigation.goToLastPage.page),
|
|
989
409
|
type: "button",
|
|
990
410
|
children: [
|
|
991
|
-
/* @__PURE__ */
|
|
411
|
+
/* @__PURE__ */ jsx2("span", {
|
|
992
412
|
className: "sr-only",
|
|
993
413
|
children: labels.goToLastPage
|
|
994
414
|
}),
|
|
995
|
-
/* @__PURE__ */
|
|
415
|
+
/* @__PURE__ */ jsx2(ChevronsRight, {})
|
|
996
416
|
]
|
|
997
417
|
})
|
|
998
418
|
]
|
|
@@ -1004,152 +424,22 @@ function Pagination({
|
|
|
1004
424
|
]
|
|
1005
425
|
});
|
|
1006
426
|
}
|
|
1007
|
-
// ../../src/components/
|
|
1008
|
-
import { ScrollArea
|
|
1009
|
-
import {
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
children
|
|
1024
|
-
}),
|
|
1025
|
-
/* @__PURE__ */ jsx12(ScrollBar, {}),
|
|
1026
|
-
/* @__PURE__ */ jsx12(ScrollAreaPrimitive.Corner, {})
|
|
1027
|
-
]
|
|
1028
|
-
});
|
|
1029
|
-
}
|
|
1030
|
-
function ScrollBar({
|
|
1031
|
-
className,
|
|
1032
|
-
orientation = "vertical",
|
|
1033
|
-
...props
|
|
1034
|
-
}) {
|
|
1035
|
-
return /* @__PURE__ */ jsx12(ScrollAreaPrimitive.Scrollbar, {
|
|
1036
|
-
"data-slot": "scroll-area-scrollbar",
|
|
1037
|
-
"data-orientation": orientation,
|
|
1038
|
-
orientation,
|
|
1039
|
-
className: cn("flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent", className),
|
|
1040
|
-
...props,
|
|
1041
|
-
children: /* @__PURE__ */ jsx12(ScrollAreaPrimitive.Thumb, {
|
|
1042
|
-
"data-slot": "scroll-area-thumb",
|
|
1043
|
-
className: "bg-border relative flex-1 rounded-full"
|
|
1044
|
-
})
|
|
1045
|
-
});
|
|
1046
|
-
}
|
|
1047
|
-
|
|
1048
|
-
// ../../src/components/ui/table.tsx
|
|
1049
|
-
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1050
|
-
function Table({ className, ...props }) {
|
|
1051
|
-
return /* @__PURE__ */ jsx13("div", {
|
|
1052
|
-
"data-slot": "table-container",
|
|
1053
|
-
className: "relative w-full overflow-x-auto",
|
|
1054
|
-
children: /* @__PURE__ */ jsx13("table", {
|
|
1055
|
-
"data-slot": "table",
|
|
1056
|
-
className: cn("w-full caption-bottom text-sm", className),
|
|
1057
|
-
...props
|
|
1058
|
-
})
|
|
1059
|
-
});
|
|
1060
|
-
}
|
|
1061
|
-
function TableHeader({ className, ...props }) {
|
|
1062
|
-
return /* @__PURE__ */ jsx13("thead", {
|
|
1063
|
-
"data-slot": "table-header",
|
|
1064
|
-
className: cn("[&_tr]:border-b", className),
|
|
1065
|
-
...props
|
|
1066
|
-
});
|
|
1067
|
-
}
|
|
1068
|
-
function TableBody({ className, ...props }) {
|
|
1069
|
-
return /* @__PURE__ */ jsx13("tbody", {
|
|
1070
|
-
"data-slot": "table-body",
|
|
1071
|
-
className: cn("[&_tr:last-child]:border-0", className),
|
|
1072
|
-
...props
|
|
1073
|
-
});
|
|
1074
|
-
}
|
|
1075
|
-
function TableRow({ className, ...props }) {
|
|
1076
|
-
return /* @__PURE__ */ jsx13("tr", {
|
|
1077
|
-
"data-slot": "table-row",
|
|
1078
|
-
className: cn("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted", className),
|
|
1079
|
-
...props
|
|
1080
|
-
});
|
|
1081
|
-
}
|
|
1082
|
-
function TableHead({ className, ...props }) {
|
|
1083
|
-
return /* @__PURE__ */ jsx13("th", {
|
|
1084
|
-
"data-slot": "table-head",
|
|
1085
|
-
className: cn("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0", className),
|
|
1086
|
-
...props
|
|
1087
|
-
});
|
|
1088
|
-
}
|
|
1089
|
-
function TableCell({ className, ...props }) {
|
|
1090
|
-
return /* @__PURE__ */ jsx13("td", {
|
|
1091
|
-
"data-slot": "table-cell",
|
|
1092
|
-
className: cn("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0", className),
|
|
1093
|
-
...props
|
|
1094
|
-
});
|
|
1095
|
-
}
|
|
1096
|
-
|
|
1097
|
-
// ../../src/components/ui/tooltip.tsx
|
|
1098
|
-
import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip";
|
|
1099
|
-
import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1100
|
-
"use client";
|
|
1101
|
-
function TooltipProvider({
|
|
1102
|
-
delay = 0,
|
|
1103
|
-
...props
|
|
1104
|
-
}) {
|
|
1105
|
-
return /* @__PURE__ */ jsx14(TooltipPrimitive.Provider, {
|
|
1106
|
-
"data-slot": "tooltip-provider",
|
|
1107
|
-
delay,
|
|
1108
|
-
...props
|
|
1109
|
-
});
|
|
1110
|
-
}
|
|
1111
|
-
function Tooltip({ ...props }) {
|
|
1112
|
-
return /* @__PURE__ */ jsx14(TooltipPrimitive.Root, {
|
|
1113
|
-
"data-slot": "tooltip",
|
|
1114
|
-
...props
|
|
1115
|
-
});
|
|
1116
|
-
}
|
|
1117
|
-
function TooltipTrigger({ ...props }) {
|
|
1118
|
-
return /* @__PURE__ */ jsx14(TooltipPrimitive.Trigger, {
|
|
1119
|
-
"data-slot": "tooltip-trigger",
|
|
1120
|
-
...props
|
|
1121
|
-
});
|
|
1122
|
-
}
|
|
1123
|
-
function TooltipContent({
|
|
1124
|
-
className,
|
|
1125
|
-
side = "top",
|
|
1126
|
-
sideOffset = 4,
|
|
1127
|
-
align = "center",
|
|
1128
|
-
alignOffset = 0,
|
|
1129
|
-
children,
|
|
1130
|
-
...props
|
|
1131
|
-
}) {
|
|
1132
|
-
return /* @__PURE__ */ jsx14(TooltipPrimitive.Portal, {
|
|
1133
|
-
children: /* @__PURE__ */ jsx14(TooltipPrimitive.Positioner, {
|
|
1134
|
-
align,
|
|
1135
|
-
alignOffset,
|
|
1136
|
-
side,
|
|
1137
|
-
sideOffset,
|
|
1138
|
-
className: "isolate z-50",
|
|
1139
|
-
children: /* @__PURE__ */ jsxs8(TooltipPrimitive.Popup, {
|
|
1140
|
-
"data-slot": "tooltip-content",
|
|
1141
|
-
className: cn("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
1142
|
-
...props,
|
|
1143
|
-
children: [
|
|
1144
|
-
children,
|
|
1145
|
-
/* @__PURE__ */ jsx14(TooltipPrimitive.Arrow, {
|
|
1146
|
-
className: "bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"
|
|
1147
|
-
})
|
|
1148
|
-
]
|
|
1149
|
-
})
|
|
1150
|
-
})
|
|
1151
|
-
});
|
|
1152
|
-
}
|
|
427
|
+
// ../../src/components/data-table/react.tsx
|
|
428
|
+
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
|
|
429
|
+
import {
|
|
430
|
+
Table as PrimitiveTable,
|
|
431
|
+
TableBody as PrimitiveTableBody,
|
|
432
|
+
TableCell as PrimitiveTableCell,
|
|
433
|
+
TableHead as PrimitiveTableHead,
|
|
434
|
+
TableHeader as PrimitiveTableHeader,
|
|
435
|
+
TableRow as PrimitiveTableRow
|
|
436
|
+
} from "@/components/ui/table";
|
|
437
|
+
import {
|
|
438
|
+
Tooltip,
|
|
439
|
+
TooltipContent as PrimitiveTooltipContent,
|
|
440
|
+
TooltipProvider,
|
|
441
|
+
TooltipTrigger
|
|
442
|
+
} from "@/components/ui/tooltip";
|
|
1153
443
|
|
|
1154
444
|
// ../../src/lib/query.ts
|
|
1155
445
|
import {
|
|
@@ -2618,14 +1908,14 @@ var dataTableBehaviours = {
|
|
|
2618
1908
|
};
|
|
2619
1909
|
|
|
2620
1910
|
// ../../src/components/data-table/react.tsx
|
|
2621
|
-
import { jsx as
|
|
1911
|
+
import { jsx as jsx3, jsxs as jsxs3, Fragment } from "react/jsx-runtime";
|
|
2622
1912
|
var DataTableStylesContext = createContext(undefined);
|
|
2623
1913
|
var DataTableSlotClassesContext = createContext(resolveTableClasses());
|
|
2624
1914
|
var styledTablePart = (Part, slot, style) => {
|
|
2625
1915
|
const StyledPart = (props) => {
|
|
2626
1916
|
const styles = useContext(DataTableStylesContext);
|
|
2627
1917
|
const className = cn(props.className, style(styles));
|
|
2628
|
-
return /* @__PURE__ */
|
|
1918
|
+
return /* @__PURE__ */ jsx3(Part, {
|
|
2629
1919
|
"data-table-slot": slot,
|
|
2630
1920
|
...props,
|
|
2631
1921
|
className
|
|
@@ -2633,32 +1923,32 @@ var styledTablePart = (Part, slot, style) => {
|
|
|
2633
1923
|
};
|
|
2634
1924
|
return StyledPart;
|
|
2635
1925
|
};
|
|
2636
|
-
var
|
|
2637
|
-
var
|
|
2638
|
-
var
|
|
2639
|
-
var
|
|
2640
|
-
var
|
|
2641
|
-
var
|
|
2642
|
-
var
|
|
2643
|
-
var
|
|
2644
|
-
var
|
|
2645
|
-
var
|
|
2646
|
-
var
|
|
2647
|
-
var
|
|
2648
|
-
var
|
|
2649
|
-
var
|
|
2650
|
-
var
|
|
2651
|
-
var
|
|
2652
|
-
var
|
|
2653
|
-
var
|
|
2654
|
-
var
|
|
2655
|
-
var
|
|
2656
|
-
var
|
|
2657
|
-
var
|
|
2658
|
-
var
|
|
2659
|
-
var
|
|
2660
|
-
var SelectContent2 = styledTablePart(
|
|
2661
|
-
var
|
|
1926
|
+
var Table = styledTablePart(PrimitiveTable, "table", (s) => s?.table?.content);
|
|
1927
|
+
var TableHeader = styledTablePart(PrimitiveTableHeader, "header", (s) => s?.table?.header);
|
|
1928
|
+
var TableBody = styledTablePart(PrimitiveTableBody, "body", (s) => s?.table?.body);
|
|
1929
|
+
var TableRow = styledTablePart(PrimitiveTableRow, "row", (s) => s?.table?.row);
|
|
1930
|
+
var TableHead = styledTablePart(PrimitiveTableHead, "head", (s) => s?.table?.head);
|
|
1931
|
+
var TableCell = styledTablePart(PrimitiveTableCell, "cell", (s) => s?.table?.cell);
|
|
1932
|
+
var Input = styledTablePart(PrimitiveInput, "input", (s) => s?.toolbar?.search);
|
|
1933
|
+
var Menubar = styledTablePart(PrimitiveMenubar, "menubar", (s) => s?.toolbar?.content);
|
|
1934
|
+
var MenubarTrigger = styledTablePart(PrimitiveMenubarTrigger, "menu-trigger", (s) => s?.toolbar?.trigger);
|
|
1935
|
+
var MenubarContent = styledTablePart(PrimitiveMenubarContent, "menu", (s) => s?.menu?.content);
|
|
1936
|
+
var MenubarSubContent = styledTablePart(PrimitiveMenubarSubContent, "submenu", (s) => s?.menu?.subContent);
|
|
1937
|
+
var MenubarSubTrigger = styledTablePart(PrimitiveMenubarSubTrigger, "submenu-trigger", (s) => s?.menu?.subTrigger);
|
|
1938
|
+
var MenubarItem = styledTablePart(PrimitiveMenubarItem, "menu-item", (s) => s?.menu?.item);
|
|
1939
|
+
var MenubarCheckboxItem = styledTablePart(PrimitiveMenubarCheckboxItem, "menu-checkbox-item", (s) => s?.menu?.item);
|
|
1940
|
+
var MenubarRadioItem = styledTablePart(PrimitiveMenubarRadioItem, "menu-radio-item", (s) => s?.menu?.item);
|
|
1941
|
+
var MenubarLabel = styledTablePart(PrimitiveMenubarLabel, "menu-label", (s) => s?.menu?.label);
|
|
1942
|
+
var MenubarSeparator = styledTablePart(PrimitiveMenubarSeparator, "menu-separator", (s) => s?.menu?.separator);
|
|
1943
|
+
var DropdownMenuTrigger = styledTablePart(PrimitiveDropdownMenuTrigger, "row-menu-trigger", (s) => s?.toolbar?.trigger);
|
|
1944
|
+
var DropdownMenuContent = styledTablePart(PrimitiveDropdownMenuContent, "row-menu", (s) => s?.menu?.content);
|
|
1945
|
+
var DropdownMenuSubContent = styledTablePart(PrimitiveDropdownMenuSubContent, "row-submenu", (s) => s?.menu?.subContent);
|
|
1946
|
+
var DropdownMenuSubTrigger = styledTablePart(PrimitiveDropdownMenuSubTrigger, "row-submenu-trigger", (s) => s?.menu?.subTrigger);
|
|
1947
|
+
var DropdownMenuItem = styledTablePart(PrimitiveDropdownMenuItem, "row-menu-item", (s) => s?.menu?.item);
|
|
1948
|
+
var DropdownMenuLabel = styledTablePart(PrimitiveDropdownMenuLabel, "row-menu-label", (s) => s?.menu?.label);
|
|
1949
|
+
var DropdownMenuSeparator = styledTablePart(PrimitiveDropdownMenuSeparator, "row-menu-separator", (s) => s?.menu?.separator);
|
|
1950
|
+
var SelectContent2 = styledTablePart(PrimitiveSelectContent, "select-popup", (s) => s?.popup?.select);
|
|
1951
|
+
var TooltipContent = styledTablePart(PrimitiveTooltipContent, "tooltip", (s) => s?.popup?.tooltip);
|
|
2662
1952
|
var DataTableReferenceCell = ({
|
|
2663
1953
|
item,
|
|
2664
1954
|
emptyLabel = "—",
|
|
@@ -2669,33 +1959,33 @@ var DataTableReferenceCell = ({
|
|
|
2669
1959
|
if (!item)
|
|
2670
1960
|
return emptyLabel;
|
|
2671
1961
|
const initials = tableInitials(item.label);
|
|
2672
|
-
return /* @__PURE__ */
|
|
1962
|
+
return /* @__PURE__ */ jsxs3("div", {
|
|
2673
1963
|
className: tableClasses.reference,
|
|
2674
1964
|
children: [
|
|
2675
|
-
/* @__PURE__ */
|
|
1965
|
+
/* @__PURE__ */ jsx3("div", {
|
|
2676
1966
|
className: cn(tableClasses.referenceAvatar, imageVariant === "circle" ? "rounded-full" : "rounded-md", item.iconClassName),
|
|
2677
|
-
children: item.icon ? /* @__PURE__ */
|
|
1967
|
+
children: item.icon ? /* @__PURE__ */ jsx3("span", {
|
|
2678
1968
|
"aria-hidden": "true",
|
|
2679
1969
|
className: "[&_svg]:size-4",
|
|
2680
1970
|
children: item.icon
|
|
2681
|
-
}) : item.imageSrc && item.imageSrc !== failedImage ? /* @__PURE__ */
|
|
1971
|
+
}) : item.imageSrc && item.imageSrc !== failedImage ? /* @__PURE__ */ jsx3("img", {
|
|
2682
1972
|
src: item.imageSrc,
|
|
2683
1973
|
alt: item.label,
|
|
2684
1974
|
className: "size-full object-cover",
|
|
2685
1975
|
onError: () => setFailedImage(item.imageSrc ?? undefined)
|
|
2686
|
-
}) : /* @__PURE__ */
|
|
1976
|
+
}) : /* @__PURE__ */ jsx3("span", {
|
|
2687
1977
|
"aria-hidden": "true",
|
|
2688
1978
|
children: initials
|
|
2689
1979
|
})
|
|
2690
1980
|
}),
|
|
2691
|
-
/* @__PURE__ */
|
|
1981
|
+
/* @__PURE__ */ jsxs3("div", {
|
|
2692
1982
|
className: tableClasses.referenceText,
|
|
2693
1983
|
children: [
|
|
2694
|
-
/* @__PURE__ */
|
|
1984
|
+
/* @__PURE__ */ jsx3("span", {
|
|
2695
1985
|
className: tableClasses.referenceName,
|
|
2696
1986
|
children: item.label
|
|
2697
1987
|
}),
|
|
2698
|
-
item.description ? /* @__PURE__ */
|
|
1988
|
+
item.description ? /* @__PURE__ */ jsx3("span", {
|
|
2699
1989
|
className: tableClasses.referenceDescription,
|
|
2700
1990
|
children: item.description
|
|
2701
1991
|
}) : null
|
|
@@ -3071,14 +2361,14 @@ var renderCell = (row, column, locale = "en", labels = dataTableMessages(locale)
|
|
|
3071
2361
|
};
|
|
3072
2362
|
const CellRenderer = column.colDef.cellRenderer;
|
|
3073
2363
|
if (CellRenderer)
|
|
3074
|
-
return /* @__PURE__ */
|
|
2364
|
+
return /* @__PURE__ */ jsx3(CellRenderer, {
|
|
3075
2365
|
...params
|
|
3076
2366
|
});
|
|
3077
2367
|
const colDef = column.colDef;
|
|
3078
2368
|
if (colDef.type === "reference") {
|
|
3079
2369
|
if (colDef.valueFormatter)
|
|
3080
2370
|
return colDef.valueFormatter(params);
|
|
3081
|
-
return /* @__PURE__ */
|
|
2371
|
+
return /* @__PURE__ */ jsx3(DataTableReferenceCell, {
|
|
3082
2372
|
item: colDef.typeOptions.getItem(row.data),
|
|
3083
2373
|
emptyLabel: colDef.typeOptions.emptyLabel,
|
|
3084
2374
|
...colDef.typeOptions.imageVariant ? { imageVariant: colDef.typeOptions.imageVariant } : {}
|
|
@@ -3088,7 +2378,7 @@ var renderCell = (row, column, locale = "en", labels = dataTableMessages(locale)
|
|
|
3088
2378
|
if (colDef.valueFormatter)
|
|
3089
2379
|
return colDef.valueFormatter(params);
|
|
3090
2380
|
const number = Option4.getOrUndefined(decodeNumberValue(value));
|
|
3091
|
-
return /* @__PURE__ */
|
|
2381
|
+
return /* @__PURE__ */ jsx3("span", {
|
|
3092
2382
|
className: "block text-left tabular-nums",
|
|
3093
2383
|
children: number === undefined ? colDef.typeOptions?.emptyLabel ?? "—" : formatNumberValue(number, colDef.typeOptions, locale)
|
|
3094
2384
|
});
|
|
@@ -3100,12 +2390,12 @@ var renderCell = (row, column, locale = "en", labels = dataTableMessages(locale)
|
|
|
3100
2390
|
if (boolean === undefined)
|
|
3101
2391
|
return colDef.typeOptions?.emptyLabel ?? "—";
|
|
3102
2392
|
const options = colDef.typeOptions;
|
|
3103
|
-
return /* @__PURE__ */
|
|
2393
|
+
return /* @__PURE__ */ jsx3("label", {
|
|
3104
2394
|
"data-slot": "data-table-boolean-cell",
|
|
3105
2395
|
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"),
|
|
3106
2396
|
onClick: (event) => event.stopPropagation(),
|
|
3107
2397
|
onPointerDown: (event) => event.stopPropagation(),
|
|
3108
|
-
children: /* @__PURE__ */
|
|
2398
|
+
children: /* @__PURE__ */ jsx3(Checkbox, {
|
|
3109
2399
|
"aria-label": options?.getAriaLabel?.(row.data) ?? columnLabel(column),
|
|
3110
2400
|
className: "focus-visible:ring-0 focus-visible:outline-none",
|
|
3111
2401
|
checked: boolean,
|
|
@@ -3119,7 +2409,7 @@ var renderCell = (row, column, locale = "en", labels = dataTableMessages(locale)
|
|
|
3119
2409
|
if (colDef.valueFormatter)
|
|
3120
2410
|
return colDef.valueFormatter(params);
|
|
3121
2411
|
const date = resolveDate(value, colDef.type);
|
|
3122
|
-
return date ? /* @__PURE__ */
|
|
2412
|
+
return date ? /* @__PURE__ */ jsx3("time", {
|
|
3123
2413
|
dateTime: dateIsoValue(date),
|
|
3124
2414
|
children: formatDateValue(date, colDef, locale)
|
|
3125
2415
|
}) : colDef.typeOptions?.emptyLabel ?? "—";
|
|
@@ -3133,7 +2423,7 @@ var renderCell = (row, column, locale = "en", labels = dataTableMessages(locale)
|
|
|
3133
2423
|
disabled: (item) => action.disabled?.({ item, row: row.data }) ?? false
|
|
3134
2424
|
}));
|
|
3135
2425
|
if (config.getOptions) {
|
|
3136
|
-
return /* @__PURE__ */
|
|
2426
|
+
return /* @__PURE__ */ jsx3(DataTableListCell, {
|
|
3137
2427
|
...config,
|
|
3138
2428
|
itemActions,
|
|
3139
2429
|
onItemClick: config.onItemClick ? (item) => config.onItemClick?.({ item, row: row.data }) : undefined,
|
|
@@ -3146,7 +2436,7 @@ var renderCell = (row, column, locale = "en", labels = dataTableMessages(locale)
|
|
|
3146
2436
|
onRemove: config.onRemove ? (value) => config.onRemove?.({ value, row: row.data }) : undefined
|
|
3147
2437
|
});
|
|
3148
2438
|
}
|
|
3149
|
-
return /* @__PURE__ */
|
|
2439
|
+
return /* @__PURE__ */ jsx3(DataTableListCell, {
|
|
3150
2440
|
...config,
|
|
3151
2441
|
itemActions,
|
|
3152
2442
|
onItemClick: config.onItemClick ? (item) => config.onItemClick?.({ item, row: row.data }) : undefined,
|
|
@@ -3181,33 +2471,33 @@ var DataTableRowActions = ({
|
|
|
3181
2471
|
const visible = actions.filter((action) => !action.visible || action.visible(row));
|
|
3182
2472
|
if (!visible.length)
|
|
3183
2473
|
return null;
|
|
3184
|
-
return /* @__PURE__ */
|
|
2474
|
+
return /* @__PURE__ */ jsxs3(DropdownMenu, {
|
|
3185
2475
|
children: [
|
|
3186
|
-
/* @__PURE__ */
|
|
2476
|
+
/* @__PURE__ */ jsx3(DropdownMenuTrigger, {
|
|
3187
2477
|
onClick: (event) => event.stopPropagation(),
|
|
3188
|
-
render: /* @__PURE__ */
|
|
2478
|
+
render: /* @__PURE__ */ jsxs3(Button2, {
|
|
3189
2479
|
className: cn(tableClasses.actionTrigger, "[&_svg:not([class*='size-'])]:size-4"),
|
|
3190
2480
|
size: "icon",
|
|
3191
2481
|
variant: "ghost",
|
|
3192
2482
|
children: [
|
|
3193
|
-
/* @__PURE__ */
|
|
2483
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3194
2484
|
className: "sr-only",
|
|
3195
2485
|
children: title
|
|
3196
2486
|
}),
|
|
3197
|
-
/* @__PURE__ */
|
|
2487
|
+
/* @__PURE__ */ jsx3(MoreHorizontal, {})
|
|
3198
2488
|
]
|
|
3199
2489
|
})
|
|
3200
2490
|
}),
|
|
3201
|
-
/* @__PURE__ */
|
|
2491
|
+
/* @__PURE__ */ jsx3(DropdownMenuContent, {
|
|
3202
2492
|
align: "end",
|
|
3203
2493
|
className: "w-max",
|
|
3204
|
-
children: /* @__PURE__ */
|
|
2494
|
+
children: /* @__PURE__ */ jsxs3(DropdownMenuGroup, {
|
|
3205
2495
|
children: [
|
|
3206
|
-
/* @__PURE__ */
|
|
2496
|
+
/* @__PURE__ */ jsx3(DropdownMenuLabel, {
|
|
3207
2497
|
children: title
|
|
3208
2498
|
}),
|
|
3209
|
-
/* @__PURE__ */
|
|
3210
|
-
visible.map((action) => /* @__PURE__ */
|
|
2499
|
+
/* @__PURE__ */ jsx3(DropdownMenuSeparator, {}),
|
|
2500
|
+
visible.map((action) => /* @__PURE__ */ jsxs3(DropdownMenuItem, {
|
|
3211
2501
|
onClick: (event) => {
|
|
3212
2502
|
event.stopPropagation();
|
|
3213
2503
|
action.onClick(row);
|
|
@@ -3242,7 +2532,7 @@ var DataTableRowActionMenu = ({
|
|
|
3242
2532
|
reorderActions.push({
|
|
3243
2533
|
id: "data-table-move-up",
|
|
3244
2534
|
name: store.config.labels.moveUp,
|
|
3245
|
-
icon: /* @__PURE__ */
|
|
2535
|
+
icon: /* @__PURE__ */ jsx3(ArrowUp, {}),
|
|
3246
2536
|
onClick: () => move(rowIndex - 1)
|
|
3247
2537
|
});
|
|
3248
2538
|
}
|
|
@@ -3250,12 +2540,12 @@ var DataTableRowActionMenu = ({
|
|
|
3250
2540
|
reorderActions.push({
|
|
3251
2541
|
id: "data-table-move-down",
|
|
3252
2542
|
name: store.config.labels.moveDown,
|
|
3253
|
-
icon: /* @__PURE__ */
|
|
2543
|
+
icon: /* @__PURE__ */ jsx3(ArrowDown, {}),
|
|
3254
2544
|
onClick: () => move(rowIndex + 1)
|
|
3255
2545
|
});
|
|
3256
2546
|
}
|
|
3257
2547
|
}
|
|
3258
|
-
return /* @__PURE__ */
|
|
2548
|
+
return /* @__PURE__ */ jsx3(DataTableRowActions, {
|
|
3259
2549
|
actions: [...reorderActions, ...rowActions ? rowActions.items : []],
|
|
3260
2550
|
row: row.data,
|
|
3261
2551
|
title: rowActions?.label ?? store.config.labels.actions
|
|
@@ -3301,60 +2591,60 @@ var DataTableToolbar = ({
|
|
|
3301
2591
|
send(DataTableMessage.ExportFinished({ failed }));
|
|
3302
2592
|
}
|
|
3303
2593
|
};
|
|
3304
|
-
return /* @__PURE__ */
|
|
2594
|
+
return /* @__PURE__ */ jsxs3("div", {
|
|
3305
2595
|
className: cn(tableClasses.toolbar, "pb-4"),
|
|
3306
2596
|
children: [
|
|
3307
|
-
features.search !== false ? /* @__PURE__ */
|
|
2597
|
+
features.search !== false ? /* @__PURE__ */ jsxs3("div", {
|
|
3308
2598
|
className: tableClasses.toolbarSearch,
|
|
3309
2599
|
children: [
|
|
3310
|
-
/* @__PURE__ */
|
|
2600
|
+
/* @__PURE__ */ jsx3(Search, {
|
|
3311
2601
|
className: "text-muted-foreground pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2"
|
|
3312
2602
|
}),
|
|
3313
|
-
/* @__PURE__ */
|
|
2603
|
+
/* @__PURE__ */ jsx3(Input, {
|
|
3314
2604
|
className: "px-9",
|
|
3315
2605
|
onChange: (event) => send(DataTableMessage.SearchChanged({ value: event.target.value })),
|
|
3316
2606
|
placeholder: labels.filter,
|
|
3317
2607
|
value: store.state.globalFilter ?? ""
|
|
3318
2608
|
}),
|
|
3319
|
-
store.state.globalFilter ? /* @__PURE__ */
|
|
2609
|
+
store.state.globalFilter ? /* @__PURE__ */ jsx3(Button2, {
|
|
3320
2610
|
"aria-label": labels.filter,
|
|
3321
2611
|
className: "absolute top-1/2 right-1 size-7 -translate-y-1/2 active:not-aria-[haspopup]:-translate-y-1/2",
|
|
3322
2612
|
onClick: () => send(DataTableMessage.SearchChanged({ value: "" })),
|
|
3323
2613
|
size: "icon",
|
|
3324
2614
|
variant: "ghost",
|
|
3325
|
-
children: /* @__PURE__ */
|
|
2615
|
+
children: /* @__PURE__ */ jsx3(X, {})
|
|
3326
2616
|
}) : null
|
|
3327
2617
|
]
|
|
3328
2618
|
}) : null,
|
|
3329
|
-
/* @__PURE__ */
|
|
2619
|
+
/* @__PURE__ */ jsx3("div", {
|
|
3330
2620
|
className: tableClasses.toolbarMenus,
|
|
3331
|
-
children: /* @__PURE__ */
|
|
2621
|
+
children: /* @__PURE__ */ jsxs3(Menubar, {
|
|
3332
2622
|
modal: false,
|
|
3333
2623
|
className: cn(tableClasses.menubar, "[&_[data-slot=menubar-trigger]]:gap-2 [&_[data-slot=menubar-trigger]_svg]:size-4"),
|
|
3334
2624
|
children: [
|
|
3335
|
-
visibleBulkActions.length ? /* @__PURE__ */
|
|
2625
|
+
visibleBulkActions.length ? /* @__PURE__ */ jsxs3(MenubarMenu, {
|
|
3336
2626
|
children: [
|
|
3337
|
-
/* @__PURE__ */
|
|
2627
|
+
/* @__PURE__ */ jsxs3(MenubarTrigger, {
|
|
3338
2628
|
className: cn(tableClasses.selectedTrigger, "aria-expanded:bg-primary/90"),
|
|
3339
2629
|
children: [
|
|
3340
2630
|
labels.selected,
|
|
3341
|
-
/* @__PURE__ */
|
|
2631
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3342
2632
|
className: tableClasses.count,
|
|
3343
2633
|
children: selectedRows.length
|
|
3344
2634
|
}),
|
|
3345
|
-
/* @__PURE__ */
|
|
2635
|
+
/* @__PURE__ */ jsx3(ChevronDown, {})
|
|
3346
2636
|
]
|
|
3347
2637
|
}),
|
|
3348
|
-
/* @__PURE__ */
|
|
2638
|
+
/* @__PURE__ */ jsx3(MenubarContent, {
|
|
3349
2639
|
align: "end",
|
|
3350
2640
|
className: "w-max",
|
|
3351
|
-
children: /* @__PURE__ */
|
|
2641
|
+
children: /* @__PURE__ */ jsxs3(MenubarGroup, {
|
|
3352
2642
|
children: [
|
|
3353
|
-
/* @__PURE__ */
|
|
2643
|
+
/* @__PURE__ */ jsx3(MenubarLabel, {
|
|
3354
2644
|
children: bulkActions && bulkActions.label ? bulkActions.label : labels.actions
|
|
3355
2645
|
}),
|
|
3356
|
-
/* @__PURE__ */
|
|
3357
|
-
visibleBulkActions.map((action) => /* @__PURE__ */
|
|
2646
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
2647
|
+
visibleBulkActions.map((action) => /* @__PURE__ */ jsxs3(MenubarItem, {
|
|
3358
2648
|
onClick: () => action.onClick(selectedRows),
|
|
3359
2649
|
variant: action.variant ?? "default",
|
|
3360
2650
|
children: [
|
|
@@ -3368,30 +2658,30 @@ var DataTableToolbar = ({
|
|
|
3368
2658
|
]
|
|
3369
2659
|
}) : null,
|
|
3370
2660
|
toolbar && toolbar.items,
|
|
3371
|
-
features.filtering !== false ? /* @__PURE__ */
|
|
2661
|
+
features.filtering !== false ? /* @__PURE__ */ jsx3(FilterMenu, {
|
|
3372
2662
|
table
|
|
3373
2663
|
}) : null,
|
|
3374
|
-
grouping ? /* @__PURE__ */
|
|
2664
|
+
grouping ? /* @__PURE__ */ jsxs3(MenubarMenu, {
|
|
3375
2665
|
children: [
|
|
3376
|
-
/* @__PURE__ */
|
|
2666
|
+
/* @__PURE__ */ jsxs3(MenubarTrigger, {
|
|
3377
2667
|
"aria-label": labels.groupBy,
|
|
3378
2668
|
children: [
|
|
3379
|
-
/* @__PURE__ */
|
|
3380
|
-
/* @__PURE__ */
|
|
2669
|
+
/* @__PURE__ */ jsx3(Rows3, {}),
|
|
2670
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3381
2671
|
className: "hidden sm:inline",
|
|
3382
2672
|
children: labels.groupBy
|
|
3383
2673
|
})
|
|
3384
2674
|
]
|
|
3385
2675
|
}),
|
|
3386
|
-
/* @__PURE__ */
|
|
2676
|
+
/* @__PURE__ */ jsx3(MenubarContent, {
|
|
3387
2677
|
align: "end",
|
|
3388
|
-
children: /* @__PURE__ */
|
|
2678
|
+
children: /* @__PURE__ */ jsxs3(MenubarGroup, {
|
|
3389
2679
|
children: [
|
|
3390
|
-
/* @__PURE__ */
|
|
2680
|
+
/* @__PURE__ */ jsx3(MenubarLabel, {
|
|
3391
2681
|
children: labels.groupBy
|
|
3392
2682
|
}),
|
|
3393
|
-
/* @__PURE__ */
|
|
3394
|
-
grouping.fields.map((field) => /* @__PURE__ */
|
|
2683
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
2684
|
+
grouping.fields.map((field) => /* @__PURE__ */ jsx3(MenubarCheckboxItem, {
|
|
3395
2685
|
checked: store.state.grouping.includes(field.id),
|
|
3396
2686
|
onCheckedChange: () => send(DataTableMessage.GroupingToggled({ fieldId: field.id })),
|
|
3397
2687
|
children: field.label
|
|
@@ -3401,77 +2691,77 @@ var DataTableToolbar = ({
|
|
|
3401
2691
|
})
|
|
3402
2692
|
]
|
|
3403
2693
|
}) : null,
|
|
3404
|
-
features.sorting !== false ? /* @__PURE__ */
|
|
2694
|
+
features.sorting !== false ? /* @__PURE__ */ jsx3(SortMenu, {
|
|
3405
2695
|
table
|
|
3406
2696
|
}) : null,
|
|
3407
|
-
features.gallery ? /* @__PURE__ */
|
|
2697
|
+
features.gallery ? /* @__PURE__ */ jsx3(ViewMenu, {
|
|
3408
2698
|
table
|
|
3409
2699
|
}) : null,
|
|
3410
|
-
features.columnVisibility !== false ? /* @__PURE__ */
|
|
2700
|
+
features.columnVisibility !== false ? /* @__PURE__ */ jsx3(ColumnMenu, {
|
|
3411
2701
|
table
|
|
3412
2702
|
}) : null,
|
|
3413
|
-
features.refresh ? /* @__PURE__ */
|
|
3414
|
-
children: /* @__PURE__ */
|
|
2703
|
+
features.refresh ? /* @__PURE__ */ jsx3(MenubarMenu, {
|
|
2704
|
+
children: /* @__PURE__ */ jsxs3(MenubarTrigger, {
|
|
3415
2705
|
"aria-label": labels.refresh,
|
|
3416
2706
|
onClick: features.refresh,
|
|
3417
2707
|
children: [
|
|
3418
|
-
/* @__PURE__ */
|
|
3419
|
-
/* @__PURE__ */
|
|
2708
|
+
/* @__PURE__ */ jsx3(RefreshCw, {}),
|
|
2709
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3420
2710
|
className: "hidden sm:inline",
|
|
3421
2711
|
children: labels.refresh
|
|
3422
2712
|
})
|
|
3423
2713
|
]
|
|
3424
2714
|
})
|
|
3425
2715
|
}) : null,
|
|
3426
|
-
features.export ? /* @__PURE__ */
|
|
2716
|
+
features.export ? /* @__PURE__ */ jsxs3(MenubarMenu, {
|
|
3427
2717
|
children: [
|
|
3428
|
-
/* @__PURE__ */
|
|
2718
|
+
/* @__PURE__ */ jsxs3(MenubarTrigger, {
|
|
3429
2719
|
"aria-label": labels.export,
|
|
3430
2720
|
"aria-busy": exporting,
|
|
3431
2721
|
disabled: exporting || !canExport,
|
|
3432
2722
|
children: [
|
|
3433
|
-
exporting ? /* @__PURE__ */
|
|
2723
|
+
exporting ? /* @__PURE__ */ jsx3(RefreshCw, {
|
|
3434
2724
|
className: "animate-spin"
|
|
3435
|
-
}) : /* @__PURE__ */
|
|
3436
|
-
/* @__PURE__ */
|
|
2725
|
+
}) : /* @__PURE__ */ jsx3(Download, {}),
|
|
2726
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3437
2727
|
className: "hidden sm:inline",
|
|
3438
2728
|
children: exporting ? labels.loading : labels.export
|
|
3439
2729
|
})
|
|
3440
2730
|
]
|
|
3441
2731
|
}),
|
|
3442
|
-
/* @__PURE__ */
|
|
2732
|
+
/* @__PURE__ */ jsx3(MenubarContent, {
|
|
3443
2733
|
align: "end",
|
|
3444
|
-
children: /* @__PURE__ */
|
|
2734
|
+
children: /* @__PURE__ */ jsxs3(MenubarGroup, {
|
|
3445
2735
|
children: [
|
|
3446
|
-
/* @__PURE__ */
|
|
2736
|
+
/* @__PURE__ */ jsx3(MenubarLabel, {
|
|
3447
2737
|
children: labels.export
|
|
3448
2738
|
}),
|
|
3449
|
-
/* @__PURE__ */
|
|
3450
|
-
builtInExport ? /* @__PURE__ */
|
|
2739
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
2740
|
+
builtInExport ? /* @__PURE__ */ jsxs3(Fragment, {
|
|
3451
2741
|
children: [
|
|
3452
|
-
/* @__PURE__ */
|
|
2742
|
+
/* @__PURE__ */ jsxs3(MenubarItem, {
|
|
3453
2743
|
disabled: exporting || !exportRows.length,
|
|
3454
2744
|
onClick: () => downloadCsv(exportColumns.map(columnLabel), exportRows.map((row) => exportColumns.map((column) => dataTableValueText(getDataTableExportValue(row, column, store.config.locale) ?? ""))), features.export ? features.export.baseName : "table"),
|
|
3455
2745
|
children: [
|
|
3456
|
-
/* @__PURE__ */
|
|
2746
|
+
/* @__PURE__ */ jsx3(FileText, {}),
|
|
3457
2747
|
labels.exportCsv
|
|
3458
2748
|
]
|
|
3459
2749
|
}),
|
|
3460
|
-
/* @__PURE__ */
|
|
2750
|
+
/* @__PURE__ */ jsxs3(MenubarItem, {
|
|
3461
2751
|
disabled: exporting || !exportRows.length,
|
|
3462
2752
|
onClick: () => downloadJson(exportRows.map((row) => Object.fromEntries(exportColumns.map((column) => [
|
|
3463
2753
|
column.id,
|
|
3464
2754
|
getDataTableExportValue(row, column, store.config.locale)
|
|
3465
2755
|
]))), features.export ? features.export.baseName : "table"),
|
|
3466
2756
|
children: [
|
|
3467
|
-
/* @__PURE__ */
|
|
2757
|
+
/* @__PURE__ */ jsx3(FileJson, {}),
|
|
3468
2758
|
labels.exportJson
|
|
3469
2759
|
]
|
|
3470
2760
|
})
|
|
3471
2761
|
]
|
|
3472
2762
|
}) : null,
|
|
3473
|
-
builtInExport && exportActions.length ? /* @__PURE__ */
|
|
3474
|
-
exportActions.map((action) => /* @__PURE__ */
|
|
2763
|
+
builtInExport && exportActions.length ? /* @__PURE__ */ jsx3(MenubarSeparator, {}) : null,
|
|
2764
|
+
exportActions.map((action) => /* @__PURE__ */ jsxs3(MenubarItem, {
|
|
3475
2765
|
disabled: exporting || action.disabled,
|
|
3476
2766
|
onClick: () => void runExport(action),
|
|
3477
2767
|
children: [
|
|
@@ -3487,7 +2777,7 @@ var DataTableToolbar = ({
|
|
|
3487
2777
|
]
|
|
3488
2778
|
})
|
|
3489
2779
|
}),
|
|
3490
|
-
exportFeature && exportFailed ? /* @__PURE__ */
|
|
2780
|
+
exportFeature && exportFailed ? /* @__PURE__ */ jsx3("p", {
|
|
3491
2781
|
role: "alert",
|
|
3492
2782
|
className: "text-destructive basis-full text-sm",
|
|
3493
2783
|
children: labels.exportFailed ?? dataTableMessages(store.config.locale).exportFailed
|
|
@@ -3524,26 +2814,26 @@ var FilterEditor = ({
|
|
|
3524
2814
|
onChange(decoded.value);
|
|
3525
2815
|
};
|
|
3526
2816
|
if (kind === "boolean") {
|
|
3527
|
-
return /* @__PURE__ */
|
|
2817
|
+
return /* @__PURE__ */ jsxs3(MenubarGroup, {
|
|
3528
2818
|
children: [
|
|
3529
|
-
/* @__PURE__ */
|
|
2819
|
+
/* @__PURE__ */ jsxs3(MenubarRadioGroup, {
|
|
3530
2820
|
value: current?.kind === "boolean" ? String(current.value) : "",
|
|
3531
2821
|
onValueChange: (value) => apply({ ...draft, primary: value }),
|
|
3532
2822
|
children: [
|
|
3533
|
-
/* @__PURE__ */
|
|
2823
|
+
/* @__PURE__ */ jsx3(MenubarRadioItem, {
|
|
3534
2824
|
value: "true",
|
|
3535
2825
|
closeOnClick: false,
|
|
3536
2826
|
children: column.colDef.type === "boolean" ? column.colDef.typeOptions?.trueLabel ?? labels.filterTrue : labels.filterTrue
|
|
3537
2827
|
}),
|
|
3538
|
-
/* @__PURE__ */
|
|
2828
|
+
/* @__PURE__ */ jsx3(MenubarRadioItem, {
|
|
3539
2829
|
value: "false",
|
|
3540
2830
|
closeOnClick: false,
|
|
3541
2831
|
children: column.colDef.type === "boolean" ? column.colDef.typeOptions?.falseLabel ?? labels.filterFalse : labels.filterFalse
|
|
3542
2832
|
})
|
|
3543
2833
|
]
|
|
3544
2834
|
}),
|
|
3545
|
-
/* @__PURE__ */
|
|
3546
|
-
/* @__PURE__ */
|
|
2835
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
2836
|
+
/* @__PURE__ */ jsx3(MenubarItem, {
|
|
3547
2837
|
closeOnClick: false,
|
|
3548
2838
|
onClick: () => onChange(undefined),
|
|
3549
2839
|
children: labels.filterClear
|
|
@@ -3555,11 +2845,11 @@ var FilterEditor = ({
|
|
|
3555
2845
|
const selected = current?.kind === "values" ? current.values : [];
|
|
3556
2846
|
const options = getDataTableFilterOptions(rows, column);
|
|
3557
2847
|
const filteredOptions = options.filter((option) => option.label.toLocaleLowerCase().includes(optionSearch.trim().toLocaleLowerCase()));
|
|
3558
|
-
return /* @__PURE__ */
|
|
2848
|
+
return /* @__PURE__ */ jsxs3(MenubarGroup, {
|
|
3559
2849
|
children: [
|
|
3560
|
-
options.length > 8 ? /* @__PURE__ */
|
|
2850
|
+
options.length > 8 ? /* @__PURE__ */ jsx3("div", {
|
|
3561
2851
|
className: "p-1",
|
|
3562
|
-
children: /* @__PURE__ */
|
|
2852
|
+
children: /* @__PURE__ */ jsx3(Input, {
|
|
3563
2853
|
"aria-label": labels.filter,
|
|
3564
2854
|
placeholder: labels.filter,
|
|
3565
2855
|
value: optionSearch,
|
|
@@ -3570,7 +2860,7 @@ var FilterEditor = ({
|
|
|
3570
2860
|
}
|
|
3571
2861
|
})
|
|
3572
2862
|
}) : null,
|
|
3573
|
-
filteredOptions.map((option) => /* @__PURE__ */
|
|
2863
|
+
filteredOptions.map((option) => /* @__PURE__ */ jsxs3(MenubarCheckboxItem, {
|
|
3574
2864
|
checked: selected.includes(option.value),
|
|
3575
2865
|
closeOnClick: false,
|
|
3576
2866
|
onCheckedChange: (checked) => {
|
|
@@ -3581,23 +2871,23 @@ var FilterEditor = ({
|
|
|
3581
2871
|
onChange(undefined);
|
|
3582
2872
|
},
|
|
3583
2873
|
children: [
|
|
3584
|
-
/* @__PURE__ */
|
|
2874
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3585
2875
|
className: "min-w-0 flex-1 truncate",
|
|
3586
2876
|
children: option.label
|
|
3587
2877
|
}),
|
|
3588
|
-
option.count !== undefined ? /* @__PURE__ */
|
|
2878
|
+
option.count !== undefined ? /* @__PURE__ */ jsx3(Badge, {
|
|
3589
2879
|
variant: "secondary",
|
|
3590
2880
|
className: "ml-auto shrink-0",
|
|
3591
2881
|
children: option.count
|
|
3592
2882
|
}) : null
|
|
3593
2883
|
]
|
|
3594
2884
|
}, option.value)),
|
|
3595
|
-
!filteredOptions.length ? /* @__PURE__ */
|
|
2885
|
+
!filteredOptions.length ? /* @__PURE__ */ jsx3("div", {
|
|
3596
2886
|
className: "text-muted-foreground px-2 py-1.5 text-sm",
|
|
3597
2887
|
children: labels.empty
|
|
3598
2888
|
}) : null,
|
|
3599
|
-
/* @__PURE__ */
|
|
3600
|
-
/* @__PURE__ */
|
|
2889
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
2890
|
+
/* @__PURE__ */ jsx3(MenubarItem, {
|
|
3601
2891
|
closeOnClick: false,
|
|
3602
2892
|
onClick: () => onChange(undefined),
|
|
3603
2893
|
children: labels.filterClear
|
|
@@ -3605,7 +2895,7 @@ var FilterEditor = ({
|
|
|
3605
2895
|
]
|
|
3606
2896
|
});
|
|
3607
2897
|
}
|
|
3608
|
-
return /* @__PURE__ */
|
|
2898
|
+
return /* @__PURE__ */ jsxs3("form", {
|
|
3609
2899
|
className: "flex flex-col gap-3 p-2",
|
|
3610
2900
|
onKeyDown: (event) => {
|
|
3611
2901
|
if (event.key !== "Escape")
|
|
@@ -3616,15 +2906,15 @@ var FilterEditor = ({
|
|
|
3616
2906
|
apply(draft);
|
|
3617
2907
|
},
|
|
3618
2908
|
children: [
|
|
3619
|
-
/* @__PURE__ */
|
|
2909
|
+
/* @__PURE__ */ jsxs3(FieldGroup, {
|
|
3620
2910
|
children: [
|
|
3621
|
-
kind === "text" ? /* @__PURE__ */
|
|
2911
|
+
kind === "text" ? /* @__PURE__ */ jsxs3(Field, {
|
|
3622
2912
|
children: [
|
|
3623
|
-
/* @__PURE__ */
|
|
2913
|
+
/* @__PURE__ */ jsx3(FieldLabel, {
|
|
3624
2914
|
htmlFor: `${inputId}-operator`,
|
|
3625
2915
|
children: labels.filterOperator
|
|
3626
2916
|
}),
|
|
3627
|
-
/* @__PURE__ */
|
|
2917
|
+
/* @__PURE__ */ jsxs3(Select2, {
|
|
3628
2918
|
items: operatorOptions,
|
|
3629
2919
|
value: operator,
|
|
3630
2920
|
onValueChange: (value) => {
|
|
@@ -3633,13 +2923,13 @@ var FilterEditor = ({
|
|
|
3633
2923
|
setDraft({ ...draft, operator: decoded.value });
|
|
3634
2924
|
},
|
|
3635
2925
|
children: [
|
|
3636
|
-
/* @__PURE__ */
|
|
2926
|
+
/* @__PURE__ */ jsx3(SelectTrigger2, {
|
|
3637
2927
|
id: `${inputId}-operator`,
|
|
3638
|
-
children: /* @__PURE__ */
|
|
2928
|
+
children: /* @__PURE__ */ jsx3(SelectValue2, {})
|
|
3639
2929
|
}),
|
|
3640
|
-
/* @__PURE__ */
|
|
3641
|
-
children: /* @__PURE__ */
|
|
3642
|
-
children: operatorOptions.map((option) => /* @__PURE__ */
|
|
2930
|
+
/* @__PURE__ */ jsx3(SelectContent2, {
|
|
2931
|
+
children: /* @__PURE__ */ jsx3(SelectGroup, {
|
|
2932
|
+
children: operatorOptions.map((option) => /* @__PURE__ */ jsx3(SelectItem2, {
|
|
3643
2933
|
value: option.value,
|
|
3644
2934
|
children: option.label
|
|
3645
2935
|
}, option.value))
|
|
@@ -3649,14 +2939,14 @@ var FilterEditor = ({
|
|
|
3649
2939
|
})
|
|
3650
2940
|
]
|
|
3651
2941
|
}) : null,
|
|
3652
|
-
/* @__PURE__ */
|
|
2942
|
+
/* @__PURE__ */ jsxs3(Field, {
|
|
3653
2943
|
"data-invalid": invalid || undefined,
|
|
3654
2944
|
children: [
|
|
3655
|
-
/* @__PURE__ */
|
|
2945
|
+
/* @__PURE__ */ jsx3(FieldLabel, {
|
|
3656
2946
|
htmlFor: `${inputId}-primary`,
|
|
3657
2947
|
children: kind === "text" ? labels.filterValue : kind === "date" ? labels.filterFrom : labels.filterMin
|
|
3658
2948
|
}),
|
|
3659
|
-
/* @__PURE__ */
|
|
2949
|
+
/* @__PURE__ */ jsx3(Input, {
|
|
3660
2950
|
id: `${inputId}-primary`,
|
|
3661
2951
|
type: kind === "text" ? "text" : kind === "date" ? "date" : "number",
|
|
3662
2952
|
step: kind === "number" ? "any" : undefined,
|
|
@@ -3669,14 +2959,14 @@ var FilterEditor = ({
|
|
|
3669
2959
|
})
|
|
3670
2960
|
]
|
|
3671
2961
|
}),
|
|
3672
|
-
kind !== "text" ? /* @__PURE__ */
|
|
2962
|
+
kind !== "text" ? /* @__PURE__ */ jsxs3(Field, {
|
|
3673
2963
|
"data-invalid": invalid || undefined,
|
|
3674
2964
|
children: [
|
|
3675
|
-
/* @__PURE__ */
|
|
2965
|
+
/* @__PURE__ */ jsx3(FieldLabel, {
|
|
3676
2966
|
htmlFor: `${inputId}-secondary`,
|
|
3677
2967
|
children: kind === "date" ? labels.filterTo : labels.filterMax
|
|
3678
2968
|
}),
|
|
3679
|
-
/* @__PURE__ */
|
|
2969
|
+
/* @__PURE__ */ jsx3(Input, {
|
|
3680
2970
|
id: `${inputId}-secondary`,
|
|
3681
2971
|
type: kind === "date" ? "date" : "number",
|
|
3682
2972
|
step: kind === "number" ? "any" : undefined,
|
|
@@ -3691,20 +2981,20 @@ var FilterEditor = ({
|
|
|
3691
2981
|
}) : null
|
|
3692
2982
|
]
|
|
3693
2983
|
}),
|
|
3694
|
-
invalid ? /* @__PURE__ */
|
|
2984
|
+
invalid ? /* @__PURE__ */ jsx3("p", {
|
|
3695
2985
|
role: "alert",
|
|
3696
2986
|
className: "text-destructive text-sm",
|
|
3697
2987
|
children: labels.filterInvalid
|
|
3698
2988
|
}) : null,
|
|
3699
|
-
/* @__PURE__ */
|
|
2989
|
+
/* @__PURE__ */ jsxs3("div", {
|
|
3700
2990
|
className: "flex gap-2",
|
|
3701
2991
|
children: [
|
|
3702
|
-
/* @__PURE__ */
|
|
2992
|
+
/* @__PURE__ */ jsx3(Button2, {
|
|
3703
2993
|
type: "submit",
|
|
3704
2994
|
size: "sm",
|
|
3705
2995
|
children: labels.filterApply
|
|
3706
2996
|
}),
|
|
3707
|
-
/* @__PURE__ */
|
|
2997
|
+
/* @__PURE__ */ jsx3(Button2, {
|
|
3708
2998
|
type: "button",
|
|
3709
2999
|
size: "sm",
|
|
3710
3000
|
variant: "outline",
|
|
@@ -3733,45 +3023,45 @@ var FilterMenu = ({
|
|
|
3733
3023
|
return null;
|
|
3734
3024
|
const filters = store.state.filters ?? [];
|
|
3735
3025
|
const update = (id, filter) => send(DataTableMessage.ColumnFilterChanged({ id, filter: filter ?? null }));
|
|
3736
|
-
return /* @__PURE__ */
|
|
3026
|
+
return /* @__PURE__ */ jsxs3(MenubarMenu, {
|
|
3737
3027
|
children: [
|
|
3738
|
-
/* @__PURE__ */
|
|
3028
|
+
/* @__PURE__ */ jsxs3(MenubarTrigger, {
|
|
3739
3029
|
"aria-label": store.config.labels.filters,
|
|
3740
3030
|
children: [
|
|
3741
|
-
/* @__PURE__ */
|
|
3742
|
-
/* @__PURE__ */
|
|
3031
|
+
/* @__PURE__ */ jsx3(ListFilter, {}),
|
|
3032
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3743
3033
|
className: "hidden sm:inline",
|
|
3744
3034
|
children: store.config.labels.filters
|
|
3745
3035
|
}),
|
|
3746
|
-
filters.length ? /* @__PURE__ */
|
|
3036
|
+
filters.length ? /* @__PURE__ */ jsx3(Badge, {
|
|
3747
3037
|
variant: "secondary",
|
|
3748
3038
|
children: filters.length
|
|
3749
3039
|
}) : null
|
|
3750
3040
|
]
|
|
3751
3041
|
}),
|
|
3752
|
-
/* @__PURE__ */
|
|
3042
|
+
/* @__PURE__ */ jsx3(MenubarContent, {
|
|
3753
3043
|
align: "end",
|
|
3754
3044
|
className: "w-80 max-w-[calc(100vw-2rem)]",
|
|
3755
|
-
children: /* @__PURE__ */
|
|
3045
|
+
children: /* @__PURE__ */ jsxs3(MenubarGroup, {
|
|
3756
3046
|
children: [
|
|
3757
|
-
/* @__PURE__ */
|
|
3047
|
+
/* @__PURE__ */ jsx3(MenubarLabel, {
|
|
3758
3048
|
children: store.config.labels.filters
|
|
3759
3049
|
}),
|
|
3760
|
-
/* @__PURE__ */
|
|
3761
|
-
columns.map(({ column, label }) => /* @__PURE__ */
|
|
3050
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
3051
|
+
columns.map(({ column, label }) => /* @__PURE__ */ jsxs3(MenubarSub, {
|
|
3762
3052
|
children: [
|
|
3763
|
-
/* @__PURE__ */
|
|
3053
|
+
/* @__PURE__ */ jsxs3(MenubarSubTrigger, {
|
|
3764
3054
|
children: [
|
|
3765
|
-
/* @__PURE__ */
|
|
3055
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3766
3056
|
className: "min-w-0 flex-1 truncate",
|
|
3767
3057
|
children: label
|
|
3768
3058
|
}),
|
|
3769
|
-
filters.some((filter) => filter.id === column.id) ? /* @__PURE__ */
|
|
3059
|
+
filters.some((filter) => filter.id === column.id) ? /* @__PURE__ */ jsx3(Check, {}) : null
|
|
3770
3060
|
]
|
|
3771
3061
|
}),
|
|
3772
|
-
/* @__PURE__ */
|
|
3062
|
+
/* @__PURE__ */ jsx3(MenubarSubContent, {
|
|
3773
3063
|
className: "w-80 max-w-[calc(100vw-2rem)]",
|
|
3774
|
-
children: /* @__PURE__ */
|
|
3064
|
+
children: /* @__PURE__ */ jsx3(FilterEditor, {
|
|
3775
3065
|
column,
|
|
3776
3066
|
rows: model.rows,
|
|
3777
3067
|
current: filters.find((filter) => filter.id === column.id),
|
|
@@ -3781,13 +3071,13 @@ var FilterMenu = ({
|
|
|
3781
3071
|
})
|
|
3782
3072
|
]
|
|
3783
3073
|
}, column.id)),
|
|
3784
|
-
filters.length ? /* @__PURE__ */
|
|
3074
|
+
filters.length ? /* @__PURE__ */ jsxs3(Fragment, {
|
|
3785
3075
|
children: [
|
|
3786
|
-
/* @__PURE__ */
|
|
3787
|
-
/* @__PURE__ */
|
|
3076
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
3077
|
+
/* @__PURE__ */ jsxs3(MenubarItem, {
|
|
3788
3078
|
onClick: () => send(DataTableMessage.FiltersCleared()),
|
|
3789
3079
|
children: [
|
|
3790
|
-
/* @__PURE__ */
|
|
3080
|
+
/* @__PURE__ */ jsx3(X, {}),
|
|
3791
3081
|
store.config.labels.filtersClear
|
|
3792
3082
|
]
|
|
3793
3083
|
})
|
|
@@ -3814,65 +3104,65 @@ var SortMenu = ({
|
|
|
3814
3104
|
return null;
|
|
3815
3105
|
const current = store.state.sort?.[0];
|
|
3816
3106
|
const sort = (id, direction) => send(DataTableMessage.SortRequested({ columnId: id, direction }));
|
|
3817
|
-
return /* @__PURE__ */
|
|
3107
|
+
return /* @__PURE__ */ jsxs3(MenubarMenu, {
|
|
3818
3108
|
children: [
|
|
3819
|
-
/* @__PURE__ */
|
|
3109
|
+
/* @__PURE__ */ jsxs3(MenubarTrigger, {
|
|
3820
3110
|
"aria-label": store.config.labels.sortBy,
|
|
3821
3111
|
children: [
|
|
3822
|
-
current ? current.direction === "desc" ? /* @__PURE__ */
|
|
3823
|
-
/* @__PURE__ */
|
|
3112
|
+
current ? current.direction === "desc" ? /* @__PURE__ */ jsx3(ArrowDown, {}) : /* @__PURE__ */ jsx3(ArrowUp, {}) : /* @__PURE__ */ jsx3(ChevronsUpDown, {}),
|
|
3113
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3824
3114
|
className: "hidden sm:inline",
|
|
3825
3115
|
children: store.config.labels.sortBy
|
|
3826
3116
|
})
|
|
3827
3117
|
]
|
|
3828
3118
|
}),
|
|
3829
|
-
/* @__PURE__ */
|
|
3119
|
+
/* @__PURE__ */ jsx3(MenubarContent, {
|
|
3830
3120
|
align: "end",
|
|
3831
3121
|
className: "w-52",
|
|
3832
|
-
children: /* @__PURE__ */
|
|
3122
|
+
children: /* @__PURE__ */ jsxs3(MenubarGroup, {
|
|
3833
3123
|
children: [
|
|
3834
|
-
/* @__PURE__ */
|
|
3124
|
+
/* @__PURE__ */ jsx3(MenubarLabel, {
|
|
3835
3125
|
children: store.config.labels.sortBy
|
|
3836
3126
|
}),
|
|
3837
|
-
/* @__PURE__ */
|
|
3127
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
3838
3128
|
columns.map((column) => {
|
|
3839
3129
|
const sortState = store.state.sort?.find(({ id }) => id === column.id);
|
|
3840
|
-
return /* @__PURE__ */
|
|
3130
|
+
return /* @__PURE__ */ jsxs3(MenubarSub, {
|
|
3841
3131
|
children: [
|
|
3842
|
-
/* @__PURE__ */
|
|
3132
|
+
/* @__PURE__ */ jsxs3(MenubarSubTrigger, {
|
|
3843
3133
|
children: [
|
|
3844
|
-
sortState ? sortState.direction === "desc" ? /* @__PURE__ */
|
|
3134
|
+
sortState ? sortState.direction === "desc" ? /* @__PURE__ */ jsx3(ArrowDown, {}) : /* @__PURE__ */ jsx3(ArrowUp, {}) : null,
|
|
3845
3135
|
columnLabel(column)
|
|
3846
3136
|
]
|
|
3847
3137
|
}),
|
|
3848
|
-
/* @__PURE__ */
|
|
3138
|
+
/* @__PURE__ */ jsxs3(MenubarSubContent, {
|
|
3849
3139
|
children: [
|
|
3850
|
-
/* @__PURE__ */
|
|
3140
|
+
/* @__PURE__ */ jsxs3(MenubarItem, {
|
|
3851
3141
|
onClick: () => sort(column.id, "asc"),
|
|
3852
3142
|
children: [
|
|
3853
|
-
/* @__PURE__ */
|
|
3143
|
+
/* @__PURE__ */ jsx3(ArrowUp, {}),
|
|
3854
3144
|
" ",
|
|
3855
3145
|
store.config.labels.sortAsc
|
|
3856
3146
|
]
|
|
3857
3147
|
}),
|
|
3858
|
-
/* @__PURE__ */
|
|
3148
|
+
/* @__PURE__ */ jsxs3(MenubarItem, {
|
|
3859
3149
|
onClick: () => sort(column.id, "desc"),
|
|
3860
3150
|
children: [
|
|
3861
|
-
/* @__PURE__ */
|
|
3151
|
+
/* @__PURE__ */ jsx3(ArrowDown, {}),
|
|
3862
3152
|
" ",
|
|
3863
3153
|
store.config.labels.sortDesc
|
|
3864
3154
|
]
|
|
3865
3155
|
}),
|
|
3866
|
-
sortState ? /* @__PURE__ */
|
|
3156
|
+
sortState ? /* @__PURE__ */ jsxs3(Fragment, {
|
|
3867
3157
|
children: [
|
|
3868
|
-
/* @__PURE__ */
|
|
3869
|
-
/* @__PURE__ */
|
|
3158
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
3159
|
+
/* @__PURE__ */ jsxs3(MenubarItem, {
|
|
3870
3160
|
onClick: () => send(DataTableMessage.SortRequested({
|
|
3871
3161
|
columnId: column.id,
|
|
3872
3162
|
direction: null
|
|
3873
3163
|
})),
|
|
3874
3164
|
children: [
|
|
3875
|
-
/* @__PURE__ */
|
|
3165
|
+
/* @__PURE__ */ jsx3(X, {}),
|
|
3876
3166
|
" ",
|
|
3877
3167
|
store.config.labels.sortClear
|
|
3878
3168
|
]
|
|
@@ -3894,27 +3184,27 @@ var ViewMenu = ({
|
|
|
3894
3184
|
table
|
|
3895
3185
|
}) => {
|
|
3896
3186
|
const [store, send] = table;
|
|
3897
|
-
return /* @__PURE__ */
|
|
3187
|
+
return /* @__PURE__ */ jsxs3(MenubarMenu, {
|
|
3898
3188
|
children: [
|
|
3899
|
-
/* @__PURE__ */
|
|
3189
|
+
/* @__PURE__ */ jsxs3(MenubarTrigger, {
|
|
3900
3190
|
"aria-label": store.config.labels.view,
|
|
3901
3191
|
children: [
|
|
3902
|
-
store.state.view === "gallery" ? /* @__PURE__ */
|
|
3903
|
-
/* @__PURE__ */
|
|
3192
|
+
store.state.view === "gallery" ? /* @__PURE__ */ jsx3(LayoutGrid, {}) : /* @__PURE__ */ jsx3(Rows3, {}),
|
|
3193
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3904
3194
|
className: "hidden sm:inline",
|
|
3905
3195
|
children: store.config.labels.view
|
|
3906
3196
|
})
|
|
3907
3197
|
]
|
|
3908
3198
|
}),
|
|
3909
|
-
/* @__PURE__ */
|
|
3199
|
+
/* @__PURE__ */ jsx3(MenubarContent, {
|
|
3910
3200
|
align: "end",
|
|
3911
|
-
children: /* @__PURE__ */
|
|
3201
|
+
children: /* @__PURE__ */ jsxs3(MenubarGroup, {
|
|
3912
3202
|
children: [
|
|
3913
|
-
/* @__PURE__ */
|
|
3203
|
+
/* @__PURE__ */ jsx3(MenubarLabel, {
|
|
3914
3204
|
children: store.config.labels.view
|
|
3915
3205
|
}),
|
|
3916
|
-
/* @__PURE__ */
|
|
3917
|
-
/* @__PURE__ */
|
|
3206
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
3207
|
+
/* @__PURE__ */ jsxs3(MenubarRadioGroup, {
|
|
3918
3208
|
onValueChange: (input) => {
|
|
3919
3209
|
const view = Schema6.decodeUnknownOption(DataTableViewSchema)(input);
|
|
3920
3210
|
if (Option4.isSome(view)) {
|
|
@@ -3923,18 +3213,18 @@ var ViewMenu = ({
|
|
|
3923
3213
|
},
|
|
3924
3214
|
value: store.state.view,
|
|
3925
3215
|
children: [
|
|
3926
|
-
/* @__PURE__ */
|
|
3216
|
+
/* @__PURE__ */ jsxs3(MenubarRadioItem, {
|
|
3927
3217
|
value: "table",
|
|
3928
3218
|
children: [
|
|
3929
|
-
/* @__PURE__ */
|
|
3219
|
+
/* @__PURE__ */ jsx3(Rows3, {}),
|
|
3930
3220
|
" ",
|
|
3931
3221
|
store.config.labels.tableView
|
|
3932
3222
|
]
|
|
3933
3223
|
}),
|
|
3934
|
-
/* @__PURE__ */
|
|
3224
|
+
/* @__PURE__ */ jsxs3(MenubarRadioItem, {
|
|
3935
3225
|
value: "gallery",
|
|
3936
3226
|
children: [
|
|
3937
|
-
/* @__PURE__ */
|
|
3227
|
+
/* @__PURE__ */ jsx3(LayoutGrid, {}),
|
|
3938
3228
|
" ",
|
|
3939
3229
|
store.config.labels.galleryView
|
|
3940
3230
|
]
|
|
@@ -3954,27 +3244,27 @@ var ColumnMenu = ({
|
|
|
3954
3244
|
const columns = deriveModel(store).columns.filter(({ colDef }) => colDef.hideable !== false);
|
|
3955
3245
|
if (!columns.length)
|
|
3956
3246
|
return null;
|
|
3957
|
-
return /* @__PURE__ */
|
|
3247
|
+
return /* @__PURE__ */ jsxs3(MenubarMenu, {
|
|
3958
3248
|
children: [
|
|
3959
|
-
/* @__PURE__ */
|
|
3249
|
+
/* @__PURE__ */ jsxs3(MenubarTrigger, {
|
|
3960
3250
|
"aria-label": store.config.labels.columns,
|
|
3961
3251
|
children: [
|
|
3962
|
-
/* @__PURE__ */
|
|
3963
|
-
/* @__PURE__ */
|
|
3252
|
+
/* @__PURE__ */ jsx3(Settings2, {}),
|
|
3253
|
+
/* @__PURE__ */ jsx3("span", {
|
|
3964
3254
|
className: "hidden sm:inline",
|
|
3965
3255
|
children: store.config.labels.columns
|
|
3966
3256
|
})
|
|
3967
3257
|
]
|
|
3968
3258
|
}),
|
|
3969
|
-
/* @__PURE__ */
|
|
3259
|
+
/* @__PURE__ */ jsx3(MenubarContent, {
|
|
3970
3260
|
align: "end",
|
|
3971
|
-
children: /* @__PURE__ */
|
|
3261
|
+
children: /* @__PURE__ */ jsxs3(MenubarGroup, {
|
|
3972
3262
|
children: [
|
|
3973
|
-
/* @__PURE__ */
|
|
3263
|
+
/* @__PURE__ */ jsx3(MenubarLabel, {
|
|
3974
3264
|
children: store.config.labels.columns
|
|
3975
3265
|
}),
|
|
3976
|
-
/* @__PURE__ */
|
|
3977
|
-
columns.map((column) => /* @__PURE__ */
|
|
3266
|
+
/* @__PURE__ */ jsx3(MenubarSeparator, {}),
|
|
3267
|
+
columns.map((column) => /* @__PURE__ */ jsx3(MenubarCheckboxItem, {
|
|
3978
3268
|
checked: store.state.columnVisibility[column.id] !== false,
|
|
3979
3269
|
onCheckedChange: (visible) => send(DataTableMessage.ColumnVisibilityChanged({ id: column.id, visible })),
|
|
3980
3270
|
children: columnLabel(column)
|
|
@@ -4010,7 +3300,7 @@ var ResizeHandle = ({
|
|
|
4010
3300
|
send(DataTableMessage.ResizeMoved({ x: event.clientX, pointerId: event.pointerId }));
|
|
4011
3301
|
};
|
|
4012
3302
|
const reset = (event) => send(DataTableMessage.ResizeEnded({ pointerId: event.pointerId }));
|
|
4013
|
-
return /* @__PURE__ */
|
|
3303
|
+
return /* @__PURE__ */ jsx3("button", {
|
|
4014
3304
|
"aria-label": store.config.labels.resizeColumn(columnLabel(column)),
|
|
4015
3305
|
"aria-orientation": "vertical",
|
|
4016
3306
|
"aria-valuemax": max,
|
|
@@ -4132,9 +3422,9 @@ var DragHandle = ({
|
|
|
4132
3422
|
reordering.onReorder(reorderDataTableRows(model.rows, rowId, target.id));
|
|
4133
3423
|
}
|
|
4134
3424
|
};
|
|
4135
|
-
return /* @__PURE__ */
|
|
3425
|
+
return /* @__PURE__ */ jsxs3(Fragment, {
|
|
4136
3426
|
children: [
|
|
4137
|
-
/* @__PURE__ */
|
|
3427
|
+
/* @__PURE__ */ jsx3(Button2, {
|
|
4138
3428
|
"aria-label": store.config.features.reordering && store.config.features.reordering.handleLabel ? store.config.features.reordering.handleLabel : store.config.labels.reorder,
|
|
4139
3429
|
className: "size-8 cursor-grab touch-none active:cursor-grabbing",
|
|
4140
3430
|
onClick: (event) => event.stopPropagation(),
|
|
@@ -4152,9 +3442,9 @@ var DragHandle = ({
|
|
|
4152
3442
|
onPointerUp: finish,
|
|
4153
3443
|
size: "icon",
|
|
4154
3444
|
variant: "ghost",
|
|
4155
|
-
children: /* @__PURE__ */
|
|
3445
|
+
children: /* @__PURE__ */ jsx3(GripVertical, {})
|
|
4156
3446
|
}),
|
|
4157
|
-
overlay ? createPortal(/* @__PURE__ */
|
|
3447
|
+
overlay ? createPortal(/* @__PURE__ */ jsx3("div", {
|
|
4158
3448
|
"aria-hidden": "true",
|
|
4159
3449
|
className: "bg-background pointer-events-none fixed z-[100] rounded-md border px-3 py-2 text-sm shadow-lg",
|
|
4160
3450
|
style: { left: overlay.x + 12, top: overlay.y + 12 },
|
|
@@ -4176,7 +3466,7 @@ var TableDataRow = ({
|
|
|
4176
3466
|
const selection = store.config.features.selection;
|
|
4177
3467
|
const selectable = !!selection && (selection.isRowSelectable?.(row.data) ?? true);
|
|
4178
3468
|
const draggable = canDragRows(store);
|
|
4179
|
-
return /* @__PURE__ */
|
|
3469
|
+
return /* @__PURE__ */ jsxs3(TableRow, {
|
|
4180
3470
|
ref: measureRef,
|
|
4181
3471
|
"data-index": virtualIndex,
|
|
4182
3472
|
"aria-rowindex": virtualIndex === undefined ? undefined : virtualIndex + 2,
|
|
@@ -4192,12 +3482,12 @@ var TableDataRow = ({
|
|
|
4192
3482
|
},
|
|
4193
3483
|
tabIndex: store.config.onRowClicked ? 0 : undefined,
|
|
4194
3484
|
children: [
|
|
4195
|
-
selection ? /* @__PURE__ */
|
|
3485
|
+
selection ? /* @__PURE__ */ jsx3(TableCell, {
|
|
4196
3486
|
className: tableClasses.selectionCell,
|
|
4197
3487
|
onClick: (event) => event.stopPropagation(),
|
|
4198
|
-
children: /* @__PURE__ */
|
|
3488
|
+
children: /* @__PURE__ */ jsx3("div", {
|
|
4199
3489
|
className: tableClasses.selectionCenter,
|
|
4200
|
-
children: /* @__PURE__ */
|
|
3490
|
+
children: /* @__PURE__ */ jsx3(Checkbox, {
|
|
4201
3491
|
"aria-label": store.config.labels.selectRow,
|
|
4202
3492
|
checked: !!store.state.rowSelection[row.id],
|
|
4203
3493
|
disabled: !selectable,
|
|
@@ -4205,26 +3495,26 @@ var TableDataRow = ({
|
|
|
4205
3495
|
})
|
|
4206
3496
|
})
|
|
4207
3497
|
}) : null,
|
|
4208
|
-
draggable ? /* @__PURE__ */
|
|
3498
|
+
draggable ? /* @__PURE__ */ jsx3(TableCell, {
|
|
4209
3499
|
className: "w-10 pr-0",
|
|
4210
|
-
children: /* @__PURE__ */
|
|
3500
|
+
children: /* @__PURE__ */ jsx3(DragHandle, {
|
|
4211
3501
|
table
|
|
4212
3502
|
})
|
|
4213
3503
|
}) : null,
|
|
4214
|
-
model.visibleColumns.map((column) => /* @__PURE__ */
|
|
3504
|
+
model.visibleColumns.map((column) => /* @__PURE__ */ jsx3(TableCell, {
|
|
4215
3505
|
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"),
|
|
4216
3506
|
style: { width: column.width },
|
|
4217
|
-
children: /* @__PURE__ */
|
|
3507
|
+
children: /* @__PURE__ */ jsx3("div", {
|
|
4218
3508
|
className: cn(tableClasses.cellContent, column.colDef.truncate && "truncate"),
|
|
4219
3509
|
children: renderCell(row, column, store.config.locale, store.config.labels)
|
|
4220
3510
|
})
|
|
4221
3511
|
}, column.id)),
|
|
4222
|
-
hasRowActionMenu(store) ? /* @__PURE__ */
|
|
3512
|
+
hasRowActionMenu(store) ? /* @__PURE__ */ jsx3(TableCell, {
|
|
4223
3513
|
className: cn(tableClasses.actionsCell, "group-data-[state=selected]/row:bg-muted"),
|
|
4224
3514
|
onClick: (event) => event.stopPropagation(),
|
|
4225
|
-
children: /* @__PURE__ */
|
|
3515
|
+
children: /* @__PURE__ */ jsx3("div", {
|
|
4226
3516
|
className: tableClasses.actionsAlign,
|
|
4227
|
-
children: /* @__PURE__ */
|
|
3517
|
+
children: /* @__PURE__ */ jsx3(DataTableRowActionMenu, {
|
|
4228
3518
|
row,
|
|
4229
3519
|
table
|
|
4230
3520
|
})
|
|
@@ -4241,27 +3531,27 @@ var GroupActions = ({
|
|
|
4241
3531
|
const visible = actions?.filter((action) => !action.visible || action.visible(groupId));
|
|
4242
3532
|
if (!visible?.length)
|
|
4243
3533
|
return null;
|
|
4244
|
-
return /* @__PURE__ */
|
|
3534
|
+
return /* @__PURE__ */ jsxs3(DropdownMenu, {
|
|
4245
3535
|
children: [
|
|
4246
|
-
/* @__PURE__ */
|
|
3536
|
+
/* @__PURE__ */ jsx3(DropdownMenuTrigger, {
|
|
4247
3537
|
onClick: (event) => event.stopPropagation(),
|
|
4248
|
-
render: /* @__PURE__ */
|
|
3538
|
+
render: /* @__PURE__ */ jsxs3(Button2, {
|
|
4249
3539
|
size: "icon-sm",
|
|
4250
3540
|
variant: "ghost",
|
|
4251
3541
|
children: [
|
|
4252
|
-
/* @__PURE__ */
|
|
3542
|
+
/* @__PURE__ */ jsx3("span", {
|
|
4253
3543
|
className: "sr-only",
|
|
4254
3544
|
children: title
|
|
4255
3545
|
}),
|
|
4256
|
-
/* @__PURE__ */
|
|
3546
|
+
/* @__PURE__ */ jsx3(MoreHorizontal, {})
|
|
4257
3547
|
]
|
|
4258
3548
|
})
|
|
4259
3549
|
}),
|
|
4260
|
-
/* @__PURE__ */
|
|
3550
|
+
/* @__PURE__ */ jsx3(DropdownMenuContent, {
|
|
4261
3551
|
align: "end",
|
|
4262
3552
|
onClick: (event) => event.stopPropagation(),
|
|
4263
|
-
children: /* @__PURE__ */
|
|
4264
|
-
children: visible.map((action) => /* @__PURE__ */
|
|
3553
|
+
children: /* @__PURE__ */ jsx3(DropdownMenuGroup, {
|
|
3554
|
+
children: visible.map((action) => /* @__PURE__ */ jsxs3(DropdownMenuItem, {
|
|
4265
3555
|
onClick: () => action.onClick(groupId),
|
|
4266
3556
|
variant: action.variant ?? "default",
|
|
4267
3557
|
children: [
|
|
@@ -4285,40 +3575,40 @@ var GroupHeaderRow = ({
|
|
|
4285
3575
|
const tableClasses = useContext(DataTableSlotClassesContext);
|
|
4286
3576
|
const [store, send] = table;
|
|
4287
3577
|
const collapsed = !!store.state.collapsedGroups[section.key];
|
|
4288
|
-
return /* @__PURE__ */
|
|
3578
|
+
return /* @__PURE__ */ jsx3(TableRow, {
|
|
4289
3579
|
ref: measureRef,
|
|
4290
3580
|
"data-index": virtualIndex,
|
|
4291
3581
|
"aria-rowindex": virtualIndex === undefined ? undefined : virtualIndex + 2,
|
|
4292
3582
|
className: cn(tableClasses.group, "cursor-pointer"),
|
|
4293
3583
|
onClick: () => send(DataTableMessage.GroupToggled({ key: section.key })),
|
|
4294
|
-
children: /* @__PURE__ */
|
|
3584
|
+
children: /* @__PURE__ */ jsx3(TableCell, {
|
|
4295
3585
|
className: "p-0",
|
|
4296
3586
|
colSpan,
|
|
4297
|
-
children: /* @__PURE__ */
|
|
3587
|
+
children: /* @__PURE__ */ jsxs3("div", {
|
|
4298
3588
|
className: cn(tableClasses.groupContent, tableClasses.groupSticky),
|
|
4299
3589
|
children: [
|
|
4300
|
-
/* @__PURE__ */
|
|
3590
|
+
/* @__PURE__ */ jsxs3("button", {
|
|
4301
3591
|
"aria-expanded": !collapsed,
|
|
4302
3592
|
className: tableClasses.groupTrigger,
|
|
4303
3593
|
style: { paddingLeft: section.depth * 20 },
|
|
4304
3594
|
type: "button",
|
|
4305
3595
|
children: [
|
|
4306
|
-
collapsed ? /* @__PURE__ */
|
|
3596
|
+
collapsed ? /* @__PURE__ */ jsx3(ChevronRight2, {
|
|
4307
3597
|
className: "size-4 shrink-0"
|
|
4308
|
-
}) : /* @__PURE__ */
|
|
3598
|
+
}) : /* @__PURE__ */ jsx3(ChevronDown, {
|
|
4309
3599
|
className: "size-4 shrink-0"
|
|
4310
3600
|
}),
|
|
4311
|
-
/* @__PURE__ */
|
|
3601
|
+
/* @__PURE__ */ jsx3("span", {
|
|
4312
3602
|
className: "min-w-0 flex-1 truncate",
|
|
4313
3603
|
children: section.field.renderGroupLabel?.(section.groupId, section.rows.map((row) => row.data)) ?? section.groupId
|
|
4314
3604
|
})
|
|
4315
3605
|
]
|
|
4316
3606
|
}),
|
|
4317
|
-
/* @__PURE__ */
|
|
3607
|
+
/* @__PURE__ */ jsx3("span", {
|
|
4318
3608
|
className: tableClasses.count,
|
|
4319
3609
|
children: section.rows.length
|
|
4320
3610
|
}),
|
|
4321
|
-
/* @__PURE__ */
|
|
3611
|
+
/* @__PURE__ */ jsx3(GroupActions, {
|
|
4322
3612
|
actions: section.field.actions,
|
|
4323
3613
|
groupId: section.groupId,
|
|
4324
3614
|
title: section.field.actionsLabel ?? store.config.labels.actions
|
|
@@ -4338,24 +3628,24 @@ var GroupedTable = ({
|
|
|
4338
3628
|
const renderSections = (items) => items.flatMap((section) => {
|
|
4339
3629
|
const collapsed = !!store.state.collapsedGroups[section.key];
|
|
4340
3630
|
const targetKey = getGroupDropKey(section.field.id, section.groupId);
|
|
4341
|
-
const body = /* @__PURE__ */
|
|
3631
|
+
const body = /* @__PURE__ */ jsxs3(TableBody, {
|
|
4342
3632
|
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",
|
|
4343
3633
|
"data-table-group": section.field.onMoveToGroup ? targetKey : undefined,
|
|
4344
3634
|
children: [
|
|
4345
|
-
/* @__PURE__ */
|
|
3635
|
+
/* @__PURE__ */ jsx3(GroupHeaderRow, {
|
|
4346
3636
|
table,
|
|
4347
3637
|
section,
|
|
4348
3638
|
colSpan: model.visibleColumns.length + extra
|
|
4349
3639
|
}),
|
|
4350
|
-
!collapsed && !section.children.length ? section.rows.length ? section.rows.map((row) => /* @__PURE__ */
|
|
3640
|
+
!collapsed && !section.children.length ? section.rows.length ? section.rows.map((row) => /* @__PURE__ */ jsx3(RowIdContext.Provider, {
|
|
4351
3641
|
value: row.id,
|
|
4352
|
-
children: /* @__PURE__ */
|
|
3642
|
+
children: /* @__PURE__ */ jsx3(TableDataRow, {
|
|
4353
3643
|
row,
|
|
4354
3644
|
table
|
|
4355
3645
|
})
|
|
4356
3646
|
}, `${section.key}:${row.id}`)) : [
|
|
4357
|
-
/* @__PURE__ */
|
|
4358
|
-
children: /* @__PURE__ */
|
|
3647
|
+
/* @__PURE__ */ jsx3(TableRow, {
|
|
3648
|
+
children: /* @__PURE__ */ jsx3(TableCell, {
|
|
4359
3649
|
className: "text-muted-foreground h-16",
|
|
4360
3650
|
colSpan: model.visibleColumns.length + extra,
|
|
4361
3651
|
children: section.field.renderEmptyGroup?.(section.groupId) ?? store.config.labels.empty
|
|
@@ -4366,7 +3656,7 @@ var GroupedTable = ({
|
|
|
4366
3656
|
}, section.key);
|
|
4367
3657
|
return !collapsed && section.children.length ? [body, renderSections(section.children)] : [body];
|
|
4368
3658
|
});
|
|
4369
|
-
return /* @__PURE__ */
|
|
3659
|
+
return /* @__PURE__ */ jsx3(Fragment, {
|
|
4370
3660
|
children: renderSections(sections)
|
|
4371
3661
|
});
|
|
4372
3662
|
};
|
|
@@ -4385,7 +3675,7 @@ var ColumnHeaderMenu = ({
|
|
|
4385
3675
|
const filteringEnabled = store.config.features.filtering !== false && filterColumns.length > 0;
|
|
4386
3676
|
const ownsFilter = (id) => id === column.id || getDataTableFieldColumns(column).some((field) => field.id === id);
|
|
4387
3677
|
const activeFilters = (store.state.filters ?? []).filter(({ id }) => ownsFilter(id));
|
|
4388
|
-
const filterEditor = (field) => /* @__PURE__ */
|
|
3678
|
+
const filterEditor = (field) => /* @__PURE__ */ jsx3(FilterEditor, {
|
|
4389
3679
|
column: field,
|
|
4390
3680
|
rows: model.rows,
|
|
4391
3681
|
current: store.state.filters?.find((filter) => filter.id === field.id),
|
|
@@ -4398,20 +3688,20 @@ var ColumnHeaderMenu = ({
|
|
|
4398
3688
|
const sort = store.state.sort?.find(({ id }) => ownsSort(id));
|
|
4399
3689
|
const setSort = (id, direction) => send(DataTableMessage.SortRequested({ columnId: id, direction }));
|
|
4400
3690
|
const label = columnLabel(column);
|
|
4401
|
-
const sortItems = (field) => /* @__PURE__ */
|
|
3691
|
+
const sortItems = (field) => /* @__PURE__ */ jsxs3(Fragment, {
|
|
4402
3692
|
children: [
|
|
4403
|
-
/* @__PURE__ */
|
|
3693
|
+
/* @__PURE__ */ jsxs3(DropdownMenuItem, {
|
|
4404
3694
|
onClick: () => setSort(field.id, "asc"),
|
|
4405
3695
|
children: [
|
|
4406
|
-
/* @__PURE__ */
|
|
3696
|
+
/* @__PURE__ */ jsx3(ArrowUp, {}),
|
|
4407
3697
|
" ",
|
|
4408
3698
|
store.config.labels.sortAsc
|
|
4409
3699
|
]
|
|
4410
3700
|
}),
|
|
4411
|
-
/* @__PURE__ */
|
|
3701
|
+
/* @__PURE__ */ jsxs3(DropdownMenuItem, {
|
|
4412
3702
|
onClick: () => setSort(field.id, "desc"),
|
|
4413
3703
|
children: [
|
|
4414
|
-
/* @__PURE__ */
|
|
3704
|
+
/* @__PURE__ */ jsx3(ArrowDown, {}),
|
|
4415
3705
|
" ",
|
|
4416
3706
|
store.config.labels.sortDesc
|
|
4417
3707
|
]
|
|
@@ -4419,81 +3709,81 @@ var ColumnHeaderMenu = ({
|
|
|
4419
3709
|
]
|
|
4420
3710
|
});
|
|
4421
3711
|
if (!sortingEnabled && !hidingEnabled && !filteringEnabled) {
|
|
4422
|
-
return /* @__PURE__ */
|
|
3712
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
4423
3713
|
className: "truncate px-2",
|
|
4424
3714
|
children: column.colDef.headerName
|
|
4425
3715
|
});
|
|
4426
3716
|
}
|
|
4427
|
-
return /* @__PURE__ */
|
|
3717
|
+
return /* @__PURE__ */ jsxs3(DropdownMenu, {
|
|
4428
3718
|
children: [
|
|
4429
|
-
/* @__PURE__ */
|
|
4430
|
-
render: /* @__PURE__ */
|
|
3719
|
+
/* @__PURE__ */ jsx3(DropdownMenuTrigger, {
|
|
3720
|
+
render: /* @__PURE__ */ jsxs3(Button2, {
|
|
4431
3721
|
"aria-label": label,
|
|
4432
3722
|
"aria-description": activeFilters.length ? `${store.config.labels.filters}: ${activeFilters.length}` : undefined,
|
|
4433
3723
|
className: tableClasses.headerTrigger,
|
|
4434
3724
|
variant: "ghost",
|
|
4435
3725
|
children: [
|
|
4436
|
-
/* @__PURE__ */
|
|
3726
|
+
/* @__PURE__ */ jsx3("span", {
|
|
4437
3727
|
className: "truncate",
|
|
4438
3728
|
children: column.colDef.headerName
|
|
4439
3729
|
}),
|
|
4440
|
-
activeFilters.length ? /* @__PURE__ */
|
|
4441
|
-
sort ? sort.direction === "desc" ? /* @__PURE__ */
|
|
3730
|
+
activeFilters.length ? /* @__PURE__ */ jsx3(ListFilter, {}) : null,
|
|
3731
|
+
sort ? sort.direction === "desc" ? /* @__PURE__ */ jsx3(ArrowDown, {}) : /* @__PURE__ */ jsx3(ArrowUp, {}) : null
|
|
4442
3732
|
]
|
|
4443
3733
|
})
|
|
4444
3734
|
}),
|
|
4445
|
-
/* @__PURE__ */
|
|
3735
|
+
/* @__PURE__ */ jsx3(DropdownMenuContent, {
|
|
4446
3736
|
align: "start",
|
|
4447
3737
|
className: "w-48",
|
|
4448
|
-
children: /* @__PURE__ */
|
|
3738
|
+
children: /* @__PURE__ */ jsxs3(DropdownMenuGroup, {
|
|
4449
3739
|
children: [
|
|
4450
|
-
sortingEnabled ? /* @__PURE__ */
|
|
3740
|
+
sortingEnabled ? /* @__PURE__ */ jsxs3(Fragment, {
|
|
4451
3741
|
children: [
|
|
4452
|
-
column.colDef.fields?.length ? sortColumns.map((field) => /* @__PURE__ */
|
|
3742
|
+
column.colDef.fields?.length ? sortColumns.map((field) => /* @__PURE__ */ jsxs3(DropdownMenuSub, {
|
|
4453
3743
|
children: [
|
|
4454
|
-
/* @__PURE__ */
|
|
3744
|
+
/* @__PURE__ */ jsx3(DropdownMenuSubTrigger, {
|
|
4455
3745
|
children: columnLabel(field)
|
|
4456
3746
|
}),
|
|
4457
|
-
/* @__PURE__ */
|
|
4458
|
-
children: /* @__PURE__ */
|
|
3747
|
+
/* @__PURE__ */ jsx3(DropdownMenuSubContent, {
|
|
3748
|
+
children: /* @__PURE__ */ jsx3(DropdownMenuGroup, {
|
|
4459
3749
|
children: sortItems(field)
|
|
4460
3750
|
})
|
|
4461
3751
|
})
|
|
4462
3752
|
]
|
|
4463
3753
|
}, field.id)) : sortItems(column),
|
|
4464
|
-
sort ? /* @__PURE__ */
|
|
3754
|
+
sort ? /* @__PURE__ */ jsxs3(DropdownMenuItem, {
|
|
4465
3755
|
onClick: () => send(DataTableMessage.ColumnSortCleared({ id: column.id })),
|
|
4466
3756
|
children: [
|
|
4467
|
-
/* @__PURE__ */
|
|
3757
|
+
/* @__PURE__ */ jsx3(X, {}),
|
|
4468
3758
|
" ",
|
|
4469
3759
|
store.config.labels.sortClear
|
|
4470
3760
|
]
|
|
4471
3761
|
}) : null
|
|
4472
3762
|
]
|
|
4473
3763
|
}) : null,
|
|
4474
|
-
sortingEnabled && filteringEnabled ? /* @__PURE__ */
|
|
4475
|
-
filteringEnabled ? /* @__PURE__ */
|
|
3764
|
+
sortingEnabled && filteringEnabled ? /* @__PURE__ */ jsx3(DropdownMenuSeparator, {}) : null,
|
|
3765
|
+
filteringEnabled ? /* @__PURE__ */ jsxs3(Fragment, {
|
|
4476
3766
|
children: [
|
|
4477
|
-
/* @__PURE__ */
|
|
3767
|
+
/* @__PURE__ */ jsxs3(DropdownMenuSub, {
|
|
4478
3768
|
children: [
|
|
4479
|
-
/* @__PURE__ */
|
|
3769
|
+
/* @__PURE__ */ jsxs3(DropdownMenuSubTrigger, {
|
|
4480
3770
|
children: [
|
|
4481
|
-
/* @__PURE__ */
|
|
3771
|
+
/* @__PURE__ */ jsx3(ListFilter, {}),
|
|
4482
3772
|
store.config.labels.filters
|
|
4483
3773
|
]
|
|
4484
3774
|
}),
|
|
4485
|
-
/* @__PURE__ */
|
|
3775
|
+
/* @__PURE__ */ jsx3(DropdownMenuSubContent, {
|
|
4486
3776
|
className: "w-80 max-w-[calc(100vw-2rem)]",
|
|
4487
|
-
children: column.colDef.fields?.length ? /* @__PURE__ */
|
|
4488
|
-
children: filterColumns.map((field) => /* @__PURE__ */
|
|
3777
|
+
children: column.colDef.fields?.length ? /* @__PURE__ */ jsx3(DropdownMenuGroup, {
|
|
3778
|
+
children: filterColumns.map((field) => /* @__PURE__ */ jsxs3(DropdownMenuSub, {
|
|
4489
3779
|
children: [
|
|
4490
|
-
/* @__PURE__ */
|
|
3780
|
+
/* @__PURE__ */ jsxs3(DropdownMenuSubTrigger, {
|
|
4491
3781
|
children: [
|
|
4492
3782
|
columnLabel(field),
|
|
4493
|
-
activeFilters.some((filter) => filter.id === field.id) ? /* @__PURE__ */
|
|
3783
|
+
activeFilters.some((filter) => filter.id === field.id) ? /* @__PURE__ */ jsx3(Check, {}) : null
|
|
4494
3784
|
]
|
|
4495
3785
|
}),
|
|
4496
|
-
/* @__PURE__ */
|
|
3786
|
+
/* @__PURE__ */ jsx3(DropdownMenuSubContent, {
|
|
4497
3787
|
className: "w-80 max-w-[calc(100vw-2rem)]",
|
|
4498
3788
|
children: filterEditor(field)
|
|
4499
3789
|
})
|
|
@@ -4503,23 +3793,23 @@ var ColumnHeaderMenu = ({
|
|
|
4503
3793
|
})
|
|
4504
3794
|
]
|
|
4505
3795
|
}),
|
|
4506
|
-
activeFilters.length ? /* @__PURE__ */
|
|
3796
|
+
activeFilters.length ? /* @__PURE__ */ jsxs3(DropdownMenuItem, {
|
|
4507
3797
|
onClick: () => send(DataTableMessage.ColumnFiltersCleared({ id: column.id })),
|
|
4508
3798
|
children: [
|
|
4509
|
-
/* @__PURE__ */
|
|
3799
|
+
/* @__PURE__ */ jsx3(X, {}),
|
|
4510
3800
|
store.config.labels.filterClear
|
|
4511
3801
|
]
|
|
4512
3802
|
}) : null
|
|
4513
3803
|
]
|
|
4514
3804
|
}) : null,
|
|
4515
|
-
(sortingEnabled || filteringEnabled) && hidingEnabled ? /* @__PURE__ */
|
|
4516
|
-
hidingEnabled ? /* @__PURE__ */
|
|
3805
|
+
(sortingEnabled || filteringEnabled) && hidingEnabled ? /* @__PURE__ */ jsx3(DropdownMenuSeparator, {}) : null,
|
|
3806
|
+
hidingEnabled ? /* @__PURE__ */ jsxs3(DropdownMenuItem, {
|
|
4517
3807
|
onClick: () => send(DataTableMessage.ColumnVisibilityChanged({
|
|
4518
3808
|
id: column.id,
|
|
4519
3809
|
visible: false
|
|
4520
3810
|
})),
|
|
4521
3811
|
children: [
|
|
4522
|
-
/* @__PURE__ */
|
|
3812
|
+
/* @__PURE__ */ jsx3(EyeOff, {}),
|
|
4523
3813
|
" ",
|
|
4524
3814
|
store.config.labels.hideColumn
|
|
4525
3815
|
]
|
|
@@ -4542,16 +3832,16 @@ var DataTableHeader = ({
|
|
|
4542
3832
|
const selectableRows = model.pageRows.filter((row) => !selection || (selection.isRowSelectable?.(row.data) ?? true));
|
|
4543
3833
|
const allSelected = selectableRows.length > 0 && selectableRows.every((row) => store.state.rowSelection[row.id]);
|
|
4544
3834
|
const someSelected = selectableRows.some((row) => store.state.rowSelection[row.id]);
|
|
4545
|
-
return /* @__PURE__ */
|
|
3835
|
+
return /* @__PURE__ */ jsx3(TableHeader, {
|
|
4546
3836
|
className: sticky ? cn(tableClasses.stickyHeader, tableClasses.stickyHeaderRule, "[&_tr]:border-b-0") : undefined,
|
|
4547
|
-
children: /* @__PURE__ */
|
|
3837
|
+
children: /* @__PURE__ */ jsxs3(TableRow, {
|
|
4548
3838
|
"aria-rowindex": sticky ? 1 : undefined,
|
|
4549
3839
|
children: [
|
|
4550
|
-
selection ? /* @__PURE__ */
|
|
3840
|
+
selection ? /* @__PURE__ */ jsx3(TableHead, {
|
|
4551
3841
|
className: tableClasses.selectionCell,
|
|
4552
|
-
children: /* @__PURE__ */
|
|
3842
|
+
children: /* @__PURE__ */ jsx3("div", {
|
|
4553
3843
|
className: tableClasses.selectionCenter,
|
|
4554
|
-
children: /* @__PURE__ */
|
|
3844
|
+
children: /* @__PURE__ */ jsx3(Checkbox, {
|
|
4555
3845
|
"aria-label": store.config.labels.selectAllRows,
|
|
4556
3846
|
checked: allSelected,
|
|
4557
3847
|
indeterminate: someSelected && !allSelected,
|
|
@@ -4564,30 +3854,30 @@ var DataTableHeader = ({
|
|
|
4564
3854
|
})
|
|
4565
3855
|
})
|
|
4566
3856
|
}) : null,
|
|
4567
|
-
draggable ? /* @__PURE__ */
|
|
3857
|
+
draggable ? /* @__PURE__ */ jsx3(TableHead, {
|
|
4568
3858
|
className: "w-10"
|
|
4569
3859
|
}) : null,
|
|
4570
3860
|
model.visibleColumns.map((column) => {
|
|
4571
3861
|
const direction = store.state.sort?.find(({ id }) => id === column.id)?.direction;
|
|
4572
|
-
return /* @__PURE__ */
|
|
3862
|
+
return /* @__PURE__ */ jsx3(TableHead, {
|
|
4573
3863
|
"aria-sort": direction === "asc" ? "ascending" : direction === "desc" ? "descending" : undefined,
|
|
4574
3864
|
className: tableClasses.header,
|
|
4575
3865
|
scope: "col",
|
|
4576
3866
|
style: { width: column.width },
|
|
4577
|
-
children: /* @__PURE__ */
|
|
3867
|
+
children: /* @__PURE__ */ jsxs3(ColumnIdContext.Provider, {
|
|
4578
3868
|
value: column.id,
|
|
4579
3869
|
children: [
|
|
4580
|
-
/* @__PURE__ */
|
|
3870
|
+
/* @__PURE__ */ jsx3(ColumnHeaderMenu, {
|
|
4581
3871
|
table
|
|
4582
3872
|
}),
|
|
4583
|
-
/* @__PURE__ */
|
|
3873
|
+
/* @__PURE__ */ jsx3(ResizeHandle, {
|
|
4584
3874
|
table
|
|
4585
3875
|
})
|
|
4586
3876
|
]
|
|
4587
3877
|
})
|
|
4588
3878
|
}, column.id);
|
|
4589
3879
|
}),
|
|
4590
|
-
hasRowActionMenu(store) ? /* @__PURE__ */
|
|
3880
|
+
hasRowActionMenu(store) ? /* @__PURE__ */ jsx3(TableHead, {
|
|
4591
3881
|
className: "w-10"
|
|
4592
3882
|
}) : null
|
|
4593
3883
|
]
|
|
@@ -4605,7 +3895,7 @@ var VirtualTableRows = ({
|
|
|
4605
3895
|
const { element: scrollElement, headerHeight } = viewport;
|
|
4606
3896
|
const pageScroll = viewport.options.scroll === "page";
|
|
4607
3897
|
const scrollMargin = viewport.pageOffset ?? headerHeight;
|
|
4608
|
-
const entries =
|
|
3898
|
+
const entries = useMemo(() => {
|
|
4609
3899
|
const result = [];
|
|
4610
3900
|
const addSections = (groups) => {
|
|
4611
3901
|
for (const section of groups) {
|
|
@@ -4669,39 +3959,39 @@ var VirtualTableRows = ({
|
|
|
4669
3959
|
const last = items.at(-1);
|
|
4670
3960
|
const before = first ? first.start - scrollMargin : 0;
|
|
4671
3961
|
const after = virtualizer.getTotalSize() - (last ? last.end - scrollMargin : 0);
|
|
4672
|
-
const spacer = (height) => height > 0 ? /* @__PURE__ */
|
|
3962
|
+
const spacer = (height) => height > 0 ? /* @__PURE__ */ jsx3("tr", {
|
|
4673
3963
|
"aria-hidden": "true",
|
|
4674
|
-
children: /* @__PURE__ */
|
|
3964
|
+
children: /* @__PURE__ */ jsx3("td", {
|
|
4675
3965
|
colSpan: Math.max(1, colSpan),
|
|
4676
3966
|
className: "border-0 p-0",
|
|
4677
3967
|
style: { height }
|
|
4678
3968
|
})
|
|
4679
3969
|
}) : null;
|
|
4680
|
-
return /* @__PURE__ */
|
|
3970
|
+
return /* @__PURE__ */ jsxs3(Fragment, {
|
|
4681
3971
|
children: [
|
|
4682
3972
|
spacer(before),
|
|
4683
3973
|
items.map(({ index, key }) => {
|
|
4684
3974
|
const entry = entries[index];
|
|
4685
3975
|
if (entry.kind === "data")
|
|
4686
|
-
return /* @__PURE__ */
|
|
3976
|
+
return /* @__PURE__ */ jsx3(TableDataRow, {
|
|
4687
3977
|
measureRef: virtualizer.measureElement,
|
|
4688
3978
|
row: entry.row,
|
|
4689
3979
|
table,
|
|
4690
3980
|
virtualIndex: index
|
|
4691
3981
|
}, key);
|
|
4692
3982
|
if (entry.kind === "header")
|
|
4693
|
-
return /* @__PURE__ */
|
|
3983
|
+
return /* @__PURE__ */ jsx3(GroupHeaderRow, {
|
|
4694
3984
|
measureRef: virtualizer.measureElement,
|
|
4695
3985
|
section: entry.section,
|
|
4696
3986
|
colSpan,
|
|
4697
3987
|
table,
|
|
4698
3988
|
virtualIndex: index
|
|
4699
3989
|
}, key);
|
|
4700
|
-
return /* @__PURE__ */
|
|
3990
|
+
return /* @__PURE__ */ jsx3(TableRow, {
|
|
4701
3991
|
ref: virtualizer.measureElement,
|
|
4702
3992
|
"data-index": index,
|
|
4703
3993
|
"aria-rowindex": index + 2,
|
|
4704
|
-
children: /* @__PURE__ */
|
|
3994
|
+
children: /* @__PURE__ */ jsx3(TableCell, {
|
|
4705
3995
|
className: "text-muted-foreground h-16",
|
|
4706
3996
|
colSpan,
|
|
4707
3997
|
children: entry.section.field.renderEmptyGroup?.(entry.section.groupId) ?? config.labels.empty
|
|
@@ -4721,42 +4011,42 @@ var DataTableBody = ({
|
|
|
4721
4011
|
const model = deriveModel(store);
|
|
4722
4012
|
const fields = getActiveGrouping(store);
|
|
4723
4013
|
const rows = model.pageRows;
|
|
4724
|
-
const sections =
|
|
4014
|
+
const sections = useMemo(() => groupDataTableRows(rows, fields), [rows, fields]);
|
|
4725
4015
|
const colSpan = model.visibleColumns.length + (store.config.features.selection ? 1 : 0) + (hasRowActionMenu(store) ? 1 : 0) + (canDragRows(store) ? 1 : 0);
|
|
4726
4016
|
const showGroups = sections.length && (rows.length || !store.config.status.loading) && !store.config.status.error;
|
|
4727
4017
|
if (showGroups && !viewport) {
|
|
4728
|
-
return /* @__PURE__ */
|
|
4018
|
+
return /* @__PURE__ */ jsx3(GroupedTable, {
|
|
4729
4019
|
table,
|
|
4730
4020
|
sections
|
|
4731
4021
|
});
|
|
4732
4022
|
}
|
|
4733
|
-
return /* @__PURE__ */
|
|
4734
|
-
children: store.config.status.error || !showGroups && !rows.length && !store.config.status.loading ? /* @__PURE__ */
|
|
4735
|
-
children: /* @__PURE__ */
|
|
4023
|
+
return /* @__PURE__ */ jsx3(TableBody, {
|
|
4024
|
+
children: store.config.status.error || !showGroups && !rows.length && !store.config.status.loading ? /* @__PURE__ */ jsx3(TableRow, {
|
|
4025
|
+
children: /* @__PURE__ */ jsx3(TableCell, {
|
|
4736
4026
|
"data-table-slot": store.config.status.error ? "error" : "empty",
|
|
4737
4027
|
className: cn("h-24 text-center", store.config.status.error ? styles?.feedback?.error : styles?.feedback?.empty),
|
|
4738
4028
|
colSpan: Math.max(colSpan, 1),
|
|
4739
4029
|
children: store.config.status.error ?? store.config.status.empty ?? store.config.labels.empty
|
|
4740
4030
|
})
|
|
4741
|
-
}) : !showGroups && store.config.status.loading && !rows.length ? /* @__PURE__ */
|
|
4742
|
-
children: /* @__PURE__ */
|
|
4031
|
+
}) : !showGroups && store.config.status.loading && !rows.length ? /* @__PURE__ */ jsx3(TableRow, {
|
|
4032
|
+
children: /* @__PURE__ */ jsx3(TableCell, {
|
|
4743
4033
|
"data-table-slot": "loading",
|
|
4744
4034
|
className: cn("h-24 p-0", styles?.feedback?.loading),
|
|
4745
4035
|
colSpan: Math.max(colSpan, 1),
|
|
4746
|
-
children: /* @__PURE__ */
|
|
4036
|
+
children: /* @__PURE__ */ jsx3(Loading, {
|
|
4747
4037
|
className: "sticky left-0 w-[100cqw] max-w-full px-2",
|
|
4748
4038
|
label: store.config.labels.loading
|
|
4749
4039
|
})
|
|
4750
4040
|
})
|
|
4751
|
-
}) : viewport ? /* @__PURE__ */
|
|
4041
|
+
}) : viewport ? /* @__PURE__ */ jsx3(VirtualTableRows, {
|
|
4752
4042
|
colSpan,
|
|
4753
4043
|
rows,
|
|
4754
4044
|
sections,
|
|
4755
4045
|
table,
|
|
4756
4046
|
viewport
|
|
4757
|
-
}) : rows.map((row) => /* @__PURE__ */
|
|
4047
|
+
}) : rows.map((row) => /* @__PURE__ */ jsx3(RowIdContext.Provider, {
|
|
4758
4048
|
value: row.id,
|
|
4759
|
-
children: /* @__PURE__ */
|
|
4049
|
+
children: /* @__PURE__ */ jsx3(TableDataRow, {
|
|
4760
4050
|
row,
|
|
4761
4051
|
table
|
|
4762
4052
|
})
|
|
@@ -4774,13 +4064,13 @@ var GalleryTag = ({
|
|
|
4774
4064
|
if ((value == null || value === "") && !column.colDef.cellRenderer)
|
|
4775
4065
|
return null;
|
|
4776
4066
|
const content = renderCell(row, column, locale, labels);
|
|
4777
|
-
return column.colDef.cellRenderer || column.colDef.valueFormatter ? /* @__PURE__ */
|
|
4067
|
+
return column.colDef.cellRenderer || column.colDef.valueFormatter ? /* @__PURE__ */ jsxs3("div", {
|
|
4778
4068
|
className: "flex min-w-0 items-center gap-1",
|
|
4779
4069
|
children: [
|
|
4780
4070
|
icon,
|
|
4781
4071
|
content
|
|
4782
4072
|
]
|
|
4783
|
-
}) : /* @__PURE__ */
|
|
4073
|
+
}) : /* @__PURE__ */ jsxs3(Badge, {
|
|
4784
4074
|
variant: "secondary",
|
|
4785
4075
|
children: [
|
|
4786
4076
|
icon,
|
|
@@ -4808,7 +4098,7 @@ var GalleryCard = ({
|
|
|
4808
4098
|
const selection = store.config.features.selection;
|
|
4809
4099
|
const selectable = !!selection && (selection.isRowSelectable?.(row.data) ?? true);
|
|
4810
4100
|
const draggable = canDragRows(store);
|
|
4811
|
-
return /* @__PURE__ */
|
|
4101
|
+
return /* @__PURE__ */ jsxs3(Card, {
|
|
4812
4102
|
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"),
|
|
4813
4103
|
"data-table-row": row.id,
|
|
4814
4104
|
onClick: () => store.config.onRowClicked?.(row.data),
|
|
@@ -4820,7 +4110,7 @@ var GalleryCard = ({
|
|
|
4820
4110
|
},
|
|
4821
4111
|
tabIndex: store.config.onRowClicked ? 0 : undefined,
|
|
4822
4112
|
children: [
|
|
4823
|
-
imageSrc && !store.ui.failedImages.includes(imageSrc) ? /* @__PURE__ */
|
|
4113
|
+
imageSrc && !store.ui.failedImages.includes(imageSrc) ? /* @__PURE__ */ jsx3("img", {
|
|
4824
4114
|
src: imageSrc,
|
|
4825
4115
|
alt: gallery.image?.getAlt?.(row.data) ?? "",
|
|
4826
4116
|
loading: "lazy",
|
|
@@ -4828,32 +4118,32 @@ var GalleryCard = ({
|
|
|
4828
4118
|
className: "aspect-video w-full object-cover",
|
|
4829
4119
|
onError: () => send(DataTableMessage.ReferenceImageFailed({ src: imageSrc }))
|
|
4830
4120
|
}) : null,
|
|
4831
|
-
/* @__PURE__ */
|
|
4121
|
+
/* @__PURE__ */ jsxs3(CardHeader, {
|
|
4832
4122
|
className: cn("relative", hasRowActionMenu(store) && "pr-12"),
|
|
4833
4123
|
children: [
|
|
4834
|
-
selection || draggable ? /* @__PURE__ */
|
|
4124
|
+
selection || draggable ? /* @__PURE__ */ jsxs3("div", {
|
|
4835
4125
|
className: "flex items-center gap-2",
|
|
4836
4126
|
children: [
|
|
4837
|
-
selection ? /* @__PURE__ */
|
|
4127
|
+
selection ? /* @__PURE__ */ jsx3(Checkbox, {
|
|
4838
4128
|
"aria-label": store.config.labels.selectRow,
|
|
4839
4129
|
checked: !!store.state.rowSelection[row.id],
|
|
4840
4130
|
disabled: !selectable,
|
|
4841
4131
|
onCheckedChange: (checked) => toggleRow(send, row.id, checked),
|
|
4842
4132
|
onClick: (event) => event.stopPropagation()
|
|
4843
4133
|
}) : null,
|
|
4844
|
-
draggable ? /* @__PURE__ */
|
|
4134
|
+
draggable ? /* @__PURE__ */ jsx3(DragHandle, {
|
|
4845
4135
|
table
|
|
4846
4136
|
}) : null
|
|
4847
4137
|
]
|
|
4848
4138
|
}) : null,
|
|
4849
|
-
/* @__PURE__ */
|
|
4139
|
+
/* @__PURE__ */ jsx3(CardTitle, {
|
|
4850
4140
|
children: name ? renderCell(row, name, store.config.locale, store.config.labels) : row.id
|
|
4851
4141
|
}),
|
|
4852
|
-
tagIds.length ? /* @__PURE__ */
|
|
4142
|
+
tagIds.length ? /* @__PURE__ */ jsx3("div", {
|
|
4853
4143
|
className: "flex flex-wrap items-center gap-2",
|
|
4854
4144
|
children: tagIds.map((id) => {
|
|
4855
4145
|
const column = find(id);
|
|
4856
|
-
return column ? /* @__PURE__ */
|
|
4146
|
+
return column ? /* @__PURE__ */ jsx3(GalleryTag, {
|
|
4857
4147
|
row,
|
|
4858
4148
|
column,
|
|
4859
4149
|
locale: store.config.locale,
|
|
@@ -4862,14 +4152,14 @@ var GalleryCard = ({
|
|
|
4862
4152
|
}, id) : null;
|
|
4863
4153
|
})
|
|
4864
4154
|
}) : null,
|
|
4865
|
-
description ? /* @__PURE__ */
|
|
4155
|
+
description ? /* @__PURE__ */ jsx3("div", {
|
|
4866
4156
|
className: "text-muted-foreground line-clamp-3 text-sm",
|
|
4867
4157
|
children: renderCell(row, description, store.config.locale, store.config.labels)
|
|
4868
4158
|
}) : null,
|
|
4869
|
-
hasRowActionMenu(store) ? /* @__PURE__ */
|
|
4159
|
+
hasRowActionMenu(store) ? /* @__PURE__ */ jsx3("div", {
|
|
4870
4160
|
className: "absolute top-0 right-4",
|
|
4871
4161
|
onClick: (event) => event.stopPropagation(),
|
|
4872
|
-
children: /* @__PURE__ */
|
|
4162
|
+
children: /* @__PURE__ */ jsx3(DataTableRowActionMenu, {
|
|
4873
4163
|
row,
|
|
4874
4164
|
table
|
|
4875
4165
|
})
|
|
@@ -4889,35 +4179,35 @@ var DataTableGallery = ({
|
|
|
4889
4179
|
const rows = model.pageRows;
|
|
4890
4180
|
const sections = groupDataTableRows(rows, fields);
|
|
4891
4181
|
if (store.config.status.error) {
|
|
4892
|
-
return /* @__PURE__ */
|
|
4182
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
4893
4183
|
"data-table-slot": "error",
|
|
4894
4184
|
className: cn("text-destructive rounded-lg border border-dashed p-10 text-center", styles?.feedback?.error),
|
|
4895
4185
|
children: store.config.status.error
|
|
4896
4186
|
});
|
|
4897
4187
|
}
|
|
4898
4188
|
if (store.config.status.loading && !rows.length) {
|
|
4899
|
-
return /* @__PURE__ */
|
|
4189
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
4900
4190
|
"data-table-slot": "loading",
|
|
4901
4191
|
className: cn("rounded-lg border border-dashed p-10 text-center", styles?.feedback?.loading),
|
|
4902
|
-
children: /* @__PURE__ */
|
|
4192
|
+
children: /* @__PURE__ */ jsx3(Loading, {
|
|
4903
4193
|
label: store.config.labels.loading
|
|
4904
4194
|
})
|
|
4905
4195
|
});
|
|
4906
4196
|
}
|
|
4907
4197
|
if (!rows.length && !sections.length) {
|
|
4908
|
-
return /* @__PURE__ */
|
|
4198
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
4909
4199
|
"data-table-slot": "empty",
|
|
4910
4200
|
className: cn("text-muted-foreground rounded-lg border border-dashed p-10 text-center", styles?.feedback?.empty),
|
|
4911
4201
|
children: store.config.status.empty ?? store.config.labels.empty
|
|
4912
4202
|
});
|
|
4913
4203
|
}
|
|
4914
4204
|
if (!fields.length) {
|
|
4915
|
-
return /* @__PURE__ */
|
|
4205
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
4916
4206
|
"data-table-slot": "gallery",
|
|
4917
4207
|
className: cn("grid gap-3 sm:grid-cols-2 xl:grid-cols-3", styles?.gallery),
|
|
4918
|
-
children: rows.map((row) => /* @__PURE__ */
|
|
4208
|
+
children: rows.map((row) => /* @__PURE__ */ jsx3(RowIdContext.Provider, {
|
|
4919
4209
|
value: row.id,
|
|
4920
|
-
children: /* @__PURE__ */
|
|
4210
|
+
children: /* @__PURE__ */ jsx3(GalleryCard, {
|
|
4921
4211
|
table
|
|
4922
4212
|
})
|
|
4923
4213
|
}, row.id))
|
|
@@ -4927,58 +4217,58 @@ var DataTableGallery = ({
|
|
|
4927
4217
|
const collapsed = !!store.state.collapsedGroups[section.key];
|
|
4928
4218
|
const targetKey = getGroupDropKey(section.field.id, section.groupId);
|
|
4929
4219
|
const toggleCollapsed = () => send(DataTableMessage.GroupToggled({ key: section.key }));
|
|
4930
|
-
return /* @__PURE__ */
|
|
4220
|
+
return /* @__PURE__ */ jsxs3("section", {
|
|
4931
4221
|
className: "data-[drop-target=true]:ring-primary space-y-3 rounded-lg transition-shadow data-[drop-target=true]:ring-2",
|
|
4932
4222
|
"data-table-group": section.field.onMoveToGroup ? targetKey : undefined,
|
|
4933
4223
|
children: [
|
|
4934
|
-
/* @__PURE__ */
|
|
4224
|
+
/* @__PURE__ */ jsxs3("div", {
|
|
4935
4225
|
className: "hover:bg-accent flex cursor-pointer items-center gap-2 rounded-lg border p-3 transition-colors",
|
|
4936
4226
|
onClick: toggleCollapsed,
|
|
4937
4227
|
children: [
|
|
4938
|
-
/* @__PURE__ */
|
|
4228
|
+
/* @__PURE__ */ jsxs3("button", {
|
|
4939
4229
|
"aria-expanded": !collapsed,
|
|
4940
4230
|
className: "flex flex-1 cursor-pointer items-center gap-2 text-left font-medium",
|
|
4941
4231
|
type: "button",
|
|
4942
4232
|
children: [
|
|
4943
|
-
collapsed ? /* @__PURE__ */
|
|
4233
|
+
collapsed ? /* @__PURE__ */ jsx3(ChevronRight2, {
|
|
4944
4234
|
className: "size-4"
|
|
4945
|
-
}) : /* @__PURE__ */
|
|
4235
|
+
}) : /* @__PURE__ */ jsx3(ChevronDown, {
|
|
4946
4236
|
className: "size-4"
|
|
4947
4237
|
}),
|
|
4948
|
-
/* @__PURE__ */
|
|
4238
|
+
/* @__PURE__ */ jsx3("span", {
|
|
4949
4239
|
className: "flex-1",
|
|
4950
4240
|
children: section.field.renderGroupLabel?.(section.groupId, section.rows.map((row) => row.data)) ?? section.groupId
|
|
4951
4241
|
}),
|
|
4952
|
-
/* @__PURE__ */
|
|
4242
|
+
/* @__PURE__ */ jsx3(Badge, {
|
|
4953
4243
|
variant: "secondary",
|
|
4954
4244
|
children: section.rows.length
|
|
4955
4245
|
})
|
|
4956
4246
|
]
|
|
4957
4247
|
}),
|
|
4958
|
-
/* @__PURE__ */
|
|
4248
|
+
/* @__PURE__ */ jsx3(GroupActions, {
|
|
4959
4249
|
actions: section.field.actions,
|
|
4960
4250
|
groupId: section.groupId,
|
|
4961
4251
|
title: section.field.actionsLabel ?? store.config.labels.actions
|
|
4962
4252
|
})
|
|
4963
4253
|
]
|
|
4964
4254
|
}),
|
|
4965
|
-
!collapsed ? section.children.length ? renderSections(section.children) : section.rows.length ? /* @__PURE__ */
|
|
4255
|
+
!collapsed ? section.children.length ? renderSections(section.children) : section.rows.length ? /* @__PURE__ */ jsx3("div", {
|
|
4966
4256
|
"data-table-slot": "gallery",
|
|
4967
4257
|
className: cn("grid gap-3 sm:grid-cols-2 xl:grid-cols-3", styles?.gallery),
|
|
4968
|
-
children: section.rows.map((row) => /* @__PURE__ */
|
|
4258
|
+
children: section.rows.map((row) => /* @__PURE__ */ jsx3(RowIdContext.Provider, {
|
|
4969
4259
|
value: row.id,
|
|
4970
|
-
children: /* @__PURE__ */
|
|
4260
|
+
children: /* @__PURE__ */ jsx3(GalleryCard, {
|
|
4971
4261
|
table
|
|
4972
4262
|
})
|
|
4973
4263
|
}, `${section.key}:${row.id}`))
|
|
4974
|
-
}) : /* @__PURE__ */
|
|
4264
|
+
}) : /* @__PURE__ */ jsx3("div", {
|
|
4975
4265
|
className: "text-muted-foreground rounded-lg border border-dashed p-8 text-center",
|
|
4976
4266
|
children: section.field.renderEmptyGroup?.(section.groupId) ?? store.config.labels.empty
|
|
4977
4267
|
}) : null
|
|
4978
4268
|
]
|
|
4979
4269
|
}, section.key);
|
|
4980
4270
|
});
|
|
4981
|
-
return /* @__PURE__ */
|
|
4271
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
4982
4272
|
className: "space-y-4",
|
|
4983
4273
|
children: renderSections(sections)
|
|
4984
4274
|
});
|
|
@@ -5000,10 +4290,10 @@ var DataTablePagination = ({
|
|
|
5000
4290
|
if (!paginationVisible || !pagination)
|
|
5001
4291
|
return null;
|
|
5002
4292
|
const selected = model.rows.filter((row) => store.state.rowSelection[row.id]).length;
|
|
5003
|
-
return /* @__PURE__ */
|
|
4293
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
5004
4294
|
"data-table-slot": "pagination",
|
|
5005
4295
|
className: cn("shrink-0 pt-4", styles?.pagination),
|
|
5006
|
-
children: /* @__PURE__ */
|
|
4296
|
+
children: /* @__PURE__ */ jsx3(Pagination, {
|
|
5007
4297
|
pageSizeContentClassName: styles?.popup?.select,
|
|
5008
4298
|
locale: store.config.locale,
|
|
5009
4299
|
messages: { [store.config.locale]: store.config.labels },
|
|
@@ -5052,10 +4342,10 @@ var modelColumns = (definitions) => normalizeDataTableColumns(definitions).map((
|
|
|
5052
4342
|
});
|
|
5053
4343
|
var getTableLayoutClass = (virtualization) => virtualization && virtualization !== true && virtualization.scroll === "internal" ? "flex min-h-0 flex-1 flex-col" : undefined;
|
|
5054
4344
|
var HydratedDataTable = (props) => {
|
|
5055
|
-
const config =
|
|
5056
|
-
const columns =
|
|
4345
|
+
const config = useMemo(() => resolveConfig(props), [props]);
|
|
4346
|
+
const columns = useMemo(() => modelColumns(props.columnDefs), [props.columnDefs]);
|
|
5057
4347
|
const selection = config.features.selection;
|
|
5058
|
-
const modelProps =
|
|
4348
|
+
const modelProps = useMemo(() => {
|
|
5059
4349
|
const { features } = config;
|
|
5060
4350
|
const grouping = features.grouping;
|
|
5061
4351
|
const pagination = features.pagination;
|
|
@@ -5153,7 +4443,7 @@ var HydratedDataTable = (props) => {
|
|
|
5153
4443
|
const query = modelProps.state ?? model.query;
|
|
5154
4444
|
const { collapsedGroups, selectedRowIds } = model;
|
|
5155
4445
|
const galleryEnabled = !!props.features?.gallery;
|
|
5156
|
-
const state =
|
|
4446
|
+
const state = useMemo(() => ({
|
|
5157
4447
|
...query,
|
|
5158
4448
|
columnVisibility,
|
|
5159
4449
|
columnSizing,
|
|
@@ -5171,7 +4461,7 @@ var HydratedDataTable = (props) => {
|
|
|
5171
4461
|
collapsedGroups,
|
|
5172
4462
|
selectedRowIds
|
|
5173
4463
|
]);
|
|
5174
|
-
const store =
|
|
4464
|
+
const store = useMemo(() => {
|
|
5175
4465
|
const source = {
|
|
5176
4466
|
rowData: props.rowData,
|
|
5177
4467
|
columnDefs: props.columnDefs,
|
|
@@ -5182,20 +4472,20 @@ var HydratedDataTable = (props) => {
|
|
|
5182
4472
|
}, [props.rowData, props.columnDefs, config, state]);
|
|
5183
4473
|
const table = [{ ...store, ui: model }, send];
|
|
5184
4474
|
if (!preferencesLoaded)
|
|
5185
|
-
return /* @__PURE__ */
|
|
4475
|
+
return /* @__PURE__ */ jsx3(TablePlaceholder, {
|
|
5186
4476
|
props
|
|
5187
4477
|
});
|
|
5188
|
-
return /* @__PURE__ */
|
|
4478
|
+
return /* @__PURE__ */ jsxs3("div", {
|
|
5189
4479
|
className: cn("w-full max-w-full min-w-0 rounded-md", getTableLayoutClass(props.features?.virtualization), props.className),
|
|
5190
4480
|
"data-table-root": "",
|
|
5191
4481
|
children: [
|
|
5192
|
-
/* @__PURE__ */
|
|
4482
|
+
/* @__PURE__ */ jsx3(DataTableToolbar, {
|
|
5193
4483
|
table
|
|
5194
4484
|
}),
|
|
5195
|
-
/* @__PURE__ */
|
|
4485
|
+
/* @__PURE__ */ jsx3(DataTableContent, {
|
|
5196
4486
|
table
|
|
5197
4487
|
}),
|
|
5198
|
-
/* @__PURE__ */
|
|
4488
|
+
/* @__PURE__ */ jsx3(DataTablePagination, {
|
|
5199
4489
|
table
|
|
5200
4490
|
})
|
|
5201
4491
|
]
|
|
@@ -5206,7 +4496,7 @@ var clientSnapshot = () => true;
|
|
|
5206
4496
|
var serverSnapshot = () => false;
|
|
5207
4497
|
var TablePlaceholder = ({
|
|
5208
4498
|
props
|
|
5209
|
-
}) => /* @__PURE__ */
|
|
4499
|
+
}) => /* @__PURE__ */ jsx3("div", {
|
|
5210
4500
|
"aria-busy": "true",
|
|
5211
4501
|
className: cn("invisible w-full max-w-full min-w-0 rounded-md", getTableLayoutClass(props.features?.virtualization), props.className),
|
|
5212
4502
|
"data-table-root": ""
|
|
@@ -5215,14 +4505,14 @@ var DataTable = (props) => {
|
|
|
5215
4505
|
const locale = useKrakstackLocale3(props.locale);
|
|
5216
4506
|
const hydrated = useSyncExternalStore(subscribeToHydration, clientSnapshot, serverSnapshot);
|
|
5217
4507
|
if (!hydrated)
|
|
5218
|
-
return /* @__PURE__ */
|
|
4508
|
+
return /* @__PURE__ */ jsx3(TablePlaceholder, {
|
|
5219
4509
|
props
|
|
5220
4510
|
});
|
|
5221
|
-
return /* @__PURE__ */
|
|
4511
|
+
return /* @__PURE__ */ jsx3(DataTableStylesContext.Provider, {
|
|
5222
4512
|
value: props.classNames,
|
|
5223
|
-
children: /* @__PURE__ */
|
|
4513
|
+
children: /* @__PURE__ */ jsx3(DataTableSlotClassesContext.Provider, {
|
|
5224
4514
|
value: resolveTableClasses(props.classes),
|
|
5225
|
-
children: /* @__PURE__ */
|
|
4515
|
+
children: /* @__PURE__ */ jsx3(HydratedDataTable, {
|
|
5226
4516
|
...props,
|
|
5227
4517
|
locale
|
|
5228
4518
|
})
|
|
@@ -5265,7 +4555,7 @@ var DataTableContent = ({
|
|
|
5265
4555
|
return () => observer.disconnect();
|
|
5266
4556
|
}, [scrollElement]);
|
|
5267
4557
|
if (store.config.features.gallery && store.state.view === "gallery") {
|
|
5268
|
-
return /* @__PURE__ */
|
|
4558
|
+
return /* @__PURE__ */ jsx3(DataTableGallery, {
|
|
5269
4559
|
table
|
|
5270
4560
|
});
|
|
5271
4561
|
}
|
|
@@ -5279,22 +4569,22 @@ var DataTableContent = ({
|
|
|
5279
4569
|
const options = virtualization && virtualization !== true ? virtualization : {};
|
|
5280
4570
|
const rowCount = !getActiveGrouping(store).length && model.pageRows.length && !store.config.status.error ? model.pageRows.length + 1 : undefined;
|
|
5281
4571
|
if (options.scroll === "page") {
|
|
5282
|
-
return /* @__PURE__ */
|
|
4572
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
5283
4573
|
ref: setPageTable,
|
|
5284
4574
|
"data-table-page-virtualization": "",
|
|
5285
4575
|
className: "[overflow-anchor:none]",
|
|
5286
|
-
children: /* @__PURE__ */
|
|
4576
|
+
children: /* @__PURE__ */ jsxs3(ScrollArea, {
|
|
5287
4577
|
className: "@container max-w-full min-w-0",
|
|
5288
4578
|
children: [
|
|
5289
|
-
/* @__PURE__ */
|
|
4579
|
+
/* @__PURE__ */ jsxs3(Table, {
|
|
5290
4580
|
"aria-rowcount": rowCount,
|
|
5291
4581
|
className: "table-fixed",
|
|
5292
4582
|
style: { width: `max(100%, ${width}px)` },
|
|
5293
4583
|
children: [
|
|
5294
|
-
/* @__PURE__ */
|
|
4584
|
+
/* @__PURE__ */ jsx3(DataTableHeader, {
|
|
5295
4585
|
table
|
|
5296
4586
|
}),
|
|
5297
|
-
/* @__PURE__ */
|
|
4587
|
+
/* @__PURE__ */ jsx3(DataTableBody, {
|
|
5298
4588
|
table,
|
|
5299
4589
|
viewport: {
|
|
5300
4590
|
element: null,
|
|
@@ -5305,7 +4595,7 @@ var DataTableContent = ({
|
|
|
5305
4595
|
})
|
|
5306
4596
|
]
|
|
5307
4597
|
}),
|
|
5308
|
-
/* @__PURE__ */
|
|
4598
|
+
/* @__PURE__ */ jsx3(ScrollBar, {
|
|
5309
4599
|
orientation: "horizontal"
|
|
5310
4600
|
})
|
|
5311
4601
|
]
|
|
@@ -5313,10 +4603,10 @@ var DataTableContent = ({
|
|
|
5313
4603
|
});
|
|
5314
4604
|
}
|
|
5315
4605
|
const fillHeight = options.scroll === "internal";
|
|
5316
|
-
return /* @__PURE__ */
|
|
4606
|
+
return /* @__PURE__ */ jsxs3(ScrollAreaPrimitive.Root, {
|
|
5317
4607
|
className: cn("relative isolate max-w-full min-w-0", fillHeight && "flex min-h-0 flex-1 flex-col"),
|
|
5318
4608
|
children: [
|
|
5319
|
-
/* @__PURE__ */
|
|
4609
|
+
/* @__PURE__ */ jsx3(ScrollAreaPrimitive.Viewport, {
|
|
5320
4610
|
ref: setScrollElement,
|
|
5321
4611
|
"data-table-virtual-viewport": "",
|
|
5322
4612
|
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"),
|
|
@@ -5324,17 +4614,17 @@ var DataTableContent = ({
|
|
|
5324
4614
|
maxHeight: fillHeight ? undefined : options.height ?? 480,
|
|
5325
4615
|
scrollPaddingTop: headerHeight
|
|
5326
4616
|
},
|
|
5327
|
-
children: /* @__PURE__ */
|
|
5328
|
-
children: /* @__PURE__ */
|
|
4617
|
+
children: /* @__PURE__ */ jsx3(ScrollAreaPrimitive.Content, {
|
|
4618
|
+
children: /* @__PURE__ */ jsxs3(Table, {
|
|
5329
4619
|
"aria-rowcount": rowCount,
|
|
5330
4620
|
className: "table-fixed",
|
|
5331
4621
|
style: { width: `max(100%, ${width}px)` },
|
|
5332
4622
|
children: [
|
|
5333
|
-
/* @__PURE__ */
|
|
4623
|
+
/* @__PURE__ */ jsx3(DataTableHeader, {
|
|
5334
4624
|
sticky: true,
|
|
5335
4625
|
table
|
|
5336
4626
|
}),
|
|
5337
|
-
/* @__PURE__ */
|
|
4627
|
+
/* @__PURE__ */ jsx3(DataTableBody, {
|
|
5338
4628
|
table,
|
|
5339
4629
|
viewport: { element: scrollElement, headerHeight, options }
|
|
5340
4630
|
})
|
|
@@ -5342,33 +4632,33 @@ var DataTableContent = ({
|
|
|
5342
4632
|
})
|
|
5343
4633
|
})
|
|
5344
4634
|
}),
|
|
5345
|
-
/* @__PURE__ */
|
|
4635
|
+
/* @__PURE__ */ jsx3(ScrollBar, {
|
|
5346
4636
|
className: "data-vertical:h-auto",
|
|
5347
4637
|
style: { top: headerHeight }
|
|
5348
4638
|
}),
|
|
5349
|
-
/* @__PURE__ */
|
|
4639
|
+
/* @__PURE__ */ jsx3(ScrollBar, {
|
|
5350
4640
|
orientation: "horizontal"
|
|
5351
4641
|
}),
|
|
5352
|
-
/* @__PURE__ */
|
|
4642
|
+
/* @__PURE__ */ jsx3(ScrollAreaPrimitive.Corner, {})
|
|
5353
4643
|
]
|
|
5354
4644
|
});
|
|
5355
4645
|
}
|
|
5356
|
-
return /* @__PURE__ */
|
|
4646
|
+
return /* @__PURE__ */ jsxs3(ScrollArea, {
|
|
5357
4647
|
className: "@container max-w-full min-w-0",
|
|
5358
4648
|
children: [
|
|
5359
|
-
/* @__PURE__ */
|
|
4649
|
+
/* @__PURE__ */ jsxs3(Table, {
|
|
5360
4650
|
className: "table-fixed",
|
|
5361
4651
|
style: { width: `max(100%, ${width}px)` },
|
|
5362
4652
|
children: [
|
|
5363
|
-
/* @__PURE__ */
|
|
4653
|
+
/* @__PURE__ */ jsx3(DataTableHeader, {
|
|
5364
4654
|
table
|
|
5365
4655
|
}),
|
|
5366
|
-
/* @__PURE__ */
|
|
4656
|
+
/* @__PURE__ */ jsx3(DataTableBody, {
|
|
5367
4657
|
table
|
|
5368
4658
|
})
|
|
5369
4659
|
]
|
|
5370
4660
|
}),
|
|
5371
|
-
/* @__PURE__ */
|
|
4661
|
+
/* @__PURE__ */ jsx3(ScrollBar, {
|
|
5372
4662
|
orientation: "horizontal"
|
|
5373
4663
|
})
|
|
5374
4664
|
]
|
|
@@ -5379,7 +4669,7 @@ var DataTableListCell = (props) => {
|
|
|
5379
4669
|
const locale = useKrakstackLocale3(props.locale);
|
|
5380
4670
|
const resolvedProps = { ...props, locale };
|
|
5381
4671
|
if (resolvedProps.options && (resolvedProps.onAdd || resolvedProps.onRemove)) {
|
|
5382
|
-
return /* @__PURE__ */
|
|
4672
|
+
return /* @__PURE__ */ jsx3(EditableDataTableListCell, {
|
|
5383
4673
|
...resolvedProps
|
|
5384
4674
|
});
|
|
5385
4675
|
}
|
|
@@ -5387,17 +4677,17 @@ var DataTableListCell = (props) => {
|
|
|
5387
4677
|
const labels = dataTableMessages(locale, resolvedProps.messages);
|
|
5388
4678
|
const hasItems = resolvedProps.items.length > 0;
|
|
5389
4679
|
if (!itemActions?.length && !hasItems) {
|
|
5390
|
-
return /* @__PURE__ */
|
|
4680
|
+
return /* @__PURE__ */ jsx3(DataTableListSummary, {
|
|
5391
4681
|
...summaryProps
|
|
5392
4682
|
});
|
|
5393
4683
|
}
|
|
5394
4684
|
const menuLabel = actionsLabel ?? (itemActions?.length ? labels.actions : labels.listDetails);
|
|
5395
|
-
return /* @__PURE__ */
|
|
4685
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
5396
4686
|
className: tableClasses.relationshipCell,
|
|
5397
4687
|
"data-slot": "data-table-list-cell",
|
|
5398
4688
|
onClick: (event) => event.stopPropagation(),
|
|
5399
4689
|
onPointerDown: (event) => event.stopPropagation(),
|
|
5400
|
-
children: /* @__PURE__ */
|
|
4690
|
+
children: /* @__PURE__ */ jsx3(DataTableListMenu, {
|
|
5401
4691
|
actions: itemActions ?? [],
|
|
5402
4692
|
display: resolvedProps.display,
|
|
5403
4693
|
force: hasItems,
|
|
@@ -5406,16 +4696,16 @@ var DataTableListCell = (props) => {
|
|
|
5406
4696
|
locale,
|
|
5407
4697
|
messages: resolvedProps.messages,
|
|
5408
4698
|
onItemClick,
|
|
5409
|
-
trigger: /* @__PURE__ */
|
|
4699
|
+
trigger: /* @__PURE__ */ jsxs3(Button2, {
|
|
5410
4700
|
"aria-label": menuLabel,
|
|
5411
4701
|
className: tableClasses.relationshipTrigger,
|
|
5412
4702
|
variant: "ghost",
|
|
5413
4703
|
children: [
|
|
5414
|
-
/* @__PURE__ */
|
|
4704
|
+
/* @__PURE__ */ jsx3(DataTableListSummaryContent, {
|
|
5415
4705
|
...summaryProps,
|
|
5416
4706
|
showMenu: false
|
|
5417
4707
|
}),
|
|
5418
|
-
/* @__PURE__ */
|
|
4708
|
+
/* @__PURE__ */ jsx3(ChevronDown, {})
|
|
5419
4709
|
]
|
|
5420
4710
|
})
|
|
5421
4711
|
})
|
|
@@ -5456,7 +4746,7 @@ var EditableDataTableListCell = ({
|
|
|
5456
4746
|
id: "data-table-list-remove",
|
|
5457
4747
|
closeOnClick: false,
|
|
5458
4748
|
name: labels.removeItem,
|
|
5459
|
-
icon: /* @__PURE__ */
|
|
4749
|
+
icon: /* @__PURE__ */ jsx3(Trash2, {}),
|
|
5460
4750
|
variant: "destructive",
|
|
5461
4751
|
onClick: (item) => {
|
|
5462
4752
|
if (item.value === undefined)
|
|
@@ -5467,12 +4757,12 @@ var EditableDataTableListCell = ({
|
|
|
5467
4757
|
}
|
|
5468
4758
|
] : []
|
|
5469
4759
|
];
|
|
5470
|
-
return /* @__PURE__ */
|
|
4760
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
5471
4761
|
"data-slot": "data-table-list-cell",
|
|
5472
4762
|
className: tableClasses.relationshipCell,
|
|
5473
4763
|
onClick: (event) => event.stopPropagation(),
|
|
5474
4764
|
onPointerDown: (event) => event.stopPropagation(),
|
|
5475
|
-
children: /* @__PURE__ */
|
|
4765
|
+
children: /* @__PURE__ */ jsx3(DataTableListMenu, {
|
|
5476
4766
|
actions,
|
|
5477
4767
|
addEmptyLabel: emptyLabel,
|
|
5478
4768
|
addLabel: labels.addItem,
|
|
@@ -5489,12 +4779,12 @@ var EditableDataTableListCell = ({
|
|
|
5489
4779
|
onAdd(item.value);
|
|
5490
4780
|
setSelected((current) => [...current, item]);
|
|
5491
4781
|
} : undefined,
|
|
5492
|
-
trigger: /* @__PURE__ */
|
|
4782
|
+
trigger: /* @__PURE__ */ jsxs3(Button2, {
|
|
5493
4783
|
"aria-label": manageLabel,
|
|
5494
4784
|
className: "h-full w-full min-w-0 justify-between rounded-none px-2 focus-visible:ring-inset",
|
|
5495
4785
|
variant: "ghost",
|
|
5496
4786
|
children: [
|
|
5497
|
-
/* @__PURE__ */
|
|
4787
|
+
/* @__PURE__ */ jsx3(DataTableListSummaryContent, {
|
|
5498
4788
|
emptyLabel,
|
|
5499
4789
|
items: selected,
|
|
5500
4790
|
display,
|
|
@@ -5502,7 +4792,7 @@ var EditableDataTableListCell = ({
|
|
|
5502
4792
|
visibleCount,
|
|
5503
4793
|
totalCount: selectedTotal
|
|
5504
4794
|
}),
|
|
5505
|
-
/* @__PURE__ */
|
|
4795
|
+
/* @__PURE__ */ jsx3(ChevronDown, {})
|
|
5506
4796
|
]
|
|
5507
4797
|
})
|
|
5508
4798
|
})
|
|
@@ -5535,42 +4825,42 @@ var DataTableListMenu = ({
|
|
|
5535
4825
|
return null;
|
|
5536
4826
|
const labels = dataTableMessages(locale, messages);
|
|
5537
4827
|
const resolvedLabel = label ?? (hasActions ? labels.actions : labels.listDetails);
|
|
5538
|
-
return /* @__PURE__ */
|
|
4828
|
+
return /* @__PURE__ */ jsxs3(DropdownMenu, {
|
|
5539
4829
|
modal: false,
|
|
5540
4830
|
children: [
|
|
5541
|
-
/* @__PURE__ */
|
|
4831
|
+
/* @__PURE__ */ jsx3(DropdownMenuTrigger, {
|
|
5542
4832
|
onClick: (event) => event.stopPropagation(),
|
|
5543
4833
|
onPointerDown: (event) => event.stopPropagation(),
|
|
5544
|
-
render: trigger ?? /* @__PURE__ */
|
|
4834
|
+
render: trigger ?? /* @__PURE__ */ jsx3(Button2, {
|
|
5545
4835
|
"aria-label": resolvedLabel,
|
|
5546
4836
|
className: cn("size-8 shrink-0", className),
|
|
5547
4837
|
size: "icon",
|
|
5548
4838
|
variant: "ghost",
|
|
5549
|
-
children: /* @__PURE__ */
|
|
4839
|
+
children: /* @__PURE__ */ jsx3(MoreHorizontal, {})
|
|
5550
4840
|
})
|
|
5551
4841
|
}),
|
|
5552
|
-
/* @__PURE__ */
|
|
4842
|
+
/* @__PURE__ */ jsx3(DropdownMenuContent, {
|
|
5553
4843
|
align: "end",
|
|
5554
4844
|
className: "max-h-[min(18rem,var(--available-height))] w-72 max-w-[calc(100vw-2rem)]",
|
|
5555
4845
|
onClick: (event) => event.stopPropagation(),
|
|
5556
4846
|
onPointerDown: (event) => event.stopPropagation(),
|
|
5557
|
-
children: /* @__PURE__ */
|
|
4847
|
+
children: /* @__PURE__ */ jsxs3(DropdownMenuGroup, {
|
|
5558
4848
|
children: [
|
|
5559
|
-
/* @__PURE__ */
|
|
4849
|
+
/* @__PURE__ */ jsx3(DropdownMenuLabel, {
|
|
5560
4850
|
children: resolvedLabel
|
|
5561
4851
|
}),
|
|
5562
|
-
/* @__PURE__ */
|
|
5563
|
-
entries.map(({ item, visibleActions }, index) => visibleActions.length ? /* @__PURE__ */
|
|
4852
|
+
/* @__PURE__ */ jsx3(DropdownMenuSeparator, {}),
|
|
4853
|
+
entries.map(({ item, visibleActions }, index) => visibleActions.length ? /* @__PURE__ */ jsxs3(DropdownMenuSub, {
|
|
5564
4854
|
children: [
|
|
5565
|
-
/* @__PURE__ */
|
|
5566
|
-
children: /* @__PURE__ */
|
|
4855
|
+
/* @__PURE__ */ jsx3(DropdownMenuSubTrigger, {
|
|
4856
|
+
children: /* @__PURE__ */ jsx3(DataTableListEntry, {
|
|
5567
4857
|
item,
|
|
5568
4858
|
appearance: display === "icon" ? "detail" : "list"
|
|
5569
4859
|
})
|
|
5570
4860
|
}),
|
|
5571
|
-
/* @__PURE__ */
|
|
4861
|
+
/* @__PURE__ */ jsx3(DropdownMenuSubContent, {
|
|
5572
4862
|
className: "w-max",
|
|
5573
|
-
children: visibleActions.map((action) => /* @__PURE__ */
|
|
4863
|
+
children: visibleActions.map((action) => /* @__PURE__ */ jsxs3(DropdownMenuItem, {
|
|
5574
4864
|
closeOnClick: action.closeOnClick,
|
|
5575
4865
|
disabled: action.disabled?.(item),
|
|
5576
4866
|
onClick: (event) => {
|
|
@@ -5585,21 +4875,21 @@ var DataTableListMenu = ({
|
|
|
5585
4875
|
}, action.id ?? action.name))
|
|
5586
4876
|
})
|
|
5587
4877
|
]
|
|
5588
|
-
}, item.value ?? `${item.label}-${index}`) : /* @__PURE__ */
|
|
4878
|
+
}, item.value ?? `${item.label}-${index}`) : /* @__PURE__ */ jsx3(DropdownMenuItem, {
|
|
5589
4879
|
closeOnClick: Boolean(onItemClick),
|
|
5590
4880
|
onClick: (event) => {
|
|
5591
4881
|
event.stopPropagation();
|
|
5592
4882
|
onItemClick?.(item);
|
|
5593
4883
|
},
|
|
5594
|
-
children: /* @__PURE__ */
|
|
4884
|
+
children: /* @__PURE__ */ jsx3(DataTableListEntry, {
|
|
5595
4885
|
item,
|
|
5596
4886
|
appearance: display === "icon" ? "detail" : "list"
|
|
5597
4887
|
})
|
|
5598
4888
|
}, item.value ?? `${item.label}-${index}`)),
|
|
5599
|
-
onAdd && addOptions?.length ? /* @__PURE__ */
|
|
4889
|
+
onAdd && addOptions?.length ? /* @__PURE__ */ jsxs3(Fragment, {
|
|
5600
4890
|
children: [
|
|
5601
|
-
entries.length ? /* @__PURE__ */
|
|
5602
|
-
/* @__PURE__ */
|
|
4891
|
+
entries.length ? /* @__PURE__ */ jsx3(DropdownMenuSeparator, {}) : null,
|
|
4892
|
+
/* @__PURE__ */ jsx3(DataTableListAddMenu, {
|
|
5603
4893
|
emptyLabel: addEmptyLabel,
|
|
5604
4894
|
label: addLabel ?? labels.addItem,
|
|
5605
4895
|
locale,
|
|
@@ -5634,28 +4924,28 @@ var DataTableListAddMenu = ({
|
|
|
5634
4924
|
const labels = dataTableMessages(locale, messages);
|
|
5635
4925
|
const normalizedSearch = search.trim().toLocaleLowerCase(locale);
|
|
5636
4926
|
const filtered = normalizedSearch ? options.filter((item) => item.label.toLocaleLowerCase(locale).includes(normalizedSearch)) : options;
|
|
5637
|
-
return /* @__PURE__ */
|
|
4927
|
+
return /* @__PURE__ */ jsxs3(DropdownMenuSub, {
|
|
5638
4928
|
onOpenChange: (open) => {
|
|
5639
4929
|
if (!open)
|
|
5640
4930
|
setSearch("");
|
|
5641
4931
|
},
|
|
5642
4932
|
children: [
|
|
5643
|
-
/* @__PURE__ */
|
|
4933
|
+
/* @__PURE__ */ jsxs3(DropdownMenuSubTrigger, {
|
|
5644
4934
|
children: [
|
|
5645
|
-
/* @__PURE__ */
|
|
4935
|
+
/* @__PURE__ */ jsx3(Plus, {}),
|
|
5646
4936
|
label
|
|
5647
4937
|
]
|
|
5648
4938
|
}),
|
|
5649
|
-
/* @__PURE__ */
|
|
4939
|
+
/* @__PURE__ */ jsxs3(DropdownMenuSubContent, {
|
|
5650
4940
|
className: "w-64",
|
|
5651
4941
|
children: [
|
|
5652
|
-
/* @__PURE__ */
|
|
4942
|
+
/* @__PURE__ */ jsxs3("div", {
|
|
5653
4943
|
className: "relative p-1",
|
|
5654
4944
|
children: [
|
|
5655
|
-
/* @__PURE__ */
|
|
4945
|
+
/* @__PURE__ */ jsx3(Search, {
|
|
5656
4946
|
className: "text-muted-foreground pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2"
|
|
5657
4947
|
}),
|
|
5658
|
-
/* @__PURE__ */
|
|
4948
|
+
/* @__PURE__ */ jsx3(Input, {
|
|
5659
4949
|
"aria-label": searchLabel,
|
|
5660
4950
|
className: "h-8 pl-8",
|
|
5661
4951
|
onChange: (event) => setSearch(event.target.value),
|
|
@@ -5669,15 +4959,15 @@ var DataTableListAddMenu = ({
|
|
|
5669
4959
|
})
|
|
5670
4960
|
]
|
|
5671
4961
|
}),
|
|
5672
|
-
/* @__PURE__ */
|
|
5673
|
-
filtered.length ? filtered.map((item) => /* @__PURE__ */
|
|
4962
|
+
/* @__PURE__ */ jsx3(DropdownMenuSeparator, {}),
|
|
4963
|
+
filtered.length ? filtered.map((item) => /* @__PURE__ */ jsx3(DropdownMenuItem, {
|
|
5674
4964
|
closeOnClick: false,
|
|
5675
4965
|
onClick: () => onAdd(item),
|
|
5676
|
-
children: /* @__PURE__ */
|
|
4966
|
+
children: /* @__PURE__ */ jsx3(DataTableListEntry, {
|
|
5677
4967
|
item,
|
|
5678
4968
|
appearance: display === "icon" ? "detail" : "list"
|
|
5679
4969
|
})
|
|
5680
|
-
}, item.value)) : /* @__PURE__ */
|
|
4970
|
+
}, item.value)) : /* @__PURE__ */ jsx3("div", {
|
|
5681
4971
|
className: "text-muted-foreground px-2 py-1.5 text-sm",
|
|
5682
4972
|
children: emptyLabel
|
|
5683
4973
|
})
|
|
@@ -5698,29 +4988,29 @@ var DataTableListSummaryContent = ({
|
|
|
5698
4988
|
}) => {
|
|
5699
4989
|
const normalized = items.map((item) => Schema6.is(Schema6.String)(item) ? { label: item } : item);
|
|
5700
4990
|
if (!normalized.length)
|
|
5701
|
-
return /* @__PURE__ */
|
|
4991
|
+
return /* @__PURE__ */ jsx3("span", {
|
|
5702
4992
|
className: "text-muted-foreground",
|
|
5703
4993
|
children: emptyLabel
|
|
5704
4994
|
});
|
|
5705
4995
|
const visible = normalized.slice(0, Math.max(0, visibleCount));
|
|
5706
4996
|
const remaining = Math.max(totalCount - visible.length, 0);
|
|
5707
4997
|
if (display === "icon") {
|
|
5708
|
-
return /* @__PURE__ */
|
|
5709
|
-
children: /* @__PURE__ */
|
|
4998
|
+
return /* @__PURE__ */ jsx3(TooltipProvider, {
|
|
4999
|
+
children: /* @__PURE__ */ jsxs3("span", {
|
|
5710
5000
|
className: "flex items-center",
|
|
5711
5001
|
children: [
|
|
5712
|
-
visible.map((item, index) => /* @__PURE__ */
|
|
5002
|
+
visible.map((item, index) => /* @__PURE__ */ jsx3(DataTableListEntry, {
|
|
5713
5003
|
item,
|
|
5714
5004
|
appearance: "icon"
|
|
5715
5005
|
}, item.value ?? `${item.label}-${index}`)),
|
|
5716
|
-
remaining ? /* @__PURE__ */
|
|
5006
|
+
remaining ? /* @__PURE__ */ jsxs3("span", {
|
|
5717
5007
|
className: "bg-secondary text-secondary-foreground -ml-1 flex size-8 items-center justify-center rounded-full",
|
|
5718
5008
|
children: [
|
|
5719
5009
|
"+",
|
|
5720
5010
|
remaining
|
|
5721
5011
|
]
|
|
5722
5012
|
}) : null,
|
|
5723
|
-
remaining && showMenu ? /* @__PURE__ */
|
|
5013
|
+
remaining && showMenu ? /* @__PURE__ */ jsx3(DataTableListMenu, {
|
|
5724
5014
|
actions: [],
|
|
5725
5015
|
display,
|
|
5726
5016
|
force: true,
|
|
@@ -5732,17 +5022,17 @@ var DataTableListSummaryContent = ({
|
|
|
5732
5022
|
})
|
|
5733
5023
|
});
|
|
5734
5024
|
}
|
|
5735
|
-
return /* @__PURE__ */
|
|
5025
|
+
return /* @__PURE__ */ jsxs3("span", {
|
|
5736
5026
|
className: "inline-flex min-w-0 items-center gap-2 text-sm",
|
|
5737
5027
|
children: [
|
|
5738
|
-
/* @__PURE__ */
|
|
5028
|
+
/* @__PURE__ */ jsxs3("span", {
|
|
5739
5029
|
className: "truncate",
|
|
5740
5030
|
children: [
|
|
5741
5031
|
visible.map((item) => item.label).join(", "),
|
|
5742
5032
|
remaining ? ` +${remaining}` : ""
|
|
5743
5033
|
]
|
|
5744
5034
|
}),
|
|
5745
|
-
remaining && showMenu ? /* @__PURE__ */
|
|
5035
|
+
remaining && showMenu ? /* @__PURE__ */ jsx3(DataTableListMenu, {
|
|
5746
5036
|
actions: [],
|
|
5747
5037
|
display,
|
|
5748
5038
|
force: true,
|
|
@@ -5753,7 +5043,7 @@ var DataTableListSummaryContent = ({
|
|
|
5753
5043
|
]
|
|
5754
5044
|
});
|
|
5755
5045
|
};
|
|
5756
|
-
var DataTableListSummary = (props) => /* @__PURE__ */
|
|
5046
|
+
var DataTableListSummary = (props) => /* @__PURE__ */ jsx3(DataTableListSummaryContent, {
|
|
5757
5047
|
...props,
|
|
5758
5048
|
showMenu: true
|
|
5759
5049
|
});
|
|
@@ -5761,40 +5051,40 @@ var DataTableListEntry = ({
|
|
|
5761
5051
|
item,
|
|
5762
5052
|
appearance
|
|
5763
5053
|
}) => {
|
|
5764
|
-
const icon = /* @__PURE__ */
|
|
5054
|
+
const icon = /* @__PURE__ */ jsx3("span", {
|
|
5765
5055
|
"aria-hidden": "true",
|
|
5766
5056
|
className: "bg-secondary text-secondary-foreground flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-full",
|
|
5767
|
-
children: item.imageSrc ? /* @__PURE__ */
|
|
5057
|
+
children: item.imageSrc ? /* @__PURE__ */ jsx3("img", {
|
|
5768
5058
|
alt: "",
|
|
5769
5059
|
src: item.imageSrc,
|
|
5770
5060
|
className: "size-full object-cover"
|
|
5771
5061
|
}) : item.icon ?? item.label.slice(0, 2).toUpperCase()
|
|
5772
5062
|
});
|
|
5773
5063
|
if (appearance === "list") {
|
|
5774
|
-
return /* @__PURE__ */
|
|
5064
|
+
return /* @__PURE__ */ jsx3("span", {
|
|
5775
5065
|
className: "min-w-0 flex-1 truncate",
|
|
5776
5066
|
title: item.label,
|
|
5777
5067
|
children: item.label
|
|
5778
5068
|
});
|
|
5779
5069
|
}
|
|
5780
|
-
return appearance === "icon" ? /* @__PURE__ */
|
|
5070
|
+
return appearance === "icon" ? /* @__PURE__ */ jsxs3(Tooltip, {
|
|
5781
5071
|
children: [
|
|
5782
|
-
/* @__PURE__ */
|
|
5783
|
-
render: /* @__PURE__ */
|
|
5072
|
+
/* @__PURE__ */ jsx3(TooltipTrigger, {
|
|
5073
|
+
render: /* @__PURE__ */ jsx3("span", {
|
|
5784
5074
|
className: "-ml-1 inline-flex rounded-full",
|
|
5785
5075
|
"aria-label": item.label
|
|
5786
5076
|
}),
|
|
5787
5077
|
children: icon
|
|
5788
5078
|
}),
|
|
5789
|
-
/* @__PURE__ */
|
|
5079
|
+
/* @__PURE__ */ jsx3(TooltipContent, {
|
|
5790
5080
|
children: item.label
|
|
5791
5081
|
})
|
|
5792
5082
|
]
|
|
5793
|
-
}) : /* @__PURE__ */
|
|
5083
|
+
}) : /* @__PURE__ */ jsxs3("span", {
|
|
5794
5084
|
className: "flex min-w-0 flex-1 items-center gap-2 text-left",
|
|
5795
5085
|
children: [
|
|
5796
5086
|
icon,
|
|
5797
|
-
/* @__PURE__ */
|
|
5087
|
+
/* @__PURE__ */ jsx3("span", {
|
|
5798
5088
|
className: "truncate",
|
|
5799
5089
|
children: item.label
|
|
5800
5090
|
})
|
|
@@ -5815,7 +5105,7 @@ var TextArrayValue = Schema7.Struct({
|
|
|
5815
5105
|
var eventTextAttribute = (record, key) => Schema7.decodeUnknownOption(TextValue)(record.attributes.find((attribute) => attribute.key === key)?.value).pipe(Option5.map((value) => value.stringValue), Option5.getOrNull);
|
|
5816
5106
|
|
|
5817
5107
|
// ../../src/components/audit-log-table/react.tsx
|
|
5818
|
-
import { jsx as
|
|
5108
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
5819
5109
|
var translations = {
|
|
5820
5110
|
en: {
|
|
5821
5111
|
title: "Activity history",
|
|
@@ -5949,13 +5239,13 @@ var AuditLogTable = ({
|
|
|
5949
5239
|
},
|
|
5950
5240
|
cellRenderer: ({ data }) => {
|
|
5951
5241
|
const impersonatorId = eventTextAttribute(data, "app.auth.impersonator.id");
|
|
5952
|
-
return /* @__PURE__ */
|
|
5242
|
+
return /* @__PURE__ */ jsxs4("div", {
|
|
5953
5243
|
className: "flex min-w-0 flex-col gap-1",
|
|
5954
5244
|
children: [
|
|
5955
|
-
/* @__PURE__ */
|
|
5245
|
+
/* @__PURE__ */ jsx4(DataTableReferenceCell, {
|
|
5956
5246
|
item: getActor(data)
|
|
5957
5247
|
}),
|
|
5958
|
-
impersonatorId !== null ? /* @__PURE__ */
|
|
5248
|
+
impersonatorId !== null ? /* @__PURE__ */ jsxs4("span", {
|
|
5959
5249
|
className: "text-muted-foreground text-xs",
|
|
5960
5250
|
children: [
|
|
5961
5251
|
labels.impersonatedBy,
|
|
@@ -5986,10 +5276,10 @@ var AuditLogTable = ({
|
|
|
5986
5276
|
}
|
|
5987
5277
|
}
|
|
5988
5278
|
];
|
|
5989
|
-
return /* @__PURE__ */
|
|
5279
|
+
return /* @__PURE__ */ jsx4("section", {
|
|
5990
5280
|
"aria-label": labels.title,
|
|
5991
5281
|
className: "flex flex-col gap-4",
|
|
5992
|
-
children: /* @__PURE__ */
|
|
5282
|
+
children: /* @__PURE__ */ jsx4(DataTable, {
|
|
5993
5283
|
locale,
|
|
5994
5284
|
status,
|
|
5995
5285
|
state: tableState,
|