@krak-stack/registry 0.2.0 → 0.2.1
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 +6 -0
- package/dist/components/ui/app-brand.js +17 -17
- package/dist/components/ui/code-block.js +6 -6
- package/dist/components/ui/color-picker.js +26 -28
- package/dist/components/ui/copy-button.js +4 -4
- package/dist/components/ui/data-table.js +441 -442
- package/dist/components/ui/editing-locale-switcher.js +10 -10
- package/dist/components/ui/effect-form.js +183 -184
- package/dist/components/ui/error-component.js +6 -6
- package/dist/components/ui/file-picker.js +2 -2
- package/dist/components/ui/form.d.ts +5 -5
- package/dist/components/ui/form.js +136 -137
- package/dist/components/ui/google-map.js +2 -2
- package/dist/components/ui/icon-input.js +45 -48
- package/dist/components/ui/krakstack-provider.js +2 -2
- package/dist/components/ui/locale-switcher.js +4 -4
- package/dist/components/ui/pagination.js +2 -2
- package/dist/components/ui/search-menu.js +2 -2
- package/dist/components/ui/sidebar-layout.js +67 -72
- package/dist/components/ui/theme-switcher.js +6 -6
- package/dist/components/ui/virtualized-combobox.js +31 -34
- package/dist/lib/docs.js +166 -171
- package/dist/lib/docs.server.js +18 -40
- package/dist/lib/documentation-toolkit.js +19 -41
- package/dist/lib/httpapi-adapter.js +2 -2
- package/dist/lib/httpapi-cli.js +7 -7
- package/dist/lib/query.js +11 -11
- package/dist/lib/seo.js +2 -2
- package/dist/lib/webfetch-toolkit.js +6 -6
- package/dist/oxlint/anti-slop/index.js +2 -2
- package/dist/services/agent/client/index.js +153 -155
- package/dist/services/agent/index.js +2 -2
- package/dist/services/agent/schema.js +5 -5
- package/dist/services/events/browser.js +6 -6
- package/dist/services/events/client/audit-log-table.js +445 -446
- package/dist/services/events/index.js +59 -59
- package/dist/services/events/migrations.js +2 -2
- package/dist/services/events/record.js +2 -2
- package/dist/services/events/schema.js +39 -39
- package/dist/services/file-extraction/index.js +4 -4
- package/dist/services/file-extraction/schema.js +2 -2
- package/dist/services/health/index.js +9 -9
- package/dist/services/notification/channels/ses/index.js +2 -2
- package/dist/services/notification/channels/ses/schema.js +2 -2
- package/dist/services/notification/client/index.js +5 -5
- package/dist/services/notification/index.js +2 -2
- package/dist/services/notification/persistence/drizzle.js +2 -2
- package/dist/services/notification/persistence/index.js +15 -15
- package/dist/services/notification/persistence/schema.js +12 -12
- package/dist/services/notification/public.js +7 -7
- package/dist/services/notification/schema.js +2 -2
- package/dist/services/opentelemetry/api.js +2 -2
- package/dist/services/opentelemetry/browser.js +7 -7
- package/dist/services/opentelemetry/web-vitals.js +2 -2
- package/dist/services/s3/index.js +2 -2
- package/dist/services/s3/schema.js +2 -2
- package/dist/services/speech/schema.js +9 -9
- package/dist/services/webhooks/client/delivery-table.js +479 -480
- package/dist/services/webhooks/http-client.js +5 -5
- package/dist/services/webhooks/index.js +34 -34
- package/dist/services/webhooks/migrations.js +5 -5
- package/dist/services/webhooks/schema.js +20 -20
- package/dist/services/webhooks/url.js +5 -5
- package/package.json +1 -1
|
@@ -337,12 +337,11 @@ function Label({ className, ...props }) {
|
|
|
337
337
|
|
|
338
338
|
// ../../src/components/ui/separator.tsx
|
|
339
339
|
import { Separator as SeparatorPrimitive } from "@base-ui/react/separator";
|
|
340
|
-
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
341
340
|
|
|
342
341
|
// ../../src/components/ui/field.tsx
|
|
343
|
-
import { jsx as
|
|
342
|
+
import { jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
344
343
|
function FieldGroup({ className, ...props }) {
|
|
345
|
-
return /* @__PURE__ */
|
|
344
|
+
return /* @__PURE__ */ jsx7("div", {
|
|
346
345
|
"data-slot": "field-group",
|
|
347
346
|
className: cn("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4", className),
|
|
348
347
|
...props
|
|
@@ -365,7 +364,7 @@ function Field({
|
|
|
365
364
|
orientation = "vertical",
|
|
366
365
|
...props
|
|
367
366
|
}) {
|
|
368
|
-
return /* @__PURE__ */
|
|
367
|
+
return /* @__PURE__ */ jsx7("div", {
|
|
369
368
|
role: "group",
|
|
370
369
|
"data-slot": "field",
|
|
371
370
|
"data-orientation": orientation,
|
|
@@ -377,7 +376,7 @@ function FieldLabel({
|
|
|
377
376
|
className,
|
|
378
377
|
...props
|
|
379
378
|
}) {
|
|
380
|
-
return /* @__PURE__ */
|
|
379
|
+
return /* @__PURE__ */ jsx7(Label, {
|
|
381
380
|
"data-slot": "field-label",
|
|
382
381
|
className: cn("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border *:data-[slot=field]:p-3 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col", className),
|
|
383
382
|
...props
|
|
@@ -387,18 +386,18 @@ function FieldLabel({
|
|
|
387
386
|
// ../../src/components/ui/select.tsx
|
|
388
387
|
import { Select as SelectPrimitive } from "@base-ui/react/select";
|
|
389
388
|
import { ChevronDownIcon, CheckIcon as CheckIcon3, ChevronUpIcon } from "lucide-react";
|
|
390
|
-
import { jsx as
|
|
389
|
+
import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
391
390
|
"use client";
|
|
392
391
|
var Select = SelectPrimitive.Root;
|
|
393
392
|
function SelectGroup({ className, ...props }) {
|
|
394
|
-
return /* @__PURE__ */
|
|
393
|
+
return /* @__PURE__ */ jsx8(SelectPrimitive.Group, {
|
|
395
394
|
"data-slot": "select-group",
|
|
396
395
|
className: cn("scroll-my-1 p-1", className),
|
|
397
396
|
...props
|
|
398
397
|
});
|
|
399
398
|
}
|
|
400
399
|
function SelectValue({ className, ...props }) {
|
|
401
|
-
return /* @__PURE__ */
|
|
400
|
+
return /* @__PURE__ */ jsx8(SelectPrimitive.Value, {
|
|
402
401
|
"data-slot": "select-value",
|
|
403
402
|
className: cn("flex flex-1 text-left", className),
|
|
404
403
|
...props
|
|
@@ -417,8 +416,8 @@ function SelectTrigger({
|
|
|
417
416
|
...props,
|
|
418
417
|
children: [
|
|
419
418
|
children,
|
|
420
|
-
/* @__PURE__ */
|
|
421
|
-
render: /* @__PURE__ */
|
|
419
|
+
/* @__PURE__ */ jsx8(SelectPrimitive.Icon, {
|
|
420
|
+
render: /* @__PURE__ */ jsx8(ChevronDownIcon, {
|
|
422
421
|
className: "text-muted-foreground pointer-events-none size-4"
|
|
423
422
|
})
|
|
424
423
|
})
|
|
@@ -435,8 +434,8 @@ function SelectContent({
|
|
|
435
434
|
alignItemWithTrigger = true,
|
|
436
435
|
...props
|
|
437
436
|
}) {
|
|
438
|
-
return /* @__PURE__ */
|
|
439
|
-
children: /* @__PURE__ */
|
|
437
|
+
return /* @__PURE__ */ jsx8(SelectPrimitive.Portal, {
|
|
438
|
+
children: /* @__PURE__ */ jsx8(SelectPrimitive.Positioner, {
|
|
440
439
|
side,
|
|
441
440
|
sideOffset,
|
|
442
441
|
align,
|
|
@@ -449,11 +448,11 @@ function SelectContent({
|
|
|
449
448
|
className: cn("relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
450
449
|
...props,
|
|
451
450
|
children: [
|
|
452
|
-
/* @__PURE__ */
|
|
453
|
-
/* @__PURE__ */
|
|
451
|
+
/* @__PURE__ */ jsx8(SelectScrollUpButton, {}),
|
|
452
|
+
/* @__PURE__ */ jsx8(SelectPrimitive.List, {
|
|
454
453
|
children
|
|
455
454
|
}),
|
|
456
|
-
/* @__PURE__ */
|
|
455
|
+
/* @__PURE__ */ jsx8(SelectScrollDownButton, {})
|
|
457
456
|
]
|
|
458
457
|
})
|
|
459
458
|
})
|
|
@@ -469,15 +468,15 @@ function SelectItem({
|
|
|
469
468
|
className: cn("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
|
|
470
469
|
...props,
|
|
471
470
|
children: [
|
|
472
|
-
/* @__PURE__ */
|
|
471
|
+
/* @__PURE__ */ jsx8(SelectPrimitive.ItemText, {
|
|
473
472
|
className: "flex flex-1 shrink-0 gap-2 whitespace-nowrap",
|
|
474
473
|
children
|
|
475
474
|
}),
|
|
476
|
-
/* @__PURE__ */
|
|
477
|
-
render: /* @__PURE__ */
|
|
475
|
+
/* @__PURE__ */ jsx8(SelectPrimitive.ItemIndicator, {
|
|
476
|
+
render: /* @__PURE__ */ jsx8("span", {
|
|
478
477
|
className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center"
|
|
479
478
|
}),
|
|
480
|
-
children: /* @__PURE__ */
|
|
479
|
+
children: /* @__PURE__ */ jsx8(CheckIcon3, {
|
|
481
480
|
className: "pointer-events-none"
|
|
482
481
|
})
|
|
483
482
|
})
|
|
@@ -488,29 +487,29 @@ function SelectScrollUpButton({
|
|
|
488
487
|
className,
|
|
489
488
|
...props
|
|
490
489
|
}) {
|
|
491
|
-
return /* @__PURE__ */
|
|
490
|
+
return /* @__PURE__ */ jsx8(SelectPrimitive.ScrollUpArrow, {
|
|
492
491
|
"data-slot": "select-scroll-up-button",
|
|
493
492
|
className: cn("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4", className),
|
|
494
493
|
...props,
|
|
495
|
-
children: /* @__PURE__ */
|
|
494
|
+
children: /* @__PURE__ */ jsx8(ChevronUpIcon, {})
|
|
496
495
|
});
|
|
497
496
|
}
|
|
498
497
|
function SelectScrollDownButton({
|
|
499
498
|
className,
|
|
500
499
|
...props
|
|
501
500
|
}) {
|
|
502
|
-
return /* @__PURE__ */
|
|
501
|
+
return /* @__PURE__ */ jsx8(SelectPrimitive.ScrollDownArrow, {
|
|
503
502
|
"data-slot": "select-scroll-down-button",
|
|
504
503
|
className: cn("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4", className),
|
|
505
504
|
...props,
|
|
506
|
-
children: /* @__PURE__ */
|
|
505
|
+
children: /* @__PURE__ */ jsx8(ChevronDownIcon, {})
|
|
507
506
|
});
|
|
508
507
|
}
|
|
509
508
|
|
|
510
509
|
// ../../src/components/ui/loading.tsx
|
|
511
510
|
import { Loader2 } from "lucide-react";
|
|
512
511
|
import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider";
|
|
513
|
-
import { jsx as
|
|
512
|
+
import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
514
513
|
var labels = {
|
|
515
514
|
en: {
|
|
516
515
|
loading: "Loading..."
|
|
@@ -531,7 +530,7 @@ function Loading({
|
|
|
531
530
|
return /* @__PURE__ */ jsxs4("div", {
|
|
532
531
|
className: cn("text-muted-foreground flex items-center justify-center gap-2 text-sm", variant === "centered" && "min-h-[50svh] w-full", className),
|
|
533
532
|
children: [
|
|
534
|
-
/* @__PURE__ */
|
|
533
|
+
/* @__PURE__ */ jsx9(Loader2, {
|
|
535
534
|
className: "size-4 animate-spin"
|
|
536
535
|
}),
|
|
537
536
|
label ?? loadingLabel(locale, messages)
|
|
@@ -543,17 +542,17 @@ function Loading({
|
|
|
543
542
|
import { Menu as MenuPrimitive2 } from "@base-ui/react/menu";
|
|
544
543
|
import { Menubar as MenubarPrimitive } from "@base-ui/react/menubar";
|
|
545
544
|
import { CheckIcon as CheckIcon4 } from "lucide-react";
|
|
546
|
-
import { jsx as
|
|
545
|
+
import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
547
546
|
"use client";
|
|
548
547
|
function Menubar({ className, ...props }) {
|
|
549
|
-
return /* @__PURE__ */
|
|
548
|
+
return /* @__PURE__ */ jsx10(MenubarPrimitive, {
|
|
550
549
|
"data-slot": "menubar",
|
|
551
550
|
className: cn("flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs", className),
|
|
552
551
|
...props
|
|
553
552
|
});
|
|
554
553
|
}
|
|
555
554
|
function MenubarMenu({ ...props }) {
|
|
556
|
-
return /* @__PURE__ */
|
|
555
|
+
return /* @__PURE__ */ jsx10(DropdownMenu, {
|
|
557
556
|
"data-slot": "menubar-menu",
|
|
558
557
|
...props
|
|
559
558
|
});
|
|
@@ -561,7 +560,7 @@ function MenubarMenu({ ...props }) {
|
|
|
561
560
|
function MenubarGroup({
|
|
562
561
|
...props
|
|
563
562
|
}) {
|
|
564
|
-
return /* @__PURE__ */
|
|
563
|
+
return /* @__PURE__ */ jsx10(DropdownMenuGroup, {
|
|
565
564
|
"data-slot": "menubar-group",
|
|
566
565
|
...props
|
|
567
566
|
});
|
|
@@ -570,7 +569,7 @@ function MenubarTrigger({
|
|
|
570
569
|
className,
|
|
571
570
|
...props
|
|
572
571
|
}) {
|
|
573
|
-
return /* @__PURE__ */
|
|
572
|
+
return /* @__PURE__ */ jsx10(DropdownMenuTrigger, {
|
|
574
573
|
"data-slot": "menubar-trigger",
|
|
575
574
|
className: cn("flex items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none hover:bg-muted aria-expanded:bg-muted", className),
|
|
576
575
|
...props
|
|
@@ -583,7 +582,7 @@ function MenubarContent({
|
|
|
583
582
|
sideOffset = 8,
|
|
584
583
|
...props
|
|
585
584
|
}) {
|
|
586
|
-
return /* @__PURE__ */
|
|
585
|
+
return /* @__PURE__ */ jsx10(DropdownMenuContent, {
|
|
587
586
|
"data-slot": "menubar-content",
|
|
588
587
|
align,
|
|
589
588
|
alignOffset,
|
|
@@ -598,7 +597,7 @@ function MenubarItem({
|
|
|
598
597
|
variant = "default",
|
|
599
598
|
...props
|
|
600
599
|
}) {
|
|
601
|
-
return /* @__PURE__ */
|
|
600
|
+
return /* @__PURE__ */ jsx10(DropdownMenuItem, {
|
|
602
601
|
"data-slot": "menubar-item",
|
|
603
602
|
"data-inset": inset,
|
|
604
603
|
"data-variant": variant,
|
|
@@ -620,10 +619,10 @@ function MenubarCheckboxItem({
|
|
|
620
619
|
checked,
|
|
621
620
|
...props,
|
|
622
621
|
children: [
|
|
623
|
-
/* @__PURE__ */
|
|
622
|
+
/* @__PURE__ */ jsx10("span", {
|
|
624
623
|
className: "pointer-events-none absolute left-2 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4",
|
|
625
|
-
children: /* @__PURE__ */
|
|
626
|
-
children: /* @__PURE__ */
|
|
624
|
+
children: /* @__PURE__ */ jsx10(MenuPrimitive2.CheckboxItemIndicator, {
|
|
625
|
+
children: /* @__PURE__ */ jsx10(CheckIcon4, {})
|
|
627
626
|
})
|
|
628
627
|
}),
|
|
629
628
|
children
|
|
@@ -633,7 +632,7 @@ function MenubarCheckboxItem({
|
|
|
633
632
|
function MenubarRadioGroup({
|
|
634
633
|
...props
|
|
635
634
|
}) {
|
|
636
|
-
return /* @__PURE__ */
|
|
635
|
+
return /* @__PURE__ */ jsx10(DropdownMenuRadioGroup, {
|
|
637
636
|
"data-slot": "menubar-radio-group",
|
|
638
637
|
...props
|
|
639
638
|
});
|
|
@@ -650,10 +649,10 @@ function MenubarRadioItem({
|
|
|
650
649
|
className: cn("relative flex cursor-default items-center gap-2 rounded-md py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
651
650
|
...props,
|
|
652
651
|
children: [
|
|
653
|
-
/* @__PURE__ */
|
|
652
|
+
/* @__PURE__ */ jsx10("span", {
|
|
654
653
|
className: "pointer-events-none absolute left-2 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4",
|
|
655
|
-
children: /* @__PURE__ */
|
|
656
|
-
children: /* @__PURE__ */
|
|
654
|
+
children: /* @__PURE__ */ jsx10(MenuPrimitive2.RadioItemIndicator, {
|
|
655
|
+
children: /* @__PURE__ */ jsx10(CheckIcon4, {})
|
|
657
656
|
})
|
|
658
657
|
}),
|
|
659
658
|
children
|
|
@@ -665,7 +664,7 @@ function MenubarLabel({
|
|
|
665
664
|
inset,
|
|
666
665
|
...props
|
|
667
666
|
}) {
|
|
668
|
-
return /* @__PURE__ */
|
|
667
|
+
return /* @__PURE__ */ jsx10(DropdownMenuLabel, {
|
|
669
668
|
"data-slot": "menubar-label",
|
|
670
669
|
"data-inset": inset,
|
|
671
670
|
className: cn("px-2 py-1.5 text-sm font-medium data-inset:pl-8", className),
|
|
@@ -676,7 +675,7 @@ function MenubarSeparator({
|
|
|
676
675
|
className,
|
|
677
676
|
...props
|
|
678
677
|
}) {
|
|
679
|
-
return /* @__PURE__ */
|
|
678
|
+
return /* @__PURE__ */ jsx10(DropdownMenuSeparator, {
|
|
680
679
|
"data-slot": "menubar-separator",
|
|
681
680
|
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
682
681
|
...props
|
|
@@ -685,7 +684,7 @@ function MenubarSeparator({
|
|
|
685
684
|
function MenubarSub({
|
|
686
685
|
...props
|
|
687
686
|
}) {
|
|
688
|
-
return /* @__PURE__ */
|
|
687
|
+
return /* @__PURE__ */ jsx10(DropdownMenuSub, {
|
|
689
688
|
"data-slot": "menubar-sub",
|
|
690
689
|
...props
|
|
691
690
|
});
|
|
@@ -695,7 +694,7 @@ function MenubarSubTrigger({
|
|
|
695
694
|
inset,
|
|
696
695
|
...props
|
|
697
696
|
}) {
|
|
698
|
-
return /* @__PURE__ */
|
|
697
|
+
return /* @__PURE__ */ jsx10(DropdownMenuSubTrigger, {
|
|
699
698
|
"data-slot": "menubar-sub-trigger",
|
|
700
699
|
"data-inset": inset,
|
|
701
700
|
className: cn("gap-2 rounded-sm px-2 py-1.5 text-sm focus:bg-accent focus:text-accent-foreground data-inset:pl-8 data-open:bg-accent data-open:text-accent-foreground [&_svg:not([class*='size-'])]:size-4", className),
|
|
@@ -706,7 +705,7 @@ function MenubarSubContent({
|
|
|
706
705
|
className,
|
|
707
706
|
...props
|
|
708
707
|
}) {
|
|
709
|
-
return /* @__PURE__ */
|
|
708
|
+
return /* @__PURE__ */ jsx10(DropdownMenuSubContent, {
|
|
710
709
|
"data-slot": "menubar-sub-content",
|
|
711
710
|
className: cn("min-w-32 rounded-md bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
712
711
|
...props
|
|
@@ -722,7 +721,7 @@ import {
|
|
|
722
721
|
} from "lucide-react";
|
|
723
722
|
import { useId } from "react";
|
|
724
723
|
import { useKrakstackLocale as useKrakstackLocale2 } from "@krak-stack/registry/krakstack-provider";
|
|
725
|
-
import { jsx as
|
|
724
|
+
import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
726
725
|
var messages = {
|
|
727
726
|
en: {
|
|
728
727
|
pageSize: "Page size",
|
|
@@ -765,7 +764,7 @@ function Pagination({
|
|
|
765
764
|
totalRows
|
|
766
765
|
}) {
|
|
767
766
|
const locale = useKrakstackLocale2(localeOverride);
|
|
768
|
-
const
|
|
767
|
+
const labels = paginationMessages(locale, messageOverrides);
|
|
769
768
|
const pageSizeId = useId();
|
|
770
769
|
const canGoBack = page > 0;
|
|
771
770
|
const canGoForward = page + 1 < pageCount;
|
|
@@ -775,11 +774,11 @@ function Pagination({
|
|
|
775
774
|
showResults ? /* @__PURE__ */ jsxs6("div", {
|
|
776
775
|
className: "text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1 text-sm",
|
|
777
776
|
children: [
|
|
778
|
-
/* @__PURE__ */
|
|
779
|
-
children:
|
|
777
|
+
/* @__PURE__ */ jsx11("span", {
|
|
778
|
+
children: labels.results(totalRows)
|
|
780
779
|
}),
|
|
781
|
-
selectedRows > 0 ? /* @__PURE__ */
|
|
782
|
-
children:
|
|
780
|
+
selectedRows > 0 ? /* @__PURE__ */ jsx11("span", {
|
|
781
|
+
children: labels.selectedOf(selectedRows, totalRows)
|
|
783
782
|
}) : null
|
|
784
783
|
]
|
|
785
784
|
}) : null,
|
|
@@ -789,10 +788,10 @@ function Pagination({
|
|
|
789
788
|
/* @__PURE__ */ jsxs6("div", {
|
|
790
789
|
className: "flex items-center gap-2",
|
|
791
790
|
children: [
|
|
792
|
-
/* @__PURE__ */
|
|
791
|
+
/* @__PURE__ */ jsx11(Label, {
|
|
793
792
|
htmlFor: pageSizeId,
|
|
794
793
|
className: cn("hidden text-sm sm:block", compact && "block"),
|
|
795
|
-
children:
|
|
794
|
+
children: labels.pageSize
|
|
796
795
|
}),
|
|
797
796
|
/* @__PURE__ */ jsxs6(Select, {
|
|
798
797
|
items: pageSizes.map((size) => ({
|
|
@@ -802,16 +801,16 @@ function Pagination({
|
|
|
802
801
|
value: `${pageSize}`,
|
|
803
802
|
onValueChange: (value) => onPageSizeChange(Number(value)),
|
|
804
803
|
children: [
|
|
805
|
-
/* @__PURE__ */
|
|
804
|
+
/* @__PURE__ */ jsx11(SelectTrigger, {
|
|
806
805
|
className: "h-8 w-[70px]",
|
|
807
806
|
id: pageSizeId,
|
|
808
|
-
children: /* @__PURE__ */
|
|
807
|
+
children: /* @__PURE__ */ jsx11(SelectValue, {
|
|
809
808
|
placeholder: pageSize
|
|
810
809
|
})
|
|
811
810
|
}),
|
|
812
|
-
/* @__PURE__ */
|
|
811
|
+
/* @__PURE__ */ jsx11(SelectContent, {
|
|
813
812
|
side: "top",
|
|
814
|
-
children: pageSizes.map((size) => /* @__PURE__ */
|
|
813
|
+
children: pageSizes.map((size) => /* @__PURE__ */ jsx11(SelectItem, {
|
|
815
814
|
value: `${size}`,
|
|
816
815
|
children: size
|
|
817
816
|
}, size))
|
|
@@ -823,9 +822,9 @@ function Pagination({
|
|
|
823
822
|
/* @__PURE__ */ jsxs6("div", {
|
|
824
823
|
className: "flex items-center gap-2",
|
|
825
824
|
children: [
|
|
826
|
-
/* @__PURE__ */
|
|
825
|
+
/* @__PURE__ */ jsx11("div", {
|
|
827
826
|
className: "flex items-center justify-center text-sm font-medium sm:block",
|
|
828
|
-
children:
|
|
827
|
+
children: labels.pageOf(page + 1, pageCount)
|
|
829
828
|
}),
|
|
830
829
|
/* @__PURE__ */ jsxs6("div", {
|
|
831
830
|
className: "flex items-center gap-1",
|
|
@@ -836,11 +835,11 @@ function Pagination({
|
|
|
836
835
|
onClick: () => onPageChange(0),
|
|
837
836
|
type: "button",
|
|
838
837
|
children: [
|
|
839
|
-
/* @__PURE__ */
|
|
838
|
+
/* @__PURE__ */ jsx11("span", {
|
|
840
839
|
className: "sr-only",
|
|
841
|
-
children:
|
|
840
|
+
children: labels.goToFirstPage
|
|
842
841
|
}),
|
|
843
|
-
/* @__PURE__ */
|
|
842
|
+
/* @__PURE__ */ jsx11(ChevronsLeft, {})
|
|
844
843
|
]
|
|
845
844
|
}),
|
|
846
845
|
/* @__PURE__ */ jsxs6(Button, {
|
|
@@ -849,11 +848,11 @@ function Pagination({
|
|
|
849
848
|
onClick: () => onPageChange(page - 1),
|
|
850
849
|
type: "button",
|
|
851
850
|
children: [
|
|
852
|
-
/* @__PURE__ */
|
|
851
|
+
/* @__PURE__ */ jsx11("span", {
|
|
853
852
|
className: "sr-only",
|
|
854
|
-
children:
|
|
853
|
+
children: labels.goToPreviousPage
|
|
855
854
|
}),
|
|
856
|
-
/* @__PURE__ */
|
|
855
|
+
/* @__PURE__ */ jsx11(ChevronLeft, {})
|
|
857
856
|
]
|
|
858
857
|
}),
|
|
859
858
|
/* @__PURE__ */ jsxs6(Button, {
|
|
@@ -862,11 +861,11 @@ function Pagination({
|
|
|
862
861
|
onClick: () => onPageChange(page + 1),
|
|
863
862
|
type: "button",
|
|
864
863
|
children: [
|
|
865
|
-
/* @__PURE__ */
|
|
864
|
+
/* @__PURE__ */ jsx11("span", {
|
|
866
865
|
className: "sr-only",
|
|
867
|
-
children:
|
|
866
|
+
children: labels.goToNextPage
|
|
868
867
|
}),
|
|
869
|
-
/* @__PURE__ */
|
|
868
|
+
/* @__PURE__ */ jsx11(ChevronRight, {})
|
|
870
869
|
]
|
|
871
870
|
}),
|
|
872
871
|
/* @__PURE__ */ jsxs6(Button, {
|
|
@@ -875,11 +874,11 @@ function Pagination({
|
|
|
875
874
|
onClick: () => onPageChange(pageCount - 1),
|
|
876
875
|
type: "button",
|
|
877
876
|
children: [
|
|
878
|
-
/* @__PURE__ */
|
|
877
|
+
/* @__PURE__ */ jsx11("span", {
|
|
879
878
|
className: "sr-only",
|
|
880
|
-
children:
|
|
879
|
+
children: labels.goToLastPage
|
|
881
880
|
}),
|
|
882
|
-
/* @__PURE__ */
|
|
881
|
+
/* @__PURE__ */ jsx11(ChevronsRight, {})
|
|
883
882
|
]
|
|
884
883
|
})
|
|
885
884
|
]
|
|
@@ -894,7 +893,7 @@ function Pagination({
|
|
|
894
893
|
|
|
895
894
|
// ../../src/components/ui/scroll-area.tsx
|
|
896
895
|
import { ScrollArea as ScrollAreaPrimitive } from "@base-ui/react/scroll-area";
|
|
897
|
-
import { jsx as
|
|
896
|
+
import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
898
897
|
function ScrollArea({
|
|
899
898
|
className,
|
|
900
899
|
children,
|
|
@@ -905,13 +904,13 @@ function ScrollArea({
|
|
|
905
904
|
className: cn("relative", className),
|
|
906
905
|
...props,
|
|
907
906
|
children: [
|
|
908
|
-
/* @__PURE__ */
|
|
907
|
+
/* @__PURE__ */ jsx12(ScrollAreaPrimitive.Viewport, {
|
|
909
908
|
"data-slot": "scroll-area-viewport",
|
|
910
909
|
className: "focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",
|
|
911
910
|
children
|
|
912
911
|
}),
|
|
913
|
-
/* @__PURE__ */
|
|
914
|
-
/* @__PURE__ */
|
|
912
|
+
/* @__PURE__ */ jsx12(ScrollBar, {}),
|
|
913
|
+
/* @__PURE__ */ jsx12(ScrollAreaPrimitive.Corner, {})
|
|
915
914
|
]
|
|
916
915
|
});
|
|
917
916
|
}
|
|
@@ -920,13 +919,13 @@ function ScrollBar({
|
|
|
920
919
|
orientation = "vertical",
|
|
921
920
|
...props
|
|
922
921
|
}) {
|
|
923
|
-
return /* @__PURE__ */
|
|
922
|
+
return /* @__PURE__ */ jsx12(ScrollAreaPrimitive.Scrollbar, {
|
|
924
923
|
"data-slot": "scroll-area-scrollbar",
|
|
925
924
|
"data-orientation": orientation,
|
|
926
925
|
orientation,
|
|
927
926
|
className: cn("flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent", className),
|
|
928
927
|
...props,
|
|
929
|
-
children: /* @__PURE__ */
|
|
928
|
+
children: /* @__PURE__ */ jsx12(ScrollAreaPrimitive.Thumb, {
|
|
930
929
|
"data-slot": "scroll-area-thumb",
|
|
931
930
|
className: "bg-border relative flex-1 rounded-full"
|
|
932
931
|
})
|
|
@@ -934,12 +933,12 @@ function ScrollBar({
|
|
|
934
933
|
}
|
|
935
934
|
|
|
936
935
|
// ../../src/components/ui/table.tsx
|
|
937
|
-
import { jsx as
|
|
936
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
938
937
|
function Table({ className, ...props }) {
|
|
939
|
-
return /* @__PURE__ */
|
|
938
|
+
return /* @__PURE__ */ jsx13("div", {
|
|
940
939
|
"data-slot": "table-container",
|
|
941
940
|
className: "relative w-full overflow-x-auto",
|
|
942
|
-
children: /* @__PURE__ */
|
|
941
|
+
children: /* @__PURE__ */ jsx13("table", {
|
|
943
942
|
"data-slot": "table",
|
|
944
943
|
className: cn("w-full caption-bottom text-sm", className),
|
|
945
944
|
...props
|
|
@@ -947,35 +946,35 @@ function Table({ className, ...props }) {
|
|
|
947
946
|
});
|
|
948
947
|
}
|
|
949
948
|
function TableHeader({ className, ...props }) {
|
|
950
|
-
return /* @__PURE__ */
|
|
949
|
+
return /* @__PURE__ */ jsx13("thead", {
|
|
951
950
|
"data-slot": "table-header",
|
|
952
951
|
className: cn("[&_tr]:border-b", className),
|
|
953
952
|
...props
|
|
954
953
|
});
|
|
955
954
|
}
|
|
956
955
|
function TableBody({ className, ...props }) {
|
|
957
|
-
return /* @__PURE__ */
|
|
956
|
+
return /* @__PURE__ */ jsx13("tbody", {
|
|
958
957
|
"data-slot": "table-body",
|
|
959
958
|
className: cn("[&_tr:last-child]:border-0", className),
|
|
960
959
|
...props
|
|
961
960
|
});
|
|
962
961
|
}
|
|
963
962
|
function TableRow({ className, ...props }) {
|
|
964
|
-
return /* @__PURE__ */
|
|
963
|
+
return /* @__PURE__ */ jsx13("tr", {
|
|
965
964
|
"data-slot": "table-row",
|
|
966
965
|
className: cn("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted", className),
|
|
967
966
|
...props
|
|
968
967
|
});
|
|
969
968
|
}
|
|
970
969
|
function TableHead({ className, ...props }) {
|
|
971
|
-
return /* @__PURE__ */
|
|
970
|
+
return /* @__PURE__ */ jsx13("th", {
|
|
972
971
|
"data-slot": "table-head",
|
|
973
972
|
className: cn("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0", className),
|
|
974
973
|
...props
|
|
975
974
|
});
|
|
976
975
|
}
|
|
977
976
|
function TableCell({ className, ...props }) {
|
|
978
|
-
return /* @__PURE__ */
|
|
977
|
+
return /* @__PURE__ */ jsx13("td", {
|
|
979
978
|
"data-slot": "table-cell",
|
|
980
979
|
className: cn("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0", className),
|
|
981
980
|
...props
|
|
@@ -984,26 +983,26 @@ function TableCell({ className, ...props }) {
|
|
|
984
983
|
|
|
985
984
|
// ../../src/components/ui/tooltip.tsx
|
|
986
985
|
import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip";
|
|
987
|
-
import { jsx as
|
|
986
|
+
import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
988
987
|
"use client";
|
|
989
988
|
function TooltipProvider({
|
|
990
989
|
delay = 0,
|
|
991
990
|
...props
|
|
992
991
|
}) {
|
|
993
|
-
return /* @__PURE__ */
|
|
992
|
+
return /* @__PURE__ */ jsx14(TooltipPrimitive.Provider, {
|
|
994
993
|
"data-slot": "tooltip-provider",
|
|
995
994
|
delay,
|
|
996
995
|
...props
|
|
997
996
|
});
|
|
998
997
|
}
|
|
999
998
|
function Tooltip({ ...props }) {
|
|
1000
|
-
return /* @__PURE__ */
|
|
999
|
+
return /* @__PURE__ */ jsx14(TooltipPrimitive.Root, {
|
|
1001
1000
|
"data-slot": "tooltip",
|
|
1002
1001
|
...props
|
|
1003
1002
|
});
|
|
1004
1003
|
}
|
|
1005
1004
|
function TooltipTrigger({ ...props }) {
|
|
1006
|
-
return /* @__PURE__ */
|
|
1005
|
+
return /* @__PURE__ */ jsx14(TooltipPrimitive.Trigger, {
|
|
1007
1006
|
"data-slot": "tooltip-trigger",
|
|
1008
1007
|
...props
|
|
1009
1008
|
});
|
|
@@ -1017,8 +1016,8 @@ function TooltipContent({
|
|
|
1017
1016
|
children,
|
|
1018
1017
|
...props
|
|
1019
1018
|
}) {
|
|
1020
|
-
return /* @__PURE__ */
|
|
1021
|
-
children: /* @__PURE__ */
|
|
1019
|
+
return /* @__PURE__ */ jsx14(TooltipPrimitive.Portal, {
|
|
1020
|
+
children: /* @__PURE__ */ jsx14(TooltipPrimitive.Positioner, {
|
|
1022
1021
|
align,
|
|
1023
1022
|
alignOffset,
|
|
1024
1023
|
side,
|
|
@@ -1030,7 +1029,7 @@ function TooltipContent({
|
|
|
1030
1029
|
...props,
|
|
1031
1030
|
children: [
|
|
1032
1031
|
children,
|
|
1033
|
-
/* @__PURE__ */
|
|
1032
|
+
/* @__PURE__ */ jsx14(TooltipPrimitive.Arrow, {
|
|
1034
1033
|
className: "bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"
|
|
1035
1034
|
})
|
|
1036
1035
|
]
|
|
@@ -1208,7 +1207,7 @@ var PaginationMeta = Schema.Struct({
|
|
|
1208
1207
|
|
|
1209
1208
|
// ../../src/components/ui/data-table.tsx
|
|
1210
1209
|
import { useKrakstackLocale as useKrakstackLocale3 } from "@krak-stack/registry/krakstack-provider";
|
|
1211
|
-
import { jsx as
|
|
1210
|
+
import { jsx as jsx15, jsxs as jsxs9, Fragment } from "react/jsx-runtime";
|
|
1212
1211
|
var DataTablePersistedUiStateSchema = Schema2.Struct({
|
|
1213
1212
|
columnVisibility: Schema2.Record(Schema2.String, Schema2.Boolean),
|
|
1214
1213
|
columnSizing: Schema2.Record(Schema2.String, Schema2.Finite),
|
|
@@ -1228,18 +1227,18 @@ var DataTableReferenceCell = ({
|
|
|
1228
1227
|
return /* @__PURE__ */ jsxs9("div", {
|
|
1229
1228
|
className: "flex min-w-0 items-center gap-2",
|
|
1230
1229
|
children: [
|
|
1231
|
-
/* @__PURE__ */
|
|
1230
|
+
/* @__PURE__ */ jsx15("div", {
|
|
1232
1231
|
className: cn("bg-muted flex size-8 shrink-0 items-center justify-center overflow-hidden text-xs font-medium", imageVariant === "circle" ? "rounded-full" : "rounded-md", item.iconClassName),
|
|
1233
|
-
children: item.icon ? /* @__PURE__ */
|
|
1232
|
+
children: item.icon ? /* @__PURE__ */ jsx15("span", {
|
|
1234
1233
|
"aria-hidden": "true",
|
|
1235
1234
|
className: "[&_svg]:size-4",
|
|
1236
1235
|
children: item.icon
|
|
1237
|
-
}) : item.imageSrc && item.imageSrc !== failedImage ? /* @__PURE__ */
|
|
1236
|
+
}) : item.imageSrc && item.imageSrc !== failedImage ? /* @__PURE__ */ jsx15("img", {
|
|
1238
1237
|
src: item.imageSrc,
|
|
1239
1238
|
alt: item.label,
|
|
1240
1239
|
className: "size-full object-cover",
|
|
1241
1240
|
onError: () => setFailedImage(item.imageSrc ?? undefined)
|
|
1242
|
-
}) : /* @__PURE__ */
|
|
1241
|
+
}) : /* @__PURE__ */ jsx15("span", {
|
|
1243
1242
|
"aria-hidden": "true",
|
|
1244
1243
|
children: initials
|
|
1245
1244
|
})
|
|
@@ -1247,11 +1246,11 @@ var DataTableReferenceCell = ({
|
|
|
1247
1246
|
/* @__PURE__ */ jsxs9("div", {
|
|
1248
1247
|
className: "flex min-w-0 flex-col leading-tight",
|
|
1249
1248
|
children: [
|
|
1250
|
-
/* @__PURE__ */
|
|
1249
|
+
/* @__PURE__ */ jsx15("span", {
|
|
1251
1250
|
className: "truncate font-medium",
|
|
1252
1251
|
children: item.label
|
|
1253
1252
|
}),
|
|
1254
|
-
item.description ? /* @__PURE__ */
|
|
1253
|
+
item.description ? /* @__PURE__ */ jsx15("span", {
|
|
1255
1254
|
className: "text-muted-foreground truncate text-xs",
|
|
1256
1255
|
children: item.description
|
|
1257
1256
|
}) : null
|
|
@@ -1632,9 +1631,9 @@ var sortDataTableRows = (rows, columns, sorting) => {
|
|
|
1632
1631
|
const nullOrder = colDef.typeOptions?.nulls === "first" ? -1 : 1;
|
|
1633
1632
|
return leftScalar === undefined ? nullOrder : -nullOrder;
|
|
1634
1633
|
}
|
|
1635
|
-
const
|
|
1636
|
-
if (
|
|
1637
|
-
return sort.direction === "desc" ? -
|
|
1634
|
+
const comparison = leftScalar - rightScalar;
|
|
1635
|
+
if (comparison !== 0)
|
|
1636
|
+
return sort.direction === "desc" ? -comparison : comparison;
|
|
1638
1637
|
continue;
|
|
1639
1638
|
}
|
|
1640
1639
|
if (!colDef.comparator && (colDef.type === "date" || colDef.type === "dateTime")) {
|
|
@@ -1646,9 +1645,9 @@ var sortDataTableRows = (rows, columns, sorting) => {
|
|
|
1646
1645
|
const nullOrder = colDef.typeOptions?.nulls === "first" ? -1 : 1;
|
|
1647
1646
|
return !leftDate ? nullOrder : -nullOrder;
|
|
1648
1647
|
}
|
|
1649
|
-
const
|
|
1650
|
-
if (
|
|
1651
|
-
return sort.direction === "desc" ? -
|
|
1648
|
+
const comparison = DateTime2.toEpochMillis(leftDate.instant) - DateTime2.toEpochMillis(rightDate.instant);
|
|
1649
|
+
if (comparison !== 0)
|
|
1650
|
+
return sort.direction === "desc" ? -comparison : comparison;
|
|
1652
1651
|
continue;
|
|
1653
1652
|
}
|
|
1654
1653
|
const comparison = column.colDef.comparator ? column.colDef.comparator(leftValue, rightValue, left.row.data, right.row.data) : Object.is(leftValue, rightValue) ? 0 : leftValue === null || leftValue === undefined ? 1 : rightValue === null || rightValue === undefined ? -1 : Schema2.is(Schema2.Finite)(leftValue) && Schema2.is(Schema2.Finite)(rightValue) ? leftValue - rightValue : dataTableValueText(leftValue).localeCompare(dataTableValueText(rightValue), undefined, { numeric: true, sensitivity: "base" });
|
|
@@ -1835,7 +1834,7 @@ var canMoveRowsToGroups = (store) => getActiveGrouping(store).some((field) => !!
|
|
|
1835
1834
|
var canDragRows = (store) => getActiveGrouping(store).length ? canMoveRowsToGroups(store) : canReorderRows(store);
|
|
1836
1835
|
var hasRowActionMenu = (store) => !!store.config.features.rowActions || canReorderRows(store);
|
|
1837
1836
|
var getSelectedRows = (store, model) => model.rows.filter((row) => store.state.rowSelection[row.id]).map((row) => row.data);
|
|
1838
|
-
var renderCell = (row, column, locale = "en",
|
|
1837
|
+
var renderCell = (row, column, locale = "en", labels = dataTableMessages(locale)) => {
|
|
1839
1838
|
const value = row.values.get(column.id);
|
|
1840
1839
|
const params = {
|
|
1841
1840
|
data: row.data,
|
|
@@ -1846,14 +1845,14 @@ var renderCell = (row, column, locale = "en", labels2 = dataTableMessages(locale
|
|
|
1846
1845
|
};
|
|
1847
1846
|
const CellRenderer = column.colDef.cellRenderer;
|
|
1848
1847
|
if (CellRenderer)
|
|
1849
|
-
return /* @__PURE__ */
|
|
1848
|
+
return /* @__PURE__ */ jsx15(CellRenderer, {
|
|
1850
1849
|
...params
|
|
1851
1850
|
});
|
|
1852
1851
|
const colDef = column.colDef;
|
|
1853
1852
|
if (colDef.type === "reference") {
|
|
1854
1853
|
if (colDef.valueFormatter)
|
|
1855
1854
|
return colDef.valueFormatter(params);
|
|
1856
|
-
return /* @__PURE__ */
|
|
1855
|
+
return /* @__PURE__ */ jsx15(DataTableReferenceCell, {
|
|
1857
1856
|
item: colDef.typeOptions.getItem(row.data),
|
|
1858
1857
|
emptyLabel: colDef.typeOptions.emptyLabel,
|
|
1859
1858
|
imageVariant: colDef.typeOptions.imageVariant
|
|
@@ -1863,7 +1862,7 @@ var renderCell = (row, column, locale = "en", labels2 = dataTableMessages(locale
|
|
|
1863
1862
|
if (colDef.valueFormatter)
|
|
1864
1863
|
return colDef.valueFormatter(params);
|
|
1865
1864
|
const number = Option2.getOrUndefined(decodeNumberValue(value));
|
|
1866
|
-
return /* @__PURE__ */
|
|
1865
|
+
return /* @__PURE__ */ jsx15("span", {
|
|
1867
1866
|
className: "block text-left tabular-nums",
|
|
1868
1867
|
children: number === undefined ? colDef.typeOptions?.emptyLabel ?? "—" : formatNumberValue(number, colDef.typeOptions, locale)
|
|
1869
1868
|
});
|
|
@@ -1875,12 +1874,12 @@ var renderCell = (row, column, locale = "en", labels2 = dataTableMessages(locale
|
|
|
1875
1874
|
if (boolean === undefined)
|
|
1876
1875
|
return colDef.typeOptions?.emptyLabel ?? "—";
|
|
1877
1876
|
const options = colDef.typeOptions;
|
|
1878
|
-
return /* @__PURE__ */
|
|
1877
|
+
return /* @__PURE__ */ jsx15("label", {
|
|
1879
1878
|
"data-slot": "data-table-boolean-cell",
|
|
1880
1879
|
className: cn("focus-within:border-ring focus-within:ring-ring/50 flex min-h-16 w-full items-center justify-start border border-transparent px-2 outline-none focus-within:ring-3 focus-within:ring-inset in-[[data-slot=table-cell]]:absolute in-[[data-slot=table-cell]]:inset-0 in-[[data-slot=table-cell]]:min-h-0", options?.onChange && !options.disabled?.(row.data) && "hover:bg-muted/50 cursor-pointer"),
|
|
1881
1880
|
onClick: (event) => event.stopPropagation(),
|
|
1882
1881
|
onPointerDown: (event) => event.stopPropagation(),
|
|
1883
|
-
children: /* @__PURE__ */
|
|
1882
|
+
children: /* @__PURE__ */ jsx15(Checkbox, {
|
|
1884
1883
|
"aria-label": options?.getAriaLabel?.(row.data) ?? columnLabel(column),
|
|
1885
1884
|
className: "focus-visible:ring-0 focus-visible:outline-none",
|
|
1886
1885
|
checked: boolean,
|
|
@@ -1894,7 +1893,7 @@ var renderCell = (row, column, locale = "en", labels2 = dataTableMessages(locale
|
|
|
1894
1893
|
if (colDef.valueFormatter)
|
|
1895
1894
|
return colDef.valueFormatter(params);
|
|
1896
1895
|
const date = resolveDate(value, colDef.type);
|
|
1897
|
-
return date ? /* @__PURE__ */
|
|
1896
|
+
return date ? /* @__PURE__ */ jsx15("time", {
|
|
1898
1897
|
dateTime: dateIsoValue(date),
|
|
1899
1898
|
children: formatDateValue(date, colDef, locale)
|
|
1900
1899
|
}) : colDef.typeOptions?.emptyLabel ?? "—";
|
|
@@ -1908,26 +1907,26 @@ var renderCell = (row, column, locale = "en", labels2 = dataTableMessages(locale
|
|
|
1908
1907
|
disabled: (item) => action.disabled?.({ item, row: row.data }) ?? false
|
|
1909
1908
|
}));
|
|
1910
1909
|
if (config.getOptions) {
|
|
1911
|
-
return /* @__PURE__ */
|
|
1910
|
+
return /* @__PURE__ */ jsx15(DataTableListCell, {
|
|
1912
1911
|
...config,
|
|
1913
1912
|
itemActions,
|
|
1914
1913
|
onItemClick: config.onItemClick ? (item) => config.onItemClick?.({ item, row: row.data }) : undefined,
|
|
1915
1914
|
items: config.getItems(row.data),
|
|
1916
1915
|
locale,
|
|
1917
|
-
messages: { [locale]:
|
|
1916
|
+
messages: { [locale]: labels },
|
|
1918
1917
|
options: config.getOptions(row.data),
|
|
1919
1918
|
totalCount: config.getTotalCount?.(row.data),
|
|
1920
|
-
onAdd: config.onAdd ? (
|
|
1921
|
-
onRemove: config.onRemove ? (
|
|
1919
|
+
onAdd: config.onAdd ? (value) => config.onAdd?.({ value, row: row.data }) : undefined,
|
|
1920
|
+
onRemove: config.onRemove ? (value) => config.onRemove?.({ value, row: row.data }) : undefined
|
|
1922
1921
|
});
|
|
1923
1922
|
}
|
|
1924
|
-
return /* @__PURE__ */
|
|
1923
|
+
return /* @__PURE__ */ jsx15(DataTableListCell, {
|
|
1925
1924
|
...config,
|
|
1926
1925
|
itemActions,
|
|
1927
1926
|
onItemClick: config.onItemClick ? (item) => config.onItemClick?.({ item, row: row.data }) : undefined,
|
|
1928
1927
|
items: config.getItems(row.data),
|
|
1929
1928
|
locale,
|
|
1930
|
-
messages: { [locale]:
|
|
1929
|
+
messages: { [locale]: labels },
|
|
1931
1930
|
totalCount: config.getTotalCount?.(row.data)
|
|
1932
1931
|
});
|
|
1933
1932
|
}
|
|
@@ -1970,30 +1969,30 @@ var DataTableRowActions = ({
|
|
|
1970
1969
|
return null;
|
|
1971
1970
|
return /* @__PURE__ */ jsxs9(DropdownMenu, {
|
|
1972
1971
|
children: [
|
|
1973
|
-
/* @__PURE__ */
|
|
1972
|
+
/* @__PURE__ */ jsx15(DropdownMenuTrigger, {
|
|
1974
1973
|
onClick: (event) => event.stopPropagation(),
|
|
1975
1974
|
render: /* @__PURE__ */ jsxs9(Button, {
|
|
1976
1975
|
className: "size-8 focus-visible:ring-inset [&_svg:not([class*='size-'])]:size-4",
|
|
1977
1976
|
size: "icon",
|
|
1978
1977
|
variant: "ghost",
|
|
1979
1978
|
children: [
|
|
1980
|
-
/* @__PURE__ */
|
|
1979
|
+
/* @__PURE__ */ jsx15("span", {
|
|
1981
1980
|
className: "sr-only",
|
|
1982
1981
|
children: title
|
|
1983
1982
|
}),
|
|
1984
|
-
/* @__PURE__ */
|
|
1983
|
+
/* @__PURE__ */ jsx15(MoreHorizontal, {})
|
|
1985
1984
|
]
|
|
1986
1985
|
})
|
|
1987
1986
|
}),
|
|
1988
|
-
/* @__PURE__ */
|
|
1987
|
+
/* @__PURE__ */ jsx15(DropdownMenuContent, {
|
|
1989
1988
|
align: "end",
|
|
1990
1989
|
className: "w-max",
|
|
1991
1990
|
children: /* @__PURE__ */ jsxs9(DropdownMenuGroup, {
|
|
1992
1991
|
children: [
|
|
1993
|
-
/* @__PURE__ */
|
|
1992
|
+
/* @__PURE__ */ jsx15(DropdownMenuLabel, {
|
|
1994
1993
|
children: title
|
|
1995
1994
|
}),
|
|
1996
|
-
/* @__PURE__ */
|
|
1995
|
+
/* @__PURE__ */ jsx15(DropdownMenuSeparator, {}),
|
|
1997
1996
|
visible.map((action) => /* @__PURE__ */ jsxs9(DropdownMenuItem, {
|
|
1998
1997
|
onClick: (event) => {
|
|
1999
1998
|
event.stopPropagation();
|
|
@@ -2031,7 +2030,7 @@ var DataTableRowActionMenu = ({
|
|
|
2031
2030
|
reorderActions.push({
|
|
2032
2031
|
id: "data-table-move-up",
|
|
2033
2032
|
name: store.config.labels.moveUp,
|
|
2034
|
-
icon: /* @__PURE__ */
|
|
2033
|
+
icon: /* @__PURE__ */ jsx15(ArrowUp, {}),
|
|
2035
2034
|
onClick: () => move(rowIndex - 1)
|
|
2036
2035
|
});
|
|
2037
2036
|
}
|
|
@@ -2039,12 +2038,12 @@ var DataTableRowActionMenu = ({
|
|
|
2039
2038
|
reorderActions.push({
|
|
2040
2039
|
id: "data-table-move-down",
|
|
2041
2040
|
name: store.config.labels.moveDown,
|
|
2042
|
-
icon: /* @__PURE__ */
|
|
2041
|
+
icon: /* @__PURE__ */ jsx15(ArrowDown, {}),
|
|
2043
2042
|
onClick: () => move(rowIndex + 1)
|
|
2044
2043
|
});
|
|
2045
2044
|
}
|
|
2046
2045
|
}
|
|
2047
|
-
return /* @__PURE__ */
|
|
2046
|
+
return /* @__PURE__ */ jsx15(DataTableRowActions, {
|
|
2048
2047
|
actions: [...reorderActions, ...rowActions ? rowActions.items : []],
|
|
2049
2048
|
row: row.data,
|
|
2050
2049
|
title: rowActions?.label ?? store.config.labels.actions
|
|
@@ -2057,7 +2056,7 @@ var DataTableToolbar = ({
|
|
|
2057
2056
|
const exportPending = useRef(false);
|
|
2058
2057
|
const [exporting, setExporting] = useState(false);
|
|
2059
2058
|
const [exportFailed, setExportFailed] = useState(false);
|
|
2060
|
-
const { features, labels
|
|
2059
|
+
const { features, labels } = store.config;
|
|
2061
2060
|
const model = deriveModel(store);
|
|
2062
2061
|
const selectedRows = getSelectedRows(store, model);
|
|
2063
2062
|
const grouping = features.grouping;
|
|
@@ -2097,21 +2096,21 @@ var DataTableToolbar = ({
|
|
|
2097
2096
|
features.search !== false ? /* @__PURE__ */ jsxs9("div", {
|
|
2098
2097
|
className: "relative min-w-0",
|
|
2099
2098
|
children: [
|
|
2100
|
-
/* @__PURE__ */
|
|
2099
|
+
/* @__PURE__ */ jsx15(Search, {
|
|
2101
2100
|
className: "text-muted-foreground pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2"
|
|
2102
2101
|
}),
|
|
2103
|
-
/* @__PURE__ */
|
|
2102
|
+
/* @__PURE__ */ jsx15(Input, {
|
|
2104
2103
|
className: "px-9",
|
|
2105
2104
|
onChange: (event) => update((state) => ({
|
|
2106
2105
|
...state,
|
|
2107
2106
|
globalFilter: event.target.value,
|
|
2108
2107
|
page: 0
|
|
2109
2108
|
})),
|
|
2110
|
-
placeholder:
|
|
2109
|
+
placeholder: labels.filter,
|
|
2111
2110
|
value: store.state.globalFilter ?? ""
|
|
2112
2111
|
}),
|
|
2113
|
-
store.state.globalFilter ? /* @__PURE__ */
|
|
2114
|
-
"aria-label":
|
|
2112
|
+
store.state.globalFilter ? /* @__PURE__ */ jsx15(Button, {
|
|
2113
|
+
"aria-label": labels.filter,
|
|
2115
2114
|
className: "absolute top-1/2 right-1 size-7 -translate-y-1/2 active:not-aria-[haspopup]:-translate-y-1/2",
|
|
2116
2115
|
onClick: () => update((state) => ({
|
|
2117
2116
|
...state,
|
|
@@ -2120,11 +2119,11 @@ var DataTableToolbar = ({
|
|
|
2120
2119
|
})),
|
|
2121
2120
|
size: "icon",
|
|
2122
2121
|
variant: "ghost",
|
|
2123
|
-
children: /* @__PURE__ */
|
|
2122
|
+
children: /* @__PURE__ */ jsx15(X, {})
|
|
2124
2123
|
}) : null
|
|
2125
2124
|
]
|
|
2126
2125
|
}) : null,
|
|
2127
|
-
/* @__PURE__ */
|
|
2126
|
+
/* @__PURE__ */ jsx15("div", {
|
|
2128
2127
|
className: "-m-1 flex overflow-x-auto p-1",
|
|
2129
2128
|
children: /* @__PURE__ */ jsxs9(Menubar, {
|
|
2130
2129
|
className: "h-auto w-max min-w-full justify-start bg-transparent shadow-none [&_[data-slot=menubar-trigger]]:gap-2 [&_[data-slot=menubar-trigger]_svg]:size-4",
|
|
@@ -2134,23 +2133,23 @@ var DataTableToolbar = ({
|
|
|
2134
2133
|
/* @__PURE__ */ jsxs9(MenubarTrigger, {
|
|
2135
2134
|
className: "bg-primary text-primary-foreground hover:bg-primary/90 aria-expanded:bg-primary/90",
|
|
2136
2135
|
children: [
|
|
2137
|
-
|
|
2138
|
-
/* @__PURE__ */
|
|
2136
|
+
labels.selected,
|
|
2137
|
+
/* @__PURE__ */ jsx15(Badge, {
|
|
2139
2138
|
variant: "secondary",
|
|
2140
2139
|
children: selectedRows.length
|
|
2141
2140
|
}),
|
|
2142
|
-
/* @__PURE__ */
|
|
2141
|
+
/* @__PURE__ */ jsx15(ChevronDown, {})
|
|
2143
2142
|
]
|
|
2144
2143
|
}),
|
|
2145
|
-
/* @__PURE__ */
|
|
2144
|
+
/* @__PURE__ */ jsx15(MenubarContent, {
|
|
2146
2145
|
align: "end",
|
|
2147
2146
|
className: "w-max",
|
|
2148
2147
|
children: /* @__PURE__ */ jsxs9(MenubarGroup, {
|
|
2149
2148
|
children: [
|
|
2150
|
-
/* @__PURE__ */
|
|
2151
|
-
children: bulkActions && bulkActions.label ? bulkActions.label :
|
|
2149
|
+
/* @__PURE__ */ jsx15(MenubarLabel, {
|
|
2150
|
+
children: bulkActions && bulkActions.label ? bulkActions.label : labels.actions
|
|
2152
2151
|
}),
|
|
2153
|
-
/* @__PURE__ */
|
|
2152
|
+
/* @__PURE__ */ jsx15(MenubarSeparator, {}),
|
|
2154
2153
|
visibleBulkActions.map((action) => /* @__PURE__ */ jsxs9(MenubarItem, {
|
|
2155
2154
|
onClick: () => action.onClick(selectedRows),
|
|
2156
2155
|
variant: action.variant ?? "default",
|
|
@@ -2165,30 +2164,30 @@ var DataTableToolbar = ({
|
|
|
2165
2164
|
]
|
|
2166
2165
|
}) : null,
|
|
2167
2166
|
toolbar && toolbar.items,
|
|
2168
|
-
features.filtering !== false ? /* @__PURE__ */
|
|
2167
|
+
features.filtering !== false ? /* @__PURE__ */ jsx15(FilterMenu, {
|
|
2169
2168
|
tableAtom
|
|
2170
2169
|
}) : null,
|
|
2171
2170
|
grouping ? /* @__PURE__ */ jsxs9(MenubarMenu, {
|
|
2172
2171
|
children: [
|
|
2173
2172
|
/* @__PURE__ */ jsxs9(MenubarTrigger, {
|
|
2174
|
-
"aria-label":
|
|
2173
|
+
"aria-label": labels.groupBy,
|
|
2175
2174
|
children: [
|
|
2176
|
-
/* @__PURE__ */
|
|
2177
|
-
/* @__PURE__ */
|
|
2175
|
+
/* @__PURE__ */ jsx15(Rows3, {}),
|
|
2176
|
+
/* @__PURE__ */ jsx15("span", {
|
|
2178
2177
|
className: "hidden sm:inline",
|
|
2179
|
-
children:
|
|
2178
|
+
children: labels.groupBy
|
|
2180
2179
|
})
|
|
2181
2180
|
]
|
|
2182
2181
|
}),
|
|
2183
|
-
/* @__PURE__ */
|
|
2182
|
+
/* @__PURE__ */ jsx15(MenubarContent, {
|
|
2184
2183
|
align: "end",
|
|
2185
2184
|
children: /* @__PURE__ */ jsxs9(MenubarGroup, {
|
|
2186
2185
|
children: [
|
|
2187
|
-
/* @__PURE__ */
|
|
2188
|
-
children:
|
|
2186
|
+
/* @__PURE__ */ jsx15(MenubarLabel, {
|
|
2187
|
+
children: labels.groupBy
|
|
2189
2188
|
}),
|
|
2190
|
-
/* @__PURE__ */
|
|
2191
|
-
grouping.fields.map((field) => /* @__PURE__ */
|
|
2189
|
+
/* @__PURE__ */ jsx15(MenubarSeparator, {}),
|
|
2190
|
+
grouping.fields.map((field) => /* @__PURE__ */ jsx15(MenubarCheckboxItem, {
|
|
2192
2191
|
checked: store.state.grouping.includes(field.id),
|
|
2193
2192
|
onCheckedChange: (checked) => update((state) => ({
|
|
2194
2193
|
...state,
|
|
@@ -2201,24 +2200,24 @@ var DataTableToolbar = ({
|
|
|
2201
2200
|
})
|
|
2202
2201
|
]
|
|
2203
2202
|
}) : null,
|
|
2204
|
-
features.sorting !== false ? /* @__PURE__ */
|
|
2203
|
+
features.sorting !== false ? /* @__PURE__ */ jsx15(SortMenu, {
|
|
2205
2204
|
tableAtom
|
|
2206
2205
|
}) : null,
|
|
2207
|
-
features.gallery ? /* @__PURE__ */
|
|
2206
|
+
features.gallery ? /* @__PURE__ */ jsx15(ViewMenu, {
|
|
2208
2207
|
tableAtom
|
|
2209
2208
|
}) : null,
|
|
2210
|
-
features.columnVisibility !== false ? /* @__PURE__ */
|
|
2209
|
+
features.columnVisibility !== false ? /* @__PURE__ */ jsx15(ColumnMenu, {
|
|
2211
2210
|
tableAtom
|
|
2212
2211
|
}) : null,
|
|
2213
|
-
features.refresh ? /* @__PURE__ */
|
|
2212
|
+
features.refresh ? /* @__PURE__ */ jsx15(MenubarMenu, {
|
|
2214
2213
|
children: /* @__PURE__ */ jsxs9(MenubarTrigger, {
|
|
2215
|
-
"aria-label":
|
|
2214
|
+
"aria-label": labels.refresh,
|
|
2216
2215
|
onClick: features.refresh,
|
|
2217
2216
|
children: [
|
|
2218
|
-
/* @__PURE__ */
|
|
2219
|
-
/* @__PURE__ */
|
|
2217
|
+
/* @__PURE__ */ jsx15(RefreshCw, {}),
|
|
2218
|
+
/* @__PURE__ */ jsx15("span", {
|
|
2220
2219
|
className: "hidden sm:inline",
|
|
2221
|
-
children:
|
|
2220
|
+
children: labels.refresh
|
|
2222
2221
|
})
|
|
2223
2222
|
]
|
|
2224
2223
|
})
|
|
@@ -2226,35 +2225,35 @@ var DataTableToolbar = ({
|
|
|
2226
2225
|
features.export ? /* @__PURE__ */ jsxs9(MenubarMenu, {
|
|
2227
2226
|
children: [
|
|
2228
2227
|
/* @__PURE__ */ jsxs9(MenubarTrigger, {
|
|
2229
|
-
"aria-label":
|
|
2228
|
+
"aria-label": labels.export,
|
|
2230
2229
|
"aria-busy": exporting,
|
|
2231
2230
|
disabled: exporting || !canExport,
|
|
2232
2231
|
children: [
|
|
2233
|
-
exporting ? /* @__PURE__ */
|
|
2232
|
+
exporting ? /* @__PURE__ */ jsx15(RefreshCw, {
|
|
2234
2233
|
className: "animate-spin"
|
|
2235
|
-
}) : /* @__PURE__ */
|
|
2236
|
-
/* @__PURE__ */
|
|
2234
|
+
}) : /* @__PURE__ */ jsx15(Download, {}),
|
|
2235
|
+
/* @__PURE__ */ jsx15("span", {
|
|
2237
2236
|
className: "hidden sm:inline",
|
|
2238
|
-
children: exporting ?
|
|
2237
|
+
children: exporting ? labels.loading : labels.export
|
|
2239
2238
|
})
|
|
2240
2239
|
]
|
|
2241
2240
|
}),
|
|
2242
|
-
/* @__PURE__ */
|
|
2241
|
+
/* @__PURE__ */ jsx15(MenubarContent, {
|
|
2243
2242
|
align: "end",
|
|
2244
2243
|
children: /* @__PURE__ */ jsxs9(MenubarGroup, {
|
|
2245
2244
|
children: [
|
|
2246
|
-
/* @__PURE__ */
|
|
2247
|
-
children:
|
|
2245
|
+
/* @__PURE__ */ jsx15(MenubarLabel, {
|
|
2246
|
+
children: labels.export
|
|
2248
2247
|
}),
|
|
2249
|
-
/* @__PURE__ */
|
|
2248
|
+
/* @__PURE__ */ jsx15(MenubarSeparator, {}),
|
|
2250
2249
|
builtInExport ? /* @__PURE__ */ jsxs9(Fragment, {
|
|
2251
2250
|
children: [
|
|
2252
2251
|
/* @__PURE__ */ jsxs9(MenubarItem, {
|
|
2253
2252
|
disabled: exporting || !exportRows.length,
|
|
2254
2253
|
onClick: () => downloadCsv(exportColumns.map(columnLabel), exportRows.map((row) => exportColumns.map((column) => dataTableValueText(getDataTableExportValue(row, column, store.config.locale) ?? ""))), features.export ? features.export.baseName : "table"),
|
|
2255
2254
|
children: [
|
|
2256
|
-
/* @__PURE__ */
|
|
2257
|
-
|
|
2255
|
+
/* @__PURE__ */ jsx15(FileText, {}),
|
|
2256
|
+
labels.exportCsv
|
|
2258
2257
|
]
|
|
2259
2258
|
}),
|
|
2260
2259
|
/* @__PURE__ */ jsxs9(MenubarItem, {
|
|
@@ -2264,13 +2263,13 @@ var DataTableToolbar = ({
|
|
|
2264
2263
|
getDataTableExportValue(row, column, store.config.locale)
|
|
2265
2264
|
]))), features.export ? features.export.baseName : "table"),
|
|
2266
2265
|
children: [
|
|
2267
|
-
/* @__PURE__ */
|
|
2268
|
-
|
|
2266
|
+
/* @__PURE__ */ jsx15(FileJson, {}),
|
|
2267
|
+
labels.exportJson
|
|
2269
2268
|
]
|
|
2270
2269
|
})
|
|
2271
2270
|
]
|
|
2272
2271
|
}) : null,
|
|
2273
|
-
builtInExport && exportActions.length ? /* @__PURE__ */
|
|
2272
|
+
builtInExport && exportActions.length ? /* @__PURE__ */ jsx15(MenubarSeparator, {}) : null,
|
|
2274
2273
|
exportActions.map((action) => /* @__PURE__ */ jsxs9(MenubarItem, {
|
|
2275
2274
|
disabled: exporting || action.disabled,
|
|
2276
2275
|
onClick: () => void runExport(action),
|
|
@@ -2287,10 +2286,10 @@ var DataTableToolbar = ({
|
|
|
2287
2286
|
]
|
|
2288
2287
|
})
|
|
2289
2288
|
}),
|
|
2290
|
-
exportFeature && exportFailed ? /* @__PURE__ */
|
|
2289
|
+
exportFeature && exportFailed ? /* @__PURE__ */ jsx15("p", {
|
|
2291
2290
|
role: "alert",
|
|
2292
2291
|
className: "text-destructive text-sm",
|
|
2293
|
-
children:
|
|
2292
|
+
children: labels.exportFailed ?? dataTableMessages(store.config.locale).exportFailed
|
|
2294
2293
|
}) : null
|
|
2295
2294
|
]
|
|
2296
2295
|
});
|
|
@@ -2305,7 +2304,7 @@ var FilterEditor = ({
|
|
|
2305
2304
|
column,
|
|
2306
2305
|
rows,
|
|
2307
2306
|
current,
|
|
2308
|
-
labels
|
|
2307
|
+
labels,
|
|
2309
2308
|
onChange
|
|
2310
2309
|
}) => {
|
|
2311
2310
|
const inputId = useId2();
|
|
@@ -2314,10 +2313,10 @@ var FilterEditor = ({
|
|
|
2314
2313
|
const [secondary, setSecondary] = useState(current?.kind === "number" ? String(current.max ?? "") : current?.kind === "date" ? current.to ?? "" : "");
|
|
2315
2314
|
const [operator, setOperator] = useState(current?.kind === "text" ? current.operator : "contains");
|
|
2316
2315
|
const operatorOptions = [
|
|
2317
|
-
{ value: "contains", label:
|
|
2318
|
-
{ value: "equals", label:
|
|
2319
|
-
{ value: "startsWith", label:
|
|
2320
|
-
{ value: "endsWith", label:
|
|
2316
|
+
{ value: "contains", label: labels.filterContains },
|
|
2317
|
+
{ value: "equals", label: labels.filterEquals },
|
|
2318
|
+
{ value: "startsWith", label: labels.filterStartsWith },
|
|
2319
|
+
{ value: "endsWith", label: labels.filterEndsWith }
|
|
2321
2320
|
];
|
|
2322
2321
|
const [invalid, setInvalid] = useState(false);
|
|
2323
2322
|
const [optionSearch, setOptionSearch] = useState("");
|
|
@@ -2337,23 +2336,23 @@ var FilterEditor = ({
|
|
|
2337
2336
|
value: current?.kind === "boolean" ? String(current.value) : "",
|
|
2338
2337
|
onValueChange: (value) => apply({ id: column.id, kind, value: value === "true" }),
|
|
2339
2338
|
children: [
|
|
2340
|
-
/* @__PURE__ */
|
|
2339
|
+
/* @__PURE__ */ jsx15(MenubarRadioItem, {
|
|
2341
2340
|
value: "true",
|
|
2342
2341
|
closeOnClick: false,
|
|
2343
|
-
children: column.colDef.type === "boolean" ? column.colDef.typeOptions?.trueLabel ??
|
|
2342
|
+
children: column.colDef.type === "boolean" ? column.colDef.typeOptions?.trueLabel ?? labels.filterTrue : labels.filterTrue
|
|
2344
2343
|
}),
|
|
2345
|
-
/* @__PURE__ */
|
|
2344
|
+
/* @__PURE__ */ jsx15(MenubarRadioItem, {
|
|
2346
2345
|
value: "false",
|
|
2347
2346
|
closeOnClick: false,
|
|
2348
|
-
children: column.colDef.type === "boolean" ? column.colDef.typeOptions?.falseLabel ??
|
|
2347
|
+
children: column.colDef.type === "boolean" ? column.colDef.typeOptions?.falseLabel ?? labels.filterFalse : labels.filterFalse
|
|
2349
2348
|
})
|
|
2350
2349
|
]
|
|
2351
2350
|
}),
|
|
2352
|
-
/* @__PURE__ */
|
|
2353
|
-
/* @__PURE__ */
|
|
2351
|
+
/* @__PURE__ */ jsx15(MenubarSeparator, {}),
|
|
2352
|
+
/* @__PURE__ */ jsx15(MenubarItem, {
|
|
2354
2353
|
closeOnClick: false,
|
|
2355
2354
|
onClick: () => onChange(undefined),
|
|
2356
|
-
children:
|
|
2355
|
+
children: labels.filterClear
|
|
2357
2356
|
})
|
|
2358
2357
|
]
|
|
2359
2358
|
});
|
|
@@ -2364,11 +2363,11 @@ var FilterEditor = ({
|
|
|
2364
2363
|
const filteredOptions = options.filter((option) => option.label.toLocaleLowerCase().includes(optionSearch.trim().toLocaleLowerCase()));
|
|
2365
2364
|
return /* @__PURE__ */ jsxs9(MenubarGroup, {
|
|
2366
2365
|
children: [
|
|
2367
|
-
options.length > 8 ? /* @__PURE__ */
|
|
2366
|
+
options.length > 8 ? /* @__PURE__ */ jsx15("div", {
|
|
2368
2367
|
className: "p-1",
|
|
2369
|
-
children: /* @__PURE__ */
|
|
2370
|
-
"aria-label":
|
|
2371
|
-
placeholder:
|
|
2368
|
+
children: /* @__PURE__ */ jsx15(Input, {
|
|
2369
|
+
"aria-label": labels.filter,
|
|
2370
|
+
placeholder: labels.filter,
|
|
2372
2371
|
value: optionSearch,
|
|
2373
2372
|
onChange: (event) => setOptionSearch(event.target.value),
|
|
2374
2373
|
onKeyDown: (event) => {
|
|
@@ -2388,26 +2387,26 @@ var FilterEditor = ({
|
|
|
2388
2387
|
onChange(undefined);
|
|
2389
2388
|
},
|
|
2390
2389
|
children: [
|
|
2391
|
-
/* @__PURE__ */
|
|
2390
|
+
/* @__PURE__ */ jsx15("span", {
|
|
2392
2391
|
className: "min-w-0 flex-1 truncate",
|
|
2393
2392
|
children: option.label
|
|
2394
2393
|
}),
|
|
2395
|
-
option.count !== undefined ? /* @__PURE__ */
|
|
2394
|
+
option.count !== undefined ? /* @__PURE__ */ jsx15(Badge, {
|
|
2396
2395
|
variant: "secondary",
|
|
2397
2396
|
className: "ml-auto shrink-0",
|
|
2398
2397
|
children: option.count
|
|
2399
2398
|
}) : null
|
|
2400
2399
|
]
|
|
2401
2400
|
}, option.value)),
|
|
2402
|
-
!filteredOptions.length ? /* @__PURE__ */
|
|
2401
|
+
!filteredOptions.length ? /* @__PURE__ */ jsx15("div", {
|
|
2403
2402
|
className: "text-muted-foreground px-2 py-1.5 text-sm",
|
|
2404
|
-
children:
|
|
2403
|
+
children: labels.empty
|
|
2405
2404
|
}) : null,
|
|
2406
|
-
/* @__PURE__ */
|
|
2407
|
-
/* @__PURE__ */
|
|
2405
|
+
/* @__PURE__ */ jsx15(MenubarSeparator, {}),
|
|
2406
|
+
/* @__PURE__ */ jsx15(MenubarItem, {
|
|
2408
2407
|
closeOnClick: false,
|
|
2409
2408
|
onClick: () => onChange(undefined),
|
|
2410
|
-
children:
|
|
2409
|
+
children: labels.filterClear
|
|
2411
2410
|
})
|
|
2412
2411
|
]
|
|
2413
2412
|
});
|
|
@@ -2444,9 +2443,9 @@ var FilterEditor = ({
|
|
|
2444
2443
|
children: [
|
|
2445
2444
|
kind === "text" ? /* @__PURE__ */ jsxs9(Field, {
|
|
2446
2445
|
children: [
|
|
2447
|
-
/* @__PURE__ */
|
|
2446
|
+
/* @__PURE__ */ jsx15(FieldLabel, {
|
|
2448
2447
|
htmlFor: `${inputId}-operator`,
|
|
2449
|
-
children:
|
|
2448
|
+
children: labels.filterOperator
|
|
2450
2449
|
}),
|
|
2451
2450
|
/* @__PURE__ */ jsxs9(Select, {
|
|
2452
2451
|
items: operatorOptions,
|
|
@@ -2457,13 +2456,13 @@ var FilterEditor = ({
|
|
|
2457
2456
|
setOperator(decoded.value);
|
|
2458
2457
|
},
|
|
2459
2458
|
children: [
|
|
2460
|
-
/* @__PURE__ */
|
|
2459
|
+
/* @__PURE__ */ jsx15(SelectTrigger, {
|
|
2461
2460
|
id: `${inputId}-operator`,
|
|
2462
|
-
children: /* @__PURE__ */
|
|
2461
|
+
children: /* @__PURE__ */ jsx15(SelectValue, {})
|
|
2463
2462
|
}),
|
|
2464
|
-
/* @__PURE__ */
|
|
2465
|
-
children: /* @__PURE__ */
|
|
2466
|
-
children: operatorOptions.map((option) => /* @__PURE__ */
|
|
2463
|
+
/* @__PURE__ */ jsx15(SelectContent, {
|
|
2464
|
+
children: /* @__PURE__ */ jsx15(SelectGroup, {
|
|
2465
|
+
children: operatorOptions.map((option) => /* @__PURE__ */ jsx15(SelectItem, {
|
|
2467
2466
|
value: option.value,
|
|
2468
2467
|
children: option.label
|
|
2469
2468
|
}, option.value))
|
|
@@ -2476,11 +2475,11 @@ var FilterEditor = ({
|
|
|
2476
2475
|
/* @__PURE__ */ jsxs9(Field, {
|
|
2477
2476
|
"data-invalid": invalid || undefined,
|
|
2478
2477
|
children: [
|
|
2479
|
-
/* @__PURE__ */
|
|
2478
|
+
/* @__PURE__ */ jsx15(FieldLabel, {
|
|
2480
2479
|
htmlFor: `${inputId}-primary`,
|
|
2481
|
-
children: kind === "text" ?
|
|
2480
|
+
children: kind === "text" ? labels.filterValue : kind === "date" ? labels.filterFrom : labels.filterMin
|
|
2482
2481
|
}),
|
|
2483
|
-
/* @__PURE__ */
|
|
2482
|
+
/* @__PURE__ */ jsx15(Input, {
|
|
2484
2483
|
id: `${inputId}-primary`,
|
|
2485
2484
|
type: kind === "text" ? "text" : kind === "date" ? "date" : "number",
|
|
2486
2485
|
step: kind === "number" ? "any" : undefined,
|
|
@@ -2496,11 +2495,11 @@ var FilterEditor = ({
|
|
|
2496
2495
|
kind !== "text" ? /* @__PURE__ */ jsxs9(Field, {
|
|
2497
2496
|
"data-invalid": invalid || undefined,
|
|
2498
2497
|
children: [
|
|
2499
|
-
/* @__PURE__ */
|
|
2498
|
+
/* @__PURE__ */ jsx15(FieldLabel, {
|
|
2500
2499
|
htmlFor: `${inputId}-secondary`,
|
|
2501
|
-
children: kind === "date" ?
|
|
2500
|
+
children: kind === "date" ? labels.filterTo : labels.filterMax
|
|
2502
2501
|
}),
|
|
2503
|
-
/* @__PURE__ */
|
|
2502
|
+
/* @__PURE__ */ jsx15(Input, {
|
|
2504
2503
|
id: `${inputId}-secondary`,
|
|
2505
2504
|
type: kind === "date" ? "date" : "number",
|
|
2506
2505
|
step: kind === "number" ? "any" : undefined,
|
|
@@ -2515,20 +2514,20 @@ var FilterEditor = ({
|
|
|
2515
2514
|
}) : null
|
|
2516
2515
|
]
|
|
2517
2516
|
}),
|
|
2518
|
-
invalid ? /* @__PURE__ */
|
|
2517
|
+
invalid ? /* @__PURE__ */ jsx15("p", {
|
|
2519
2518
|
role: "alert",
|
|
2520
2519
|
className: "text-destructive text-sm",
|
|
2521
|
-
children:
|
|
2520
|
+
children: labels.filterInvalid
|
|
2522
2521
|
}) : null,
|
|
2523
2522
|
/* @__PURE__ */ jsxs9("div", {
|
|
2524
2523
|
className: "flex gap-2",
|
|
2525
2524
|
children: [
|
|
2526
|
-
/* @__PURE__ */
|
|
2525
|
+
/* @__PURE__ */ jsx15(Button, {
|
|
2527
2526
|
type: "submit",
|
|
2528
2527
|
size: "sm",
|
|
2529
|
-
children:
|
|
2528
|
+
children: labels.filterApply
|
|
2530
2529
|
}),
|
|
2531
|
-
/* @__PURE__ */
|
|
2530
|
+
/* @__PURE__ */ jsx15(Button, {
|
|
2532
2531
|
type: "button",
|
|
2533
2532
|
size: "sm",
|
|
2534
2533
|
variant: "outline",
|
|
@@ -2538,7 +2537,7 @@ var FilterEditor = ({
|
|
|
2538
2537
|
setInvalid(false);
|
|
2539
2538
|
onChange(undefined);
|
|
2540
2539
|
},
|
|
2541
|
-
children:
|
|
2540
|
+
children: labels.filterClear
|
|
2542
2541
|
})
|
|
2543
2542
|
]
|
|
2544
2543
|
})
|
|
@@ -2563,39 +2562,39 @@ var FilterMenu = ({
|
|
|
2563
2562
|
/* @__PURE__ */ jsxs9(MenubarTrigger, {
|
|
2564
2563
|
"aria-label": store.config.labels.filters,
|
|
2565
2564
|
children: [
|
|
2566
|
-
/* @__PURE__ */
|
|
2567
|
-
/* @__PURE__ */
|
|
2565
|
+
/* @__PURE__ */ jsx15(ListFilter, {}),
|
|
2566
|
+
/* @__PURE__ */ jsx15("span", {
|
|
2568
2567
|
children: store.config.labels.filters
|
|
2569
2568
|
}),
|
|
2570
|
-
filters.length ? /* @__PURE__ */
|
|
2569
|
+
filters.length ? /* @__PURE__ */ jsx15(Badge, {
|
|
2571
2570
|
variant: "secondary",
|
|
2572
2571
|
children: filters.length
|
|
2573
2572
|
}) : null
|
|
2574
2573
|
]
|
|
2575
2574
|
}),
|
|
2576
|
-
/* @__PURE__ */
|
|
2575
|
+
/* @__PURE__ */ jsx15(MenubarContent, {
|
|
2577
2576
|
align: "end",
|
|
2578
2577
|
className: "w-80 max-w-[calc(100vw-2rem)]",
|
|
2579
2578
|
children: /* @__PURE__ */ jsxs9(MenubarGroup, {
|
|
2580
2579
|
children: [
|
|
2581
|
-
/* @__PURE__ */
|
|
2580
|
+
/* @__PURE__ */ jsx15(MenubarLabel, {
|
|
2582
2581
|
children: store.config.labels.filters
|
|
2583
2582
|
}),
|
|
2584
|
-
/* @__PURE__ */
|
|
2583
|
+
/* @__PURE__ */ jsx15(MenubarSeparator, {}),
|
|
2585
2584
|
columns.map(({ column, label }) => /* @__PURE__ */ jsxs9(MenubarSub, {
|
|
2586
2585
|
children: [
|
|
2587
2586
|
/* @__PURE__ */ jsxs9(MenubarSubTrigger, {
|
|
2588
2587
|
children: [
|
|
2589
|
-
/* @__PURE__ */
|
|
2588
|
+
/* @__PURE__ */ jsx15("span", {
|
|
2590
2589
|
className: "min-w-0 flex-1 truncate",
|
|
2591
2590
|
children: label
|
|
2592
2591
|
}),
|
|
2593
|
-
filters.some((filter) => filter.id === column.id) ? /* @__PURE__ */
|
|
2592
|
+
filters.some((filter) => filter.id === column.id) ? /* @__PURE__ */ jsx15(Check, {}) : null
|
|
2594
2593
|
]
|
|
2595
2594
|
}),
|
|
2596
|
-
/* @__PURE__ */
|
|
2595
|
+
/* @__PURE__ */ jsx15(MenubarSubContent, {
|
|
2597
2596
|
className: "w-80 max-w-[calc(100vw-2rem)]",
|
|
2598
|
-
children: /* @__PURE__ */
|
|
2597
|
+
children: /* @__PURE__ */ jsx15(FilterEditor, {
|
|
2599
2598
|
column,
|
|
2600
2599
|
rows: model.rows,
|
|
2601
2600
|
current: filters.find((filter) => filter.id === column.id),
|
|
@@ -2607,7 +2606,7 @@ var FilterMenu = ({
|
|
|
2607
2606
|
}, column.id)),
|
|
2608
2607
|
filters.length ? /* @__PURE__ */ jsxs9(Fragment, {
|
|
2609
2608
|
children: [
|
|
2610
|
-
/* @__PURE__ */
|
|
2609
|
+
/* @__PURE__ */ jsx15(MenubarSeparator, {}),
|
|
2611
2610
|
/* @__PURE__ */ jsxs9(MenubarItem, {
|
|
2612
2611
|
onClick: () => changeState(setStore, (state) => ({
|
|
2613
2612
|
...state,
|
|
@@ -2615,7 +2614,7 @@ var FilterMenu = ({
|
|
|
2615
2614
|
filters: undefined
|
|
2616
2615
|
})),
|
|
2617
2616
|
children: [
|
|
2618
|
-
/* @__PURE__ */
|
|
2617
|
+
/* @__PURE__ */ jsx15(X, {}),
|
|
2619
2618
|
store.config.labels.filtersClear
|
|
2620
2619
|
]
|
|
2621
2620
|
})
|
|
@@ -2651,29 +2650,29 @@ var SortMenu = ({
|
|
|
2651
2650
|
/* @__PURE__ */ jsxs9(MenubarTrigger, {
|
|
2652
2651
|
"aria-label": store.config.labels.sortBy,
|
|
2653
2652
|
children: [
|
|
2654
|
-
current ? current.direction === "desc" ? /* @__PURE__ */
|
|
2655
|
-
/* @__PURE__ */
|
|
2653
|
+
current ? current.direction === "desc" ? /* @__PURE__ */ jsx15(ArrowDown, {}) : /* @__PURE__ */ jsx15(ArrowUp, {}) : /* @__PURE__ */ jsx15(ChevronsUpDown, {}),
|
|
2654
|
+
/* @__PURE__ */ jsx15("span", {
|
|
2656
2655
|
className: "hidden sm:inline",
|
|
2657
2656
|
children: store.config.labels.sortBy
|
|
2658
2657
|
})
|
|
2659
2658
|
]
|
|
2660
2659
|
}),
|
|
2661
|
-
/* @__PURE__ */
|
|
2660
|
+
/* @__PURE__ */ jsx15(MenubarContent, {
|
|
2662
2661
|
align: "end",
|
|
2663
2662
|
className: "w-52",
|
|
2664
2663
|
children: /* @__PURE__ */ jsxs9(MenubarGroup, {
|
|
2665
2664
|
children: [
|
|
2666
|
-
/* @__PURE__ */
|
|
2665
|
+
/* @__PURE__ */ jsx15(MenubarLabel, {
|
|
2667
2666
|
children: store.config.labels.sortBy
|
|
2668
2667
|
}),
|
|
2669
|
-
/* @__PURE__ */
|
|
2668
|
+
/* @__PURE__ */ jsx15(MenubarSeparator, {}),
|
|
2670
2669
|
columns.map((column) => {
|
|
2671
2670
|
const sortState = store.state.sort?.find(({ id }) => id === column.id);
|
|
2672
2671
|
return /* @__PURE__ */ jsxs9(MenubarSub, {
|
|
2673
2672
|
children: [
|
|
2674
2673
|
/* @__PURE__ */ jsxs9(MenubarSubTrigger, {
|
|
2675
2674
|
children: [
|
|
2676
|
-
sortState ? sortState.direction === "desc" ? /* @__PURE__ */
|
|
2675
|
+
sortState ? sortState.direction === "desc" ? /* @__PURE__ */ jsx15(ArrowDown, {}) : /* @__PURE__ */ jsx15(ArrowUp, {}) : null,
|
|
2677
2676
|
columnLabel(column)
|
|
2678
2677
|
]
|
|
2679
2678
|
}),
|
|
@@ -2682,7 +2681,7 @@ var SortMenu = ({
|
|
|
2682
2681
|
/* @__PURE__ */ jsxs9(MenubarItem, {
|
|
2683
2682
|
onClick: () => sort(column.id, "asc"),
|
|
2684
2683
|
children: [
|
|
2685
|
-
/* @__PURE__ */
|
|
2684
|
+
/* @__PURE__ */ jsx15(ArrowUp, {}),
|
|
2686
2685
|
" ",
|
|
2687
2686
|
store.config.labels.sortAsc
|
|
2688
2687
|
]
|
|
@@ -2690,21 +2689,21 @@ var SortMenu = ({
|
|
|
2690
2689
|
/* @__PURE__ */ jsxs9(MenubarItem, {
|
|
2691
2690
|
onClick: () => sort(column.id, "desc"),
|
|
2692
2691
|
children: [
|
|
2693
|
-
/* @__PURE__ */
|
|
2692
|
+
/* @__PURE__ */ jsx15(ArrowDown, {}),
|
|
2694
2693
|
" ",
|
|
2695
2694
|
store.config.labels.sortDesc
|
|
2696
2695
|
]
|
|
2697
2696
|
}),
|
|
2698
2697
|
sortState ? /* @__PURE__ */ jsxs9(Fragment, {
|
|
2699
2698
|
children: [
|
|
2700
|
-
/* @__PURE__ */
|
|
2699
|
+
/* @__PURE__ */ jsx15(MenubarSeparator, {}),
|
|
2701
2700
|
/* @__PURE__ */ jsxs9(MenubarItem, {
|
|
2702
2701
|
onClick: () => changeState(setStore, (state) => ({
|
|
2703
2702
|
...state,
|
|
2704
2703
|
sort: state.sort?.filter(({ id }) => id !== column.id)
|
|
2705
2704
|
})),
|
|
2706
2705
|
children: [
|
|
2707
|
-
/* @__PURE__ */
|
|
2706
|
+
/* @__PURE__ */ jsx15(X, {}),
|
|
2708
2707
|
" ",
|
|
2709
2708
|
store.config.labels.sortClear
|
|
2710
2709
|
]
|
|
@@ -2731,21 +2730,21 @@ var ViewMenu = ({
|
|
|
2731
2730
|
/* @__PURE__ */ jsxs9(MenubarTrigger, {
|
|
2732
2731
|
"aria-label": store.config.labels.view,
|
|
2733
2732
|
children: [
|
|
2734
|
-
store.state.view === "gallery" ? /* @__PURE__ */
|
|
2735
|
-
/* @__PURE__ */
|
|
2733
|
+
store.state.view === "gallery" ? /* @__PURE__ */ jsx15(LayoutGrid, {}) : /* @__PURE__ */ jsx15(Rows3, {}),
|
|
2734
|
+
/* @__PURE__ */ jsx15("span", {
|
|
2736
2735
|
className: "hidden sm:inline",
|
|
2737
2736
|
children: store.config.labels.view
|
|
2738
2737
|
})
|
|
2739
2738
|
]
|
|
2740
2739
|
}),
|
|
2741
|
-
/* @__PURE__ */
|
|
2740
|
+
/* @__PURE__ */ jsx15(MenubarContent, {
|
|
2742
2741
|
align: "end",
|
|
2743
2742
|
children: /* @__PURE__ */ jsxs9(MenubarGroup, {
|
|
2744
2743
|
children: [
|
|
2745
|
-
/* @__PURE__ */
|
|
2744
|
+
/* @__PURE__ */ jsx15(MenubarLabel, {
|
|
2746
2745
|
children: store.config.labels.view
|
|
2747
2746
|
}),
|
|
2748
|
-
/* @__PURE__ */
|
|
2747
|
+
/* @__PURE__ */ jsx15(MenubarSeparator, {}),
|
|
2749
2748
|
/* @__PURE__ */ jsxs9(MenubarRadioGroup, {
|
|
2750
2749
|
onValueChange: (view) => {
|
|
2751
2750
|
if (view === "table" || view === "gallery") {
|
|
@@ -2757,7 +2756,7 @@ var ViewMenu = ({
|
|
|
2757
2756
|
/* @__PURE__ */ jsxs9(MenubarRadioItem, {
|
|
2758
2757
|
value: "table",
|
|
2759
2758
|
children: [
|
|
2760
|
-
/* @__PURE__ */
|
|
2759
|
+
/* @__PURE__ */ jsx15(Rows3, {}),
|
|
2761
2760
|
" ",
|
|
2762
2761
|
store.config.labels.tableView
|
|
2763
2762
|
]
|
|
@@ -2765,7 +2764,7 @@ var ViewMenu = ({
|
|
|
2765
2764
|
/* @__PURE__ */ jsxs9(MenubarRadioItem, {
|
|
2766
2765
|
value: "gallery",
|
|
2767
2766
|
children: [
|
|
2768
|
-
/* @__PURE__ */
|
|
2767
|
+
/* @__PURE__ */ jsx15(LayoutGrid, {}),
|
|
2769
2768
|
" ",
|
|
2770
2769
|
store.config.labels.galleryView
|
|
2771
2770
|
]
|
|
@@ -2790,22 +2789,22 @@ var ColumnMenu = ({
|
|
|
2790
2789
|
/* @__PURE__ */ jsxs9(MenubarTrigger, {
|
|
2791
2790
|
"aria-label": store.config.labels.columns,
|
|
2792
2791
|
children: [
|
|
2793
|
-
/* @__PURE__ */
|
|
2794
|
-
/* @__PURE__ */
|
|
2792
|
+
/* @__PURE__ */ jsx15(Settings2, {}),
|
|
2793
|
+
/* @__PURE__ */ jsx15("span", {
|
|
2795
2794
|
className: "hidden sm:inline",
|
|
2796
2795
|
children: store.config.labels.columns
|
|
2797
2796
|
})
|
|
2798
2797
|
]
|
|
2799
2798
|
}),
|
|
2800
|
-
/* @__PURE__ */
|
|
2799
|
+
/* @__PURE__ */ jsx15(MenubarContent, {
|
|
2801
2800
|
align: "end",
|
|
2802
2801
|
children: /* @__PURE__ */ jsxs9(MenubarGroup, {
|
|
2803
2802
|
children: [
|
|
2804
|
-
/* @__PURE__ */
|
|
2803
|
+
/* @__PURE__ */ jsx15(MenubarLabel, {
|
|
2805
2804
|
children: store.config.labels.columns
|
|
2806
2805
|
}),
|
|
2807
|
-
/* @__PURE__ */
|
|
2808
|
-
columns.map((column) => /* @__PURE__ */
|
|
2806
|
+
/* @__PURE__ */ jsx15(MenubarSeparator, {}),
|
|
2807
|
+
columns.map((column) => /* @__PURE__ */ jsx15(MenubarCheckboxItem, {
|
|
2809
2808
|
checked: store.state.columnVisibility[column.id] !== false,
|
|
2810
2809
|
onCheckedChange: (visible) => changeState(setStore, (state) => ({
|
|
2811
2810
|
...state,
|
|
@@ -2858,7 +2857,7 @@ var ResizeHandle = ({
|
|
|
2858
2857
|
const reset = () => {
|
|
2859
2858
|
resizeRef.current = null;
|
|
2860
2859
|
};
|
|
2861
|
-
return /* @__PURE__ */
|
|
2860
|
+
return /* @__PURE__ */ jsx15("button", {
|
|
2862
2861
|
"aria-label": store.config.labels.resizeColumn(columnLabel(column)),
|
|
2863
2862
|
"aria-orientation": "vertical",
|
|
2864
2863
|
"aria-valuemax": column.colDef.maxWidth ?? DEFAULT_MAX_WIDTH,
|
|
@@ -2982,7 +2981,7 @@ var DragHandle = ({
|
|
|
2982
2981
|
};
|
|
2983
2982
|
return /* @__PURE__ */ jsxs9(Fragment, {
|
|
2984
2983
|
children: [
|
|
2985
|
-
/* @__PURE__ */
|
|
2984
|
+
/* @__PURE__ */ jsx15(Button, {
|
|
2986
2985
|
"aria-label": store.config.features.reordering && store.config.features.reordering.handleLabel ? store.config.features.reordering.handleLabel : store.config.labels.reorder,
|
|
2987
2986
|
className: "size-8 cursor-grab touch-none active:cursor-grabbing",
|
|
2988
2987
|
onClick: (event) => event.stopPropagation(),
|
|
@@ -3000,9 +2999,9 @@ var DragHandle = ({
|
|
|
3000
2999
|
onPointerUp: finish,
|
|
3001
3000
|
size: "icon",
|
|
3002
3001
|
variant: "ghost",
|
|
3003
|
-
children: /* @__PURE__ */
|
|
3002
|
+
children: /* @__PURE__ */ jsx15(GripVertical, {})
|
|
3004
3003
|
}),
|
|
3005
|
-
overlay ? createPortal(/* @__PURE__ */
|
|
3004
|
+
overlay ? createPortal(/* @__PURE__ */ jsx15("div", {
|
|
3006
3005
|
"aria-hidden": "true",
|
|
3007
3006
|
className: "bg-background pointer-events-none fixed z-[100] rounded-md border px-3 py-2 text-sm shadow-lg",
|
|
3008
3007
|
style: { left: overlay.x + 12, top: overlay.y + 12 },
|
|
@@ -3045,36 +3044,36 @@ var TableDataRow = ({
|
|
|
3045
3044
|
},
|
|
3046
3045
|
tabIndex: store.config.onRowClicked ? 0 : undefined,
|
|
3047
3046
|
children: [
|
|
3048
|
-
selection ? /* @__PURE__ */
|
|
3047
|
+
selection ? /* @__PURE__ */ jsx15(TableCell, {
|
|
3049
3048
|
className: "w-10 pr-0",
|
|
3050
3049
|
onClick: (event) => event.stopPropagation(),
|
|
3051
|
-
children: /* @__PURE__ */
|
|
3050
|
+
children: /* @__PURE__ */ jsx15(Checkbox, {
|
|
3052
3051
|
"aria-label": store.config.labels.selectRow,
|
|
3053
3052
|
checked: !!store.state.rowSelection[row.id],
|
|
3054
3053
|
disabled: !selectable,
|
|
3055
3054
|
onCheckedChange: (checked) => toggleRow(store, setStore, row.id, checked)
|
|
3056
3055
|
})
|
|
3057
3056
|
}) : null,
|
|
3058
|
-
draggable ? /* @__PURE__ */
|
|
3057
|
+
draggable ? /* @__PURE__ */ jsx15(TableCell, {
|
|
3059
3058
|
className: "w-10 pr-0",
|
|
3060
|
-
children: /* @__PURE__ */
|
|
3059
|
+
children: /* @__PURE__ */ jsx15(DragHandle, {
|
|
3061
3060
|
tableAtom
|
|
3062
3061
|
})
|
|
3063
3062
|
}) : null,
|
|
3064
|
-
model.visibleColumns.map((column) => /* @__PURE__ */
|
|
3063
|
+
model.visibleColumns.map((column) => /* @__PURE__ */ jsx15(TableCell, {
|
|
3065
3064
|
className: cn("min-w-24 overflow-hidden has-[[data-slot=data-table-boolean-cell]]:relative has-[[data-slot=data-table-boolean-cell]]:p-0 has-[[data-slot=data-table-list-cell]]:relative has-[[data-slot=data-table-list-cell]]:p-0", column.colDef.truncate ? "whitespace-nowrap" : "whitespace-normal"),
|
|
3066
3065
|
style: { width: column.width },
|
|
3067
|
-
children: /* @__PURE__ */
|
|
3066
|
+
children: /* @__PURE__ */ jsx15("div", {
|
|
3068
3067
|
className: cn("min-w-0", column.colDef.truncate && "truncate"),
|
|
3069
3068
|
children: renderCell(row, column, store.config.locale, store.config.labels)
|
|
3070
3069
|
})
|
|
3071
3070
|
}, column.id)),
|
|
3072
|
-
hasRowActionMenu(store) ? /* @__PURE__ */
|
|
3071
|
+
hasRowActionMenu(store) ? /* @__PURE__ */ jsx15(TableCell, {
|
|
3073
3072
|
className: "bg-background group-data-[state=selected]/row:bg-muted sticky right-0 z-20 w-10 min-w-10 cursor-default p-0 transition-colors group-hover/row:bg-[color-mix(in_oklab,var(--muted)_50%,var(--background))]",
|
|
3074
3073
|
onClick: (event) => event.stopPropagation(),
|
|
3075
|
-
children: /* @__PURE__ */
|
|
3074
|
+
children: /* @__PURE__ */ jsx15("div", {
|
|
3076
3075
|
className: "flex h-16 items-center justify-center",
|
|
3077
|
-
children: /* @__PURE__ */
|
|
3076
|
+
children: /* @__PURE__ */ jsx15(DataTableRowActionMenu, {
|
|
3078
3077
|
tableAtom
|
|
3079
3078
|
})
|
|
3080
3079
|
})
|
|
@@ -3092,23 +3091,23 @@ var GroupActions = ({
|
|
|
3092
3091
|
return null;
|
|
3093
3092
|
return /* @__PURE__ */ jsxs9(DropdownMenu, {
|
|
3094
3093
|
children: [
|
|
3095
|
-
/* @__PURE__ */
|
|
3094
|
+
/* @__PURE__ */ jsx15(DropdownMenuTrigger, {
|
|
3096
3095
|
onClick: (event) => event.stopPropagation(),
|
|
3097
3096
|
render: /* @__PURE__ */ jsxs9(Button, {
|
|
3098
3097
|
size: "icon",
|
|
3099
3098
|
variant: "ghost",
|
|
3100
3099
|
children: [
|
|
3101
|
-
/* @__PURE__ */
|
|
3100
|
+
/* @__PURE__ */ jsx15("span", {
|
|
3102
3101
|
className: "sr-only",
|
|
3103
3102
|
children: title
|
|
3104
3103
|
}),
|
|
3105
|
-
/* @__PURE__ */
|
|
3104
|
+
/* @__PURE__ */ jsx15(MoreHorizontal, {})
|
|
3106
3105
|
]
|
|
3107
3106
|
})
|
|
3108
3107
|
}),
|
|
3109
|
-
/* @__PURE__ */
|
|
3108
|
+
/* @__PURE__ */ jsx15(DropdownMenuContent, {
|
|
3110
3109
|
align: "end",
|
|
3111
|
-
children: /* @__PURE__ */
|
|
3110
|
+
children: /* @__PURE__ */ jsx15(DropdownMenuGroup, {
|
|
3112
3111
|
children: visible.map((action) => /* @__PURE__ */ jsxs9(DropdownMenuItem, {
|
|
3113
3112
|
onClick: () => action.onClick(groupId),
|
|
3114
3113
|
variant: action.variant ?? "default",
|
|
@@ -3144,10 +3143,10 @@ var GroupedTable = ({
|
|
|
3144
3143
|
className: "data-[drop-target=true]:outline-primary relative data-[drop-target=true]:z-30 data-[drop-target=true]:outline-2 data-[drop-target=true]:-outline-offset-2 data-[drop-target=true]:[&>tr]:border-transparent data-[drop-target=true]:[&>tr>td:last-child]:z-0",
|
|
3145
3144
|
"data-table-group": section.field.onMoveToGroup ? targetKey : undefined,
|
|
3146
3145
|
children: [
|
|
3147
|
-
/* @__PURE__ */
|
|
3146
|
+
/* @__PURE__ */ jsx15(TableRow, {
|
|
3148
3147
|
className: "bg-muted/40 hover:bg-accent! cursor-pointer",
|
|
3149
3148
|
onClick: toggleCollapsed,
|
|
3150
|
-
children: /* @__PURE__ */
|
|
3149
|
+
children: /* @__PURE__ */ jsx15(TableCell, {
|
|
3151
3150
|
colSpan: model.visibleColumns.length + extra,
|
|
3152
3151
|
children: /* @__PURE__ */ jsxs9("div", {
|
|
3153
3152
|
className: "flex items-center gap-2",
|
|
@@ -3158,22 +3157,22 @@ var GroupedTable = ({
|
|
|
3158
3157
|
className: "flex flex-1 cursor-pointer items-center gap-2 text-left font-medium",
|
|
3159
3158
|
type: "button",
|
|
3160
3159
|
children: [
|
|
3161
|
-
collapsed ? /* @__PURE__ */
|
|
3160
|
+
collapsed ? /* @__PURE__ */ jsx15(ChevronRight2, {
|
|
3162
3161
|
className: "size-4"
|
|
3163
|
-
}) : /* @__PURE__ */
|
|
3162
|
+
}) : /* @__PURE__ */ jsx15(ChevronDown, {
|
|
3164
3163
|
className: "size-4"
|
|
3165
3164
|
}),
|
|
3166
|
-
/* @__PURE__ */
|
|
3165
|
+
/* @__PURE__ */ jsx15("span", {
|
|
3167
3166
|
className: "flex-1",
|
|
3168
3167
|
children: section.field.renderGroupLabel?.(section.groupId, section.rows.map((row) => row.data)) ?? section.groupId
|
|
3169
3168
|
})
|
|
3170
3169
|
]
|
|
3171
3170
|
}),
|
|
3172
|
-
/* @__PURE__ */
|
|
3171
|
+
/* @__PURE__ */ jsx15(Badge, {
|
|
3173
3172
|
variant: "secondary",
|
|
3174
3173
|
children: section.rows.length
|
|
3175
3174
|
}),
|
|
3176
|
-
/* @__PURE__ */
|
|
3175
|
+
/* @__PURE__ */ jsx15(GroupActions, {
|
|
3177
3176
|
actions: section.field.actions,
|
|
3178
3177
|
groupId: section.groupId,
|
|
3179
3178
|
title: section.field.actionsLabel ?? store.config.labels.actions
|
|
@@ -3182,14 +3181,14 @@ var GroupedTable = ({
|
|
|
3182
3181
|
})
|
|
3183
3182
|
})
|
|
3184
3183
|
}),
|
|
3185
|
-
!collapsed && !section.children.length ? section.rows.length ? section.rows.map((row) => /* @__PURE__ */
|
|
3184
|
+
!collapsed && !section.children.length ? section.rows.length ? section.rows.map((row) => /* @__PURE__ */ jsx15(RowIdContext.Provider, {
|
|
3186
3185
|
value: row.id,
|
|
3187
|
-
children: /* @__PURE__ */
|
|
3186
|
+
children: /* @__PURE__ */ jsx15(TableDataRow, {
|
|
3188
3187
|
tableAtom
|
|
3189
3188
|
})
|
|
3190
3189
|
}, `${section.key}:${row.id}`)) : [
|
|
3191
|
-
/* @__PURE__ */
|
|
3192
|
-
children: /* @__PURE__ */
|
|
3190
|
+
/* @__PURE__ */ jsx15(TableRow, {
|
|
3191
|
+
children: /* @__PURE__ */ jsx15(TableCell, {
|
|
3193
3192
|
className: "text-muted-foreground h-16",
|
|
3194
3193
|
colSpan: model.visibleColumns.length + extra,
|
|
3195
3194
|
children: section.field.renderEmptyGroup?.(section.groupId) ?? store.config.labels.empty
|
|
@@ -3200,7 +3199,7 @@ var GroupedTable = ({
|
|
|
3200
3199
|
}, section.key);
|
|
3201
3200
|
return !collapsed && section.children.length ? [body, renderSections(section.children)] : [body];
|
|
3202
3201
|
});
|
|
3203
|
-
return /* @__PURE__ */
|
|
3202
|
+
return /* @__PURE__ */ jsx15(Fragment, {
|
|
3204
3203
|
children: renderSections(sections)
|
|
3205
3204
|
});
|
|
3206
3205
|
};
|
|
@@ -3218,7 +3217,7 @@ var ColumnHeaderMenu = ({
|
|
|
3218
3217
|
const filteringEnabled = store.config.features.filtering !== false && filterColumns.length > 0;
|
|
3219
3218
|
const ownsFilter = (id) => id === column.id || getDataTableFieldColumns(column).some((field) => field.id === id);
|
|
3220
3219
|
const activeFilters = (store.state.filters ?? []).filter(({ id }) => ownsFilter(id));
|
|
3221
|
-
const filterEditor = (field) => /* @__PURE__ */
|
|
3220
|
+
const filterEditor = (field) => /* @__PURE__ */ jsx15(FilterEditor, {
|
|
3222
3221
|
column: field,
|
|
3223
3222
|
rows: model.rows,
|
|
3224
3223
|
current: store.state.filters?.find((filter) => filter.id === field.id),
|
|
@@ -3241,7 +3240,7 @@ var ColumnHeaderMenu = ({
|
|
|
3241
3240
|
/* @__PURE__ */ jsxs9(DropdownMenuItem, {
|
|
3242
3241
|
onClick: () => setSort(field.id, "asc"),
|
|
3243
3242
|
children: [
|
|
3244
|
-
/* @__PURE__ */
|
|
3243
|
+
/* @__PURE__ */ jsx15(ArrowUp, {}),
|
|
3245
3244
|
" ",
|
|
3246
3245
|
store.config.labels.sortAsc
|
|
3247
3246
|
]
|
|
@@ -3249,7 +3248,7 @@ var ColumnHeaderMenu = ({
|
|
|
3249
3248
|
/* @__PURE__ */ jsxs9(DropdownMenuItem, {
|
|
3250
3249
|
onClick: () => setSort(field.id, "desc"),
|
|
3251
3250
|
children: [
|
|
3252
|
-
/* @__PURE__ */
|
|
3251
|
+
/* @__PURE__ */ jsx15(ArrowDown, {}),
|
|
3253
3252
|
" ",
|
|
3254
3253
|
store.config.labels.sortDesc
|
|
3255
3254
|
]
|
|
@@ -3257,30 +3256,30 @@ var ColumnHeaderMenu = ({
|
|
|
3257
3256
|
]
|
|
3258
3257
|
});
|
|
3259
3258
|
if (!sortingEnabled && !hidingEnabled && !filteringEnabled) {
|
|
3260
|
-
return /* @__PURE__ */
|
|
3259
|
+
return /* @__PURE__ */ jsx15("div", {
|
|
3261
3260
|
className: "truncate px-2",
|
|
3262
3261
|
children: column.colDef.headerName
|
|
3263
3262
|
});
|
|
3264
3263
|
}
|
|
3265
3264
|
return /* @__PURE__ */ jsxs9(DropdownMenu, {
|
|
3266
3265
|
children: [
|
|
3267
|
-
/* @__PURE__ */
|
|
3266
|
+
/* @__PURE__ */ jsx15(DropdownMenuTrigger, {
|
|
3268
3267
|
render: /* @__PURE__ */ jsxs9(Button, {
|
|
3269
3268
|
"aria-label": label,
|
|
3270
3269
|
"aria-description": activeFilters.length ? `${store.config.labels.filters}: ${activeFilters.length}` : undefined,
|
|
3271
3270
|
className: "absolute inset-0 h-full w-full min-w-0 justify-start rounded-none px-2 pr-4 focus-visible:ring-inset",
|
|
3272
3271
|
variant: "ghost",
|
|
3273
3272
|
children: [
|
|
3274
|
-
/* @__PURE__ */
|
|
3273
|
+
/* @__PURE__ */ jsx15("span", {
|
|
3275
3274
|
className: "truncate",
|
|
3276
3275
|
children: column.colDef.headerName
|
|
3277
3276
|
}),
|
|
3278
|
-
activeFilters.length ? /* @__PURE__ */
|
|
3279
|
-
sort ? sort.direction === "desc" ? /* @__PURE__ */
|
|
3277
|
+
activeFilters.length ? /* @__PURE__ */ jsx15(ListFilter, {}) : null,
|
|
3278
|
+
sort ? sort.direction === "desc" ? /* @__PURE__ */ jsx15(ArrowDown, {}) : /* @__PURE__ */ jsx15(ArrowUp, {}) : null
|
|
3280
3279
|
]
|
|
3281
3280
|
})
|
|
3282
3281
|
}),
|
|
3283
|
-
/* @__PURE__ */
|
|
3282
|
+
/* @__PURE__ */ jsx15(DropdownMenuContent, {
|
|
3284
3283
|
align: "start",
|
|
3285
3284
|
className: "w-48",
|
|
3286
3285
|
children: /* @__PURE__ */ jsxs9(DropdownMenuGroup, {
|
|
@@ -3289,11 +3288,11 @@ var ColumnHeaderMenu = ({
|
|
|
3289
3288
|
children: [
|
|
3290
3289
|
column.colDef.fields?.length ? sortColumns.map((field) => /* @__PURE__ */ jsxs9(DropdownMenuSub, {
|
|
3291
3290
|
children: [
|
|
3292
|
-
/* @__PURE__ */
|
|
3291
|
+
/* @__PURE__ */ jsx15(DropdownMenuSubTrigger, {
|
|
3293
3292
|
children: columnLabel(field)
|
|
3294
3293
|
}),
|
|
3295
|
-
/* @__PURE__ */
|
|
3296
|
-
children: /* @__PURE__ */
|
|
3294
|
+
/* @__PURE__ */ jsx15(DropdownMenuSubContent, {
|
|
3295
|
+
children: /* @__PURE__ */ jsx15(DropdownMenuGroup, {
|
|
3297
3296
|
children: sortItems(field)
|
|
3298
3297
|
})
|
|
3299
3298
|
})
|
|
@@ -3305,36 +3304,36 @@ var ColumnHeaderMenu = ({
|
|
|
3305
3304
|
sort: state.sort?.filter(({ id }) => !ownsSort(id))
|
|
3306
3305
|
})),
|
|
3307
3306
|
children: [
|
|
3308
|
-
/* @__PURE__ */
|
|
3307
|
+
/* @__PURE__ */ jsx15(X, {}),
|
|
3309
3308
|
" ",
|
|
3310
3309
|
store.config.labels.sortClear
|
|
3311
3310
|
]
|
|
3312
3311
|
}) : null
|
|
3313
3312
|
]
|
|
3314
3313
|
}) : null,
|
|
3315
|
-
sortingEnabled && filteringEnabled ? /* @__PURE__ */
|
|
3314
|
+
sortingEnabled && filteringEnabled ? /* @__PURE__ */ jsx15(DropdownMenuSeparator, {}) : null,
|
|
3316
3315
|
filteringEnabled ? /* @__PURE__ */ jsxs9(Fragment, {
|
|
3317
3316
|
children: [
|
|
3318
3317
|
/* @__PURE__ */ jsxs9(DropdownMenuSub, {
|
|
3319
3318
|
children: [
|
|
3320
3319
|
/* @__PURE__ */ jsxs9(DropdownMenuSubTrigger, {
|
|
3321
3320
|
children: [
|
|
3322
|
-
/* @__PURE__ */
|
|
3321
|
+
/* @__PURE__ */ jsx15(ListFilter, {}),
|
|
3323
3322
|
store.config.labels.filters
|
|
3324
3323
|
]
|
|
3325
3324
|
}),
|
|
3326
|
-
/* @__PURE__ */
|
|
3325
|
+
/* @__PURE__ */ jsx15(DropdownMenuSubContent, {
|
|
3327
3326
|
className: "w-80 max-w-[calc(100vw-2rem)]",
|
|
3328
|
-
children: column.colDef.fields?.length ? /* @__PURE__ */
|
|
3327
|
+
children: column.colDef.fields?.length ? /* @__PURE__ */ jsx15(DropdownMenuGroup, {
|
|
3329
3328
|
children: filterColumns.map((field) => /* @__PURE__ */ jsxs9(DropdownMenuSub, {
|
|
3330
3329
|
children: [
|
|
3331
3330
|
/* @__PURE__ */ jsxs9(DropdownMenuSubTrigger, {
|
|
3332
3331
|
children: [
|
|
3333
3332
|
columnLabel(field),
|
|
3334
|
-
activeFilters.some((filter) => filter.id === field.id) ? /* @__PURE__ */
|
|
3333
|
+
activeFilters.some((filter) => filter.id === field.id) ? /* @__PURE__ */ jsx15(Check, {}) : null
|
|
3335
3334
|
]
|
|
3336
3335
|
}),
|
|
3337
|
-
/* @__PURE__ */
|
|
3336
|
+
/* @__PURE__ */ jsx15(DropdownMenuSubContent, {
|
|
3338
3337
|
className: "w-80 max-w-[calc(100vw-2rem)]",
|
|
3339
3338
|
children: filterEditor(field)
|
|
3340
3339
|
})
|
|
@@ -3354,13 +3353,13 @@ var ColumnHeaderMenu = ({
|
|
|
3354
3353
|
};
|
|
3355
3354
|
}),
|
|
3356
3355
|
children: [
|
|
3357
|
-
/* @__PURE__ */
|
|
3356
|
+
/* @__PURE__ */ jsx15(X, {}),
|
|
3358
3357
|
store.config.labels.filterClear
|
|
3359
3358
|
]
|
|
3360
3359
|
}) : null
|
|
3361
3360
|
]
|
|
3362
3361
|
}) : null,
|
|
3363
|
-
(sortingEnabled || filteringEnabled) && hidingEnabled ? /* @__PURE__ */
|
|
3362
|
+
(sortingEnabled || filteringEnabled) && hidingEnabled ? /* @__PURE__ */ jsx15(DropdownMenuSeparator, {}) : null,
|
|
3364
3363
|
hidingEnabled ? /* @__PURE__ */ jsxs9(DropdownMenuItem, {
|
|
3365
3364
|
onClick: () => update((state) => ({
|
|
3366
3365
|
...state,
|
|
@@ -3370,7 +3369,7 @@ var ColumnHeaderMenu = ({
|
|
|
3370
3369
|
}
|
|
3371
3370
|
})),
|
|
3372
3371
|
children: [
|
|
3373
|
-
/* @__PURE__ */
|
|
3372
|
+
/* @__PURE__ */ jsx15(EyeOff, {}),
|
|
3374
3373
|
" ",
|
|
3375
3374
|
store.config.labels.hideColumn
|
|
3376
3375
|
]
|
|
@@ -3392,12 +3391,12 @@ var DataTableHeader = ({
|
|
|
3392
3391
|
const selectableRows = getDataTableSelectableRows(model, grouped, selection ? selection.isRowSelectable : undefined);
|
|
3393
3392
|
const allSelected = selectableRows.length > 0 && selectableRows.every((row) => store.state.rowSelection[row.id]);
|
|
3394
3393
|
const someSelected = selectableRows.some((row) => store.state.rowSelection[row.id]);
|
|
3395
|
-
return /* @__PURE__ */
|
|
3394
|
+
return /* @__PURE__ */ jsx15(TableHeader, {
|
|
3396
3395
|
children: /* @__PURE__ */ jsxs9(TableRow, {
|
|
3397
3396
|
children: [
|
|
3398
|
-
selection ? /* @__PURE__ */
|
|
3397
|
+
selection ? /* @__PURE__ */ jsx15(TableHead, {
|
|
3399
3398
|
className: "w-10 pr-0",
|
|
3400
|
-
children: /* @__PURE__ */
|
|
3399
|
+
children: /* @__PURE__ */ jsx15(Checkbox, {
|
|
3401
3400
|
"aria-label": store.config.labels.selectAllRows,
|
|
3402
3401
|
checked: allSelected,
|
|
3403
3402
|
indeterminate: someSelected && !allSelected,
|
|
@@ -3411,12 +3410,12 @@ var DataTableHeader = ({
|
|
|
3411
3410
|
}
|
|
3412
3411
|
})
|
|
3413
3412
|
}) : null,
|
|
3414
|
-
draggable ? /* @__PURE__ */
|
|
3413
|
+
draggable ? /* @__PURE__ */ jsx15(TableHead, {
|
|
3415
3414
|
className: "w-10"
|
|
3416
3415
|
}) : null,
|
|
3417
3416
|
model.visibleColumns.map((column) => {
|
|
3418
3417
|
const direction = store.state.sort?.find(({ id }) => id === column.id)?.direction;
|
|
3419
|
-
return /* @__PURE__ */
|
|
3418
|
+
return /* @__PURE__ */ jsx15(TableHead, {
|
|
3420
3419
|
"aria-sort": direction === "asc" ? "ascending" : direction === "desc" ? "descending" : undefined,
|
|
3421
3420
|
className: "relative h-12 p-0",
|
|
3422
3421
|
scope: "col",
|
|
@@ -3424,17 +3423,17 @@ var DataTableHeader = ({
|
|
|
3424
3423
|
children: /* @__PURE__ */ jsxs9(ColumnIdContext.Provider, {
|
|
3425
3424
|
value: column.id,
|
|
3426
3425
|
children: [
|
|
3427
|
-
/* @__PURE__ */
|
|
3426
|
+
/* @__PURE__ */ jsx15(ColumnHeaderMenu, {
|
|
3428
3427
|
tableAtom
|
|
3429
3428
|
}),
|
|
3430
|
-
/* @__PURE__ */
|
|
3429
|
+
/* @__PURE__ */ jsx15(ResizeHandle, {
|
|
3431
3430
|
tableAtom
|
|
3432
3431
|
})
|
|
3433
3432
|
]
|
|
3434
3433
|
})
|
|
3435
3434
|
}, column.id);
|
|
3436
3435
|
}),
|
|
3437
|
-
hasRowActionMenu(store) ? /* @__PURE__ */
|
|
3436
|
+
hasRowActionMenu(store) ? /* @__PURE__ */ jsx15(TableHead, {
|
|
3438
3437
|
className: "w-10"
|
|
3439
3438
|
}) : null
|
|
3440
3439
|
]
|
|
@@ -3452,29 +3451,29 @@ var DataTableBody = ({
|
|
|
3452
3451
|
const sections = groupDataTableRows(rows, fields);
|
|
3453
3452
|
const colSpan = model.visibleColumns.length + (store.config.features.selection ? 1 : 0) + (hasRowActionMenu(store) ? 1 : 0) + (canDragRows(store) ? 1 : 0);
|
|
3454
3453
|
if (sections.length && (rows.length || !store.config.status.loading) && !store.config.status.error) {
|
|
3455
|
-
return /* @__PURE__ */
|
|
3454
|
+
return /* @__PURE__ */ jsx15(GroupedTable, {
|
|
3456
3455
|
tableAtom,
|
|
3457
3456
|
sections
|
|
3458
3457
|
});
|
|
3459
3458
|
}
|
|
3460
|
-
return /* @__PURE__ */
|
|
3461
|
-
children: store.config.status.error || !rows.length && !store.config.status.loading ? /* @__PURE__ */
|
|
3462
|
-
children: /* @__PURE__ */
|
|
3459
|
+
return /* @__PURE__ */ jsx15(TableBody, {
|
|
3460
|
+
children: store.config.status.error || !rows.length && !store.config.status.loading ? /* @__PURE__ */ jsx15(TableRow, {
|
|
3461
|
+
children: /* @__PURE__ */ jsx15(TableCell, {
|
|
3463
3462
|
className: "h-24 text-center",
|
|
3464
3463
|
colSpan: Math.max(colSpan, 1),
|
|
3465
3464
|
children: store.config.status.error ?? store.config.status.empty ?? store.config.labels.empty
|
|
3466
3465
|
})
|
|
3467
|
-
}) : store.config.status.loading && !rows.length ? /* @__PURE__ */
|
|
3468
|
-
children: /* @__PURE__ */
|
|
3466
|
+
}) : store.config.status.loading && !rows.length ? /* @__PURE__ */ jsx15(TableRow, {
|
|
3467
|
+
children: /* @__PURE__ */ jsx15(TableCell, {
|
|
3469
3468
|
className: "h-24 text-center",
|
|
3470
3469
|
colSpan: Math.max(colSpan, 1),
|
|
3471
|
-
children: /* @__PURE__ */
|
|
3470
|
+
children: /* @__PURE__ */ jsx15(Loading, {
|
|
3472
3471
|
label: store.config.labels.loading
|
|
3473
3472
|
})
|
|
3474
3473
|
})
|
|
3475
|
-
}) : rows.map((row) => /* @__PURE__ */
|
|
3474
|
+
}) : rows.map((row) => /* @__PURE__ */ jsx15(RowIdContext.Provider, {
|
|
3476
3475
|
value: row.id,
|
|
3477
|
-
children: /* @__PURE__ */
|
|
3476
|
+
children: /* @__PURE__ */ jsx15(TableDataRow, {
|
|
3478
3477
|
tableAtom
|
|
3479
3478
|
})
|
|
3480
3479
|
}, row.id))
|
|
@@ -3497,7 +3496,7 @@ var GalleryCard = ({
|
|
|
3497
3496
|
const selection = store.config.features.selection;
|
|
3498
3497
|
const selectable = !!selection && (selection.isRowSelectable?.(row.data) ?? true);
|
|
3499
3498
|
const draggable = canDragRows(store);
|
|
3500
|
-
return /* @__PURE__ */
|
|
3499
|
+
return /* @__PURE__ */ jsx15(Card, {
|
|
3501
3500
|
className: cn("data-[drop-position=before]:border-t-primary data-[drop-position=after]:border-b-primary relative gap-3 data-[drag-source=true]:opacity-40 data-[drop-position=after]:border-b-2 data-[drop-position=before]:border-t-2", store.config.onRowClicked && "cursor-pointer"),
|
|
3502
3501
|
"data-table-row": row.id,
|
|
3503
3502
|
onClick: () => store.config.onRowClicked?.(row.data),
|
|
@@ -3514,14 +3513,14 @@ var GalleryCard = ({
|
|
|
3514
3513
|
/* @__PURE__ */ jsxs9("div", {
|
|
3515
3514
|
className: "flex items-center gap-2",
|
|
3516
3515
|
children: [
|
|
3517
|
-
selection ? /* @__PURE__ */
|
|
3516
|
+
selection ? /* @__PURE__ */ jsx15(Checkbox, {
|
|
3518
3517
|
"aria-label": store.config.labels.selectRow,
|
|
3519
3518
|
checked: !!store.state.rowSelection[row.id],
|
|
3520
3519
|
disabled: !selectable,
|
|
3521
3520
|
onCheckedChange: (checked) => toggleRow(store, setStore, row.id, checked),
|
|
3522
3521
|
onClick: (event) => event.stopPropagation()
|
|
3523
3522
|
}) : null,
|
|
3524
|
-
draggable ? /* @__PURE__ */
|
|
3523
|
+
draggable ? /* @__PURE__ */ jsx15(DragHandle, {
|
|
3525
3524
|
tableAtom
|
|
3526
3525
|
}) : null,
|
|
3527
3526
|
tag ? /* @__PURE__ */ jsxs9(Badge, {
|
|
@@ -3533,17 +3532,17 @@ var GalleryCard = ({
|
|
|
3533
3532
|
}) : null
|
|
3534
3533
|
]
|
|
3535
3534
|
}),
|
|
3536
|
-
/* @__PURE__ */
|
|
3535
|
+
/* @__PURE__ */ jsx15(CardTitle, {
|
|
3537
3536
|
children: name ? renderCell(row, name, store.config.locale, store.config.labels) : row.id
|
|
3538
3537
|
}),
|
|
3539
|
-
description ? /* @__PURE__ */
|
|
3538
|
+
description ? /* @__PURE__ */ jsx15("div", {
|
|
3540
3539
|
className: "text-muted-foreground line-clamp-3 text-sm",
|
|
3541
3540
|
children: renderCell(row, description, store.config.locale, store.config.labels)
|
|
3542
3541
|
}) : null,
|
|
3543
|
-
hasRowActionMenu(store) ? /* @__PURE__ */
|
|
3542
|
+
hasRowActionMenu(store) ? /* @__PURE__ */ jsx15("div", {
|
|
3544
3543
|
className: "absolute top-4 right-4",
|
|
3545
3544
|
onClick: (event) => event.stopPropagation(),
|
|
3546
|
-
children: /* @__PURE__ */
|
|
3545
|
+
children: /* @__PURE__ */ jsx15(DataTableRowActionMenu, {
|
|
3547
3546
|
tableAtom
|
|
3548
3547
|
})
|
|
3549
3548
|
}) : null
|
|
@@ -3560,37 +3559,37 @@ var DataTableGallery = ({
|
|
|
3560
3559
|
const rows = fields.length ? model.sortedRows : model.pageRows;
|
|
3561
3560
|
const sections = groupDataTableRows(rows, fields);
|
|
3562
3561
|
if (store.config.status.error) {
|
|
3563
|
-
return /* @__PURE__ */
|
|
3562
|
+
return /* @__PURE__ */ jsx15("div", {
|
|
3564
3563
|
className: "text-destructive rounded-lg border border-dashed p-10 text-center",
|
|
3565
3564
|
children: store.config.status.error
|
|
3566
3565
|
});
|
|
3567
3566
|
}
|
|
3568
3567
|
if (store.config.status.loading && !rows.length) {
|
|
3569
|
-
return /* @__PURE__ */
|
|
3568
|
+
return /* @__PURE__ */ jsx15("div", {
|
|
3570
3569
|
className: "rounded-lg border border-dashed p-10 text-center",
|
|
3571
|
-
children: /* @__PURE__ */
|
|
3570
|
+
children: /* @__PURE__ */ jsx15(Loading, {
|
|
3572
3571
|
label: store.config.labels.loading
|
|
3573
3572
|
})
|
|
3574
3573
|
});
|
|
3575
3574
|
}
|
|
3576
3575
|
if (!rows.length && !sections.length) {
|
|
3577
|
-
return /* @__PURE__ */
|
|
3576
|
+
return /* @__PURE__ */ jsx15("div", {
|
|
3578
3577
|
className: "text-muted-foreground rounded-lg border border-dashed p-10 text-center",
|
|
3579
3578
|
children: store.config.status.empty ?? store.config.labels.empty
|
|
3580
3579
|
});
|
|
3581
3580
|
}
|
|
3582
3581
|
if (!fields.length) {
|
|
3583
|
-
return /* @__PURE__ */
|
|
3582
|
+
return /* @__PURE__ */ jsx15("div", {
|
|
3584
3583
|
className: "grid gap-3 sm:grid-cols-2 xl:grid-cols-3",
|
|
3585
|
-
children: rows.map((row) => /* @__PURE__ */
|
|
3584
|
+
children: rows.map((row) => /* @__PURE__ */ jsx15(RowIdContext.Provider, {
|
|
3586
3585
|
value: row.id,
|
|
3587
|
-
children: /* @__PURE__ */
|
|
3586
|
+
children: /* @__PURE__ */ jsx15(GalleryCard, {
|
|
3588
3587
|
tableAtom
|
|
3589
3588
|
})
|
|
3590
3589
|
}, row.id))
|
|
3591
3590
|
});
|
|
3592
3591
|
}
|
|
3593
|
-
const renderSections = (
|
|
3592
|
+
const renderSections = (sections) => sections.map((section) => {
|
|
3594
3593
|
const collapsed = !!store.state.collapsedGroups[section.key];
|
|
3595
3594
|
const targetKey = getGroupDropKey(section.field.id, section.groupId);
|
|
3596
3595
|
const toggleCollapsed = () => changeState(setStore, (state) => ({
|
|
@@ -3613,44 +3612,44 @@ var DataTableGallery = ({
|
|
|
3613
3612
|
className: "flex flex-1 cursor-pointer items-center gap-2 text-left font-medium",
|
|
3614
3613
|
type: "button",
|
|
3615
3614
|
children: [
|
|
3616
|
-
collapsed ? /* @__PURE__ */
|
|
3615
|
+
collapsed ? /* @__PURE__ */ jsx15(ChevronRight2, {
|
|
3617
3616
|
className: "size-4"
|
|
3618
|
-
}) : /* @__PURE__ */
|
|
3617
|
+
}) : /* @__PURE__ */ jsx15(ChevronDown, {
|
|
3619
3618
|
className: "size-4"
|
|
3620
3619
|
}),
|
|
3621
|
-
/* @__PURE__ */
|
|
3620
|
+
/* @__PURE__ */ jsx15("span", {
|
|
3622
3621
|
className: "flex-1",
|
|
3623
3622
|
children: section.field.renderGroupLabel?.(section.groupId, section.rows.map((row) => row.data)) ?? section.groupId
|
|
3624
3623
|
}),
|
|
3625
|
-
/* @__PURE__ */
|
|
3624
|
+
/* @__PURE__ */ jsx15(Badge, {
|
|
3626
3625
|
variant: "secondary",
|
|
3627
3626
|
children: section.rows.length
|
|
3628
3627
|
})
|
|
3629
3628
|
]
|
|
3630
3629
|
}),
|
|
3631
|
-
/* @__PURE__ */
|
|
3630
|
+
/* @__PURE__ */ jsx15(GroupActions, {
|
|
3632
3631
|
actions: section.field.actions,
|
|
3633
3632
|
groupId: section.groupId,
|
|
3634
3633
|
title: section.field.actionsLabel ?? store.config.labels.actions
|
|
3635
3634
|
})
|
|
3636
3635
|
]
|
|
3637
3636
|
}),
|
|
3638
|
-
!collapsed ? section.children.length ? renderSections(section.children) : section.rows.length ? /* @__PURE__ */
|
|
3637
|
+
!collapsed ? section.children.length ? renderSections(section.children) : section.rows.length ? /* @__PURE__ */ jsx15("div", {
|
|
3639
3638
|
className: "grid gap-3 sm:grid-cols-2 xl:grid-cols-3",
|
|
3640
|
-
children: section.rows.map((row) => /* @__PURE__ */
|
|
3639
|
+
children: section.rows.map((row) => /* @__PURE__ */ jsx15(RowIdContext.Provider, {
|
|
3641
3640
|
value: row.id,
|
|
3642
|
-
children: /* @__PURE__ */
|
|
3641
|
+
children: /* @__PURE__ */ jsx15(GalleryCard, {
|
|
3643
3642
|
tableAtom
|
|
3644
3643
|
})
|
|
3645
3644
|
}, `${section.key}:${row.id}`))
|
|
3646
|
-
}) : /* @__PURE__ */
|
|
3645
|
+
}) : /* @__PURE__ */ jsx15("div", {
|
|
3647
3646
|
className: "text-muted-foreground rounded-lg border border-dashed p-8 text-center",
|
|
3648
3647
|
children: section.field.renderEmptyGroup?.(section.groupId) ?? store.config.labels.empty
|
|
3649
3648
|
}) : null
|
|
3650
3649
|
]
|
|
3651
3650
|
}, section.key);
|
|
3652
3651
|
});
|
|
3653
|
-
return /* @__PURE__ */
|
|
3652
|
+
return /* @__PURE__ */ jsx15("div", {
|
|
3654
3653
|
className: "space-y-4",
|
|
3655
3654
|
children: renderSections(sections)
|
|
3656
3655
|
});
|
|
@@ -3677,9 +3676,9 @@ var DataTablePagination = ({
|
|
|
3677
3676
|
return null;
|
|
3678
3677
|
const selected = model.rows.filter((row) => store.state.rowSelection[row.id]).length;
|
|
3679
3678
|
const setPagination = (next) => changeState(setStore, (state) => ({ ...state, ...next }));
|
|
3680
|
-
return /* @__PURE__ */
|
|
3679
|
+
return /* @__PURE__ */ jsx15("div", {
|
|
3681
3680
|
className: "pt-4",
|
|
3682
|
-
children: /* @__PURE__ */
|
|
3681
|
+
children: /* @__PURE__ */ jsx15(Pagination, {
|
|
3683
3682
|
locale: store.config.locale,
|
|
3684
3683
|
messages: { [store.config.locale]: store.config.labels },
|
|
3685
3684
|
onPageChange: (page) => setPagination({ page, pageSize: store.state.pageSize }),
|
|
@@ -3735,7 +3734,7 @@ var HydratedDataTable = ({
|
|
|
3735
3734
|
const config = {
|
|
3736
3735
|
getRowId: selection && selection.getRowId || props.getRowId || undefined,
|
|
3737
3736
|
onStateChange: props.onStateChange,
|
|
3738
|
-
onUiStateChange: (
|
|
3737
|
+
onUiStateChange: (state) => setUiState(state),
|
|
3739
3738
|
status: props.status ?? {},
|
|
3740
3739
|
features,
|
|
3741
3740
|
onRowClicked: props.onRowClicked,
|
|
@@ -3777,13 +3776,13 @@ var HydratedDataTable = ({
|
|
|
3777
3776
|
className: "w-full max-w-full min-w-0 rounded-md",
|
|
3778
3777
|
"data-table-root": "",
|
|
3779
3778
|
children: [
|
|
3780
|
-
/* @__PURE__ */
|
|
3779
|
+
/* @__PURE__ */ jsx15(DataTableToolbar, {
|
|
3781
3780
|
tableAtom
|
|
3782
3781
|
}),
|
|
3783
|
-
/* @__PURE__ */
|
|
3782
|
+
/* @__PURE__ */ jsx15(DataTableContent, {
|
|
3784
3783
|
tableAtom
|
|
3785
3784
|
}),
|
|
3786
|
-
/* @__PURE__ */
|
|
3785
|
+
/* @__PURE__ */ jsx15(DataTablePagination, {
|
|
3787
3786
|
tableAtom
|
|
3788
3787
|
})
|
|
3789
3788
|
]
|
|
@@ -3816,13 +3815,13 @@ var DataTable = (props) => {
|
|
|
3816
3815
|
}
|
|
3817
3816
|
} : undefined, [initialColumnVisibility, persistedUiResult]);
|
|
3818
3817
|
if (!persistedUiState || AsyncResult.isWaiting(persistedUiResult)) {
|
|
3819
|
-
return /* @__PURE__ */
|
|
3818
|
+
return /* @__PURE__ */ jsx15("div", {
|
|
3820
3819
|
"aria-busy": "true",
|
|
3821
3820
|
className: "invisible w-full max-w-full min-w-0 rounded-md",
|
|
3822
3821
|
"data-table-root": ""
|
|
3823
3822
|
});
|
|
3824
3823
|
}
|
|
3825
|
-
return /* @__PURE__ */
|
|
3824
|
+
return /* @__PURE__ */ jsx15(HydratedDataTable, {
|
|
3826
3825
|
...props,
|
|
3827
3826
|
locale,
|
|
3828
3827
|
persistedUiState,
|
|
@@ -3834,7 +3833,7 @@ var DataTableContent = ({
|
|
|
3834
3833
|
}) => {
|
|
3835
3834
|
const [store] = useTableAtom(tableAtom);
|
|
3836
3835
|
if (store.config.features.gallery && store.state.view === "gallery") {
|
|
3837
|
-
return /* @__PURE__ */
|
|
3836
|
+
return /* @__PURE__ */ jsx15(DataTableGallery, {
|
|
3838
3837
|
tableAtom
|
|
3839
3838
|
});
|
|
3840
3839
|
}
|
|
@@ -3847,15 +3846,15 @@ var DataTableContent = ({
|
|
|
3847
3846
|
className: "table-fixed",
|
|
3848
3847
|
style: { width: `max(100%, ${width}px)` },
|
|
3849
3848
|
children: [
|
|
3850
|
-
/* @__PURE__ */
|
|
3849
|
+
/* @__PURE__ */ jsx15(DataTableHeader, {
|
|
3851
3850
|
tableAtom
|
|
3852
3851
|
}),
|
|
3853
|
-
/* @__PURE__ */
|
|
3852
|
+
/* @__PURE__ */ jsx15(DataTableBody, {
|
|
3854
3853
|
tableAtom
|
|
3855
3854
|
})
|
|
3856
3855
|
]
|
|
3857
3856
|
}),
|
|
3858
|
-
/* @__PURE__ */
|
|
3857
|
+
/* @__PURE__ */ jsx15(ScrollBar, {
|
|
3859
3858
|
orientation: "horizontal"
|
|
3860
3859
|
})
|
|
3861
3860
|
]
|
|
@@ -3865,25 +3864,25 @@ var DataTableListCell = (props) => {
|
|
|
3865
3864
|
const locale = useKrakstackLocale3(props.locale);
|
|
3866
3865
|
const resolvedProps = { ...props, locale };
|
|
3867
3866
|
if (resolvedProps.options && (resolvedProps.onAdd || resolvedProps.onRemove)) {
|
|
3868
|
-
return /* @__PURE__ */
|
|
3867
|
+
return /* @__PURE__ */ jsx15(EditableDataTableListCell, {
|
|
3869
3868
|
...resolvedProps
|
|
3870
3869
|
});
|
|
3871
3870
|
}
|
|
3872
3871
|
const { actionsLabel, itemActions, onItemClick, ...summaryProps } = resolvedProps;
|
|
3873
|
-
const
|
|
3872
|
+
const labels = dataTableMessages(locale, resolvedProps.messages);
|
|
3874
3873
|
const hasItems = resolvedProps.items.length > 0;
|
|
3875
3874
|
if (!itemActions?.length && !hasItems) {
|
|
3876
|
-
return /* @__PURE__ */
|
|
3875
|
+
return /* @__PURE__ */ jsx15(DataTableListSummary, {
|
|
3877
3876
|
...summaryProps
|
|
3878
3877
|
});
|
|
3879
3878
|
}
|
|
3880
|
-
const menuLabel = actionsLabel ?? (itemActions?.length ?
|
|
3881
|
-
return /* @__PURE__ */
|
|
3879
|
+
const menuLabel = actionsLabel ?? (itemActions?.length ? labels.actions : labels.listDetails);
|
|
3880
|
+
return /* @__PURE__ */ jsx15("div", {
|
|
3882
3881
|
className: "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",
|
|
3883
3882
|
"data-slot": "data-table-list-cell",
|
|
3884
3883
|
onClick: (event) => event.stopPropagation(),
|
|
3885
3884
|
onPointerDown: (event) => event.stopPropagation(),
|
|
3886
|
-
children: /* @__PURE__ */
|
|
3885
|
+
children: /* @__PURE__ */ jsx15(DataTableListMenu, {
|
|
3887
3886
|
actions: itemActions ?? [],
|
|
3888
3887
|
display: resolvedProps.display,
|
|
3889
3888
|
force: hasItems,
|
|
@@ -3897,11 +3896,11 @@ var DataTableListCell = (props) => {
|
|
|
3897
3896
|
className: "h-full w-full min-w-0 justify-between rounded-none px-2 focus-visible:ring-inset",
|
|
3898
3897
|
variant: "ghost",
|
|
3899
3898
|
children: [
|
|
3900
|
-
/* @__PURE__ */
|
|
3899
|
+
/* @__PURE__ */ jsx15(DataTableListSummaryContent, {
|
|
3901
3900
|
...summaryProps,
|
|
3902
3901
|
showMenu: false
|
|
3903
3902
|
}),
|
|
3904
|
-
/* @__PURE__ */
|
|
3903
|
+
/* @__PURE__ */ jsx15(ChevronDown, {})
|
|
3905
3904
|
]
|
|
3906
3905
|
})
|
|
3907
3906
|
})
|
|
@@ -3921,7 +3920,7 @@ var EditableDataTableListCell = ({
|
|
|
3921
3920
|
itemActions,
|
|
3922
3921
|
onItemClick,
|
|
3923
3922
|
locale = "en",
|
|
3924
|
-
messages
|
|
3923
|
+
messages
|
|
3925
3924
|
}) => {
|
|
3926
3925
|
const [selected, setSelected] = useState([...items]);
|
|
3927
3926
|
const [previousItems, setPreviousItems] = useState(items);
|
|
@@ -3933,15 +3932,15 @@ var EditableDataTableListCell = ({
|
|
|
3933
3932
|
const available = options.filter((item) => !selectedValues.has(item.value));
|
|
3934
3933
|
const canAdd = !!onAdd && available.length > 0;
|
|
3935
3934
|
const selectedTotal = totalCount === undefined ? selected.length : totalCount + selected.length - items.length;
|
|
3936
|
-
const
|
|
3935
|
+
const labels = dataTableMessages(locale, messages);
|
|
3937
3936
|
const actions = [
|
|
3938
3937
|
...itemActions ?? [],
|
|
3939
3938
|
...onRemove ? [
|
|
3940
3939
|
{
|
|
3941
3940
|
id: "data-table-list-remove",
|
|
3942
3941
|
closeOnClick: false,
|
|
3943
|
-
name:
|
|
3944
|
-
icon: /* @__PURE__ */
|
|
3942
|
+
name: labels.removeItem,
|
|
3943
|
+
icon: /* @__PURE__ */ jsx15(Trash2, {}),
|
|
3945
3944
|
variant: "destructive",
|
|
3946
3945
|
onClick: (item) => {
|
|
3947
3946
|
if (item.value === undefined)
|
|
@@ -3952,15 +3951,15 @@ var EditableDataTableListCell = ({
|
|
|
3952
3951
|
}
|
|
3953
3952
|
] : []
|
|
3954
3953
|
];
|
|
3955
|
-
return /* @__PURE__ */
|
|
3954
|
+
return /* @__PURE__ */ jsx15("div", {
|
|
3956
3955
|
"data-slot": "data-table-list-cell",
|
|
3957
3956
|
className: "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",
|
|
3958
3957
|
onClick: (event) => event.stopPropagation(),
|
|
3959
3958
|
onPointerDown: (event) => event.stopPropagation(),
|
|
3960
|
-
children: /* @__PURE__ */
|
|
3959
|
+
children: /* @__PURE__ */ jsx15(DataTableListMenu, {
|
|
3961
3960
|
actions,
|
|
3962
3961
|
addEmptyLabel: emptyLabel,
|
|
3963
|
-
addLabel:
|
|
3962
|
+
addLabel: labels.addItem,
|
|
3964
3963
|
addOptions: canAdd ? available : undefined,
|
|
3965
3964
|
addSearchLabel: manageLabel,
|
|
3966
3965
|
display,
|
|
@@ -3969,7 +3968,7 @@ var EditableDataTableListCell = ({
|
|
|
3969
3968
|
onItemClick,
|
|
3970
3969
|
label: actionsLabel ?? manageLabel,
|
|
3971
3970
|
locale,
|
|
3972
|
-
messages
|
|
3971
|
+
messages,
|
|
3973
3972
|
onAdd: canAdd ? (item) => {
|
|
3974
3973
|
onAdd(item.value);
|
|
3975
3974
|
setSelected((current) => [...current, item]);
|
|
@@ -3979,7 +3978,7 @@ var EditableDataTableListCell = ({
|
|
|
3979
3978
|
className: "h-full w-full min-w-0 justify-between rounded-none px-2 focus-visible:ring-inset",
|
|
3980
3979
|
variant: "ghost",
|
|
3981
3980
|
children: [
|
|
3982
|
-
/* @__PURE__ */
|
|
3981
|
+
/* @__PURE__ */ jsx15(DataTableListSummaryContent, {
|
|
3983
3982
|
emptyLabel,
|
|
3984
3983
|
items: selected,
|
|
3985
3984
|
display,
|
|
@@ -3987,7 +3986,7 @@ var EditableDataTableListCell = ({
|
|
|
3987
3986
|
visibleCount,
|
|
3988
3987
|
totalCount: selectedTotal
|
|
3989
3988
|
}),
|
|
3990
|
-
/* @__PURE__ */
|
|
3989
|
+
/* @__PURE__ */ jsx15(ChevronDown, {})
|
|
3991
3990
|
]
|
|
3992
3991
|
})
|
|
3993
3992
|
})
|
|
@@ -4005,7 +4004,7 @@ var DataTableListMenu = ({
|
|
|
4005
4004
|
items,
|
|
4006
4005
|
label,
|
|
4007
4006
|
locale = "en",
|
|
4008
|
-
messages
|
|
4007
|
+
messages,
|
|
4009
4008
|
onAdd,
|
|
4010
4009
|
onItemClick,
|
|
4011
4010
|
trigger
|
|
@@ -4018,41 +4017,41 @@ var DataTableListMenu = ({
|
|
|
4018
4017
|
const hasActions = entries.some(({ visibleActions }) => visibleActions.length);
|
|
4019
4018
|
if (!force && !hasActions && !onAdd)
|
|
4020
4019
|
return null;
|
|
4021
|
-
const
|
|
4022
|
-
const resolvedLabel = label ?? (hasActions ?
|
|
4020
|
+
const labels = dataTableMessages(locale, messages);
|
|
4021
|
+
const resolvedLabel = label ?? (hasActions ? labels.actions : labels.listDetails);
|
|
4023
4022
|
return /* @__PURE__ */ jsxs9(DropdownMenu, {
|
|
4024
4023
|
children: [
|
|
4025
|
-
/* @__PURE__ */
|
|
4024
|
+
/* @__PURE__ */ jsx15(DropdownMenuTrigger, {
|
|
4026
4025
|
onClick: (event) => event.stopPropagation(),
|
|
4027
4026
|
onPointerDown: (event) => event.stopPropagation(),
|
|
4028
|
-
render: trigger ?? /* @__PURE__ */
|
|
4027
|
+
render: trigger ?? /* @__PURE__ */ jsx15(Button, {
|
|
4029
4028
|
"aria-label": resolvedLabel,
|
|
4030
4029
|
className: cn("size-8 shrink-0", className),
|
|
4031
4030
|
size: "icon",
|
|
4032
4031
|
variant: "ghost",
|
|
4033
|
-
children: /* @__PURE__ */
|
|
4032
|
+
children: /* @__PURE__ */ jsx15(MoreHorizontal, {})
|
|
4034
4033
|
})
|
|
4035
4034
|
}),
|
|
4036
|
-
/* @__PURE__ */
|
|
4035
|
+
/* @__PURE__ */ jsx15(DropdownMenuContent, {
|
|
4037
4036
|
align: "end",
|
|
4038
4037
|
className: "max-h-[min(18rem,var(--available-height))] w-72 max-w-[calc(100vw-2rem)]",
|
|
4039
4038
|
onClick: (event) => event.stopPropagation(),
|
|
4040
4039
|
onPointerDown: (event) => event.stopPropagation(),
|
|
4041
4040
|
children: /* @__PURE__ */ jsxs9(DropdownMenuGroup, {
|
|
4042
4041
|
children: [
|
|
4043
|
-
/* @__PURE__ */
|
|
4042
|
+
/* @__PURE__ */ jsx15(DropdownMenuLabel, {
|
|
4044
4043
|
children: resolvedLabel
|
|
4045
4044
|
}),
|
|
4046
|
-
/* @__PURE__ */
|
|
4045
|
+
/* @__PURE__ */ jsx15(DropdownMenuSeparator, {}),
|
|
4047
4046
|
entries.map(({ item, visibleActions }, index) => visibleActions.length ? /* @__PURE__ */ jsxs9(DropdownMenuSub, {
|
|
4048
4047
|
children: [
|
|
4049
|
-
/* @__PURE__ */
|
|
4050
|
-
children: /* @__PURE__ */
|
|
4048
|
+
/* @__PURE__ */ jsx15(DropdownMenuSubTrigger, {
|
|
4049
|
+
children: /* @__PURE__ */ jsx15(DataTableListEntry, {
|
|
4051
4050
|
item,
|
|
4052
4051
|
appearance: display === "icon" ? "detail" : "list"
|
|
4053
4052
|
})
|
|
4054
4053
|
}),
|
|
4055
|
-
/* @__PURE__ */
|
|
4054
|
+
/* @__PURE__ */ jsx15(DropdownMenuSubContent, {
|
|
4056
4055
|
className: "w-max",
|
|
4057
4056
|
children: visibleActions.map((action) => /* @__PURE__ */ jsxs9(DropdownMenuItem, {
|
|
4058
4057
|
closeOnClick: action.closeOnClick,
|
|
@@ -4069,28 +4068,28 @@ var DataTableListMenu = ({
|
|
|
4069
4068
|
}, action.id ?? action.name))
|
|
4070
4069
|
})
|
|
4071
4070
|
]
|
|
4072
|
-
}, item.value ?? `${item.label}-${index}`) : /* @__PURE__ */
|
|
4071
|
+
}, item.value ?? `${item.label}-${index}`) : /* @__PURE__ */ jsx15(DropdownMenuItem, {
|
|
4073
4072
|
closeOnClick: Boolean(onItemClick),
|
|
4074
4073
|
onClick: (event) => {
|
|
4075
4074
|
event.stopPropagation();
|
|
4076
4075
|
onItemClick?.(item);
|
|
4077
4076
|
},
|
|
4078
|
-
children: /* @__PURE__ */
|
|
4077
|
+
children: /* @__PURE__ */ jsx15(DataTableListEntry, {
|
|
4079
4078
|
item,
|
|
4080
4079
|
appearance: display === "icon" ? "detail" : "list"
|
|
4081
4080
|
})
|
|
4082
4081
|
}, item.value ?? `${item.label}-${index}`)),
|
|
4083
4082
|
onAdd && addOptions?.length ? /* @__PURE__ */ jsxs9(Fragment, {
|
|
4084
4083
|
children: [
|
|
4085
|
-
entries.length ? /* @__PURE__ */
|
|
4086
|
-
/* @__PURE__ */
|
|
4084
|
+
entries.length ? /* @__PURE__ */ jsx15(DropdownMenuSeparator, {}) : null,
|
|
4085
|
+
/* @__PURE__ */ jsx15(DataTableListAddMenu, {
|
|
4087
4086
|
emptyLabel: addEmptyLabel,
|
|
4088
|
-
label: addLabel ??
|
|
4087
|
+
label: addLabel ?? labels.addItem,
|
|
4089
4088
|
locale,
|
|
4090
|
-
messages
|
|
4089
|
+
messages,
|
|
4091
4090
|
onAdd,
|
|
4092
4091
|
options: addOptions,
|
|
4093
|
-
searchLabel: addSearchLabel ??
|
|
4092
|
+
searchLabel: addSearchLabel ?? labels.filter,
|
|
4094
4093
|
display
|
|
4095
4094
|
})
|
|
4096
4095
|
]
|
|
@@ -4106,7 +4105,7 @@ var DataTableListAddMenu = ({
|
|
|
4106
4105
|
display,
|
|
4107
4106
|
label,
|
|
4108
4107
|
locale = "en",
|
|
4109
|
-
messages
|
|
4108
|
+
messages,
|
|
4110
4109
|
onAdd,
|
|
4111
4110
|
options,
|
|
4112
4111
|
searchLabel
|
|
@@ -4115,7 +4114,7 @@ var DataTableListAddMenu = ({
|
|
|
4115
4114
|
const focusSearch = useCallback((input) => {
|
|
4116
4115
|
input?.focus({ preventScroll: true });
|
|
4117
4116
|
}, []);
|
|
4118
|
-
const
|
|
4117
|
+
const labels = dataTableMessages(locale, messages);
|
|
4119
4118
|
const normalizedSearch = search.trim().toLocaleLowerCase(locale);
|
|
4120
4119
|
const filtered = normalizedSearch ? options.filter((item) => item.label.toLocaleLowerCase(locale).includes(normalizedSearch)) : options;
|
|
4121
4120
|
return /* @__PURE__ */ jsxs9(DropdownMenuSub, {
|
|
@@ -4126,7 +4125,7 @@ var DataTableListAddMenu = ({
|
|
|
4126
4125
|
children: [
|
|
4127
4126
|
/* @__PURE__ */ jsxs9(DropdownMenuSubTrigger, {
|
|
4128
4127
|
children: [
|
|
4129
|
-
/* @__PURE__ */
|
|
4128
|
+
/* @__PURE__ */ jsx15(Plus, {}),
|
|
4130
4129
|
label
|
|
4131
4130
|
]
|
|
4132
4131
|
}),
|
|
@@ -4136,10 +4135,10 @@ var DataTableListAddMenu = ({
|
|
|
4136
4135
|
/* @__PURE__ */ jsxs9("div", {
|
|
4137
4136
|
className: "relative p-1",
|
|
4138
4137
|
children: [
|
|
4139
|
-
/* @__PURE__ */
|
|
4138
|
+
/* @__PURE__ */ jsx15(Search, {
|
|
4140
4139
|
className: "text-muted-foreground pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2"
|
|
4141
4140
|
}),
|
|
4142
|
-
/* @__PURE__ */
|
|
4141
|
+
/* @__PURE__ */ jsx15(Input, {
|
|
4143
4142
|
"aria-label": searchLabel,
|
|
4144
4143
|
className: "h-8 pl-8",
|
|
4145
4144
|
onChange: (event) => setSearch(event.target.value),
|
|
@@ -4147,21 +4146,21 @@ var DataTableListAddMenu = ({
|
|
|
4147
4146
|
if (event.key !== "Escape")
|
|
4148
4147
|
event.stopPropagation();
|
|
4149
4148
|
},
|
|
4150
|
-
placeholder:
|
|
4149
|
+
placeholder: labels.filter,
|
|
4151
4150
|
ref: focusSearch,
|
|
4152
4151
|
value: search
|
|
4153
4152
|
})
|
|
4154
4153
|
]
|
|
4155
4154
|
}),
|
|
4156
|
-
/* @__PURE__ */
|
|
4157
|
-
filtered.length ? filtered.map((item) => /* @__PURE__ */
|
|
4155
|
+
/* @__PURE__ */ jsx15(DropdownMenuSeparator, {}),
|
|
4156
|
+
filtered.length ? filtered.map((item) => /* @__PURE__ */ jsx15(DropdownMenuItem, {
|
|
4158
4157
|
closeOnClick: false,
|
|
4159
4158
|
onClick: () => onAdd(item),
|
|
4160
|
-
children: /* @__PURE__ */
|
|
4159
|
+
children: /* @__PURE__ */ jsx15(DataTableListEntry, {
|
|
4161
4160
|
item,
|
|
4162
4161
|
appearance: display === "icon" ? "detail" : "list"
|
|
4163
4162
|
})
|
|
4164
|
-
}, item.value)) : /* @__PURE__ */
|
|
4163
|
+
}, item.value)) : /* @__PURE__ */ jsx15("div", {
|
|
4165
4164
|
className: "text-muted-foreground px-2 py-1.5 text-sm",
|
|
4166
4165
|
children: emptyLabel
|
|
4167
4166
|
})
|
|
@@ -4174,7 +4173,7 @@ var DataTableListSummaryContent = ({
|
|
|
4174
4173
|
emptyLabel,
|
|
4175
4174
|
items,
|
|
4176
4175
|
locale,
|
|
4177
|
-
messages
|
|
4176
|
+
messages,
|
|
4178
4177
|
totalCount = items.length,
|
|
4179
4178
|
display = "list",
|
|
4180
4179
|
showMenu,
|
|
@@ -4182,18 +4181,18 @@ var DataTableListSummaryContent = ({
|
|
|
4182
4181
|
}) => {
|
|
4183
4182
|
const normalized = items.map((item) => Schema2.is(Schema2.String)(item) ? { label: item } : item);
|
|
4184
4183
|
if (!normalized.length)
|
|
4185
|
-
return /* @__PURE__ */
|
|
4184
|
+
return /* @__PURE__ */ jsx15("span", {
|
|
4186
4185
|
className: "text-muted-foreground",
|
|
4187
4186
|
children: emptyLabel
|
|
4188
4187
|
});
|
|
4189
4188
|
const visible = normalized.slice(0, Math.max(0, visibleCount));
|
|
4190
4189
|
const remaining = Math.max(totalCount - visible.length, 0);
|
|
4191
4190
|
if (display === "icon") {
|
|
4192
|
-
return /* @__PURE__ */
|
|
4191
|
+
return /* @__PURE__ */ jsx15(TooltipProvider, {
|
|
4193
4192
|
children: /* @__PURE__ */ jsxs9("span", {
|
|
4194
4193
|
className: "flex items-center",
|
|
4195
4194
|
children: [
|
|
4196
|
-
visible.map((item, index) => /* @__PURE__ */
|
|
4195
|
+
visible.map((item, index) => /* @__PURE__ */ jsx15(DataTableListEntry, {
|
|
4197
4196
|
item,
|
|
4198
4197
|
appearance: "icon"
|
|
4199
4198
|
}, item.value ?? `${item.label}-${index}`)),
|
|
@@ -4204,13 +4203,13 @@ var DataTableListSummaryContent = ({
|
|
|
4204
4203
|
remaining
|
|
4205
4204
|
]
|
|
4206
4205
|
}) : null,
|
|
4207
|
-
remaining && showMenu ? /* @__PURE__ */
|
|
4206
|
+
remaining && showMenu ? /* @__PURE__ */ jsx15(DataTableListMenu, {
|
|
4208
4207
|
actions: [],
|
|
4209
4208
|
display,
|
|
4210
4209
|
force: true,
|
|
4211
4210
|
items: normalized,
|
|
4212
4211
|
locale,
|
|
4213
|
-
messages
|
|
4212
|
+
messages
|
|
4214
4213
|
}) : null
|
|
4215
4214
|
]
|
|
4216
4215
|
})
|
|
@@ -4226,18 +4225,18 @@ var DataTableListSummaryContent = ({
|
|
|
4226
4225
|
remaining ? ` +${remaining}` : ""
|
|
4227
4226
|
]
|
|
4228
4227
|
}),
|
|
4229
|
-
remaining && showMenu ? /* @__PURE__ */
|
|
4228
|
+
remaining && showMenu ? /* @__PURE__ */ jsx15(DataTableListMenu, {
|
|
4230
4229
|
actions: [],
|
|
4231
4230
|
display,
|
|
4232
4231
|
force: true,
|
|
4233
4232
|
items: normalized,
|
|
4234
4233
|
locale,
|
|
4235
|
-
messages
|
|
4234
|
+
messages
|
|
4236
4235
|
}) : null
|
|
4237
4236
|
]
|
|
4238
4237
|
});
|
|
4239
4238
|
};
|
|
4240
|
-
var DataTableListSummary = (props) => /* @__PURE__ */
|
|
4239
|
+
var DataTableListSummary = (props) => /* @__PURE__ */ jsx15(DataTableListSummaryContent, {
|
|
4241
4240
|
...props,
|
|
4242
4241
|
showMenu: true
|
|
4243
4242
|
});
|
|
@@ -4245,17 +4244,17 @@ var DataTableListEntry = ({
|
|
|
4245
4244
|
item,
|
|
4246
4245
|
appearance
|
|
4247
4246
|
}) => {
|
|
4248
|
-
const icon = /* @__PURE__ */
|
|
4247
|
+
const icon = /* @__PURE__ */ jsx15("span", {
|
|
4249
4248
|
"aria-hidden": "true",
|
|
4250
4249
|
className: "bg-secondary text-secondary-foreground flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-full",
|
|
4251
|
-
children: item.imageSrc ? /* @__PURE__ */
|
|
4250
|
+
children: item.imageSrc ? /* @__PURE__ */ jsx15("img", {
|
|
4252
4251
|
alt: "",
|
|
4253
4252
|
src: item.imageSrc,
|
|
4254
4253
|
className: "size-full object-cover"
|
|
4255
4254
|
}) : item.icon ?? item.label.slice(0, 2).toUpperCase()
|
|
4256
4255
|
});
|
|
4257
4256
|
if (appearance === "list") {
|
|
4258
|
-
return /* @__PURE__ */
|
|
4257
|
+
return /* @__PURE__ */ jsx15("span", {
|
|
4259
4258
|
className: "min-w-0 flex-1 truncate",
|
|
4260
4259
|
title: item.label,
|
|
4261
4260
|
children: item.label
|
|
@@ -4263,14 +4262,14 @@ var DataTableListEntry = ({
|
|
|
4263
4262
|
}
|
|
4264
4263
|
return appearance === "icon" ? /* @__PURE__ */ jsxs9(Tooltip, {
|
|
4265
4264
|
children: [
|
|
4266
|
-
/* @__PURE__ */
|
|
4267
|
-
render: /* @__PURE__ */
|
|
4265
|
+
/* @__PURE__ */ jsx15(TooltipTrigger, {
|
|
4266
|
+
render: /* @__PURE__ */ jsx15("span", {
|
|
4268
4267
|
className: "-ml-1 inline-flex rounded-full",
|
|
4269
4268
|
"aria-label": item.label
|
|
4270
4269
|
}),
|
|
4271
4270
|
children: icon
|
|
4272
4271
|
}),
|
|
4273
|
-
/* @__PURE__ */
|
|
4272
|
+
/* @__PURE__ */ jsx15(TooltipContent, {
|
|
4274
4273
|
children: item.label
|
|
4275
4274
|
})
|
|
4276
4275
|
]
|
|
@@ -4278,7 +4277,7 @@ var DataTableListEntry = ({
|
|
|
4278
4277
|
className: "flex min-w-0 flex-1 items-center gap-2 text-left",
|
|
4279
4278
|
children: [
|
|
4280
4279
|
icon,
|
|
4281
|
-
/* @__PURE__ */
|
|
4280
|
+
/* @__PURE__ */ jsx15("span", {
|
|
4282
4281
|
className: "truncate",
|
|
4283
4282
|
children: item.label
|
|
4284
4283
|
})
|
|
@@ -4290,7 +4289,7 @@ var DataTableListEntry = ({
|
|
|
4290
4289
|
import { Check as Check2, Copy, TriangleAlert } from "lucide-react";
|
|
4291
4290
|
import { useEffect, useRef as useRef2, useState as useState2 } from "react";
|
|
4292
4291
|
import { useKrakstackLocale as useKrakstackLocale4 } from "@krak-stack/registry/krakstack-provider";
|
|
4293
|
-
import { jsx as
|
|
4292
|
+
import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
4294
4293
|
var messages3 = {
|
|
4295
4294
|
en: { copy: "Copy", copied: "Copied", copyFailed: "Copy failed" },
|
|
4296
4295
|
fr: { copy: "Copier", copied: "Copié", copyFailed: "Échec de la copie" }
|
|
@@ -4305,7 +4304,7 @@ function CopyButton({
|
|
|
4305
4304
|
valueDescription,
|
|
4306
4305
|
copyVariant = "default",
|
|
4307
4306
|
locale: localeOverride,
|
|
4308
|
-
messages
|
|
4307
|
+
messages,
|
|
4309
4308
|
onCopied,
|
|
4310
4309
|
onCopyError,
|
|
4311
4310
|
resetDelay = 1500,
|
|
@@ -4317,8 +4316,8 @@ function CopyButton({
|
|
|
4317
4316
|
const locale = useKrakstackLocale4(localeOverride);
|
|
4318
4317
|
const [copyState, setCopyState] = useState2("idle");
|
|
4319
4318
|
const copyTimeout = useRef2(undefined);
|
|
4320
|
-
const
|
|
4321
|
-
const accessibleLabel = ariaLabel ?? (valueDescription ? `${
|
|
4319
|
+
const labels = copyButtonMessages(locale, messages);
|
|
4320
|
+
const accessibleLabel = ariaLabel ?? (valueDescription ? `${labels.copy} ${valueDescription}` : labels.copy);
|
|
4322
4321
|
const isLarge = copyVariant === "large";
|
|
4323
4322
|
const defaultSize = copyVariant === "sm" ? "icon-xs" : isLarge ? "sm" : "icon-sm";
|
|
4324
4323
|
useEffect(() => {
|
|
@@ -4339,11 +4338,11 @@ function CopyButton({
|
|
|
4339
4338
|
onCopied?.();
|
|
4340
4339
|
} catch (error) {
|
|
4341
4340
|
setCopyState("failed");
|
|
4342
|
-
onCopyError?.(error instanceof Error ? error : new Error(
|
|
4341
|
+
onCopyError?.(error instanceof Error ? error : new Error(labels.copyFailed, { cause: error }));
|
|
4343
4342
|
}
|
|
4344
4343
|
resetCopyState();
|
|
4345
4344
|
};
|
|
4346
|
-
const status = copyState === "copied" ? valueDescription ? `${
|
|
4345
|
+
const status = copyState === "copied" ? valueDescription ? `${labels.copied}: ${valueDescription}` : labels.copied : copyState === "failed" ? valueDescription ? `${labels.copyFailed}: ${valueDescription}` : labels.copyFailed : "";
|
|
4347
4346
|
return /* @__PURE__ */ jsxs10(Button, {
|
|
4348
4347
|
"aria-label": accessibleLabel,
|
|
4349
4348
|
disabled,
|
|
@@ -4351,23 +4350,23 @@ function CopyButton({
|
|
|
4351
4350
|
size: size ?? defaultSize,
|
|
4352
4351
|
...props,
|
|
4353
4352
|
children: [
|
|
4354
|
-
/* @__PURE__ */
|
|
4353
|
+
/* @__PURE__ */ jsx16("span", {
|
|
4355
4354
|
"aria-live": "polite",
|
|
4356
4355
|
className: "sr-only",
|
|
4357
4356
|
role: "status",
|
|
4358
4357
|
children: status
|
|
4359
4358
|
}),
|
|
4360
|
-
copyState === "copied" ? /* @__PURE__ */
|
|
4359
|
+
copyState === "copied" ? /* @__PURE__ */ jsx16(Check2, {
|
|
4361
4360
|
"aria-hidden": "true"
|
|
4362
4361
|
}) : null,
|
|
4363
|
-
copyState === "failed" ? /* @__PURE__ */
|
|
4362
|
+
copyState === "failed" ? /* @__PURE__ */ jsx16(TriangleAlert, {
|
|
4364
4363
|
"aria-hidden": "true"
|
|
4365
4364
|
}) : null,
|
|
4366
|
-
copyState === "idle" ? /* @__PURE__ */
|
|
4365
|
+
copyState === "idle" ? /* @__PURE__ */ jsx16(Copy, {
|
|
4367
4366
|
"aria-hidden": "true"
|
|
4368
4367
|
}) : null,
|
|
4369
|
-
isLarge ? /* @__PURE__ */
|
|
4370
|
-
children:
|
|
4368
|
+
isLarge ? /* @__PURE__ */ jsx16("span", {
|
|
4369
|
+
children: labels.copy
|
|
4371
4370
|
}) : null
|
|
4372
4371
|
]
|
|
4373
4372
|
});
|
|
@@ -4379,7 +4378,7 @@ import { createThemeCss } from "@tanstack/highlight/theme";
|
|
|
4379
4378
|
import { githubDarkTheme } from "@tanstack/highlight/themes/github-dark";
|
|
4380
4379
|
import { githubLightTheme } from "@tanstack/highlight/themes/github-light";
|
|
4381
4380
|
import { useKrakstackLocale as useKrakstackLocale5 } from "@krak-stack/registry/krakstack-provider";
|
|
4382
|
-
import { jsx as
|
|
4381
|
+
import { jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
4383
4382
|
var themeCss = `${createThemeCss({
|
|
4384
4383
|
light: githubLightTheme,
|
|
4385
4384
|
dark: githubDarkTheme,
|
|
@@ -4419,36 +4418,36 @@ function CodeBlock({
|
|
|
4419
4418
|
code,
|
|
4420
4419
|
language = "text",
|
|
4421
4420
|
locale: localeOverride,
|
|
4422
|
-
messages
|
|
4421
|
+
messages
|
|
4423
4422
|
}) {
|
|
4424
4423
|
const locale = useKrakstackLocale5(localeOverride);
|
|
4425
4424
|
const normalizedLanguage = language.toLowerCase() || "text";
|
|
4426
4425
|
const highlighted = highlight(code, { lang: normalizedLanguage });
|
|
4427
|
-
const
|
|
4426
|
+
const labels = codeBlockMessages(locale, messages);
|
|
4428
4427
|
return /* @__PURE__ */ jsxs11("div", {
|
|
4429
4428
|
className: "not-prose bg-muted overflow-hidden rounded-md border text-[var(--th-token)]",
|
|
4430
4429
|
"data-code-theme": true,
|
|
4431
4430
|
children: [
|
|
4432
|
-
/* @__PURE__ */
|
|
4431
|
+
/* @__PURE__ */ jsx17("style", {
|
|
4433
4432
|
children: themeCss
|
|
4434
4433
|
}),
|
|
4435
4434
|
/* @__PURE__ */ jsxs11("div", {
|
|
4436
4435
|
className: "bg-background border-border/60 flex items-center justify-between border-b px-3 py-2",
|
|
4437
4436
|
children: [
|
|
4438
|
-
/* @__PURE__ */
|
|
4437
|
+
/* @__PURE__ */ jsx17("span", {
|
|
4439
4438
|
className: "text-muted-foreground font-mono text-xs",
|
|
4440
4439
|
children: highlighted.lang
|
|
4441
4440
|
}),
|
|
4442
|
-
/* @__PURE__ */
|
|
4441
|
+
/* @__PURE__ */ jsx17(CopyButton, {
|
|
4443
4442
|
value: code,
|
|
4444
|
-
valueDescription:
|
|
4443
|
+
valueDescription: labels.codeDescription(highlighted.lang),
|
|
4445
4444
|
variant: "secondary",
|
|
4446
4445
|
locale,
|
|
4447
|
-
messages: { [locale]:
|
|
4446
|
+
messages: { [locale]: labels }
|
|
4448
4447
|
})
|
|
4449
4448
|
]
|
|
4450
4449
|
}),
|
|
4451
|
-
/* @__PURE__ */
|
|
4450
|
+
/* @__PURE__ */ jsx17("div", {
|
|
4452
4451
|
className: "max-h-full overflow-auto font-mono text-[0.875rem] leading-[1.625]",
|
|
4453
4452
|
dangerouslySetInnerHTML: { __html: highlighted.html }
|
|
4454
4453
|
})
|
|
@@ -4459,15 +4458,15 @@ function CodeBlock({
|
|
|
4459
4458
|
// ../../src/components/ui/dialog.tsx
|
|
4460
4459
|
import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
|
|
4461
4460
|
import { XIcon } from "lucide-react";
|
|
4462
|
-
import { jsx as
|
|
4461
|
+
import { jsx as jsx18, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
4463
4462
|
function Dialog({ ...props }) {
|
|
4464
|
-
return /* @__PURE__ */
|
|
4463
|
+
return /* @__PURE__ */ jsx18(DialogPrimitive.Root, {
|
|
4465
4464
|
"data-slot": "dialog",
|
|
4466
4465
|
...props
|
|
4467
4466
|
});
|
|
4468
4467
|
}
|
|
4469
4468
|
function DialogPortal({ ...props }) {
|
|
4470
|
-
return /* @__PURE__ */
|
|
4469
|
+
return /* @__PURE__ */ jsx18(DialogPrimitive.Portal, {
|
|
4471
4470
|
"data-slot": "dialog-portal",
|
|
4472
4471
|
...props
|
|
4473
4472
|
});
|
|
@@ -4476,7 +4475,7 @@ function DialogOverlay({
|
|
|
4476
4475
|
className,
|
|
4477
4476
|
...props
|
|
4478
4477
|
}) {
|
|
4479
|
-
return /* @__PURE__ */
|
|
4478
|
+
return /* @__PURE__ */ jsx18(DialogPrimitive.Backdrop, {
|
|
4480
4479
|
"data-slot": "dialog-overlay",
|
|
4481
4480
|
className: cn("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", className),
|
|
4482
4481
|
...props
|
|
@@ -4489,7 +4488,7 @@ function DialogContent({
|
|
|
4489
4488
|
}) {
|
|
4490
4489
|
return /* @__PURE__ */ jsxs12(DialogPortal, {
|
|
4491
4490
|
children: [
|
|
4492
|
-
/* @__PURE__ */
|
|
4491
|
+
/* @__PURE__ */ jsx18(DialogOverlay, {}),
|
|
4493
4492
|
/* @__PURE__ */ jsxs12(DialogPrimitive.Popup, {
|
|
4494
4493
|
"data-slot": "dialog-content",
|
|
4495
4494
|
className: cn("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-6 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-lg data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
@@ -4499,10 +4498,10 @@ function DialogContent({
|
|
|
4499
4498
|
/* @__PURE__ */ jsxs12(DialogPrimitive.Close, {
|
|
4500
4499
|
className: "focus-visible:ring-ring absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-2 focus-visible:outline-none disabled:pointer-events-none",
|
|
4501
4500
|
children: [
|
|
4502
|
-
/* @__PURE__ */
|
|
4501
|
+
/* @__PURE__ */ jsx18(XIcon, {
|
|
4503
4502
|
className: "size-4"
|
|
4504
4503
|
}),
|
|
4505
|
-
/* @__PURE__ */
|
|
4504
|
+
/* @__PURE__ */ jsx18("span", {
|
|
4506
4505
|
className: "sr-only",
|
|
4507
4506
|
children: "Close"
|
|
4508
4507
|
})
|
|
@@ -4514,7 +4513,7 @@ function DialogContent({
|
|
|
4514
4513
|
});
|
|
4515
4514
|
}
|
|
4516
4515
|
function DialogHeader({ className, ...props }) {
|
|
4517
|
-
return /* @__PURE__ */
|
|
4516
|
+
return /* @__PURE__ */ jsx18("div", {
|
|
4518
4517
|
"data-slot": "dialog-header",
|
|
4519
4518
|
className: cn("grid gap-1.5", className),
|
|
4520
4519
|
...props
|
|
@@ -4524,7 +4523,7 @@ function DialogTitle({
|
|
|
4524
4523
|
className,
|
|
4525
4524
|
...props
|
|
4526
4525
|
}) {
|
|
4527
|
-
return /* @__PURE__ */
|
|
4526
|
+
return /* @__PURE__ */ jsx18(DialogPrimitive.Title, {
|
|
4528
4527
|
"data-slot": "dialog-title",
|
|
4529
4528
|
className: cn("text-lg font-medium", className),
|
|
4530
4529
|
...props
|
|
@@ -4533,7 +4532,7 @@ function DialogTitle({
|
|
|
4533
4532
|
|
|
4534
4533
|
// ../../src/services/webhooks/client/delivery-table.tsx
|
|
4535
4534
|
import { useKrakstackLocale as useKrakstackLocale6 } from "@krak-stack/registry/krakstack-provider";
|
|
4536
|
-
import { jsx as
|
|
4535
|
+
import { jsx as jsx19, jsxs as jsxs13, Fragment as Fragment2 } from "react/jsx-runtime";
|
|
4537
4536
|
var translations = {
|
|
4538
4537
|
en: {
|
|
4539
4538
|
identifier: "ID",
|
|
@@ -4571,7 +4570,7 @@ var WebhookDeliveryTable = ({
|
|
|
4571
4570
|
entries,
|
|
4572
4571
|
rowCount,
|
|
4573
4572
|
locale: localeOverride,
|
|
4574
|
-
messages
|
|
4573
|
+
messages,
|
|
4575
4574
|
events = [],
|
|
4576
4575
|
linksColumn,
|
|
4577
4576
|
state,
|
|
@@ -4580,11 +4579,11 @@ var WebhookDeliveryTable = ({
|
|
|
4580
4579
|
}) => {
|
|
4581
4580
|
const locale = useKrakstackLocale6(localeOverride);
|
|
4582
4581
|
const base = locale.split("-")[0];
|
|
4583
|
-
const
|
|
4582
|
+
const labels = {
|
|
4584
4583
|
...translations.en,
|
|
4585
4584
|
...base === "fr" ? translations.fr : translations.en,
|
|
4586
|
-
...
|
|
4587
|
-
...
|
|
4585
|
+
...messages?.[base],
|
|
4586
|
+
...messages?.[locale]
|
|
4588
4587
|
};
|
|
4589
4588
|
const [selected, setSelected] = useState3(null);
|
|
4590
4589
|
const dateFormatter = new Intl.DateTimeFormat(locale, {
|
|
@@ -4592,15 +4591,15 @@ var WebhookDeliveryTable = ({
|
|
|
4592
4591
|
timeStyle: "short"
|
|
4593
4592
|
});
|
|
4594
4593
|
const statusLabels = {
|
|
4595
|
-
pending:
|
|
4596
|
-
success:
|
|
4597
|
-
failed:
|
|
4594
|
+
pending: labels.pending,
|
|
4595
|
+
success: labels.success,
|
|
4596
|
+
failed: labels.failed
|
|
4598
4597
|
};
|
|
4599
4598
|
const columns = [
|
|
4600
|
-
{ field: "id", headerName:
|
|
4599
|
+
{ field: "id", headerName: labels.identifier },
|
|
4601
4600
|
{
|
|
4602
4601
|
field: "event",
|
|
4603
|
-
headerName:
|
|
4602
|
+
headerName: labels.event,
|
|
4604
4603
|
valueGetter: ({ data }) => events.find((event) => event.value === data.event)?.label ?? data.event,
|
|
4605
4604
|
filterValueGetter: ({ data }) => data.event,
|
|
4606
4605
|
filterable: events.length > 0,
|
|
@@ -4608,7 +4607,7 @@ var WebhookDeliveryTable = ({
|
|
|
4608
4607
|
},
|
|
4609
4608
|
{
|
|
4610
4609
|
field: "status",
|
|
4611
|
-
headerName:
|
|
4610
|
+
headerName: labels.status,
|
|
4612
4611
|
type: "reference",
|
|
4613
4612
|
filterValueGetter: ({ data }) => webhookDeliveryStatus(data),
|
|
4614
4613
|
valueGetter: ({ data }) => statusLabels[webhookDeliveryStatus(data)],
|
|
@@ -4621,16 +4620,16 @@ var WebhookDeliveryTable = ({
|
|
|
4621
4620
|
getItem: (delivery) => {
|
|
4622
4621
|
const displayStatus = webhookDeliveryStatus(delivery);
|
|
4623
4622
|
const details = displayStatus === "failed" ? [
|
|
4624
|
-
delivery.error ??
|
|
4625
|
-
`${
|
|
4623
|
+
delivery.error ?? labels.errorUnavailable,
|
|
4624
|
+
`${labels.retries}: ${delivery.retries}`,
|
|
4626
4625
|
...delivery.status === "pending" ? [
|
|
4627
|
-
`${
|
|
4626
|
+
`${labels.retryAt}: ${dateFormatter.format(delivery.retryAt)}`
|
|
4628
4627
|
] : []
|
|
4629
4628
|
] : [];
|
|
4630
4629
|
return {
|
|
4631
4630
|
label: statusLabels[displayStatus],
|
|
4632
4631
|
description: details.join(" · ") || undefined,
|
|
4633
|
-
icon: displayStatus === "failed" ? /* @__PURE__ */
|
|
4632
|
+
icon: displayStatus === "failed" ? /* @__PURE__ */ jsx19(X2, {}) : displayStatus === "success" ? /* @__PURE__ */ jsx19(Check3, {}) : /* @__PURE__ */ jsx19(Clock, {}),
|
|
4634
4633
|
iconClassName: displayStatus === "failed" ? "bg-destructive/10 text-destructive" : displayStatus === "success" ? "bg-success/10 text-success" : "bg-primary/10 text-primary"
|
|
4635
4634
|
};
|
|
4636
4635
|
}
|
|
@@ -4639,7 +4638,7 @@ var WebhookDeliveryTable = ({
|
|
|
4639
4638
|
...linksColumn ? [linksColumn] : [],
|
|
4640
4639
|
{
|
|
4641
4640
|
colId: "data",
|
|
4642
|
-
headerName:
|
|
4641
|
+
headerName: labels.payload,
|
|
4643
4642
|
sortable: false,
|
|
4644
4643
|
filterable: false,
|
|
4645
4644
|
cellRenderer: ({ data }) => /* @__PURE__ */ jsxs13(Button, {
|
|
@@ -4650,19 +4649,19 @@ var WebhookDeliveryTable = ({
|
|
|
4650
4649
|
setSelected(data);
|
|
4651
4650
|
},
|
|
4652
4651
|
children: [
|
|
4653
|
-
/* @__PURE__ */
|
|
4652
|
+
/* @__PURE__ */ jsx19(FileJson2, {
|
|
4654
4653
|
"data-icon": "inline-start"
|
|
4655
4654
|
}),
|
|
4656
|
-
|
|
4655
|
+
labels.viewPayload
|
|
4657
4656
|
]
|
|
4658
4657
|
})
|
|
4659
4658
|
},
|
|
4660
|
-
{ field: "createdAt", headerName:
|
|
4661
|
-
{ field: "completedAt", headerName:
|
|
4659
|
+
{ field: "createdAt", headerName: labels.createdAt, type: "dateTime" },
|
|
4660
|
+
{ field: "completedAt", headerName: labels.completedAt, type: "dateTime" }
|
|
4662
4661
|
];
|
|
4663
4662
|
return /* @__PURE__ */ jsxs13(Fragment2, {
|
|
4664
4663
|
children: [
|
|
4665
|
-
/* @__PURE__ */
|
|
4664
|
+
/* @__PURE__ */ jsx19(DataTable, {
|
|
4666
4665
|
locale,
|
|
4667
4666
|
rowData: entries,
|
|
4668
4667
|
getRowId: (row) => row.id,
|
|
@@ -4677,7 +4676,7 @@ var WebhookDeliveryTable = ({
|
|
|
4677
4676
|
pagination: { mode: "server", rowCount }
|
|
4678
4677
|
}
|
|
4679
4678
|
}),
|
|
4680
|
-
/* @__PURE__ */
|
|
4679
|
+
/* @__PURE__ */ jsx19(Dialog, {
|
|
4681
4680
|
open: selected !== null,
|
|
4682
4681
|
onOpenChange: (open) => {
|
|
4683
4682
|
if (!open)
|
|
@@ -4686,14 +4685,14 @@ var WebhookDeliveryTable = ({
|
|
|
4686
4685
|
children: /* @__PURE__ */ jsxs13(DialogContent, {
|
|
4687
4686
|
className: "grid max-h-[calc(100svh-2rem)] grid-rows-[auto_minmax(0,1fr)] overflow-hidden sm:max-w-4xl",
|
|
4688
4687
|
children: [
|
|
4689
|
-
/* @__PURE__ */
|
|
4690
|
-
children: /* @__PURE__ */
|
|
4691
|
-
children:
|
|
4688
|
+
/* @__PURE__ */ jsx19(DialogHeader, {
|
|
4689
|
+
children: /* @__PURE__ */ jsx19(DialogTitle, {
|
|
4690
|
+
children: labels.payload
|
|
4692
4691
|
})
|
|
4693
4692
|
}),
|
|
4694
|
-
/* @__PURE__ */
|
|
4693
|
+
/* @__PURE__ */ jsx19("div", {
|
|
4695
4694
|
className: "min-h-0 overflow-auto",
|
|
4696
|
-
children: /* @__PURE__ */
|
|
4695
|
+
children: /* @__PURE__ */ jsx19(CodeBlock, {
|
|
4697
4696
|
code: JSON.stringify(selected?.data ?? null, null, 2),
|
|
4698
4697
|
language: "json",
|
|
4699
4698
|
locale
|
|
@@ -4706,6 +4705,6 @@ var WebhookDeliveryTable = ({
|
|
|
4706
4705
|
});
|
|
4707
4706
|
};
|
|
4708
4707
|
export {
|
|
4709
|
-
|
|
4710
|
-
|
|
4708
|
+
WebhookDeliveryTable,
|
|
4709
|
+
webhookDeliveryStatus
|
|
4711
4710
|
};
|