@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,141 +1,58 @@
|
|
|
1
1
|
// ../../src/components/data-table/html.ts
|
|
2
|
-
import { Schema as Schema6, Stream as Stream2 } from "effect";
|
|
3
|
-
import { Mount } from "effect/ui";
|
|
2
|
+
import { Array as Arr, Schema as Schema6, Stream as Stream2 } from "effect";
|
|
3
|
+
import { Mount, UiSchema as UiSchema3 } from "effect/ui";
|
|
4
4
|
import { Html as Html2 } from "effect/ui/html";
|
|
5
|
-
import { Checkbox, Menu, Menubar, VirtualList } from "effect/ui/kit";
|
|
6
|
-
|
|
7
|
-
// ../../src/components/effectcn/button.ts
|
|
5
|
+
import { Checkbox, Menu, Menubar, Select as Select2, VirtualList } from "effect/ui/kit";
|
|
6
|
+
import { Button as Button2, buttonVariants } from "@/components/effectcn/button";
|
|
8
7
|
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import { cn } from "cn";
|
|
14
|
-
|
|
15
|
-
// ../../src/components/effectcn/button.ts
|
|
16
|
-
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";
|
|
17
|
-
var variants = {
|
|
18
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/85",
|
|
19
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-accent",
|
|
20
|
-
outline: "border-input bg-background text-foreground shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
21
|
-
ghost: "text-foreground hover:bg-accent hover:text-accent-foreground",
|
|
22
|
-
brand: "bg-brand-soft text-brand-soft-foreground hover:bg-brand-soft/85",
|
|
23
|
-
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/85",
|
|
24
|
-
link: "h-auto px-0 text-foreground underline decoration-transparent underline-offset-4 hover:decoration-current"
|
|
25
|
-
};
|
|
26
|
-
var sizes = {
|
|
27
|
-
default: "",
|
|
28
|
-
sm: "h-7 rounded-sm px-2.5 text-xs",
|
|
29
|
-
lg: "h-10 px-5 text-sm",
|
|
30
|
-
icon: "w-8.5 px-0",
|
|
31
|
-
"icon-sm": "h-7 w-7 rounded-sm px-0"
|
|
32
|
-
};
|
|
33
|
-
var buttonVariants = (options = {}) => cn(base, variants[options.variant ?? "default"], sizes[options.size ?? "default"], options.class);
|
|
34
|
-
var Button = (h, options = {}) => KitButton(h, {
|
|
35
|
-
element: options.element,
|
|
36
|
-
onPress: options.onPress,
|
|
37
|
-
props: options.loading ? { ...options.props, disabled: true, focusableWhenDisabled: true } : options.props
|
|
38
|
-
}).class(buttonVariants(options)).attr("data-loading", options.loading ? "" : undefined);
|
|
39
|
-
|
|
40
|
-
// ../../src/components/effectcn/checkbox.ts
|
|
41
|
-
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)));
|
|
42
|
-
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)));
|
|
43
|
-
|
|
44
|
-
// ../../src/components/effectcn/input.ts
|
|
8
|
+
CheckboxIndicator,
|
|
9
|
+
CheckboxRoot
|
|
10
|
+
} from "@/components/effectcn/checkbox";
|
|
11
|
+
import { Input } from "@/components/effectcn/input";
|
|
45
12
|
import {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
var MenuPopup = (h, menu, options = {}) => menu.popup(h.div.class(cn(popup, options.class)));
|
|
70
|
-
var MenuItem = (h, menu, options) => menu.item({
|
|
71
|
-
element: h.div.class(cn(item, itemVariants[options.variant ?? "default"], options.inset === true && inset, options.class)),
|
|
72
|
-
value: options.value,
|
|
73
|
-
closeOnClick: options.closeOnClick
|
|
74
|
-
});
|
|
75
|
-
var MenuSubTrigger = (h, menu, submenu, options) => menu.item({
|
|
76
|
-
element: submenu.submenuTrigger(h.div.class(cn(item, submenuArrow, options.inset === true && inset, options.class))),
|
|
77
|
-
value: options.value
|
|
78
|
-
});
|
|
79
|
-
var MenuSeparator = (h, menu, options = {}) => menu.separator(h.div.class(cn("bg-border -mx-1 my-1 h-px", options.class)));
|
|
80
|
-
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({
|
|
81
|
-
placeholder: options.placeholder,
|
|
82
|
-
"aria-label": options.label ?? options.placeholder
|
|
83
|
-
}));
|
|
84
|
-
var MenuEmpty = (h, menu, options = {}) => menu.empty(h.div.class(cn("text-muted-foreground px-2 py-3.5 text-center", options.class)));
|
|
85
|
-
|
|
86
|
-
// ../../src/components/effectcn/menubar.ts
|
|
87
|
-
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)));
|
|
88
|
-
var MenubarTrigger = (h, menu, label, className) => menu.trigger({
|
|
89
|
-
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)
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
// ../../src/components/data-table/html.ts
|
|
13
|
+
MenuCheckboxItem,
|
|
14
|
+
MenuEmpty,
|
|
15
|
+
MenuInput,
|
|
16
|
+
MenuItem,
|
|
17
|
+
MenuPopup,
|
|
18
|
+
MenuPositioner,
|
|
19
|
+
MenuRadioItem,
|
|
20
|
+
MenuSeparator,
|
|
21
|
+
MenuSubTrigger
|
|
22
|
+
} from "@/components/effectcn/menu";
|
|
23
|
+
import { MenubarRoot, MenubarTrigger } from "@/components/effectcn/menubar";
|
|
24
|
+
import {
|
|
25
|
+
SelectIcon as SelectIcon2,
|
|
26
|
+
SelectItem as SelectItem2,
|
|
27
|
+
SelectItemIndicator as SelectItemIndicator2,
|
|
28
|
+
SelectItemText as SelectItemText2,
|
|
29
|
+
SelectLabel as SelectLabel2,
|
|
30
|
+
SelectList as SelectList2,
|
|
31
|
+
SelectPopup as SelectPopup2,
|
|
32
|
+
SelectPositioner as SelectPositioner2,
|
|
33
|
+
SelectTrigger as SelectTrigger2,
|
|
34
|
+
SelectValue as SelectValue2
|
|
35
|
+
} from "@/components/effectcn/select";
|
|
93
36
|
import { krakstackLocaleRead as krakstackLocaleRead2 } from "@krak-stack/registry/krakstack-provider/html";
|
|
94
37
|
|
|
95
38
|
// ../../src/components/pagination/html.ts
|
|
96
39
|
import { Html } from "effect/ui/html";
|
|
97
40
|
import { Select } from "effect/ui/kit";
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}, { 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)));
|
|
114
|
-
var SelectValue = (h, select, options = {}) => select.value(h.span.class(cn("data-[placeholder]:text-muted-foreground min-w-0 truncate leading-snug", options.class)));
|
|
115
|
-
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)));
|
|
116
|
-
var SelectPositioner = (h, select, options = {}) => select.positioner(h.div.class(cn("outline-none data-[side=none]:my-2.5", options.class)));
|
|
117
|
-
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)));
|
|
118
|
-
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)));
|
|
119
|
-
var SelectItem = (h, select, options) => select.item({
|
|
120
|
-
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)),
|
|
121
|
-
value: options.value
|
|
122
|
-
});
|
|
123
|
-
var SelectItemText = (h, select, options = {}) => select.itemText(h.div.class(cn("min-w-0 flex-1 whitespace-nowrap", options.class)));
|
|
124
|
-
var SelectItemIndicator = (h, select, options) => select.itemIndicator({
|
|
125
|
-
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)),
|
|
126
|
-
value: options.value
|
|
127
|
-
});
|
|
128
|
-
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";
|
|
129
|
-
var SelectScrollUpArrow = (h, select, options = {}) => select.scrollUpArrow({
|
|
130
|
-
keepMounted: true,
|
|
131
|
-
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))
|
|
132
|
-
});
|
|
133
|
-
var SelectScrollDownArrow = (h, select, options = {}) => select.scrollDownArrow({
|
|
134
|
-
keepMounted: true,
|
|
135
|
-
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))
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
// ../../src/components/pagination/html.ts
|
|
41
|
+
import { Button } from "@/components/effectcn/button";
|
|
42
|
+
import {
|
|
43
|
+
SelectIcon,
|
|
44
|
+
SelectItem,
|
|
45
|
+
SelectItemIndicator,
|
|
46
|
+
SelectItemText,
|
|
47
|
+
SelectLabel,
|
|
48
|
+
SelectList,
|
|
49
|
+
SelectPopup,
|
|
50
|
+
SelectPositioner,
|
|
51
|
+
SelectScrollDownArrow,
|
|
52
|
+
SelectScrollUpArrow,
|
|
53
|
+
SelectTrigger,
|
|
54
|
+
SelectValue
|
|
55
|
+
} from "@/components/effectcn/select";
|
|
139
56
|
import { krakstackLocaleRead } from "@krak-stack/registry/krakstack-provider/html";
|
|
140
57
|
import {
|
|
141
58
|
ChevronLeft,
|
|
@@ -144,6 +61,9 @@ import {
|
|
|
144
61
|
ChevronsRight
|
|
145
62
|
} from "@krak-stack/registry/lucide-effect";
|
|
146
63
|
|
|
64
|
+
// ../../src/lib/utils.ts
|
|
65
|
+
import { cn } from "cn";
|
|
66
|
+
|
|
147
67
|
// ../../src/components/pagination/classes.ts
|
|
148
68
|
var paginationClasses = {
|
|
149
69
|
root: "flex flex-col gap-3 px-2 sm:flex-row sm:items-center sm:justify-between",
|
|
@@ -1917,6 +1837,55 @@ var PersistPreferences = Mount.makeStream("DataTable/PersistPreferences", {
|
|
|
1917
1837
|
preferences: readTablePreferences(storageKey, host)
|
|
1918
1838
|
});
|
|
1919
1839
|
}), Stream2.filter((message) => message !== undefined)));
|
|
1840
|
+
var FilterSelectMessage = UiSchema3.TaggedEnum({
|
|
1841
|
+
OpenChanged: { open: Schema6.Boolean },
|
|
1842
|
+
Picked: { value: Schema6.String }
|
|
1843
|
+
});
|
|
1844
|
+
var FilterSelectEvent = UiSchema3.TaggedEnum({
|
|
1845
|
+
Changed: { value: Schema6.String }
|
|
1846
|
+
});
|
|
1847
|
+
var FilterSelect = Html2.component({
|
|
1848
|
+
name: "DataTableFilterSelect",
|
|
1849
|
+
props: Schema6.Struct({
|
|
1850
|
+
label: Schema6.String,
|
|
1851
|
+
value: Schema6.String,
|
|
1852
|
+
items: Schema6.Array(Schema6.Struct({ value: Schema6.String, label: Schema6.String }))
|
|
1853
|
+
}),
|
|
1854
|
+
model: Schema6.Boolean,
|
|
1855
|
+
message: FilterSelectMessage,
|
|
1856
|
+
events: FilterSelectEvent,
|
|
1857
|
+
restore: false
|
|
1858
|
+
}).make({
|
|
1859
|
+
init: () => false,
|
|
1860
|
+
update: {
|
|
1861
|
+
OpenChanged: ($, { open }) => $.set(open),
|
|
1862
|
+
Picked: ($, { value }) => $.set(false).emit(FilterSelectEvent.Changed({ value }))
|
|
1863
|
+
},
|
|
1864
|
+
view: (h, open) => Select2(h, {
|
|
1865
|
+
props: {
|
|
1866
|
+
open,
|
|
1867
|
+
items: h.props.items,
|
|
1868
|
+
value: h.props.value || null,
|
|
1869
|
+
placeholder: "—",
|
|
1870
|
+
alignItemWithTrigger: false
|
|
1871
|
+
},
|
|
1872
|
+
onEmit: {
|
|
1873
|
+
RequestedOpen: () => FilterSelectMessage.OpenChanged({ open: true }),
|
|
1874
|
+
RequestedClose: () => FilterSelectMessage.OpenChanged({ open: false }),
|
|
1875
|
+
Picked: ({ value }) => {
|
|
1876
|
+
const item = h.props.items.find((item) => item.value === value);
|
|
1877
|
+
return item && FilterSelectMessage.Picked({ value: item.value });
|
|
1878
|
+
},
|
|
1879
|
+
Settled: () => {
|
|
1880
|
+
return;
|
|
1881
|
+
}
|
|
1882
|
+
},
|
|
1883
|
+
view: (select) => h.div.class("grid gap-1").children(SelectLabel2(h, select, { class: "mb-0" }).children(h.props.label), SelectTrigger2(h, select, {
|
|
1884
|
+
size: "sm",
|
|
1885
|
+
class: "w-full min-w-0"
|
|
1886
|
+
}).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 })))))))
|
|
1887
|
+
})
|
|
1888
|
+
});
|
|
1920
1889
|
var DataTable = Html2.component({
|
|
1921
1890
|
...dataTableOptions,
|
|
1922
1891
|
reads: { localeConfig: krakstackLocaleRead2 }
|
|
@@ -2013,18 +1982,19 @@ var DataTable = Html2.component({
|
|
|
2013
1982
|
element: h.button.class(cn(buttonVariants({
|
|
2014
1983
|
variant: "ghost",
|
|
2015
1984
|
size: presentation === "actions" ? "icon" : "sm"
|
|
2016
|
-
}), presentation === "actions" && tableClasses.actionTrigger, presentation && presentation !== "actions" && "filtered" in presentation && tableClasses.headerTrigger, presentation && presentation !== "actions" && "relationship" in presentation && tableClasses.relationshipTrigger)).
|
|
2017
|
-
|
|
2018
|
-
"aria-description": presentation && presentation !== "actions" && "filtered" in presentation && presentation.filtered ? `${copy.filters}: ${presentation.filtered}` : undefined
|
|
2019
|
-
})
|
|
2020
|
-
})).attr("aria-busy", pending ? "true" : undefined).children(presentation === "actions" ? Ellipsis(h, { size: 16 }) : presentation && ("selectedCount" in presentation) ? [
|
|
1985
|
+
}), presentation === "actions" && tableClasses.actionTrigger, presentation && presentation !== "actions" && "filtered" in presentation && tableClasses.headerTrigger, presentation && presentation !== "actions" && "relationship" in presentation && tableClasses.relationshipTrigger)).attr("aria-label", accessibleLabel)
|
|
1986
|
+
})).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) ? [
|
|
2021
1987
|
copy.selected,
|
|
2022
1988
|
h.span.class(tableClasses.count).children(String(presentation.selectedCount)),
|
|
2023
1989
|
ChevronDown(h, { size: 16 })
|
|
2024
1990
|
] : presentation && ("relationship" in presentation) ? [
|
|
2025
1991
|
presentation.relationship,
|
|
2026
1992
|
ChevronDown(h, { size: 16, className: "shrink-0" })
|
|
2027
|
-
] : presentation && ("toolbarIcon" in presentation) ? [
|
|
1993
|
+
] : presentation && ("toolbarIcon" in presentation) ? [
|
|
1994
|
+
indicator(presentation.toolbarIcon),
|
|
1995
|
+
label,
|
|
1996
|
+
!!presentation.filterCount && h.span.attr("data-slot", "badge").class(tableClasses.count).children(String(presentation.filterCount))
|
|
1997
|
+
] : presentation ? [
|
|
2028
1998
|
h.span.class("truncate").children(label),
|
|
2029
1999
|
presentation.filtered > 0 && indicator("filter"),
|
|
2030
2000
|
indicator(presentation.sort)
|
|
@@ -2053,10 +2023,11 @@ var DataTable = Html2.component({
|
|
|
2053
2023
|
query: childSearch ? model.menuQuery : undefined,
|
|
2054
2024
|
filter: childSearch ? "contains" : undefined,
|
|
2055
2025
|
open: model.menu === key && model.submenu === subkey,
|
|
2056
|
-
items: subitems.map(({ id, name, disabled }) => ({
|
|
2026
|
+
items: subitems.map(({ id, name, disabled, checked }) => ({
|
|
2057
2027
|
value: id,
|
|
2058
2028
|
label: name,
|
|
2059
|
-
disabled
|
|
2029
|
+
disabled,
|
|
2030
|
+
checked
|
|
2060
2031
|
})),
|
|
2061
2032
|
locale
|
|
2062
2033
|
},
|
|
@@ -2084,12 +2055,22 @@ var DataTable = Html2.component({
|
|
|
2084
2055
|
name,
|
|
2085
2056
|
variant,
|
|
2086
2057
|
keepOpen,
|
|
2087
|
-
icon
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2058
|
+
icon,
|
|
2059
|
+
checked,
|
|
2060
|
+
radio,
|
|
2061
|
+
separatorBefore
|
|
2062
|
+
}) => {
|
|
2063
|
+
const options = {
|
|
2064
|
+
value: id,
|
|
2065
|
+
closeOnClick: keepOpen ? false : undefined
|
|
2066
|
+
};
|
|
2067
|
+
const part = radio ? MenuRadioItem(h, submenu, options) : checked !== undefined ? MenuCheckboxItem(h, submenu, options) : MenuItem(h, submenu, {
|
|
2068
|
+
...options,
|
|
2069
|
+
variant
|
|
2070
|
+
});
|
|
2071
|
+
const content = part.children(indicator(icon), name);
|
|
2072
|
+
return separatorBefore ? h.div.children(MenuSeparator(h, submenu), content) : content;
|
|
2073
|
+
})))))
|
|
2093
2074
|
});
|
|
2094
2075
|
}
|
|
2095
2076
|
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"));
|
|
@@ -2120,7 +2101,10 @@ var DataTable = Html2.component({
|
|
|
2120
2101
|
const filterColumn = draft && filterColumns.find(({ id }) => id === draft.id);
|
|
2121
2102
|
const filterKind = filterColumn && tableFilterKind(filterColumn);
|
|
2122
2103
|
const activeFilters = (query.filters ?? []).filter((filter) => filterColumns.some((column) => column.id === filter.id && tableFilterKind(column) === filter.kind));
|
|
2123
|
-
const selectFilter = (label, value, options, change) =>
|
|
2104
|
+
const selectFilter = (label, value, options, change) => FilterSelect(h, {
|
|
2105
|
+
props: { label, value, items: options },
|
|
2106
|
+
onEmit: { Changed: ({ value }) => change(value) }
|
|
2107
|
+
});
|
|
2124
2108
|
const filterInput = (label, field, value, type = "text") => h.label.class("grid gap-1 text-sm").children(label, Input(h, {
|
|
2125
2109
|
element: type === "number" ? h.input.attrs({ type: "number", step: "any" }) : h.input.attr("type", type),
|
|
2126
2110
|
props: { value },
|
|
@@ -2140,22 +2124,59 @@ var DataTable = Html2.component({
|
|
|
2140
2124
|
], filterKind === "date" && [
|
|
2141
2125
|
filterInput(copy.filterFrom, "primary", draft.primary, "date"),
|
|
2142
2126
|
filterInput(copy.filterTo, "secondary", draft.secondary, "date")
|
|
2143
|
-
],
|
|
2144
|
-
{ value: "", label: "—" },
|
|
2145
|
-
{ value: "true", label: copy.filterTrue },
|
|
2146
|
-
{ value: "false", label: copy.filterFalse }
|
|
2147
|
-
], (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, {
|
|
2127
|
+
], 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, {
|
|
2148
2128
|
size: "sm",
|
|
2149
2129
|
onPress: DataTableMessage.FilterApplied()
|
|
2150
|
-
}).children(copy.filterApply),
|
|
2130
|
+
}).children(copy.filterApply), Button2(h, {
|
|
2151
2131
|
size: "sm",
|
|
2152
2132
|
variant: "outline",
|
|
2153
2133
|
onPress: DataTableMessage.FilterCleared()
|
|
2154
|
-
}).children(copy.filterClear)))
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2134
|
+
}).children(copy.filterClear))));
|
|
2135
|
+
const filterSubmenu = (column) => {
|
|
2136
|
+
const { id } = column;
|
|
2137
|
+
const current = activeFilters.find((filter) => filter.id === id);
|
|
2138
|
+
let children;
|
|
2139
|
+
if (column.type === "boolean") {
|
|
2140
|
+
children = [true, false].map((value) => ({
|
|
2141
|
+
id: String(value),
|
|
2142
|
+
name: value ? column.typeOptions?.trueLabel ?? copy.filterTrue : column.typeOptions?.falseLabel ?? copy.filterFalse,
|
|
2143
|
+
radio: true,
|
|
2144
|
+
checked: current?.kind === "boolean" && current.value === value,
|
|
2145
|
+
keepOpen: true,
|
|
2146
|
+
message: DataTableMessage.ColumnFilterChanged({
|
|
2147
|
+
id,
|
|
2148
|
+
filter: { id, kind: "boolean", value }
|
|
2149
|
+
})
|
|
2150
|
+
}));
|
|
2151
|
+
} else if (column.type === "list") {
|
|
2152
|
+
const selected = current?.kind === "values" ? current.values : [];
|
|
2153
|
+
const options = column.filterOptions ?? tableFilterOptions(props.rowData, id, locale);
|
|
2154
|
+
children = options.map(({ value, label }) => {
|
|
2155
|
+
const checked = selected.includes(value);
|
|
2156
|
+
const values = updateSelectedRows(selected, [value], !checked);
|
|
2157
|
+
return {
|
|
2158
|
+
id: keyOf("option", value),
|
|
2159
|
+
name: label,
|
|
2160
|
+
checked,
|
|
2161
|
+
keepOpen: true,
|
|
2162
|
+
message: DataTableMessage.ColumnFilterChanged({
|
|
2163
|
+
id,
|
|
2164
|
+
filter: Arr.isArrayNonEmpty(values) ? { id, kind: "values", values } : null
|
|
2165
|
+
})
|
|
2166
|
+
};
|
|
2167
|
+
});
|
|
2168
|
+
} else {
|
|
2169
|
+
return { filterColumnId: id, filterEditor: filterPanel };
|
|
2170
|
+
}
|
|
2171
|
+
children.push({
|
|
2172
|
+
id: "clear",
|
|
2173
|
+
name: copy.filterClear,
|
|
2174
|
+
keepOpen: true,
|
|
2175
|
+
separatorBefore: children.length > 0,
|
|
2176
|
+
message: DataTableMessage.ColumnFilterChanged({ id, filter: null })
|
|
2177
|
+
});
|
|
2178
|
+
return { children };
|
|
2179
|
+
};
|
|
2159
2180
|
const cell = (column, row) => {
|
|
2160
2181
|
const value = row.cells[column.id];
|
|
2161
2182
|
const empty = column.emptyLabel ?? "—";
|
|
@@ -2170,7 +2191,7 @@ var DataTable = Html2.component({
|
|
|
2170
2191
|
return date ? h.time.attr("datetime", dateIsoValue(date)).children(formatDateValue(date, column, locale)) : empty;
|
|
2171
2192
|
}
|
|
2172
2193
|
case "boolean":
|
|
2173
|
-
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;
|
|
2194
|
+
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;
|
|
2174
2195
|
case "reference":
|
|
2175
2196
|
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({
|
|
2176
2197
|
src: value.imageSrc,
|
|
@@ -2248,7 +2269,7 @@ var DataTable = Html2.component({
|
|
|
2248
2269
|
itemId: value,
|
|
2249
2270
|
actionId: action.id
|
|
2250
2271
|
})
|
|
2251
|
-
}))), column.allowRemove && !disabled &&
|
|
2272
|
+
}))), column.allowRemove && !disabled && Button2(h, {
|
|
2252
2273
|
variant: "ghost",
|
|
2253
2274
|
size: "sm",
|
|
2254
2275
|
onPress: edit(DataTableEdit.RemoveItem({ itemId: value }))
|
|
@@ -2270,17 +2291,20 @@ var DataTable = Html2.component({
|
|
|
2270
2291
|
const renderRow = (row, siblings, key, group) => {
|
|
2271
2292
|
const primary = row.actions?.find(({ id, disabled }) => id === row.primaryActionId && !disabled);
|
|
2272
2293
|
const activate = props.rowActivation ? DataTableMessage.RowActivated({ rowId: row.id }) : primary && DataTableMessage.RowActionRequested({ rowId: row.id, actionId: primary.id });
|
|
2273
|
-
const
|
|
2274
|
-
const
|
|
2294
|
+
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);
|
|
2295
|
+
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;
|
|
2296
|
+
const ignoreActivation = () => {
|
|
2297
|
+
return;
|
|
2298
|
+
};
|
|
2275
2299
|
const drop = dropOnRow(row.id, group);
|
|
2276
|
-
return (drop ?
|
|
2300
|
+
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) => {
|
|
2277
2301
|
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"));
|
|
2278
2302
|
const content = () => h.div.class(cn(tableClasses.cellContent, column.truncate && "truncate")).children(cell(column, row));
|
|
2279
|
-
if (
|
|
2280
|
-
return td.
|
|
2303
|
+
if (column.type === "list" || column.type === "boolean" && column.editable && !row.disabledColumnIds?.includes(column.id)) {
|
|
2304
|
+
return td.on("click", ignoreActivation).on("keydown", ignoreActivation).children(content());
|
|
2281
2305
|
}
|
|
2282
|
-
return (
|
|
2283
|
-
}), rowActions && h.td.class(cn(tableClasses.actionsCell, "group-data-[selected]/row:bg-muted")).children(h.div.class(tableClasses.actionsAlign).children(primary && activate &&
|
|
2306
|
+
return (!props.rowActivation && activate && column.type !== "boolean" ? td.class("cursor-pointer").on("click", activate) : td).children(content());
|
|
2307
|
+
}), 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, {
|
|
2284
2308
|
variant: primary.variant === "destructive" ? "destructive" : "ghost",
|
|
2285
2309
|
size: "sm",
|
|
2286
2310
|
onPress: activate
|
|
@@ -2299,7 +2323,7 @@ var DataTable = Html2.component({
|
|
|
2299
2323
|
const activate = props.rowActivation ? DataTableMessage.RowActivated({ rowId: row.id }) : primary && DataTableMessage.RowActionRequested({ rowId: row.id, actionId: primary.id });
|
|
2300
2324
|
const card = h.article.key(keyOf(key, row.id)).class("grid content-start gap-2 rounded-lg border p-3");
|
|
2301
2325
|
const drop = dropOnRow(row.id, group);
|
|
2302
|
-
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 ?
|
|
2326
|
+
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, {
|
|
2303
2327
|
variant: "ghost",
|
|
2304
2328
|
onPress: activate
|
|
2305
2329
|
}).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)));
|
|
@@ -2352,7 +2376,7 @@ var DataTable = Html2.component({
|
|
|
2352
2376
|
}),
|
|
2353
2377
|
props: { value: query.globalFilter ?? "" },
|
|
2354
2378
|
onUpdate: ({ value }) => DataTableMessage.SearchChanged({ value })
|
|
2355
|
-
}).attr("aria-label", copy.search), !!query.globalFilter &&
|
|
2379
|
+
}).attr("aria-label", copy.search), !!query.globalFilter && Button2(h, {
|
|
2356
2380
|
class: "absolute end-1 top-1/2 -translate-y-1/2",
|
|
2357
2381
|
size: "icon-sm",
|
|
2358
2382
|
variant: "ghost",
|
|
@@ -2364,11 +2388,11 @@ var DataTable = Html2.component({
|
|
|
2364
2388
|
message: DataTableMessage.BulkActionRequested({
|
|
2365
2389
|
actionId: action.id
|
|
2366
2390
|
})
|
|
2367
|
-
})), true, undefined, false, { selectedCount }), features.filtering && filterColumns.length > 0 && menu(keyOf("filters"),
|
|
2368
|
-
...filterColumns.map((
|
|
2369
|
-
id,
|
|
2370
|
-
name: headerName,
|
|
2371
|
-
|
|
2391
|
+
})), true, undefined, false, { selectedCount }), features.filtering && filterColumns.length > 0 && menu(keyOf("filters"), copy.filters, copy.filters, [
|
|
2392
|
+
...filterColumns.map((column) => ({
|
|
2393
|
+
id: column.id,
|
|
2394
|
+
name: column.headerName,
|
|
2395
|
+
...filterSubmenu(column)
|
|
2372
2396
|
})),
|
|
2373
2397
|
...activeFilters.length > 0 ? [
|
|
2374
2398
|
{
|
|
@@ -2378,7 +2402,10 @@ var DataTable = Html2.component({
|
|
|
2378
2402
|
message: DataTableMessage.FiltersCleared()
|
|
2379
2403
|
}
|
|
2380
2404
|
] : []
|
|
2381
|
-
], true, undefined, false, {
|
|
2405
|
+
], true, undefined, false, {
|
|
2406
|
+
toolbarIcon: "filter",
|
|
2407
|
+
filterCount: activeFilters.length
|
|
2408
|
+
}), features.sorting && sortableColumns.length > 0 && menu(keyOf("sort-toolbar"), copy.sortBy, copy.sortBy, sortableColumns.map((column) => ({
|
|
2382
2409
|
id: column.id,
|
|
2383
2410
|
name: column.headerName,
|
|
2384
2411
|
children: ["asc", "desc", null].filter((direction) => direction !== null || sort.some(({ id }) => id === column.id)).map((direction) => ({
|
|
@@ -2516,8 +2543,7 @@ var DataTable = Html2.component({
|
|
|
2516
2543
|
...filtering ? tableDataColumns([column]).filter(({ filterable }) => filterable !== false).map((field, index) => ({
|
|
2517
2544
|
id: keyOf("filter", field.id),
|
|
2518
2545
|
name: column.fields?.length ? `${copy.filters}: ${field.headerName}` : copy.filters,
|
|
2519
|
-
|
|
2520
|
-
filterEditor: filterPanel,
|
|
2546
|
+
...filterSubmenu(field),
|
|
2521
2547
|
icon: "filter",
|
|
2522
2548
|
separatorBefore: sorting && index === 0
|
|
2523
2549
|
})) : [],
|