@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
|
@@ -333,12 +333,11 @@ function Label({ className, ...props }) {
|
|
|
333
333
|
|
|
334
334
|
// ../../src/components/ui/separator.tsx
|
|
335
335
|
import { Separator as SeparatorPrimitive } from "@base-ui/react/separator";
|
|
336
|
-
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
337
336
|
|
|
338
337
|
// ../../src/components/ui/field.tsx
|
|
339
|
-
import { jsx as
|
|
338
|
+
import { jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
340
339
|
function FieldGroup({ className, ...props }) {
|
|
341
|
-
return /* @__PURE__ */
|
|
340
|
+
return /* @__PURE__ */ jsx7("div", {
|
|
342
341
|
"data-slot": "field-group",
|
|
343
342
|
className: cn("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4", className),
|
|
344
343
|
...props
|
|
@@ -361,7 +360,7 @@ function Field({
|
|
|
361
360
|
orientation = "vertical",
|
|
362
361
|
...props
|
|
363
362
|
}) {
|
|
364
|
-
return /* @__PURE__ */
|
|
363
|
+
return /* @__PURE__ */ jsx7("div", {
|
|
365
364
|
role: "group",
|
|
366
365
|
"data-slot": "field",
|
|
367
366
|
"data-orientation": orientation,
|
|
@@ -373,7 +372,7 @@ function FieldLabel({
|
|
|
373
372
|
className,
|
|
374
373
|
...props
|
|
375
374
|
}) {
|
|
376
|
-
return /* @__PURE__ */
|
|
375
|
+
return /* @__PURE__ */ jsx7(Label, {
|
|
377
376
|
"data-slot": "field-label",
|
|
378
377
|
className: cn("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border *:data-[slot=field]:p-3 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col", className),
|
|
379
378
|
...props
|
|
@@ -383,18 +382,18 @@ function FieldLabel({
|
|
|
383
382
|
// ../../src/components/ui/select.tsx
|
|
384
383
|
import { Select as SelectPrimitive } from "@base-ui/react/select";
|
|
385
384
|
import { ChevronDownIcon, CheckIcon as CheckIcon3, ChevronUpIcon } from "lucide-react";
|
|
386
|
-
import { jsx as
|
|
385
|
+
import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
387
386
|
"use client";
|
|
388
387
|
var Select = SelectPrimitive.Root;
|
|
389
388
|
function SelectGroup({ className, ...props }) {
|
|
390
|
-
return /* @__PURE__ */
|
|
389
|
+
return /* @__PURE__ */ jsx8(SelectPrimitive.Group, {
|
|
391
390
|
"data-slot": "select-group",
|
|
392
391
|
className: cn("scroll-my-1 p-1", className),
|
|
393
392
|
...props
|
|
394
393
|
});
|
|
395
394
|
}
|
|
396
395
|
function SelectValue({ className, ...props }) {
|
|
397
|
-
return /* @__PURE__ */
|
|
396
|
+
return /* @__PURE__ */ jsx8(SelectPrimitive.Value, {
|
|
398
397
|
"data-slot": "select-value",
|
|
399
398
|
className: cn("flex flex-1 text-left", className),
|
|
400
399
|
...props
|
|
@@ -413,8 +412,8 @@ function SelectTrigger({
|
|
|
413
412
|
...props,
|
|
414
413
|
children: [
|
|
415
414
|
children,
|
|
416
|
-
/* @__PURE__ */
|
|
417
|
-
render: /* @__PURE__ */
|
|
415
|
+
/* @__PURE__ */ jsx8(SelectPrimitive.Icon, {
|
|
416
|
+
render: /* @__PURE__ */ jsx8(ChevronDownIcon, {
|
|
418
417
|
className: "text-muted-foreground pointer-events-none size-4"
|
|
419
418
|
})
|
|
420
419
|
})
|
|
@@ -431,8 +430,8 @@ function SelectContent({
|
|
|
431
430
|
alignItemWithTrigger = true,
|
|
432
431
|
...props
|
|
433
432
|
}) {
|
|
434
|
-
return /* @__PURE__ */
|
|
435
|
-
children: /* @__PURE__ */
|
|
433
|
+
return /* @__PURE__ */ jsx8(SelectPrimitive.Portal, {
|
|
434
|
+
children: /* @__PURE__ */ jsx8(SelectPrimitive.Positioner, {
|
|
436
435
|
side,
|
|
437
436
|
sideOffset,
|
|
438
437
|
align,
|
|
@@ -445,11 +444,11 @@ function SelectContent({
|
|
|
445
444
|
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),
|
|
446
445
|
...props,
|
|
447
446
|
children: [
|
|
448
|
-
/* @__PURE__ */
|
|
449
|
-
/* @__PURE__ */
|
|
447
|
+
/* @__PURE__ */ jsx8(SelectScrollUpButton, {}),
|
|
448
|
+
/* @__PURE__ */ jsx8(SelectPrimitive.List, {
|
|
450
449
|
children
|
|
451
450
|
}),
|
|
452
|
-
/* @__PURE__ */
|
|
451
|
+
/* @__PURE__ */ jsx8(SelectScrollDownButton, {})
|
|
453
452
|
]
|
|
454
453
|
})
|
|
455
454
|
})
|
|
@@ -465,15 +464,15 @@ function SelectItem({
|
|
|
465
464
|
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),
|
|
466
465
|
...props,
|
|
467
466
|
children: [
|
|
468
|
-
/* @__PURE__ */
|
|
467
|
+
/* @__PURE__ */ jsx8(SelectPrimitive.ItemText, {
|
|
469
468
|
className: "flex flex-1 shrink-0 gap-2 whitespace-nowrap",
|
|
470
469
|
children
|
|
471
470
|
}),
|
|
472
|
-
/* @__PURE__ */
|
|
473
|
-
render: /* @__PURE__ */
|
|
471
|
+
/* @__PURE__ */ jsx8(SelectPrimitive.ItemIndicator, {
|
|
472
|
+
render: /* @__PURE__ */ jsx8("span", {
|
|
474
473
|
className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center"
|
|
475
474
|
}),
|
|
476
|
-
children: /* @__PURE__ */
|
|
475
|
+
children: /* @__PURE__ */ jsx8(CheckIcon3, {
|
|
477
476
|
className: "pointer-events-none"
|
|
478
477
|
})
|
|
479
478
|
})
|
|
@@ -484,29 +483,29 @@ function SelectScrollUpButton({
|
|
|
484
483
|
className,
|
|
485
484
|
...props
|
|
486
485
|
}) {
|
|
487
|
-
return /* @__PURE__ */
|
|
486
|
+
return /* @__PURE__ */ jsx8(SelectPrimitive.ScrollUpArrow, {
|
|
488
487
|
"data-slot": "select-scroll-up-button",
|
|
489
488
|
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),
|
|
490
489
|
...props,
|
|
491
|
-
children: /* @__PURE__ */
|
|
490
|
+
children: /* @__PURE__ */ jsx8(ChevronUpIcon, {})
|
|
492
491
|
});
|
|
493
492
|
}
|
|
494
493
|
function SelectScrollDownButton({
|
|
495
494
|
className,
|
|
496
495
|
...props
|
|
497
496
|
}) {
|
|
498
|
-
return /* @__PURE__ */
|
|
497
|
+
return /* @__PURE__ */ jsx8(SelectPrimitive.ScrollDownArrow, {
|
|
499
498
|
"data-slot": "select-scroll-down-button",
|
|
500
499
|
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),
|
|
501
500
|
...props,
|
|
502
|
-
children: /* @__PURE__ */
|
|
501
|
+
children: /* @__PURE__ */ jsx8(ChevronDownIcon, {})
|
|
503
502
|
});
|
|
504
503
|
}
|
|
505
504
|
|
|
506
505
|
// ../../src/components/ui/loading.tsx
|
|
507
506
|
import { Loader2 } from "lucide-react";
|
|
508
507
|
import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider";
|
|
509
|
-
import { jsx as
|
|
508
|
+
import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
510
509
|
var labels = {
|
|
511
510
|
en: {
|
|
512
511
|
loading: "Loading..."
|
|
@@ -527,7 +526,7 @@ function Loading({
|
|
|
527
526
|
return /* @__PURE__ */ jsxs4("div", {
|
|
528
527
|
className: cn("text-muted-foreground flex items-center justify-center gap-2 text-sm", variant === "centered" && "min-h-[50svh] w-full", className),
|
|
529
528
|
children: [
|
|
530
|
-
/* @__PURE__ */
|
|
529
|
+
/* @__PURE__ */ jsx9(Loader2, {
|
|
531
530
|
className: "size-4 animate-spin"
|
|
532
531
|
}),
|
|
533
532
|
label ?? loadingLabel(locale, messages)
|
|
@@ -539,17 +538,17 @@ function Loading({
|
|
|
539
538
|
import { Menu as MenuPrimitive2 } from "@base-ui/react/menu";
|
|
540
539
|
import { Menubar as MenubarPrimitive } from "@base-ui/react/menubar";
|
|
541
540
|
import { CheckIcon as CheckIcon4 } from "lucide-react";
|
|
542
|
-
import { jsx as
|
|
541
|
+
import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
543
542
|
"use client";
|
|
544
543
|
function Menubar({ className, ...props }) {
|
|
545
|
-
return /* @__PURE__ */
|
|
544
|
+
return /* @__PURE__ */ jsx10(MenubarPrimitive, {
|
|
546
545
|
"data-slot": "menubar",
|
|
547
546
|
className: cn("flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs", className),
|
|
548
547
|
...props
|
|
549
548
|
});
|
|
550
549
|
}
|
|
551
550
|
function MenubarMenu({ ...props }) {
|
|
552
|
-
return /* @__PURE__ */
|
|
551
|
+
return /* @__PURE__ */ jsx10(DropdownMenu, {
|
|
553
552
|
"data-slot": "menubar-menu",
|
|
554
553
|
...props
|
|
555
554
|
});
|
|
@@ -557,7 +556,7 @@ function MenubarMenu({ ...props }) {
|
|
|
557
556
|
function MenubarGroup({
|
|
558
557
|
...props
|
|
559
558
|
}) {
|
|
560
|
-
return /* @__PURE__ */
|
|
559
|
+
return /* @__PURE__ */ jsx10(DropdownMenuGroup, {
|
|
561
560
|
"data-slot": "menubar-group",
|
|
562
561
|
...props
|
|
563
562
|
});
|
|
@@ -566,7 +565,7 @@ function MenubarTrigger({
|
|
|
566
565
|
className,
|
|
567
566
|
...props
|
|
568
567
|
}) {
|
|
569
|
-
return /* @__PURE__ */
|
|
568
|
+
return /* @__PURE__ */ jsx10(DropdownMenuTrigger, {
|
|
570
569
|
"data-slot": "menubar-trigger",
|
|
571
570
|
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),
|
|
572
571
|
...props
|
|
@@ -579,7 +578,7 @@ function MenubarContent({
|
|
|
579
578
|
sideOffset = 8,
|
|
580
579
|
...props
|
|
581
580
|
}) {
|
|
582
|
-
return /* @__PURE__ */
|
|
581
|
+
return /* @__PURE__ */ jsx10(DropdownMenuContent, {
|
|
583
582
|
"data-slot": "menubar-content",
|
|
584
583
|
align,
|
|
585
584
|
alignOffset,
|
|
@@ -594,7 +593,7 @@ function MenubarItem({
|
|
|
594
593
|
variant = "default",
|
|
595
594
|
...props
|
|
596
595
|
}) {
|
|
597
|
-
return /* @__PURE__ */
|
|
596
|
+
return /* @__PURE__ */ jsx10(DropdownMenuItem, {
|
|
598
597
|
"data-slot": "menubar-item",
|
|
599
598
|
"data-inset": inset,
|
|
600
599
|
"data-variant": variant,
|
|
@@ -616,10 +615,10 @@ function MenubarCheckboxItem({
|
|
|
616
615
|
checked,
|
|
617
616
|
...props,
|
|
618
617
|
children: [
|
|
619
|
-
/* @__PURE__ */
|
|
618
|
+
/* @__PURE__ */ jsx10("span", {
|
|
620
619
|
className: "pointer-events-none absolute left-2 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4",
|
|
621
|
-
children: /* @__PURE__ */
|
|
622
|
-
children: /* @__PURE__ */
|
|
620
|
+
children: /* @__PURE__ */ jsx10(MenuPrimitive2.CheckboxItemIndicator, {
|
|
621
|
+
children: /* @__PURE__ */ jsx10(CheckIcon4, {})
|
|
623
622
|
})
|
|
624
623
|
}),
|
|
625
624
|
children
|
|
@@ -629,7 +628,7 @@ function MenubarCheckboxItem({
|
|
|
629
628
|
function MenubarRadioGroup({
|
|
630
629
|
...props
|
|
631
630
|
}) {
|
|
632
|
-
return /* @__PURE__ */
|
|
631
|
+
return /* @__PURE__ */ jsx10(DropdownMenuRadioGroup, {
|
|
633
632
|
"data-slot": "menubar-radio-group",
|
|
634
633
|
...props
|
|
635
634
|
});
|
|
@@ -646,10 +645,10 @@ function MenubarRadioItem({
|
|
|
646
645
|
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),
|
|
647
646
|
...props,
|
|
648
647
|
children: [
|
|
649
|
-
/* @__PURE__ */
|
|
648
|
+
/* @__PURE__ */ jsx10("span", {
|
|
650
649
|
className: "pointer-events-none absolute left-2 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4",
|
|
651
|
-
children: /* @__PURE__ */
|
|
652
|
-
children: /* @__PURE__ */
|
|
650
|
+
children: /* @__PURE__ */ jsx10(MenuPrimitive2.RadioItemIndicator, {
|
|
651
|
+
children: /* @__PURE__ */ jsx10(CheckIcon4, {})
|
|
653
652
|
})
|
|
654
653
|
}),
|
|
655
654
|
children
|
|
@@ -661,7 +660,7 @@ function MenubarLabel({
|
|
|
661
660
|
inset,
|
|
662
661
|
...props
|
|
663
662
|
}) {
|
|
664
|
-
return /* @__PURE__ */
|
|
663
|
+
return /* @__PURE__ */ jsx10(DropdownMenuLabel, {
|
|
665
664
|
"data-slot": "menubar-label",
|
|
666
665
|
"data-inset": inset,
|
|
667
666
|
className: cn("px-2 py-1.5 text-sm font-medium data-inset:pl-8", className),
|
|
@@ -672,7 +671,7 @@ function MenubarSeparator({
|
|
|
672
671
|
className,
|
|
673
672
|
...props
|
|
674
673
|
}) {
|
|
675
|
-
return /* @__PURE__ */
|
|
674
|
+
return /* @__PURE__ */ jsx10(DropdownMenuSeparator, {
|
|
676
675
|
"data-slot": "menubar-separator",
|
|
677
676
|
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
678
677
|
...props
|
|
@@ -681,7 +680,7 @@ function MenubarSeparator({
|
|
|
681
680
|
function MenubarSub({
|
|
682
681
|
...props
|
|
683
682
|
}) {
|
|
684
|
-
return /* @__PURE__ */
|
|
683
|
+
return /* @__PURE__ */ jsx10(DropdownMenuSub, {
|
|
685
684
|
"data-slot": "menubar-sub",
|
|
686
685
|
...props
|
|
687
686
|
});
|
|
@@ -691,7 +690,7 @@ function MenubarSubTrigger({
|
|
|
691
690
|
inset,
|
|
692
691
|
...props
|
|
693
692
|
}) {
|
|
694
|
-
return /* @__PURE__ */
|
|
693
|
+
return /* @__PURE__ */ jsx10(DropdownMenuSubTrigger, {
|
|
695
694
|
"data-slot": "menubar-sub-trigger",
|
|
696
695
|
"data-inset": inset,
|
|
697
696
|
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),
|
|
@@ -702,7 +701,7 @@ function MenubarSubContent({
|
|
|
702
701
|
className,
|
|
703
702
|
...props
|
|
704
703
|
}) {
|
|
705
|
-
return /* @__PURE__ */
|
|
704
|
+
return /* @__PURE__ */ jsx10(DropdownMenuSubContent, {
|
|
706
705
|
"data-slot": "menubar-sub-content",
|
|
707
706
|
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),
|
|
708
707
|
...props
|
|
@@ -718,7 +717,7 @@ import {
|
|
|
718
717
|
} from "lucide-react";
|
|
719
718
|
import { useId } from "react";
|
|
720
719
|
import { useKrakstackLocale as useKrakstackLocale2 } from "@krak-stack/registry/krakstack-provider";
|
|
721
|
-
import { jsx as
|
|
720
|
+
import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
722
721
|
var messages = {
|
|
723
722
|
en: {
|
|
724
723
|
pageSize: "Page size",
|
|
@@ -761,7 +760,7 @@ function Pagination({
|
|
|
761
760
|
totalRows
|
|
762
761
|
}) {
|
|
763
762
|
const locale = useKrakstackLocale2(localeOverride);
|
|
764
|
-
const
|
|
763
|
+
const labels = paginationMessages(locale, messageOverrides);
|
|
765
764
|
const pageSizeId = useId();
|
|
766
765
|
const canGoBack = page > 0;
|
|
767
766
|
const canGoForward = page + 1 < pageCount;
|
|
@@ -771,11 +770,11 @@ function Pagination({
|
|
|
771
770
|
showResults ? /* @__PURE__ */ jsxs6("div", {
|
|
772
771
|
className: "text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1 text-sm",
|
|
773
772
|
children: [
|
|
774
|
-
/* @__PURE__ */
|
|
775
|
-
children:
|
|
773
|
+
/* @__PURE__ */ jsx11("span", {
|
|
774
|
+
children: labels.results(totalRows)
|
|
776
775
|
}),
|
|
777
|
-
selectedRows > 0 ? /* @__PURE__ */
|
|
778
|
-
children:
|
|
776
|
+
selectedRows > 0 ? /* @__PURE__ */ jsx11("span", {
|
|
777
|
+
children: labels.selectedOf(selectedRows, totalRows)
|
|
779
778
|
}) : null
|
|
780
779
|
]
|
|
781
780
|
}) : null,
|
|
@@ -785,10 +784,10 @@ function Pagination({
|
|
|
785
784
|
/* @__PURE__ */ jsxs6("div", {
|
|
786
785
|
className: "flex items-center gap-2",
|
|
787
786
|
children: [
|
|
788
|
-
/* @__PURE__ */
|
|
787
|
+
/* @__PURE__ */ jsx11(Label, {
|
|
789
788
|
htmlFor: pageSizeId,
|
|
790
789
|
className: cn("hidden text-sm sm:block", compact && "block"),
|
|
791
|
-
children:
|
|
790
|
+
children: labels.pageSize
|
|
792
791
|
}),
|
|
793
792
|
/* @__PURE__ */ jsxs6(Select, {
|
|
794
793
|
items: pageSizes.map((size) => ({
|
|
@@ -798,16 +797,16 @@ function Pagination({
|
|
|
798
797
|
value: `${pageSize}`,
|
|
799
798
|
onValueChange: (value) => onPageSizeChange(Number(value)),
|
|
800
799
|
children: [
|
|
801
|
-
/* @__PURE__ */
|
|
800
|
+
/* @__PURE__ */ jsx11(SelectTrigger, {
|
|
802
801
|
className: "h-8 w-[70px]",
|
|
803
802
|
id: pageSizeId,
|
|
804
|
-
children: /* @__PURE__ */
|
|
803
|
+
children: /* @__PURE__ */ jsx11(SelectValue, {
|
|
805
804
|
placeholder: pageSize
|
|
806
805
|
})
|
|
807
806
|
}),
|
|
808
|
-
/* @__PURE__ */
|
|
807
|
+
/* @__PURE__ */ jsx11(SelectContent, {
|
|
809
808
|
side: "top",
|
|
810
|
-
children: pageSizes.map((size) => /* @__PURE__ */
|
|
809
|
+
children: pageSizes.map((size) => /* @__PURE__ */ jsx11(SelectItem, {
|
|
811
810
|
value: `${size}`,
|
|
812
811
|
children: size
|
|
813
812
|
}, size))
|
|
@@ -819,9 +818,9 @@ function Pagination({
|
|
|
819
818
|
/* @__PURE__ */ jsxs6("div", {
|
|
820
819
|
className: "flex items-center gap-2",
|
|
821
820
|
children: [
|
|
822
|
-
/* @__PURE__ */
|
|
821
|
+
/* @__PURE__ */ jsx11("div", {
|
|
823
822
|
className: "flex items-center justify-center text-sm font-medium sm:block",
|
|
824
|
-
children:
|
|
823
|
+
children: labels.pageOf(page + 1, pageCount)
|
|
825
824
|
}),
|
|
826
825
|
/* @__PURE__ */ jsxs6("div", {
|
|
827
826
|
className: "flex items-center gap-1",
|
|
@@ -832,11 +831,11 @@ function Pagination({
|
|
|
832
831
|
onClick: () => onPageChange(0),
|
|
833
832
|
type: "button",
|
|
834
833
|
children: [
|
|
835
|
-
/* @__PURE__ */
|
|
834
|
+
/* @__PURE__ */ jsx11("span", {
|
|
836
835
|
className: "sr-only",
|
|
837
|
-
children:
|
|
836
|
+
children: labels.goToFirstPage
|
|
838
837
|
}),
|
|
839
|
-
/* @__PURE__ */
|
|
838
|
+
/* @__PURE__ */ jsx11(ChevronsLeft, {})
|
|
840
839
|
]
|
|
841
840
|
}),
|
|
842
841
|
/* @__PURE__ */ jsxs6(Button, {
|
|
@@ -845,11 +844,11 @@ function Pagination({
|
|
|
845
844
|
onClick: () => onPageChange(page - 1),
|
|
846
845
|
type: "button",
|
|
847
846
|
children: [
|
|
848
|
-
/* @__PURE__ */
|
|
847
|
+
/* @__PURE__ */ jsx11("span", {
|
|
849
848
|
className: "sr-only",
|
|
850
|
-
children:
|
|
849
|
+
children: labels.goToPreviousPage
|
|
851
850
|
}),
|
|
852
|
-
/* @__PURE__ */
|
|
851
|
+
/* @__PURE__ */ jsx11(ChevronLeft, {})
|
|
853
852
|
]
|
|
854
853
|
}),
|
|
855
854
|
/* @__PURE__ */ jsxs6(Button, {
|
|
@@ -858,11 +857,11 @@ function Pagination({
|
|
|
858
857
|
onClick: () => onPageChange(page + 1),
|
|
859
858
|
type: "button",
|
|
860
859
|
children: [
|
|
861
|
-
/* @__PURE__ */
|
|
860
|
+
/* @__PURE__ */ jsx11("span", {
|
|
862
861
|
className: "sr-only",
|
|
863
|
-
children:
|
|
862
|
+
children: labels.goToNextPage
|
|
864
863
|
}),
|
|
865
|
-
/* @__PURE__ */
|
|
864
|
+
/* @__PURE__ */ jsx11(ChevronRight, {})
|
|
866
865
|
]
|
|
867
866
|
}),
|
|
868
867
|
/* @__PURE__ */ jsxs6(Button, {
|
|
@@ -871,11 +870,11 @@ function Pagination({
|
|
|
871
870
|
onClick: () => onPageChange(pageCount - 1),
|
|
872
871
|
type: "button",
|
|
873
872
|
children: [
|
|
874
|
-
/* @__PURE__ */
|
|
873
|
+
/* @__PURE__ */ jsx11("span", {
|
|
875
874
|
className: "sr-only",
|
|
876
|
-
children:
|
|
875
|
+
children: labels.goToLastPage
|
|
877
876
|
}),
|
|
878
|
-
/* @__PURE__ */
|
|
877
|
+
/* @__PURE__ */ jsx11(ChevronsRight, {})
|
|
879
878
|
]
|
|
880
879
|
})
|
|
881
880
|
]
|
|
@@ -890,7 +889,7 @@ function Pagination({
|
|
|
890
889
|
|
|
891
890
|
// ../../src/components/ui/scroll-area.tsx
|
|
892
891
|
import { ScrollArea as ScrollAreaPrimitive } from "@base-ui/react/scroll-area";
|
|
893
|
-
import { jsx as
|
|
892
|
+
import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
894
893
|
function ScrollArea({
|
|
895
894
|
className,
|
|
896
895
|
children,
|
|
@@ -901,13 +900,13 @@ function ScrollArea({
|
|
|
901
900
|
className: cn("relative", className),
|
|
902
901
|
...props,
|
|
903
902
|
children: [
|
|
904
|
-
/* @__PURE__ */
|
|
903
|
+
/* @__PURE__ */ jsx12(ScrollAreaPrimitive.Viewport, {
|
|
905
904
|
"data-slot": "scroll-area-viewport",
|
|
906
905
|
className: "focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",
|
|
907
906
|
children
|
|
908
907
|
}),
|
|
909
|
-
/* @__PURE__ */
|
|
910
|
-
/* @__PURE__ */
|
|
908
|
+
/* @__PURE__ */ jsx12(ScrollBar, {}),
|
|
909
|
+
/* @__PURE__ */ jsx12(ScrollAreaPrimitive.Corner, {})
|
|
911
910
|
]
|
|
912
911
|
});
|
|
913
912
|
}
|
|
@@ -916,13 +915,13 @@ function ScrollBar({
|
|
|
916
915
|
orientation = "vertical",
|
|
917
916
|
...props
|
|
918
917
|
}) {
|
|
919
|
-
return /* @__PURE__ */
|
|
918
|
+
return /* @__PURE__ */ jsx12(ScrollAreaPrimitive.Scrollbar, {
|
|
920
919
|
"data-slot": "scroll-area-scrollbar",
|
|
921
920
|
"data-orientation": orientation,
|
|
922
921
|
orientation,
|
|
923
922
|
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),
|
|
924
923
|
...props,
|
|
925
|
-
children: /* @__PURE__ */
|
|
924
|
+
children: /* @__PURE__ */ jsx12(ScrollAreaPrimitive.Thumb, {
|
|
926
925
|
"data-slot": "scroll-area-thumb",
|
|
927
926
|
className: "bg-border relative flex-1 rounded-full"
|
|
928
927
|
})
|
|
@@ -930,12 +929,12 @@ function ScrollBar({
|
|
|
930
929
|
}
|
|
931
930
|
|
|
932
931
|
// ../../src/components/ui/table.tsx
|
|
933
|
-
import { jsx as
|
|
932
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
934
933
|
function Table({ className, ...props }) {
|
|
935
|
-
return /* @__PURE__ */
|
|
934
|
+
return /* @__PURE__ */ jsx13("div", {
|
|
936
935
|
"data-slot": "table-container",
|
|
937
936
|
className: "relative w-full overflow-x-auto",
|
|
938
|
-
children: /* @__PURE__ */
|
|
937
|
+
children: /* @__PURE__ */ jsx13("table", {
|
|
939
938
|
"data-slot": "table",
|
|
940
939
|
className: cn("w-full caption-bottom text-sm", className),
|
|
941
940
|
...props
|
|
@@ -943,35 +942,35 @@ function Table({ className, ...props }) {
|
|
|
943
942
|
});
|
|
944
943
|
}
|
|
945
944
|
function TableHeader({ className, ...props }) {
|
|
946
|
-
return /* @__PURE__ */
|
|
945
|
+
return /* @__PURE__ */ jsx13("thead", {
|
|
947
946
|
"data-slot": "table-header",
|
|
948
947
|
className: cn("[&_tr]:border-b", className),
|
|
949
948
|
...props
|
|
950
949
|
});
|
|
951
950
|
}
|
|
952
951
|
function TableBody({ className, ...props }) {
|
|
953
|
-
return /* @__PURE__ */
|
|
952
|
+
return /* @__PURE__ */ jsx13("tbody", {
|
|
954
953
|
"data-slot": "table-body",
|
|
955
954
|
className: cn("[&_tr:last-child]:border-0", className),
|
|
956
955
|
...props
|
|
957
956
|
});
|
|
958
957
|
}
|
|
959
958
|
function TableRow({ className, ...props }) {
|
|
960
|
-
return /* @__PURE__ */
|
|
959
|
+
return /* @__PURE__ */ jsx13("tr", {
|
|
961
960
|
"data-slot": "table-row",
|
|
962
961
|
className: cn("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted", className),
|
|
963
962
|
...props
|
|
964
963
|
});
|
|
965
964
|
}
|
|
966
965
|
function TableHead({ className, ...props }) {
|
|
967
|
-
return /* @__PURE__ */
|
|
966
|
+
return /* @__PURE__ */ jsx13("th", {
|
|
968
967
|
"data-slot": "table-head",
|
|
969
968
|
className: cn("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0", className),
|
|
970
969
|
...props
|
|
971
970
|
});
|
|
972
971
|
}
|
|
973
972
|
function TableCell({ className, ...props }) {
|
|
974
|
-
return /* @__PURE__ */
|
|
973
|
+
return /* @__PURE__ */ jsx13("td", {
|
|
975
974
|
"data-slot": "table-cell",
|
|
976
975
|
className: cn("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0", className),
|
|
977
976
|
...props
|
|
@@ -980,26 +979,26 @@ function TableCell({ className, ...props }) {
|
|
|
980
979
|
|
|
981
980
|
// ../../src/components/ui/tooltip.tsx
|
|
982
981
|
import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip";
|
|
983
|
-
import { jsx as
|
|
982
|
+
import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
984
983
|
"use client";
|
|
985
984
|
function TooltipProvider({
|
|
986
985
|
delay = 0,
|
|
987
986
|
...props
|
|
988
987
|
}) {
|
|
989
|
-
return /* @__PURE__ */
|
|
988
|
+
return /* @__PURE__ */ jsx14(TooltipPrimitive.Provider, {
|
|
990
989
|
"data-slot": "tooltip-provider",
|
|
991
990
|
delay,
|
|
992
991
|
...props
|
|
993
992
|
});
|
|
994
993
|
}
|
|
995
994
|
function Tooltip({ ...props }) {
|
|
996
|
-
return /* @__PURE__ */
|
|
995
|
+
return /* @__PURE__ */ jsx14(TooltipPrimitive.Root, {
|
|
997
996
|
"data-slot": "tooltip",
|
|
998
997
|
...props
|
|
999
998
|
});
|
|
1000
999
|
}
|
|
1001
1000
|
function TooltipTrigger({ ...props }) {
|
|
1002
|
-
return /* @__PURE__ */
|
|
1001
|
+
return /* @__PURE__ */ jsx14(TooltipPrimitive.Trigger, {
|
|
1003
1002
|
"data-slot": "tooltip-trigger",
|
|
1004
1003
|
...props
|
|
1005
1004
|
});
|
|
@@ -1013,8 +1012,8 @@ function TooltipContent({
|
|
|
1013
1012
|
children,
|
|
1014
1013
|
...props
|
|
1015
1014
|
}) {
|
|
1016
|
-
return /* @__PURE__ */
|
|
1017
|
-
children: /* @__PURE__ */
|
|
1015
|
+
return /* @__PURE__ */ jsx14(TooltipPrimitive.Portal, {
|
|
1016
|
+
children: /* @__PURE__ */ jsx14(TooltipPrimitive.Positioner, {
|
|
1018
1017
|
align,
|
|
1019
1018
|
alignOffset,
|
|
1020
1019
|
side,
|
|
@@ -1026,7 +1025,7 @@ function TooltipContent({
|
|
|
1026
1025
|
...props,
|
|
1027
1026
|
children: [
|
|
1028
1027
|
children,
|
|
1029
|
-
/* @__PURE__ */
|
|
1028
|
+
/* @__PURE__ */ jsx14(TooltipPrimitive.Arrow, {
|
|
1030
1029
|
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"
|
|
1031
1030
|
})
|
|
1032
1031
|
]
|
|
@@ -1204,7 +1203,7 @@ var PaginationMeta = Schema.Struct({
|
|
|
1204
1203
|
|
|
1205
1204
|
// ../../src/components/ui/data-table.tsx
|
|
1206
1205
|
import { useKrakstackLocale as useKrakstackLocale3 } from "@krak-stack/registry/krakstack-provider";
|
|
1207
|
-
import { jsx as
|
|
1206
|
+
import { jsx as jsx15, jsxs as jsxs9, Fragment } from "react/jsx-runtime";
|
|
1208
1207
|
var DataTablePersistedUiStateSchema = Schema2.Struct({
|
|
1209
1208
|
columnVisibility: Schema2.Record(Schema2.String, Schema2.Boolean),
|
|
1210
1209
|
columnSizing: Schema2.Record(Schema2.String, Schema2.Finite),
|
|
@@ -1224,18 +1223,18 @@ var DataTableReferenceCell = ({
|
|
|
1224
1223
|
return /* @__PURE__ */ jsxs9("div", {
|
|
1225
1224
|
className: "flex min-w-0 items-center gap-2",
|
|
1226
1225
|
children: [
|
|
1227
|
-
/* @__PURE__ */
|
|
1226
|
+
/* @__PURE__ */ jsx15("div", {
|
|
1228
1227
|
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),
|
|
1229
|
-
children: item.icon ? /* @__PURE__ */
|
|
1228
|
+
children: item.icon ? /* @__PURE__ */ jsx15("span", {
|
|
1230
1229
|
"aria-hidden": "true",
|
|
1231
1230
|
className: "[&_svg]:size-4",
|
|
1232
1231
|
children: item.icon
|
|
1233
|
-
}) : item.imageSrc && item.imageSrc !== failedImage ? /* @__PURE__ */
|
|
1232
|
+
}) : item.imageSrc && item.imageSrc !== failedImage ? /* @__PURE__ */ jsx15("img", {
|
|
1234
1233
|
src: item.imageSrc,
|
|
1235
1234
|
alt: item.label,
|
|
1236
1235
|
className: "size-full object-cover",
|
|
1237
1236
|
onError: () => setFailedImage(item.imageSrc ?? undefined)
|
|
1238
|
-
}) : /* @__PURE__ */
|
|
1237
|
+
}) : /* @__PURE__ */ jsx15("span", {
|
|
1239
1238
|
"aria-hidden": "true",
|
|
1240
1239
|
children: initials
|
|
1241
1240
|
})
|
|
@@ -1243,11 +1242,11 @@ var DataTableReferenceCell = ({
|
|
|
1243
1242
|
/* @__PURE__ */ jsxs9("div", {
|
|
1244
1243
|
className: "flex min-w-0 flex-col leading-tight",
|
|
1245
1244
|
children: [
|
|
1246
|
-
/* @__PURE__ */
|
|
1245
|
+
/* @__PURE__ */ jsx15("span", {
|
|
1247
1246
|
className: "truncate font-medium",
|
|
1248
1247
|
children: item.label
|
|
1249
1248
|
}),
|
|
1250
|
-
item.description ? /* @__PURE__ */
|
|
1249
|
+
item.description ? /* @__PURE__ */ jsx15("span", {
|
|
1251
1250
|
className: "text-muted-foreground truncate text-xs",
|
|
1252
1251
|
children: item.description
|
|
1253
1252
|
}) : null
|
|
@@ -1628,9 +1627,9 @@ var sortDataTableRows = (rows, columns, sorting) => {
|
|
|
1628
1627
|
const nullOrder = colDef.typeOptions?.nulls === "first" ? -1 : 1;
|
|
1629
1628
|
return leftScalar === undefined ? nullOrder : -nullOrder;
|
|
1630
1629
|
}
|
|
1631
|
-
const
|
|
1632
|
-
if (
|
|
1633
|
-
return sort.direction === "desc" ? -
|
|
1630
|
+
const comparison = leftScalar - rightScalar;
|
|
1631
|
+
if (comparison !== 0)
|
|
1632
|
+
return sort.direction === "desc" ? -comparison : comparison;
|
|
1634
1633
|
continue;
|
|
1635
1634
|
}
|
|
1636
1635
|
if (!colDef.comparator && (colDef.type === "date" || colDef.type === "dateTime")) {
|
|
@@ -1642,9 +1641,9 @@ var sortDataTableRows = (rows, columns, sorting) => {
|
|
|
1642
1641
|
const nullOrder = colDef.typeOptions?.nulls === "first" ? -1 : 1;
|
|
1643
1642
|
return !leftDate ? nullOrder : -nullOrder;
|
|
1644
1643
|
}
|
|
1645
|
-
const
|
|
1646
|
-
if (
|
|
1647
|
-
return sort.direction === "desc" ? -
|
|
1644
|
+
const comparison = DateTime2.toEpochMillis(leftDate.instant) - DateTime2.toEpochMillis(rightDate.instant);
|
|
1645
|
+
if (comparison !== 0)
|
|
1646
|
+
return sort.direction === "desc" ? -comparison : comparison;
|
|
1648
1647
|
continue;
|
|
1649
1648
|
}
|
|
1650
1649
|
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" });
|
|
@@ -1831,7 +1830,7 @@ var canMoveRowsToGroups = (store) => getActiveGrouping(store).some((field) => !!
|
|
|
1831
1830
|
var canDragRows = (store) => getActiveGrouping(store).length ? canMoveRowsToGroups(store) : canReorderRows(store);
|
|
1832
1831
|
var hasRowActionMenu = (store) => !!store.config.features.rowActions || canReorderRows(store);
|
|
1833
1832
|
var getSelectedRows = (store, model) => model.rows.filter((row) => store.state.rowSelection[row.id]).map((row) => row.data);
|
|
1834
|
-
var renderCell = (row, column, locale = "en",
|
|
1833
|
+
var renderCell = (row, column, locale = "en", labels = dataTableMessages(locale)) => {
|
|
1835
1834
|
const value = row.values.get(column.id);
|
|
1836
1835
|
const params = {
|
|
1837
1836
|
data: row.data,
|
|
@@ -1842,14 +1841,14 @@ var renderCell = (row, column, locale = "en", labels2 = dataTableMessages(locale
|
|
|
1842
1841
|
};
|
|
1843
1842
|
const CellRenderer = column.colDef.cellRenderer;
|
|
1844
1843
|
if (CellRenderer)
|
|
1845
|
-
return /* @__PURE__ */
|
|
1844
|
+
return /* @__PURE__ */ jsx15(CellRenderer, {
|
|
1846
1845
|
...params
|
|
1847
1846
|
});
|
|
1848
1847
|
const colDef = column.colDef;
|
|
1849
1848
|
if (colDef.type === "reference") {
|
|
1850
1849
|
if (colDef.valueFormatter)
|
|
1851
1850
|
return colDef.valueFormatter(params);
|
|
1852
|
-
return /* @__PURE__ */
|
|
1851
|
+
return /* @__PURE__ */ jsx15(DataTableReferenceCell, {
|
|
1853
1852
|
item: colDef.typeOptions.getItem(row.data),
|
|
1854
1853
|
emptyLabel: colDef.typeOptions.emptyLabel,
|
|
1855
1854
|
imageVariant: colDef.typeOptions.imageVariant
|
|
@@ -1859,7 +1858,7 @@ var renderCell = (row, column, locale = "en", labels2 = dataTableMessages(locale
|
|
|
1859
1858
|
if (colDef.valueFormatter)
|
|
1860
1859
|
return colDef.valueFormatter(params);
|
|
1861
1860
|
const number = Option2.getOrUndefined(decodeNumberValue(value));
|
|
1862
|
-
return /* @__PURE__ */
|
|
1861
|
+
return /* @__PURE__ */ jsx15("span", {
|
|
1863
1862
|
className: "block text-left tabular-nums",
|
|
1864
1863
|
children: number === undefined ? colDef.typeOptions?.emptyLabel ?? "—" : formatNumberValue(number, colDef.typeOptions, locale)
|
|
1865
1864
|
});
|
|
@@ -1871,12 +1870,12 @@ var renderCell = (row, column, locale = "en", labels2 = dataTableMessages(locale
|
|
|
1871
1870
|
if (boolean === undefined)
|
|
1872
1871
|
return colDef.typeOptions?.emptyLabel ?? "—";
|
|
1873
1872
|
const options = colDef.typeOptions;
|
|
1874
|
-
return /* @__PURE__ */
|
|
1873
|
+
return /* @__PURE__ */ jsx15("label", {
|
|
1875
1874
|
"data-slot": "data-table-boolean-cell",
|
|
1876
1875
|
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"),
|
|
1877
1876
|
onClick: (event) => event.stopPropagation(),
|
|
1878
1877
|
onPointerDown: (event) => event.stopPropagation(),
|
|
1879
|
-
children: /* @__PURE__ */
|
|
1878
|
+
children: /* @__PURE__ */ jsx15(Checkbox, {
|
|
1880
1879
|
"aria-label": options?.getAriaLabel?.(row.data) ?? columnLabel(column),
|
|
1881
1880
|
className: "focus-visible:ring-0 focus-visible:outline-none",
|
|
1882
1881
|
checked: boolean,
|
|
@@ -1890,7 +1889,7 @@ var renderCell = (row, column, locale = "en", labels2 = dataTableMessages(locale
|
|
|
1890
1889
|
if (colDef.valueFormatter)
|
|
1891
1890
|
return colDef.valueFormatter(params);
|
|
1892
1891
|
const date = resolveDate(value, colDef.type);
|
|
1893
|
-
return date ? /* @__PURE__ */
|
|
1892
|
+
return date ? /* @__PURE__ */ jsx15("time", {
|
|
1894
1893
|
dateTime: dateIsoValue(date),
|
|
1895
1894
|
children: formatDateValue(date, colDef, locale)
|
|
1896
1895
|
}) : colDef.typeOptions?.emptyLabel ?? "—";
|
|
@@ -1904,26 +1903,26 @@ var renderCell = (row, column, locale = "en", labels2 = dataTableMessages(locale
|
|
|
1904
1903
|
disabled: (item) => action.disabled?.({ item, row: row.data }) ?? false
|
|
1905
1904
|
}));
|
|
1906
1905
|
if (config.getOptions) {
|
|
1907
|
-
return /* @__PURE__ */
|
|
1906
|
+
return /* @__PURE__ */ jsx15(DataTableListCell, {
|
|
1908
1907
|
...config,
|
|
1909
1908
|
itemActions,
|
|
1910
1909
|
onItemClick: config.onItemClick ? (item) => config.onItemClick?.({ item, row: row.data }) : undefined,
|
|
1911
1910
|
items: config.getItems(row.data),
|
|
1912
1911
|
locale,
|
|
1913
|
-
messages: { [locale]:
|
|
1912
|
+
messages: { [locale]: labels },
|
|
1914
1913
|
options: config.getOptions(row.data),
|
|
1915
1914
|
totalCount: config.getTotalCount?.(row.data),
|
|
1916
|
-
onAdd: config.onAdd ? (
|
|
1917
|
-
onRemove: config.onRemove ? (
|
|
1915
|
+
onAdd: config.onAdd ? (value) => config.onAdd?.({ value, row: row.data }) : undefined,
|
|
1916
|
+
onRemove: config.onRemove ? (value) => config.onRemove?.({ value, row: row.data }) : undefined
|
|
1918
1917
|
});
|
|
1919
1918
|
}
|
|
1920
|
-
return /* @__PURE__ */
|
|
1919
|
+
return /* @__PURE__ */ jsx15(DataTableListCell, {
|
|
1921
1920
|
...config,
|
|
1922
1921
|
itemActions,
|
|
1923
1922
|
onItemClick: config.onItemClick ? (item) => config.onItemClick?.({ item, row: row.data }) : undefined,
|
|
1924
1923
|
items: config.getItems(row.data),
|
|
1925
1924
|
locale,
|
|
1926
|
-
messages: { [locale]:
|
|
1925
|
+
messages: { [locale]: labels },
|
|
1927
1926
|
totalCount: config.getTotalCount?.(row.data)
|
|
1928
1927
|
});
|
|
1929
1928
|
}
|
|
@@ -1966,30 +1965,30 @@ var DataTableRowActions = ({
|
|
|
1966
1965
|
return null;
|
|
1967
1966
|
return /* @__PURE__ */ jsxs9(DropdownMenu, {
|
|
1968
1967
|
children: [
|
|
1969
|
-
/* @__PURE__ */
|
|
1968
|
+
/* @__PURE__ */ jsx15(DropdownMenuTrigger, {
|
|
1970
1969
|
onClick: (event) => event.stopPropagation(),
|
|
1971
1970
|
render: /* @__PURE__ */ jsxs9(Button, {
|
|
1972
1971
|
className: "size-8 focus-visible:ring-inset [&_svg:not([class*='size-'])]:size-4",
|
|
1973
1972
|
size: "icon",
|
|
1974
1973
|
variant: "ghost",
|
|
1975
1974
|
children: [
|
|
1976
|
-
/* @__PURE__ */
|
|
1975
|
+
/* @__PURE__ */ jsx15("span", {
|
|
1977
1976
|
className: "sr-only",
|
|
1978
1977
|
children: title
|
|
1979
1978
|
}),
|
|
1980
|
-
/* @__PURE__ */
|
|
1979
|
+
/* @__PURE__ */ jsx15(MoreHorizontal, {})
|
|
1981
1980
|
]
|
|
1982
1981
|
})
|
|
1983
1982
|
}),
|
|
1984
|
-
/* @__PURE__ */
|
|
1983
|
+
/* @__PURE__ */ jsx15(DropdownMenuContent, {
|
|
1985
1984
|
align: "end",
|
|
1986
1985
|
className: "w-max",
|
|
1987
1986
|
children: /* @__PURE__ */ jsxs9(DropdownMenuGroup, {
|
|
1988
1987
|
children: [
|
|
1989
|
-
/* @__PURE__ */
|
|
1988
|
+
/* @__PURE__ */ jsx15(DropdownMenuLabel, {
|
|
1990
1989
|
children: title
|
|
1991
1990
|
}),
|
|
1992
|
-
/* @__PURE__ */
|
|
1991
|
+
/* @__PURE__ */ jsx15(DropdownMenuSeparator, {}),
|
|
1993
1992
|
visible.map((action) => /* @__PURE__ */ jsxs9(DropdownMenuItem, {
|
|
1994
1993
|
onClick: (event) => {
|
|
1995
1994
|
event.stopPropagation();
|
|
@@ -2027,7 +2026,7 @@ var DataTableRowActionMenu = ({
|
|
|
2027
2026
|
reorderActions.push({
|
|
2028
2027
|
id: "data-table-move-up",
|
|
2029
2028
|
name: store.config.labels.moveUp,
|
|
2030
|
-
icon: /* @__PURE__ */
|
|
2029
|
+
icon: /* @__PURE__ */ jsx15(ArrowUp, {}),
|
|
2031
2030
|
onClick: () => move(rowIndex - 1)
|
|
2032
2031
|
});
|
|
2033
2032
|
}
|
|
@@ -2035,12 +2034,12 @@ var DataTableRowActionMenu = ({
|
|
|
2035
2034
|
reorderActions.push({
|
|
2036
2035
|
id: "data-table-move-down",
|
|
2037
2036
|
name: store.config.labels.moveDown,
|
|
2038
|
-
icon: /* @__PURE__ */
|
|
2037
|
+
icon: /* @__PURE__ */ jsx15(ArrowDown, {}),
|
|
2039
2038
|
onClick: () => move(rowIndex + 1)
|
|
2040
2039
|
});
|
|
2041
2040
|
}
|
|
2042
2041
|
}
|
|
2043
|
-
return /* @__PURE__ */
|
|
2042
|
+
return /* @__PURE__ */ jsx15(DataTableRowActions, {
|
|
2044
2043
|
actions: [...reorderActions, ...rowActions ? rowActions.items : []],
|
|
2045
2044
|
row: row.data,
|
|
2046
2045
|
title: rowActions?.label ?? store.config.labels.actions
|
|
@@ -2053,7 +2052,7 @@ var DataTableToolbar = ({
|
|
|
2053
2052
|
const exportPending = useRef(false);
|
|
2054
2053
|
const [exporting, setExporting] = useState(false);
|
|
2055
2054
|
const [exportFailed, setExportFailed] = useState(false);
|
|
2056
|
-
const { features, labels
|
|
2055
|
+
const { features, labels } = store.config;
|
|
2057
2056
|
const model = deriveModel(store);
|
|
2058
2057
|
const selectedRows = getSelectedRows(store, model);
|
|
2059
2058
|
const grouping = features.grouping;
|
|
@@ -2093,21 +2092,21 @@ var DataTableToolbar = ({
|
|
|
2093
2092
|
features.search !== false ? /* @__PURE__ */ jsxs9("div", {
|
|
2094
2093
|
className: "relative min-w-0",
|
|
2095
2094
|
children: [
|
|
2096
|
-
/* @__PURE__ */
|
|
2095
|
+
/* @__PURE__ */ jsx15(Search, {
|
|
2097
2096
|
className: "text-muted-foreground pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2"
|
|
2098
2097
|
}),
|
|
2099
|
-
/* @__PURE__ */
|
|
2098
|
+
/* @__PURE__ */ jsx15(Input, {
|
|
2100
2099
|
className: "px-9",
|
|
2101
2100
|
onChange: (event) => update((state) => ({
|
|
2102
2101
|
...state,
|
|
2103
2102
|
globalFilter: event.target.value,
|
|
2104
2103
|
page: 0
|
|
2105
2104
|
})),
|
|
2106
|
-
placeholder:
|
|
2105
|
+
placeholder: labels.filter,
|
|
2107
2106
|
value: store.state.globalFilter ?? ""
|
|
2108
2107
|
}),
|
|
2109
|
-
store.state.globalFilter ? /* @__PURE__ */
|
|
2110
|
-
"aria-label":
|
|
2108
|
+
store.state.globalFilter ? /* @__PURE__ */ jsx15(Button, {
|
|
2109
|
+
"aria-label": labels.filter,
|
|
2111
2110
|
className: "absolute top-1/2 right-1 size-7 -translate-y-1/2 active:not-aria-[haspopup]:-translate-y-1/2",
|
|
2112
2111
|
onClick: () => update((state) => ({
|
|
2113
2112
|
...state,
|
|
@@ -2116,11 +2115,11 @@ var DataTableToolbar = ({
|
|
|
2116
2115
|
})),
|
|
2117
2116
|
size: "icon",
|
|
2118
2117
|
variant: "ghost",
|
|
2119
|
-
children: /* @__PURE__ */
|
|
2118
|
+
children: /* @__PURE__ */ jsx15(X, {})
|
|
2120
2119
|
}) : null
|
|
2121
2120
|
]
|
|
2122
2121
|
}) : null,
|
|
2123
|
-
/* @__PURE__ */
|
|
2122
|
+
/* @__PURE__ */ jsx15("div", {
|
|
2124
2123
|
className: "-m-1 flex overflow-x-auto p-1",
|
|
2125
2124
|
children: /* @__PURE__ */ jsxs9(Menubar, {
|
|
2126
2125
|
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",
|
|
@@ -2130,23 +2129,23 @@ var DataTableToolbar = ({
|
|
|
2130
2129
|
/* @__PURE__ */ jsxs9(MenubarTrigger, {
|
|
2131
2130
|
className: "bg-primary text-primary-foreground hover:bg-primary/90 aria-expanded:bg-primary/90",
|
|
2132
2131
|
children: [
|
|
2133
|
-
|
|
2134
|
-
/* @__PURE__ */
|
|
2132
|
+
labels.selected,
|
|
2133
|
+
/* @__PURE__ */ jsx15(Badge, {
|
|
2135
2134
|
variant: "secondary",
|
|
2136
2135
|
children: selectedRows.length
|
|
2137
2136
|
}),
|
|
2138
|
-
/* @__PURE__ */
|
|
2137
|
+
/* @__PURE__ */ jsx15(ChevronDown, {})
|
|
2139
2138
|
]
|
|
2140
2139
|
}),
|
|
2141
|
-
/* @__PURE__ */
|
|
2140
|
+
/* @__PURE__ */ jsx15(MenubarContent, {
|
|
2142
2141
|
align: "end",
|
|
2143
2142
|
className: "w-max",
|
|
2144
2143
|
children: /* @__PURE__ */ jsxs9(MenubarGroup, {
|
|
2145
2144
|
children: [
|
|
2146
|
-
/* @__PURE__ */
|
|
2147
|
-
children: bulkActions && bulkActions.label ? bulkActions.label :
|
|
2145
|
+
/* @__PURE__ */ jsx15(MenubarLabel, {
|
|
2146
|
+
children: bulkActions && bulkActions.label ? bulkActions.label : labels.actions
|
|
2148
2147
|
}),
|
|
2149
|
-
/* @__PURE__ */
|
|
2148
|
+
/* @__PURE__ */ jsx15(MenubarSeparator, {}),
|
|
2150
2149
|
visibleBulkActions.map((action) => /* @__PURE__ */ jsxs9(MenubarItem, {
|
|
2151
2150
|
onClick: () => action.onClick(selectedRows),
|
|
2152
2151
|
variant: action.variant ?? "default",
|
|
@@ -2161,30 +2160,30 @@ var DataTableToolbar = ({
|
|
|
2161
2160
|
]
|
|
2162
2161
|
}) : null,
|
|
2163
2162
|
toolbar && toolbar.items,
|
|
2164
|
-
features.filtering !== false ? /* @__PURE__ */
|
|
2163
|
+
features.filtering !== false ? /* @__PURE__ */ jsx15(FilterMenu, {
|
|
2165
2164
|
tableAtom
|
|
2166
2165
|
}) : null,
|
|
2167
2166
|
grouping ? /* @__PURE__ */ jsxs9(MenubarMenu, {
|
|
2168
2167
|
children: [
|
|
2169
2168
|
/* @__PURE__ */ jsxs9(MenubarTrigger, {
|
|
2170
|
-
"aria-label":
|
|
2169
|
+
"aria-label": labels.groupBy,
|
|
2171
2170
|
children: [
|
|
2172
|
-
/* @__PURE__ */
|
|
2173
|
-
/* @__PURE__ */
|
|
2171
|
+
/* @__PURE__ */ jsx15(Rows3, {}),
|
|
2172
|
+
/* @__PURE__ */ jsx15("span", {
|
|
2174
2173
|
className: "hidden sm:inline",
|
|
2175
|
-
children:
|
|
2174
|
+
children: labels.groupBy
|
|
2176
2175
|
})
|
|
2177
2176
|
]
|
|
2178
2177
|
}),
|
|
2179
|
-
/* @__PURE__ */
|
|
2178
|
+
/* @__PURE__ */ jsx15(MenubarContent, {
|
|
2180
2179
|
align: "end",
|
|
2181
2180
|
children: /* @__PURE__ */ jsxs9(MenubarGroup, {
|
|
2182
2181
|
children: [
|
|
2183
|
-
/* @__PURE__ */
|
|
2184
|
-
children:
|
|
2182
|
+
/* @__PURE__ */ jsx15(MenubarLabel, {
|
|
2183
|
+
children: labels.groupBy
|
|
2185
2184
|
}),
|
|
2186
|
-
/* @__PURE__ */
|
|
2187
|
-
grouping.fields.map((field) => /* @__PURE__ */
|
|
2185
|
+
/* @__PURE__ */ jsx15(MenubarSeparator, {}),
|
|
2186
|
+
grouping.fields.map((field) => /* @__PURE__ */ jsx15(MenubarCheckboxItem, {
|
|
2188
2187
|
checked: store.state.grouping.includes(field.id),
|
|
2189
2188
|
onCheckedChange: (checked) => update((state) => ({
|
|
2190
2189
|
...state,
|
|
@@ -2197,24 +2196,24 @@ var DataTableToolbar = ({
|
|
|
2197
2196
|
})
|
|
2198
2197
|
]
|
|
2199
2198
|
}) : null,
|
|
2200
|
-
features.sorting !== false ? /* @__PURE__ */
|
|
2199
|
+
features.sorting !== false ? /* @__PURE__ */ jsx15(SortMenu, {
|
|
2201
2200
|
tableAtom
|
|
2202
2201
|
}) : null,
|
|
2203
|
-
features.gallery ? /* @__PURE__ */
|
|
2202
|
+
features.gallery ? /* @__PURE__ */ jsx15(ViewMenu, {
|
|
2204
2203
|
tableAtom
|
|
2205
2204
|
}) : null,
|
|
2206
|
-
features.columnVisibility !== false ? /* @__PURE__ */
|
|
2205
|
+
features.columnVisibility !== false ? /* @__PURE__ */ jsx15(ColumnMenu, {
|
|
2207
2206
|
tableAtom
|
|
2208
2207
|
}) : null,
|
|
2209
|
-
features.refresh ? /* @__PURE__ */
|
|
2208
|
+
features.refresh ? /* @__PURE__ */ jsx15(MenubarMenu, {
|
|
2210
2209
|
children: /* @__PURE__ */ jsxs9(MenubarTrigger, {
|
|
2211
|
-
"aria-label":
|
|
2210
|
+
"aria-label": labels.refresh,
|
|
2212
2211
|
onClick: features.refresh,
|
|
2213
2212
|
children: [
|
|
2214
|
-
/* @__PURE__ */
|
|
2215
|
-
/* @__PURE__ */
|
|
2213
|
+
/* @__PURE__ */ jsx15(RefreshCw, {}),
|
|
2214
|
+
/* @__PURE__ */ jsx15("span", {
|
|
2216
2215
|
className: "hidden sm:inline",
|
|
2217
|
-
children:
|
|
2216
|
+
children: labels.refresh
|
|
2218
2217
|
})
|
|
2219
2218
|
]
|
|
2220
2219
|
})
|
|
@@ -2222,35 +2221,35 @@ var DataTableToolbar = ({
|
|
|
2222
2221
|
features.export ? /* @__PURE__ */ jsxs9(MenubarMenu, {
|
|
2223
2222
|
children: [
|
|
2224
2223
|
/* @__PURE__ */ jsxs9(MenubarTrigger, {
|
|
2225
|
-
"aria-label":
|
|
2224
|
+
"aria-label": labels.export,
|
|
2226
2225
|
"aria-busy": exporting,
|
|
2227
2226
|
disabled: exporting || !canExport,
|
|
2228
2227
|
children: [
|
|
2229
|
-
exporting ? /* @__PURE__ */
|
|
2228
|
+
exporting ? /* @__PURE__ */ jsx15(RefreshCw, {
|
|
2230
2229
|
className: "animate-spin"
|
|
2231
|
-
}) : /* @__PURE__ */
|
|
2232
|
-
/* @__PURE__ */
|
|
2230
|
+
}) : /* @__PURE__ */ jsx15(Download, {}),
|
|
2231
|
+
/* @__PURE__ */ jsx15("span", {
|
|
2233
2232
|
className: "hidden sm:inline",
|
|
2234
|
-
children: exporting ?
|
|
2233
|
+
children: exporting ? labels.loading : labels.export
|
|
2235
2234
|
})
|
|
2236
2235
|
]
|
|
2237
2236
|
}),
|
|
2238
|
-
/* @__PURE__ */
|
|
2237
|
+
/* @__PURE__ */ jsx15(MenubarContent, {
|
|
2239
2238
|
align: "end",
|
|
2240
2239
|
children: /* @__PURE__ */ jsxs9(MenubarGroup, {
|
|
2241
2240
|
children: [
|
|
2242
|
-
/* @__PURE__ */
|
|
2243
|
-
children:
|
|
2241
|
+
/* @__PURE__ */ jsx15(MenubarLabel, {
|
|
2242
|
+
children: labels.export
|
|
2244
2243
|
}),
|
|
2245
|
-
/* @__PURE__ */
|
|
2244
|
+
/* @__PURE__ */ jsx15(MenubarSeparator, {}),
|
|
2246
2245
|
builtInExport ? /* @__PURE__ */ jsxs9(Fragment, {
|
|
2247
2246
|
children: [
|
|
2248
2247
|
/* @__PURE__ */ jsxs9(MenubarItem, {
|
|
2249
2248
|
disabled: exporting || !exportRows.length,
|
|
2250
2249
|
onClick: () => downloadCsv(exportColumns.map(columnLabel), exportRows.map((row) => exportColumns.map((column) => dataTableValueText(getDataTableExportValue(row, column, store.config.locale) ?? ""))), features.export ? features.export.baseName : "table"),
|
|
2251
2250
|
children: [
|
|
2252
|
-
/* @__PURE__ */
|
|
2253
|
-
|
|
2251
|
+
/* @__PURE__ */ jsx15(FileText, {}),
|
|
2252
|
+
labels.exportCsv
|
|
2254
2253
|
]
|
|
2255
2254
|
}),
|
|
2256
2255
|
/* @__PURE__ */ jsxs9(MenubarItem, {
|
|
@@ -2260,13 +2259,13 @@ var DataTableToolbar = ({
|
|
|
2260
2259
|
getDataTableExportValue(row, column, store.config.locale)
|
|
2261
2260
|
]))), features.export ? features.export.baseName : "table"),
|
|
2262
2261
|
children: [
|
|
2263
|
-
/* @__PURE__ */
|
|
2264
|
-
|
|
2262
|
+
/* @__PURE__ */ jsx15(FileJson, {}),
|
|
2263
|
+
labels.exportJson
|
|
2265
2264
|
]
|
|
2266
2265
|
})
|
|
2267
2266
|
]
|
|
2268
2267
|
}) : null,
|
|
2269
|
-
builtInExport && exportActions.length ? /* @__PURE__ */
|
|
2268
|
+
builtInExport && exportActions.length ? /* @__PURE__ */ jsx15(MenubarSeparator, {}) : null,
|
|
2270
2269
|
exportActions.map((action) => /* @__PURE__ */ jsxs9(MenubarItem, {
|
|
2271
2270
|
disabled: exporting || action.disabled,
|
|
2272
2271
|
onClick: () => void runExport(action),
|
|
@@ -2283,10 +2282,10 @@ var DataTableToolbar = ({
|
|
|
2283
2282
|
]
|
|
2284
2283
|
})
|
|
2285
2284
|
}),
|
|
2286
|
-
exportFeature && exportFailed ? /* @__PURE__ */
|
|
2285
|
+
exportFeature && exportFailed ? /* @__PURE__ */ jsx15("p", {
|
|
2287
2286
|
role: "alert",
|
|
2288
2287
|
className: "text-destructive text-sm",
|
|
2289
|
-
children:
|
|
2288
|
+
children: labels.exportFailed ?? dataTableMessages(store.config.locale).exportFailed
|
|
2290
2289
|
}) : null
|
|
2291
2290
|
]
|
|
2292
2291
|
});
|
|
@@ -2301,7 +2300,7 @@ var FilterEditor = ({
|
|
|
2301
2300
|
column,
|
|
2302
2301
|
rows,
|
|
2303
2302
|
current,
|
|
2304
|
-
labels
|
|
2303
|
+
labels,
|
|
2305
2304
|
onChange
|
|
2306
2305
|
}) => {
|
|
2307
2306
|
const inputId = useId2();
|
|
@@ -2310,10 +2309,10 @@ var FilterEditor = ({
|
|
|
2310
2309
|
const [secondary, setSecondary] = useState(current?.kind === "number" ? String(current.max ?? "") : current?.kind === "date" ? current.to ?? "" : "");
|
|
2311
2310
|
const [operator, setOperator] = useState(current?.kind === "text" ? current.operator : "contains");
|
|
2312
2311
|
const operatorOptions = [
|
|
2313
|
-
{ value: "contains", label:
|
|
2314
|
-
{ value: "equals", label:
|
|
2315
|
-
{ value: "startsWith", label:
|
|
2316
|
-
{ value: "endsWith", label:
|
|
2312
|
+
{ value: "contains", label: labels.filterContains },
|
|
2313
|
+
{ value: "equals", label: labels.filterEquals },
|
|
2314
|
+
{ value: "startsWith", label: labels.filterStartsWith },
|
|
2315
|
+
{ value: "endsWith", label: labels.filterEndsWith }
|
|
2317
2316
|
];
|
|
2318
2317
|
const [invalid, setInvalid] = useState(false);
|
|
2319
2318
|
const [optionSearch, setOptionSearch] = useState("");
|
|
@@ -2333,23 +2332,23 @@ var FilterEditor = ({
|
|
|
2333
2332
|
value: current?.kind === "boolean" ? String(current.value) : "",
|
|
2334
2333
|
onValueChange: (value) => apply({ id: column.id, kind, value: value === "true" }),
|
|
2335
2334
|
children: [
|
|
2336
|
-
/* @__PURE__ */
|
|
2335
|
+
/* @__PURE__ */ jsx15(MenubarRadioItem, {
|
|
2337
2336
|
value: "true",
|
|
2338
2337
|
closeOnClick: false,
|
|
2339
|
-
children: column.colDef.type === "boolean" ? column.colDef.typeOptions?.trueLabel ??
|
|
2338
|
+
children: column.colDef.type === "boolean" ? column.colDef.typeOptions?.trueLabel ?? labels.filterTrue : labels.filterTrue
|
|
2340
2339
|
}),
|
|
2341
|
-
/* @__PURE__ */
|
|
2340
|
+
/* @__PURE__ */ jsx15(MenubarRadioItem, {
|
|
2342
2341
|
value: "false",
|
|
2343
2342
|
closeOnClick: false,
|
|
2344
|
-
children: column.colDef.type === "boolean" ? column.colDef.typeOptions?.falseLabel ??
|
|
2343
|
+
children: column.colDef.type === "boolean" ? column.colDef.typeOptions?.falseLabel ?? labels.filterFalse : labels.filterFalse
|
|
2345
2344
|
})
|
|
2346
2345
|
]
|
|
2347
2346
|
}),
|
|
2348
|
-
/* @__PURE__ */
|
|
2349
|
-
/* @__PURE__ */
|
|
2347
|
+
/* @__PURE__ */ jsx15(MenubarSeparator, {}),
|
|
2348
|
+
/* @__PURE__ */ jsx15(MenubarItem, {
|
|
2350
2349
|
closeOnClick: false,
|
|
2351
2350
|
onClick: () => onChange(undefined),
|
|
2352
|
-
children:
|
|
2351
|
+
children: labels.filterClear
|
|
2353
2352
|
})
|
|
2354
2353
|
]
|
|
2355
2354
|
});
|
|
@@ -2360,11 +2359,11 @@ var FilterEditor = ({
|
|
|
2360
2359
|
const filteredOptions = options.filter((option) => option.label.toLocaleLowerCase().includes(optionSearch.trim().toLocaleLowerCase()));
|
|
2361
2360
|
return /* @__PURE__ */ jsxs9(MenubarGroup, {
|
|
2362
2361
|
children: [
|
|
2363
|
-
options.length > 8 ? /* @__PURE__ */
|
|
2362
|
+
options.length > 8 ? /* @__PURE__ */ jsx15("div", {
|
|
2364
2363
|
className: "p-1",
|
|
2365
|
-
children: /* @__PURE__ */
|
|
2366
|
-
"aria-label":
|
|
2367
|
-
placeholder:
|
|
2364
|
+
children: /* @__PURE__ */ jsx15(Input, {
|
|
2365
|
+
"aria-label": labels.filter,
|
|
2366
|
+
placeholder: labels.filter,
|
|
2368
2367
|
value: optionSearch,
|
|
2369
2368
|
onChange: (event) => setOptionSearch(event.target.value),
|
|
2370
2369
|
onKeyDown: (event) => {
|
|
@@ -2384,26 +2383,26 @@ var FilterEditor = ({
|
|
|
2384
2383
|
onChange(undefined);
|
|
2385
2384
|
},
|
|
2386
2385
|
children: [
|
|
2387
|
-
/* @__PURE__ */
|
|
2386
|
+
/* @__PURE__ */ jsx15("span", {
|
|
2388
2387
|
className: "min-w-0 flex-1 truncate",
|
|
2389
2388
|
children: option.label
|
|
2390
2389
|
}),
|
|
2391
|
-
option.count !== undefined ? /* @__PURE__ */
|
|
2390
|
+
option.count !== undefined ? /* @__PURE__ */ jsx15(Badge, {
|
|
2392
2391
|
variant: "secondary",
|
|
2393
2392
|
className: "ml-auto shrink-0",
|
|
2394
2393
|
children: option.count
|
|
2395
2394
|
}) : null
|
|
2396
2395
|
]
|
|
2397
2396
|
}, option.value)),
|
|
2398
|
-
!filteredOptions.length ? /* @__PURE__ */
|
|
2397
|
+
!filteredOptions.length ? /* @__PURE__ */ jsx15("div", {
|
|
2399
2398
|
className: "text-muted-foreground px-2 py-1.5 text-sm",
|
|
2400
|
-
children:
|
|
2399
|
+
children: labels.empty
|
|
2401
2400
|
}) : null,
|
|
2402
|
-
/* @__PURE__ */
|
|
2403
|
-
/* @__PURE__ */
|
|
2401
|
+
/* @__PURE__ */ jsx15(MenubarSeparator, {}),
|
|
2402
|
+
/* @__PURE__ */ jsx15(MenubarItem, {
|
|
2404
2403
|
closeOnClick: false,
|
|
2405
2404
|
onClick: () => onChange(undefined),
|
|
2406
|
-
children:
|
|
2405
|
+
children: labels.filterClear
|
|
2407
2406
|
})
|
|
2408
2407
|
]
|
|
2409
2408
|
});
|
|
@@ -2440,9 +2439,9 @@ var FilterEditor = ({
|
|
|
2440
2439
|
children: [
|
|
2441
2440
|
kind === "text" ? /* @__PURE__ */ jsxs9(Field, {
|
|
2442
2441
|
children: [
|
|
2443
|
-
/* @__PURE__ */
|
|
2442
|
+
/* @__PURE__ */ jsx15(FieldLabel, {
|
|
2444
2443
|
htmlFor: `${inputId}-operator`,
|
|
2445
|
-
children:
|
|
2444
|
+
children: labels.filterOperator
|
|
2446
2445
|
}),
|
|
2447
2446
|
/* @__PURE__ */ jsxs9(Select, {
|
|
2448
2447
|
items: operatorOptions,
|
|
@@ -2453,13 +2452,13 @@ var FilterEditor = ({
|
|
|
2453
2452
|
setOperator(decoded.value);
|
|
2454
2453
|
},
|
|
2455
2454
|
children: [
|
|
2456
|
-
/* @__PURE__ */
|
|
2455
|
+
/* @__PURE__ */ jsx15(SelectTrigger, {
|
|
2457
2456
|
id: `${inputId}-operator`,
|
|
2458
|
-
children: /* @__PURE__ */
|
|
2457
|
+
children: /* @__PURE__ */ jsx15(SelectValue, {})
|
|
2459
2458
|
}),
|
|
2460
|
-
/* @__PURE__ */
|
|
2461
|
-
children: /* @__PURE__ */
|
|
2462
|
-
children: operatorOptions.map((option) => /* @__PURE__ */
|
|
2459
|
+
/* @__PURE__ */ jsx15(SelectContent, {
|
|
2460
|
+
children: /* @__PURE__ */ jsx15(SelectGroup, {
|
|
2461
|
+
children: operatorOptions.map((option) => /* @__PURE__ */ jsx15(SelectItem, {
|
|
2463
2462
|
value: option.value,
|
|
2464
2463
|
children: option.label
|
|
2465
2464
|
}, option.value))
|
|
@@ -2472,11 +2471,11 @@ var FilterEditor = ({
|
|
|
2472
2471
|
/* @__PURE__ */ jsxs9(Field, {
|
|
2473
2472
|
"data-invalid": invalid || undefined,
|
|
2474
2473
|
children: [
|
|
2475
|
-
/* @__PURE__ */
|
|
2474
|
+
/* @__PURE__ */ jsx15(FieldLabel, {
|
|
2476
2475
|
htmlFor: `${inputId}-primary`,
|
|
2477
|
-
children: kind === "text" ?
|
|
2476
|
+
children: kind === "text" ? labels.filterValue : kind === "date" ? labels.filterFrom : labels.filterMin
|
|
2478
2477
|
}),
|
|
2479
|
-
/* @__PURE__ */
|
|
2478
|
+
/* @__PURE__ */ jsx15(Input, {
|
|
2480
2479
|
id: `${inputId}-primary`,
|
|
2481
2480
|
type: kind === "text" ? "text" : kind === "date" ? "date" : "number",
|
|
2482
2481
|
step: kind === "number" ? "any" : undefined,
|
|
@@ -2492,11 +2491,11 @@ var FilterEditor = ({
|
|
|
2492
2491
|
kind !== "text" ? /* @__PURE__ */ jsxs9(Field, {
|
|
2493
2492
|
"data-invalid": invalid || undefined,
|
|
2494
2493
|
children: [
|
|
2495
|
-
/* @__PURE__ */
|
|
2494
|
+
/* @__PURE__ */ jsx15(FieldLabel, {
|
|
2496
2495
|
htmlFor: `${inputId}-secondary`,
|
|
2497
|
-
children: kind === "date" ?
|
|
2496
|
+
children: kind === "date" ? labels.filterTo : labels.filterMax
|
|
2498
2497
|
}),
|
|
2499
|
-
/* @__PURE__ */
|
|
2498
|
+
/* @__PURE__ */ jsx15(Input, {
|
|
2500
2499
|
id: `${inputId}-secondary`,
|
|
2501
2500
|
type: kind === "date" ? "date" : "number",
|
|
2502
2501
|
step: kind === "number" ? "any" : undefined,
|
|
@@ -2511,20 +2510,20 @@ var FilterEditor = ({
|
|
|
2511
2510
|
}) : null
|
|
2512
2511
|
]
|
|
2513
2512
|
}),
|
|
2514
|
-
invalid ? /* @__PURE__ */
|
|
2513
|
+
invalid ? /* @__PURE__ */ jsx15("p", {
|
|
2515
2514
|
role: "alert",
|
|
2516
2515
|
className: "text-destructive text-sm",
|
|
2517
|
-
children:
|
|
2516
|
+
children: labels.filterInvalid
|
|
2518
2517
|
}) : null,
|
|
2519
2518
|
/* @__PURE__ */ jsxs9("div", {
|
|
2520
2519
|
className: "flex gap-2",
|
|
2521
2520
|
children: [
|
|
2522
|
-
/* @__PURE__ */
|
|
2521
|
+
/* @__PURE__ */ jsx15(Button, {
|
|
2523
2522
|
type: "submit",
|
|
2524
2523
|
size: "sm",
|
|
2525
|
-
children:
|
|
2524
|
+
children: labels.filterApply
|
|
2526
2525
|
}),
|
|
2527
|
-
/* @__PURE__ */
|
|
2526
|
+
/* @__PURE__ */ jsx15(Button, {
|
|
2528
2527
|
type: "button",
|
|
2529
2528
|
size: "sm",
|
|
2530
2529
|
variant: "outline",
|
|
@@ -2534,7 +2533,7 @@ var FilterEditor = ({
|
|
|
2534
2533
|
setInvalid(false);
|
|
2535
2534
|
onChange(undefined);
|
|
2536
2535
|
},
|
|
2537
|
-
children:
|
|
2536
|
+
children: labels.filterClear
|
|
2538
2537
|
})
|
|
2539
2538
|
]
|
|
2540
2539
|
})
|
|
@@ -2559,39 +2558,39 @@ var FilterMenu = ({
|
|
|
2559
2558
|
/* @__PURE__ */ jsxs9(MenubarTrigger, {
|
|
2560
2559
|
"aria-label": store.config.labels.filters,
|
|
2561
2560
|
children: [
|
|
2562
|
-
/* @__PURE__ */
|
|
2563
|
-
/* @__PURE__ */
|
|
2561
|
+
/* @__PURE__ */ jsx15(ListFilter, {}),
|
|
2562
|
+
/* @__PURE__ */ jsx15("span", {
|
|
2564
2563
|
children: store.config.labels.filters
|
|
2565
2564
|
}),
|
|
2566
|
-
filters.length ? /* @__PURE__ */
|
|
2565
|
+
filters.length ? /* @__PURE__ */ jsx15(Badge, {
|
|
2567
2566
|
variant: "secondary",
|
|
2568
2567
|
children: filters.length
|
|
2569
2568
|
}) : null
|
|
2570
2569
|
]
|
|
2571
2570
|
}),
|
|
2572
|
-
/* @__PURE__ */
|
|
2571
|
+
/* @__PURE__ */ jsx15(MenubarContent, {
|
|
2573
2572
|
align: "end",
|
|
2574
2573
|
className: "w-80 max-w-[calc(100vw-2rem)]",
|
|
2575
2574
|
children: /* @__PURE__ */ jsxs9(MenubarGroup, {
|
|
2576
2575
|
children: [
|
|
2577
|
-
/* @__PURE__ */
|
|
2576
|
+
/* @__PURE__ */ jsx15(MenubarLabel, {
|
|
2578
2577
|
children: store.config.labels.filters
|
|
2579
2578
|
}),
|
|
2580
|
-
/* @__PURE__ */
|
|
2579
|
+
/* @__PURE__ */ jsx15(MenubarSeparator, {}),
|
|
2581
2580
|
columns.map(({ column, label }) => /* @__PURE__ */ jsxs9(MenubarSub, {
|
|
2582
2581
|
children: [
|
|
2583
2582
|
/* @__PURE__ */ jsxs9(MenubarSubTrigger, {
|
|
2584
2583
|
children: [
|
|
2585
|
-
/* @__PURE__ */
|
|
2584
|
+
/* @__PURE__ */ jsx15("span", {
|
|
2586
2585
|
className: "min-w-0 flex-1 truncate",
|
|
2587
2586
|
children: label
|
|
2588
2587
|
}),
|
|
2589
|
-
filters.some((filter) => filter.id === column.id) ? /* @__PURE__ */
|
|
2588
|
+
filters.some((filter) => filter.id === column.id) ? /* @__PURE__ */ jsx15(Check, {}) : null
|
|
2590
2589
|
]
|
|
2591
2590
|
}),
|
|
2592
|
-
/* @__PURE__ */
|
|
2591
|
+
/* @__PURE__ */ jsx15(MenubarSubContent, {
|
|
2593
2592
|
className: "w-80 max-w-[calc(100vw-2rem)]",
|
|
2594
|
-
children: /* @__PURE__ */
|
|
2593
|
+
children: /* @__PURE__ */ jsx15(FilterEditor, {
|
|
2595
2594
|
column,
|
|
2596
2595
|
rows: model.rows,
|
|
2597
2596
|
current: filters.find((filter) => filter.id === column.id),
|
|
@@ -2603,7 +2602,7 @@ var FilterMenu = ({
|
|
|
2603
2602
|
}, column.id)),
|
|
2604
2603
|
filters.length ? /* @__PURE__ */ jsxs9(Fragment, {
|
|
2605
2604
|
children: [
|
|
2606
|
-
/* @__PURE__ */
|
|
2605
|
+
/* @__PURE__ */ jsx15(MenubarSeparator, {}),
|
|
2607
2606
|
/* @__PURE__ */ jsxs9(MenubarItem, {
|
|
2608
2607
|
onClick: () => changeState(setStore, (state) => ({
|
|
2609
2608
|
...state,
|
|
@@ -2611,7 +2610,7 @@ var FilterMenu = ({
|
|
|
2611
2610
|
filters: undefined
|
|
2612
2611
|
})),
|
|
2613
2612
|
children: [
|
|
2614
|
-
/* @__PURE__ */
|
|
2613
|
+
/* @__PURE__ */ jsx15(X, {}),
|
|
2615
2614
|
store.config.labels.filtersClear
|
|
2616
2615
|
]
|
|
2617
2616
|
})
|
|
@@ -2647,29 +2646,29 @@ var SortMenu = ({
|
|
|
2647
2646
|
/* @__PURE__ */ jsxs9(MenubarTrigger, {
|
|
2648
2647
|
"aria-label": store.config.labels.sortBy,
|
|
2649
2648
|
children: [
|
|
2650
|
-
current ? current.direction === "desc" ? /* @__PURE__ */
|
|
2651
|
-
/* @__PURE__ */
|
|
2649
|
+
current ? current.direction === "desc" ? /* @__PURE__ */ jsx15(ArrowDown, {}) : /* @__PURE__ */ jsx15(ArrowUp, {}) : /* @__PURE__ */ jsx15(ChevronsUpDown, {}),
|
|
2650
|
+
/* @__PURE__ */ jsx15("span", {
|
|
2652
2651
|
className: "hidden sm:inline",
|
|
2653
2652
|
children: store.config.labels.sortBy
|
|
2654
2653
|
})
|
|
2655
2654
|
]
|
|
2656
2655
|
}),
|
|
2657
|
-
/* @__PURE__ */
|
|
2656
|
+
/* @__PURE__ */ jsx15(MenubarContent, {
|
|
2658
2657
|
align: "end",
|
|
2659
2658
|
className: "w-52",
|
|
2660
2659
|
children: /* @__PURE__ */ jsxs9(MenubarGroup, {
|
|
2661
2660
|
children: [
|
|
2662
|
-
/* @__PURE__ */
|
|
2661
|
+
/* @__PURE__ */ jsx15(MenubarLabel, {
|
|
2663
2662
|
children: store.config.labels.sortBy
|
|
2664
2663
|
}),
|
|
2665
|
-
/* @__PURE__ */
|
|
2664
|
+
/* @__PURE__ */ jsx15(MenubarSeparator, {}),
|
|
2666
2665
|
columns.map((column) => {
|
|
2667
2666
|
const sortState = store.state.sort?.find(({ id }) => id === column.id);
|
|
2668
2667
|
return /* @__PURE__ */ jsxs9(MenubarSub, {
|
|
2669
2668
|
children: [
|
|
2670
2669
|
/* @__PURE__ */ jsxs9(MenubarSubTrigger, {
|
|
2671
2670
|
children: [
|
|
2672
|
-
sortState ? sortState.direction === "desc" ? /* @__PURE__ */
|
|
2671
|
+
sortState ? sortState.direction === "desc" ? /* @__PURE__ */ jsx15(ArrowDown, {}) : /* @__PURE__ */ jsx15(ArrowUp, {}) : null,
|
|
2673
2672
|
columnLabel(column)
|
|
2674
2673
|
]
|
|
2675
2674
|
}),
|
|
@@ -2678,7 +2677,7 @@ var SortMenu = ({
|
|
|
2678
2677
|
/* @__PURE__ */ jsxs9(MenubarItem, {
|
|
2679
2678
|
onClick: () => sort(column.id, "asc"),
|
|
2680
2679
|
children: [
|
|
2681
|
-
/* @__PURE__ */
|
|
2680
|
+
/* @__PURE__ */ jsx15(ArrowUp, {}),
|
|
2682
2681
|
" ",
|
|
2683
2682
|
store.config.labels.sortAsc
|
|
2684
2683
|
]
|
|
@@ -2686,21 +2685,21 @@ var SortMenu = ({
|
|
|
2686
2685
|
/* @__PURE__ */ jsxs9(MenubarItem, {
|
|
2687
2686
|
onClick: () => sort(column.id, "desc"),
|
|
2688
2687
|
children: [
|
|
2689
|
-
/* @__PURE__ */
|
|
2688
|
+
/* @__PURE__ */ jsx15(ArrowDown, {}),
|
|
2690
2689
|
" ",
|
|
2691
2690
|
store.config.labels.sortDesc
|
|
2692
2691
|
]
|
|
2693
2692
|
}),
|
|
2694
2693
|
sortState ? /* @__PURE__ */ jsxs9(Fragment, {
|
|
2695
2694
|
children: [
|
|
2696
|
-
/* @__PURE__ */
|
|
2695
|
+
/* @__PURE__ */ jsx15(MenubarSeparator, {}),
|
|
2697
2696
|
/* @__PURE__ */ jsxs9(MenubarItem, {
|
|
2698
2697
|
onClick: () => changeState(setStore, (state) => ({
|
|
2699
2698
|
...state,
|
|
2700
2699
|
sort: state.sort?.filter(({ id }) => id !== column.id)
|
|
2701
2700
|
})),
|
|
2702
2701
|
children: [
|
|
2703
|
-
/* @__PURE__ */
|
|
2702
|
+
/* @__PURE__ */ jsx15(X, {}),
|
|
2704
2703
|
" ",
|
|
2705
2704
|
store.config.labels.sortClear
|
|
2706
2705
|
]
|
|
@@ -2727,21 +2726,21 @@ var ViewMenu = ({
|
|
|
2727
2726
|
/* @__PURE__ */ jsxs9(MenubarTrigger, {
|
|
2728
2727
|
"aria-label": store.config.labels.view,
|
|
2729
2728
|
children: [
|
|
2730
|
-
store.state.view === "gallery" ? /* @__PURE__ */
|
|
2731
|
-
/* @__PURE__ */
|
|
2729
|
+
store.state.view === "gallery" ? /* @__PURE__ */ jsx15(LayoutGrid, {}) : /* @__PURE__ */ jsx15(Rows3, {}),
|
|
2730
|
+
/* @__PURE__ */ jsx15("span", {
|
|
2732
2731
|
className: "hidden sm:inline",
|
|
2733
2732
|
children: store.config.labels.view
|
|
2734
2733
|
})
|
|
2735
2734
|
]
|
|
2736
2735
|
}),
|
|
2737
|
-
/* @__PURE__ */
|
|
2736
|
+
/* @__PURE__ */ jsx15(MenubarContent, {
|
|
2738
2737
|
align: "end",
|
|
2739
2738
|
children: /* @__PURE__ */ jsxs9(MenubarGroup, {
|
|
2740
2739
|
children: [
|
|
2741
|
-
/* @__PURE__ */
|
|
2740
|
+
/* @__PURE__ */ jsx15(MenubarLabel, {
|
|
2742
2741
|
children: store.config.labels.view
|
|
2743
2742
|
}),
|
|
2744
|
-
/* @__PURE__ */
|
|
2743
|
+
/* @__PURE__ */ jsx15(MenubarSeparator, {}),
|
|
2745
2744
|
/* @__PURE__ */ jsxs9(MenubarRadioGroup, {
|
|
2746
2745
|
onValueChange: (view) => {
|
|
2747
2746
|
if (view === "table" || view === "gallery") {
|
|
@@ -2753,7 +2752,7 @@ var ViewMenu = ({
|
|
|
2753
2752
|
/* @__PURE__ */ jsxs9(MenubarRadioItem, {
|
|
2754
2753
|
value: "table",
|
|
2755
2754
|
children: [
|
|
2756
|
-
/* @__PURE__ */
|
|
2755
|
+
/* @__PURE__ */ jsx15(Rows3, {}),
|
|
2757
2756
|
" ",
|
|
2758
2757
|
store.config.labels.tableView
|
|
2759
2758
|
]
|
|
@@ -2761,7 +2760,7 @@ var ViewMenu = ({
|
|
|
2761
2760
|
/* @__PURE__ */ jsxs9(MenubarRadioItem, {
|
|
2762
2761
|
value: "gallery",
|
|
2763
2762
|
children: [
|
|
2764
|
-
/* @__PURE__ */
|
|
2763
|
+
/* @__PURE__ */ jsx15(LayoutGrid, {}),
|
|
2765
2764
|
" ",
|
|
2766
2765
|
store.config.labels.galleryView
|
|
2767
2766
|
]
|
|
@@ -2786,22 +2785,22 @@ var ColumnMenu = ({
|
|
|
2786
2785
|
/* @__PURE__ */ jsxs9(MenubarTrigger, {
|
|
2787
2786
|
"aria-label": store.config.labels.columns,
|
|
2788
2787
|
children: [
|
|
2789
|
-
/* @__PURE__ */
|
|
2790
|
-
/* @__PURE__ */
|
|
2788
|
+
/* @__PURE__ */ jsx15(Settings2, {}),
|
|
2789
|
+
/* @__PURE__ */ jsx15("span", {
|
|
2791
2790
|
className: "hidden sm:inline",
|
|
2792
2791
|
children: store.config.labels.columns
|
|
2793
2792
|
})
|
|
2794
2793
|
]
|
|
2795
2794
|
}),
|
|
2796
|
-
/* @__PURE__ */
|
|
2795
|
+
/* @__PURE__ */ jsx15(MenubarContent, {
|
|
2797
2796
|
align: "end",
|
|
2798
2797
|
children: /* @__PURE__ */ jsxs9(MenubarGroup, {
|
|
2799
2798
|
children: [
|
|
2800
|
-
/* @__PURE__ */
|
|
2799
|
+
/* @__PURE__ */ jsx15(MenubarLabel, {
|
|
2801
2800
|
children: store.config.labels.columns
|
|
2802
2801
|
}),
|
|
2803
|
-
/* @__PURE__ */
|
|
2804
|
-
columns.map((column) => /* @__PURE__ */
|
|
2802
|
+
/* @__PURE__ */ jsx15(MenubarSeparator, {}),
|
|
2803
|
+
columns.map((column) => /* @__PURE__ */ jsx15(MenubarCheckboxItem, {
|
|
2805
2804
|
checked: store.state.columnVisibility[column.id] !== false,
|
|
2806
2805
|
onCheckedChange: (visible) => changeState(setStore, (state) => ({
|
|
2807
2806
|
...state,
|
|
@@ -2854,7 +2853,7 @@ var ResizeHandle = ({
|
|
|
2854
2853
|
const reset = () => {
|
|
2855
2854
|
resizeRef.current = null;
|
|
2856
2855
|
};
|
|
2857
|
-
return /* @__PURE__ */
|
|
2856
|
+
return /* @__PURE__ */ jsx15("button", {
|
|
2858
2857
|
"aria-label": store.config.labels.resizeColumn(columnLabel(column)),
|
|
2859
2858
|
"aria-orientation": "vertical",
|
|
2860
2859
|
"aria-valuemax": column.colDef.maxWidth ?? DEFAULT_MAX_WIDTH,
|
|
@@ -2978,7 +2977,7 @@ var DragHandle = ({
|
|
|
2978
2977
|
};
|
|
2979
2978
|
return /* @__PURE__ */ jsxs9(Fragment, {
|
|
2980
2979
|
children: [
|
|
2981
|
-
/* @__PURE__ */
|
|
2980
|
+
/* @__PURE__ */ jsx15(Button, {
|
|
2982
2981
|
"aria-label": store.config.features.reordering && store.config.features.reordering.handleLabel ? store.config.features.reordering.handleLabel : store.config.labels.reorder,
|
|
2983
2982
|
className: "size-8 cursor-grab touch-none active:cursor-grabbing",
|
|
2984
2983
|
onClick: (event) => event.stopPropagation(),
|
|
@@ -2996,9 +2995,9 @@ var DragHandle = ({
|
|
|
2996
2995
|
onPointerUp: finish,
|
|
2997
2996
|
size: "icon",
|
|
2998
2997
|
variant: "ghost",
|
|
2999
|
-
children: /* @__PURE__ */
|
|
2998
|
+
children: /* @__PURE__ */ jsx15(GripVertical, {})
|
|
3000
2999
|
}),
|
|
3001
|
-
overlay ? createPortal(/* @__PURE__ */
|
|
3000
|
+
overlay ? createPortal(/* @__PURE__ */ jsx15("div", {
|
|
3002
3001
|
"aria-hidden": "true",
|
|
3003
3002
|
className: "bg-background pointer-events-none fixed z-[100] rounded-md border px-3 py-2 text-sm shadow-lg",
|
|
3004
3003
|
style: { left: overlay.x + 12, top: overlay.y + 12 },
|
|
@@ -3041,36 +3040,36 @@ var TableDataRow = ({
|
|
|
3041
3040
|
},
|
|
3042
3041
|
tabIndex: store.config.onRowClicked ? 0 : undefined,
|
|
3043
3042
|
children: [
|
|
3044
|
-
selection ? /* @__PURE__ */
|
|
3043
|
+
selection ? /* @__PURE__ */ jsx15(TableCell, {
|
|
3045
3044
|
className: "w-10 pr-0",
|
|
3046
3045
|
onClick: (event) => event.stopPropagation(),
|
|
3047
|
-
children: /* @__PURE__ */
|
|
3046
|
+
children: /* @__PURE__ */ jsx15(Checkbox, {
|
|
3048
3047
|
"aria-label": store.config.labels.selectRow,
|
|
3049
3048
|
checked: !!store.state.rowSelection[row.id],
|
|
3050
3049
|
disabled: !selectable,
|
|
3051
3050
|
onCheckedChange: (checked) => toggleRow(store, setStore, row.id, checked)
|
|
3052
3051
|
})
|
|
3053
3052
|
}) : null,
|
|
3054
|
-
draggable ? /* @__PURE__ */
|
|
3053
|
+
draggable ? /* @__PURE__ */ jsx15(TableCell, {
|
|
3055
3054
|
className: "w-10 pr-0",
|
|
3056
|
-
children: /* @__PURE__ */
|
|
3055
|
+
children: /* @__PURE__ */ jsx15(DragHandle, {
|
|
3057
3056
|
tableAtom
|
|
3058
3057
|
})
|
|
3059
3058
|
}) : null,
|
|
3060
|
-
model.visibleColumns.map((column) => /* @__PURE__ */
|
|
3059
|
+
model.visibleColumns.map((column) => /* @__PURE__ */ jsx15(TableCell, {
|
|
3061
3060
|
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"),
|
|
3062
3061
|
style: { width: column.width },
|
|
3063
|
-
children: /* @__PURE__ */
|
|
3062
|
+
children: /* @__PURE__ */ jsx15("div", {
|
|
3064
3063
|
className: cn("min-w-0", column.colDef.truncate && "truncate"),
|
|
3065
3064
|
children: renderCell(row, column, store.config.locale, store.config.labels)
|
|
3066
3065
|
})
|
|
3067
3066
|
}, column.id)),
|
|
3068
|
-
hasRowActionMenu(store) ? /* @__PURE__ */
|
|
3067
|
+
hasRowActionMenu(store) ? /* @__PURE__ */ jsx15(TableCell, {
|
|
3069
3068
|
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))]",
|
|
3070
3069
|
onClick: (event) => event.stopPropagation(),
|
|
3071
|
-
children: /* @__PURE__ */
|
|
3070
|
+
children: /* @__PURE__ */ jsx15("div", {
|
|
3072
3071
|
className: "flex h-16 items-center justify-center",
|
|
3073
|
-
children: /* @__PURE__ */
|
|
3072
|
+
children: /* @__PURE__ */ jsx15(DataTableRowActionMenu, {
|
|
3074
3073
|
tableAtom
|
|
3075
3074
|
})
|
|
3076
3075
|
})
|
|
@@ -3088,23 +3087,23 @@ var GroupActions = ({
|
|
|
3088
3087
|
return null;
|
|
3089
3088
|
return /* @__PURE__ */ jsxs9(DropdownMenu, {
|
|
3090
3089
|
children: [
|
|
3091
|
-
/* @__PURE__ */
|
|
3090
|
+
/* @__PURE__ */ jsx15(DropdownMenuTrigger, {
|
|
3092
3091
|
onClick: (event) => event.stopPropagation(),
|
|
3093
3092
|
render: /* @__PURE__ */ jsxs9(Button, {
|
|
3094
3093
|
size: "icon",
|
|
3095
3094
|
variant: "ghost",
|
|
3096
3095
|
children: [
|
|
3097
|
-
/* @__PURE__ */
|
|
3096
|
+
/* @__PURE__ */ jsx15("span", {
|
|
3098
3097
|
className: "sr-only",
|
|
3099
3098
|
children: title
|
|
3100
3099
|
}),
|
|
3101
|
-
/* @__PURE__ */
|
|
3100
|
+
/* @__PURE__ */ jsx15(MoreHorizontal, {})
|
|
3102
3101
|
]
|
|
3103
3102
|
})
|
|
3104
3103
|
}),
|
|
3105
|
-
/* @__PURE__ */
|
|
3104
|
+
/* @__PURE__ */ jsx15(DropdownMenuContent, {
|
|
3106
3105
|
align: "end",
|
|
3107
|
-
children: /* @__PURE__ */
|
|
3106
|
+
children: /* @__PURE__ */ jsx15(DropdownMenuGroup, {
|
|
3108
3107
|
children: visible.map((action) => /* @__PURE__ */ jsxs9(DropdownMenuItem, {
|
|
3109
3108
|
onClick: () => action.onClick(groupId),
|
|
3110
3109
|
variant: action.variant ?? "default",
|
|
@@ -3140,10 +3139,10 @@ var GroupedTable = ({
|
|
|
3140
3139
|
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",
|
|
3141
3140
|
"data-table-group": section.field.onMoveToGroup ? targetKey : undefined,
|
|
3142
3141
|
children: [
|
|
3143
|
-
/* @__PURE__ */
|
|
3142
|
+
/* @__PURE__ */ jsx15(TableRow, {
|
|
3144
3143
|
className: "bg-muted/40 hover:bg-accent! cursor-pointer",
|
|
3145
3144
|
onClick: toggleCollapsed,
|
|
3146
|
-
children: /* @__PURE__ */
|
|
3145
|
+
children: /* @__PURE__ */ jsx15(TableCell, {
|
|
3147
3146
|
colSpan: model.visibleColumns.length + extra,
|
|
3148
3147
|
children: /* @__PURE__ */ jsxs9("div", {
|
|
3149
3148
|
className: "flex items-center gap-2",
|
|
@@ -3154,22 +3153,22 @@ var GroupedTable = ({
|
|
|
3154
3153
|
className: "flex flex-1 cursor-pointer items-center gap-2 text-left font-medium",
|
|
3155
3154
|
type: "button",
|
|
3156
3155
|
children: [
|
|
3157
|
-
collapsed ? /* @__PURE__ */
|
|
3156
|
+
collapsed ? /* @__PURE__ */ jsx15(ChevronRight2, {
|
|
3158
3157
|
className: "size-4"
|
|
3159
|
-
}) : /* @__PURE__ */
|
|
3158
|
+
}) : /* @__PURE__ */ jsx15(ChevronDown, {
|
|
3160
3159
|
className: "size-4"
|
|
3161
3160
|
}),
|
|
3162
|
-
/* @__PURE__ */
|
|
3161
|
+
/* @__PURE__ */ jsx15("span", {
|
|
3163
3162
|
className: "flex-1",
|
|
3164
3163
|
children: section.field.renderGroupLabel?.(section.groupId, section.rows.map((row) => row.data)) ?? section.groupId
|
|
3165
3164
|
})
|
|
3166
3165
|
]
|
|
3167
3166
|
}),
|
|
3168
|
-
/* @__PURE__ */
|
|
3167
|
+
/* @__PURE__ */ jsx15(Badge, {
|
|
3169
3168
|
variant: "secondary",
|
|
3170
3169
|
children: section.rows.length
|
|
3171
3170
|
}),
|
|
3172
|
-
/* @__PURE__ */
|
|
3171
|
+
/* @__PURE__ */ jsx15(GroupActions, {
|
|
3173
3172
|
actions: section.field.actions,
|
|
3174
3173
|
groupId: section.groupId,
|
|
3175
3174
|
title: section.field.actionsLabel ?? store.config.labels.actions
|
|
@@ -3178,14 +3177,14 @@ var GroupedTable = ({
|
|
|
3178
3177
|
})
|
|
3179
3178
|
})
|
|
3180
3179
|
}),
|
|
3181
|
-
!collapsed && !section.children.length ? section.rows.length ? section.rows.map((row) => /* @__PURE__ */
|
|
3180
|
+
!collapsed && !section.children.length ? section.rows.length ? section.rows.map((row) => /* @__PURE__ */ jsx15(RowIdContext.Provider, {
|
|
3182
3181
|
value: row.id,
|
|
3183
|
-
children: /* @__PURE__ */
|
|
3182
|
+
children: /* @__PURE__ */ jsx15(TableDataRow, {
|
|
3184
3183
|
tableAtom
|
|
3185
3184
|
})
|
|
3186
3185
|
}, `${section.key}:${row.id}`)) : [
|
|
3187
|
-
/* @__PURE__ */
|
|
3188
|
-
children: /* @__PURE__ */
|
|
3186
|
+
/* @__PURE__ */ jsx15(TableRow, {
|
|
3187
|
+
children: /* @__PURE__ */ jsx15(TableCell, {
|
|
3189
3188
|
className: "text-muted-foreground h-16",
|
|
3190
3189
|
colSpan: model.visibleColumns.length + extra,
|
|
3191
3190
|
children: section.field.renderEmptyGroup?.(section.groupId) ?? store.config.labels.empty
|
|
@@ -3196,7 +3195,7 @@ var GroupedTable = ({
|
|
|
3196
3195
|
}, section.key);
|
|
3197
3196
|
return !collapsed && section.children.length ? [body, renderSections(section.children)] : [body];
|
|
3198
3197
|
});
|
|
3199
|
-
return /* @__PURE__ */
|
|
3198
|
+
return /* @__PURE__ */ jsx15(Fragment, {
|
|
3200
3199
|
children: renderSections(sections)
|
|
3201
3200
|
});
|
|
3202
3201
|
};
|
|
@@ -3214,7 +3213,7 @@ var ColumnHeaderMenu = ({
|
|
|
3214
3213
|
const filteringEnabled = store.config.features.filtering !== false && filterColumns.length > 0;
|
|
3215
3214
|
const ownsFilter = (id) => id === column.id || getDataTableFieldColumns(column).some((field) => field.id === id);
|
|
3216
3215
|
const activeFilters = (store.state.filters ?? []).filter(({ id }) => ownsFilter(id));
|
|
3217
|
-
const filterEditor = (field) => /* @__PURE__ */
|
|
3216
|
+
const filterEditor = (field) => /* @__PURE__ */ jsx15(FilterEditor, {
|
|
3218
3217
|
column: field,
|
|
3219
3218
|
rows: model.rows,
|
|
3220
3219
|
current: store.state.filters?.find((filter) => filter.id === field.id),
|
|
@@ -3237,7 +3236,7 @@ var ColumnHeaderMenu = ({
|
|
|
3237
3236
|
/* @__PURE__ */ jsxs9(DropdownMenuItem, {
|
|
3238
3237
|
onClick: () => setSort(field.id, "asc"),
|
|
3239
3238
|
children: [
|
|
3240
|
-
/* @__PURE__ */
|
|
3239
|
+
/* @__PURE__ */ jsx15(ArrowUp, {}),
|
|
3241
3240
|
" ",
|
|
3242
3241
|
store.config.labels.sortAsc
|
|
3243
3242
|
]
|
|
@@ -3245,7 +3244,7 @@ var ColumnHeaderMenu = ({
|
|
|
3245
3244
|
/* @__PURE__ */ jsxs9(DropdownMenuItem, {
|
|
3246
3245
|
onClick: () => setSort(field.id, "desc"),
|
|
3247
3246
|
children: [
|
|
3248
|
-
/* @__PURE__ */
|
|
3247
|
+
/* @__PURE__ */ jsx15(ArrowDown, {}),
|
|
3249
3248
|
" ",
|
|
3250
3249
|
store.config.labels.sortDesc
|
|
3251
3250
|
]
|
|
@@ -3253,30 +3252,30 @@ var ColumnHeaderMenu = ({
|
|
|
3253
3252
|
]
|
|
3254
3253
|
});
|
|
3255
3254
|
if (!sortingEnabled && !hidingEnabled && !filteringEnabled) {
|
|
3256
|
-
return /* @__PURE__ */
|
|
3255
|
+
return /* @__PURE__ */ jsx15("div", {
|
|
3257
3256
|
className: "truncate px-2",
|
|
3258
3257
|
children: column.colDef.headerName
|
|
3259
3258
|
});
|
|
3260
3259
|
}
|
|
3261
3260
|
return /* @__PURE__ */ jsxs9(DropdownMenu, {
|
|
3262
3261
|
children: [
|
|
3263
|
-
/* @__PURE__ */
|
|
3262
|
+
/* @__PURE__ */ jsx15(DropdownMenuTrigger, {
|
|
3264
3263
|
render: /* @__PURE__ */ jsxs9(Button, {
|
|
3265
3264
|
"aria-label": label,
|
|
3266
3265
|
"aria-description": activeFilters.length ? `${store.config.labels.filters}: ${activeFilters.length}` : undefined,
|
|
3267
3266
|
className: "absolute inset-0 h-full w-full min-w-0 justify-start rounded-none px-2 pr-4 focus-visible:ring-inset",
|
|
3268
3267
|
variant: "ghost",
|
|
3269
3268
|
children: [
|
|
3270
|
-
/* @__PURE__ */
|
|
3269
|
+
/* @__PURE__ */ jsx15("span", {
|
|
3271
3270
|
className: "truncate",
|
|
3272
3271
|
children: column.colDef.headerName
|
|
3273
3272
|
}),
|
|
3274
|
-
activeFilters.length ? /* @__PURE__ */
|
|
3275
|
-
sort ? sort.direction === "desc" ? /* @__PURE__ */
|
|
3273
|
+
activeFilters.length ? /* @__PURE__ */ jsx15(ListFilter, {}) : null,
|
|
3274
|
+
sort ? sort.direction === "desc" ? /* @__PURE__ */ jsx15(ArrowDown, {}) : /* @__PURE__ */ jsx15(ArrowUp, {}) : null
|
|
3276
3275
|
]
|
|
3277
3276
|
})
|
|
3278
3277
|
}),
|
|
3279
|
-
/* @__PURE__ */
|
|
3278
|
+
/* @__PURE__ */ jsx15(DropdownMenuContent, {
|
|
3280
3279
|
align: "start",
|
|
3281
3280
|
className: "w-48",
|
|
3282
3281
|
children: /* @__PURE__ */ jsxs9(DropdownMenuGroup, {
|
|
@@ -3285,11 +3284,11 @@ var ColumnHeaderMenu = ({
|
|
|
3285
3284
|
children: [
|
|
3286
3285
|
column.colDef.fields?.length ? sortColumns.map((field) => /* @__PURE__ */ jsxs9(DropdownMenuSub, {
|
|
3287
3286
|
children: [
|
|
3288
|
-
/* @__PURE__ */
|
|
3287
|
+
/* @__PURE__ */ jsx15(DropdownMenuSubTrigger, {
|
|
3289
3288
|
children: columnLabel(field)
|
|
3290
3289
|
}),
|
|
3291
|
-
/* @__PURE__ */
|
|
3292
|
-
children: /* @__PURE__ */
|
|
3290
|
+
/* @__PURE__ */ jsx15(DropdownMenuSubContent, {
|
|
3291
|
+
children: /* @__PURE__ */ jsx15(DropdownMenuGroup, {
|
|
3293
3292
|
children: sortItems(field)
|
|
3294
3293
|
})
|
|
3295
3294
|
})
|
|
@@ -3301,36 +3300,36 @@ var ColumnHeaderMenu = ({
|
|
|
3301
3300
|
sort: state.sort?.filter(({ id }) => !ownsSort(id))
|
|
3302
3301
|
})),
|
|
3303
3302
|
children: [
|
|
3304
|
-
/* @__PURE__ */
|
|
3303
|
+
/* @__PURE__ */ jsx15(X, {}),
|
|
3305
3304
|
" ",
|
|
3306
3305
|
store.config.labels.sortClear
|
|
3307
3306
|
]
|
|
3308
3307
|
}) : null
|
|
3309
3308
|
]
|
|
3310
3309
|
}) : null,
|
|
3311
|
-
sortingEnabled && filteringEnabled ? /* @__PURE__ */
|
|
3310
|
+
sortingEnabled && filteringEnabled ? /* @__PURE__ */ jsx15(DropdownMenuSeparator, {}) : null,
|
|
3312
3311
|
filteringEnabled ? /* @__PURE__ */ jsxs9(Fragment, {
|
|
3313
3312
|
children: [
|
|
3314
3313
|
/* @__PURE__ */ jsxs9(DropdownMenuSub, {
|
|
3315
3314
|
children: [
|
|
3316
3315
|
/* @__PURE__ */ jsxs9(DropdownMenuSubTrigger, {
|
|
3317
3316
|
children: [
|
|
3318
|
-
/* @__PURE__ */
|
|
3317
|
+
/* @__PURE__ */ jsx15(ListFilter, {}),
|
|
3319
3318
|
store.config.labels.filters
|
|
3320
3319
|
]
|
|
3321
3320
|
}),
|
|
3322
|
-
/* @__PURE__ */
|
|
3321
|
+
/* @__PURE__ */ jsx15(DropdownMenuSubContent, {
|
|
3323
3322
|
className: "w-80 max-w-[calc(100vw-2rem)]",
|
|
3324
|
-
children: column.colDef.fields?.length ? /* @__PURE__ */
|
|
3323
|
+
children: column.colDef.fields?.length ? /* @__PURE__ */ jsx15(DropdownMenuGroup, {
|
|
3325
3324
|
children: filterColumns.map((field) => /* @__PURE__ */ jsxs9(DropdownMenuSub, {
|
|
3326
3325
|
children: [
|
|
3327
3326
|
/* @__PURE__ */ jsxs9(DropdownMenuSubTrigger, {
|
|
3328
3327
|
children: [
|
|
3329
3328
|
columnLabel(field),
|
|
3330
|
-
activeFilters.some((filter) => filter.id === field.id) ? /* @__PURE__ */
|
|
3329
|
+
activeFilters.some((filter) => filter.id === field.id) ? /* @__PURE__ */ jsx15(Check, {}) : null
|
|
3331
3330
|
]
|
|
3332
3331
|
}),
|
|
3333
|
-
/* @__PURE__ */
|
|
3332
|
+
/* @__PURE__ */ jsx15(DropdownMenuSubContent, {
|
|
3334
3333
|
className: "w-80 max-w-[calc(100vw-2rem)]",
|
|
3335
3334
|
children: filterEditor(field)
|
|
3336
3335
|
})
|
|
@@ -3350,13 +3349,13 @@ var ColumnHeaderMenu = ({
|
|
|
3350
3349
|
};
|
|
3351
3350
|
}),
|
|
3352
3351
|
children: [
|
|
3353
|
-
/* @__PURE__ */
|
|
3352
|
+
/* @__PURE__ */ jsx15(X, {}),
|
|
3354
3353
|
store.config.labels.filterClear
|
|
3355
3354
|
]
|
|
3356
3355
|
}) : null
|
|
3357
3356
|
]
|
|
3358
3357
|
}) : null,
|
|
3359
|
-
(sortingEnabled || filteringEnabled) && hidingEnabled ? /* @__PURE__ */
|
|
3358
|
+
(sortingEnabled || filteringEnabled) && hidingEnabled ? /* @__PURE__ */ jsx15(DropdownMenuSeparator, {}) : null,
|
|
3360
3359
|
hidingEnabled ? /* @__PURE__ */ jsxs9(DropdownMenuItem, {
|
|
3361
3360
|
onClick: () => update((state) => ({
|
|
3362
3361
|
...state,
|
|
@@ -3366,7 +3365,7 @@ var ColumnHeaderMenu = ({
|
|
|
3366
3365
|
}
|
|
3367
3366
|
})),
|
|
3368
3367
|
children: [
|
|
3369
|
-
/* @__PURE__ */
|
|
3368
|
+
/* @__PURE__ */ jsx15(EyeOff, {}),
|
|
3370
3369
|
" ",
|
|
3371
3370
|
store.config.labels.hideColumn
|
|
3372
3371
|
]
|
|
@@ -3388,12 +3387,12 @@ var DataTableHeader = ({
|
|
|
3388
3387
|
const selectableRows = getDataTableSelectableRows(model, grouped, selection ? selection.isRowSelectable : undefined);
|
|
3389
3388
|
const allSelected = selectableRows.length > 0 && selectableRows.every((row) => store.state.rowSelection[row.id]);
|
|
3390
3389
|
const someSelected = selectableRows.some((row) => store.state.rowSelection[row.id]);
|
|
3391
|
-
return /* @__PURE__ */
|
|
3390
|
+
return /* @__PURE__ */ jsx15(TableHeader, {
|
|
3392
3391
|
children: /* @__PURE__ */ jsxs9(TableRow, {
|
|
3393
3392
|
children: [
|
|
3394
|
-
selection ? /* @__PURE__ */
|
|
3393
|
+
selection ? /* @__PURE__ */ jsx15(TableHead, {
|
|
3395
3394
|
className: "w-10 pr-0",
|
|
3396
|
-
children: /* @__PURE__ */
|
|
3395
|
+
children: /* @__PURE__ */ jsx15(Checkbox, {
|
|
3397
3396
|
"aria-label": store.config.labels.selectAllRows,
|
|
3398
3397
|
checked: allSelected,
|
|
3399
3398
|
indeterminate: someSelected && !allSelected,
|
|
@@ -3407,12 +3406,12 @@ var DataTableHeader = ({
|
|
|
3407
3406
|
}
|
|
3408
3407
|
})
|
|
3409
3408
|
}) : null,
|
|
3410
|
-
draggable ? /* @__PURE__ */
|
|
3409
|
+
draggable ? /* @__PURE__ */ jsx15(TableHead, {
|
|
3411
3410
|
className: "w-10"
|
|
3412
3411
|
}) : null,
|
|
3413
3412
|
model.visibleColumns.map((column) => {
|
|
3414
3413
|
const direction = store.state.sort?.find(({ id }) => id === column.id)?.direction;
|
|
3415
|
-
return /* @__PURE__ */
|
|
3414
|
+
return /* @__PURE__ */ jsx15(TableHead, {
|
|
3416
3415
|
"aria-sort": direction === "asc" ? "ascending" : direction === "desc" ? "descending" : undefined,
|
|
3417
3416
|
className: "relative h-12 p-0",
|
|
3418
3417
|
scope: "col",
|
|
@@ -3420,17 +3419,17 @@ var DataTableHeader = ({
|
|
|
3420
3419
|
children: /* @__PURE__ */ jsxs9(ColumnIdContext.Provider, {
|
|
3421
3420
|
value: column.id,
|
|
3422
3421
|
children: [
|
|
3423
|
-
/* @__PURE__ */
|
|
3422
|
+
/* @__PURE__ */ jsx15(ColumnHeaderMenu, {
|
|
3424
3423
|
tableAtom
|
|
3425
3424
|
}),
|
|
3426
|
-
/* @__PURE__ */
|
|
3425
|
+
/* @__PURE__ */ jsx15(ResizeHandle, {
|
|
3427
3426
|
tableAtom
|
|
3428
3427
|
})
|
|
3429
3428
|
]
|
|
3430
3429
|
})
|
|
3431
3430
|
}, column.id);
|
|
3432
3431
|
}),
|
|
3433
|
-
hasRowActionMenu(store) ? /* @__PURE__ */
|
|
3432
|
+
hasRowActionMenu(store) ? /* @__PURE__ */ jsx15(TableHead, {
|
|
3434
3433
|
className: "w-10"
|
|
3435
3434
|
}) : null
|
|
3436
3435
|
]
|
|
@@ -3448,29 +3447,29 @@ var DataTableBody = ({
|
|
|
3448
3447
|
const sections = groupDataTableRows(rows, fields);
|
|
3449
3448
|
const colSpan = model.visibleColumns.length + (store.config.features.selection ? 1 : 0) + (hasRowActionMenu(store) ? 1 : 0) + (canDragRows(store) ? 1 : 0);
|
|
3450
3449
|
if (sections.length && (rows.length || !store.config.status.loading) && !store.config.status.error) {
|
|
3451
|
-
return /* @__PURE__ */
|
|
3450
|
+
return /* @__PURE__ */ jsx15(GroupedTable, {
|
|
3452
3451
|
tableAtom,
|
|
3453
3452
|
sections
|
|
3454
3453
|
});
|
|
3455
3454
|
}
|
|
3456
|
-
return /* @__PURE__ */
|
|
3457
|
-
children: store.config.status.error || !rows.length && !store.config.status.loading ? /* @__PURE__ */
|
|
3458
|
-
children: /* @__PURE__ */
|
|
3455
|
+
return /* @__PURE__ */ jsx15(TableBody, {
|
|
3456
|
+
children: store.config.status.error || !rows.length && !store.config.status.loading ? /* @__PURE__ */ jsx15(TableRow, {
|
|
3457
|
+
children: /* @__PURE__ */ jsx15(TableCell, {
|
|
3459
3458
|
className: "h-24 text-center",
|
|
3460
3459
|
colSpan: Math.max(colSpan, 1),
|
|
3461
3460
|
children: store.config.status.error ?? store.config.status.empty ?? store.config.labels.empty
|
|
3462
3461
|
})
|
|
3463
|
-
}) : store.config.status.loading && !rows.length ? /* @__PURE__ */
|
|
3464
|
-
children: /* @__PURE__ */
|
|
3462
|
+
}) : store.config.status.loading && !rows.length ? /* @__PURE__ */ jsx15(TableRow, {
|
|
3463
|
+
children: /* @__PURE__ */ jsx15(TableCell, {
|
|
3465
3464
|
className: "h-24 text-center",
|
|
3466
3465
|
colSpan: Math.max(colSpan, 1),
|
|
3467
|
-
children: /* @__PURE__ */
|
|
3466
|
+
children: /* @__PURE__ */ jsx15(Loading, {
|
|
3468
3467
|
label: store.config.labels.loading
|
|
3469
3468
|
})
|
|
3470
3469
|
})
|
|
3471
|
-
}) : rows.map((row) => /* @__PURE__ */
|
|
3470
|
+
}) : rows.map((row) => /* @__PURE__ */ jsx15(RowIdContext.Provider, {
|
|
3472
3471
|
value: row.id,
|
|
3473
|
-
children: /* @__PURE__ */
|
|
3472
|
+
children: /* @__PURE__ */ jsx15(TableDataRow, {
|
|
3474
3473
|
tableAtom
|
|
3475
3474
|
})
|
|
3476
3475
|
}, row.id))
|
|
@@ -3493,7 +3492,7 @@ var GalleryCard = ({
|
|
|
3493
3492
|
const selection = store.config.features.selection;
|
|
3494
3493
|
const selectable = !!selection && (selection.isRowSelectable?.(row.data) ?? true);
|
|
3495
3494
|
const draggable = canDragRows(store);
|
|
3496
|
-
return /* @__PURE__ */
|
|
3495
|
+
return /* @__PURE__ */ jsx15(Card, {
|
|
3497
3496
|
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"),
|
|
3498
3497
|
"data-table-row": row.id,
|
|
3499
3498
|
onClick: () => store.config.onRowClicked?.(row.data),
|
|
@@ -3510,14 +3509,14 @@ var GalleryCard = ({
|
|
|
3510
3509
|
/* @__PURE__ */ jsxs9("div", {
|
|
3511
3510
|
className: "flex items-center gap-2",
|
|
3512
3511
|
children: [
|
|
3513
|
-
selection ? /* @__PURE__ */
|
|
3512
|
+
selection ? /* @__PURE__ */ jsx15(Checkbox, {
|
|
3514
3513
|
"aria-label": store.config.labels.selectRow,
|
|
3515
3514
|
checked: !!store.state.rowSelection[row.id],
|
|
3516
3515
|
disabled: !selectable,
|
|
3517
3516
|
onCheckedChange: (checked) => toggleRow(store, setStore, row.id, checked),
|
|
3518
3517
|
onClick: (event) => event.stopPropagation()
|
|
3519
3518
|
}) : null,
|
|
3520
|
-
draggable ? /* @__PURE__ */
|
|
3519
|
+
draggable ? /* @__PURE__ */ jsx15(DragHandle, {
|
|
3521
3520
|
tableAtom
|
|
3522
3521
|
}) : null,
|
|
3523
3522
|
tag ? /* @__PURE__ */ jsxs9(Badge, {
|
|
@@ -3529,17 +3528,17 @@ var GalleryCard = ({
|
|
|
3529
3528
|
}) : null
|
|
3530
3529
|
]
|
|
3531
3530
|
}),
|
|
3532
|
-
/* @__PURE__ */
|
|
3531
|
+
/* @__PURE__ */ jsx15(CardTitle, {
|
|
3533
3532
|
children: name ? renderCell(row, name, store.config.locale, store.config.labels) : row.id
|
|
3534
3533
|
}),
|
|
3535
|
-
description ? /* @__PURE__ */
|
|
3534
|
+
description ? /* @__PURE__ */ jsx15("div", {
|
|
3536
3535
|
className: "text-muted-foreground line-clamp-3 text-sm",
|
|
3537
3536
|
children: renderCell(row, description, store.config.locale, store.config.labels)
|
|
3538
3537
|
}) : null,
|
|
3539
|
-
hasRowActionMenu(store) ? /* @__PURE__ */
|
|
3538
|
+
hasRowActionMenu(store) ? /* @__PURE__ */ jsx15("div", {
|
|
3540
3539
|
className: "absolute top-4 right-4",
|
|
3541
3540
|
onClick: (event) => event.stopPropagation(),
|
|
3542
|
-
children: /* @__PURE__ */
|
|
3541
|
+
children: /* @__PURE__ */ jsx15(DataTableRowActionMenu, {
|
|
3543
3542
|
tableAtom
|
|
3544
3543
|
})
|
|
3545
3544
|
}) : null
|
|
@@ -3556,37 +3555,37 @@ var DataTableGallery = ({
|
|
|
3556
3555
|
const rows = fields.length ? model.sortedRows : model.pageRows;
|
|
3557
3556
|
const sections = groupDataTableRows(rows, fields);
|
|
3558
3557
|
if (store.config.status.error) {
|
|
3559
|
-
return /* @__PURE__ */
|
|
3558
|
+
return /* @__PURE__ */ jsx15("div", {
|
|
3560
3559
|
className: "text-destructive rounded-lg border border-dashed p-10 text-center",
|
|
3561
3560
|
children: store.config.status.error
|
|
3562
3561
|
});
|
|
3563
3562
|
}
|
|
3564
3563
|
if (store.config.status.loading && !rows.length) {
|
|
3565
|
-
return /* @__PURE__ */
|
|
3564
|
+
return /* @__PURE__ */ jsx15("div", {
|
|
3566
3565
|
className: "rounded-lg border border-dashed p-10 text-center",
|
|
3567
|
-
children: /* @__PURE__ */
|
|
3566
|
+
children: /* @__PURE__ */ jsx15(Loading, {
|
|
3568
3567
|
label: store.config.labels.loading
|
|
3569
3568
|
})
|
|
3570
3569
|
});
|
|
3571
3570
|
}
|
|
3572
3571
|
if (!rows.length && !sections.length) {
|
|
3573
|
-
return /* @__PURE__ */
|
|
3572
|
+
return /* @__PURE__ */ jsx15("div", {
|
|
3574
3573
|
className: "text-muted-foreground rounded-lg border border-dashed p-10 text-center",
|
|
3575
3574
|
children: store.config.status.empty ?? store.config.labels.empty
|
|
3576
3575
|
});
|
|
3577
3576
|
}
|
|
3578
3577
|
if (!fields.length) {
|
|
3579
|
-
return /* @__PURE__ */
|
|
3578
|
+
return /* @__PURE__ */ jsx15("div", {
|
|
3580
3579
|
className: "grid gap-3 sm:grid-cols-2 xl:grid-cols-3",
|
|
3581
|
-
children: rows.map((row) => /* @__PURE__ */
|
|
3580
|
+
children: rows.map((row) => /* @__PURE__ */ jsx15(RowIdContext.Provider, {
|
|
3582
3581
|
value: row.id,
|
|
3583
|
-
children: /* @__PURE__ */
|
|
3582
|
+
children: /* @__PURE__ */ jsx15(GalleryCard, {
|
|
3584
3583
|
tableAtom
|
|
3585
3584
|
})
|
|
3586
3585
|
}, row.id))
|
|
3587
3586
|
});
|
|
3588
3587
|
}
|
|
3589
|
-
const renderSections = (
|
|
3588
|
+
const renderSections = (sections) => sections.map((section) => {
|
|
3590
3589
|
const collapsed = !!store.state.collapsedGroups[section.key];
|
|
3591
3590
|
const targetKey = getGroupDropKey(section.field.id, section.groupId);
|
|
3592
3591
|
const toggleCollapsed = () => changeState(setStore, (state) => ({
|
|
@@ -3609,44 +3608,44 @@ var DataTableGallery = ({
|
|
|
3609
3608
|
className: "flex flex-1 cursor-pointer items-center gap-2 text-left font-medium",
|
|
3610
3609
|
type: "button",
|
|
3611
3610
|
children: [
|
|
3612
|
-
collapsed ? /* @__PURE__ */
|
|
3611
|
+
collapsed ? /* @__PURE__ */ jsx15(ChevronRight2, {
|
|
3613
3612
|
className: "size-4"
|
|
3614
|
-
}) : /* @__PURE__ */
|
|
3613
|
+
}) : /* @__PURE__ */ jsx15(ChevronDown, {
|
|
3615
3614
|
className: "size-4"
|
|
3616
3615
|
}),
|
|
3617
|
-
/* @__PURE__ */
|
|
3616
|
+
/* @__PURE__ */ jsx15("span", {
|
|
3618
3617
|
className: "flex-1",
|
|
3619
3618
|
children: section.field.renderGroupLabel?.(section.groupId, section.rows.map((row) => row.data)) ?? section.groupId
|
|
3620
3619
|
}),
|
|
3621
|
-
/* @__PURE__ */
|
|
3620
|
+
/* @__PURE__ */ jsx15(Badge, {
|
|
3622
3621
|
variant: "secondary",
|
|
3623
3622
|
children: section.rows.length
|
|
3624
3623
|
})
|
|
3625
3624
|
]
|
|
3626
3625
|
}),
|
|
3627
|
-
/* @__PURE__ */
|
|
3626
|
+
/* @__PURE__ */ jsx15(GroupActions, {
|
|
3628
3627
|
actions: section.field.actions,
|
|
3629
3628
|
groupId: section.groupId,
|
|
3630
3629
|
title: section.field.actionsLabel ?? store.config.labels.actions
|
|
3631
3630
|
})
|
|
3632
3631
|
]
|
|
3633
3632
|
}),
|
|
3634
|
-
!collapsed ? section.children.length ? renderSections(section.children) : section.rows.length ? /* @__PURE__ */
|
|
3633
|
+
!collapsed ? section.children.length ? renderSections(section.children) : section.rows.length ? /* @__PURE__ */ jsx15("div", {
|
|
3635
3634
|
className: "grid gap-3 sm:grid-cols-2 xl:grid-cols-3",
|
|
3636
|
-
children: section.rows.map((row) => /* @__PURE__ */
|
|
3635
|
+
children: section.rows.map((row) => /* @__PURE__ */ jsx15(RowIdContext.Provider, {
|
|
3637
3636
|
value: row.id,
|
|
3638
|
-
children: /* @__PURE__ */
|
|
3637
|
+
children: /* @__PURE__ */ jsx15(GalleryCard, {
|
|
3639
3638
|
tableAtom
|
|
3640
3639
|
})
|
|
3641
3640
|
}, `${section.key}:${row.id}`))
|
|
3642
|
-
}) : /* @__PURE__ */
|
|
3641
|
+
}) : /* @__PURE__ */ jsx15("div", {
|
|
3643
3642
|
className: "text-muted-foreground rounded-lg border border-dashed p-8 text-center",
|
|
3644
3643
|
children: section.field.renderEmptyGroup?.(section.groupId) ?? store.config.labels.empty
|
|
3645
3644
|
}) : null
|
|
3646
3645
|
]
|
|
3647
3646
|
}, section.key);
|
|
3648
3647
|
});
|
|
3649
|
-
return /* @__PURE__ */
|
|
3648
|
+
return /* @__PURE__ */ jsx15("div", {
|
|
3650
3649
|
className: "space-y-4",
|
|
3651
3650
|
children: renderSections(sections)
|
|
3652
3651
|
});
|
|
@@ -3673,9 +3672,9 @@ var DataTablePagination = ({
|
|
|
3673
3672
|
return null;
|
|
3674
3673
|
const selected = model.rows.filter((row) => store.state.rowSelection[row.id]).length;
|
|
3675
3674
|
const setPagination = (next) => changeState(setStore, (state) => ({ ...state, ...next }));
|
|
3676
|
-
return /* @__PURE__ */
|
|
3675
|
+
return /* @__PURE__ */ jsx15("div", {
|
|
3677
3676
|
className: "pt-4",
|
|
3678
|
-
children: /* @__PURE__ */
|
|
3677
|
+
children: /* @__PURE__ */ jsx15(Pagination, {
|
|
3679
3678
|
locale: store.config.locale,
|
|
3680
3679
|
messages: { [store.config.locale]: store.config.labels },
|
|
3681
3680
|
onPageChange: (page) => setPagination({ page, pageSize: store.state.pageSize }),
|
|
@@ -3731,7 +3730,7 @@ var HydratedDataTable = ({
|
|
|
3731
3730
|
const config = {
|
|
3732
3731
|
getRowId: selection && selection.getRowId || props.getRowId || undefined,
|
|
3733
3732
|
onStateChange: props.onStateChange,
|
|
3734
|
-
onUiStateChange: (
|
|
3733
|
+
onUiStateChange: (state) => setUiState(state),
|
|
3735
3734
|
status: props.status ?? {},
|
|
3736
3735
|
features,
|
|
3737
3736
|
onRowClicked: props.onRowClicked,
|
|
@@ -3773,13 +3772,13 @@ var HydratedDataTable = ({
|
|
|
3773
3772
|
className: "w-full max-w-full min-w-0 rounded-md",
|
|
3774
3773
|
"data-table-root": "",
|
|
3775
3774
|
children: [
|
|
3776
|
-
/* @__PURE__ */
|
|
3775
|
+
/* @__PURE__ */ jsx15(DataTableToolbar, {
|
|
3777
3776
|
tableAtom
|
|
3778
3777
|
}),
|
|
3779
|
-
/* @__PURE__ */
|
|
3778
|
+
/* @__PURE__ */ jsx15(DataTableContent, {
|
|
3780
3779
|
tableAtom
|
|
3781
3780
|
}),
|
|
3782
|
-
/* @__PURE__ */
|
|
3781
|
+
/* @__PURE__ */ jsx15(DataTablePagination, {
|
|
3783
3782
|
tableAtom
|
|
3784
3783
|
})
|
|
3785
3784
|
]
|
|
@@ -3812,13 +3811,13 @@ var DataTable = (props) => {
|
|
|
3812
3811
|
}
|
|
3813
3812
|
} : undefined, [initialColumnVisibility, persistedUiResult]);
|
|
3814
3813
|
if (!persistedUiState || AsyncResult.isWaiting(persistedUiResult)) {
|
|
3815
|
-
return /* @__PURE__ */
|
|
3814
|
+
return /* @__PURE__ */ jsx15("div", {
|
|
3816
3815
|
"aria-busy": "true",
|
|
3817
3816
|
className: "invisible w-full max-w-full min-w-0 rounded-md",
|
|
3818
3817
|
"data-table-root": ""
|
|
3819
3818
|
});
|
|
3820
3819
|
}
|
|
3821
|
-
return /* @__PURE__ */
|
|
3820
|
+
return /* @__PURE__ */ jsx15(HydratedDataTable, {
|
|
3822
3821
|
...props,
|
|
3823
3822
|
locale,
|
|
3824
3823
|
persistedUiState,
|
|
@@ -3830,7 +3829,7 @@ var DataTableContent = ({
|
|
|
3830
3829
|
}) => {
|
|
3831
3830
|
const [store] = useTableAtom(tableAtom);
|
|
3832
3831
|
if (store.config.features.gallery && store.state.view === "gallery") {
|
|
3833
|
-
return /* @__PURE__ */
|
|
3832
|
+
return /* @__PURE__ */ jsx15(DataTableGallery, {
|
|
3834
3833
|
tableAtom
|
|
3835
3834
|
});
|
|
3836
3835
|
}
|
|
@@ -3843,15 +3842,15 @@ var DataTableContent = ({
|
|
|
3843
3842
|
className: "table-fixed",
|
|
3844
3843
|
style: { width: `max(100%, ${width}px)` },
|
|
3845
3844
|
children: [
|
|
3846
|
-
/* @__PURE__ */
|
|
3845
|
+
/* @__PURE__ */ jsx15(DataTableHeader, {
|
|
3847
3846
|
tableAtom
|
|
3848
3847
|
}),
|
|
3849
|
-
/* @__PURE__ */
|
|
3848
|
+
/* @__PURE__ */ jsx15(DataTableBody, {
|
|
3850
3849
|
tableAtom
|
|
3851
3850
|
})
|
|
3852
3851
|
]
|
|
3853
3852
|
}),
|
|
3854
|
-
/* @__PURE__ */
|
|
3853
|
+
/* @__PURE__ */ jsx15(ScrollBar, {
|
|
3855
3854
|
orientation: "horizontal"
|
|
3856
3855
|
})
|
|
3857
3856
|
]
|
|
@@ -3861,25 +3860,25 @@ var DataTableListCell = (props) => {
|
|
|
3861
3860
|
const locale = useKrakstackLocale3(props.locale);
|
|
3862
3861
|
const resolvedProps = { ...props, locale };
|
|
3863
3862
|
if (resolvedProps.options && (resolvedProps.onAdd || resolvedProps.onRemove)) {
|
|
3864
|
-
return /* @__PURE__ */
|
|
3863
|
+
return /* @__PURE__ */ jsx15(EditableDataTableListCell, {
|
|
3865
3864
|
...resolvedProps
|
|
3866
3865
|
});
|
|
3867
3866
|
}
|
|
3868
3867
|
const { actionsLabel, itemActions, onItemClick, ...summaryProps } = resolvedProps;
|
|
3869
|
-
const
|
|
3868
|
+
const labels = dataTableMessages(locale, resolvedProps.messages);
|
|
3870
3869
|
const hasItems = resolvedProps.items.length > 0;
|
|
3871
3870
|
if (!itemActions?.length && !hasItems) {
|
|
3872
|
-
return /* @__PURE__ */
|
|
3871
|
+
return /* @__PURE__ */ jsx15(DataTableListSummary, {
|
|
3873
3872
|
...summaryProps
|
|
3874
3873
|
});
|
|
3875
3874
|
}
|
|
3876
|
-
const menuLabel = actionsLabel ?? (itemActions?.length ?
|
|
3877
|
-
return /* @__PURE__ */
|
|
3875
|
+
const menuLabel = actionsLabel ?? (itemActions?.length ? labels.actions : labels.listDetails);
|
|
3876
|
+
return /* @__PURE__ */ jsx15("div", {
|
|
3878
3877
|
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",
|
|
3879
3878
|
"data-slot": "data-table-list-cell",
|
|
3880
3879
|
onClick: (event) => event.stopPropagation(),
|
|
3881
3880
|
onPointerDown: (event) => event.stopPropagation(),
|
|
3882
|
-
children: /* @__PURE__ */
|
|
3881
|
+
children: /* @__PURE__ */ jsx15(DataTableListMenu, {
|
|
3883
3882
|
actions: itemActions ?? [],
|
|
3884
3883
|
display: resolvedProps.display,
|
|
3885
3884
|
force: hasItems,
|
|
@@ -3893,11 +3892,11 @@ var DataTableListCell = (props) => {
|
|
|
3893
3892
|
className: "h-full w-full min-w-0 justify-between rounded-none px-2 focus-visible:ring-inset",
|
|
3894
3893
|
variant: "ghost",
|
|
3895
3894
|
children: [
|
|
3896
|
-
/* @__PURE__ */
|
|
3895
|
+
/* @__PURE__ */ jsx15(DataTableListSummaryContent, {
|
|
3897
3896
|
...summaryProps,
|
|
3898
3897
|
showMenu: false
|
|
3899
3898
|
}),
|
|
3900
|
-
/* @__PURE__ */
|
|
3899
|
+
/* @__PURE__ */ jsx15(ChevronDown, {})
|
|
3901
3900
|
]
|
|
3902
3901
|
})
|
|
3903
3902
|
})
|
|
@@ -3917,7 +3916,7 @@ var EditableDataTableListCell = ({
|
|
|
3917
3916
|
itemActions,
|
|
3918
3917
|
onItemClick,
|
|
3919
3918
|
locale = "en",
|
|
3920
|
-
messages
|
|
3919
|
+
messages
|
|
3921
3920
|
}) => {
|
|
3922
3921
|
const [selected, setSelected] = useState([...items]);
|
|
3923
3922
|
const [previousItems, setPreviousItems] = useState(items);
|
|
@@ -3929,15 +3928,15 @@ var EditableDataTableListCell = ({
|
|
|
3929
3928
|
const available = options.filter((item) => !selectedValues.has(item.value));
|
|
3930
3929
|
const canAdd = !!onAdd && available.length > 0;
|
|
3931
3930
|
const selectedTotal = totalCount === undefined ? selected.length : totalCount + selected.length - items.length;
|
|
3932
|
-
const
|
|
3931
|
+
const labels = dataTableMessages(locale, messages);
|
|
3933
3932
|
const actions = [
|
|
3934
3933
|
...itemActions ?? [],
|
|
3935
3934
|
...onRemove ? [
|
|
3936
3935
|
{
|
|
3937
3936
|
id: "data-table-list-remove",
|
|
3938
3937
|
closeOnClick: false,
|
|
3939
|
-
name:
|
|
3940
|
-
icon: /* @__PURE__ */
|
|
3938
|
+
name: labels.removeItem,
|
|
3939
|
+
icon: /* @__PURE__ */ jsx15(Trash2, {}),
|
|
3941
3940
|
variant: "destructive",
|
|
3942
3941
|
onClick: (item) => {
|
|
3943
3942
|
if (item.value === undefined)
|
|
@@ -3948,15 +3947,15 @@ var EditableDataTableListCell = ({
|
|
|
3948
3947
|
}
|
|
3949
3948
|
] : []
|
|
3950
3949
|
];
|
|
3951
|
-
return /* @__PURE__ */
|
|
3950
|
+
return /* @__PURE__ */ jsx15("div", {
|
|
3952
3951
|
"data-slot": "data-table-list-cell",
|
|
3953
3952
|
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",
|
|
3954
3953
|
onClick: (event) => event.stopPropagation(),
|
|
3955
3954
|
onPointerDown: (event) => event.stopPropagation(),
|
|
3956
|
-
children: /* @__PURE__ */
|
|
3955
|
+
children: /* @__PURE__ */ jsx15(DataTableListMenu, {
|
|
3957
3956
|
actions,
|
|
3958
3957
|
addEmptyLabel: emptyLabel,
|
|
3959
|
-
addLabel:
|
|
3958
|
+
addLabel: labels.addItem,
|
|
3960
3959
|
addOptions: canAdd ? available : undefined,
|
|
3961
3960
|
addSearchLabel: manageLabel,
|
|
3962
3961
|
display,
|
|
@@ -3965,7 +3964,7 @@ var EditableDataTableListCell = ({
|
|
|
3965
3964
|
onItemClick,
|
|
3966
3965
|
label: actionsLabel ?? manageLabel,
|
|
3967
3966
|
locale,
|
|
3968
|
-
messages
|
|
3967
|
+
messages,
|
|
3969
3968
|
onAdd: canAdd ? (item) => {
|
|
3970
3969
|
onAdd(item.value);
|
|
3971
3970
|
setSelected((current) => [...current, item]);
|
|
@@ -3975,7 +3974,7 @@ var EditableDataTableListCell = ({
|
|
|
3975
3974
|
className: "h-full w-full min-w-0 justify-between rounded-none px-2 focus-visible:ring-inset",
|
|
3976
3975
|
variant: "ghost",
|
|
3977
3976
|
children: [
|
|
3978
|
-
/* @__PURE__ */
|
|
3977
|
+
/* @__PURE__ */ jsx15(DataTableListSummaryContent, {
|
|
3979
3978
|
emptyLabel,
|
|
3980
3979
|
items: selected,
|
|
3981
3980
|
display,
|
|
@@ -3983,7 +3982,7 @@ var EditableDataTableListCell = ({
|
|
|
3983
3982
|
visibleCount,
|
|
3984
3983
|
totalCount: selectedTotal
|
|
3985
3984
|
}),
|
|
3986
|
-
/* @__PURE__ */
|
|
3985
|
+
/* @__PURE__ */ jsx15(ChevronDown, {})
|
|
3987
3986
|
]
|
|
3988
3987
|
})
|
|
3989
3988
|
})
|
|
@@ -4001,7 +4000,7 @@ var DataTableListMenu = ({
|
|
|
4001
4000
|
items,
|
|
4002
4001
|
label,
|
|
4003
4002
|
locale = "en",
|
|
4004
|
-
messages
|
|
4003
|
+
messages,
|
|
4005
4004
|
onAdd,
|
|
4006
4005
|
onItemClick,
|
|
4007
4006
|
trigger
|
|
@@ -4014,41 +4013,41 @@ var DataTableListMenu = ({
|
|
|
4014
4013
|
const hasActions = entries.some(({ visibleActions }) => visibleActions.length);
|
|
4015
4014
|
if (!force && !hasActions && !onAdd)
|
|
4016
4015
|
return null;
|
|
4017
|
-
const
|
|
4018
|
-
const resolvedLabel = label ?? (hasActions ?
|
|
4016
|
+
const labels = dataTableMessages(locale, messages);
|
|
4017
|
+
const resolvedLabel = label ?? (hasActions ? labels.actions : labels.listDetails);
|
|
4019
4018
|
return /* @__PURE__ */ jsxs9(DropdownMenu, {
|
|
4020
4019
|
children: [
|
|
4021
|
-
/* @__PURE__ */
|
|
4020
|
+
/* @__PURE__ */ jsx15(DropdownMenuTrigger, {
|
|
4022
4021
|
onClick: (event) => event.stopPropagation(),
|
|
4023
4022
|
onPointerDown: (event) => event.stopPropagation(),
|
|
4024
|
-
render: trigger ?? /* @__PURE__ */
|
|
4023
|
+
render: trigger ?? /* @__PURE__ */ jsx15(Button, {
|
|
4025
4024
|
"aria-label": resolvedLabel,
|
|
4026
4025
|
className: cn("size-8 shrink-0", className),
|
|
4027
4026
|
size: "icon",
|
|
4028
4027
|
variant: "ghost",
|
|
4029
|
-
children: /* @__PURE__ */
|
|
4028
|
+
children: /* @__PURE__ */ jsx15(MoreHorizontal, {})
|
|
4030
4029
|
})
|
|
4031
4030
|
}),
|
|
4032
|
-
/* @__PURE__ */
|
|
4031
|
+
/* @__PURE__ */ jsx15(DropdownMenuContent, {
|
|
4033
4032
|
align: "end",
|
|
4034
4033
|
className: "max-h-[min(18rem,var(--available-height))] w-72 max-w-[calc(100vw-2rem)]",
|
|
4035
4034
|
onClick: (event) => event.stopPropagation(),
|
|
4036
4035
|
onPointerDown: (event) => event.stopPropagation(),
|
|
4037
4036
|
children: /* @__PURE__ */ jsxs9(DropdownMenuGroup, {
|
|
4038
4037
|
children: [
|
|
4039
|
-
/* @__PURE__ */
|
|
4038
|
+
/* @__PURE__ */ jsx15(DropdownMenuLabel, {
|
|
4040
4039
|
children: resolvedLabel
|
|
4041
4040
|
}),
|
|
4042
|
-
/* @__PURE__ */
|
|
4041
|
+
/* @__PURE__ */ jsx15(DropdownMenuSeparator, {}),
|
|
4043
4042
|
entries.map(({ item, visibleActions }, index) => visibleActions.length ? /* @__PURE__ */ jsxs9(DropdownMenuSub, {
|
|
4044
4043
|
children: [
|
|
4045
|
-
/* @__PURE__ */
|
|
4046
|
-
children: /* @__PURE__ */
|
|
4044
|
+
/* @__PURE__ */ jsx15(DropdownMenuSubTrigger, {
|
|
4045
|
+
children: /* @__PURE__ */ jsx15(DataTableListEntry, {
|
|
4047
4046
|
item,
|
|
4048
4047
|
appearance: display === "icon" ? "detail" : "list"
|
|
4049
4048
|
})
|
|
4050
4049
|
}),
|
|
4051
|
-
/* @__PURE__ */
|
|
4050
|
+
/* @__PURE__ */ jsx15(DropdownMenuSubContent, {
|
|
4052
4051
|
className: "w-max",
|
|
4053
4052
|
children: visibleActions.map((action) => /* @__PURE__ */ jsxs9(DropdownMenuItem, {
|
|
4054
4053
|
closeOnClick: action.closeOnClick,
|
|
@@ -4065,28 +4064,28 @@ var DataTableListMenu = ({
|
|
|
4065
4064
|
}, action.id ?? action.name))
|
|
4066
4065
|
})
|
|
4067
4066
|
]
|
|
4068
|
-
}, item.value ?? `${item.label}-${index}`) : /* @__PURE__ */
|
|
4067
|
+
}, item.value ?? `${item.label}-${index}`) : /* @__PURE__ */ jsx15(DropdownMenuItem, {
|
|
4069
4068
|
closeOnClick: Boolean(onItemClick),
|
|
4070
4069
|
onClick: (event) => {
|
|
4071
4070
|
event.stopPropagation();
|
|
4072
4071
|
onItemClick?.(item);
|
|
4073
4072
|
},
|
|
4074
|
-
children: /* @__PURE__ */
|
|
4073
|
+
children: /* @__PURE__ */ jsx15(DataTableListEntry, {
|
|
4075
4074
|
item,
|
|
4076
4075
|
appearance: display === "icon" ? "detail" : "list"
|
|
4077
4076
|
})
|
|
4078
4077
|
}, item.value ?? `${item.label}-${index}`)),
|
|
4079
4078
|
onAdd && addOptions?.length ? /* @__PURE__ */ jsxs9(Fragment, {
|
|
4080
4079
|
children: [
|
|
4081
|
-
entries.length ? /* @__PURE__ */
|
|
4082
|
-
/* @__PURE__ */
|
|
4080
|
+
entries.length ? /* @__PURE__ */ jsx15(DropdownMenuSeparator, {}) : null,
|
|
4081
|
+
/* @__PURE__ */ jsx15(DataTableListAddMenu, {
|
|
4083
4082
|
emptyLabel: addEmptyLabel,
|
|
4084
|
-
label: addLabel ??
|
|
4083
|
+
label: addLabel ?? labels.addItem,
|
|
4085
4084
|
locale,
|
|
4086
|
-
messages
|
|
4085
|
+
messages,
|
|
4087
4086
|
onAdd,
|
|
4088
4087
|
options: addOptions,
|
|
4089
|
-
searchLabel: addSearchLabel ??
|
|
4088
|
+
searchLabel: addSearchLabel ?? labels.filter,
|
|
4090
4089
|
display
|
|
4091
4090
|
})
|
|
4092
4091
|
]
|
|
@@ -4102,7 +4101,7 @@ var DataTableListAddMenu = ({
|
|
|
4102
4101
|
display,
|
|
4103
4102
|
label,
|
|
4104
4103
|
locale = "en",
|
|
4105
|
-
messages
|
|
4104
|
+
messages,
|
|
4106
4105
|
onAdd,
|
|
4107
4106
|
options,
|
|
4108
4107
|
searchLabel
|
|
@@ -4111,7 +4110,7 @@ var DataTableListAddMenu = ({
|
|
|
4111
4110
|
const focusSearch = useCallback((input) => {
|
|
4112
4111
|
input?.focus({ preventScroll: true });
|
|
4113
4112
|
}, []);
|
|
4114
|
-
const
|
|
4113
|
+
const labels = dataTableMessages(locale, messages);
|
|
4115
4114
|
const normalizedSearch = search.trim().toLocaleLowerCase(locale);
|
|
4116
4115
|
const filtered = normalizedSearch ? options.filter((item) => item.label.toLocaleLowerCase(locale).includes(normalizedSearch)) : options;
|
|
4117
4116
|
return /* @__PURE__ */ jsxs9(DropdownMenuSub, {
|
|
@@ -4122,7 +4121,7 @@ var DataTableListAddMenu = ({
|
|
|
4122
4121
|
children: [
|
|
4123
4122
|
/* @__PURE__ */ jsxs9(DropdownMenuSubTrigger, {
|
|
4124
4123
|
children: [
|
|
4125
|
-
/* @__PURE__ */
|
|
4124
|
+
/* @__PURE__ */ jsx15(Plus, {}),
|
|
4126
4125
|
label
|
|
4127
4126
|
]
|
|
4128
4127
|
}),
|
|
@@ -4132,10 +4131,10 @@ var DataTableListAddMenu = ({
|
|
|
4132
4131
|
/* @__PURE__ */ jsxs9("div", {
|
|
4133
4132
|
className: "relative p-1",
|
|
4134
4133
|
children: [
|
|
4135
|
-
/* @__PURE__ */
|
|
4134
|
+
/* @__PURE__ */ jsx15(Search, {
|
|
4136
4135
|
className: "text-muted-foreground pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2"
|
|
4137
4136
|
}),
|
|
4138
|
-
/* @__PURE__ */
|
|
4137
|
+
/* @__PURE__ */ jsx15(Input, {
|
|
4139
4138
|
"aria-label": searchLabel,
|
|
4140
4139
|
className: "h-8 pl-8",
|
|
4141
4140
|
onChange: (event) => setSearch(event.target.value),
|
|
@@ -4143,21 +4142,21 @@ var DataTableListAddMenu = ({
|
|
|
4143
4142
|
if (event.key !== "Escape")
|
|
4144
4143
|
event.stopPropagation();
|
|
4145
4144
|
},
|
|
4146
|
-
placeholder:
|
|
4145
|
+
placeholder: labels.filter,
|
|
4147
4146
|
ref: focusSearch,
|
|
4148
4147
|
value: search
|
|
4149
4148
|
})
|
|
4150
4149
|
]
|
|
4151
4150
|
}),
|
|
4152
|
-
/* @__PURE__ */
|
|
4153
|
-
filtered.length ? filtered.map((item) => /* @__PURE__ */
|
|
4151
|
+
/* @__PURE__ */ jsx15(DropdownMenuSeparator, {}),
|
|
4152
|
+
filtered.length ? filtered.map((item) => /* @__PURE__ */ jsx15(DropdownMenuItem, {
|
|
4154
4153
|
closeOnClick: false,
|
|
4155
4154
|
onClick: () => onAdd(item),
|
|
4156
|
-
children: /* @__PURE__ */
|
|
4155
|
+
children: /* @__PURE__ */ jsx15(DataTableListEntry, {
|
|
4157
4156
|
item,
|
|
4158
4157
|
appearance: display === "icon" ? "detail" : "list"
|
|
4159
4158
|
})
|
|
4160
|
-
}, item.value)) : /* @__PURE__ */
|
|
4159
|
+
}, item.value)) : /* @__PURE__ */ jsx15("div", {
|
|
4161
4160
|
className: "text-muted-foreground px-2 py-1.5 text-sm",
|
|
4162
4161
|
children: emptyLabel
|
|
4163
4162
|
})
|
|
@@ -4170,7 +4169,7 @@ var DataTableListSummaryContent = ({
|
|
|
4170
4169
|
emptyLabel,
|
|
4171
4170
|
items,
|
|
4172
4171
|
locale,
|
|
4173
|
-
messages
|
|
4172
|
+
messages,
|
|
4174
4173
|
totalCount = items.length,
|
|
4175
4174
|
display = "list",
|
|
4176
4175
|
showMenu,
|
|
@@ -4178,18 +4177,18 @@ var DataTableListSummaryContent = ({
|
|
|
4178
4177
|
}) => {
|
|
4179
4178
|
const normalized = items.map((item) => Schema2.is(Schema2.String)(item) ? { label: item } : item);
|
|
4180
4179
|
if (!normalized.length)
|
|
4181
|
-
return /* @__PURE__ */
|
|
4180
|
+
return /* @__PURE__ */ jsx15("span", {
|
|
4182
4181
|
className: "text-muted-foreground",
|
|
4183
4182
|
children: emptyLabel
|
|
4184
4183
|
});
|
|
4185
4184
|
const visible = normalized.slice(0, Math.max(0, visibleCount));
|
|
4186
4185
|
const remaining = Math.max(totalCount - visible.length, 0);
|
|
4187
4186
|
if (display === "icon") {
|
|
4188
|
-
return /* @__PURE__ */
|
|
4187
|
+
return /* @__PURE__ */ jsx15(TooltipProvider, {
|
|
4189
4188
|
children: /* @__PURE__ */ jsxs9("span", {
|
|
4190
4189
|
className: "flex items-center",
|
|
4191
4190
|
children: [
|
|
4192
|
-
visible.map((item, index) => /* @__PURE__ */
|
|
4191
|
+
visible.map((item, index) => /* @__PURE__ */ jsx15(DataTableListEntry, {
|
|
4193
4192
|
item,
|
|
4194
4193
|
appearance: "icon"
|
|
4195
4194
|
}, item.value ?? `${item.label}-${index}`)),
|
|
@@ -4200,13 +4199,13 @@ var DataTableListSummaryContent = ({
|
|
|
4200
4199
|
remaining
|
|
4201
4200
|
]
|
|
4202
4201
|
}) : null,
|
|
4203
|
-
remaining && showMenu ? /* @__PURE__ */
|
|
4202
|
+
remaining && showMenu ? /* @__PURE__ */ jsx15(DataTableListMenu, {
|
|
4204
4203
|
actions: [],
|
|
4205
4204
|
display,
|
|
4206
4205
|
force: true,
|
|
4207
4206
|
items: normalized,
|
|
4208
4207
|
locale,
|
|
4209
|
-
messages
|
|
4208
|
+
messages
|
|
4210
4209
|
}) : null
|
|
4211
4210
|
]
|
|
4212
4211
|
})
|
|
@@ -4222,18 +4221,18 @@ var DataTableListSummaryContent = ({
|
|
|
4222
4221
|
remaining ? ` +${remaining}` : ""
|
|
4223
4222
|
]
|
|
4224
4223
|
}),
|
|
4225
|
-
remaining && showMenu ? /* @__PURE__ */
|
|
4224
|
+
remaining && showMenu ? /* @__PURE__ */ jsx15(DataTableListMenu, {
|
|
4226
4225
|
actions: [],
|
|
4227
4226
|
display,
|
|
4228
4227
|
force: true,
|
|
4229
4228
|
items: normalized,
|
|
4230
4229
|
locale,
|
|
4231
|
-
messages
|
|
4230
|
+
messages
|
|
4232
4231
|
}) : null
|
|
4233
4232
|
]
|
|
4234
4233
|
});
|
|
4235
4234
|
};
|
|
4236
|
-
var DataTableListSummary = (props) => /* @__PURE__ */
|
|
4235
|
+
var DataTableListSummary = (props) => /* @__PURE__ */ jsx15(DataTableListSummaryContent, {
|
|
4237
4236
|
...props,
|
|
4238
4237
|
showMenu: true
|
|
4239
4238
|
});
|
|
@@ -4241,17 +4240,17 @@ var DataTableListEntry = ({
|
|
|
4241
4240
|
item,
|
|
4242
4241
|
appearance
|
|
4243
4242
|
}) => {
|
|
4244
|
-
const icon = /* @__PURE__ */
|
|
4243
|
+
const icon = /* @__PURE__ */ jsx15("span", {
|
|
4245
4244
|
"aria-hidden": "true",
|
|
4246
4245
|
className: "bg-secondary text-secondary-foreground flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-full",
|
|
4247
|
-
children: item.imageSrc ? /* @__PURE__ */
|
|
4246
|
+
children: item.imageSrc ? /* @__PURE__ */ jsx15("img", {
|
|
4248
4247
|
alt: "",
|
|
4249
4248
|
src: item.imageSrc,
|
|
4250
4249
|
className: "size-full object-cover"
|
|
4251
4250
|
}) : item.icon ?? item.label.slice(0, 2).toUpperCase()
|
|
4252
4251
|
});
|
|
4253
4252
|
if (appearance === "list") {
|
|
4254
|
-
return /* @__PURE__ */
|
|
4253
|
+
return /* @__PURE__ */ jsx15("span", {
|
|
4255
4254
|
className: "min-w-0 flex-1 truncate",
|
|
4256
4255
|
title: item.label,
|
|
4257
4256
|
children: item.label
|
|
@@ -4259,14 +4258,14 @@ var DataTableListEntry = ({
|
|
|
4259
4258
|
}
|
|
4260
4259
|
return appearance === "icon" ? /* @__PURE__ */ jsxs9(Tooltip, {
|
|
4261
4260
|
children: [
|
|
4262
|
-
/* @__PURE__ */
|
|
4263
|
-
render: /* @__PURE__ */
|
|
4261
|
+
/* @__PURE__ */ jsx15(TooltipTrigger, {
|
|
4262
|
+
render: /* @__PURE__ */ jsx15("span", {
|
|
4264
4263
|
className: "-ml-1 inline-flex rounded-full",
|
|
4265
4264
|
"aria-label": item.label
|
|
4266
4265
|
}),
|
|
4267
4266
|
children: icon
|
|
4268
4267
|
}),
|
|
4269
|
-
/* @__PURE__ */
|
|
4268
|
+
/* @__PURE__ */ jsx15(TooltipContent, {
|
|
4270
4269
|
children: item.label
|
|
4271
4270
|
})
|
|
4272
4271
|
]
|
|
@@ -4274,7 +4273,7 @@ var DataTableListEntry = ({
|
|
|
4274
4273
|
className: "flex min-w-0 flex-1 items-center gap-2 text-left",
|
|
4275
4274
|
children: [
|
|
4276
4275
|
icon,
|
|
4277
|
-
/* @__PURE__ */
|
|
4276
|
+
/* @__PURE__ */ jsx15("span", {
|
|
4278
4277
|
className: "truncate",
|
|
4279
4278
|
children: item.label
|
|
4280
4279
|
})
|
|
@@ -4296,7 +4295,7 @@ var TextArrayValue = Schema3.Struct({
|
|
|
4296
4295
|
var eventTextAttribute = (record, key) => Schema3.decodeUnknownOption(TextValue)(record.attributes.find((attribute) => attribute.key === key)?.value).pipe(Option3.map((value) => value.stringValue), Option3.getOrNull);
|
|
4297
4296
|
|
|
4298
4297
|
// ../../src/services/events/client/audit-log-table.tsx
|
|
4299
|
-
import { jsx as
|
|
4298
|
+
import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
4300
4299
|
var translations = {
|
|
4301
4300
|
en: {
|
|
4302
4301
|
title: "Activity history",
|
|
@@ -4337,7 +4336,7 @@ var AuditLogTable = ({
|
|
|
4337
4336
|
rowCount,
|
|
4338
4337
|
timeZone = "America/New_York",
|
|
4339
4338
|
locale: localeOverride,
|
|
4340
|
-
messages
|
|
4339
|
+
messages,
|
|
4341
4340
|
renderAction,
|
|
4342
4341
|
state,
|
|
4343
4342
|
onStateChange,
|
|
@@ -4345,15 +4344,15 @@ var AuditLogTable = ({
|
|
|
4345
4344
|
}) => {
|
|
4346
4345
|
const locale = useKrakstackLocale4(localeOverride);
|
|
4347
4346
|
const base = locale.split("-")[0];
|
|
4348
|
-
const
|
|
4347
|
+
const labels = {
|
|
4349
4348
|
...translations.en,
|
|
4350
4349
|
...base === "fr" ? translations.fr : translations.en,
|
|
4351
|
-
...
|
|
4352
|
-
...
|
|
4350
|
+
...messages?.[base],
|
|
4351
|
+
...messages?.[locale]
|
|
4353
4352
|
};
|
|
4354
4353
|
const methods = new Map([
|
|
4355
|
-
["session",
|
|
4356
|
-
["api_key",
|
|
4354
|
+
["session", labels.methodSession],
|
|
4355
|
+
["api_key", labels.methodApiKey]
|
|
4357
4356
|
]);
|
|
4358
4357
|
const tableState = state?.eventName && !state.filters?.some((filter) => filter.id === "eventName") ? {
|
|
4359
4358
|
...state,
|
|
@@ -4366,36 +4365,36 @@ var AuditLogTable = ({
|
|
|
4366
4365
|
const type = eventTextAttribute(entry, "app.actor.type");
|
|
4367
4366
|
const id = eventTextAttribute(entry, "app.actor.id") ?? eventTextAttribute(entry, "user.id");
|
|
4368
4367
|
if (type === "organization") {
|
|
4369
|
-
return { label:
|
|
4368
|
+
return { label: labels.actorOrganization, description: id };
|
|
4370
4369
|
}
|
|
4371
4370
|
if (type === "user" || eventTextAttribute(entry, "user.id") !== null) {
|
|
4372
4371
|
const fullName = eventTextAttribute(entry, "user.full_name");
|
|
4373
4372
|
const name = eventTextAttribute(entry, "user.name");
|
|
4374
4373
|
const email = eventTextAttribute(entry, "user.email");
|
|
4375
4374
|
return {
|
|
4376
|
-
label: fullName || name || email ||
|
|
4375
|
+
label: fullName || name || email || labels.actorMember,
|
|
4377
4376
|
description: fullName || name ? email || id : id
|
|
4378
4377
|
};
|
|
4379
4378
|
}
|
|
4380
|
-
return { label: type ??
|
|
4379
|
+
return { label: type ?? labels.actor, description: id };
|
|
4381
4380
|
};
|
|
4382
4381
|
const columns = [
|
|
4383
4382
|
{
|
|
4384
4383
|
colId: "time",
|
|
4385
|
-
headerName:
|
|
4384
|
+
headerName: labels.time,
|
|
4386
4385
|
type: "dateTime",
|
|
4387
4386
|
typeOptions: { timeZone },
|
|
4388
4387
|
valueGetter: ({ data }) => new Date(Number(BigInt(data.timeUnixNano) / 1000000n))
|
|
4389
4388
|
},
|
|
4390
4389
|
{
|
|
4391
4390
|
field: "eventName",
|
|
4392
|
-
headerName:
|
|
4391
|
+
headerName: labels.action,
|
|
4393
4392
|
filterOptions: events,
|
|
4394
4393
|
cellRenderer: ({ data }) => renderAction?.(data) ?? events.find((event) => event.value === data.eventName)?.label ?? data.eventName
|
|
4395
4394
|
},
|
|
4396
4395
|
{
|
|
4397
4396
|
colId: "record",
|
|
4398
|
-
headerName:
|
|
4397
|
+
headerName: labels.target,
|
|
4399
4398
|
filterValueGetter: ({ data }) => [
|
|
4400
4399
|
eventTextAttribute(data, "app.audit.target.name") ?? "",
|
|
4401
4400
|
eventTextAttribute(data, "app.audit.target.type") ?? "",
|
|
@@ -4409,7 +4408,7 @@ var AuditLogTable = ({
|
|
|
4409
4408
|
const name = eventTextAttribute(entry, "app.audit.target.name");
|
|
4410
4409
|
const type = eventTextAttribute(entry, "app.audit.target.type");
|
|
4411
4410
|
return id === null ? null : {
|
|
4412
|
-
label: name && name !== id ? name : type ||
|
|
4411
|
+
label: name && name !== id ? name : type || labels.target,
|
|
4413
4412
|
description: name && name !== id && type ? `${type} · ${id}` : id
|
|
4414
4413
|
};
|
|
4415
4414
|
}
|
|
@@ -4417,7 +4416,7 @@ var AuditLogTable = ({
|
|
|
4417
4416
|
},
|
|
4418
4417
|
{
|
|
4419
4418
|
colId: "actor",
|
|
4420
|
-
headerName:
|
|
4419
|
+
headerName: labels.actor,
|
|
4421
4420
|
filterValueGetter: ({ data }) => [
|
|
4422
4421
|
eventTextAttribute(data, "user.full_name") || eventTextAttribute(data, "user.name") || eventTextAttribute(data, "user.email") || eventTextAttribute(data, "app.actor.type") || "",
|
|
4423
4422
|
eventTextAttribute(data, "user.email") ?? "",
|
|
@@ -4433,13 +4432,13 @@ var AuditLogTable = ({
|
|
|
4433
4432
|
return /* @__PURE__ */ jsxs10("div", {
|
|
4434
4433
|
className: "flex min-w-0 flex-col gap-1",
|
|
4435
4434
|
children: [
|
|
4436
|
-
/* @__PURE__ */
|
|
4435
|
+
/* @__PURE__ */ jsx16(DataTableReferenceCell, {
|
|
4437
4436
|
item: getActor(data)
|
|
4438
4437
|
}),
|
|
4439
4438
|
impersonatorId !== null ? /* @__PURE__ */ jsxs10("span", {
|
|
4440
4439
|
className: "text-muted-foreground text-xs",
|
|
4441
4440
|
children: [
|
|
4442
|
-
|
|
4441
|
+
labels.impersonatedBy,
|
|
4443
4442
|
": ",
|
|
4444
4443
|
impersonatorId
|
|
4445
4444
|
]
|
|
@@ -4450,11 +4449,11 @@ var AuditLogTable = ({
|
|
|
4450
4449
|
},
|
|
4451
4450
|
{
|
|
4452
4451
|
colId: "method",
|
|
4453
|
-
headerName:
|
|
4452
|
+
headerName: labels.method,
|
|
4454
4453
|
filterOptions: [
|
|
4455
|
-
{ value: "session", label:
|
|
4456
|
-
{ value: "api_key", label:
|
|
4457
|
-
{ value: "unknown", label:
|
|
4454
|
+
{ value: "session", label: labels.methodSession },
|
|
4455
|
+
{ value: "api_key", label: labels.methodApiKey },
|
|
4456
|
+
{ value: "unknown", label: labels.methodUnknown }
|
|
4458
4457
|
],
|
|
4459
4458
|
filterValueGetter: ({ data }) => {
|
|
4460
4459
|
const method = eventTextAttribute(data, "app.auth.method");
|
|
@@ -4463,14 +4462,14 @@ var AuditLogTable = ({
|
|
|
4463
4462
|
sortable: false,
|
|
4464
4463
|
valueGetter: ({ data }) => {
|
|
4465
4464
|
const method = eventTextAttribute(data, "app.auth.method");
|
|
4466
|
-
return method === null ?
|
|
4465
|
+
return method === null ? labels.methodUnknown : methods.get(method) ?? labels.methodUnknown;
|
|
4467
4466
|
}
|
|
4468
4467
|
}
|
|
4469
4468
|
];
|
|
4470
|
-
return /* @__PURE__ */
|
|
4471
|
-
"aria-label":
|
|
4469
|
+
return /* @__PURE__ */ jsx16("section", {
|
|
4470
|
+
"aria-label": labels.title,
|
|
4472
4471
|
className: "flex flex-col gap-4",
|
|
4473
|
-
children: /* @__PURE__ */
|
|
4472
|
+
children: /* @__PURE__ */ jsx16(DataTable, {
|
|
4474
4473
|
locale,
|
|
4475
4474
|
status,
|
|
4476
4475
|
state: tableState,
|