@krak-stack/registry 0.11.4 → 0.11.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -1
- package/README.md +23 -9
- package/dist/components/agent/react.js +226 -1072
- package/dist/components/app-switcher/html.js +10 -53
- package/dist/components/app-switcher/react.js +29 -139
- package/dist/components/async-action-button/html.js +3 -34
- package/dist/components/async-action-button/react.d.ts +1 -1
- package/dist/components/async-action-button/react.js +8 -54
- package/dist/components/audit-log-table/react.js +706 -1279
- package/dist/components/bulk-list-input/html.js +3 -40
- package/dist/components/bulk-list-input/react.d.ts +1 -1
- package/dist/components/bulk-list-input/react.js +6 -59
- package/dist/components/code-block/html.js +1 -35
- package/dist/components/code-block/react.js +12 -59
- package/dist/components/color-input/html.js +2 -19
- package/dist/components/color-input/react.js +6 -97
- package/dist/components/copy-button/html.js +1 -35
- package/dist/components/copy-button/react.d.ts +1 -1
- package/dist/components/copy-button/react.js +7 -54
- package/dist/components/copy-value/html.js +11 -52
- package/dist/components/copy-value/react.js +25 -165
- package/dist/components/cron-input/html.js +2 -18
- package/dist/components/cron-input/react.js +15 -30
- package/dist/components/danger-confirmation/html.js +11 -57
- package/dist/components/danger-confirmation/react.js +26 -187
- package/dist/components/data-table/classes.d.ts +9 -3
- package/dist/components/data-table/html.d.ts +93 -21
- package/dist/components/data-table/html.js +309 -196
- package/dist/components/data-table/index.d.ts +97 -9
- package/dist/components/data-table/react.d.ts +14 -3
- package/dist/components/data-table/react.js +700 -1273
- package/dist/components/data-table/schema.d.ts +175 -16
- package/dist/components/date-input/html.js +19 -74
- package/dist/components/date-input/react.d.ts +1 -1
- package/dist/components/date-input/react.js +28 -313
- package/dist/components/docs/classes.d.ts +15 -0
- package/dist/components/docs/html.d.ts +55 -0
- package/dist/components/docs/html.js +837 -0
- package/dist/components/docs/index.d.ts +49 -0
- package/dist/components/docs/react.d.ts +10 -0
- package/dist/components/docs/react.js +949 -0
- package/dist/components/docs/schema.d.ts +49 -0
- package/dist/components/editable-text/html.js +6 -52
- package/dist/components/editable-text/react.js +13 -83
- package/dist/components/editing-locale-switcher/html.d.ts +2 -2
- package/dist/components/editing-locale-switcher/html.js +13 -43
- package/dist/components/editing-locale-switcher/react.js +17 -141
- package/dist/components/effect-form/react.js +249 -812
- package/dist/components/email-composer/react.js +62 -279
- package/dist/components/email-editor/html.js +13 -58
- package/dist/components/email-editor/react.js +187 -483
- package/dist/components/error-component/html.js +2 -47
- package/dist/components/error-component/react.js +33 -137
- package/dist/components/file-input/html.js +9 -40
- package/dist/components/file-input/react.js +39 -208
- package/dist/components/form/react.js +212 -777
- package/dist/components/icon-input/html.js +9 -56
- package/dist/components/icon-input/react.js +43 -143
- package/dist/components/image-crop-editor/html.js +1 -35
- package/dist/components/image-crop-editor/react.js +21 -66
- package/dist/components/locale-switcher/html.js +8 -55
- package/dist/components/locale-switcher/react.js +21 -146
- package/dist/components/map-menu/html.d.ts +8 -8
- package/dist/components/map-menu/html.js +13 -72
- package/dist/components/map-menu/react.js +92 -309
- package/dist/components/markdown/html.js +1 -35
- package/dist/components/markdown/react.js +20 -64
- package/dist/components/notification-menu/html.js +14 -50
- package/dist/components/notification-menu/react.js +73 -343
- package/dist/components/pagination/html.js +17 -73
- package/dist/components/pagination/react.js +37 -200
- package/dist/components/phone-number-input/html.js +19 -57
- package/dist/components/phone-number-input/react.d.ts +1 -1
- package/dist/components/phone-number-input/react.js +43 -142
- package/dist/components/presence-transition/index.d.ts +2 -2
- package/dist/components/registry-previews/component-example.js +26 -126
- package/dist/components/rich-text-editor/html.d.ts +12 -12
- package/dist/components/rich-text-editor/html.js +12 -85
- package/dist/components/rich-text-editor/react.js +55 -272
- package/dist/components/search-menu/classes.d.ts +2 -0
- package/dist/components/search-menu/html.d.ts +2 -0
- package/dist/components/search-menu/html.js +40 -73
- package/dist/components/search-menu/index.d.ts +27 -2
- package/dist/components/search-menu/react.d.ts +1 -1
- package/dist/components/search-menu/react.js +59 -280
- package/dist/components/search-menu/schema.d.ts +1 -0
- package/dist/components/select-with-custom-input/html.d.ts +2 -2
- package/dist/components/select-with-custom-input/html.js +13 -48
- package/dist/components/select-with-custom-input/react.js +22 -146
- package/dist/components/sidebar-layout/html.d.ts +16 -6
- package/dist/components/sidebar-layout/html.js +83 -69
- package/dist/components/sidebar-layout/index.d.ts +16 -0
- package/dist/components/sidebar-layout/react.js +105 -698
- package/dist/components/stats-card/react.js +13 -58
- package/dist/components/support/html.js +14 -69
- package/dist/components/support/react.js +74 -320
- package/dist/components/theme-switcher/html.js +11 -55
- package/dist/components/theme-switcher/react.js +28 -152
- package/dist/components/time-input/html.d.ts +2 -2
- package/dist/components/time-input/html.js +8 -53
- package/dist/components/time-input/react.js +34 -188
- package/dist/components/timezone-input/html.js +11 -67
- package/dist/components/timezone-input/react.js +41 -143
- package/dist/components/toast/html.d.ts +6 -6
- package/dist/components/toast/html.js +13 -46
- package/dist/components/tracking-notice/react.js +39 -188
- package/dist/components/unsaved-changes-guard/html.js +9 -43
- package/dist/components/unsaved-changes-guard/react.js +19 -169
- package/dist/components/upload-attachment/html.d.ts +4 -4
- package/dist/components/upload-attachment/html.js +4 -35
- package/dist/components/upload-attachment/react.js +25 -164
- package/dist/components/virtualized-combobox/html.js +10 -35
- package/dist/components/virtualized-combobox/react.js +28 -129
- package/dist/components/webhook-delivery-table/html.js +320 -206
- package/dist/components/webhook-delivery-table/react.js +736 -1376
- package/dist/lib/docs.integrations.server.js +150 -202
- package/dist/lib/docs.js +305 -1085
- package/dist/lib/docs.server.js +134 -186
- package/dist/lib/documentation-toolkit.js +144 -196
- package/dist/services/agent/client/index.js +226 -1072
- package/dist/services/notification/client/index.js +73 -343
- package/dist/services/notification/public.js +73 -343
- package/package.json +5 -13
- package/dist/components/effectcn/alert-dialog.d.ts +0 -13
- package/dist/components/effectcn/button.d.ts +0 -31
- package/dist/components/effectcn/calendar.d.ts +0 -12
- package/dist/components/effectcn/checkbox.d.ts +0 -10
- package/dist/components/effectcn/combobox.d.ts +0 -25
- package/dist/components/effectcn/dialog.d.ts +0 -19
- package/dist/components/effectcn/field.d.ts +0 -11
- package/dist/components/effectcn/file-drop.d.ts +0 -8
- package/dist/components/effectcn/input.d.ts +0 -26
- package/dist/components/effectcn/menu.d.ts +0 -85
- package/dist/components/effectcn/menubar.d.ts +0 -8
- package/dist/components/effectcn/popover.d.ts +0 -18
- package/dist/components/effectcn/scroll-area.d.ts +0 -12
- package/dist/components/effectcn/select.d.ts +0 -68
- package/dist/components/effectcn/toast.d.ts +0 -29
- package/dist/components/ui/alert-dialog.d.ts +0 -18
- package/dist/components/ui/alert.d.ts +0 -10
- package/dist/components/ui/attachment.d.ts +0 -23
- package/dist/components/ui/badge.d.ts +0 -7
- package/dist/components/ui/bubble.d.ts +0 -16
- package/dist/components/ui/button.d.ts +0 -8
- package/dist/components/ui/calendar.d.ts +0 -10
- package/dist/components/ui/card.d.ts +0 -11
- package/dist/components/ui/checkbox.d.ts +0 -3
- package/dist/components/ui/collapsible.d.ts +0 -5
- package/dist/components/ui/command.d.ts +0 -18
- package/dist/components/ui/dialog.d.ts +0 -17
- package/dist/components/ui/dropdown-menu.d.ts +0 -29
- package/dist/components/ui/empty.d.ts +0 -11
- package/dist/components/ui/field.d.ts +0 -24
- package/dist/components/ui/input-group.d.ts +0 -17
- package/dist/components/ui/input.d.ts +0 -3
- package/dist/components/ui/item.d.ts +0 -22
- package/dist/components/ui/label.d.ts +0 -3
- package/dist/components/ui/menubar.d.ts +0 -29
- package/dist/components/ui/message-scroller.d.ts +0 -10
- package/dist/components/ui/message.d.ts +0 -10
- package/dist/components/ui/popover.d.ts +0 -9
- package/dist/components/ui/scroll-area.d.ts +0 -4
- package/dist/components/ui/select.d.ts +0 -15
- package/dist/components/ui/select.js +0 -159
- package/dist/components/ui/separator.d.ts +0 -3
- package/dist/components/ui/sheet.d.ts +0 -14
- package/dist/components/ui/sidebar.d.ts +0 -63
- package/dist/components/ui/skeleton.d.ts +0 -2
- package/dist/components/ui/table.d.ts +0 -10
- package/dist/components/ui/tabs.d.ts +0 -10
- package/dist/components/ui/textarea.d.ts +0 -3
- package/dist/components/ui/tooltip.d.ts +0 -6
- package/dist/components/ui/trace.d.ts +0 -18
- package/dist/lib/effectcn-form.d.ts +0 -3
- package/dist/lib/effectcn-form.js +0 -54
|
@@ -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",
|
|
@@ -545,9 +465,16 @@ import { Csv } from "effect/encoding";
|
|
|
545
465
|
import { Command, Component as Component2, Subscription, UiSchema as UiSchema2 } from "effect/ui";
|
|
546
466
|
|
|
547
467
|
// ../../src/components/data-table/schema.ts
|
|
548
|
-
import { DateTime as DateTime2, Option as Option2, Schema as Schema4, Struct as Struct2, Tuple } from "effect";
|
|
468
|
+
import { DateTime as DateTime2, Option as Option2, Predicate, Schema as Schema4, Struct as Struct2, Tuple } from "effect";
|
|
549
469
|
|
|
550
470
|
// ../../src/components/data-table/classes.ts
|
|
471
|
+
var booleanCellControl = "flex min-h-16 w-full items-center justify-start px-2 in-[[data-slot=table-cell]]:absolute in-[[data-slot=table-cell]]:inset-0 in-[[data-slot=table-cell]]:min-h-0 has-[:focus-visible]:outline-2 has-[:focus-visible]:-outline-offset-2 has-[:focus-visible]:outline-ring";
|
|
472
|
+
var cellTriggerFocus = "focus-visible:ring-0 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring";
|
|
473
|
+
var tableBadgeTones = {
|
|
474
|
+
success: "border-emerald-200 bg-emerald-100 text-emerald-900 dark:border-emerald-900/50 dark:bg-emerald-950/50 dark:text-emerald-200",
|
|
475
|
+
info: "border-blue-200 bg-blue-100 text-blue-900 dark:border-blue-900/50 dark:bg-blue-950/50 dark:text-blue-200",
|
|
476
|
+
muted: "border-muted bg-muted text-muted-foreground dark:bg-muted/50"
|
|
477
|
+
};
|
|
551
478
|
var tableClasses = {
|
|
552
479
|
selectionCell: "w-10 p-0 align-middle",
|
|
553
480
|
selectionCenter: "grid place-items-center",
|
|
@@ -559,16 +486,16 @@ var tableClasses = {
|
|
|
559
486
|
menubar: "h-auto w-full flex-wrap justify-start border border-input bg-transparent",
|
|
560
487
|
cell: "overflow-hidden",
|
|
561
488
|
cellContent: "min-w-0 wrap-anywhere",
|
|
562
|
-
actionTrigger:
|
|
489
|
+
actionTrigger: `size-8 ${cellTriggerFocus}`,
|
|
563
490
|
actionsCell: "sticky right-0 z-20 w-10 min-w-10 cursor-default bg-background p-0 transition-colors group-hover/row:bg-[color-mix(in_oklab,var(--muted)_50%,var(--background))]",
|
|
564
491
|
actionsAlign: "flex min-h-12 items-center justify-end pe-1",
|
|
565
492
|
header: "relative h-12 p-0",
|
|
566
493
|
stickyHeader: "sticky top-0 z-30 bg-background",
|
|
567
494
|
stickyHeaderRule: "after:border-border after:pointer-events-none after:absolute after:inset-x-0 after:bottom-0 after:border-b",
|
|
568
|
-
headerTrigger:
|
|
495
|
+
headerTrigger: `absolute inset-0 h-full w-full min-w-0 justify-start rounded-none px-2 pe-4 ${cellTriggerFocus}`,
|
|
569
496
|
resizeHandle: "absolute inset-y-0 right-0 z-10 w-2 cursor-col-resize touch-none outline-none after:absolute after:inset-y-3 after:right-0 after:w-px after:bg-border hover:after:w-0.5 hover:after:bg-primary/60 focus-visible:after:w-0.5 focus-visible:after:bg-ring",
|
|
570
497
|
relationshipCell: "grid min-h-16 in-[[data-slot=table-cell]]:absolute in-[[data-slot=table-cell]]:inset-0 in-[[data-slot=table-cell]]:min-h-0",
|
|
571
|
-
relationshipTrigger:
|
|
498
|
+
relationshipTrigger: `h-full w-full min-w-0 justify-between rounded-none px-2 text-start ${cellTriggerFocus}`,
|
|
572
499
|
reference: "flex min-w-0 items-center gap-2",
|
|
573
500
|
referenceAvatar: "relative grid size-8 shrink-0 place-items-center overflow-hidden bg-muted text-xs font-medium",
|
|
574
501
|
referenceText: "flex min-w-0 flex-col leading-tight",
|
|
@@ -692,8 +619,33 @@ var column = {
|
|
|
692
619
|
emptyLabel: Schema4.optionalKey(Schema4.String),
|
|
693
620
|
nulls: Schema4.optionalKey(Schema4.Literals(["first", "last"]))
|
|
694
621
|
};
|
|
622
|
+
var DataTableBadgeOptionSchema = Schema4.Struct({
|
|
623
|
+
value: Schema4.NonEmptyString,
|
|
624
|
+
label: Schema4.optionalKey(Schema4.String),
|
|
625
|
+
variant: Schema4.optionalKey(Schema4.Literals([
|
|
626
|
+
"default",
|
|
627
|
+
"secondary",
|
|
628
|
+
"outline",
|
|
629
|
+
"destructive",
|
|
630
|
+
"success",
|
|
631
|
+
"info",
|
|
632
|
+
"muted"
|
|
633
|
+
]))
|
|
634
|
+
}).annotate({ identifier: "DataTableBadgeOption" });
|
|
635
|
+
var BadgeIcon = Schema4.declare((value) => Predicate.isFunction(value)).annotate({ identifier: "DataTableBadgeIcon" });
|
|
636
|
+
var DataTableBadgeOptionsSchema = Schema4.Struct({
|
|
637
|
+
options: Schema4.optionalKey(Schema4.Array(DataTableBadgeOptionSchema.mapFields((fields) => ({
|
|
638
|
+
...fields,
|
|
639
|
+
icon: Schema4.optionalKey(BadgeIcon)
|
|
640
|
+
}))))
|
|
641
|
+
}).annotate({ identifier: "DataTableBadgeOptions" });
|
|
695
642
|
var DataTableFieldSchema = Schema4.Union([
|
|
696
|
-
Schema4.Struct({
|
|
643
|
+
Schema4.Struct({
|
|
644
|
+
...column,
|
|
645
|
+
type: Schema4.Literal("text"),
|
|
646
|
+
display: Schema4.optionalKey(Schema4.Literal("badge")),
|
|
647
|
+
typeOptions: Schema4.optionalKey(DataTableBadgeOptionsSchema)
|
|
648
|
+
}),
|
|
697
649
|
Schema4.Struct({
|
|
698
650
|
...column,
|
|
699
651
|
type: Schema4.Literal("number"),
|
|
@@ -736,7 +688,7 @@ var DataTableFieldSchema = Schema4.Union([
|
|
|
736
688
|
options: Schema4.optionalKey(Schema4.Array(DataTableItemSchema)),
|
|
737
689
|
allowRemove: Schema4.optionalKey(Schema4.Boolean),
|
|
738
690
|
itemActions: Schema4.optionalKey(Schema4.Array(DataTableActionSchema)),
|
|
739
|
-
display: Schema4.optionalKey(Schema4.Literals(["list", "icon"])),
|
|
691
|
+
display: Schema4.optionalKey(Schema4.Literals(["list", "icon", "badge"])),
|
|
740
692
|
visibleCount: Schema4.optionalKey(Schema4.Int.check(Schema4.isGreaterThanOrEqualTo(0))),
|
|
741
693
|
actionsLabel: Schema4.optionalKey(Schema4.String),
|
|
742
694
|
manageLabel: Schema4.optionalKey(Schema4.String)
|
|
@@ -1038,7 +990,33 @@ var matchesFilterText = (value, filter) => {
|
|
|
1038
990
|
return text.endsWith(query);
|
|
1039
991
|
}
|
|
1040
992
|
};
|
|
1041
|
-
var tableFilterKind = (column, hasOptions = false) => hasOptions || column.type === "list" ? "values" : column.type === "reference" ? "text" : column.type === "dateTime" ? "date" : column.type ?? "text";
|
|
993
|
+
var tableFilterKind = (column, hasOptions = false) => hasOptions || column.type === "list" || column.display === "badge" ? "values" : column.type === "reference" ? "text" : column.type === "dateTime" ? "date" : column.type ?? "text";
|
|
994
|
+
var tableBadgeValue = (value) => isTableText(value) && value !== "" ? value : null;
|
|
995
|
+
var tableBadge = (input, config) => {
|
|
996
|
+
const value = tableBadgeValue(input);
|
|
997
|
+
if (value === null)
|
|
998
|
+
return null;
|
|
999
|
+
const option = config?.options?.find((option) => option.value === value);
|
|
1000
|
+
return {
|
|
1001
|
+
value,
|
|
1002
|
+
label: option?.label ?? value,
|
|
1003
|
+
variant: option?.variant ?? "secondary",
|
|
1004
|
+
option
|
|
1005
|
+
};
|
|
1006
|
+
};
|
|
1007
|
+
var tableBadgeFilterOptions = (values, config) => {
|
|
1008
|
+
const options = new Map(config?.options?.map(({ value, label }) => [value, label ?? value]));
|
|
1009
|
+
for (const input of values) {
|
|
1010
|
+
const value = tableBadgeValue(input);
|
|
1011
|
+
if (value !== null && !options.has(value))
|
|
1012
|
+
options.set(value, value);
|
|
1013
|
+
}
|
|
1014
|
+
return [...options].map(([value, label]) => ({ value, label }));
|
|
1015
|
+
};
|
|
1016
|
+
var tableBadgeSearchText = (value, config) => {
|
|
1017
|
+
const badge = tableBadge(value, config);
|
|
1018
|
+
return badge ? `${badge.label} ${badge.value}` : "";
|
|
1019
|
+
};
|
|
1042
1020
|
var matchesTableFilter = (filter, value, type, text, values) => {
|
|
1043
1021
|
switch (filter.kind) {
|
|
1044
1022
|
case "text":
|
|
@@ -1083,13 +1061,20 @@ var filterTableColumns = (rows, columns, filters) => {
|
|
|
1083
1061
|
return rows;
|
|
1084
1062
|
return rows.filter((row) => active.every((filter) => {
|
|
1085
1063
|
const value = row.cells[filter.id];
|
|
1086
|
-
|
|
1064
|
+
const column = byId.get(filter.id);
|
|
1065
|
+
return matchesTableFilter(filter, value, column?.type, () => isTableText(value) ? value : isTableReference(value) ? `${value.label} ${value.description ?? ""}`.trim() : "", () => {
|
|
1066
|
+
if (column?.type === "text" && column.display === "badge") {
|
|
1067
|
+
const key = tableBadgeValue(value);
|
|
1068
|
+
return key === null ? [] : [key];
|
|
1069
|
+
}
|
|
1070
|
+
return isTableList(value) ? value.map(({ value }) => value) : [];
|
|
1071
|
+
});
|
|
1087
1072
|
}));
|
|
1088
1073
|
};
|
|
1089
1074
|
var columnValue = (column, value) => {
|
|
1090
1075
|
switch (column.type) {
|
|
1091
1076
|
case "text":
|
|
1092
|
-
return isTableText(value) ? value : null;
|
|
1077
|
+
return column.display === "badge" ? tableBadgeValue(value) : isTableText(value) ? value : null;
|
|
1093
1078
|
case "number":
|
|
1094
1079
|
case "boolean":
|
|
1095
1080
|
case "date":
|
|
@@ -1143,6 +1128,8 @@ var filterTableRows = (rows, columns, search, locale) => {
|
|
|
1143
1128
|
const searchable = columns.filter(({ searchable }) => searchable !== false);
|
|
1144
1129
|
return rows.filter((row) => searchable.some((column) => {
|
|
1145
1130
|
const value = row.cells[column.id];
|
|
1131
|
+
if (column.type === "text" && column.display === "badge")
|
|
1132
|
+
return tableBadgeSearchText(value, column.typeOptions).toLocaleLowerCase(locale).includes(query);
|
|
1146
1133
|
if (column.type === "date" || column.type === "dateTime") {
|
|
1147
1134
|
const date = resolveDate(value, column.type);
|
|
1148
1135
|
return !!date && `${formatDateValue(date, column, locale)} ${dateIsoValue(date)}`.toLocaleLowerCase(locale).includes(query);
|
|
@@ -1898,6 +1885,14 @@ var dataTableBehaviours = {
|
|
|
1898
1885
|
// ../../src/components/data-table/html.ts
|
|
1899
1886
|
var keyOf = (...parts) => JSON.stringify(parts);
|
|
1900
1887
|
var cellClass = "px-3 py-2 align-middle";
|
|
1888
|
+
var badgeVariants = {
|
|
1889
|
+
...tableBadgeTones,
|
|
1890
|
+
default: "bg-primary text-primary-foreground",
|
|
1891
|
+
secondary: "bg-secondary text-secondary-foreground",
|
|
1892
|
+
outline: "border-border text-foreground",
|
|
1893
|
+
destructive: "bg-destructive/10 text-destructive dark:bg-destructive/20"
|
|
1894
|
+
};
|
|
1895
|
+
var badgeClass = "inline-flex items-center gap-1 rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap";
|
|
1901
1896
|
var isTextFilterOperator = Schema6.is(TextFilterOperator);
|
|
1902
1897
|
var RowDrag = "application/x-krakstack-table-row";
|
|
1903
1898
|
var PersistPreferences = Mount.makeStream("DataTable/PersistPreferences", {
|
|
@@ -1917,6 +1912,55 @@ var PersistPreferences = Mount.makeStream("DataTable/PersistPreferences", {
|
|
|
1917
1912
|
preferences: readTablePreferences(storageKey, host)
|
|
1918
1913
|
});
|
|
1919
1914
|
}), Stream2.filter((message) => message !== undefined)));
|
|
1915
|
+
var FilterSelectMessage = UiSchema3.TaggedEnum({
|
|
1916
|
+
OpenChanged: { open: Schema6.Boolean },
|
|
1917
|
+
Picked: { value: Schema6.String }
|
|
1918
|
+
});
|
|
1919
|
+
var FilterSelectEvent = UiSchema3.TaggedEnum({
|
|
1920
|
+
Changed: { value: Schema6.String }
|
|
1921
|
+
});
|
|
1922
|
+
var FilterSelect = Html2.component({
|
|
1923
|
+
name: "DataTableFilterSelect",
|
|
1924
|
+
props: Schema6.Struct({
|
|
1925
|
+
label: Schema6.String,
|
|
1926
|
+
value: Schema6.String,
|
|
1927
|
+
items: Schema6.Array(Schema6.Struct({ value: Schema6.String, label: Schema6.String }))
|
|
1928
|
+
}),
|
|
1929
|
+
model: Schema6.Boolean,
|
|
1930
|
+
message: FilterSelectMessage,
|
|
1931
|
+
events: FilterSelectEvent,
|
|
1932
|
+
restore: false
|
|
1933
|
+
}).make({
|
|
1934
|
+
init: () => false,
|
|
1935
|
+
update: {
|
|
1936
|
+
OpenChanged: ($, { open }) => $.set(open),
|
|
1937
|
+
Picked: ($, { value }) => $.set(false).emit(FilterSelectEvent.Changed({ value }))
|
|
1938
|
+
},
|
|
1939
|
+
view: (h, open) => Select2(h, {
|
|
1940
|
+
props: {
|
|
1941
|
+
open,
|
|
1942
|
+
items: h.props.items,
|
|
1943
|
+
value: h.props.value || null,
|
|
1944
|
+
placeholder: "—",
|
|
1945
|
+
alignItemWithTrigger: false
|
|
1946
|
+
},
|
|
1947
|
+
onEmit: {
|
|
1948
|
+
RequestedOpen: () => FilterSelectMessage.OpenChanged({ open: true }),
|
|
1949
|
+
RequestedClose: () => FilterSelectMessage.OpenChanged({ open: false }),
|
|
1950
|
+
Picked: ({ value }) => {
|
|
1951
|
+
const item = h.props.items.find((item) => item.value === value);
|
|
1952
|
+
return item && FilterSelectMessage.Picked({ value: item.value });
|
|
1953
|
+
},
|
|
1954
|
+
Settled: () => {
|
|
1955
|
+
return;
|
|
1956
|
+
}
|
|
1957
|
+
},
|
|
1958
|
+
view: (select) => h.div.class("grid gap-1").children(SelectLabel2(h, select, { class: "mb-0" }).children(h.props.label), SelectTrigger2(h, select, {
|
|
1959
|
+
size: "sm",
|
|
1960
|
+
class: "w-full min-w-0"
|
|
1961
|
+
}).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 })))))))
|
|
1962
|
+
})
|
|
1963
|
+
});
|
|
1920
1964
|
var DataTable = Html2.component({
|
|
1921
1965
|
...dataTableOptions,
|
|
1922
1966
|
reads: { localeConfig: krakstackLocaleRead2 }
|
|
@@ -2013,18 +2057,19 @@ var DataTable = Html2.component({
|
|
|
2013
2057
|
element: h.button.class(cn(buttonVariants({
|
|
2014
2058
|
variant: "ghost",
|
|
2015
2059
|
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) ? [
|
|
2060
|
+
}), presentation === "actions" && tableClasses.actionTrigger, presentation && presentation !== "actions" && "filtered" in presentation && tableClasses.headerTrigger, presentation && presentation !== "actions" && "relationship" in presentation && tableClasses.relationshipTrigger)).attr("aria-label", accessibleLabel)
|
|
2061
|
+
})).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
2062
|
copy.selected,
|
|
2022
2063
|
h.span.class(tableClasses.count).children(String(presentation.selectedCount)),
|
|
2023
2064
|
ChevronDown(h, { size: 16 })
|
|
2024
2065
|
] : presentation && ("relationship" in presentation) ? [
|
|
2025
2066
|
presentation.relationship,
|
|
2026
2067
|
ChevronDown(h, { size: 16, className: "shrink-0" })
|
|
2027
|
-
] : presentation && ("toolbarIcon" in presentation) ? [
|
|
2068
|
+
] : presentation && ("toolbarIcon" in presentation) ? [
|
|
2069
|
+
indicator(presentation.toolbarIcon),
|
|
2070
|
+
label,
|
|
2071
|
+
!!presentation.filterCount && h.span.attr("data-slot", "badge").class(tableClasses.count).children(String(presentation.filterCount))
|
|
2072
|
+
] : presentation ? [
|
|
2028
2073
|
h.span.class("truncate").children(label),
|
|
2029
2074
|
presentation.filtered > 0 && indicator("filter"),
|
|
2030
2075
|
indicator(presentation.sort)
|
|
@@ -2053,10 +2098,11 @@ var DataTable = Html2.component({
|
|
|
2053
2098
|
query: childSearch ? model.menuQuery : undefined,
|
|
2054
2099
|
filter: childSearch ? "contains" : undefined,
|
|
2055
2100
|
open: model.menu === key && model.submenu === subkey,
|
|
2056
|
-
items: subitems.map(({ id, name, disabled }) => ({
|
|
2101
|
+
items: subitems.map(({ id, name, disabled, checked }) => ({
|
|
2057
2102
|
value: id,
|
|
2058
2103
|
label: name,
|
|
2059
|
-
disabled
|
|
2104
|
+
disabled,
|
|
2105
|
+
checked
|
|
2060
2106
|
})),
|
|
2061
2107
|
locale
|
|
2062
2108
|
},
|
|
@@ -2084,12 +2130,22 @@ var DataTable = Html2.component({
|
|
|
2084
2130
|
name,
|
|
2085
2131
|
variant,
|
|
2086
2132
|
keepOpen,
|
|
2087
|
-
icon
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2133
|
+
icon,
|
|
2134
|
+
checked,
|
|
2135
|
+
radio,
|
|
2136
|
+
separatorBefore
|
|
2137
|
+
}) => {
|
|
2138
|
+
const options = {
|
|
2139
|
+
value: id,
|
|
2140
|
+
closeOnClick: keepOpen ? false : undefined
|
|
2141
|
+
};
|
|
2142
|
+
const part = radio ? MenuRadioItem(h, submenu, options) : checked !== undefined ? MenuCheckboxItem(h, submenu, options) : MenuItem(h, submenu, {
|
|
2143
|
+
...options,
|
|
2144
|
+
variant
|
|
2145
|
+
});
|
|
2146
|
+
const content = part.children(indicator(icon), name);
|
|
2147
|
+
return separatorBefore ? h.div.children(MenuSeparator(h, submenu), content) : content;
|
|
2148
|
+
})))))
|
|
2093
2149
|
});
|
|
2094
2150
|
}
|
|
2095
2151
|
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"));
|
|
@@ -2107,11 +2163,13 @@ var DataTable = Html2.component({
|
|
|
2107
2163
|
})))));
|
|
2108
2164
|
}
|
|
2109
2165
|
});
|
|
2110
|
-
const check = (key, label, checked, onToggle, options) => Checkbox(h, {
|
|
2166
|
+
const check = (key, label, checked, onToggle, options, inCell = false) => Checkbox(h, {
|
|
2111
2167
|
key,
|
|
2112
2168
|
props: { checked, ...options },
|
|
2113
2169
|
onEmit: { Toggled: ({ checked }) => onToggle(checked) },
|
|
2114
|
-
view: (checkbox) => h.span.class("grid size-4 shrink-0 place-items-center").children(CheckboxRoot(h, checkbox
|
|
2170
|
+
view: (checkbox) => h.span.class("grid size-4 shrink-0 place-items-center").children(CheckboxRoot(h, checkbox, {
|
|
2171
|
+
class: inCell ? "focus-visible:outline-none" : undefined
|
|
2172
|
+
}).attr("aria-label", label).children(CheckboxIndicator(h, checkbox, {
|
|
2115
2173
|
class: "pointer-events-none"
|
|
2116
2174
|
})))
|
|
2117
2175
|
});
|
|
@@ -2120,7 +2178,10 @@ var DataTable = Html2.component({
|
|
|
2120
2178
|
const filterColumn = draft && filterColumns.find(({ id }) => id === draft.id);
|
|
2121
2179
|
const filterKind = filterColumn && tableFilterKind(filterColumn);
|
|
2122
2180
|
const activeFilters = (query.filters ?? []).filter((filter) => filterColumns.some((column) => column.id === filter.id && tableFilterKind(column) === filter.kind));
|
|
2123
|
-
const selectFilter = (label, value, options, change) =>
|
|
2181
|
+
const selectFilter = (label, value, options, change) => FilterSelect(h, {
|
|
2182
|
+
props: { label, value, items: options },
|
|
2183
|
+
onEmit: { Changed: ({ value }) => change(value) }
|
|
2184
|
+
});
|
|
2124
2185
|
const filterInput = (label, field, value, type = "text") => h.label.class("grid gap-1 text-sm").children(label, Input(h, {
|
|
2125
2186
|
element: type === "number" ? h.input.attrs({ type: "number", step: "any" }) : h.input.attr("type", type),
|
|
2126
2187
|
props: { value },
|
|
@@ -2140,28 +2201,71 @@ var DataTable = Html2.component({
|
|
|
2140
2201
|
], filterKind === "date" && [
|
|
2141
2202
|
filterInput(copy.filterFrom, "primary", draft.primary, "date"),
|
|
2142
2203
|
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, {
|
|
2204
|
+
], 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
2205
|
size: "sm",
|
|
2149
2206
|
onPress: DataTableMessage.FilterApplied()
|
|
2150
|
-
}).children(copy.filterApply),
|
|
2207
|
+
}).children(copy.filterApply), Button2(h, {
|
|
2151
2208
|
size: "sm",
|
|
2152
2209
|
variant: "outline",
|
|
2153
2210
|
onPress: DataTableMessage.FilterCleared()
|
|
2154
|
-
}).children(copy.filterClear)))
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2211
|
+
}).children(copy.filterClear))));
|
|
2212
|
+
const filterSubmenu = (column) => {
|
|
2213
|
+
const { id } = column;
|
|
2214
|
+
const current = activeFilters.find((filter) => filter.id === id);
|
|
2215
|
+
let children;
|
|
2216
|
+
if (column.type === "boolean") {
|
|
2217
|
+
children = [true, false].map((value) => ({
|
|
2218
|
+
id: String(value),
|
|
2219
|
+
name: value ? column.typeOptions?.trueLabel ?? copy.filterTrue : column.typeOptions?.falseLabel ?? copy.filterFalse,
|
|
2220
|
+
radio: true,
|
|
2221
|
+
checked: current?.kind === "boolean" && current.value === value,
|
|
2222
|
+
keepOpen: true,
|
|
2223
|
+
message: DataTableMessage.ColumnFilterChanged({
|
|
2224
|
+
id,
|
|
2225
|
+
filter: { id, kind: "boolean", value }
|
|
2226
|
+
})
|
|
2227
|
+
}));
|
|
2228
|
+
} else if (column.type === "list" || column.type === "text" && column.display === "badge") {
|
|
2229
|
+
const selected = current?.kind === "values" ? current.values : [];
|
|
2230
|
+
const options = column.type === "text" ? tableBadgeFilterOptions(props.rowData.map((row) => row.cells[id]), column.typeOptions) : column.filterOptions ?? tableFilterOptions(props.rowData, id, locale);
|
|
2231
|
+
children = options.map(({ value, label }) => {
|
|
2232
|
+
const checked = selected.includes(value);
|
|
2233
|
+
const values = updateSelectedRows(selected, [value], !checked);
|
|
2234
|
+
return {
|
|
2235
|
+
id: keyOf("option", value),
|
|
2236
|
+
name: label,
|
|
2237
|
+
checked,
|
|
2238
|
+
keepOpen: true,
|
|
2239
|
+
message: DataTableMessage.ColumnFilterChanged({
|
|
2240
|
+
id,
|
|
2241
|
+
filter: Arr.isArrayNonEmpty(values) ? { id, kind: "values", values } : null
|
|
2242
|
+
})
|
|
2243
|
+
};
|
|
2244
|
+
});
|
|
2245
|
+
} else {
|
|
2246
|
+
return { filterColumnId: id, filterEditor: filterPanel };
|
|
2247
|
+
}
|
|
2248
|
+
children.push({
|
|
2249
|
+
id: "clear",
|
|
2250
|
+
name: copy.filterClear,
|
|
2251
|
+
keepOpen: true,
|
|
2252
|
+
separatorBefore: children.length > 0,
|
|
2253
|
+
message: DataTableMessage.ColumnFilterChanged({ id, filter: null })
|
|
2254
|
+
});
|
|
2255
|
+
return { children };
|
|
2256
|
+
};
|
|
2159
2257
|
const cell = (column, row) => {
|
|
2160
2258
|
const value = row.cells[column.id];
|
|
2161
2259
|
const empty = column.emptyLabel ?? "—";
|
|
2162
2260
|
const disabled = row.disabledColumnIds?.includes(column.id);
|
|
2163
2261
|
const edit = (edit) => DataTableMessage.CellEditRequested({ rowId: row.id, columnId: column.id, edit });
|
|
2164
2262
|
switch (column.type) {
|
|
2263
|
+
case "text": {
|
|
2264
|
+
if (column.display !== "badge")
|
|
2265
|
+
return isTableText(value) ? value : empty;
|
|
2266
|
+
const badge = tableBadge(value, column.typeOptions);
|
|
2267
|
+
return badge ? h.span.class(cn(badgeClass, badgeVariants[badge.variant])).children(badge.option?.icon && h.span.attr("aria-hidden", "true").class("inline-flex shrink-0").children(badge.option.icon(h, { size: 12 })), badge.label) : empty;
|
|
2268
|
+
}
|
|
2165
2269
|
case "number":
|
|
2166
2270
|
return isTableNumber(value) ? formatNumberValue(value, column.typeOptions, locale) : empty;
|
|
2167
2271
|
case "date":
|
|
@@ -2170,7 +2274,7 @@ var DataTable = Html2.component({
|
|
|
2170
2274
|
return date ? h.time.attr("datetime", dateIsoValue(date)).children(formatDateValue(date, column, locale)) : empty;
|
|
2171
2275
|
}
|
|
2172
2276
|
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;
|
|
2277
|
+
return isTableBoolean(value) ? h.label.attr("data-slot", "data-table-boolean-cell").class(cn(booleanCellControl, column.editable && !disabled && "hover:bg-muted/50 cursor-pointer")).children(check(keyOf("edit", row.id, column.id), `${column.headerName}: ${row.label}`, value, (value) => edit(DataTableEdit.SetBoolean({ value })), { readOnly: !column.editable || disabled }, true)) : empty;
|
|
2174
2278
|
case "reference":
|
|
2175
2279
|
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
2280
|
src: value.imageSrc,
|
|
@@ -2179,6 +2283,9 @@ var DataTable = Html2.component({
|
|
|
2179
2283
|
}).class("absolute inset-0 size-full object-cover").on("error", DataTableMessage.ReferenceImageFailed({ src: value.imageSrc }))), h.div.class(tableClasses.referenceText).children(h.span.class(tableClasses.referenceName).children(value.label), value.description && h.span.class(tableClasses.referenceDescription).children(value.description))) : empty;
|
|
2180
2284
|
case "list": {
|
|
2181
2285
|
const current = isTableList(value) ? value : [];
|
|
2286
|
+
const visible = current.slice(0, column.visibleCount ?? 3);
|
|
2287
|
+
const overflow = current.length - visible.length;
|
|
2288
|
+
const badgeSummary = () => h.span.class("inline-flex min-w-0 flex-wrap items-center gap-1").children(visible.map(({ value, label }) => h.span.key(value).class(cn(badgeClass, badgeVariants.secondary)).children(label)), overflow > 0 && h.span.class(cn(badgeClass, badgeVariants.secondary)).children(`+${overflow}`));
|
|
2182
2289
|
if (column.manageLabel && !disabled && (column.options || column.allowRemove)) {
|
|
2183
2290
|
const used = new Set(current.map(({ value }) => value));
|
|
2184
2291
|
const available = (column.options ?? []).filter(({ value }) => !used.has(value));
|
|
@@ -2214,15 +2321,13 @@ var DataTable = Html2.component({
|
|
|
2214
2321
|
}
|
|
2215
2322
|
] : []
|
|
2216
2323
|
], false, undefined, false, {
|
|
2217
|
-
relationship: h.span.class("min-w-0 truncate").children(current.length ? `${current.slice(0, column.visibleCount ?? 3).map(({ label }) => label).join(", ")}${current.length > (column.visibleCount ?? 3) ? ` +${current.length - (column.visibleCount ?? 3)}` : ""}` : empty)
|
|
2324
|
+
relationship: column.display === "badge" && current.length ? badgeSummary() : h.span.class("min-w-0 truncate").children(current.length ? `${current.slice(0, column.visibleCount ?? 3).map(({ label }) => label).join(", ")}${current.length > (column.visibleCount ?? 3) ? ` +${current.length - (column.visibleCount ?? 3)}` : ""}` : empty)
|
|
2218
2325
|
}));
|
|
2219
2326
|
}
|
|
2220
2327
|
if (column.display && !column.options && !column.allowRemove) {
|
|
2221
|
-
const visible = current.slice(0, column.visibleCount ?? 3);
|
|
2222
|
-
const overflow = current.length - visible.length;
|
|
2223
2328
|
const label = column.actionsLabel ?? (column.itemActions?.length ? copy.actions : copy.listDetails);
|
|
2224
|
-
const summary = column.display === "icon" ? h.span.class("flex min-w-0 items-center gap-1 overflow-hidden").children(visible.map(({ value, label }) => h.span.key(value).attr("title", label).class("inline-grid size-7 place-items-center rounded-full bg-muted text-xs").children(tableInitials(label))), overflow > 0 && `+${overflow}`) : h.span.class("min-w-0 truncate").children(`${visible.map(({ label }) => label).join(", ")}${overflow > 0 ? ` +${overflow}` : ""}`);
|
|
2225
|
-
return !current.length ? empty :
|
|
2329
|
+
const summary = column.display === "icon" ? h.span.class("flex min-w-0 items-center gap-1 overflow-hidden").children(visible.map(({ value, label }) => h.span.key(value).attr("title", label).class("inline-grid size-7 place-items-center rounded-full bg-muted text-xs").children(tableInitials(label))), overflow > 0 && `+${overflow}`) : column.display === "badge" ? badgeSummary() : h.span.class("min-w-0 truncate").children(`${visible.map(({ label }) => label).join(", ")}${overflow > 0 ? ` +${overflow}` : ""}`);
|
|
2330
|
+
return !current.length ? empty : h.div.class("min-w-0").children(menu(keyOf("items", row.id, column.id), label, `${label}: ${row.label}`, current.map(({ value, label }) => ({
|
|
2226
2331
|
id: value,
|
|
2227
2332
|
name: label,
|
|
2228
2333
|
...column.itemActions?.length ? {
|
|
@@ -2236,11 +2341,11 @@ var DataTable = Html2.component({
|
|
|
2236
2341
|
})
|
|
2237
2342
|
}))
|
|
2238
2343
|
} : { disabled: true }
|
|
2239
|
-
})), false, undefined, false, { relationship: summary }))
|
|
2344
|
+
})), false, undefined, false, { relationship: summary }));
|
|
2240
2345
|
}
|
|
2241
2346
|
const used = new Set(current.map(({ value }) => value));
|
|
2242
2347
|
const add = (column.options ?? []).filter(({ value }) => !used.has(value));
|
|
2243
|
-
return h.div.class("grid gap-1").children(current.length > 0 ? h.ul.class("flex flex-wrap gap-1").children(current.map(({ value, label }) => h.li.key(value).class("bg-muted rounded-sm ps-2 inline-flex items-center gap-1").children(label, !!column.itemActions?.length && menu(keyOf("item", row.id, column.id, value), copy.actions, `${copy.actions}: ${label} — ${row.label}`, column.itemActions.map((action) => ({
|
|
2348
|
+
return h.div.class("grid gap-1").children(current.length > 0 ? h.ul.class("flex flex-wrap gap-1").children(current.map(({ value, label }) => h.li.key(value).class(column.display === "badge" ? cn(badgeClass, badgeVariants.secondary) : "bg-muted rounded-sm ps-2 inline-flex items-center gap-1").children(label, !!column.itemActions?.length && menu(keyOf("item", row.id, column.id, value), copy.actions, `${copy.actions}: ${label} — ${row.label}`, column.itemActions.map((action) => ({
|
|
2244
2349
|
...action,
|
|
2245
2350
|
message: DataTableMessage.ItemActionRequested({
|
|
2246
2351
|
rowId: row.id,
|
|
@@ -2248,7 +2353,7 @@ var DataTable = Html2.component({
|
|
|
2248
2353
|
itemId: value,
|
|
2249
2354
|
actionId: action.id
|
|
2250
2355
|
})
|
|
2251
|
-
}))), column.allowRemove && !disabled &&
|
|
2356
|
+
}))), column.allowRemove && !disabled && Button2(h, {
|
|
2252
2357
|
variant: "ghost",
|
|
2253
2358
|
size: "sm",
|
|
2254
2359
|
onPress: edit(DataTableEdit.RemoveItem({ itemId: value }))
|
|
@@ -2258,8 +2363,6 @@ var DataTable = Html2.component({
|
|
|
2258
2363
|
message: edit(DataTableEdit.AddItem({ itemId: value }))
|
|
2259
2364
|
})), false, copy.addItem));
|
|
2260
2365
|
}
|
|
2261
|
-
case "text":
|
|
2262
|
-
return isTableText(value) ? value : empty;
|
|
2263
2366
|
}
|
|
2264
2367
|
};
|
|
2265
2368
|
const dragHandle = (row) => draggable && h.span.attr("aria-hidden", "true").class("inline-flex size-8 cursor-grab items-center justify-center text-muted-foreground").draggable({ [RowDrag]: row.id }, { effectAllowed: "move" }).on("dragstart", DataTableMessage.DragStarted({ rowId: row.id })).on("dragend", DataTableMessage.DragEnded()).children(GripVertical(h, { size: 16 }));
|
|
@@ -2270,17 +2373,20 @@ var DataTable = Html2.component({
|
|
|
2270
2373
|
const renderRow = (row, siblings, key, group) => {
|
|
2271
2374
|
const primary = row.actions?.find(({ id, disabled }) => id === row.primaryActionId && !disabled);
|
|
2272
2375
|
const activate = props.rowActivation ? DataTableMessage.RowActivated({ rowId: row.id }) : primary && DataTableMessage.RowActionRequested({ rowId: row.id, actionId: primary.id });
|
|
2273
|
-
const
|
|
2274
|
-
const
|
|
2376
|
+
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);
|
|
2377
|
+
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;
|
|
2378
|
+
const ignoreActivation = () => {
|
|
2379
|
+
return;
|
|
2380
|
+
};
|
|
2275
2381
|
const drop = dropOnRow(row.id, group);
|
|
2276
|
-
return (drop ?
|
|
2277
|
-
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"));
|
|
2382
|
+
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) => {
|
|
2383
|
+
const td = h.td.key(column.id).attr("data-slot", "table-cell").attr("data-column-id", column.id).class(cn(cellClass, tableClasses.cell, column.truncate ? "whitespace-nowrap" : "whitespace-normal", column.type === "list" && "p-0", column.type === "boolean" && "min-w-24 has-[[data-slot=data-table-boolean-cell]]:relative has-[[data-slot=data-table-boolean-cell]]:p-0", "has-[[data-slot=data-table-list-cell]]:relative has-[[data-slot=data-table-list-cell]]:h-16"));
|
|
2278
2384
|
const content = () => h.div.class(cn(tableClasses.cellContent, column.truncate && "truncate")).children(cell(column, row));
|
|
2279
|
-
if (
|
|
2280
|
-
return td.
|
|
2385
|
+
if (column.type === "list" || column.type === "boolean" && isTableBoolean(row.cells[column.id])) {
|
|
2386
|
+
return td.on("click", ignoreActivation).on("keydown", ignoreActivation).children(content());
|
|
2281
2387
|
}
|
|
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 &&
|
|
2388
|
+
return (!props.rowActivation && activate && column.type !== "boolean" ? td.class("cursor-pointer").on("click", activate) : td).children(content());
|
|
2389
|
+
}), 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
2390
|
variant: primary.variant === "destructive" ? "destructive" : "ghost",
|
|
2285
2391
|
size: "sm",
|
|
2286
2392
|
onPress: activate
|
|
@@ -2299,10 +2405,15 @@ var DataTable = Html2.component({
|
|
|
2299
2405
|
const activate = props.rowActivation ? DataTableMessage.RowActivated({ rowId: row.id }) : primary && DataTableMessage.RowActionRequested({ rowId: row.id, actionId: primary.id });
|
|
2300
2406
|
const card = h.article.key(keyOf(key, row.id)).class("grid content-start gap-2 rounded-lg border p-3");
|
|
2301
2407
|
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 ?
|
|
2408
|
+
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
2409
|
variant: "ghost",
|
|
2304
2410
|
onPress: activate
|
|
2305
|
-
}).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) =>
|
|
2411
|
+
}).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) => {
|
|
2412
|
+
const column = props.columnDefs.find((column) => column.id === id);
|
|
2413
|
+
if ((column?.type === "text" || column?.type === "list") && column.display === "badge")
|
|
2414
|
+
return h.div.key(id).children(cell(column, row));
|
|
2415
|
+
return h.span.key(id).class("bg-muted rounded px-2 py-1 text-xs").children(galleryValue(id, row));
|
|
2416
|
+
})), 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)));
|
|
2306
2417
|
};
|
|
2307
2418
|
const renderGroups = (members, depth, parent, parentTarget) => {
|
|
2308
2419
|
const field = grouping[depth];
|
|
@@ -2352,7 +2463,7 @@ var DataTable = Html2.component({
|
|
|
2352
2463
|
}),
|
|
2353
2464
|
props: { value: query.globalFilter ?? "" },
|
|
2354
2465
|
onUpdate: ({ value }) => DataTableMessage.SearchChanged({ value })
|
|
2355
|
-
}).attr("aria-label", copy.search), !!query.globalFilter &&
|
|
2466
|
+
}).attr("aria-label", copy.search), !!query.globalFilter && Button2(h, {
|
|
2356
2467
|
class: "absolute end-1 top-1/2 -translate-y-1/2",
|
|
2357
2468
|
size: "icon-sm",
|
|
2358
2469
|
variant: "ghost",
|
|
@@ -2364,11 +2475,11 @@ var DataTable = Html2.component({
|
|
|
2364
2475
|
message: DataTableMessage.BulkActionRequested({
|
|
2365
2476
|
actionId: action.id
|
|
2366
2477
|
})
|
|
2367
|
-
})), true, undefined, false, { selectedCount }), features.filtering && filterColumns.length > 0 && menu(keyOf("filters"),
|
|
2368
|
-
...filterColumns.map((
|
|
2369
|
-
id,
|
|
2370
|
-
name: headerName,
|
|
2371
|
-
|
|
2478
|
+
})), true, undefined, false, { selectedCount }), features.filtering && filterColumns.length > 0 && menu(keyOf("filters"), copy.filters, copy.filters, [
|
|
2479
|
+
...filterColumns.map((column) => ({
|
|
2480
|
+
id: column.id,
|
|
2481
|
+
name: column.headerName,
|
|
2482
|
+
...filterSubmenu(column)
|
|
2372
2483
|
})),
|
|
2373
2484
|
...activeFilters.length > 0 ? [
|
|
2374
2485
|
{
|
|
@@ -2378,7 +2489,10 @@ var DataTable = Html2.component({
|
|
|
2378
2489
|
message: DataTableMessage.FiltersCleared()
|
|
2379
2490
|
}
|
|
2380
2491
|
] : []
|
|
2381
|
-
], true, undefined, false, {
|
|
2492
|
+
], true, undefined, false, {
|
|
2493
|
+
toolbarIcon: "filter",
|
|
2494
|
+
filterCount: activeFilters.length
|
|
2495
|
+
}), features.sorting && sortableColumns.length > 0 && menu(keyOf("sort-toolbar"), copy.sortBy, copy.sortBy, sortableColumns.map((column) => ({
|
|
2382
2496
|
id: column.id,
|
|
2383
2497
|
name: column.headerName,
|
|
2384
2498
|
children: ["asc", "desc", null].filter((direction) => direction !== null || sort.some(({ id }) => id === column.id)).map((direction) => ({
|
|
@@ -2516,8 +2630,7 @@ var DataTable = Html2.component({
|
|
|
2516
2630
|
...filtering ? tableDataColumns([column]).filter(({ filterable }) => filterable !== false).map((field, index) => ({
|
|
2517
2631
|
id: keyOf("filter", field.id),
|
|
2518
2632
|
name: column.fields?.length ? `${copy.filters}: ${field.headerName}` : copy.filters,
|
|
2519
|
-
|
|
2520
|
-
filterEditor: filterPanel,
|
|
2633
|
+
...filterSubmenu(field),
|
|
2521
2634
|
icon: "filter",
|
|
2522
2635
|
separatorBefore: sorting && index === 0
|
|
2523
2636
|
})) : [],
|