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