@krak-stack/registry 0.11.3 → 0.11.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/README.md +23 -9
- package/dist/components/agent/react.js +226 -1072
- package/dist/components/app-switcher/html.js +10 -53
- package/dist/components/app-switcher/react.js +29 -139
- package/dist/components/async-action-button/html.js +3 -34
- package/dist/components/async-action-button/react.d.ts +1 -1
- package/dist/components/async-action-button/react.js +8 -54
- package/dist/components/audit-log-table/react.js +555 -1265
- package/dist/components/bulk-list-input/html.js +3 -40
- package/dist/components/bulk-list-input/react.d.ts +1 -1
- package/dist/components/bulk-list-input/react.js +6 -59
- package/dist/components/code-block/html.js +1 -35
- package/dist/components/code-block/react.js +12 -59
- package/dist/components/color-input/html.js +2 -19
- package/dist/components/color-input/react.js +6 -97
- package/dist/components/copy-button/html.js +1 -35
- package/dist/components/copy-button/react.d.ts +1 -1
- package/dist/components/copy-button/react.js +7 -54
- package/dist/components/copy-value/html.js +11 -52
- package/dist/components/copy-value/react.js +25 -165
- package/dist/components/cron-input/html.js +2 -18
- package/dist/components/cron-input/react.js +15 -30
- package/dist/components/danger-confirmation/html.js +11 -57
- package/dist/components/danger-confirmation/react.js +26 -187
- package/dist/components/data-table/html.d.ts +12 -12
- package/dist/components/data-table/html.js +200 -174
- package/dist/components/data-table/react.js +549 -1259
- package/dist/components/date-input/html.js +19 -74
- package/dist/components/date-input/react.d.ts +1 -1
- package/dist/components/date-input/react.js +28 -313
- package/dist/components/docs/classes.d.ts +15 -0
- package/dist/components/docs/html.d.ts +55 -0
- package/dist/components/docs/html.js +837 -0
- package/dist/components/docs/index.d.ts +49 -0
- package/dist/components/docs/react.d.ts +10 -0
- package/dist/components/docs/react.js +949 -0
- package/dist/components/docs/schema.d.ts +49 -0
- package/dist/components/editable-text/html.js +6 -52
- package/dist/components/editable-text/react.js +13 -83
- package/dist/components/editing-locale-switcher/html.d.ts +2 -2
- package/dist/components/editing-locale-switcher/html.js +13 -43
- package/dist/components/editing-locale-switcher/react.js +17 -141
- package/dist/components/effect-form/react.js +249 -812
- package/dist/components/email-composer/react.js +62 -279
- package/dist/components/email-editor/html.js +13 -58
- package/dist/components/email-editor/react.js +187 -483
- package/dist/components/error-component/html.js +2 -47
- package/dist/components/error-component/react.js +33 -137
- package/dist/components/file-input/html.js +9 -40
- package/dist/components/file-input/react.js +39 -208
- package/dist/components/form/react.js +212 -777
- package/dist/components/hint/react.d.ts +15 -0
- package/dist/components/hint/react.js +133 -0
- package/dist/components/icon-input/html.js +9 -56
- package/dist/components/icon-input/react.js +43 -143
- package/dist/components/image-crop-editor/html.js +1 -35
- package/dist/components/image-crop-editor/react.js +21 -66
- package/dist/components/locale-switcher/html.js +8 -55
- package/dist/components/locale-switcher/react.js +21 -146
- package/dist/components/map-menu/html.d.ts +8 -8
- package/dist/components/map-menu/html.js +13 -72
- package/dist/components/map-menu/react.js +92 -309
- package/dist/components/markdown/html.js +1 -35
- package/dist/components/markdown/react.js +20 -64
- package/dist/components/notification-menu/html.js +14 -50
- package/dist/components/notification-menu/react.js +73 -343
- package/dist/components/pagination/html.js +17 -73
- package/dist/components/pagination/react.js +37 -200
- package/dist/components/phone-number-input/html.js +19 -57
- package/dist/components/phone-number-input/react.d.ts +1 -1
- package/dist/components/phone-number-input/react.js +43 -142
- package/dist/components/presence-transition/index.d.ts +2 -2
- package/dist/components/registry-previews/component-example.js +26 -126
- package/dist/components/rich-text-editor/html.d.ts +12 -12
- package/dist/components/rich-text-editor/html.js +12 -85
- package/dist/components/rich-text-editor/react.js +55 -272
- package/dist/components/search-menu/classes.d.ts +2 -0
- package/dist/components/search-menu/html.d.ts +2 -0
- package/dist/components/search-menu/html.js +40 -73
- package/dist/components/search-menu/index.d.ts +27 -2
- package/dist/components/search-menu/react.d.ts +1 -1
- package/dist/components/search-menu/react.js +59 -280
- package/dist/components/search-menu/schema.d.ts +1 -0
- package/dist/components/select-with-custom-input/html.d.ts +2 -2
- package/dist/components/select-with-custom-input/html.js +13 -48
- package/dist/components/select-with-custom-input/react.js +22 -146
- package/dist/components/sidebar-layout/html.d.ts +16 -6
- package/dist/components/sidebar-layout/html.js +83 -69
- package/dist/components/sidebar-layout/index.d.ts +16 -0
- package/dist/components/sidebar-layout/react.js +105 -698
- package/dist/components/stats-card/react.js +13 -58
- package/dist/components/support/html.js +14 -69
- package/dist/components/support/react.js +74 -320
- package/dist/components/theme-switcher/html.js +11 -55
- package/dist/components/theme-switcher/react.js +28 -152
- package/dist/components/time-input/html.d.ts +2 -2
- package/dist/components/time-input/html.js +8 -53
- package/dist/components/time-input/react.js +34 -188
- package/dist/components/timezone-input/html.js +11 -67
- package/dist/components/timezone-input/react.js +41 -143
- package/dist/components/toast/html.d.ts +6 -6
- package/dist/components/toast/html.js +13 -46
- package/dist/components/tracking-notice/react.js +39 -188
- package/dist/components/unsaved-changes-guard/html.js +9 -43
- package/dist/components/unsaved-changes-guard/react.js +19 -169
- package/dist/components/upload-attachment/html.d.ts +4 -4
- package/dist/components/upload-attachment/html.js +4 -35
- package/dist/components/upload-attachment/react.js +25 -164
- package/dist/components/virtualized-combobox/html.js +10 -35
- package/dist/components/virtualized-combobox/react.js +28 -129
- package/dist/components/webhook-delivery-table/html.js +211 -184
- package/dist/components/webhook-delivery-table/react.js +585 -1362
- package/dist/lib/docs.integrations.server.js +150 -202
- package/dist/lib/docs.js +305 -1085
- package/dist/lib/docs.server.js +134 -186
- package/dist/lib/documentation-toolkit.js +144 -196
- package/dist/services/agent/client/index.js +226 -1072
- package/dist/services/notification/client/index.js +73 -343
- package/dist/services/notification/public.js +73 -343
- package/package.json +4 -8
- package/dist/components/effectcn/alert-dialog.d.ts +0 -13
- package/dist/components/effectcn/button.d.ts +0 -31
- package/dist/components/effectcn/calendar.d.ts +0 -12
- package/dist/components/effectcn/checkbox.d.ts +0 -10
- package/dist/components/effectcn/combobox.d.ts +0 -25
- package/dist/components/effectcn/dialog.d.ts +0 -19
- package/dist/components/effectcn/field.d.ts +0 -11
- package/dist/components/effectcn/file-drop.d.ts +0 -8
- package/dist/components/effectcn/input.d.ts +0 -26
- package/dist/components/effectcn/menu.d.ts +0 -85
- package/dist/components/effectcn/menubar.d.ts +0 -8
- package/dist/components/effectcn/popover.d.ts +0 -18
- package/dist/components/effectcn/scroll-area.d.ts +0 -12
- package/dist/components/effectcn/select.d.ts +0 -68
- package/dist/components/effectcn/toast.d.ts +0 -29
- package/dist/components/ui/alert-dialog.d.ts +0 -18
- package/dist/components/ui/alert.d.ts +0 -10
- package/dist/components/ui/attachment.d.ts +0 -23
- package/dist/components/ui/badge.d.ts +0 -7
- package/dist/components/ui/bubble.d.ts +0 -16
- package/dist/components/ui/button.d.ts +0 -8
- package/dist/components/ui/calendar.d.ts +0 -10
- package/dist/components/ui/card.d.ts +0 -11
- package/dist/components/ui/checkbox.d.ts +0 -3
- package/dist/components/ui/collapsible.d.ts +0 -5
- package/dist/components/ui/command.d.ts +0 -18
- package/dist/components/ui/dialog.d.ts +0 -17
- package/dist/components/ui/dropdown-menu.d.ts +0 -29
- package/dist/components/ui/empty.d.ts +0 -11
- package/dist/components/ui/field.d.ts +0 -24
- package/dist/components/ui/input-group.d.ts +0 -17
- package/dist/components/ui/input.d.ts +0 -3
- package/dist/components/ui/item.d.ts +0 -22
- package/dist/components/ui/label.d.ts +0 -3
- package/dist/components/ui/menubar.d.ts +0 -29
- package/dist/components/ui/message-scroller.d.ts +0 -10
- package/dist/components/ui/message.d.ts +0 -10
- package/dist/components/ui/popover.d.ts +0 -9
- package/dist/components/ui/scroll-area.d.ts +0 -4
- package/dist/components/ui/select.d.ts +0 -15
- package/dist/components/ui/select.js +0 -159
- package/dist/components/ui/separator.d.ts +0 -3
- package/dist/components/ui/sheet.d.ts +0 -14
- package/dist/components/ui/sidebar.d.ts +0 -63
- package/dist/components/ui/skeleton.d.ts +0 -2
- package/dist/components/ui/table.d.ts +0 -10
- package/dist/components/ui/tabs.d.ts +0 -10
- package/dist/components/ui/textarea.d.ts +0 -3
- package/dist/components/ui/tooltip.d.ts +0 -6
- package/dist/components/ui/trace.d.ts +0 -18
- package/dist/lib/effectcn-form.d.ts +0 -3
- package/dist/lib/effectcn-form.js +0 -54
|
@@ -3,143 +3,60 @@ import { Html as Html3 } from "effect/ui/html";
|
|
|
3
3
|
import { Dialog } from "effect/ui/kit";
|
|
4
4
|
|
|
5
5
|
// ../../src/components/data-table/html.ts
|
|
6
|
-
import { Schema as Schema6, Stream as Stream2 } from "effect";
|
|
7
|
-
import { Mount } from "effect/ui";
|
|
6
|
+
import { Array as Arr, Schema as Schema6, Stream as Stream2 } from "effect";
|
|
7
|
+
import { Mount, UiSchema as UiSchema3 } from "effect/ui";
|
|
8
8
|
import { Html as Html2 } from "effect/ui/html";
|
|
9
|
-
import { Checkbox, Menu, Menubar, VirtualList } from "effect/ui/kit";
|
|
10
|
-
|
|
11
|
-
// ../../src/components/effectcn/button.ts
|
|
9
|
+
import { Checkbox, Menu, Menubar, Select as Select2, VirtualList } from "effect/ui/kit";
|
|
10
|
+
import { Button as Button2, buttonVariants } from "@/components/effectcn/button";
|
|
12
11
|
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
import { cn } from "cn";
|
|
18
|
-
|
|
19
|
-
// ../../src/components/effectcn/button.ts
|
|
20
|
-
var base = "inline-flex h-8.5 shrink-0 items-center justify-center gap-1.5 rounded-md border border-transparent px-3.5 text-[13px] leading-none font-medium whitespace-nowrap no-underline select-none transition-[background-color,border-color,color,opacity] duration-150 active:translate-y-px data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 [&_svg]:size-[15px] [&_svg]:shrink-0 data-[loading]:before:size-3 data-[loading]:before:animate-spin data-[loading]:before:rounded-full data-[loading]:before:border-2 data-[loading]:before:border-current data-[loading]:before:border-r-transparent";
|
|
21
|
-
var variants = {
|
|
22
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/85",
|
|
23
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-accent",
|
|
24
|
-
outline: "border-input bg-background text-foreground shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
25
|
-
ghost: "text-foreground hover:bg-accent hover:text-accent-foreground",
|
|
26
|
-
brand: "bg-brand-soft text-brand-soft-foreground hover:bg-brand-soft/85",
|
|
27
|
-
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/85",
|
|
28
|
-
link: "h-auto px-0 text-foreground underline decoration-transparent underline-offset-4 hover:decoration-current"
|
|
29
|
-
};
|
|
30
|
-
var sizes = {
|
|
31
|
-
default: "",
|
|
32
|
-
sm: "h-7 rounded-sm px-2.5 text-xs",
|
|
33
|
-
lg: "h-10 px-5 text-sm",
|
|
34
|
-
icon: "w-8.5 px-0",
|
|
35
|
-
"icon-sm": "h-7 w-7 rounded-sm px-0"
|
|
36
|
-
};
|
|
37
|
-
var buttonVariants = (options = {}) => cn(base, variants[options.variant ?? "default"], sizes[options.size ?? "default"], options.class);
|
|
38
|
-
var Button = (h, options = {}) => KitButton(h, {
|
|
39
|
-
element: options.element,
|
|
40
|
-
onPress: options.onPress,
|
|
41
|
-
props: options.loading ? { ...options.props, disabled: true, focusableWhenDisabled: true } : options.props
|
|
42
|
-
}).class(buttonVariants(options)).attr("data-loading", options.loading ? "" : undefined);
|
|
43
|
-
|
|
44
|
-
// ../../src/components/effectcn/checkbox.ts
|
|
45
|
-
var CheckboxRoot = (h, checkbox, options = {}) => checkbox.root(h.button.class(cn("border-input bg-background inline-grid size-4 shrink-0 place-items-center rounded-xs border p-0 " + "text-brand-foreground hover:border-muted-foreground shadow-sm transition-colors duration-150 " + "data-[checked]:border-brand data-[checked]:bg-brand " + "data-[indeterminate]:border-brand data-[indeterminate]:bg-brand " + "data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 data-[readonly]:cursor-default", options.class)));
|
|
46
|
-
var CheckboxIndicator = (h, checkbox, options = {}) => checkbox.indicator(h.span.class(cn("-mt-0.5 h-[5px] w-[9px] -rotate-45 border-b-[1.5px] border-l-[1.5px] border-current " + "data-[unchecked]:hidden " + "data-[indeterminate]:mt-0 data-[indeterminate]:h-0 data-[indeterminate]:w-2 " + "data-[indeterminate]:rotate-0 data-[indeterminate]:border-l-0", options.class)));
|
|
47
|
-
|
|
48
|
-
// ../../src/components/effectcn/input.ts
|
|
12
|
+
CheckboxIndicator,
|
|
13
|
+
CheckboxRoot
|
|
14
|
+
} from "@/components/effectcn/checkbox";
|
|
15
|
+
import { Input } from "@/components/effectcn/input";
|
|
49
16
|
import {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
var MenuPopup = (h, menu, options = {}) => menu.popup(h.div.class(cn(popup, options.class)));
|
|
74
|
-
var MenuItem = (h, menu, options) => menu.item({
|
|
75
|
-
element: h.div.class(cn(item, itemVariants[options.variant ?? "default"], options.inset === true && inset, options.class)),
|
|
76
|
-
value: options.value,
|
|
77
|
-
closeOnClick: options.closeOnClick
|
|
78
|
-
});
|
|
79
|
-
var MenuSubTrigger = (h, menu, submenu, options) => menu.item({
|
|
80
|
-
element: submenu.submenuTrigger(h.div.class(cn(item, submenuArrow, options.inset === true && inset, options.class))),
|
|
81
|
-
value: options.value
|
|
82
|
-
});
|
|
83
|
-
var MenuSeparator = (h, menu, options = {}) => menu.separator(h.div.class(cn("bg-border -mx-1 my-1 h-px", options.class)));
|
|
84
|
-
var MenuInput = (h, menu, options = {}) => menu.input(h.input.class(cn("-mx-1 -mt-1 mb-1 block h-[34px] w-[calc(100%+0.5rem)] border-b bg-transparent px-3 outline-none", "placeholder:text-muted-foreground", options.class)).attrs({
|
|
85
|
-
placeholder: options.placeholder,
|
|
86
|
-
"aria-label": options.label ?? options.placeholder
|
|
87
|
-
}));
|
|
88
|
-
var MenuEmpty = (h, menu, options = {}) => menu.empty(h.div.class(cn("text-muted-foreground px-2 py-3.5 text-center", options.class)));
|
|
89
|
-
|
|
90
|
-
// ../../src/components/effectcn/menubar.ts
|
|
91
|
-
var MenubarRoot = (h, menubar, className) => menubar.root(h.div.class(cn("group/menubar bg-background inline-flex items-center gap-0.5 rounded-md border p-[3px] shadow-sm", "data-[orientation=vertical]:min-w-40 data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch", className)));
|
|
92
|
-
var MenubarTrigger = (h, menu, label, className) => menu.trigger({
|
|
93
|
-
element: h.button.class(cn("text-foreground hover:bg-accent hover:text-accent-foreground data-[popup-open]:bg-accent data-[popup-open]:text-accent-foreground flex h-7 cursor-default items-center gap-2 rounded-sm px-2.5 text-[13px] font-medium transition-colors duration-150 select-none focus-visible:outline-offset-0 data-[disabled]:pointer-events-none data-[disabled]:opacity-45", className)).attr("aria-label", label)
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
// ../../src/components/data-table/html.ts
|
|
17
|
+
MenuCheckboxItem,
|
|
18
|
+
MenuEmpty,
|
|
19
|
+
MenuInput,
|
|
20
|
+
MenuItem,
|
|
21
|
+
MenuPopup,
|
|
22
|
+
MenuPositioner,
|
|
23
|
+
MenuRadioItem,
|
|
24
|
+
MenuSeparator,
|
|
25
|
+
MenuSubTrigger
|
|
26
|
+
} from "@/components/effectcn/menu";
|
|
27
|
+
import { MenubarRoot, MenubarTrigger } from "@/components/effectcn/menubar";
|
|
28
|
+
import {
|
|
29
|
+
SelectIcon as SelectIcon2,
|
|
30
|
+
SelectItem as SelectItem2,
|
|
31
|
+
SelectItemIndicator as SelectItemIndicator2,
|
|
32
|
+
SelectItemText as SelectItemText2,
|
|
33
|
+
SelectLabel as SelectLabel2,
|
|
34
|
+
SelectList as SelectList2,
|
|
35
|
+
SelectPopup as SelectPopup2,
|
|
36
|
+
SelectPositioner as SelectPositioner2,
|
|
37
|
+
SelectTrigger as SelectTrigger2,
|
|
38
|
+
SelectValue as SelectValue2
|
|
39
|
+
} from "@/components/effectcn/select";
|
|
97
40
|
import { krakstackLocaleRead as krakstackLocaleRead2 } from "@krak-stack/registry/krakstack-provider/html";
|
|
98
41
|
|
|
99
42
|
// ../../src/components/pagination/html.ts
|
|
100
43
|
import { Html } from "effect/ui/html";
|
|
101
44
|
import { Select } from "effect/ui/kit";
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}, { preventDefault: "always" }).class(cn("border-input bg-background inline-flex items-center justify-between gap-2 rounded-md border text-start", "text-foreground leading-none whitespace-nowrap shadow-sm select-none", "hover:bg-accent data-[popup-open]:bg-accent transition-colors duration-150", "data-[disabled]:hover:bg-background data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50", "data-[readonly]:bg-muted data-[readonly]:cursor-default", triggerSizes[options.size ?? "default"], options.class)));
|
|
118
|
-
var SelectValue = (h, select, options = {}) => select.value(h.span.class(cn("data-[placeholder]:text-muted-foreground min-w-0 truncate leading-snug", options.class)));
|
|
119
|
-
var SelectIcon = (h, select, options = {}) => select.icon(h.span.class(cn("border-muted-foreground mx-1 mb-[3px] size-[7px] shrink-0 rotate-45 border-r-[1.5px] border-b-[1.5px]", options.class)));
|
|
120
|
-
var SelectPositioner = (h, select, options = {}) => select.positioner(h.div.class(cn("outline-none data-[side=none]:my-2.5", options.class)));
|
|
121
|
-
var SelectPopup = (h, select, options = {}) => select.popup(h.div.class(cn("relative box-border max-w-[var(--available-width)] min-w-[max(var(--anchor-width),10rem)] overflow-y-auto", "bg-popover text-foreground shadow-float rounded-lg border p-1 outline-none", "max-h-[min(var(--available-height),20rem)] data-[side=none]:max-h-none", "origin-[var(--transform-origin)] transition-[opacity,scale] duration-150", "data-[ending-style]:opacity-0 data-[starting-style]:opacity-0", "not-data-[side=none]:data-[ending-style]:scale-95 not-data-[side=none]:data-[starting-style]:scale-95", "data-[side=none]:[scrollbar-width:none]", "has-[>[data-slot=select-list]]:flex has-[>[data-slot=select-list]]:flex-col", "has-[>[data-slot=select-list]]:overflow-hidden has-[>[data-slot=select-list]]:p-0", popupSizes[options.size ?? "default"], options.class)));
|
|
122
|
-
var SelectList = (h, select, options = {}) => select.list(h.div.attr("data-slot", "select-list").class(cn("min-h-0 flex-1 [scrollbar-width:none] overflow-y-auto p-1 outline-none", options.class)));
|
|
123
|
-
var SelectItem = (h, select, options) => select.item({
|
|
124
|
-
element: h.div.class(cn("flex min-h-7.5 cursor-default scroll-my-1 items-center gap-2 rounded-sm px-2 py-1 leading-snug outline-none", "data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground select-none", "data-[disabled]:text-muted-foreground data-[disabled]:opacity-60 data-[selected]:font-medium", "[&_svg]:text-muted-foreground [&_svg]:size-[15px] [&_svg]:shrink-0", options.class)),
|
|
125
|
-
value: options.value
|
|
126
|
-
});
|
|
127
|
-
var SelectItemText = (h, select, options = {}) => select.itemText(h.div.class(cn("min-w-0 flex-1 whitespace-nowrap", options.class)));
|
|
128
|
-
var SelectItemIndicator = (h, select, options) => select.itemIndicator({
|
|
129
|
-
element: h.span.class(cn("border-brand mr-1.5 mb-0.5 ml-2.5 h-[9px] w-[5px] shrink-0 rotate-45 border-r-[1.5px] border-b-[1.5px]", options.class)),
|
|
130
|
-
value: options.value
|
|
131
|
-
});
|
|
132
|
-
var scrollArrow = "inset-x-0 z-10 hidden h-6 cursor-default place-items-center rounded-lg bg-popover data-[visible]:grid " + "before:size-1.5 before:rotate-45 before:border-muted-foreground";
|
|
133
|
-
var SelectScrollUpArrow = (h, select, options = {}) => select.scrollUpArrow({
|
|
134
|
-
keepMounted: true,
|
|
135
|
-
element: h.div.class(cn(scrollArrow, "top-0 before:translate-y-0.5 before:border-t-[1.5px] before:border-l-[1.5px]", options.class))
|
|
136
|
-
});
|
|
137
|
-
var SelectScrollDownArrow = (h, select, options = {}) => select.scrollDownArrow({
|
|
138
|
-
keepMounted: true,
|
|
139
|
-
element: h.div.class(cn(scrollArrow, "bottom-0 before:-translate-y-0.5 before:border-r-[1.5px] before:border-b-[1.5px]", options.class))
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
// ../../src/components/pagination/html.ts
|
|
45
|
+
import { Button } from "@/components/effectcn/button";
|
|
46
|
+
import {
|
|
47
|
+
SelectIcon,
|
|
48
|
+
SelectItem,
|
|
49
|
+
SelectItemIndicator,
|
|
50
|
+
SelectItemText,
|
|
51
|
+
SelectLabel,
|
|
52
|
+
SelectList,
|
|
53
|
+
SelectPopup,
|
|
54
|
+
SelectPositioner,
|
|
55
|
+
SelectScrollDownArrow,
|
|
56
|
+
SelectScrollUpArrow,
|
|
57
|
+
SelectTrigger,
|
|
58
|
+
SelectValue
|
|
59
|
+
} from "@/components/effectcn/select";
|
|
143
60
|
import { krakstackLocaleRead } from "@krak-stack/registry/krakstack-provider/html";
|
|
144
61
|
import {
|
|
145
62
|
ChevronLeft,
|
|
@@ -148,6 +65,9 @@ import {
|
|
|
148
65
|
ChevronsRight
|
|
149
66
|
} from "@krak-stack/registry/lucide-effect";
|
|
150
67
|
|
|
68
|
+
// ../../src/lib/utils.ts
|
|
69
|
+
import { cn } from "cn";
|
|
70
|
+
|
|
151
71
|
// ../../src/components/pagination/classes.ts
|
|
152
72
|
var paginationClasses = {
|
|
153
73
|
root: "flex flex-col gap-3 px-2 sm:flex-row sm:items-center sm:justify-between",
|
|
@@ -1921,6 +1841,55 @@ var PersistPreferences = Mount.makeStream("DataTable/PersistPreferences", {
|
|
|
1921
1841
|
preferences: readTablePreferences(storageKey, host)
|
|
1922
1842
|
});
|
|
1923
1843
|
}), Stream2.filter((message) => message !== undefined)));
|
|
1844
|
+
var FilterSelectMessage = UiSchema3.TaggedEnum({
|
|
1845
|
+
OpenChanged: { open: Schema6.Boolean },
|
|
1846
|
+
Picked: { value: Schema6.String }
|
|
1847
|
+
});
|
|
1848
|
+
var FilterSelectEvent = UiSchema3.TaggedEnum({
|
|
1849
|
+
Changed: { value: Schema6.String }
|
|
1850
|
+
});
|
|
1851
|
+
var FilterSelect = Html2.component({
|
|
1852
|
+
name: "DataTableFilterSelect",
|
|
1853
|
+
props: Schema6.Struct({
|
|
1854
|
+
label: Schema6.String,
|
|
1855
|
+
value: Schema6.String,
|
|
1856
|
+
items: Schema6.Array(Schema6.Struct({ value: Schema6.String, label: Schema6.String }))
|
|
1857
|
+
}),
|
|
1858
|
+
model: Schema6.Boolean,
|
|
1859
|
+
message: FilterSelectMessage,
|
|
1860
|
+
events: FilterSelectEvent,
|
|
1861
|
+
restore: false
|
|
1862
|
+
}).make({
|
|
1863
|
+
init: () => false,
|
|
1864
|
+
update: {
|
|
1865
|
+
OpenChanged: ($, { open }) => $.set(open),
|
|
1866
|
+
Picked: ($, { value }) => $.set(false).emit(FilterSelectEvent.Changed({ value }))
|
|
1867
|
+
},
|
|
1868
|
+
view: (h, open) => Select2(h, {
|
|
1869
|
+
props: {
|
|
1870
|
+
open,
|
|
1871
|
+
items: h.props.items,
|
|
1872
|
+
value: h.props.value || null,
|
|
1873
|
+
placeholder: "—",
|
|
1874
|
+
alignItemWithTrigger: false
|
|
1875
|
+
},
|
|
1876
|
+
onEmit: {
|
|
1877
|
+
RequestedOpen: () => FilterSelectMessage.OpenChanged({ open: true }),
|
|
1878
|
+
RequestedClose: () => FilterSelectMessage.OpenChanged({ open: false }),
|
|
1879
|
+
Picked: ({ value }) => {
|
|
1880
|
+
const item = h.props.items.find((item) => item.value === value);
|
|
1881
|
+
return item && FilterSelectMessage.Picked({ value: item.value });
|
|
1882
|
+
},
|
|
1883
|
+
Settled: () => {
|
|
1884
|
+
return;
|
|
1885
|
+
}
|
|
1886
|
+
},
|
|
1887
|
+
view: (select) => h.div.class("grid gap-1").children(SelectLabel2(h, select, { class: "mb-0" }).children(h.props.label), SelectTrigger2(h, select, {
|
|
1888
|
+
size: "sm",
|
|
1889
|
+
class: "w-full min-w-0"
|
|
1890
|
+
}).children(SelectValue2(h, select), SelectIcon2(h, select)), SelectPositioner2(h, select).children(SelectPopup2(h, select, { size: "sm" }).children(SelectList2(h, select).children(h.props.items.map(({ value, label }) => SelectItem2(h, select, { value }).children(SelectItemText2(h, select).children(label), SelectItemIndicator2(h, select, { value })))))))
|
|
1891
|
+
})
|
|
1892
|
+
});
|
|
1924
1893
|
var DataTable = Html2.component({
|
|
1925
1894
|
...dataTableOptions,
|
|
1926
1895
|
reads: { localeConfig: krakstackLocaleRead2 }
|
|
@@ -2017,18 +1986,19 @@ var DataTable = Html2.component({
|
|
|
2017
1986
|
element: h.button.class(cn(buttonVariants({
|
|
2018
1987
|
variant: "ghost",
|
|
2019
1988
|
size: presentation === "actions" ? "icon" : "sm"
|
|
2020
|
-
}), presentation === "actions" && tableClasses.actionTrigger, presentation && presentation !== "actions" && "filtered" in presentation && tableClasses.headerTrigger, presentation && presentation !== "actions" && "relationship" in presentation && tableClasses.relationshipTrigger)).
|
|
2021
|
-
|
|
2022
|
-
"aria-description": presentation && presentation !== "actions" && "filtered" in presentation && presentation.filtered ? `${copy.filters}: ${presentation.filtered}` : undefined
|
|
2023
|
-
})
|
|
2024
|
-
})).attr("aria-busy", pending ? "true" : undefined).children(presentation === "actions" ? Ellipsis(h, { size: 16 }) : presentation && ("selectedCount" in presentation) ? [
|
|
1989
|
+
}), presentation === "actions" && tableClasses.actionTrigger, presentation && presentation !== "actions" && "filtered" in presentation && tableClasses.headerTrigger, presentation && presentation !== "actions" && "relationship" in presentation && tableClasses.relationshipTrigger)).attr("aria-label", accessibleLabel)
|
|
1990
|
+
})).attr("aria-busy", pending ? "true" : undefined).attr("aria-description", presentation && presentation !== "actions" && "toolbarIcon" in presentation && presentation.filterCount ? `${copy.filters}: ${presentation.filterCount}` : presentation && presentation !== "actions" && ("filtered" in presentation) && presentation.filtered ? `${copy.filters}: ${presentation.filtered}` : undefined).children(presentation === "actions" ? Ellipsis(h, { size: 16 }) : presentation && ("selectedCount" in presentation) ? [
|
|
2025
1991
|
copy.selected,
|
|
2026
1992
|
h.span.class(tableClasses.count).children(String(presentation.selectedCount)),
|
|
2027
1993
|
ChevronDown(h, { size: 16 })
|
|
2028
1994
|
] : presentation && ("relationship" in presentation) ? [
|
|
2029
1995
|
presentation.relationship,
|
|
2030
1996
|
ChevronDown(h, { size: 16, className: "shrink-0" })
|
|
2031
|
-
] : presentation && ("toolbarIcon" in presentation) ? [
|
|
1997
|
+
] : presentation && ("toolbarIcon" in presentation) ? [
|
|
1998
|
+
indicator(presentation.toolbarIcon),
|
|
1999
|
+
label,
|
|
2000
|
+
!!presentation.filterCount && h.span.attr("data-slot", "badge").class(tableClasses.count).children(String(presentation.filterCount))
|
|
2001
|
+
] : presentation ? [
|
|
2032
2002
|
h.span.class("truncate").children(label),
|
|
2033
2003
|
presentation.filtered > 0 && indicator("filter"),
|
|
2034
2004
|
indicator(presentation.sort)
|
|
@@ -2057,10 +2027,11 @@ var DataTable = Html2.component({
|
|
|
2057
2027
|
query: childSearch ? model.menuQuery : undefined,
|
|
2058
2028
|
filter: childSearch ? "contains" : undefined,
|
|
2059
2029
|
open: model.menu === key && model.submenu === subkey,
|
|
2060
|
-
items: subitems.map(({ id, name, disabled }) => ({
|
|
2030
|
+
items: subitems.map(({ id, name, disabled, checked }) => ({
|
|
2061
2031
|
value: id,
|
|
2062
2032
|
label: name,
|
|
2063
|
-
disabled
|
|
2033
|
+
disabled,
|
|
2034
|
+
checked
|
|
2064
2035
|
})),
|
|
2065
2036
|
locale
|
|
2066
2037
|
},
|
|
@@ -2088,12 +2059,22 @@ var DataTable = Html2.component({
|
|
|
2088
2059
|
name,
|
|
2089
2060
|
variant,
|
|
2090
2061
|
keepOpen,
|
|
2091
|
-
icon
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2062
|
+
icon,
|
|
2063
|
+
checked,
|
|
2064
|
+
radio,
|
|
2065
|
+
separatorBefore
|
|
2066
|
+
}) => {
|
|
2067
|
+
const options = {
|
|
2068
|
+
value: id,
|
|
2069
|
+
closeOnClick: keepOpen ? false : undefined
|
|
2070
|
+
};
|
|
2071
|
+
const part = radio ? MenuRadioItem(h, submenu, options) : checked !== undefined ? MenuCheckboxItem(h, submenu, options) : MenuItem(h, submenu, {
|
|
2072
|
+
...options,
|
|
2073
|
+
variant
|
|
2074
|
+
});
|
|
2075
|
+
const content = part.children(indicator(icon), name);
|
|
2076
|
+
return separatorBefore ? h.div.children(MenuSeparator(h, submenu), content) : content;
|
|
2077
|
+
})))))
|
|
2097
2078
|
});
|
|
2098
2079
|
}
|
|
2099
2080
|
const element = h.div.class(cn("data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex min-h-[30px] cursor-default items-center gap-2 rounded-sm px-2 whitespace-nowrap outline-none select-none data-[disabled]:opacity-45", variant === "destructive" && "text-destructive data-[highlighted]:bg-destructive/10 data-[highlighted]:text-destructive"));
|
|
@@ -2124,7 +2105,10 @@ var DataTable = Html2.component({
|
|
|
2124
2105
|
const filterColumn = draft && filterColumns.find(({ id }) => id === draft.id);
|
|
2125
2106
|
const filterKind = filterColumn && tableFilterKind(filterColumn);
|
|
2126
2107
|
const activeFilters = (query.filters ?? []).filter((filter) => filterColumns.some((column) => column.id === filter.id && tableFilterKind(column) === filter.kind));
|
|
2127
|
-
const selectFilter = (label, value, options, change) =>
|
|
2108
|
+
const selectFilter = (label, value, options, change) => FilterSelect(h, {
|
|
2109
|
+
props: { label, value, items: options },
|
|
2110
|
+
onEmit: { Changed: ({ value }) => change(value) }
|
|
2111
|
+
});
|
|
2128
2112
|
const filterInput = (label, field, value, type = "text") => h.label.class("grid gap-1 text-sm").children(label, Input(h, {
|
|
2129
2113
|
element: type === "number" ? h.input.attrs({ type: "number", step: "any" }) : h.input.attr("type", type),
|
|
2130
2114
|
props: { value },
|
|
@@ -2144,22 +2128,59 @@ var DataTable = Html2.component({
|
|
|
2144
2128
|
], filterKind === "date" && [
|
|
2145
2129
|
filterInput(copy.filterFrom, "primary", draft.primary, "date"),
|
|
2146
2130
|
filterInput(copy.filterTo, "secondary", draft.secondary, "date")
|
|
2147
|
-
],
|
|
2148
|
-
{ value: "", label: "—" },
|
|
2149
|
-
{ value: "true", label: copy.filterTrue },
|
|
2150
|
-
{ value: "false", label: copy.filterFalse }
|
|
2151
|
-
], (value) => DataTableMessage.FilterInputChanged({ field: "primary", value })), filterKind === "values" && h.fieldset.class("grid gap-1").children(h.legend.class("text-sm").children(copy.filterValue), (filterColumn.type === "list" && filterColumn.filterOptions ? filterColumn.filterOptions : tableFilterOptions(props.rowData, filterColumn.id, locale)).map(({ value, label }) => h.label.key(value).class("flex items-center gap-2 text-sm").children(h.input.attr("type", "checkbox").checked(draft.values.includes(value)).on("change", ({ checked }) => DataTableMessage.FilterValueToggled({ value, checked })), label))), model.invalidFilter && h.p.attr("role", "alert").class("text-destructive text-sm").children(copy.filterInvalid), h.div.class("flex flex-wrap gap-2").children(Button(h, {
|
|
2131
|
+
], model.invalidFilter && h.p.attr("role", "alert").class("text-destructive text-sm").children(copy.filterInvalid), h.div.class("flex flex-wrap gap-2").children(Button2(h, {
|
|
2152
2132
|
size: "sm",
|
|
2153
2133
|
onPress: DataTableMessage.FilterApplied()
|
|
2154
|
-
}).children(copy.filterApply),
|
|
2134
|
+
}).children(copy.filterApply), Button2(h, {
|
|
2155
2135
|
size: "sm",
|
|
2156
2136
|
variant: "outline",
|
|
2157
2137
|
onPress: DataTableMessage.FilterCleared()
|
|
2158
|
-
}).children(copy.filterClear)))
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2138
|
+
}).children(copy.filterClear))));
|
|
2139
|
+
const filterSubmenu = (column) => {
|
|
2140
|
+
const { id } = column;
|
|
2141
|
+
const current = activeFilters.find((filter) => filter.id === id);
|
|
2142
|
+
let children;
|
|
2143
|
+
if (column.type === "boolean") {
|
|
2144
|
+
children = [true, false].map((value) => ({
|
|
2145
|
+
id: String(value),
|
|
2146
|
+
name: value ? column.typeOptions?.trueLabel ?? copy.filterTrue : column.typeOptions?.falseLabel ?? copy.filterFalse,
|
|
2147
|
+
radio: true,
|
|
2148
|
+
checked: current?.kind === "boolean" && current.value === value,
|
|
2149
|
+
keepOpen: true,
|
|
2150
|
+
message: DataTableMessage.ColumnFilterChanged({
|
|
2151
|
+
id,
|
|
2152
|
+
filter: { id, kind: "boolean", value }
|
|
2153
|
+
})
|
|
2154
|
+
}));
|
|
2155
|
+
} else if (column.type === "list") {
|
|
2156
|
+
const selected = current?.kind === "values" ? current.values : [];
|
|
2157
|
+
const options = column.filterOptions ?? tableFilterOptions(props.rowData, id, locale);
|
|
2158
|
+
children = options.map(({ value, label }) => {
|
|
2159
|
+
const checked = selected.includes(value);
|
|
2160
|
+
const values = updateSelectedRows(selected, [value], !checked);
|
|
2161
|
+
return {
|
|
2162
|
+
id: keyOf("option", value),
|
|
2163
|
+
name: label,
|
|
2164
|
+
checked,
|
|
2165
|
+
keepOpen: true,
|
|
2166
|
+
message: DataTableMessage.ColumnFilterChanged({
|
|
2167
|
+
id,
|
|
2168
|
+
filter: Arr.isArrayNonEmpty(values) ? { id, kind: "values", values } : null
|
|
2169
|
+
})
|
|
2170
|
+
};
|
|
2171
|
+
});
|
|
2172
|
+
} else {
|
|
2173
|
+
return { filterColumnId: id, filterEditor: filterPanel };
|
|
2174
|
+
}
|
|
2175
|
+
children.push({
|
|
2176
|
+
id: "clear",
|
|
2177
|
+
name: copy.filterClear,
|
|
2178
|
+
keepOpen: true,
|
|
2179
|
+
separatorBefore: children.length > 0,
|
|
2180
|
+
message: DataTableMessage.ColumnFilterChanged({ id, filter: null })
|
|
2181
|
+
});
|
|
2182
|
+
return { children };
|
|
2183
|
+
};
|
|
2163
2184
|
const cell = (column, row) => {
|
|
2164
2185
|
const value = row.cells[column.id];
|
|
2165
2186
|
const empty = column.emptyLabel ?? "—";
|
|
@@ -2174,7 +2195,7 @@ var DataTable = Html2.component({
|
|
|
2174
2195
|
return date ? h.time.attr("datetime", dateIsoValue(date)).children(formatDateValue(date, column, locale)) : empty;
|
|
2175
2196
|
}
|
|
2176
2197
|
case "boolean":
|
|
2177
|
-
return isTableBoolean(value) ? check(keyOf("edit", row.id, column.id), `${column.headerName}: ${row.label}`, value, (value) => edit(DataTableEdit.SetBoolean({ value })), { readOnly: !column.editable || disabled }) : empty;
|
|
2198
|
+
return isTableBoolean(value) ? props.rowActivation && (!column.editable || disabled) ? value ? column.typeOptions?.trueLabel ?? copy.filterTrue : column.typeOptions?.falseLabel ?? copy.filterFalse : check(keyOf("edit", row.id, column.id), `${column.headerName}: ${row.label}`, value, (value) => edit(DataTableEdit.SetBoolean({ value })), { readOnly: !column.editable || disabled }) : empty;
|
|
2178
2199
|
case "reference":
|
|
2179
2200
|
return isTableReference(value) ? h.div.class(tableClasses.reference).children(h.span.class(cn(tableClasses.referenceAvatar, "rounded-full")).children(h.span.attr("aria-hidden", "true").children(tableInitials(value.label)), value.imageSrc && !model.failedImages.includes(value.imageSrc) && h.img.attrs({
|
|
2180
2201
|
src: value.imageSrc,
|
|
@@ -2252,7 +2273,7 @@ var DataTable = Html2.component({
|
|
|
2252
2273
|
itemId: value,
|
|
2253
2274
|
actionId: action.id
|
|
2254
2275
|
})
|
|
2255
|
-
}))), column.allowRemove && !disabled &&
|
|
2276
|
+
}))), column.allowRemove && !disabled && Button2(h, {
|
|
2256
2277
|
variant: "ghost",
|
|
2257
2278
|
size: "sm",
|
|
2258
2279
|
onPress: edit(DataTableEdit.RemoveItem({ itemId: value }))
|
|
@@ -2274,17 +2295,20 @@ var DataTable = Html2.component({
|
|
|
2274
2295
|
const renderRow = (row, siblings, key, group) => {
|
|
2275
2296
|
const primary = row.actions?.find(({ id, disabled }) => id === row.primaryActionId && !disabled);
|
|
2276
2297
|
const activate = props.rowActivation ? DataTableMessage.RowActivated({ rowId: row.id }) : primary && DataTableMessage.RowActionRequested({ rowId: row.id, actionId: primary.id });
|
|
2277
|
-
const
|
|
2278
|
-
const
|
|
2298
|
+
const tr = h.tr.key(keyOf(key, row.id)).class(cn("group/row hover:bg-muted/50 data-[selected]:bg-muted/40 border-b last:border-0", props.rowActivation && "cursor-pointer")).attr("data-selected", selected.has(row.id) ? "" : undefined);
|
|
2299
|
+
const rowElement = props.rowActivation && activate ? tr.attr("tabindex", "0").on("click", activate).on("keydown", (event) => !event.repeat && !event.composing && (event.key === "Enter" || event.key === " ") ? activate : undefined, { preventDefault: true }) : tr;
|
|
2300
|
+
const ignoreActivation = () => {
|
|
2301
|
+
return;
|
|
2302
|
+
};
|
|
2279
2303
|
const drop = dropOnRow(row.id, group);
|
|
2280
|
-
return (drop ?
|
|
2304
|
+
return (drop ? rowElement.dropTarget({ accepts: [RowDrag], dropEffect: "move" }).on("drop", drop) : rowElement).children(selection && h.td.class(tableClasses.selectionCell).on("click", ignoreActivation).on("keydown", ignoreActivation).children(h.div.class(tableClasses.selectionCenter).children(check(keyOf("select", key, row.id), `${copy.selectRow}: ${row.label}`, selected.has(row.id), (checked) => DataTableMessage.SelectionRequested({ rowIds: [row.id], checked }), { disabled: row.selectable === false }))), draggable && h.td.class("w-10 ps-1").on("click", ignoreActivation).on("keydown", ignoreActivation).children(dragHandle(row)), columns.map((column) => {
|
|
2281
2305
|
const td = h.td.key(column.id).attr("data-slot", "table-cell").class(cn(cellClass, tableClasses.cell, column.truncate ? "whitespace-nowrap" : "whitespace-normal", column.type === "list" && "p-0", "has-[[data-slot=data-table-list-cell]]:relative has-[[data-slot=data-table-list-cell]]:h-16"));
|
|
2282
2306
|
const content = () => h.div.class(cn(tableClasses.cellContent, column.truncate && "truncate")).children(cell(column, row));
|
|
2283
|
-
if (
|
|
2284
|
-
return td.
|
|
2307
|
+
if (column.type === "list" || column.type === "boolean" && column.editable && !row.disabledColumnIds?.includes(column.id)) {
|
|
2308
|
+
return td.on("click", ignoreActivation).on("keydown", ignoreActivation).children(content());
|
|
2285
2309
|
}
|
|
2286
|
-
return (
|
|
2287
|
-
}), rowActions && h.td.class(cn(tableClasses.actionsCell, "group-data-[selected]/row:bg-muted")).children(h.div.class(tableClasses.actionsAlign).children(primary && activate &&
|
|
2310
|
+
return (!props.rowActivation && activate && column.type !== "boolean" ? td.class("cursor-pointer").on("click", activate) : td).children(content());
|
|
2311
|
+
}), rowActions && h.td.on("click", ignoreActivation).on("keydown", ignoreActivation).class(cn(tableClasses.actionsCell, "group-data-[selected]/row:bg-muted")).children(h.div.class(tableClasses.actionsAlign).children(primary && activate && Button2(h, {
|
|
2288
2312
|
variant: primary.variant === "destructive" ? "destructive" : "ghost",
|
|
2289
2313
|
size: "sm",
|
|
2290
2314
|
onPress: activate
|
|
@@ -2303,7 +2327,7 @@ var DataTable = Html2.component({
|
|
|
2303
2327
|
const activate = props.rowActivation ? DataTableMessage.RowActivated({ rowId: row.id }) : primary && DataTableMessage.RowActionRequested({ rowId: row.id, actionId: primary.id });
|
|
2304
2328
|
const card = h.article.key(keyOf(key, row.id)).class("grid content-start gap-2 rounded-lg border p-3");
|
|
2305
2329
|
const drop = dropOnRow(row.id, group);
|
|
2306
|
-
return (drop ? card.dropTarget({ accepts: [RowDrag], dropEffect: "move" }).on("drop", drop) : card).children(isTableText(image) && h.img.attrs({ src: image, alt: "", loading: "lazy" }).class("aspect-video w-full rounded object-cover"), h.h3.class("font-medium").children(activate ?
|
|
2330
|
+
return (drop ? card.dropTarget({ accepts: [RowDrag], dropEffect: "move" }).on("drop", drop) : card).children(isTableText(image) && h.img.attrs({ src: image, alt: "", loading: "lazy" }).class("aspect-video w-full rounded object-cover"), h.h3.class("font-medium").children(activate ? Button2(h, {
|
|
2307
2331
|
variant: "ghost",
|
|
2308
2332
|
onPress: activate
|
|
2309
2333
|
}).children(name) : name), gallery.description && h.div.class("text-muted-foreground text-sm").children(galleryValue(gallery.description, row)), h.div.class("flex flex-wrap gap-2").children(gallery.tags?.map((id) => h.span.key(id).class("bg-muted rounded px-2 py-1 text-xs").children(galleryValue(id, row)))), selection && check(keyOf("select", key, row.id), `${copy.selectRow}: ${row.label}`, selected.has(row.id), (checked) => DataTableMessage.SelectionRequested({ rowIds: [row.id], checked }), { disabled: row.selectable === false }), h.div.class("flex items-center justify-end gap-1").children(dragHandle(row), rowControls(row, siblings, key)));
|
|
@@ -2356,7 +2380,7 @@ var DataTable = Html2.component({
|
|
|
2356
2380
|
}),
|
|
2357
2381
|
props: { value: query.globalFilter ?? "" },
|
|
2358
2382
|
onUpdate: ({ value }) => DataTableMessage.SearchChanged({ value })
|
|
2359
|
-
}).attr("aria-label", copy.search), !!query.globalFilter &&
|
|
2383
|
+
}).attr("aria-label", copy.search), !!query.globalFilter && Button2(h, {
|
|
2360
2384
|
class: "absolute end-1 top-1/2 -translate-y-1/2",
|
|
2361
2385
|
size: "icon-sm",
|
|
2362
2386
|
variant: "ghost",
|
|
@@ -2368,11 +2392,11 @@ var DataTable = Html2.component({
|
|
|
2368
2392
|
message: DataTableMessage.BulkActionRequested({
|
|
2369
2393
|
actionId: action.id
|
|
2370
2394
|
})
|
|
2371
|
-
})), true, undefined, false, { selectedCount }), features.filtering && filterColumns.length > 0 && menu(keyOf("filters"),
|
|
2372
|
-
...filterColumns.map((
|
|
2373
|
-
id,
|
|
2374
|
-
name: headerName,
|
|
2375
|
-
|
|
2395
|
+
})), true, undefined, false, { selectedCount }), features.filtering && filterColumns.length > 0 && menu(keyOf("filters"), copy.filters, copy.filters, [
|
|
2396
|
+
...filterColumns.map((column) => ({
|
|
2397
|
+
id: column.id,
|
|
2398
|
+
name: column.headerName,
|
|
2399
|
+
...filterSubmenu(column)
|
|
2376
2400
|
})),
|
|
2377
2401
|
...activeFilters.length > 0 ? [
|
|
2378
2402
|
{
|
|
@@ -2382,7 +2406,10 @@ var DataTable = Html2.component({
|
|
|
2382
2406
|
message: DataTableMessage.FiltersCleared()
|
|
2383
2407
|
}
|
|
2384
2408
|
] : []
|
|
2385
|
-
], true, undefined, false, {
|
|
2409
|
+
], true, undefined, false, {
|
|
2410
|
+
toolbarIcon: "filter",
|
|
2411
|
+
filterCount: activeFilters.length
|
|
2412
|
+
}), features.sorting && sortableColumns.length > 0 && menu(keyOf("sort-toolbar"), copy.sortBy, copy.sortBy, sortableColumns.map((column) => ({
|
|
2386
2413
|
id: column.id,
|
|
2387
2414
|
name: column.headerName,
|
|
2388
2415
|
children: ["asc", "desc", null].filter((direction) => direction !== null || sort.some(({ id }) => id === column.id)).map((direction) => ({
|
|
@@ -2520,8 +2547,7 @@ var DataTable = Html2.component({
|
|
|
2520
2547
|
...filtering ? tableDataColumns([column]).filter(({ filterable }) => filterable !== false).map((field, index) => ({
|
|
2521
2548
|
id: keyOf("filter", field.id),
|
|
2522
2549
|
name: column.fields?.length ? `${copy.filters}: ${field.headerName}` : copy.filters,
|
|
2523
|
-
|
|
2524
|
-
filterEditor: filterPanel,
|
|
2550
|
+
...filterSubmenu(field),
|
|
2525
2551
|
icon: "filter",
|
|
2526
2552
|
separatorBefore: sorting && index === 0
|
|
2527
2553
|
})) : [],
|
|
@@ -2607,18 +2633,19 @@ var DataTable = Html2.component({
|
|
|
2607
2633
|
}
|
|
2608
2634
|
});
|
|
2609
2635
|
|
|
2610
|
-
// ../../src/components/effectcn/dialog.ts
|
|
2611
|
-
var DialogBackdrop = (h, dialog, options = {}) => dialog.backdrop(h.div.class(cn("fixed inset-0 bg-[color-mix(in_oklab,var(--shadow-color,#000)_45%,transparent)] transition-opacity duration-200 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0", options.class)));
|
|
2612
|
-
var DialogViewport = (h, dialog, options = {}) => dialog.viewport(h.div.class(cn("pointer-events-none fixed inset-0 grid place-items-center p-4", options.class)));
|
|
2613
|
-
var DialogPopup = (h, dialog, options = {}) => dialog.popup(h.div.class(cn("bg-popover text-popover-foreground pointer-events-auto relative flex max-h-full w-full max-w-[440px] flex-col gap-4 rounded-lg border p-6 text-sm shadow-lg outline-none", "transition-[opacity,scale,translate,filter] duration-200 ease-out data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0", "data-[nested-dialog-open]:-translate-y-[calc(14px*var(--nested-dialogs))] data-[nested-dialog-open]:scale-[calc(1-0.05*var(--nested-dialogs))] data-[nested-dialog-open]:brightness-95", options.class)));
|
|
2614
|
-
var DialogTitle = (h, dialog, options = {}) => dialog.title(h.h2.class(cn("m-0 border-0 p-0 text-[16px] leading-snug font-semibold tracking-tight", options.class)));
|
|
2615
|
-
|
|
2616
2636
|
// ../../src/components/webhook-delivery-table/html.ts
|
|
2637
|
+
import { buttonVariants as buttonVariants2 } from "@/components/effectcn/button";
|
|
2638
|
+
import {
|
|
2639
|
+
DialogBackdrop,
|
|
2640
|
+
DialogPopup,
|
|
2641
|
+
DialogTitle,
|
|
2642
|
+
DialogViewport
|
|
2643
|
+
} from "@/components/effectcn/dialog";
|
|
2617
2644
|
import { krakstackLocaleRead as krakstackLocaleRead3 } from "@krak-stack/registry/krakstack-provider/html";
|
|
2618
2645
|
|
|
2619
2646
|
// ../../src/components/webhook-delivery-table/index.ts
|
|
2620
2647
|
import { Schema as Schema8 } from "effect";
|
|
2621
|
-
import { Component as Component3, UiSchema as
|
|
2648
|
+
import { Component as Component3, UiSchema as UiSchema4 } from "effect/ui";
|
|
2622
2649
|
|
|
2623
2650
|
// ../../src/components/webhook-delivery-table/schema.ts
|
|
2624
2651
|
import { Schema as Schema7 } from "effect";
|
|
@@ -2746,13 +2773,13 @@ var webhookDeliveryStatusDetails = (delivery, labels, dates) => webhookDeliveryS
|
|
|
2746
2773
|
`${labels.retries}: ${delivery.retries}`,
|
|
2747
2774
|
...delivery.status === "pending" ? [`${labels.retryAt}: ${dates.format(delivery.retryAt)}`] : []
|
|
2748
2775
|
].join(" · ") : undefined;
|
|
2749
|
-
var WebhookDeliveryTableMessage =
|
|
2776
|
+
var WebhookDeliveryTableMessage = UiSchema4.TaggedEnum({
|
|
2750
2777
|
OpenPayload: { id: Schema8.String },
|
|
2751
2778
|
ClosePayload: {},
|
|
2752
2779
|
QueryChanged: { query: WebhookDeliveryQuerySchema },
|
|
2753
2780
|
ExportRequested: {}
|
|
2754
2781
|
});
|
|
2755
|
-
var Events =
|
|
2782
|
+
var Events = UiSchema4.TaggedEnum({
|
|
2756
2783
|
QueryChanged: { query: WebhookDeliveryQuerySchema },
|
|
2757
2784
|
ExportRequested: { query: WebhookDeliveryQuerySchema }
|
|
2758
2785
|
});
|
|
@@ -2925,7 +2952,7 @@ var WebhookDeliveryTable = Html3.component({
|
|
|
2925
2952
|
},
|
|
2926
2953
|
view: (dialog) => h.div(dialog.portal(h.div)?.children(DialogBackdrop(h, dialog), DialogViewport(h, dialog).children(DialogPopup(h, dialog, {
|
|
2927
2954
|
class: "max-h-[calc(100svh-2rem)] sm:max-w-4xl"
|
|
2928
|
-
}).children(DialogTitle(h, dialog).children(labels.payload), selected && links?.[selected.id]?.map(({ href, label }) => h.a.key(href).class("underline underline-offset-4").attr("href", href).children(label)), h.pre.class("min-h-0 overflow-auto rounded-md bg-muted p-4 text-sm").children(h.code.children(JSON.stringify(selected?.data ?? null, null, 2))), dialog.initialFocus(dialog.close(h.button.class(
|
|
2955
|
+
}).children(DialogTitle(h, dialog).children(labels.payload), selected && links?.[selected.id]?.map(({ href, label }) => h.a.key(href).class("underline underline-offset-4").attr("href", href).children(label)), h.pre.class("min-h-0 overflow-auto rounded-md bg-muted p-4 text-sm").children(h.code.children(JSON.stringify(selected?.data ?? null, null, 2))), dialog.initialFocus(dialog.close(h.button.class(buttonVariants2({ variant: "outline" })))).children(labels.close)))))
|
|
2929
2956
|
}));
|
|
2930
2957
|
}
|
|
2931
2958
|
});
|