@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// ../../src/components/ui/data-table.tsx
|
|
2
2
|
import { useAtom, useAtomSet } from "@effect/atom-react";
|
|
3
3
|
import { BrowserKeyValueStore } from "@effect/platform-browser";
|
|
4
|
-
import { DateTime as DateTime2, Effect as Effect2, Option as Option2, Schema as Schema2, Stream } from "effect";
|
|
4
|
+
import { DateTime as DateTime2, Effect as Effect2, Formatter, Option as Option2, Schema as Schema2, Stream } from "effect";
|
|
5
5
|
import { Csv } from "effect/encoding";
|
|
6
6
|
import { AsyncResult, Atom } from "effect/reactivity";
|
|
7
7
|
import {
|
|
@@ -333,11 +333,12 @@ function Label({ className, ...props }) {
|
|
|
333
333
|
|
|
334
334
|
// ../../src/components/ui/separator.tsx
|
|
335
335
|
import { Separator as SeparatorPrimitive } from "@base-ui/react/separator";
|
|
336
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
336
337
|
|
|
337
338
|
// ../../src/components/ui/field.tsx
|
|
338
|
-
import { jsx as
|
|
339
|
+
import { jsx as jsx8, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
339
340
|
function FieldGroup({ className, ...props }) {
|
|
340
|
-
return /* @__PURE__ */
|
|
341
|
+
return /* @__PURE__ */ jsx8("div", {
|
|
341
342
|
"data-slot": "field-group",
|
|
342
343
|
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),
|
|
343
344
|
...props
|
|
@@ -360,7 +361,7 @@ function Field({
|
|
|
360
361
|
orientation = "vertical",
|
|
361
362
|
...props
|
|
362
363
|
}) {
|
|
363
|
-
return /* @__PURE__ */
|
|
364
|
+
return /* @__PURE__ */ jsx8("div", {
|
|
364
365
|
role: "group",
|
|
365
366
|
"data-slot": "field",
|
|
366
367
|
"data-orientation": orientation,
|
|
@@ -372,7 +373,7 @@ function FieldLabel({
|
|
|
372
373
|
className,
|
|
373
374
|
...props
|
|
374
375
|
}) {
|
|
375
|
-
return /* @__PURE__ */
|
|
376
|
+
return /* @__PURE__ */ jsx8(Label, {
|
|
376
377
|
"data-slot": "field-label",
|
|
377
378
|
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),
|
|
378
379
|
...props
|
|
@@ -382,18 +383,18 @@ function FieldLabel({
|
|
|
382
383
|
// ../../src/components/ui/select.tsx
|
|
383
384
|
import { Select as SelectPrimitive } from "@base-ui/react/select";
|
|
384
385
|
import { ChevronDownIcon, CheckIcon as CheckIcon3, ChevronUpIcon } from "lucide-react";
|
|
385
|
-
import { jsx as
|
|
386
|
+
import { jsx as jsx9, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
386
387
|
"use client";
|
|
387
388
|
var Select = SelectPrimitive.Root;
|
|
388
389
|
function SelectGroup({ className, ...props }) {
|
|
389
|
-
return /* @__PURE__ */
|
|
390
|
+
return /* @__PURE__ */ jsx9(SelectPrimitive.Group, {
|
|
390
391
|
"data-slot": "select-group",
|
|
391
392
|
className: cn("scroll-my-1 p-1", className),
|
|
392
393
|
...props
|
|
393
394
|
});
|
|
394
395
|
}
|
|
395
396
|
function SelectValue({ className, ...props }) {
|
|
396
|
-
return /* @__PURE__ */
|
|
397
|
+
return /* @__PURE__ */ jsx9(SelectPrimitive.Value, {
|
|
397
398
|
"data-slot": "select-value",
|
|
398
399
|
className: cn("flex flex-1 text-left", className),
|
|
399
400
|
...props
|
|
@@ -412,8 +413,8 @@ function SelectTrigger({
|
|
|
412
413
|
...props,
|
|
413
414
|
children: [
|
|
414
415
|
children,
|
|
415
|
-
/* @__PURE__ */
|
|
416
|
-
render: /* @__PURE__ */
|
|
416
|
+
/* @__PURE__ */ jsx9(SelectPrimitive.Icon, {
|
|
417
|
+
render: /* @__PURE__ */ jsx9(ChevronDownIcon, {
|
|
417
418
|
className: "text-muted-foreground pointer-events-none size-4"
|
|
418
419
|
})
|
|
419
420
|
})
|
|
@@ -430,8 +431,8 @@ function SelectContent({
|
|
|
430
431
|
alignItemWithTrigger = true,
|
|
431
432
|
...props
|
|
432
433
|
}) {
|
|
433
|
-
return /* @__PURE__ */
|
|
434
|
-
children: /* @__PURE__ */
|
|
434
|
+
return /* @__PURE__ */ jsx9(SelectPrimitive.Portal, {
|
|
435
|
+
children: /* @__PURE__ */ jsx9(SelectPrimitive.Positioner, {
|
|
435
436
|
side,
|
|
436
437
|
sideOffset,
|
|
437
438
|
align,
|
|
@@ -444,11 +445,11 @@ function SelectContent({
|
|
|
444
445
|
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),
|
|
445
446
|
...props,
|
|
446
447
|
children: [
|
|
447
|
-
/* @__PURE__ */
|
|
448
|
-
/* @__PURE__ */
|
|
448
|
+
/* @__PURE__ */ jsx9(SelectScrollUpButton, {}),
|
|
449
|
+
/* @__PURE__ */ jsx9(SelectPrimitive.List, {
|
|
449
450
|
children
|
|
450
451
|
}),
|
|
451
|
-
/* @__PURE__ */
|
|
452
|
+
/* @__PURE__ */ jsx9(SelectScrollDownButton, {})
|
|
452
453
|
]
|
|
453
454
|
})
|
|
454
455
|
})
|
|
@@ -464,15 +465,15 @@ function SelectItem({
|
|
|
464
465
|
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),
|
|
465
466
|
...props,
|
|
466
467
|
children: [
|
|
467
|
-
/* @__PURE__ */
|
|
468
|
+
/* @__PURE__ */ jsx9(SelectPrimitive.ItemText, {
|
|
468
469
|
className: "flex flex-1 shrink-0 gap-2 whitespace-nowrap",
|
|
469
470
|
children
|
|
470
471
|
}),
|
|
471
|
-
/* @__PURE__ */
|
|
472
|
-
render: /* @__PURE__ */
|
|
472
|
+
/* @__PURE__ */ jsx9(SelectPrimitive.ItemIndicator, {
|
|
473
|
+
render: /* @__PURE__ */ jsx9("span", {
|
|
473
474
|
className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center"
|
|
474
475
|
}),
|
|
475
|
-
children: /* @__PURE__ */
|
|
476
|
+
children: /* @__PURE__ */ jsx9(CheckIcon3, {
|
|
476
477
|
className: "pointer-events-none"
|
|
477
478
|
})
|
|
478
479
|
})
|
|
@@ -483,29 +484,29 @@ function SelectScrollUpButton({
|
|
|
483
484
|
className,
|
|
484
485
|
...props
|
|
485
486
|
}) {
|
|
486
|
-
return /* @__PURE__ */
|
|
487
|
+
return /* @__PURE__ */ jsx9(SelectPrimitive.ScrollUpArrow, {
|
|
487
488
|
"data-slot": "select-scroll-up-button",
|
|
488
489
|
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),
|
|
489
490
|
...props,
|
|
490
|
-
children: /* @__PURE__ */
|
|
491
|
+
children: /* @__PURE__ */ jsx9(ChevronUpIcon, {})
|
|
491
492
|
});
|
|
492
493
|
}
|
|
493
494
|
function SelectScrollDownButton({
|
|
494
495
|
className,
|
|
495
496
|
...props
|
|
496
497
|
}) {
|
|
497
|
-
return /* @__PURE__ */
|
|
498
|
+
return /* @__PURE__ */ jsx9(SelectPrimitive.ScrollDownArrow, {
|
|
498
499
|
"data-slot": "select-scroll-down-button",
|
|
499
500
|
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),
|
|
500
501
|
...props,
|
|
501
|
-
children: /* @__PURE__ */
|
|
502
|
+
children: /* @__PURE__ */ jsx9(ChevronDownIcon, {})
|
|
502
503
|
});
|
|
503
504
|
}
|
|
504
505
|
|
|
505
506
|
// ../../src/components/ui/loading.tsx
|
|
506
507
|
import { Loader2 } from "lucide-react";
|
|
507
508
|
import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider";
|
|
508
|
-
import { jsx as
|
|
509
|
+
import { jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
509
510
|
var labels = {
|
|
510
511
|
en: {
|
|
511
512
|
loading: "Loading..."
|
|
@@ -526,7 +527,7 @@ function Loading({
|
|
|
526
527
|
return /* @__PURE__ */ jsxs4("div", {
|
|
527
528
|
className: cn("text-muted-foreground flex items-center justify-center gap-2 text-sm", variant === "centered" && "min-h-[50svh] w-full", className),
|
|
528
529
|
children: [
|
|
529
|
-
/* @__PURE__ */
|
|
530
|
+
/* @__PURE__ */ jsx10(Loader2, {
|
|
530
531
|
className: "size-4 animate-spin"
|
|
531
532
|
}),
|
|
532
533
|
label ?? loadingLabel(locale, messages)
|
|
@@ -538,17 +539,17 @@ function Loading({
|
|
|
538
539
|
import { Menu as MenuPrimitive2 } from "@base-ui/react/menu";
|
|
539
540
|
import { Menubar as MenubarPrimitive } from "@base-ui/react/menubar";
|
|
540
541
|
import { CheckIcon as CheckIcon4 } from "lucide-react";
|
|
541
|
-
import { jsx as
|
|
542
|
+
import { jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
542
543
|
"use client";
|
|
543
544
|
function Menubar({ className, ...props }) {
|
|
544
|
-
return /* @__PURE__ */
|
|
545
|
+
return /* @__PURE__ */ jsx11(MenubarPrimitive, {
|
|
545
546
|
"data-slot": "menubar",
|
|
546
547
|
className: cn("flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs", className),
|
|
547
548
|
...props
|
|
548
549
|
});
|
|
549
550
|
}
|
|
550
551
|
function MenubarMenu({ ...props }) {
|
|
551
|
-
return /* @__PURE__ */
|
|
552
|
+
return /* @__PURE__ */ jsx11(DropdownMenu, {
|
|
552
553
|
"data-slot": "menubar-menu",
|
|
553
554
|
...props
|
|
554
555
|
});
|
|
@@ -556,7 +557,7 @@ function MenubarMenu({ ...props }) {
|
|
|
556
557
|
function MenubarGroup({
|
|
557
558
|
...props
|
|
558
559
|
}) {
|
|
559
|
-
return /* @__PURE__ */
|
|
560
|
+
return /* @__PURE__ */ jsx11(DropdownMenuGroup, {
|
|
560
561
|
"data-slot": "menubar-group",
|
|
561
562
|
...props
|
|
562
563
|
});
|
|
@@ -565,7 +566,7 @@ function MenubarTrigger({
|
|
|
565
566
|
className,
|
|
566
567
|
...props
|
|
567
568
|
}) {
|
|
568
|
-
return /* @__PURE__ */
|
|
569
|
+
return /* @__PURE__ */ jsx11(DropdownMenuTrigger, {
|
|
569
570
|
"data-slot": "menubar-trigger",
|
|
570
571
|
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),
|
|
571
572
|
...props
|
|
@@ -578,7 +579,7 @@ function MenubarContent({
|
|
|
578
579
|
sideOffset = 8,
|
|
579
580
|
...props
|
|
580
581
|
}) {
|
|
581
|
-
return /* @__PURE__ */
|
|
582
|
+
return /* @__PURE__ */ jsx11(DropdownMenuContent, {
|
|
582
583
|
"data-slot": "menubar-content",
|
|
583
584
|
align,
|
|
584
585
|
alignOffset,
|
|
@@ -593,7 +594,7 @@ function MenubarItem({
|
|
|
593
594
|
variant = "default",
|
|
594
595
|
...props
|
|
595
596
|
}) {
|
|
596
|
-
return /* @__PURE__ */
|
|
597
|
+
return /* @__PURE__ */ jsx11(DropdownMenuItem, {
|
|
597
598
|
"data-slot": "menubar-item",
|
|
598
599
|
"data-inset": inset,
|
|
599
600
|
"data-variant": variant,
|
|
@@ -615,10 +616,10 @@ function MenubarCheckboxItem({
|
|
|
615
616
|
checked,
|
|
616
617
|
...props,
|
|
617
618
|
children: [
|
|
618
|
-
/* @__PURE__ */
|
|
619
|
+
/* @__PURE__ */ jsx11("span", {
|
|
619
620
|
className: "pointer-events-none absolute left-2 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4",
|
|
620
|
-
children: /* @__PURE__ */
|
|
621
|
-
children: /* @__PURE__ */
|
|
621
|
+
children: /* @__PURE__ */ jsx11(MenuPrimitive2.CheckboxItemIndicator, {
|
|
622
|
+
children: /* @__PURE__ */ jsx11(CheckIcon4, {})
|
|
622
623
|
})
|
|
623
624
|
}),
|
|
624
625
|
children
|
|
@@ -628,7 +629,7 @@ function MenubarCheckboxItem({
|
|
|
628
629
|
function MenubarRadioGroup({
|
|
629
630
|
...props
|
|
630
631
|
}) {
|
|
631
|
-
return /* @__PURE__ */
|
|
632
|
+
return /* @__PURE__ */ jsx11(DropdownMenuRadioGroup, {
|
|
632
633
|
"data-slot": "menubar-radio-group",
|
|
633
634
|
...props
|
|
634
635
|
});
|
|
@@ -645,10 +646,10 @@ function MenubarRadioItem({
|
|
|
645
646
|
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),
|
|
646
647
|
...props,
|
|
647
648
|
children: [
|
|
648
|
-
/* @__PURE__ */
|
|
649
|
+
/* @__PURE__ */ jsx11("span", {
|
|
649
650
|
className: "pointer-events-none absolute left-2 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4",
|
|
650
|
-
children: /* @__PURE__ */
|
|
651
|
-
children: /* @__PURE__ */
|
|
651
|
+
children: /* @__PURE__ */ jsx11(MenuPrimitive2.RadioItemIndicator, {
|
|
652
|
+
children: /* @__PURE__ */ jsx11(CheckIcon4, {})
|
|
652
653
|
})
|
|
653
654
|
}),
|
|
654
655
|
children
|
|
@@ -660,7 +661,7 @@ function MenubarLabel({
|
|
|
660
661
|
inset,
|
|
661
662
|
...props
|
|
662
663
|
}) {
|
|
663
|
-
return /* @__PURE__ */
|
|
664
|
+
return /* @__PURE__ */ jsx11(DropdownMenuLabel, {
|
|
664
665
|
"data-slot": "menubar-label",
|
|
665
666
|
"data-inset": inset,
|
|
666
667
|
className: cn("px-2 py-1.5 text-sm font-medium data-inset:pl-8", className),
|
|
@@ -671,7 +672,7 @@ function MenubarSeparator({
|
|
|
671
672
|
className,
|
|
672
673
|
...props
|
|
673
674
|
}) {
|
|
674
|
-
return /* @__PURE__ */
|
|
675
|
+
return /* @__PURE__ */ jsx11(DropdownMenuSeparator, {
|
|
675
676
|
"data-slot": "menubar-separator",
|
|
676
677
|
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
677
678
|
...props
|
|
@@ -680,7 +681,7 @@ function MenubarSeparator({
|
|
|
680
681
|
function MenubarSub({
|
|
681
682
|
...props
|
|
682
683
|
}) {
|
|
683
|
-
return /* @__PURE__ */
|
|
684
|
+
return /* @__PURE__ */ jsx11(DropdownMenuSub, {
|
|
684
685
|
"data-slot": "menubar-sub",
|
|
685
686
|
...props
|
|
686
687
|
});
|
|
@@ -690,7 +691,7 @@ function MenubarSubTrigger({
|
|
|
690
691
|
inset,
|
|
691
692
|
...props
|
|
692
693
|
}) {
|
|
693
|
-
return /* @__PURE__ */
|
|
694
|
+
return /* @__PURE__ */ jsx11(DropdownMenuSubTrigger, {
|
|
694
695
|
"data-slot": "menubar-sub-trigger",
|
|
695
696
|
"data-inset": inset,
|
|
696
697
|
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),
|
|
@@ -701,7 +702,7 @@ function MenubarSubContent({
|
|
|
701
702
|
className,
|
|
702
703
|
...props
|
|
703
704
|
}) {
|
|
704
|
-
return /* @__PURE__ */
|
|
705
|
+
return /* @__PURE__ */ jsx11(DropdownMenuSubContent, {
|
|
705
706
|
"data-slot": "menubar-sub-content",
|
|
706
707
|
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),
|
|
707
708
|
...props
|
|
@@ -717,7 +718,7 @@ import {
|
|
|
717
718
|
} from "lucide-react";
|
|
718
719
|
import { useId } from "react";
|
|
719
720
|
import { useKrakstackLocale as useKrakstackLocale2 } from "@krak-stack/registry/krakstack-provider";
|
|
720
|
-
import { jsx as
|
|
721
|
+
import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
721
722
|
var messages = {
|
|
722
723
|
en: {
|
|
723
724
|
pageSize: "Page size",
|
|
@@ -760,7 +761,7 @@ function Pagination({
|
|
|
760
761
|
totalRows
|
|
761
762
|
}) {
|
|
762
763
|
const locale = useKrakstackLocale2(localeOverride);
|
|
763
|
-
const
|
|
764
|
+
const labels2 = paginationMessages(locale, messageOverrides);
|
|
764
765
|
const pageSizeId = useId();
|
|
765
766
|
const canGoBack = page > 0;
|
|
766
767
|
const canGoForward = page + 1 < pageCount;
|
|
@@ -770,11 +771,11 @@ function Pagination({
|
|
|
770
771
|
showResults ? /* @__PURE__ */ jsxs6("div", {
|
|
771
772
|
className: "text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1 text-sm",
|
|
772
773
|
children: [
|
|
773
|
-
/* @__PURE__ */
|
|
774
|
-
children:
|
|
774
|
+
/* @__PURE__ */ jsx12("span", {
|
|
775
|
+
children: labels2.results(totalRows)
|
|
775
776
|
}),
|
|
776
|
-
selectedRows > 0 ? /* @__PURE__ */
|
|
777
|
-
children:
|
|
777
|
+
selectedRows > 0 ? /* @__PURE__ */ jsx12("span", {
|
|
778
|
+
children: labels2.selectedOf(selectedRows, totalRows)
|
|
778
779
|
}) : null
|
|
779
780
|
]
|
|
780
781
|
}) : null,
|
|
@@ -784,10 +785,10 @@ function Pagination({
|
|
|
784
785
|
/* @__PURE__ */ jsxs6("div", {
|
|
785
786
|
className: "flex items-center gap-2",
|
|
786
787
|
children: [
|
|
787
|
-
/* @__PURE__ */
|
|
788
|
+
/* @__PURE__ */ jsx12(Label, {
|
|
788
789
|
htmlFor: pageSizeId,
|
|
789
790
|
className: cn("hidden text-sm sm:block", compact && "block"),
|
|
790
|
-
children:
|
|
791
|
+
children: labels2.pageSize
|
|
791
792
|
}),
|
|
792
793
|
/* @__PURE__ */ jsxs6(Select, {
|
|
793
794
|
items: pageSizes.map((size) => ({
|
|
@@ -797,16 +798,16 @@ function Pagination({
|
|
|
797
798
|
value: `${pageSize}`,
|
|
798
799
|
onValueChange: (value) => onPageSizeChange(Number(value)),
|
|
799
800
|
children: [
|
|
800
|
-
/* @__PURE__ */
|
|
801
|
+
/* @__PURE__ */ jsx12(SelectTrigger, {
|
|
801
802
|
className: "h-8 w-[70px]",
|
|
802
803
|
id: pageSizeId,
|
|
803
|
-
children: /* @__PURE__ */
|
|
804
|
+
children: /* @__PURE__ */ jsx12(SelectValue, {
|
|
804
805
|
placeholder: pageSize
|
|
805
806
|
})
|
|
806
807
|
}),
|
|
807
|
-
/* @__PURE__ */
|
|
808
|
+
/* @__PURE__ */ jsx12(SelectContent, {
|
|
808
809
|
side: "top",
|
|
809
|
-
children: pageSizes.map((size) => /* @__PURE__ */
|
|
810
|
+
children: pageSizes.map((size) => /* @__PURE__ */ jsx12(SelectItem, {
|
|
810
811
|
value: `${size}`,
|
|
811
812
|
children: size
|
|
812
813
|
}, size))
|
|
@@ -818,9 +819,9 @@ function Pagination({
|
|
|
818
819
|
/* @__PURE__ */ jsxs6("div", {
|
|
819
820
|
className: "flex items-center gap-2",
|
|
820
821
|
children: [
|
|
821
|
-
/* @__PURE__ */
|
|
822
|
+
/* @__PURE__ */ jsx12("div", {
|
|
822
823
|
className: "flex items-center justify-center text-sm font-medium sm:block",
|
|
823
|
-
children:
|
|
824
|
+
children: labels2.pageOf(page + 1, pageCount)
|
|
824
825
|
}),
|
|
825
826
|
/* @__PURE__ */ jsxs6("div", {
|
|
826
827
|
className: "flex items-center gap-1",
|
|
@@ -831,11 +832,11 @@ function Pagination({
|
|
|
831
832
|
onClick: () => onPageChange(0),
|
|
832
833
|
type: "button",
|
|
833
834
|
children: [
|
|
834
|
-
/* @__PURE__ */
|
|
835
|
+
/* @__PURE__ */ jsx12("span", {
|
|
835
836
|
className: "sr-only",
|
|
836
|
-
children:
|
|
837
|
+
children: labels2.goToFirstPage
|
|
837
838
|
}),
|
|
838
|
-
/* @__PURE__ */
|
|
839
|
+
/* @__PURE__ */ jsx12(ChevronsLeft, {})
|
|
839
840
|
]
|
|
840
841
|
}),
|
|
841
842
|
/* @__PURE__ */ jsxs6(Button, {
|
|
@@ -844,11 +845,11 @@ function Pagination({
|
|
|
844
845
|
onClick: () => onPageChange(page - 1),
|
|
845
846
|
type: "button",
|
|
846
847
|
children: [
|
|
847
|
-
/* @__PURE__ */
|
|
848
|
+
/* @__PURE__ */ jsx12("span", {
|
|
848
849
|
className: "sr-only",
|
|
849
|
-
children:
|
|
850
|
+
children: labels2.goToPreviousPage
|
|
850
851
|
}),
|
|
851
|
-
/* @__PURE__ */
|
|
852
|
+
/* @__PURE__ */ jsx12(ChevronLeft, {})
|
|
852
853
|
]
|
|
853
854
|
}),
|
|
854
855
|
/* @__PURE__ */ jsxs6(Button, {
|
|
@@ -857,11 +858,11 @@ function Pagination({
|
|
|
857
858
|
onClick: () => onPageChange(page + 1),
|
|
858
859
|
type: "button",
|
|
859
860
|
children: [
|
|
860
|
-
/* @__PURE__ */
|
|
861
|
+
/* @__PURE__ */ jsx12("span", {
|
|
861
862
|
className: "sr-only",
|
|
862
|
-
children:
|
|
863
|
+
children: labels2.goToNextPage
|
|
863
864
|
}),
|
|
864
|
-
/* @__PURE__ */
|
|
865
|
+
/* @__PURE__ */ jsx12(ChevronRight, {})
|
|
865
866
|
]
|
|
866
867
|
}),
|
|
867
868
|
/* @__PURE__ */ jsxs6(Button, {
|
|
@@ -870,11 +871,11 @@ function Pagination({
|
|
|
870
871
|
onClick: () => onPageChange(pageCount - 1),
|
|
871
872
|
type: "button",
|
|
872
873
|
children: [
|
|
873
|
-
/* @__PURE__ */
|
|
874
|
+
/* @__PURE__ */ jsx12("span", {
|
|
874
875
|
className: "sr-only",
|
|
875
|
-
children:
|
|
876
|
+
children: labels2.goToLastPage
|
|
876
877
|
}),
|
|
877
|
-
/* @__PURE__ */
|
|
878
|
+
/* @__PURE__ */ jsx12(ChevronsRight, {})
|
|
878
879
|
]
|
|
879
880
|
})
|
|
880
881
|
]
|
|
@@ -889,7 +890,7 @@ function Pagination({
|
|
|
889
890
|
|
|
890
891
|
// ../../src/components/ui/scroll-area.tsx
|
|
891
892
|
import { ScrollArea as ScrollAreaPrimitive } from "@base-ui/react/scroll-area";
|
|
892
|
-
import { jsx as
|
|
893
|
+
import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
893
894
|
function ScrollArea({
|
|
894
895
|
className,
|
|
895
896
|
children,
|
|
@@ -900,13 +901,13 @@ function ScrollArea({
|
|
|
900
901
|
className: cn("relative", className),
|
|
901
902
|
...props,
|
|
902
903
|
children: [
|
|
903
|
-
/* @__PURE__ */
|
|
904
|
+
/* @__PURE__ */ jsx13(ScrollAreaPrimitive.Viewport, {
|
|
904
905
|
"data-slot": "scroll-area-viewport",
|
|
905
906
|
className: "focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",
|
|
906
907
|
children
|
|
907
908
|
}),
|
|
908
|
-
/* @__PURE__ */
|
|
909
|
-
/* @__PURE__ */
|
|
909
|
+
/* @__PURE__ */ jsx13(ScrollBar, {}),
|
|
910
|
+
/* @__PURE__ */ jsx13(ScrollAreaPrimitive.Corner, {})
|
|
910
911
|
]
|
|
911
912
|
});
|
|
912
913
|
}
|
|
@@ -915,13 +916,13 @@ function ScrollBar({
|
|
|
915
916
|
orientation = "vertical",
|
|
916
917
|
...props
|
|
917
918
|
}) {
|
|
918
|
-
return /* @__PURE__ */
|
|
919
|
+
return /* @__PURE__ */ jsx13(ScrollAreaPrimitive.Scrollbar, {
|
|
919
920
|
"data-slot": "scroll-area-scrollbar",
|
|
920
921
|
"data-orientation": orientation,
|
|
921
922
|
orientation,
|
|
922
923
|
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),
|
|
923
924
|
...props,
|
|
924
|
-
children: /* @__PURE__ */
|
|
925
|
+
children: /* @__PURE__ */ jsx13(ScrollAreaPrimitive.Thumb, {
|
|
925
926
|
"data-slot": "scroll-area-thumb",
|
|
926
927
|
className: "bg-border relative flex-1 rounded-full"
|
|
927
928
|
})
|
|
@@ -929,12 +930,12 @@ function ScrollBar({
|
|
|
929
930
|
}
|
|
930
931
|
|
|
931
932
|
// ../../src/components/ui/table.tsx
|
|
932
|
-
import { jsx as
|
|
933
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
933
934
|
function Table({ className, ...props }) {
|
|
934
|
-
return /* @__PURE__ */
|
|
935
|
+
return /* @__PURE__ */ jsx14("div", {
|
|
935
936
|
"data-slot": "table-container",
|
|
936
937
|
className: "relative w-full overflow-x-auto",
|
|
937
|
-
children: /* @__PURE__ */
|
|
938
|
+
children: /* @__PURE__ */ jsx14("table", {
|
|
938
939
|
"data-slot": "table",
|
|
939
940
|
className: cn("w-full caption-bottom text-sm", className),
|
|
940
941
|
...props
|
|
@@ -942,35 +943,35 @@ function Table({ className, ...props }) {
|
|
|
942
943
|
});
|
|
943
944
|
}
|
|
944
945
|
function TableHeader({ className, ...props }) {
|
|
945
|
-
return /* @__PURE__ */
|
|
946
|
+
return /* @__PURE__ */ jsx14("thead", {
|
|
946
947
|
"data-slot": "table-header",
|
|
947
948
|
className: cn("[&_tr]:border-b", className),
|
|
948
949
|
...props
|
|
949
950
|
});
|
|
950
951
|
}
|
|
951
952
|
function TableBody({ className, ...props }) {
|
|
952
|
-
return /* @__PURE__ */
|
|
953
|
+
return /* @__PURE__ */ jsx14("tbody", {
|
|
953
954
|
"data-slot": "table-body",
|
|
954
955
|
className: cn("[&_tr:last-child]:border-0", className),
|
|
955
956
|
...props
|
|
956
957
|
});
|
|
957
958
|
}
|
|
958
959
|
function TableRow({ className, ...props }) {
|
|
959
|
-
return /* @__PURE__ */
|
|
960
|
+
return /* @__PURE__ */ jsx14("tr", {
|
|
960
961
|
"data-slot": "table-row",
|
|
961
962
|
className: cn("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted", className),
|
|
962
963
|
...props
|
|
963
964
|
});
|
|
964
965
|
}
|
|
965
966
|
function TableHead({ className, ...props }) {
|
|
966
|
-
return /* @__PURE__ */
|
|
967
|
+
return /* @__PURE__ */ jsx14("th", {
|
|
967
968
|
"data-slot": "table-head",
|
|
968
969
|
className: cn("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0", className),
|
|
969
970
|
...props
|
|
970
971
|
});
|
|
971
972
|
}
|
|
972
973
|
function TableCell({ className, ...props }) {
|
|
973
|
-
return /* @__PURE__ */
|
|
974
|
+
return /* @__PURE__ */ jsx14("td", {
|
|
974
975
|
"data-slot": "table-cell",
|
|
975
976
|
className: cn("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0", className),
|
|
976
977
|
...props
|
|
@@ -979,26 +980,26 @@ function TableCell({ className, ...props }) {
|
|
|
979
980
|
|
|
980
981
|
// ../../src/components/ui/tooltip.tsx
|
|
981
982
|
import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip";
|
|
982
|
-
import { jsx as
|
|
983
|
+
import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
983
984
|
"use client";
|
|
984
985
|
function TooltipProvider({
|
|
985
986
|
delay = 0,
|
|
986
987
|
...props
|
|
987
988
|
}) {
|
|
988
|
-
return /* @__PURE__ */
|
|
989
|
+
return /* @__PURE__ */ jsx15(TooltipPrimitive.Provider, {
|
|
989
990
|
"data-slot": "tooltip-provider",
|
|
990
991
|
delay,
|
|
991
992
|
...props
|
|
992
993
|
});
|
|
993
994
|
}
|
|
994
995
|
function Tooltip({ ...props }) {
|
|
995
|
-
return /* @__PURE__ */
|
|
996
|
+
return /* @__PURE__ */ jsx15(TooltipPrimitive.Root, {
|
|
996
997
|
"data-slot": "tooltip",
|
|
997
998
|
...props
|
|
998
999
|
});
|
|
999
1000
|
}
|
|
1000
1001
|
function TooltipTrigger({ ...props }) {
|
|
1001
|
-
return /* @__PURE__ */
|
|
1002
|
+
return /* @__PURE__ */ jsx15(TooltipPrimitive.Trigger, {
|
|
1002
1003
|
"data-slot": "tooltip-trigger",
|
|
1003
1004
|
...props
|
|
1004
1005
|
});
|
|
@@ -1012,8 +1013,8 @@ function TooltipContent({
|
|
|
1012
1013
|
children,
|
|
1013
1014
|
...props
|
|
1014
1015
|
}) {
|
|
1015
|
-
return /* @__PURE__ */
|
|
1016
|
-
children: /* @__PURE__ */
|
|
1016
|
+
return /* @__PURE__ */ jsx15(TooltipPrimitive.Portal, {
|
|
1017
|
+
children: /* @__PURE__ */ jsx15(TooltipPrimitive.Positioner, {
|
|
1017
1018
|
align,
|
|
1018
1019
|
alignOffset,
|
|
1019
1020
|
side,
|
|
@@ -1025,7 +1026,7 @@ function TooltipContent({
|
|
|
1025
1026
|
...props,
|
|
1026
1027
|
children: [
|
|
1027
1028
|
children,
|
|
1028
|
-
/* @__PURE__ */
|
|
1029
|
+
/* @__PURE__ */ jsx15(TooltipPrimitive.Arrow, {
|
|
1029
1030
|
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"
|
|
1030
1031
|
})
|
|
1031
1032
|
]
|
|
@@ -1161,11 +1162,11 @@ var ColumnFilters = Schema.declare(Schema.is(ColumnFiltersArray), {
|
|
|
1161
1162
|
toCodecStringTree: () => Schema.link()(Schema.fromJsonString(ColumnFiltersArray), SchemaTransformation.passthrough())
|
|
1162
1163
|
});
|
|
1163
1164
|
var Query = Schema.Struct({
|
|
1164
|
-
page: Schema.optional(Schema.Union([Schema.
|
|
1165
|
+
page: Schema.optional(Schema.Union([Schema.Finite, Schema.FiniteFromString]).check(Schema.isInt(), Schema.isGreaterThanOrEqualTo(0))).pipe(Schema.decodeTo(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), {
|
|
1165
1166
|
decode: SchemaGetter.withDefault(Effect.succeed(0)),
|
|
1166
1167
|
encode: SchemaGetter.transformOptional(Option.filter((page) => page !== 0))
|
|
1167
1168
|
})),
|
|
1168
|
-
pageSize: Schema.optional(Schema.Union([Schema.
|
|
1169
|
+
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 })), {
|
|
1169
1170
|
decode: SchemaGetter.withDefault(Effect.succeed(20)),
|
|
1170
1171
|
encode: SchemaGetter.transformOptional(Option.filter((pageSize) => pageSize !== 20))
|
|
1171
1172
|
})),
|
|
@@ -1203,10 +1204,10 @@ var PaginationMeta = Schema.Struct({
|
|
|
1203
1204
|
|
|
1204
1205
|
// ../../src/components/ui/data-table.tsx
|
|
1205
1206
|
import { useKrakstackLocale as useKrakstackLocale3 } from "@krak-stack/registry/krakstack-provider";
|
|
1206
|
-
import { jsx as
|
|
1207
|
+
import { jsx as jsx16, jsxs as jsxs9, Fragment } from "react/jsx-runtime";
|
|
1207
1208
|
var DataTablePersistedUiStateSchema = Schema2.Struct({
|
|
1208
1209
|
columnVisibility: Schema2.Record(Schema2.String, Schema2.Boolean),
|
|
1209
|
-
columnSizing: Schema2.Record(Schema2.String, Schema2.
|
|
1210
|
+
columnSizing: Schema2.Record(Schema2.String, Schema2.Finite),
|
|
1210
1211
|
grouping: Schema2.optionalKey(Schema2.Array(Schema2.String)),
|
|
1211
1212
|
view: Schema2.Literals(["table", "gallery"])
|
|
1212
1213
|
}).annotate({ identifier: "DataTablePersistedUiState" });
|
|
@@ -1223,18 +1224,18 @@ var DataTableReferenceCell = ({
|
|
|
1223
1224
|
return /* @__PURE__ */ jsxs9("div", {
|
|
1224
1225
|
className: "flex min-w-0 items-center gap-2",
|
|
1225
1226
|
children: [
|
|
1226
|
-
/* @__PURE__ */
|
|
1227
|
+
/* @__PURE__ */ jsx16("div", {
|
|
1227
1228
|
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),
|
|
1228
|
-
children: item.icon ? /* @__PURE__ */
|
|
1229
|
+
children: item.icon ? /* @__PURE__ */ jsx16("span", {
|
|
1229
1230
|
"aria-hidden": "true",
|
|
1230
1231
|
className: "[&_svg]:size-4",
|
|
1231
1232
|
children: item.icon
|
|
1232
|
-
}) : item.imageSrc && item.imageSrc !== failedImage ? /* @__PURE__ */
|
|
1233
|
+
}) : item.imageSrc && item.imageSrc !== failedImage ? /* @__PURE__ */ jsx16("img", {
|
|
1233
1234
|
src: item.imageSrc,
|
|
1234
1235
|
alt: item.label,
|
|
1235
1236
|
className: "size-full object-cover",
|
|
1236
1237
|
onError: () => setFailedImage(item.imageSrc ?? undefined)
|
|
1237
|
-
}) : /* @__PURE__ */
|
|
1238
|
+
}) : /* @__PURE__ */ jsx16("span", {
|
|
1238
1239
|
"aria-hidden": "true",
|
|
1239
1240
|
children: initials
|
|
1240
1241
|
})
|
|
@@ -1242,11 +1243,11 @@ var DataTableReferenceCell = ({
|
|
|
1242
1243
|
/* @__PURE__ */ jsxs9("div", {
|
|
1243
1244
|
className: "flex min-w-0 flex-col leading-tight",
|
|
1244
1245
|
children: [
|
|
1245
|
-
/* @__PURE__ */
|
|
1246
|
+
/* @__PURE__ */ jsx16("span", {
|
|
1246
1247
|
className: "truncate font-medium",
|
|
1247
1248
|
children: item.label
|
|
1248
1249
|
}),
|
|
1249
|
-
item.description ? /* @__PURE__ */
|
|
1250
|
+
item.description ? /* @__PURE__ */ jsx16("span", {
|
|
1250
1251
|
className: "text-muted-foreground truncate text-xs",
|
|
1251
1252
|
children: item.description
|
|
1252
1253
|
}) : null
|
|
@@ -1486,6 +1487,14 @@ var formatNumberValue = (value, options = {}, defaultLocale = "en") => {
|
|
|
1486
1487
|
} = options;
|
|
1487
1488
|
return new Intl.NumberFormat(locale ?? defaultLocale, format).format(value);
|
|
1488
1489
|
};
|
|
1490
|
+
var scalarText = Schema2.is(Schema2.Union([
|
|
1491
|
+
Schema2.String,
|
|
1492
|
+
Schema2.Finite,
|
|
1493
|
+
Schema2.Boolean,
|
|
1494
|
+
Schema2.BigInt,
|
|
1495
|
+
Schema2.Symbol
|
|
1496
|
+
]));
|
|
1497
|
+
var dataTableValueText = (value) => value == null ? "" : scalarText(value) ? String(value) : Formatter.format(value);
|
|
1489
1498
|
var booleanLabel = (value, options) => value ? options?.trueLabel : options?.falseLabel;
|
|
1490
1499
|
var getDataTableExportValue = (row, column, locale = "en") => {
|
|
1491
1500
|
const value = row.values.get(column.id);
|
|
@@ -1517,7 +1526,7 @@ var filterDataTableRows = (rows, columns, globalFilter, locale = "en") => {
|
|
|
1517
1526
|
return rows.filter((row) => searchable.some((column) => {
|
|
1518
1527
|
const value = row.values.get(column.id);
|
|
1519
1528
|
const colDef = column.colDef;
|
|
1520
|
-
let text =
|
|
1529
|
+
let text = dataTableValueText(value);
|
|
1521
1530
|
if (colDef.type === "date" || colDef.type === "dateTime") {
|
|
1522
1531
|
const date = resolveDate(value, colDef.type);
|
|
1523
1532
|
text = date ? `${formatDateValue(date, colDef, locale)} ${dateIsoValue(date)}` : "";
|
|
@@ -1564,7 +1573,7 @@ var filterDataTableColumnRows = (rows, columns, filters) => {
|
|
|
1564
1573
|
}) : row.values.get(column.id);
|
|
1565
1574
|
switch (filter.kind) {
|
|
1566
1575
|
case "text": {
|
|
1567
|
-
const text =
|
|
1576
|
+
const text = dataTableValueText(value).toLocaleLowerCase();
|
|
1568
1577
|
const query = filter.value.toLocaleLowerCase();
|
|
1569
1578
|
switch (filter.operator) {
|
|
1570
1579
|
case "contains":
|
|
@@ -1591,7 +1600,7 @@ var filterDataTableColumnRows = (rows, columns, filters) => {
|
|
|
1591
1600
|
case "boolean":
|
|
1592
1601
|
return Option2.getOrUndefined(decodeBooleanValue(value)) === filter.value;
|
|
1593
1602
|
case "values": {
|
|
1594
|
-
const values = column.colDef.type === "list" ? column.colDef.typeOptions.getItems(row.data).map((item) => item.value ?? item.label) : [
|
|
1603
|
+
const values = column.colDef.type === "list" ? column.colDef.typeOptions.getItems(row.data).map((item) => item.value ?? item.label) : [dataTableValueText(value)];
|
|
1595
1604
|
return filter.values.some((selected) => values.includes(selected));
|
|
1596
1605
|
}
|
|
1597
1606
|
}
|
|
@@ -1619,9 +1628,9 @@ var sortDataTableRows = (rows, columns, sorting) => {
|
|
|
1619
1628
|
const nullOrder = colDef.typeOptions?.nulls === "first" ? -1 : 1;
|
|
1620
1629
|
return leftScalar === undefined ? nullOrder : -nullOrder;
|
|
1621
1630
|
}
|
|
1622
|
-
const
|
|
1623
|
-
if (
|
|
1624
|
-
return sort.direction === "desc" ? -
|
|
1631
|
+
const comparison2 = leftScalar - rightScalar;
|
|
1632
|
+
if (comparison2 !== 0)
|
|
1633
|
+
return sort.direction === "desc" ? -comparison2 : comparison2;
|
|
1625
1634
|
continue;
|
|
1626
1635
|
}
|
|
1627
1636
|
if (!colDef.comparator && (colDef.type === "date" || colDef.type === "dateTime")) {
|
|
@@ -1633,12 +1642,12 @@ var sortDataTableRows = (rows, columns, sorting) => {
|
|
|
1633
1642
|
const nullOrder = colDef.typeOptions?.nulls === "first" ? -1 : 1;
|
|
1634
1643
|
return !leftDate ? nullOrder : -nullOrder;
|
|
1635
1644
|
}
|
|
1636
|
-
const
|
|
1637
|
-
if (
|
|
1638
|
-
return sort.direction === "desc" ? -
|
|
1645
|
+
const comparison2 = DateTime2.toEpochMillis(leftDate.instant) - DateTime2.toEpochMillis(rightDate.instant);
|
|
1646
|
+
if (comparison2 !== 0)
|
|
1647
|
+
return sort.direction === "desc" ? -comparison2 : comparison2;
|
|
1639
1648
|
continue;
|
|
1640
1649
|
}
|
|
1641
|
-
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.
|
|
1650
|
+
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" });
|
|
1642
1651
|
if (comparison !== 0)
|
|
1643
1652
|
return sort.direction === "desc" ? -comparison : comparison;
|
|
1644
1653
|
}
|
|
@@ -1822,7 +1831,7 @@ var canMoveRowsToGroups = (store) => getActiveGrouping(store).some((field) => !!
|
|
|
1822
1831
|
var canDragRows = (store) => getActiveGrouping(store).length ? canMoveRowsToGroups(store) : canReorderRows(store);
|
|
1823
1832
|
var hasRowActionMenu = (store) => !!store.config.features.rowActions || canReorderRows(store);
|
|
1824
1833
|
var getSelectedRows = (store, model) => model.rows.filter((row) => store.state.rowSelection[row.id]).map((row) => row.data);
|
|
1825
|
-
var renderCell = (row, column, locale = "en",
|
|
1834
|
+
var renderCell = (row, column, locale = "en", labels2 = dataTableMessages(locale)) => {
|
|
1826
1835
|
const value = row.values.get(column.id);
|
|
1827
1836
|
const params = {
|
|
1828
1837
|
data: row.data,
|
|
@@ -1833,14 +1842,14 @@ var renderCell = (row, column, locale = "en", labels = dataTableMessages(locale)
|
|
|
1833
1842
|
};
|
|
1834
1843
|
const CellRenderer = column.colDef.cellRenderer;
|
|
1835
1844
|
if (CellRenderer)
|
|
1836
|
-
return /* @__PURE__ */
|
|
1845
|
+
return /* @__PURE__ */ jsx16(CellRenderer, {
|
|
1837
1846
|
...params
|
|
1838
1847
|
});
|
|
1839
1848
|
const colDef = column.colDef;
|
|
1840
1849
|
if (colDef.type === "reference") {
|
|
1841
1850
|
if (colDef.valueFormatter)
|
|
1842
1851
|
return colDef.valueFormatter(params);
|
|
1843
|
-
return /* @__PURE__ */
|
|
1852
|
+
return /* @__PURE__ */ jsx16(DataTableReferenceCell, {
|
|
1844
1853
|
item: colDef.typeOptions.getItem(row.data),
|
|
1845
1854
|
emptyLabel: colDef.typeOptions.emptyLabel,
|
|
1846
1855
|
imageVariant: colDef.typeOptions.imageVariant
|
|
@@ -1850,7 +1859,7 @@ var renderCell = (row, column, locale = "en", labels = dataTableMessages(locale)
|
|
|
1850
1859
|
if (colDef.valueFormatter)
|
|
1851
1860
|
return colDef.valueFormatter(params);
|
|
1852
1861
|
const number = Option2.getOrUndefined(decodeNumberValue(value));
|
|
1853
|
-
return /* @__PURE__ */
|
|
1862
|
+
return /* @__PURE__ */ jsx16("span", {
|
|
1854
1863
|
className: "block text-left tabular-nums",
|
|
1855
1864
|
children: number === undefined ? colDef.typeOptions?.emptyLabel ?? "—" : formatNumberValue(number, colDef.typeOptions, locale)
|
|
1856
1865
|
});
|
|
@@ -1862,12 +1871,12 @@ var renderCell = (row, column, locale = "en", labels = dataTableMessages(locale)
|
|
|
1862
1871
|
if (boolean === undefined)
|
|
1863
1872
|
return colDef.typeOptions?.emptyLabel ?? "—";
|
|
1864
1873
|
const options = colDef.typeOptions;
|
|
1865
|
-
return /* @__PURE__ */
|
|
1874
|
+
return /* @__PURE__ */ jsx16("label", {
|
|
1866
1875
|
"data-slot": "data-table-boolean-cell",
|
|
1867
1876
|
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"),
|
|
1868
1877
|
onClick: (event) => event.stopPropagation(),
|
|
1869
1878
|
onPointerDown: (event) => event.stopPropagation(),
|
|
1870
|
-
children: /* @__PURE__ */
|
|
1879
|
+
children: /* @__PURE__ */ jsx16(Checkbox, {
|
|
1871
1880
|
"aria-label": options?.getAriaLabel?.(row.data) ?? columnLabel(column),
|
|
1872
1881
|
className: "focus-visible:ring-0 focus-visible:outline-none",
|
|
1873
1882
|
checked: boolean,
|
|
@@ -1881,7 +1890,7 @@ var renderCell = (row, column, locale = "en", labels = dataTableMessages(locale)
|
|
|
1881
1890
|
if (colDef.valueFormatter)
|
|
1882
1891
|
return colDef.valueFormatter(params);
|
|
1883
1892
|
const date = resolveDate(value, colDef.type);
|
|
1884
|
-
return date ? /* @__PURE__ */
|
|
1893
|
+
return date ? /* @__PURE__ */ jsx16("time", {
|
|
1885
1894
|
dateTime: dateIsoValue(date),
|
|
1886
1895
|
children: formatDateValue(date, colDef, locale)
|
|
1887
1896
|
}) : colDef.typeOptions?.emptyLabel ?? "—";
|
|
@@ -1895,33 +1904,33 @@ var renderCell = (row, column, locale = "en", labels = dataTableMessages(locale)
|
|
|
1895
1904
|
disabled: (item) => action.disabled?.({ item, row: row.data }) ?? false
|
|
1896
1905
|
}));
|
|
1897
1906
|
if (config.getOptions) {
|
|
1898
|
-
return /* @__PURE__ */
|
|
1907
|
+
return /* @__PURE__ */ jsx16(DataTableListCell, {
|
|
1899
1908
|
...config,
|
|
1900
1909
|
itemActions,
|
|
1901
1910
|
onItemClick: config.onItemClick ? (item) => config.onItemClick?.({ item, row: row.data }) : undefined,
|
|
1902
1911
|
items: config.getItems(row.data),
|
|
1903
1912
|
locale,
|
|
1904
|
-
messages: { [locale]:
|
|
1913
|
+
messages: { [locale]: labels2 },
|
|
1905
1914
|
options: config.getOptions(row.data),
|
|
1906
1915
|
totalCount: config.getTotalCount?.(row.data),
|
|
1907
|
-
onAdd: config.onAdd ? (
|
|
1908
|
-
onRemove: config.onRemove ? (
|
|
1916
|
+
onAdd: config.onAdd ? (value2) => config.onAdd?.({ value: value2, row: row.data }) : undefined,
|
|
1917
|
+
onRemove: config.onRemove ? (value2) => config.onRemove?.({ value: value2, row: row.data }) : undefined
|
|
1909
1918
|
});
|
|
1910
1919
|
}
|
|
1911
|
-
return /* @__PURE__ */
|
|
1920
|
+
return /* @__PURE__ */ jsx16(DataTableListCell, {
|
|
1912
1921
|
...config,
|
|
1913
1922
|
itemActions,
|
|
1914
1923
|
onItemClick: config.onItemClick ? (item) => config.onItemClick?.({ item, row: row.data }) : undefined,
|
|
1915
1924
|
items: config.getItems(row.data),
|
|
1916
1925
|
locale,
|
|
1917
|
-
messages: { [locale]:
|
|
1926
|
+
messages: { [locale]: labels2 },
|
|
1918
1927
|
totalCount: config.getTotalCount?.(row.data)
|
|
1919
1928
|
});
|
|
1920
1929
|
}
|
|
1921
|
-
return column.colDef.valueFormatter?.(params) ?? (value === null || value === undefined ? null :
|
|
1930
|
+
return column.colDef.valueFormatter?.(params) ?? (value === null || value === undefined ? null : dataTableValueText(value));
|
|
1922
1931
|
};
|
|
1923
1932
|
var nodeText = (node) => {
|
|
1924
|
-
if (Schema2.is(Schema2.String)(node) || Schema2.is(Schema2.
|
|
1933
|
+
if (Schema2.is(Schema2.String)(node) || Schema2.is(Schema2.Finite)(node))
|
|
1925
1934
|
return String(node);
|
|
1926
1935
|
if (!isValidElement(node))
|
|
1927
1936
|
return "";
|
|
@@ -1957,30 +1966,30 @@ var DataTableRowActions = ({
|
|
|
1957
1966
|
return null;
|
|
1958
1967
|
return /* @__PURE__ */ jsxs9(DropdownMenu, {
|
|
1959
1968
|
children: [
|
|
1960
|
-
/* @__PURE__ */
|
|
1969
|
+
/* @__PURE__ */ jsx16(DropdownMenuTrigger, {
|
|
1961
1970
|
onClick: (event) => event.stopPropagation(),
|
|
1962
1971
|
render: /* @__PURE__ */ jsxs9(Button, {
|
|
1963
1972
|
className: "size-8 focus-visible:ring-inset [&_svg:not([class*='size-'])]:size-4",
|
|
1964
1973
|
size: "icon",
|
|
1965
1974
|
variant: "ghost",
|
|
1966
1975
|
children: [
|
|
1967
|
-
/* @__PURE__ */
|
|
1976
|
+
/* @__PURE__ */ jsx16("span", {
|
|
1968
1977
|
className: "sr-only",
|
|
1969
1978
|
children: title
|
|
1970
1979
|
}),
|
|
1971
|
-
/* @__PURE__ */
|
|
1980
|
+
/* @__PURE__ */ jsx16(MoreHorizontal, {})
|
|
1972
1981
|
]
|
|
1973
1982
|
})
|
|
1974
1983
|
}),
|
|
1975
|
-
/* @__PURE__ */
|
|
1984
|
+
/* @__PURE__ */ jsx16(DropdownMenuContent, {
|
|
1976
1985
|
align: "end",
|
|
1977
1986
|
className: "w-max",
|
|
1978
1987
|
children: /* @__PURE__ */ jsxs9(DropdownMenuGroup, {
|
|
1979
1988
|
children: [
|
|
1980
|
-
/* @__PURE__ */
|
|
1989
|
+
/* @__PURE__ */ jsx16(DropdownMenuLabel, {
|
|
1981
1990
|
children: title
|
|
1982
1991
|
}),
|
|
1983
|
-
/* @__PURE__ */
|
|
1992
|
+
/* @__PURE__ */ jsx16(DropdownMenuSeparator, {}),
|
|
1984
1993
|
visible.map((action) => /* @__PURE__ */ jsxs9(DropdownMenuItem, {
|
|
1985
1994
|
onClick: (event) => {
|
|
1986
1995
|
event.stopPropagation();
|
|
@@ -2018,7 +2027,7 @@ var DataTableRowActionMenu = ({
|
|
|
2018
2027
|
reorderActions.push({
|
|
2019
2028
|
id: "data-table-move-up",
|
|
2020
2029
|
name: store.config.labels.moveUp,
|
|
2021
|
-
icon: /* @__PURE__ */
|
|
2030
|
+
icon: /* @__PURE__ */ jsx16(ArrowUp, {}),
|
|
2022
2031
|
onClick: () => move(rowIndex - 1)
|
|
2023
2032
|
});
|
|
2024
2033
|
}
|
|
@@ -2026,12 +2035,12 @@ var DataTableRowActionMenu = ({
|
|
|
2026
2035
|
reorderActions.push({
|
|
2027
2036
|
id: "data-table-move-down",
|
|
2028
2037
|
name: store.config.labels.moveDown,
|
|
2029
|
-
icon: /* @__PURE__ */
|
|
2038
|
+
icon: /* @__PURE__ */ jsx16(ArrowDown, {}),
|
|
2030
2039
|
onClick: () => move(rowIndex + 1)
|
|
2031
2040
|
});
|
|
2032
2041
|
}
|
|
2033
2042
|
}
|
|
2034
|
-
return /* @__PURE__ */
|
|
2043
|
+
return /* @__PURE__ */ jsx16(DataTableRowActions, {
|
|
2035
2044
|
actions: [...reorderActions, ...rowActions ? rowActions.items : []],
|
|
2036
2045
|
row: row.data,
|
|
2037
2046
|
title: rowActions?.label ?? store.config.labels.actions
|
|
@@ -2044,7 +2053,7 @@ var DataTableToolbar = ({
|
|
|
2044
2053
|
const exportPending = useRef(false);
|
|
2045
2054
|
const [exporting, setExporting] = useState(false);
|
|
2046
2055
|
const [exportFailed, setExportFailed] = useState(false);
|
|
2047
|
-
const { features, labels } = store.config;
|
|
2056
|
+
const { features, labels: labels2 } = store.config;
|
|
2048
2057
|
const model = deriveModel(store);
|
|
2049
2058
|
const selectedRows = getSelectedRows(store, model);
|
|
2050
2059
|
const grouping = features.grouping;
|
|
@@ -2084,21 +2093,21 @@ var DataTableToolbar = ({
|
|
|
2084
2093
|
features.search !== false ? /* @__PURE__ */ jsxs9("div", {
|
|
2085
2094
|
className: "relative min-w-0",
|
|
2086
2095
|
children: [
|
|
2087
|
-
/* @__PURE__ */
|
|
2096
|
+
/* @__PURE__ */ jsx16(Search, {
|
|
2088
2097
|
className: "text-muted-foreground pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2"
|
|
2089
2098
|
}),
|
|
2090
|
-
/* @__PURE__ */
|
|
2099
|
+
/* @__PURE__ */ jsx16(Input, {
|
|
2091
2100
|
className: "px-9",
|
|
2092
2101
|
onChange: (event) => update((state) => ({
|
|
2093
2102
|
...state,
|
|
2094
2103
|
globalFilter: event.target.value,
|
|
2095
2104
|
page: 0
|
|
2096
2105
|
})),
|
|
2097
|
-
placeholder:
|
|
2106
|
+
placeholder: labels2.filter,
|
|
2098
2107
|
value: store.state.globalFilter ?? ""
|
|
2099
2108
|
}),
|
|
2100
|
-
store.state.globalFilter ? /* @__PURE__ */
|
|
2101
|
-
"aria-label":
|
|
2109
|
+
store.state.globalFilter ? /* @__PURE__ */ jsx16(Button, {
|
|
2110
|
+
"aria-label": labels2.filter,
|
|
2102
2111
|
className: "absolute top-1/2 right-1 size-7 -translate-y-1/2 active:not-aria-[haspopup]:-translate-y-1/2",
|
|
2103
2112
|
onClick: () => update((state) => ({
|
|
2104
2113
|
...state,
|
|
@@ -2107,11 +2116,11 @@ var DataTableToolbar = ({
|
|
|
2107
2116
|
})),
|
|
2108
2117
|
size: "icon",
|
|
2109
2118
|
variant: "ghost",
|
|
2110
|
-
children: /* @__PURE__ */
|
|
2119
|
+
children: /* @__PURE__ */ jsx16(X, {})
|
|
2111
2120
|
}) : null
|
|
2112
2121
|
]
|
|
2113
2122
|
}) : null,
|
|
2114
|
-
/* @__PURE__ */
|
|
2123
|
+
/* @__PURE__ */ jsx16("div", {
|
|
2115
2124
|
className: "-m-1 flex overflow-x-auto p-1",
|
|
2116
2125
|
children: /* @__PURE__ */ jsxs9(Menubar, {
|
|
2117
2126
|
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",
|
|
@@ -2121,23 +2130,23 @@ var DataTableToolbar = ({
|
|
|
2121
2130
|
/* @__PURE__ */ jsxs9(MenubarTrigger, {
|
|
2122
2131
|
className: "bg-primary text-primary-foreground hover:bg-primary/90 aria-expanded:bg-primary/90",
|
|
2123
2132
|
children: [
|
|
2124
|
-
|
|
2125
|
-
/* @__PURE__ */
|
|
2133
|
+
labels2.selected,
|
|
2134
|
+
/* @__PURE__ */ jsx16(Badge, {
|
|
2126
2135
|
variant: "secondary",
|
|
2127
2136
|
children: selectedRows.length
|
|
2128
2137
|
}),
|
|
2129
|
-
/* @__PURE__ */
|
|
2138
|
+
/* @__PURE__ */ jsx16(ChevronDown, {})
|
|
2130
2139
|
]
|
|
2131
2140
|
}),
|
|
2132
|
-
/* @__PURE__ */
|
|
2141
|
+
/* @__PURE__ */ jsx16(MenubarContent, {
|
|
2133
2142
|
align: "end",
|
|
2134
2143
|
className: "w-max",
|
|
2135
2144
|
children: /* @__PURE__ */ jsxs9(MenubarGroup, {
|
|
2136
2145
|
children: [
|
|
2137
|
-
/* @__PURE__ */
|
|
2138
|
-
children: bulkActions && bulkActions.label ? bulkActions.label :
|
|
2146
|
+
/* @__PURE__ */ jsx16(MenubarLabel, {
|
|
2147
|
+
children: bulkActions && bulkActions.label ? bulkActions.label : labels2.actions
|
|
2139
2148
|
}),
|
|
2140
|
-
/* @__PURE__ */
|
|
2149
|
+
/* @__PURE__ */ jsx16(MenubarSeparator, {}),
|
|
2141
2150
|
visibleBulkActions.map((action) => /* @__PURE__ */ jsxs9(MenubarItem, {
|
|
2142
2151
|
onClick: () => action.onClick(selectedRows),
|
|
2143
2152
|
variant: action.variant ?? "default",
|
|
@@ -2152,30 +2161,30 @@ var DataTableToolbar = ({
|
|
|
2152
2161
|
]
|
|
2153
2162
|
}) : null,
|
|
2154
2163
|
toolbar && toolbar.items,
|
|
2155
|
-
features.filtering !== false ? /* @__PURE__ */
|
|
2164
|
+
features.filtering !== false ? /* @__PURE__ */ jsx16(FilterMenu, {
|
|
2156
2165
|
tableAtom
|
|
2157
2166
|
}) : null,
|
|
2158
2167
|
grouping ? /* @__PURE__ */ jsxs9(MenubarMenu, {
|
|
2159
2168
|
children: [
|
|
2160
2169
|
/* @__PURE__ */ jsxs9(MenubarTrigger, {
|
|
2161
|
-
"aria-label":
|
|
2170
|
+
"aria-label": labels2.groupBy,
|
|
2162
2171
|
children: [
|
|
2163
|
-
/* @__PURE__ */
|
|
2164
|
-
/* @__PURE__ */
|
|
2172
|
+
/* @__PURE__ */ jsx16(Rows3, {}),
|
|
2173
|
+
/* @__PURE__ */ jsx16("span", {
|
|
2165
2174
|
className: "hidden sm:inline",
|
|
2166
|
-
children:
|
|
2175
|
+
children: labels2.groupBy
|
|
2167
2176
|
})
|
|
2168
2177
|
]
|
|
2169
2178
|
}),
|
|
2170
|
-
/* @__PURE__ */
|
|
2179
|
+
/* @__PURE__ */ jsx16(MenubarContent, {
|
|
2171
2180
|
align: "end",
|
|
2172
2181
|
children: /* @__PURE__ */ jsxs9(MenubarGroup, {
|
|
2173
2182
|
children: [
|
|
2174
|
-
/* @__PURE__ */
|
|
2175
|
-
children:
|
|
2183
|
+
/* @__PURE__ */ jsx16(MenubarLabel, {
|
|
2184
|
+
children: labels2.groupBy
|
|
2176
2185
|
}),
|
|
2177
|
-
/* @__PURE__ */
|
|
2178
|
-
grouping.fields.map((field) => /* @__PURE__ */
|
|
2186
|
+
/* @__PURE__ */ jsx16(MenubarSeparator, {}),
|
|
2187
|
+
grouping.fields.map((field) => /* @__PURE__ */ jsx16(MenubarCheckboxItem, {
|
|
2179
2188
|
checked: store.state.grouping.includes(field.id),
|
|
2180
2189
|
onCheckedChange: (checked) => update((state) => ({
|
|
2181
2190
|
...state,
|
|
@@ -2188,24 +2197,24 @@ var DataTableToolbar = ({
|
|
|
2188
2197
|
})
|
|
2189
2198
|
]
|
|
2190
2199
|
}) : null,
|
|
2191
|
-
features.sorting !== false ? /* @__PURE__ */
|
|
2200
|
+
features.sorting !== false ? /* @__PURE__ */ jsx16(SortMenu, {
|
|
2192
2201
|
tableAtom
|
|
2193
2202
|
}) : null,
|
|
2194
|
-
features.gallery ? /* @__PURE__ */
|
|
2203
|
+
features.gallery ? /* @__PURE__ */ jsx16(ViewMenu, {
|
|
2195
2204
|
tableAtom
|
|
2196
2205
|
}) : null,
|
|
2197
|
-
features.columnVisibility !== false ? /* @__PURE__ */
|
|
2206
|
+
features.columnVisibility !== false ? /* @__PURE__ */ jsx16(ColumnMenu, {
|
|
2198
2207
|
tableAtom
|
|
2199
2208
|
}) : null,
|
|
2200
|
-
features.refresh ? /* @__PURE__ */
|
|
2209
|
+
features.refresh ? /* @__PURE__ */ jsx16(MenubarMenu, {
|
|
2201
2210
|
children: /* @__PURE__ */ jsxs9(MenubarTrigger, {
|
|
2202
|
-
"aria-label":
|
|
2211
|
+
"aria-label": labels2.refresh,
|
|
2203
2212
|
onClick: features.refresh,
|
|
2204
2213
|
children: [
|
|
2205
|
-
/* @__PURE__ */
|
|
2206
|
-
/* @__PURE__ */
|
|
2214
|
+
/* @__PURE__ */ jsx16(RefreshCw, {}),
|
|
2215
|
+
/* @__PURE__ */ jsx16("span", {
|
|
2207
2216
|
className: "hidden sm:inline",
|
|
2208
|
-
children:
|
|
2217
|
+
children: labels2.refresh
|
|
2209
2218
|
})
|
|
2210
2219
|
]
|
|
2211
2220
|
})
|
|
@@ -2213,35 +2222,35 @@ var DataTableToolbar = ({
|
|
|
2213
2222
|
features.export ? /* @__PURE__ */ jsxs9(MenubarMenu, {
|
|
2214
2223
|
children: [
|
|
2215
2224
|
/* @__PURE__ */ jsxs9(MenubarTrigger, {
|
|
2216
|
-
"aria-label":
|
|
2225
|
+
"aria-label": labels2.export,
|
|
2217
2226
|
"aria-busy": exporting,
|
|
2218
2227
|
disabled: exporting || !canExport,
|
|
2219
2228
|
children: [
|
|
2220
|
-
exporting ? /* @__PURE__ */
|
|
2229
|
+
exporting ? /* @__PURE__ */ jsx16(RefreshCw, {
|
|
2221
2230
|
className: "animate-spin"
|
|
2222
|
-
}) : /* @__PURE__ */
|
|
2223
|
-
/* @__PURE__ */
|
|
2231
|
+
}) : /* @__PURE__ */ jsx16(Download, {}),
|
|
2232
|
+
/* @__PURE__ */ jsx16("span", {
|
|
2224
2233
|
className: "hidden sm:inline",
|
|
2225
|
-
children: exporting ?
|
|
2234
|
+
children: exporting ? labels2.loading : labels2.export
|
|
2226
2235
|
})
|
|
2227
2236
|
]
|
|
2228
2237
|
}),
|
|
2229
|
-
/* @__PURE__ */
|
|
2238
|
+
/* @__PURE__ */ jsx16(MenubarContent, {
|
|
2230
2239
|
align: "end",
|
|
2231
2240
|
children: /* @__PURE__ */ jsxs9(MenubarGroup, {
|
|
2232
2241
|
children: [
|
|
2233
|
-
/* @__PURE__ */
|
|
2234
|
-
children:
|
|
2242
|
+
/* @__PURE__ */ jsx16(MenubarLabel, {
|
|
2243
|
+
children: labels2.export
|
|
2235
2244
|
}),
|
|
2236
|
-
/* @__PURE__ */
|
|
2245
|
+
/* @__PURE__ */ jsx16(MenubarSeparator, {}),
|
|
2237
2246
|
builtInExport ? /* @__PURE__ */ jsxs9(Fragment, {
|
|
2238
2247
|
children: [
|
|
2239
2248
|
/* @__PURE__ */ jsxs9(MenubarItem, {
|
|
2240
2249
|
disabled: exporting || !exportRows.length,
|
|
2241
|
-
onClick: () => downloadCsv(exportColumns.map(columnLabel), exportRows.map((row) => exportColumns.map((column) =>
|
|
2250
|
+
onClick: () => downloadCsv(exportColumns.map(columnLabel), exportRows.map((row) => exportColumns.map((column) => dataTableValueText(getDataTableExportValue(row, column, store.config.locale) ?? ""))), features.export ? features.export.baseName : "table"),
|
|
2242
2251
|
children: [
|
|
2243
|
-
/* @__PURE__ */
|
|
2244
|
-
|
|
2252
|
+
/* @__PURE__ */ jsx16(FileText, {}),
|
|
2253
|
+
labels2.exportCsv
|
|
2245
2254
|
]
|
|
2246
2255
|
}),
|
|
2247
2256
|
/* @__PURE__ */ jsxs9(MenubarItem, {
|
|
@@ -2251,13 +2260,13 @@ var DataTableToolbar = ({
|
|
|
2251
2260
|
getDataTableExportValue(row, column, store.config.locale)
|
|
2252
2261
|
]))), features.export ? features.export.baseName : "table"),
|
|
2253
2262
|
children: [
|
|
2254
|
-
/* @__PURE__ */
|
|
2255
|
-
|
|
2263
|
+
/* @__PURE__ */ jsx16(FileJson, {}),
|
|
2264
|
+
labels2.exportJson
|
|
2256
2265
|
]
|
|
2257
2266
|
})
|
|
2258
2267
|
]
|
|
2259
2268
|
}) : null,
|
|
2260
|
-
builtInExport && exportActions.length ? /* @__PURE__ */
|
|
2269
|
+
builtInExport && exportActions.length ? /* @__PURE__ */ jsx16(MenubarSeparator, {}) : null,
|
|
2261
2270
|
exportActions.map((action) => /* @__PURE__ */ jsxs9(MenubarItem, {
|
|
2262
2271
|
disabled: exporting || action.disabled,
|
|
2263
2272
|
onClick: () => void runExport(action),
|
|
@@ -2274,10 +2283,10 @@ var DataTableToolbar = ({
|
|
|
2274
2283
|
]
|
|
2275
2284
|
})
|
|
2276
2285
|
}),
|
|
2277
|
-
exportFeature && exportFailed ? /* @__PURE__ */
|
|
2286
|
+
exportFeature && exportFailed ? /* @__PURE__ */ jsx16("p", {
|
|
2278
2287
|
role: "alert",
|
|
2279
2288
|
className: "text-destructive text-sm",
|
|
2280
|
-
children:
|
|
2289
|
+
children: labels2.exportFailed ?? dataTableMessages(store.config.locale).exportFailed
|
|
2281
2290
|
}) : null
|
|
2282
2291
|
]
|
|
2283
2292
|
});
|
|
@@ -2292,7 +2301,7 @@ var FilterEditor = ({
|
|
|
2292
2301
|
column,
|
|
2293
2302
|
rows,
|
|
2294
2303
|
current,
|
|
2295
|
-
labels,
|
|
2304
|
+
labels: labels2,
|
|
2296
2305
|
onChange
|
|
2297
2306
|
}) => {
|
|
2298
2307
|
const inputId = useId2();
|
|
@@ -2301,10 +2310,10 @@ var FilterEditor = ({
|
|
|
2301
2310
|
const [secondary, setSecondary] = useState(current?.kind === "number" ? String(current.max ?? "") : current?.kind === "date" ? current.to ?? "" : "");
|
|
2302
2311
|
const [operator, setOperator] = useState(current?.kind === "text" ? current.operator : "contains");
|
|
2303
2312
|
const operatorOptions = [
|
|
2304
|
-
{ value: "contains", label:
|
|
2305
|
-
{ value: "equals", label:
|
|
2306
|
-
{ value: "startsWith", label:
|
|
2307
|
-
{ value: "endsWith", label:
|
|
2313
|
+
{ value: "contains", label: labels2.filterContains },
|
|
2314
|
+
{ value: "equals", label: labels2.filterEquals },
|
|
2315
|
+
{ value: "startsWith", label: labels2.filterStartsWith },
|
|
2316
|
+
{ value: "endsWith", label: labels2.filterEndsWith }
|
|
2308
2317
|
];
|
|
2309
2318
|
const [invalid, setInvalid] = useState(false);
|
|
2310
2319
|
const [optionSearch, setOptionSearch] = useState("");
|
|
@@ -2324,23 +2333,23 @@ var FilterEditor = ({
|
|
|
2324
2333
|
value: current?.kind === "boolean" ? String(current.value) : "",
|
|
2325
2334
|
onValueChange: (value) => apply({ id: column.id, kind, value: value === "true" }),
|
|
2326
2335
|
children: [
|
|
2327
|
-
/* @__PURE__ */
|
|
2336
|
+
/* @__PURE__ */ jsx16(MenubarRadioItem, {
|
|
2328
2337
|
value: "true",
|
|
2329
2338
|
closeOnClick: false,
|
|
2330
|
-
children: column.colDef.type === "boolean" ? column.colDef.typeOptions?.trueLabel ??
|
|
2339
|
+
children: column.colDef.type === "boolean" ? column.colDef.typeOptions?.trueLabel ?? labels2.filterTrue : labels2.filterTrue
|
|
2331
2340
|
}),
|
|
2332
|
-
/* @__PURE__ */
|
|
2341
|
+
/* @__PURE__ */ jsx16(MenubarRadioItem, {
|
|
2333
2342
|
value: "false",
|
|
2334
2343
|
closeOnClick: false,
|
|
2335
|
-
children: column.colDef.type === "boolean" ? column.colDef.typeOptions?.falseLabel ??
|
|
2344
|
+
children: column.colDef.type === "boolean" ? column.colDef.typeOptions?.falseLabel ?? labels2.filterFalse : labels2.filterFalse
|
|
2336
2345
|
})
|
|
2337
2346
|
]
|
|
2338
2347
|
}),
|
|
2339
|
-
/* @__PURE__ */
|
|
2340
|
-
/* @__PURE__ */
|
|
2348
|
+
/* @__PURE__ */ jsx16(MenubarSeparator, {}),
|
|
2349
|
+
/* @__PURE__ */ jsx16(MenubarItem, {
|
|
2341
2350
|
closeOnClick: false,
|
|
2342
2351
|
onClick: () => onChange(undefined),
|
|
2343
|
-
children:
|
|
2352
|
+
children: labels2.filterClear
|
|
2344
2353
|
})
|
|
2345
2354
|
]
|
|
2346
2355
|
});
|
|
@@ -2351,11 +2360,11 @@ var FilterEditor = ({
|
|
|
2351
2360
|
const filteredOptions = options.filter((option) => option.label.toLocaleLowerCase().includes(optionSearch.trim().toLocaleLowerCase()));
|
|
2352
2361
|
return /* @__PURE__ */ jsxs9(MenubarGroup, {
|
|
2353
2362
|
children: [
|
|
2354
|
-
options.length > 8 ? /* @__PURE__ */
|
|
2363
|
+
options.length > 8 ? /* @__PURE__ */ jsx16("div", {
|
|
2355
2364
|
className: "p-1",
|
|
2356
|
-
children: /* @__PURE__ */
|
|
2357
|
-
"aria-label":
|
|
2358
|
-
placeholder:
|
|
2365
|
+
children: /* @__PURE__ */ jsx16(Input, {
|
|
2366
|
+
"aria-label": labels2.filter,
|
|
2367
|
+
placeholder: labels2.filter,
|
|
2359
2368
|
value: optionSearch,
|
|
2360
2369
|
onChange: (event) => setOptionSearch(event.target.value),
|
|
2361
2370
|
onKeyDown: (event) => {
|
|
@@ -2375,26 +2384,26 @@ var FilterEditor = ({
|
|
|
2375
2384
|
onChange(undefined);
|
|
2376
2385
|
},
|
|
2377
2386
|
children: [
|
|
2378
|
-
/* @__PURE__ */
|
|
2387
|
+
/* @__PURE__ */ jsx16("span", {
|
|
2379
2388
|
className: "min-w-0 flex-1 truncate",
|
|
2380
2389
|
children: option.label
|
|
2381
2390
|
}),
|
|
2382
|
-
option.count !== undefined ? /* @__PURE__ */
|
|
2391
|
+
option.count !== undefined ? /* @__PURE__ */ jsx16(Badge, {
|
|
2383
2392
|
variant: "secondary",
|
|
2384
2393
|
className: "ml-auto shrink-0",
|
|
2385
2394
|
children: option.count
|
|
2386
2395
|
}) : null
|
|
2387
2396
|
]
|
|
2388
2397
|
}, option.value)),
|
|
2389
|
-
!filteredOptions.length ? /* @__PURE__ */
|
|
2398
|
+
!filteredOptions.length ? /* @__PURE__ */ jsx16("div", {
|
|
2390
2399
|
className: "text-muted-foreground px-2 py-1.5 text-sm",
|
|
2391
|
-
children:
|
|
2400
|
+
children: labels2.empty
|
|
2392
2401
|
}) : null,
|
|
2393
|
-
/* @__PURE__ */
|
|
2394
|
-
/* @__PURE__ */
|
|
2402
|
+
/* @__PURE__ */ jsx16(MenubarSeparator, {}),
|
|
2403
|
+
/* @__PURE__ */ jsx16(MenubarItem, {
|
|
2395
2404
|
closeOnClick: false,
|
|
2396
2405
|
onClick: () => onChange(undefined),
|
|
2397
|
-
children:
|
|
2406
|
+
children: labels2.filterClear
|
|
2398
2407
|
})
|
|
2399
2408
|
]
|
|
2400
2409
|
});
|
|
@@ -2417,8 +2426,8 @@ var FilterEditor = ({
|
|
|
2417
2426
|
to: secondary || undefined
|
|
2418
2427
|
});
|
|
2419
2428
|
else {
|
|
2420
|
-
const min = primary ? Schema2.
|
|
2421
|
-
const max = secondary ? Schema2.
|
|
2429
|
+
const min = primary ? Schema2.decodeOption(Schema2.FiniteFromString)(primary) : Option2.some(undefined);
|
|
2430
|
+
const max = secondary ? Schema2.decodeOption(Schema2.FiniteFromString)(secondary) : Option2.some(undefined);
|
|
2422
2431
|
if (Option2.isNone(min) || Option2.isNone(max)) {
|
|
2423
2432
|
setInvalid(true);
|
|
2424
2433
|
return;
|
|
@@ -2431,9 +2440,9 @@ var FilterEditor = ({
|
|
|
2431
2440
|
children: [
|
|
2432
2441
|
kind === "text" ? /* @__PURE__ */ jsxs9(Field, {
|
|
2433
2442
|
children: [
|
|
2434
|
-
/* @__PURE__ */
|
|
2443
|
+
/* @__PURE__ */ jsx16(FieldLabel, {
|
|
2435
2444
|
htmlFor: `${inputId}-operator`,
|
|
2436
|
-
children:
|
|
2445
|
+
children: labels2.filterOperator
|
|
2437
2446
|
}),
|
|
2438
2447
|
/* @__PURE__ */ jsxs9(Select, {
|
|
2439
2448
|
items: operatorOptions,
|
|
@@ -2444,13 +2453,13 @@ var FilterEditor = ({
|
|
|
2444
2453
|
setOperator(decoded.value);
|
|
2445
2454
|
},
|
|
2446
2455
|
children: [
|
|
2447
|
-
/* @__PURE__ */
|
|
2456
|
+
/* @__PURE__ */ jsx16(SelectTrigger, {
|
|
2448
2457
|
id: `${inputId}-operator`,
|
|
2449
|
-
children: /* @__PURE__ */
|
|
2458
|
+
children: /* @__PURE__ */ jsx16(SelectValue, {})
|
|
2450
2459
|
}),
|
|
2451
|
-
/* @__PURE__ */
|
|
2452
|
-
children: /* @__PURE__ */
|
|
2453
|
-
children: operatorOptions.map((option) => /* @__PURE__ */
|
|
2460
|
+
/* @__PURE__ */ jsx16(SelectContent, {
|
|
2461
|
+
children: /* @__PURE__ */ jsx16(SelectGroup, {
|
|
2462
|
+
children: operatorOptions.map((option) => /* @__PURE__ */ jsx16(SelectItem, {
|
|
2454
2463
|
value: option.value,
|
|
2455
2464
|
children: option.label
|
|
2456
2465
|
}, option.value))
|
|
@@ -2463,11 +2472,11 @@ var FilterEditor = ({
|
|
|
2463
2472
|
/* @__PURE__ */ jsxs9(Field, {
|
|
2464
2473
|
"data-invalid": invalid || undefined,
|
|
2465
2474
|
children: [
|
|
2466
|
-
/* @__PURE__ */
|
|
2475
|
+
/* @__PURE__ */ jsx16(FieldLabel, {
|
|
2467
2476
|
htmlFor: `${inputId}-primary`,
|
|
2468
|
-
children: kind === "text" ?
|
|
2477
|
+
children: kind === "text" ? labels2.filterValue : kind === "date" ? labels2.filterFrom : labels2.filterMin
|
|
2469
2478
|
}),
|
|
2470
|
-
/* @__PURE__ */
|
|
2479
|
+
/* @__PURE__ */ jsx16(Input, {
|
|
2471
2480
|
id: `${inputId}-primary`,
|
|
2472
2481
|
type: kind === "text" ? "text" : kind === "date" ? "date" : "number",
|
|
2473
2482
|
step: kind === "number" ? "any" : undefined,
|
|
@@ -2483,11 +2492,11 @@ var FilterEditor = ({
|
|
|
2483
2492
|
kind !== "text" ? /* @__PURE__ */ jsxs9(Field, {
|
|
2484
2493
|
"data-invalid": invalid || undefined,
|
|
2485
2494
|
children: [
|
|
2486
|
-
/* @__PURE__ */
|
|
2495
|
+
/* @__PURE__ */ jsx16(FieldLabel, {
|
|
2487
2496
|
htmlFor: `${inputId}-secondary`,
|
|
2488
|
-
children: kind === "date" ?
|
|
2497
|
+
children: kind === "date" ? labels2.filterTo : labels2.filterMax
|
|
2489
2498
|
}),
|
|
2490
|
-
/* @__PURE__ */
|
|
2499
|
+
/* @__PURE__ */ jsx16(Input, {
|
|
2491
2500
|
id: `${inputId}-secondary`,
|
|
2492
2501
|
type: kind === "date" ? "date" : "number",
|
|
2493
2502
|
step: kind === "number" ? "any" : undefined,
|
|
@@ -2502,20 +2511,20 @@ var FilterEditor = ({
|
|
|
2502
2511
|
}) : null
|
|
2503
2512
|
]
|
|
2504
2513
|
}),
|
|
2505
|
-
invalid ? /* @__PURE__ */
|
|
2514
|
+
invalid ? /* @__PURE__ */ jsx16("p", {
|
|
2506
2515
|
role: "alert",
|
|
2507
2516
|
className: "text-destructive text-sm",
|
|
2508
|
-
children:
|
|
2517
|
+
children: labels2.filterInvalid
|
|
2509
2518
|
}) : null,
|
|
2510
2519
|
/* @__PURE__ */ jsxs9("div", {
|
|
2511
2520
|
className: "flex gap-2",
|
|
2512
2521
|
children: [
|
|
2513
|
-
/* @__PURE__ */
|
|
2522
|
+
/* @__PURE__ */ jsx16(Button, {
|
|
2514
2523
|
type: "submit",
|
|
2515
2524
|
size: "sm",
|
|
2516
|
-
children:
|
|
2525
|
+
children: labels2.filterApply
|
|
2517
2526
|
}),
|
|
2518
|
-
/* @__PURE__ */
|
|
2527
|
+
/* @__PURE__ */ jsx16(Button, {
|
|
2519
2528
|
type: "button",
|
|
2520
2529
|
size: "sm",
|
|
2521
2530
|
variant: "outline",
|
|
@@ -2525,7 +2534,7 @@ var FilterEditor = ({
|
|
|
2525
2534
|
setInvalid(false);
|
|
2526
2535
|
onChange(undefined);
|
|
2527
2536
|
},
|
|
2528
|
-
children:
|
|
2537
|
+
children: labels2.filterClear
|
|
2529
2538
|
})
|
|
2530
2539
|
]
|
|
2531
2540
|
})
|
|
@@ -2550,39 +2559,39 @@ var FilterMenu = ({
|
|
|
2550
2559
|
/* @__PURE__ */ jsxs9(MenubarTrigger, {
|
|
2551
2560
|
"aria-label": store.config.labels.filters,
|
|
2552
2561
|
children: [
|
|
2553
|
-
/* @__PURE__ */
|
|
2554
|
-
/* @__PURE__ */
|
|
2562
|
+
/* @__PURE__ */ jsx16(ListFilter, {}),
|
|
2563
|
+
/* @__PURE__ */ jsx16("span", {
|
|
2555
2564
|
children: store.config.labels.filters
|
|
2556
2565
|
}),
|
|
2557
|
-
filters.length ? /* @__PURE__ */
|
|
2566
|
+
filters.length ? /* @__PURE__ */ jsx16(Badge, {
|
|
2558
2567
|
variant: "secondary",
|
|
2559
2568
|
children: filters.length
|
|
2560
2569
|
}) : null
|
|
2561
2570
|
]
|
|
2562
2571
|
}),
|
|
2563
|
-
/* @__PURE__ */
|
|
2572
|
+
/* @__PURE__ */ jsx16(MenubarContent, {
|
|
2564
2573
|
align: "end",
|
|
2565
2574
|
className: "w-80 max-w-[calc(100vw-2rem)]",
|
|
2566
2575
|
children: /* @__PURE__ */ jsxs9(MenubarGroup, {
|
|
2567
2576
|
children: [
|
|
2568
|
-
/* @__PURE__ */
|
|
2577
|
+
/* @__PURE__ */ jsx16(MenubarLabel, {
|
|
2569
2578
|
children: store.config.labels.filters
|
|
2570
2579
|
}),
|
|
2571
|
-
/* @__PURE__ */
|
|
2580
|
+
/* @__PURE__ */ jsx16(MenubarSeparator, {}),
|
|
2572
2581
|
columns.map(({ column, label }) => /* @__PURE__ */ jsxs9(MenubarSub, {
|
|
2573
2582
|
children: [
|
|
2574
2583
|
/* @__PURE__ */ jsxs9(MenubarSubTrigger, {
|
|
2575
2584
|
children: [
|
|
2576
|
-
/* @__PURE__ */
|
|
2585
|
+
/* @__PURE__ */ jsx16("span", {
|
|
2577
2586
|
className: "min-w-0 flex-1 truncate",
|
|
2578
2587
|
children: label
|
|
2579
2588
|
}),
|
|
2580
|
-
filters.some((filter) => filter.id === column.id) ? /* @__PURE__ */
|
|
2589
|
+
filters.some((filter) => filter.id === column.id) ? /* @__PURE__ */ jsx16(Check, {}) : null
|
|
2581
2590
|
]
|
|
2582
2591
|
}),
|
|
2583
|
-
/* @__PURE__ */
|
|
2592
|
+
/* @__PURE__ */ jsx16(MenubarSubContent, {
|
|
2584
2593
|
className: "w-80 max-w-[calc(100vw-2rem)]",
|
|
2585
|
-
children: /* @__PURE__ */
|
|
2594
|
+
children: /* @__PURE__ */ jsx16(FilterEditor, {
|
|
2586
2595
|
column,
|
|
2587
2596
|
rows: model.rows,
|
|
2588
2597
|
current: filters.find((filter) => filter.id === column.id),
|
|
@@ -2594,7 +2603,7 @@ var FilterMenu = ({
|
|
|
2594
2603
|
}, column.id)),
|
|
2595
2604
|
filters.length ? /* @__PURE__ */ jsxs9(Fragment, {
|
|
2596
2605
|
children: [
|
|
2597
|
-
/* @__PURE__ */
|
|
2606
|
+
/* @__PURE__ */ jsx16(MenubarSeparator, {}),
|
|
2598
2607
|
/* @__PURE__ */ jsxs9(MenubarItem, {
|
|
2599
2608
|
onClick: () => changeState(setStore, (state) => ({
|
|
2600
2609
|
...state,
|
|
@@ -2602,7 +2611,7 @@ var FilterMenu = ({
|
|
|
2602
2611
|
filters: undefined
|
|
2603
2612
|
})),
|
|
2604
2613
|
children: [
|
|
2605
|
-
/* @__PURE__ */
|
|
2614
|
+
/* @__PURE__ */ jsx16(X, {}),
|
|
2606
2615
|
store.config.labels.filtersClear
|
|
2607
2616
|
]
|
|
2608
2617
|
})
|
|
@@ -2638,29 +2647,29 @@ var SortMenu = ({
|
|
|
2638
2647
|
/* @__PURE__ */ jsxs9(MenubarTrigger, {
|
|
2639
2648
|
"aria-label": store.config.labels.sortBy,
|
|
2640
2649
|
children: [
|
|
2641
|
-
current ? current.direction === "desc" ? /* @__PURE__ */
|
|
2642
|
-
/* @__PURE__ */
|
|
2650
|
+
current ? current.direction === "desc" ? /* @__PURE__ */ jsx16(ArrowDown, {}) : /* @__PURE__ */ jsx16(ArrowUp, {}) : /* @__PURE__ */ jsx16(ChevronsUpDown, {}),
|
|
2651
|
+
/* @__PURE__ */ jsx16("span", {
|
|
2643
2652
|
className: "hidden sm:inline",
|
|
2644
2653
|
children: store.config.labels.sortBy
|
|
2645
2654
|
})
|
|
2646
2655
|
]
|
|
2647
2656
|
}),
|
|
2648
|
-
/* @__PURE__ */
|
|
2657
|
+
/* @__PURE__ */ jsx16(MenubarContent, {
|
|
2649
2658
|
align: "end",
|
|
2650
2659
|
className: "w-52",
|
|
2651
2660
|
children: /* @__PURE__ */ jsxs9(MenubarGroup, {
|
|
2652
2661
|
children: [
|
|
2653
|
-
/* @__PURE__ */
|
|
2662
|
+
/* @__PURE__ */ jsx16(MenubarLabel, {
|
|
2654
2663
|
children: store.config.labels.sortBy
|
|
2655
2664
|
}),
|
|
2656
|
-
/* @__PURE__ */
|
|
2665
|
+
/* @__PURE__ */ jsx16(MenubarSeparator, {}),
|
|
2657
2666
|
columns.map((column) => {
|
|
2658
2667
|
const sortState = store.state.sort?.find(({ id }) => id === column.id);
|
|
2659
2668
|
return /* @__PURE__ */ jsxs9(MenubarSub, {
|
|
2660
2669
|
children: [
|
|
2661
2670
|
/* @__PURE__ */ jsxs9(MenubarSubTrigger, {
|
|
2662
2671
|
children: [
|
|
2663
|
-
sortState ? sortState.direction === "desc" ? /* @__PURE__ */
|
|
2672
|
+
sortState ? sortState.direction === "desc" ? /* @__PURE__ */ jsx16(ArrowDown, {}) : /* @__PURE__ */ jsx16(ArrowUp, {}) : null,
|
|
2664
2673
|
columnLabel(column)
|
|
2665
2674
|
]
|
|
2666
2675
|
}),
|
|
@@ -2669,7 +2678,7 @@ var SortMenu = ({
|
|
|
2669
2678
|
/* @__PURE__ */ jsxs9(MenubarItem, {
|
|
2670
2679
|
onClick: () => sort(column.id, "asc"),
|
|
2671
2680
|
children: [
|
|
2672
|
-
/* @__PURE__ */
|
|
2681
|
+
/* @__PURE__ */ jsx16(ArrowUp, {}),
|
|
2673
2682
|
" ",
|
|
2674
2683
|
store.config.labels.sortAsc
|
|
2675
2684
|
]
|
|
@@ -2677,21 +2686,21 @@ var SortMenu = ({
|
|
|
2677
2686
|
/* @__PURE__ */ jsxs9(MenubarItem, {
|
|
2678
2687
|
onClick: () => sort(column.id, "desc"),
|
|
2679
2688
|
children: [
|
|
2680
|
-
/* @__PURE__ */
|
|
2689
|
+
/* @__PURE__ */ jsx16(ArrowDown, {}),
|
|
2681
2690
|
" ",
|
|
2682
2691
|
store.config.labels.sortDesc
|
|
2683
2692
|
]
|
|
2684
2693
|
}),
|
|
2685
2694
|
sortState ? /* @__PURE__ */ jsxs9(Fragment, {
|
|
2686
2695
|
children: [
|
|
2687
|
-
/* @__PURE__ */
|
|
2696
|
+
/* @__PURE__ */ jsx16(MenubarSeparator, {}),
|
|
2688
2697
|
/* @__PURE__ */ jsxs9(MenubarItem, {
|
|
2689
2698
|
onClick: () => changeState(setStore, (state) => ({
|
|
2690
2699
|
...state,
|
|
2691
2700
|
sort: state.sort?.filter(({ id }) => id !== column.id)
|
|
2692
2701
|
})),
|
|
2693
2702
|
children: [
|
|
2694
|
-
/* @__PURE__ */
|
|
2703
|
+
/* @__PURE__ */ jsx16(X, {}),
|
|
2695
2704
|
" ",
|
|
2696
2705
|
store.config.labels.sortClear
|
|
2697
2706
|
]
|
|
@@ -2718,21 +2727,21 @@ var ViewMenu = ({
|
|
|
2718
2727
|
/* @__PURE__ */ jsxs9(MenubarTrigger, {
|
|
2719
2728
|
"aria-label": store.config.labels.view,
|
|
2720
2729
|
children: [
|
|
2721
|
-
store.state.view === "gallery" ? /* @__PURE__ */
|
|
2722
|
-
/* @__PURE__ */
|
|
2730
|
+
store.state.view === "gallery" ? /* @__PURE__ */ jsx16(LayoutGrid, {}) : /* @__PURE__ */ jsx16(Rows3, {}),
|
|
2731
|
+
/* @__PURE__ */ jsx16("span", {
|
|
2723
2732
|
className: "hidden sm:inline",
|
|
2724
2733
|
children: store.config.labels.view
|
|
2725
2734
|
})
|
|
2726
2735
|
]
|
|
2727
2736
|
}),
|
|
2728
|
-
/* @__PURE__ */
|
|
2737
|
+
/* @__PURE__ */ jsx16(MenubarContent, {
|
|
2729
2738
|
align: "end",
|
|
2730
2739
|
children: /* @__PURE__ */ jsxs9(MenubarGroup, {
|
|
2731
2740
|
children: [
|
|
2732
|
-
/* @__PURE__ */
|
|
2741
|
+
/* @__PURE__ */ jsx16(MenubarLabel, {
|
|
2733
2742
|
children: store.config.labels.view
|
|
2734
2743
|
}),
|
|
2735
|
-
/* @__PURE__ */
|
|
2744
|
+
/* @__PURE__ */ jsx16(MenubarSeparator, {}),
|
|
2736
2745
|
/* @__PURE__ */ jsxs9(MenubarRadioGroup, {
|
|
2737
2746
|
onValueChange: (view) => {
|
|
2738
2747
|
if (view === "table" || view === "gallery") {
|
|
@@ -2744,7 +2753,7 @@ var ViewMenu = ({
|
|
|
2744
2753
|
/* @__PURE__ */ jsxs9(MenubarRadioItem, {
|
|
2745
2754
|
value: "table",
|
|
2746
2755
|
children: [
|
|
2747
|
-
/* @__PURE__ */
|
|
2756
|
+
/* @__PURE__ */ jsx16(Rows3, {}),
|
|
2748
2757
|
" ",
|
|
2749
2758
|
store.config.labels.tableView
|
|
2750
2759
|
]
|
|
@@ -2752,7 +2761,7 @@ var ViewMenu = ({
|
|
|
2752
2761
|
/* @__PURE__ */ jsxs9(MenubarRadioItem, {
|
|
2753
2762
|
value: "gallery",
|
|
2754
2763
|
children: [
|
|
2755
|
-
/* @__PURE__ */
|
|
2764
|
+
/* @__PURE__ */ jsx16(LayoutGrid, {}),
|
|
2756
2765
|
" ",
|
|
2757
2766
|
store.config.labels.galleryView
|
|
2758
2767
|
]
|
|
@@ -2777,22 +2786,22 @@ var ColumnMenu = ({
|
|
|
2777
2786
|
/* @__PURE__ */ jsxs9(MenubarTrigger, {
|
|
2778
2787
|
"aria-label": store.config.labels.columns,
|
|
2779
2788
|
children: [
|
|
2780
|
-
/* @__PURE__ */
|
|
2781
|
-
/* @__PURE__ */
|
|
2789
|
+
/* @__PURE__ */ jsx16(Settings2, {}),
|
|
2790
|
+
/* @__PURE__ */ jsx16("span", {
|
|
2782
2791
|
className: "hidden sm:inline",
|
|
2783
2792
|
children: store.config.labels.columns
|
|
2784
2793
|
})
|
|
2785
2794
|
]
|
|
2786
2795
|
}),
|
|
2787
|
-
/* @__PURE__ */
|
|
2796
|
+
/* @__PURE__ */ jsx16(MenubarContent, {
|
|
2788
2797
|
align: "end",
|
|
2789
2798
|
children: /* @__PURE__ */ jsxs9(MenubarGroup, {
|
|
2790
2799
|
children: [
|
|
2791
|
-
/* @__PURE__ */
|
|
2800
|
+
/* @__PURE__ */ jsx16(MenubarLabel, {
|
|
2792
2801
|
children: store.config.labels.columns
|
|
2793
2802
|
}),
|
|
2794
|
-
/* @__PURE__ */
|
|
2795
|
-
columns.map((column) => /* @__PURE__ */
|
|
2803
|
+
/* @__PURE__ */ jsx16(MenubarSeparator, {}),
|
|
2804
|
+
columns.map((column) => /* @__PURE__ */ jsx16(MenubarCheckboxItem, {
|
|
2796
2805
|
checked: store.state.columnVisibility[column.id] !== false,
|
|
2797
2806
|
onCheckedChange: (visible) => changeState(setStore, (state) => ({
|
|
2798
2807
|
...state,
|
|
@@ -2845,7 +2854,7 @@ var ResizeHandle = ({
|
|
|
2845
2854
|
const reset = () => {
|
|
2846
2855
|
resizeRef.current = null;
|
|
2847
2856
|
};
|
|
2848
|
-
return /* @__PURE__ */
|
|
2857
|
+
return /* @__PURE__ */ jsx16("button", {
|
|
2849
2858
|
"aria-label": store.config.labels.resizeColumn(columnLabel(column)),
|
|
2850
2859
|
"aria-orientation": "vertical",
|
|
2851
2860
|
"aria-valuemax": column.colDef.maxWidth ?? DEFAULT_MAX_WIDTH,
|
|
@@ -2969,7 +2978,7 @@ var DragHandle = ({
|
|
|
2969
2978
|
};
|
|
2970
2979
|
return /* @__PURE__ */ jsxs9(Fragment, {
|
|
2971
2980
|
children: [
|
|
2972
|
-
/* @__PURE__ */
|
|
2981
|
+
/* @__PURE__ */ jsx16(Button, {
|
|
2973
2982
|
"aria-label": store.config.features.reordering && store.config.features.reordering.handleLabel ? store.config.features.reordering.handleLabel : store.config.labels.reorder,
|
|
2974
2983
|
className: "size-8 cursor-grab touch-none active:cursor-grabbing",
|
|
2975
2984
|
onClick: (event) => event.stopPropagation(),
|
|
@@ -2987,9 +2996,9 @@ var DragHandle = ({
|
|
|
2987
2996
|
onPointerUp: finish,
|
|
2988
2997
|
size: "icon",
|
|
2989
2998
|
variant: "ghost",
|
|
2990
|
-
children: /* @__PURE__ */
|
|
2999
|
+
children: /* @__PURE__ */ jsx16(GripVertical, {})
|
|
2991
3000
|
}),
|
|
2992
|
-
overlay ? createPortal(/* @__PURE__ */
|
|
3001
|
+
overlay ? createPortal(/* @__PURE__ */ jsx16("div", {
|
|
2993
3002
|
"aria-hidden": "true",
|
|
2994
3003
|
className: "bg-background pointer-events-none fixed z-[100] rounded-md border px-3 py-2 text-sm shadow-lg",
|
|
2995
3004
|
style: { left: overlay.x + 12, top: overlay.y + 12 },
|
|
@@ -3032,36 +3041,36 @@ var TableDataRow = ({
|
|
|
3032
3041
|
},
|
|
3033
3042
|
tabIndex: store.config.onRowClicked ? 0 : undefined,
|
|
3034
3043
|
children: [
|
|
3035
|
-
selection ? /* @__PURE__ */
|
|
3044
|
+
selection ? /* @__PURE__ */ jsx16(TableCell, {
|
|
3036
3045
|
className: "w-10 pr-0",
|
|
3037
3046
|
onClick: (event) => event.stopPropagation(),
|
|
3038
|
-
children: /* @__PURE__ */
|
|
3047
|
+
children: /* @__PURE__ */ jsx16(Checkbox, {
|
|
3039
3048
|
"aria-label": store.config.labels.selectRow,
|
|
3040
3049
|
checked: !!store.state.rowSelection[row.id],
|
|
3041
3050
|
disabled: !selectable,
|
|
3042
3051
|
onCheckedChange: (checked) => toggleRow(store, setStore, row.id, checked)
|
|
3043
3052
|
})
|
|
3044
3053
|
}) : null,
|
|
3045
|
-
draggable ? /* @__PURE__ */
|
|
3054
|
+
draggable ? /* @__PURE__ */ jsx16(TableCell, {
|
|
3046
3055
|
className: "w-10 pr-0",
|
|
3047
|
-
children: /* @__PURE__ */
|
|
3056
|
+
children: /* @__PURE__ */ jsx16(DragHandle, {
|
|
3048
3057
|
tableAtom
|
|
3049
3058
|
})
|
|
3050
3059
|
}) : null,
|
|
3051
|
-
model.visibleColumns.map((column) => /* @__PURE__ */
|
|
3060
|
+
model.visibleColumns.map((column) => /* @__PURE__ */ jsx16(TableCell, {
|
|
3052
3061
|
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"),
|
|
3053
3062
|
style: { width: column.width },
|
|
3054
|
-
children: /* @__PURE__ */
|
|
3063
|
+
children: /* @__PURE__ */ jsx16("div", {
|
|
3055
3064
|
className: cn("min-w-0", column.colDef.truncate && "truncate"),
|
|
3056
3065
|
children: renderCell(row, column, store.config.locale, store.config.labels)
|
|
3057
3066
|
})
|
|
3058
3067
|
}, column.id)),
|
|
3059
|
-
hasRowActionMenu(store) ? /* @__PURE__ */
|
|
3068
|
+
hasRowActionMenu(store) ? /* @__PURE__ */ jsx16(TableCell, {
|
|
3060
3069
|
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))]",
|
|
3061
3070
|
onClick: (event) => event.stopPropagation(),
|
|
3062
|
-
children: /* @__PURE__ */
|
|
3071
|
+
children: /* @__PURE__ */ jsx16("div", {
|
|
3063
3072
|
className: "flex h-16 items-center justify-center",
|
|
3064
|
-
children: /* @__PURE__ */
|
|
3073
|
+
children: /* @__PURE__ */ jsx16(DataTableRowActionMenu, {
|
|
3065
3074
|
tableAtom
|
|
3066
3075
|
})
|
|
3067
3076
|
})
|
|
@@ -3079,23 +3088,23 @@ var GroupActions = ({
|
|
|
3079
3088
|
return null;
|
|
3080
3089
|
return /* @__PURE__ */ jsxs9(DropdownMenu, {
|
|
3081
3090
|
children: [
|
|
3082
|
-
/* @__PURE__ */
|
|
3091
|
+
/* @__PURE__ */ jsx16(DropdownMenuTrigger, {
|
|
3083
3092
|
onClick: (event) => event.stopPropagation(),
|
|
3084
3093
|
render: /* @__PURE__ */ jsxs9(Button, {
|
|
3085
3094
|
size: "icon",
|
|
3086
3095
|
variant: "ghost",
|
|
3087
3096
|
children: [
|
|
3088
|
-
/* @__PURE__ */
|
|
3097
|
+
/* @__PURE__ */ jsx16("span", {
|
|
3089
3098
|
className: "sr-only",
|
|
3090
3099
|
children: title
|
|
3091
3100
|
}),
|
|
3092
|
-
/* @__PURE__ */
|
|
3101
|
+
/* @__PURE__ */ jsx16(MoreHorizontal, {})
|
|
3093
3102
|
]
|
|
3094
3103
|
})
|
|
3095
3104
|
}),
|
|
3096
|
-
/* @__PURE__ */
|
|
3105
|
+
/* @__PURE__ */ jsx16(DropdownMenuContent, {
|
|
3097
3106
|
align: "end",
|
|
3098
|
-
children: /* @__PURE__ */
|
|
3107
|
+
children: /* @__PURE__ */ jsx16(DropdownMenuGroup, {
|
|
3099
3108
|
children: visible.map((action) => /* @__PURE__ */ jsxs9(DropdownMenuItem, {
|
|
3100
3109
|
onClick: () => action.onClick(groupId),
|
|
3101
3110
|
variant: action.variant ?? "default",
|
|
@@ -3131,10 +3140,10 @@ var GroupedTable = ({
|
|
|
3131
3140
|
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",
|
|
3132
3141
|
"data-table-group": section.field.onMoveToGroup ? targetKey : undefined,
|
|
3133
3142
|
children: [
|
|
3134
|
-
/* @__PURE__ */
|
|
3143
|
+
/* @__PURE__ */ jsx16(TableRow, {
|
|
3135
3144
|
className: "bg-muted/40 hover:bg-accent! cursor-pointer",
|
|
3136
3145
|
onClick: toggleCollapsed,
|
|
3137
|
-
children: /* @__PURE__ */
|
|
3146
|
+
children: /* @__PURE__ */ jsx16(TableCell, {
|
|
3138
3147
|
colSpan: model.visibleColumns.length + extra,
|
|
3139
3148
|
children: /* @__PURE__ */ jsxs9("div", {
|
|
3140
3149
|
className: "flex items-center gap-2",
|
|
@@ -3145,22 +3154,22 @@ var GroupedTable = ({
|
|
|
3145
3154
|
className: "flex flex-1 cursor-pointer items-center gap-2 text-left font-medium",
|
|
3146
3155
|
type: "button",
|
|
3147
3156
|
children: [
|
|
3148
|
-
collapsed ? /* @__PURE__ */
|
|
3157
|
+
collapsed ? /* @__PURE__ */ jsx16(ChevronRight2, {
|
|
3149
3158
|
className: "size-4"
|
|
3150
|
-
}) : /* @__PURE__ */
|
|
3159
|
+
}) : /* @__PURE__ */ jsx16(ChevronDown, {
|
|
3151
3160
|
className: "size-4"
|
|
3152
3161
|
}),
|
|
3153
|
-
/* @__PURE__ */
|
|
3162
|
+
/* @__PURE__ */ jsx16("span", {
|
|
3154
3163
|
className: "flex-1",
|
|
3155
3164
|
children: section.field.renderGroupLabel?.(section.groupId, section.rows.map((row) => row.data)) ?? section.groupId
|
|
3156
3165
|
})
|
|
3157
3166
|
]
|
|
3158
3167
|
}),
|
|
3159
|
-
/* @__PURE__ */
|
|
3168
|
+
/* @__PURE__ */ jsx16(Badge, {
|
|
3160
3169
|
variant: "secondary",
|
|
3161
3170
|
children: section.rows.length
|
|
3162
3171
|
}),
|
|
3163
|
-
/* @__PURE__ */
|
|
3172
|
+
/* @__PURE__ */ jsx16(GroupActions, {
|
|
3164
3173
|
actions: section.field.actions,
|
|
3165
3174
|
groupId: section.groupId,
|
|
3166
3175
|
title: section.field.actionsLabel ?? store.config.labels.actions
|
|
@@ -3169,14 +3178,14 @@ var GroupedTable = ({
|
|
|
3169
3178
|
})
|
|
3170
3179
|
})
|
|
3171
3180
|
}),
|
|
3172
|
-
!collapsed && !section.children.length ? section.rows.length ? section.rows.map((row) => /* @__PURE__ */
|
|
3181
|
+
!collapsed && !section.children.length ? section.rows.length ? section.rows.map((row) => /* @__PURE__ */ jsx16(RowIdContext.Provider, {
|
|
3173
3182
|
value: row.id,
|
|
3174
|
-
children: /* @__PURE__ */
|
|
3183
|
+
children: /* @__PURE__ */ jsx16(TableDataRow, {
|
|
3175
3184
|
tableAtom
|
|
3176
3185
|
})
|
|
3177
3186
|
}, `${section.key}:${row.id}`)) : [
|
|
3178
|
-
/* @__PURE__ */
|
|
3179
|
-
children: /* @__PURE__ */
|
|
3187
|
+
/* @__PURE__ */ jsx16(TableRow, {
|
|
3188
|
+
children: /* @__PURE__ */ jsx16(TableCell, {
|
|
3180
3189
|
className: "text-muted-foreground h-16",
|
|
3181
3190
|
colSpan: model.visibleColumns.length + extra,
|
|
3182
3191
|
children: section.field.renderEmptyGroup?.(section.groupId) ?? store.config.labels.empty
|
|
@@ -3187,7 +3196,7 @@ var GroupedTable = ({
|
|
|
3187
3196
|
}, section.key);
|
|
3188
3197
|
return !collapsed && section.children.length ? [body, renderSections(section.children)] : [body];
|
|
3189
3198
|
});
|
|
3190
|
-
return /* @__PURE__ */
|
|
3199
|
+
return /* @__PURE__ */ jsx16(Fragment, {
|
|
3191
3200
|
children: renderSections(sections)
|
|
3192
3201
|
});
|
|
3193
3202
|
};
|
|
@@ -3205,7 +3214,7 @@ var ColumnHeaderMenu = ({
|
|
|
3205
3214
|
const filteringEnabled = store.config.features.filtering !== false && filterColumns.length > 0;
|
|
3206
3215
|
const ownsFilter = (id) => id === column.id || getDataTableFieldColumns(column).some((field) => field.id === id);
|
|
3207
3216
|
const activeFilters = (store.state.filters ?? []).filter(({ id }) => ownsFilter(id));
|
|
3208
|
-
const filterEditor = (field) => /* @__PURE__ */
|
|
3217
|
+
const filterEditor = (field) => /* @__PURE__ */ jsx16(FilterEditor, {
|
|
3209
3218
|
column: field,
|
|
3210
3219
|
rows: model.rows,
|
|
3211
3220
|
current: store.state.filters?.find((filter) => filter.id === field.id),
|
|
@@ -3228,7 +3237,7 @@ var ColumnHeaderMenu = ({
|
|
|
3228
3237
|
/* @__PURE__ */ jsxs9(DropdownMenuItem, {
|
|
3229
3238
|
onClick: () => setSort(field.id, "asc"),
|
|
3230
3239
|
children: [
|
|
3231
|
-
/* @__PURE__ */
|
|
3240
|
+
/* @__PURE__ */ jsx16(ArrowUp, {}),
|
|
3232
3241
|
" ",
|
|
3233
3242
|
store.config.labels.sortAsc
|
|
3234
3243
|
]
|
|
@@ -3236,7 +3245,7 @@ var ColumnHeaderMenu = ({
|
|
|
3236
3245
|
/* @__PURE__ */ jsxs9(DropdownMenuItem, {
|
|
3237
3246
|
onClick: () => setSort(field.id, "desc"),
|
|
3238
3247
|
children: [
|
|
3239
|
-
/* @__PURE__ */
|
|
3248
|
+
/* @__PURE__ */ jsx16(ArrowDown, {}),
|
|
3240
3249
|
" ",
|
|
3241
3250
|
store.config.labels.sortDesc
|
|
3242
3251
|
]
|
|
@@ -3244,30 +3253,30 @@ var ColumnHeaderMenu = ({
|
|
|
3244
3253
|
]
|
|
3245
3254
|
});
|
|
3246
3255
|
if (!sortingEnabled && !hidingEnabled && !filteringEnabled) {
|
|
3247
|
-
return /* @__PURE__ */
|
|
3256
|
+
return /* @__PURE__ */ jsx16("div", {
|
|
3248
3257
|
className: "truncate px-2",
|
|
3249
3258
|
children: column.colDef.headerName
|
|
3250
3259
|
});
|
|
3251
3260
|
}
|
|
3252
3261
|
return /* @__PURE__ */ jsxs9(DropdownMenu, {
|
|
3253
3262
|
children: [
|
|
3254
|
-
/* @__PURE__ */
|
|
3263
|
+
/* @__PURE__ */ jsx16(DropdownMenuTrigger, {
|
|
3255
3264
|
render: /* @__PURE__ */ jsxs9(Button, {
|
|
3256
3265
|
"aria-label": label,
|
|
3257
3266
|
"aria-description": activeFilters.length ? `${store.config.labels.filters}: ${activeFilters.length}` : undefined,
|
|
3258
3267
|
className: "absolute inset-0 h-full w-full min-w-0 justify-start rounded-none px-2 pr-4 focus-visible:ring-inset",
|
|
3259
3268
|
variant: "ghost",
|
|
3260
3269
|
children: [
|
|
3261
|
-
/* @__PURE__ */
|
|
3270
|
+
/* @__PURE__ */ jsx16("span", {
|
|
3262
3271
|
className: "truncate",
|
|
3263
3272
|
children: column.colDef.headerName
|
|
3264
3273
|
}),
|
|
3265
|
-
activeFilters.length ? /* @__PURE__ */
|
|
3266
|
-
sort ? sort.direction === "desc" ? /* @__PURE__ */
|
|
3274
|
+
activeFilters.length ? /* @__PURE__ */ jsx16(ListFilter, {}) : null,
|
|
3275
|
+
sort ? sort.direction === "desc" ? /* @__PURE__ */ jsx16(ArrowDown, {}) : /* @__PURE__ */ jsx16(ArrowUp, {}) : null
|
|
3267
3276
|
]
|
|
3268
3277
|
})
|
|
3269
3278
|
}),
|
|
3270
|
-
/* @__PURE__ */
|
|
3279
|
+
/* @__PURE__ */ jsx16(DropdownMenuContent, {
|
|
3271
3280
|
align: "start",
|
|
3272
3281
|
className: "w-48",
|
|
3273
3282
|
children: /* @__PURE__ */ jsxs9(DropdownMenuGroup, {
|
|
@@ -3276,11 +3285,11 @@ var ColumnHeaderMenu = ({
|
|
|
3276
3285
|
children: [
|
|
3277
3286
|
column.colDef.fields?.length ? sortColumns.map((field) => /* @__PURE__ */ jsxs9(DropdownMenuSub, {
|
|
3278
3287
|
children: [
|
|
3279
|
-
/* @__PURE__ */
|
|
3288
|
+
/* @__PURE__ */ jsx16(DropdownMenuSubTrigger, {
|
|
3280
3289
|
children: columnLabel(field)
|
|
3281
3290
|
}),
|
|
3282
|
-
/* @__PURE__ */
|
|
3283
|
-
children: /* @__PURE__ */
|
|
3291
|
+
/* @__PURE__ */ jsx16(DropdownMenuSubContent, {
|
|
3292
|
+
children: /* @__PURE__ */ jsx16(DropdownMenuGroup, {
|
|
3284
3293
|
children: sortItems(field)
|
|
3285
3294
|
})
|
|
3286
3295
|
})
|
|
@@ -3292,36 +3301,36 @@ var ColumnHeaderMenu = ({
|
|
|
3292
3301
|
sort: state.sort?.filter(({ id }) => !ownsSort(id))
|
|
3293
3302
|
})),
|
|
3294
3303
|
children: [
|
|
3295
|
-
/* @__PURE__ */
|
|
3304
|
+
/* @__PURE__ */ jsx16(X, {}),
|
|
3296
3305
|
" ",
|
|
3297
3306
|
store.config.labels.sortClear
|
|
3298
3307
|
]
|
|
3299
3308
|
}) : null
|
|
3300
3309
|
]
|
|
3301
3310
|
}) : null,
|
|
3302
|
-
sortingEnabled && filteringEnabled ? /* @__PURE__ */
|
|
3311
|
+
sortingEnabled && filteringEnabled ? /* @__PURE__ */ jsx16(DropdownMenuSeparator, {}) : null,
|
|
3303
3312
|
filteringEnabled ? /* @__PURE__ */ jsxs9(Fragment, {
|
|
3304
3313
|
children: [
|
|
3305
3314
|
/* @__PURE__ */ jsxs9(DropdownMenuSub, {
|
|
3306
3315
|
children: [
|
|
3307
3316
|
/* @__PURE__ */ jsxs9(DropdownMenuSubTrigger, {
|
|
3308
3317
|
children: [
|
|
3309
|
-
/* @__PURE__ */
|
|
3318
|
+
/* @__PURE__ */ jsx16(ListFilter, {}),
|
|
3310
3319
|
store.config.labels.filters
|
|
3311
3320
|
]
|
|
3312
3321
|
}),
|
|
3313
|
-
/* @__PURE__ */
|
|
3322
|
+
/* @__PURE__ */ jsx16(DropdownMenuSubContent, {
|
|
3314
3323
|
className: "w-80 max-w-[calc(100vw-2rem)]",
|
|
3315
|
-
children: column.colDef.fields?.length ? /* @__PURE__ */
|
|
3324
|
+
children: column.colDef.fields?.length ? /* @__PURE__ */ jsx16(DropdownMenuGroup, {
|
|
3316
3325
|
children: filterColumns.map((field) => /* @__PURE__ */ jsxs9(DropdownMenuSub, {
|
|
3317
3326
|
children: [
|
|
3318
3327
|
/* @__PURE__ */ jsxs9(DropdownMenuSubTrigger, {
|
|
3319
3328
|
children: [
|
|
3320
3329
|
columnLabel(field),
|
|
3321
|
-
activeFilters.some((filter) => filter.id === field.id) ? /* @__PURE__ */
|
|
3330
|
+
activeFilters.some((filter) => filter.id === field.id) ? /* @__PURE__ */ jsx16(Check, {}) : null
|
|
3322
3331
|
]
|
|
3323
3332
|
}),
|
|
3324
|
-
/* @__PURE__ */
|
|
3333
|
+
/* @__PURE__ */ jsx16(DropdownMenuSubContent, {
|
|
3325
3334
|
className: "w-80 max-w-[calc(100vw-2rem)]",
|
|
3326
3335
|
children: filterEditor(field)
|
|
3327
3336
|
})
|
|
@@ -3341,13 +3350,13 @@ var ColumnHeaderMenu = ({
|
|
|
3341
3350
|
};
|
|
3342
3351
|
}),
|
|
3343
3352
|
children: [
|
|
3344
|
-
/* @__PURE__ */
|
|
3353
|
+
/* @__PURE__ */ jsx16(X, {}),
|
|
3345
3354
|
store.config.labels.filterClear
|
|
3346
3355
|
]
|
|
3347
3356
|
}) : null
|
|
3348
3357
|
]
|
|
3349
3358
|
}) : null,
|
|
3350
|
-
(sortingEnabled || filteringEnabled) && hidingEnabled ? /* @__PURE__ */
|
|
3359
|
+
(sortingEnabled || filteringEnabled) && hidingEnabled ? /* @__PURE__ */ jsx16(DropdownMenuSeparator, {}) : null,
|
|
3351
3360
|
hidingEnabled ? /* @__PURE__ */ jsxs9(DropdownMenuItem, {
|
|
3352
3361
|
onClick: () => update((state) => ({
|
|
3353
3362
|
...state,
|
|
@@ -3357,7 +3366,7 @@ var ColumnHeaderMenu = ({
|
|
|
3357
3366
|
}
|
|
3358
3367
|
})),
|
|
3359
3368
|
children: [
|
|
3360
|
-
/* @__PURE__ */
|
|
3369
|
+
/* @__PURE__ */ jsx16(EyeOff, {}),
|
|
3361
3370
|
" ",
|
|
3362
3371
|
store.config.labels.hideColumn
|
|
3363
3372
|
]
|
|
@@ -3379,12 +3388,12 @@ var DataTableHeader = ({
|
|
|
3379
3388
|
const selectableRows = getDataTableSelectableRows(model, grouped, selection ? selection.isRowSelectable : undefined);
|
|
3380
3389
|
const allSelected = selectableRows.length > 0 && selectableRows.every((row) => store.state.rowSelection[row.id]);
|
|
3381
3390
|
const someSelected = selectableRows.some((row) => store.state.rowSelection[row.id]);
|
|
3382
|
-
return /* @__PURE__ */
|
|
3391
|
+
return /* @__PURE__ */ jsx16(TableHeader, {
|
|
3383
3392
|
children: /* @__PURE__ */ jsxs9(TableRow, {
|
|
3384
3393
|
children: [
|
|
3385
|
-
selection ? /* @__PURE__ */
|
|
3394
|
+
selection ? /* @__PURE__ */ jsx16(TableHead, {
|
|
3386
3395
|
className: "w-10 pr-0",
|
|
3387
|
-
children: /* @__PURE__ */
|
|
3396
|
+
children: /* @__PURE__ */ jsx16(Checkbox, {
|
|
3388
3397
|
"aria-label": store.config.labels.selectAllRows,
|
|
3389
3398
|
checked: allSelected,
|
|
3390
3399
|
indeterminate: someSelected && !allSelected,
|
|
@@ -3398,12 +3407,12 @@ var DataTableHeader = ({
|
|
|
3398
3407
|
}
|
|
3399
3408
|
})
|
|
3400
3409
|
}) : null,
|
|
3401
|
-
draggable ? /* @__PURE__ */
|
|
3410
|
+
draggable ? /* @__PURE__ */ jsx16(TableHead, {
|
|
3402
3411
|
className: "w-10"
|
|
3403
3412
|
}) : null,
|
|
3404
3413
|
model.visibleColumns.map((column) => {
|
|
3405
3414
|
const direction = store.state.sort?.find(({ id }) => id === column.id)?.direction;
|
|
3406
|
-
return /* @__PURE__ */
|
|
3415
|
+
return /* @__PURE__ */ jsx16(TableHead, {
|
|
3407
3416
|
"aria-sort": direction === "asc" ? "ascending" : direction === "desc" ? "descending" : undefined,
|
|
3408
3417
|
className: "relative h-12 p-0",
|
|
3409
3418
|
scope: "col",
|
|
@@ -3411,17 +3420,17 @@ var DataTableHeader = ({
|
|
|
3411
3420
|
children: /* @__PURE__ */ jsxs9(ColumnIdContext.Provider, {
|
|
3412
3421
|
value: column.id,
|
|
3413
3422
|
children: [
|
|
3414
|
-
/* @__PURE__ */
|
|
3423
|
+
/* @__PURE__ */ jsx16(ColumnHeaderMenu, {
|
|
3415
3424
|
tableAtom
|
|
3416
3425
|
}),
|
|
3417
|
-
/* @__PURE__ */
|
|
3426
|
+
/* @__PURE__ */ jsx16(ResizeHandle, {
|
|
3418
3427
|
tableAtom
|
|
3419
3428
|
})
|
|
3420
3429
|
]
|
|
3421
3430
|
})
|
|
3422
3431
|
}, column.id);
|
|
3423
3432
|
}),
|
|
3424
|
-
hasRowActionMenu(store) ? /* @__PURE__ */
|
|
3433
|
+
hasRowActionMenu(store) ? /* @__PURE__ */ jsx16(TableHead, {
|
|
3425
3434
|
className: "w-10"
|
|
3426
3435
|
}) : null
|
|
3427
3436
|
]
|
|
@@ -3439,29 +3448,29 @@ var DataTableBody = ({
|
|
|
3439
3448
|
const sections = groupDataTableRows(rows, fields);
|
|
3440
3449
|
const colSpan = model.visibleColumns.length + (store.config.features.selection ? 1 : 0) + (hasRowActionMenu(store) ? 1 : 0) + (canDragRows(store) ? 1 : 0);
|
|
3441
3450
|
if (sections.length && (rows.length || !store.config.status.loading) && !store.config.status.error) {
|
|
3442
|
-
return /* @__PURE__ */
|
|
3451
|
+
return /* @__PURE__ */ jsx16(GroupedTable, {
|
|
3443
3452
|
tableAtom,
|
|
3444
3453
|
sections
|
|
3445
3454
|
});
|
|
3446
3455
|
}
|
|
3447
|
-
return /* @__PURE__ */
|
|
3448
|
-
children: store.config.status.error || !rows.length && !store.config.status.loading ? /* @__PURE__ */
|
|
3449
|
-
children: /* @__PURE__ */
|
|
3456
|
+
return /* @__PURE__ */ jsx16(TableBody, {
|
|
3457
|
+
children: store.config.status.error || !rows.length && !store.config.status.loading ? /* @__PURE__ */ jsx16(TableRow, {
|
|
3458
|
+
children: /* @__PURE__ */ jsx16(TableCell, {
|
|
3450
3459
|
className: "h-24 text-center",
|
|
3451
3460
|
colSpan: Math.max(colSpan, 1),
|
|
3452
3461
|
children: store.config.status.error ?? store.config.status.empty ?? store.config.labels.empty
|
|
3453
3462
|
})
|
|
3454
|
-
}) : store.config.status.loading && !rows.length ? /* @__PURE__ */
|
|
3455
|
-
children: /* @__PURE__ */
|
|
3463
|
+
}) : store.config.status.loading && !rows.length ? /* @__PURE__ */ jsx16(TableRow, {
|
|
3464
|
+
children: /* @__PURE__ */ jsx16(TableCell, {
|
|
3456
3465
|
className: "h-24 text-center",
|
|
3457
3466
|
colSpan: Math.max(colSpan, 1),
|
|
3458
|
-
children: /* @__PURE__ */
|
|
3467
|
+
children: /* @__PURE__ */ jsx16(Loading, {
|
|
3459
3468
|
label: store.config.labels.loading
|
|
3460
3469
|
})
|
|
3461
3470
|
})
|
|
3462
|
-
}) : rows.map((row) => /* @__PURE__ */
|
|
3471
|
+
}) : rows.map((row) => /* @__PURE__ */ jsx16(RowIdContext.Provider, {
|
|
3463
3472
|
value: row.id,
|
|
3464
|
-
children: /* @__PURE__ */
|
|
3473
|
+
children: /* @__PURE__ */ jsx16(TableDataRow, {
|
|
3465
3474
|
tableAtom
|
|
3466
3475
|
})
|
|
3467
3476
|
}, row.id))
|
|
@@ -3484,7 +3493,7 @@ var GalleryCard = ({
|
|
|
3484
3493
|
const selection = store.config.features.selection;
|
|
3485
3494
|
const selectable = !!selection && (selection.isRowSelectable?.(row.data) ?? true);
|
|
3486
3495
|
const draggable = canDragRows(store);
|
|
3487
|
-
return /* @__PURE__ */
|
|
3496
|
+
return /* @__PURE__ */ jsx16(Card, {
|
|
3488
3497
|
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"),
|
|
3489
3498
|
"data-table-row": row.id,
|
|
3490
3499
|
onClick: () => store.config.onRowClicked?.(row.data),
|
|
@@ -3501,14 +3510,14 @@ var GalleryCard = ({
|
|
|
3501
3510
|
/* @__PURE__ */ jsxs9("div", {
|
|
3502
3511
|
className: "flex items-center gap-2",
|
|
3503
3512
|
children: [
|
|
3504
|
-
selection ? /* @__PURE__ */
|
|
3513
|
+
selection ? /* @__PURE__ */ jsx16(Checkbox, {
|
|
3505
3514
|
"aria-label": store.config.labels.selectRow,
|
|
3506
3515
|
checked: !!store.state.rowSelection[row.id],
|
|
3507
3516
|
disabled: !selectable,
|
|
3508
3517
|
onCheckedChange: (checked) => toggleRow(store, setStore, row.id, checked),
|
|
3509
3518
|
onClick: (event) => event.stopPropagation()
|
|
3510
3519
|
}) : null,
|
|
3511
|
-
draggable ? /* @__PURE__ */
|
|
3520
|
+
draggable ? /* @__PURE__ */ jsx16(DragHandle, {
|
|
3512
3521
|
tableAtom
|
|
3513
3522
|
}) : null,
|
|
3514
3523
|
tag ? /* @__PURE__ */ jsxs9(Badge, {
|
|
@@ -3520,17 +3529,17 @@ var GalleryCard = ({
|
|
|
3520
3529
|
}) : null
|
|
3521
3530
|
]
|
|
3522
3531
|
}),
|
|
3523
|
-
/* @__PURE__ */
|
|
3532
|
+
/* @__PURE__ */ jsx16(CardTitle, {
|
|
3524
3533
|
children: name ? renderCell(row, name, store.config.locale, store.config.labels) : row.id
|
|
3525
3534
|
}),
|
|
3526
|
-
description ? /* @__PURE__ */
|
|
3535
|
+
description ? /* @__PURE__ */ jsx16("div", {
|
|
3527
3536
|
className: "text-muted-foreground line-clamp-3 text-sm",
|
|
3528
3537
|
children: renderCell(row, description, store.config.locale, store.config.labels)
|
|
3529
3538
|
}) : null,
|
|
3530
|
-
hasRowActionMenu(store) ? /* @__PURE__ */
|
|
3539
|
+
hasRowActionMenu(store) ? /* @__PURE__ */ jsx16("div", {
|
|
3531
3540
|
className: "absolute top-4 right-4",
|
|
3532
3541
|
onClick: (event) => event.stopPropagation(),
|
|
3533
|
-
children: /* @__PURE__ */
|
|
3542
|
+
children: /* @__PURE__ */ jsx16(DataTableRowActionMenu, {
|
|
3534
3543
|
tableAtom
|
|
3535
3544
|
})
|
|
3536
3545
|
}) : null
|
|
@@ -3547,37 +3556,37 @@ var DataTableGallery = ({
|
|
|
3547
3556
|
const rows = fields.length ? model.sortedRows : model.pageRows;
|
|
3548
3557
|
const sections = groupDataTableRows(rows, fields);
|
|
3549
3558
|
if (store.config.status.error) {
|
|
3550
|
-
return /* @__PURE__ */
|
|
3559
|
+
return /* @__PURE__ */ jsx16("div", {
|
|
3551
3560
|
className: "text-destructive rounded-lg border border-dashed p-10 text-center",
|
|
3552
3561
|
children: store.config.status.error
|
|
3553
3562
|
});
|
|
3554
3563
|
}
|
|
3555
3564
|
if (store.config.status.loading && !rows.length) {
|
|
3556
|
-
return /* @__PURE__ */
|
|
3565
|
+
return /* @__PURE__ */ jsx16("div", {
|
|
3557
3566
|
className: "rounded-lg border border-dashed p-10 text-center",
|
|
3558
|
-
children: /* @__PURE__ */
|
|
3567
|
+
children: /* @__PURE__ */ jsx16(Loading, {
|
|
3559
3568
|
label: store.config.labels.loading
|
|
3560
3569
|
})
|
|
3561
3570
|
});
|
|
3562
3571
|
}
|
|
3563
3572
|
if (!rows.length && !sections.length) {
|
|
3564
|
-
return /* @__PURE__ */
|
|
3573
|
+
return /* @__PURE__ */ jsx16("div", {
|
|
3565
3574
|
className: "text-muted-foreground rounded-lg border border-dashed p-10 text-center",
|
|
3566
3575
|
children: store.config.status.empty ?? store.config.labels.empty
|
|
3567
3576
|
});
|
|
3568
3577
|
}
|
|
3569
3578
|
if (!fields.length) {
|
|
3570
|
-
return /* @__PURE__ */
|
|
3579
|
+
return /* @__PURE__ */ jsx16("div", {
|
|
3571
3580
|
className: "grid gap-3 sm:grid-cols-2 xl:grid-cols-3",
|
|
3572
|
-
children: rows.map((row) => /* @__PURE__ */
|
|
3581
|
+
children: rows.map((row) => /* @__PURE__ */ jsx16(RowIdContext.Provider, {
|
|
3573
3582
|
value: row.id,
|
|
3574
|
-
children: /* @__PURE__ */
|
|
3583
|
+
children: /* @__PURE__ */ jsx16(GalleryCard, {
|
|
3575
3584
|
tableAtom
|
|
3576
3585
|
})
|
|
3577
3586
|
}, row.id))
|
|
3578
3587
|
});
|
|
3579
3588
|
}
|
|
3580
|
-
const renderSections = (
|
|
3589
|
+
const renderSections = (sections2) => sections2.map((section) => {
|
|
3581
3590
|
const collapsed = !!store.state.collapsedGroups[section.key];
|
|
3582
3591
|
const targetKey = getGroupDropKey(section.field.id, section.groupId);
|
|
3583
3592
|
const toggleCollapsed = () => changeState(setStore, (state) => ({
|
|
@@ -3600,44 +3609,44 @@ var DataTableGallery = ({
|
|
|
3600
3609
|
className: "flex flex-1 cursor-pointer items-center gap-2 text-left font-medium",
|
|
3601
3610
|
type: "button",
|
|
3602
3611
|
children: [
|
|
3603
|
-
collapsed ? /* @__PURE__ */
|
|
3612
|
+
collapsed ? /* @__PURE__ */ jsx16(ChevronRight2, {
|
|
3604
3613
|
className: "size-4"
|
|
3605
|
-
}) : /* @__PURE__ */
|
|
3614
|
+
}) : /* @__PURE__ */ jsx16(ChevronDown, {
|
|
3606
3615
|
className: "size-4"
|
|
3607
3616
|
}),
|
|
3608
|
-
/* @__PURE__ */
|
|
3617
|
+
/* @__PURE__ */ jsx16("span", {
|
|
3609
3618
|
className: "flex-1",
|
|
3610
3619
|
children: section.field.renderGroupLabel?.(section.groupId, section.rows.map((row) => row.data)) ?? section.groupId
|
|
3611
3620
|
}),
|
|
3612
|
-
/* @__PURE__ */
|
|
3621
|
+
/* @__PURE__ */ jsx16(Badge, {
|
|
3613
3622
|
variant: "secondary",
|
|
3614
3623
|
children: section.rows.length
|
|
3615
3624
|
})
|
|
3616
3625
|
]
|
|
3617
3626
|
}),
|
|
3618
|
-
/* @__PURE__ */
|
|
3627
|
+
/* @__PURE__ */ jsx16(GroupActions, {
|
|
3619
3628
|
actions: section.field.actions,
|
|
3620
3629
|
groupId: section.groupId,
|
|
3621
3630
|
title: section.field.actionsLabel ?? store.config.labels.actions
|
|
3622
3631
|
})
|
|
3623
3632
|
]
|
|
3624
3633
|
}),
|
|
3625
|
-
!collapsed ? section.children.length ? renderSections(section.children) : section.rows.length ? /* @__PURE__ */
|
|
3634
|
+
!collapsed ? section.children.length ? renderSections(section.children) : section.rows.length ? /* @__PURE__ */ jsx16("div", {
|
|
3626
3635
|
className: "grid gap-3 sm:grid-cols-2 xl:grid-cols-3",
|
|
3627
|
-
children: section.rows.map((row) => /* @__PURE__ */
|
|
3636
|
+
children: section.rows.map((row) => /* @__PURE__ */ jsx16(RowIdContext.Provider, {
|
|
3628
3637
|
value: row.id,
|
|
3629
|
-
children: /* @__PURE__ */
|
|
3638
|
+
children: /* @__PURE__ */ jsx16(GalleryCard, {
|
|
3630
3639
|
tableAtom
|
|
3631
3640
|
})
|
|
3632
3641
|
}, `${section.key}:${row.id}`))
|
|
3633
|
-
}) : /* @__PURE__ */
|
|
3642
|
+
}) : /* @__PURE__ */ jsx16("div", {
|
|
3634
3643
|
className: "text-muted-foreground rounded-lg border border-dashed p-8 text-center",
|
|
3635
3644
|
children: section.field.renderEmptyGroup?.(section.groupId) ?? store.config.labels.empty
|
|
3636
3645
|
}) : null
|
|
3637
3646
|
]
|
|
3638
3647
|
}, section.key);
|
|
3639
3648
|
});
|
|
3640
|
-
return /* @__PURE__ */
|
|
3649
|
+
return /* @__PURE__ */ jsx16("div", {
|
|
3641
3650
|
className: "space-y-4",
|
|
3642
3651
|
children: renderSections(sections)
|
|
3643
3652
|
});
|
|
@@ -3664,9 +3673,9 @@ var DataTablePagination = ({
|
|
|
3664
3673
|
return null;
|
|
3665
3674
|
const selected = model.rows.filter((row) => store.state.rowSelection[row.id]).length;
|
|
3666
3675
|
const setPagination = (next) => changeState(setStore, (state) => ({ ...state, ...next }));
|
|
3667
|
-
return /* @__PURE__ */
|
|
3676
|
+
return /* @__PURE__ */ jsx16("div", {
|
|
3668
3677
|
className: "pt-4",
|
|
3669
|
-
children: /* @__PURE__ */
|
|
3678
|
+
children: /* @__PURE__ */ jsx16(Pagination, {
|
|
3670
3679
|
locale: store.config.locale,
|
|
3671
3680
|
messages: { [store.config.locale]: store.config.labels },
|
|
3672
3681
|
onPageChange: (page) => setPagination({ page, pageSize: store.state.pageSize }),
|
|
@@ -3722,7 +3731,7 @@ var HydratedDataTable = ({
|
|
|
3722
3731
|
const config = {
|
|
3723
3732
|
getRowId: selection && selection.getRowId || props.getRowId || undefined,
|
|
3724
3733
|
onStateChange: props.onStateChange,
|
|
3725
|
-
onUiStateChange: (
|
|
3734
|
+
onUiStateChange: (state2) => setUiState(state2),
|
|
3726
3735
|
status: props.status ?? {},
|
|
3727
3736
|
features,
|
|
3728
3737
|
onRowClicked: props.onRowClicked,
|
|
@@ -3764,13 +3773,13 @@ var HydratedDataTable = ({
|
|
|
3764
3773
|
className: "w-full max-w-full min-w-0 rounded-md",
|
|
3765
3774
|
"data-table-root": "",
|
|
3766
3775
|
children: [
|
|
3767
|
-
/* @__PURE__ */
|
|
3776
|
+
/* @__PURE__ */ jsx16(DataTableToolbar, {
|
|
3768
3777
|
tableAtom
|
|
3769
3778
|
}),
|
|
3770
|
-
/* @__PURE__ */
|
|
3779
|
+
/* @__PURE__ */ jsx16(DataTableContent, {
|
|
3771
3780
|
tableAtom
|
|
3772
3781
|
}),
|
|
3773
|
-
/* @__PURE__ */
|
|
3782
|
+
/* @__PURE__ */ jsx16(DataTablePagination, {
|
|
3774
3783
|
tableAtom
|
|
3775
3784
|
})
|
|
3776
3785
|
]
|
|
@@ -3803,13 +3812,13 @@ var DataTable = (props) => {
|
|
|
3803
3812
|
}
|
|
3804
3813
|
} : undefined, [initialColumnVisibility, persistedUiResult]);
|
|
3805
3814
|
if (!persistedUiState || AsyncResult.isWaiting(persistedUiResult)) {
|
|
3806
|
-
return /* @__PURE__ */
|
|
3815
|
+
return /* @__PURE__ */ jsx16("div", {
|
|
3807
3816
|
"aria-busy": "true",
|
|
3808
3817
|
className: "invisible w-full max-w-full min-w-0 rounded-md",
|
|
3809
3818
|
"data-table-root": ""
|
|
3810
3819
|
});
|
|
3811
3820
|
}
|
|
3812
|
-
return /* @__PURE__ */
|
|
3821
|
+
return /* @__PURE__ */ jsx16(HydratedDataTable, {
|
|
3813
3822
|
...props,
|
|
3814
3823
|
locale,
|
|
3815
3824
|
persistedUiState,
|
|
@@ -3821,7 +3830,7 @@ var DataTableContent = ({
|
|
|
3821
3830
|
}) => {
|
|
3822
3831
|
const [store] = useTableAtom(tableAtom);
|
|
3823
3832
|
if (store.config.features.gallery && store.state.view === "gallery") {
|
|
3824
|
-
return /* @__PURE__ */
|
|
3833
|
+
return /* @__PURE__ */ jsx16(DataTableGallery, {
|
|
3825
3834
|
tableAtom
|
|
3826
3835
|
});
|
|
3827
3836
|
}
|
|
@@ -3834,15 +3843,15 @@ var DataTableContent = ({
|
|
|
3834
3843
|
className: "table-fixed",
|
|
3835
3844
|
style: { width: `max(100%, ${width}px)` },
|
|
3836
3845
|
children: [
|
|
3837
|
-
/* @__PURE__ */
|
|
3846
|
+
/* @__PURE__ */ jsx16(DataTableHeader, {
|
|
3838
3847
|
tableAtom
|
|
3839
3848
|
}),
|
|
3840
|
-
/* @__PURE__ */
|
|
3849
|
+
/* @__PURE__ */ jsx16(DataTableBody, {
|
|
3841
3850
|
tableAtom
|
|
3842
3851
|
})
|
|
3843
3852
|
]
|
|
3844
3853
|
}),
|
|
3845
|
-
/* @__PURE__ */
|
|
3854
|
+
/* @__PURE__ */ jsx16(ScrollBar, {
|
|
3846
3855
|
orientation: "horizontal"
|
|
3847
3856
|
})
|
|
3848
3857
|
]
|
|
@@ -3852,25 +3861,25 @@ var DataTableListCell = (props) => {
|
|
|
3852
3861
|
const locale = useKrakstackLocale3(props.locale);
|
|
3853
3862
|
const resolvedProps = { ...props, locale };
|
|
3854
3863
|
if (resolvedProps.options && (resolvedProps.onAdd || resolvedProps.onRemove)) {
|
|
3855
|
-
return /* @__PURE__ */
|
|
3864
|
+
return /* @__PURE__ */ jsx16(EditableDataTableListCell, {
|
|
3856
3865
|
...resolvedProps
|
|
3857
3866
|
});
|
|
3858
3867
|
}
|
|
3859
3868
|
const { actionsLabel, itemActions, onItemClick, ...summaryProps } = resolvedProps;
|
|
3860
|
-
const
|
|
3869
|
+
const labels2 = dataTableMessages(locale, resolvedProps.messages);
|
|
3861
3870
|
const hasItems = resolvedProps.items.length > 0;
|
|
3862
3871
|
if (!itemActions?.length && !hasItems) {
|
|
3863
|
-
return /* @__PURE__ */
|
|
3872
|
+
return /* @__PURE__ */ jsx16(DataTableListSummary, {
|
|
3864
3873
|
...summaryProps
|
|
3865
3874
|
});
|
|
3866
3875
|
}
|
|
3867
|
-
const menuLabel = actionsLabel ?? (itemActions?.length ?
|
|
3868
|
-
return /* @__PURE__ */
|
|
3876
|
+
const menuLabel = actionsLabel ?? (itemActions?.length ? labels2.actions : labels2.listDetails);
|
|
3877
|
+
return /* @__PURE__ */ jsx16("div", {
|
|
3869
3878
|
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",
|
|
3870
3879
|
"data-slot": "data-table-list-cell",
|
|
3871
3880
|
onClick: (event) => event.stopPropagation(),
|
|
3872
3881
|
onPointerDown: (event) => event.stopPropagation(),
|
|
3873
|
-
children: /* @__PURE__ */
|
|
3882
|
+
children: /* @__PURE__ */ jsx16(DataTableListMenu, {
|
|
3874
3883
|
actions: itemActions ?? [],
|
|
3875
3884
|
display: resolvedProps.display,
|
|
3876
3885
|
force: hasItems,
|
|
@@ -3884,11 +3893,11 @@ var DataTableListCell = (props) => {
|
|
|
3884
3893
|
className: "h-full w-full min-w-0 justify-between rounded-none px-2 focus-visible:ring-inset",
|
|
3885
3894
|
variant: "ghost",
|
|
3886
3895
|
children: [
|
|
3887
|
-
/* @__PURE__ */
|
|
3896
|
+
/* @__PURE__ */ jsx16(DataTableListSummaryContent, {
|
|
3888
3897
|
...summaryProps,
|
|
3889
3898
|
showMenu: false
|
|
3890
3899
|
}),
|
|
3891
|
-
/* @__PURE__ */
|
|
3900
|
+
/* @__PURE__ */ jsx16(ChevronDown, {})
|
|
3892
3901
|
]
|
|
3893
3902
|
})
|
|
3894
3903
|
})
|
|
@@ -3908,23 +3917,27 @@ var EditableDataTableListCell = ({
|
|
|
3908
3917
|
itemActions,
|
|
3909
3918
|
onItemClick,
|
|
3910
3919
|
locale = "en",
|
|
3911
|
-
messages
|
|
3920
|
+
messages: messages3
|
|
3912
3921
|
}) => {
|
|
3913
3922
|
const [selected, setSelected] = useState([...items]);
|
|
3914
|
-
|
|
3923
|
+
const [previousItems, setPreviousItems] = useState(items);
|
|
3924
|
+
if (previousItems !== items) {
|
|
3925
|
+
setPreviousItems(items);
|
|
3926
|
+
setSelected([...items]);
|
|
3927
|
+
}
|
|
3915
3928
|
const selectedValues = new Set(selected.map((item) => item.value));
|
|
3916
3929
|
const available = options.filter((item) => !selectedValues.has(item.value));
|
|
3917
3930
|
const canAdd = !!onAdd && available.length > 0;
|
|
3918
3931
|
const selectedTotal = totalCount === undefined ? selected.length : totalCount + selected.length - items.length;
|
|
3919
|
-
const
|
|
3932
|
+
const labels2 = dataTableMessages(locale, messages3);
|
|
3920
3933
|
const actions = [
|
|
3921
3934
|
...itemActions ?? [],
|
|
3922
3935
|
...onRemove ? [
|
|
3923
3936
|
{
|
|
3924
3937
|
id: "data-table-list-remove",
|
|
3925
3938
|
closeOnClick: false,
|
|
3926
|
-
name:
|
|
3927
|
-
icon: /* @__PURE__ */
|
|
3939
|
+
name: labels2.removeItem,
|
|
3940
|
+
icon: /* @__PURE__ */ jsx16(Trash2, {}),
|
|
3928
3941
|
variant: "destructive",
|
|
3929
3942
|
onClick: (item) => {
|
|
3930
3943
|
if (item.value === undefined)
|
|
@@ -3935,15 +3948,15 @@ var EditableDataTableListCell = ({
|
|
|
3935
3948
|
}
|
|
3936
3949
|
] : []
|
|
3937
3950
|
];
|
|
3938
|
-
return /* @__PURE__ */
|
|
3951
|
+
return /* @__PURE__ */ jsx16("div", {
|
|
3939
3952
|
"data-slot": "data-table-list-cell",
|
|
3940
3953
|
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",
|
|
3941
3954
|
onClick: (event) => event.stopPropagation(),
|
|
3942
3955
|
onPointerDown: (event) => event.stopPropagation(),
|
|
3943
|
-
children: /* @__PURE__ */
|
|
3956
|
+
children: /* @__PURE__ */ jsx16(DataTableListMenu, {
|
|
3944
3957
|
actions,
|
|
3945
3958
|
addEmptyLabel: emptyLabel,
|
|
3946
|
-
addLabel:
|
|
3959
|
+
addLabel: labels2.addItem,
|
|
3947
3960
|
addOptions: canAdd ? available : undefined,
|
|
3948
3961
|
addSearchLabel: manageLabel,
|
|
3949
3962
|
display,
|
|
@@ -3952,7 +3965,7 @@ var EditableDataTableListCell = ({
|
|
|
3952
3965
|
onItemClick,
|
|
3953
3966
|
label: actionsLabel ?? manageLabel,
|
|
3954
3967
|
locale,
|
|
3955
|
-
messages,
|
|
3968
|
+
messages: messages3,
|
|
3956
3969
|
onAdd: canAdd ? (item) => {
|
|
3957
3970
|
onAdd(item.value);
|
|
3958
3971
|
setSelected((current) => [...current, item]);
|
|
@@ -3962,7 +3975,7 @@ var EditableDataTableListCell = ({
|
|
|
3962
3975
|
className: "h-full w-full min-w-0 justify-between rounded-none px-2 focus-visible:ring-inset",
|
|
3963
3976
|
variant: "ghost",
|
|
3964
3977
|
children: [
|
|
3965
|
-
/* @__PURE__ */
|
|
3978
|
+
/* @__PURE__ */ jsx16(DataTableListSummaryContent, {
|
|
3966
3979
|
emptyLabel,
|
|
3967
3980
|
items: selected,
|
|
3968
3981
|
display,
|
|
@@ -3970,7 +3983,7 @@ var EditableDataTableListCell = ({
|
|
|
3970
3983
|
visibleCount,
|
|
3971
3984
|
totalCount: selectedTotal
|
|
3972
3985
|
}),
|
|
3973
|
-
/* @__PURE__ */
|
|
3986
|
+
/* @__PURE__ */ jsx16(ChevronDown, {})
|
|
3974
3987
|
]
|
|
3975
3988
|
})
|
|
3976
3989
|
})
|
|
@@ -3988,7 +4001,7 @@ var DataTableListMenu = ({
|
|
|
3988
4001
|
items,
|
|
3989
4002
|
label,
|
|
3990
4003
|
locale = "en",
|
|
3991
|
-
messages,
|
|
4004
|
+
messages: messages3,
|
|
3992
4005
|
onAdd,
|
|
3993
4006
|
onItemClick,
|
|
3994
4007
|
trigger
|
|
@@ -4001,41 +4014,41 @@ var DataTableListMenu = ({
|
|
|
4001
4014
|
const hasActions = entries.some(({ visibleActions }) => visibleActions.length);
|
|
4002
4015
|
if (!force && !hasActions && !onAdd)
|
|
4003
4016
|
return null;
|
|
4004
|
-
const
|
|
4005
|
-
const resolvedLabel = label ?? (hasActions ?
|
|
4017
|
+
const labels2 = dataTableMessages(locale, messages3);
|
|
4018
|
+
const resolvedLabel = label ?? (hasActions ? labels2.actions : labels2.listDetails);
|
|
4006
4019
|
return /* @__PURE__ */ jsxs9(DropdownMenu, {
|
|
4007
4020
|
children: [
|
|
4008
|
-
/* @__PURE__ */
|
|
4021
|
+
/* @__PURE__ */ jsx16(DropdownMenuTrigger, {
|
|
4009
4022
|
onClick: (event) => event.stopPropagation(),
|
|
4010
4023
|
onPointerDown: (event) => event.stopPropagation(),
|
|
4011
|
-
render: trigger ?? /* @__PURE__ */
|
|
4024
|
+
render: trigger ?? /* @__PURE__ */ jsx16(Button, {
|
|
4012
4025
|
"aria-label": resolvedLabel,
|
|
4013
4026
|
className: cn("size-8 shrink-0", className),
|
|
4014
4027
|
size: "icon",
|
|
4015
4028
|
variant: "ghost",
|
|
4016
|
-
children: /* @__PURE__ */
|
|
4029
|
+
children: /* @__PURE__ */ jsx16(MoreHorizontal, {})
|
|
4017
4030
|
})
|
|
4018
4031
|
}),
|
|
4019
|
-
/* @__PURE__ */
|
|
4032
|
+
/* @__PURE__ */ jsx16(DropdownMenuContent, {
|
|
4020
4033
|
align: "end",
|
|
4021
4034
|
className: "max-h-[min(18rem,var(--available-height))] w-72 max-w-[calc(100vw-2rem)]",
|
|
4022
4035
|
onClick: (event) => event.stopPropagation(),
|
|
4023
4036
|
onPointerDown: (event) => event.stopPropagation(),
|
|
4024
4037
|
children: /* @__PURE__ */ jsxs9(DropdownMenuGroup, {
|
|
4025
4038
|
children: [
|
|
4026
|
-
/* @__PURE__ */
|
|
4039
|
+
/* @__PURE__ */ jsx16(DropdownMenuLabel, {
|
|
4027
4040
|
children: resolvedLabel
|
|
4028
4041
|
}),
|
|
4029
|
-
/* @__PURE__ */
|
|
4042
|
+
/* @__PURE__ */ jsx16(DropdownMenuSeparator, {}),
|
|
4030
4043
|
entries.map(({ item, visibleActions }, index) => visibleActions.length ? /* @__PURE__ */ jsxs9(DropdownMenuSub, {
|
|
4031
4044
|
children: [
|
|
4032
|
-
/* @__PURE__ */
|
|
4033
|
-
children: /* @__PURE__ */
|
|
4045
|
+
/* @__PURE__ */ jsx16(DropdownMenuSubTrigger, {
|
|
4046
|
+
children: /* @__PURE__ */ jsx16(DataTableListEntry, {
|
|
4034
4047
|
item,
|
|
4035
4048
|
appearance: display === "icon" ? "detail" : "list"
|
|
4036
4049
|
})
|
|
4037
4050
|
}),
|
|
4038
|
-
/* @__PURE__ */
|
|
4051
|
+
/* @__PURE__ */ jsx16(DropdownMenuSubContent, {
|
|
4039
4052
|
className: "w-max",
|
|
4040
4053
|
children: visibleActions.map((action) => /* @__PURE__ */ jsxs9(DropdownMenuItem, {
|
|
4041
4054
|
closeOnClick: action.closeOnClick,
|
|
@@ -4052,28 +4065,28 @@ var DataTableListMenu = ({
|
|
|
4052
4065
|
}, action.id ?? action.name))
|
|
4053
4066
|
})
|
|
4054
4067
|
]
|
|
4055
|
-
}, item.value ?? `${item.label}-${index}`) : /* @__PURE__ */
|
|
4068
|
+
}, item.value ?? `${item.label}-${index}`) : /* @__PURE__ */ jsx16(DropdownMenuItem, {
|
|
4056
4069
|
closeOnClick: Boolean(onItemClick),
|
|
4057
4070
|
onClick: (event) => {
|
|
4058
4071
|
event.stopPropagation();
|
|
4059
4072
|
onItemClick?.(item);
|
|
4060
4073
|
},
|
|
4061
|
-
children: /* @__PURE__ */
|
|
4074
|
+
children: /* @__PURE__ */ jsx16(DataTableListEntry, {
|
|
4062
4075
|
item,
|
|
4063
4076
|
appearance: display === "icon" ? "detail" : "list"
|
|
4064
4077
|
})
|
|
4065
4078
|
}, item.value ?? `${item.label}-${index}`)),
|
|
4066
4079
|
onAdd && addOptions?.length ? /* @__PURE__ */ jsxs9(Fragment, {
|
|
4067
4080
|
children: [
|
|
4068
|
-
entries.length ? /* @__PURE__ */
|
|
4069
|
-
/* @__PURE__ */
|
|
4081
|
+
entries.length ? /* @__PURE__ */ jsx16(DropdownMenuSeparator, {}) : null,
|
|
4082
|
+
/* @__PURE__ */ jsx16(DataTableListAddMenu, {
|
|
4070
4083
|
emptyLabel: addEmptyLabel,
|
|
4071
|
-
label: addLabel ??
|
|
4084
|
+
label: addLabel ?? labels2.addItem,
|
|
4072
4085
|
locale,
|
|
4073
|
-
messages,
|
|
4086
|
+
messages: messages3,
|
|
4074
4087
|
onAdd,
|
|
4075
4088
|
options: addOptions,
|
|
4076
|
-
searchLabel: addSearchLabel ??
|
|
4089
|
+
searchLabel: addSearchLabel ?? labels2.filter,
|
|
4077
4090
|
display
|
|
4078
4091
|
})
|
|
4079
4092
|
]
|
|
@@ -4089,7 +4102,7 @@ var DataTableListAddMenu = ({
|
|
|
4089
4102
|
display,
|
|
4090
4103
|
label,
|
|
4091
4104
|
locale = "en",
|
|
4092
|
-
messages,
|
|
4105
|
+
messages: messages3,
|
|
4093
4106
|
onAdd,
|
|
4094
4107
|
options,
|
|
4095
4108
|
searchLabel
|
|
@@ -4098,7 +4111,7 @@ var DataTableListAddMenu = ({
|
|
|
4098
4111
|
const focusSearch = useCallback((input) => {
|
|
4099
4112
|
input?.focus({ preventScroll: true });
|
|
4100
4113
|
}, []);
|
|
4101
|
-
const
|
|
4114
|
+
const labels2 = dataTableMessages(locale, messages3);
|
|
4102
4115
|
const normalizedSearch = search.trim().toLocaleLowerCase(locale);
|
|
4103
4116
|
const filtered = normalizedSearch ? options.filter((item) => item.label.toLocaleLowerCase(locale).includes(normalizedSearch)) : options;
|
|
4104
4117
|
return /* @__PURE__ */ jsxs9(DropdownMenuSub, {
|
|
@@ -4109,7 +4122,7 @@ var DataTableListAddMenu = ({
|
|
|
4109
4122
|
children: [
|
|
4110
4123
|
/* @__PURE__ */ jsxs9(DropdownMenuSubTrigger, {
|
|
4111
4124
|
children: [
|
|
4112
|
-
/* @__PURE__ */
|
|
4125
|
+
/* @__PURE__ */ jsx16(Plus, {}),
|
|
4113
4126
|
label
|
|
4114
4127
|
]
|
|
4115
4128
|
}),
|
|
@@ -4119,10 +4132,10 @@ var DataTableListAddMenu = ({
|
|
|
4119
4132
|
/* @__PURE__ */ jsxs9("div", {
|
|
4120
4133
|
className: "relative p-1",
|
|
4121
4134
|
children: [
|
|
4122
|
-
/* @__PURE__ */
|
|
4135
|
+
/* @__PURE__ */ jsx16(Search, {
|
|
4123
4136
|
className: "text-muted-foreground pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2"
|
|
4124
4137
|
}),
|
|
4125
|
-
/* @__PURE__ */
|
|
4138
|
+
/* @__PURE__ */ jsx16(Input, {
|
|
4126
4139
|
"aria-label": searchLabel,
|
|
4127
4140
|
className: "h-8 pl-8",
|
|
4128
4141
|
onChange: (event) => setSearch(event.target.value),
|
|
@@ -4130,21 +4143,21 @@ var DataTableListAddMenu = ({
|
|
|
4130
4143
|
if (event.key !== "Escape")
|
|
4131
4144
|
event.stopPropagation();
|
|
4132
4145
|
},
|
|
4133
|
-
placeholder:
|
|
4146
|
+
placeholder: labels2.filter,
|
|
4134
4147
|
ref: focusSearch,
|
|
4135
4148
|
value: search
|
|
4136
4149
|
})
|
|
4137
4150
|
]
|
|
4138
4151
|
}),
|
|
4139
|
-
/* @__PURE__ */
|
|
4140
|
-
filtered.length ? filtered.map((item) => /* @__PURE__ */
|
|
4152
|
+
/* @__PURE__ */ jsx16(DropdownMenuSeparator, {}),
|
|
4153
|
+
filtered.length ? filtered.map((item) => /* @__PURE__ */ jsx16(DropdownMenuItem, {
|
|
4141
4154
|
closeOnClick: false,
|
|
4142
4155
|
onClick: () => onAdd(item),
|
|
4143
|
-
children: /* @__PURE__ */
|
|
4156
|
+
children: /* @__PURE__ */ jsx16(DataTableListEntry, {
|
|
4144
4157
|
item,
|
|
4145
4158
|
appearance: display === "icon" ? "detail" : "list"
|
|
4146
4159
|
})
|
|
4147
|
-
}, item.value)) : /* @__PURE__ */
|
|
4160
|
+
}, item.value)) : /* @__PURE__ */ jsx16("div", {
|
|
4148
4161
|
className: "text-muted-foreground px-2 py-1.5 text-sm",
|
|
4149
4162
|
children: emptyLabel
|
|
4150
4163
|
})
|
|
@@ -4157,7 +4170,7 @@ var DataTableListSummaryContent = ({
|
|
|
4157
4170
|
emptyLabel,
|
|
4158
4171
|
items,
|
|
4159
4172
|
locale,
|
|
4160
|
-
messages,
|
|
4173
|
+
messages: messages3,
|
|
4161
4174
|
totalCount = items.length,
|
|
4162
4175
|
display = "list",
|
|
4163
4176
|
showMenu,
|
|
@@ -4165,18 +4178,18 @@ var DataTableListSummaryContent = ({
|
|
|
4165
4178
|
}) => {
|
|
4166
4179
|
const normalized = items.map((item) => Schema2.is(Schema2.String)(item) ? { label: item } : item);
|
|
4167
4180
|
if (!normalized.length)
|
|
4168
|
-
return /* @__PURE__ */
|
|
4181
|
+
return /* @__PURE__ */ jsx16("span", {
|
|
4169
4182
|
className: "text-muted-foreground",
|
|
4170
4183
|
children: emptyLabel
|
|
4171
4184
|
});
|
|
4172
4185
|
const visible = normalized.slice(0, Math.max(0, visibleCount));
|
|
4173
4186
|
const remaining = Math.max(totalCount - visible.length, 0);
|
|
4174
4187
|
if (display === "icon") {
|
|
4175
|
-
return /* @__PURE__ */
|
|
4188
|
+
return /* @__PURE__ */ jsx16(TooltipProvider, {
|
|
4176
4189
|
children: /* @__PURE__ */ jsxs9("span", {
|
|
4177
4190
|
className: "flex items-center",
|
|
4178
4191
|
children: [
|
|
4179
|
-
visible.map((item, index) => /* @__PURE__ */
|
|
4192
|
+
visible.map((item, index) => /* @__PURE__ */ jsx16(DataTableListEntry, {
|
|
4180
4193
|
item,
|
|
4181
4194
|
appearance: "icon"
|
|
4182
4195
|
}, item.value ?? `${item.label}-${index}`)),
|
|
@@ -4187,13 +4200,13 @@ var DataTableListSummaryContent = ({
|
|
|
4187
4200
|
remaining
|
|
4188
4201
|
]
|
|
4189
4202
|
}) : null,
|
|
4190
|
-
remaining && showMenu ? /* @__PURE__ */
|
|
4203
|
+
remaining && showMenu ? /* @__PURE__ */ jsx16(DataTableListMenu, {
|
|
4191
4204
|
actions: [],
|
|
4192
4205
|
display,
|
|
4193
4206
|
force: true,
|
|
4194
4207
|
items: normalized,
|
|
4195
4208
|
locale,
|
|
4196
|
-
messages
|
|
4209
|
+
messages: messages3
|
|
4197
4210
|
}) : null
|
|
4198
4211
|
]
|
|
4199
4212
|
})
|
|
@@ -4209,18 +4222,18 @@ var DataTableListSummaryContent = ({
|
|
|
4209
4222
|
remaining ? ` +${remaining}` : ""
|
|
4210
4223
|
]
|
|
4211
4224
|
}),
|
|
4212
|
-
remaining && showMenu ? /* @__PURE__ */
|
|
4225
|
+
remaining && showMenu ? /* @__PURE__ */ jsx16(DataTableListMenu, {
|
|
4213
4226
|
actions: [],
|
|
4214
4227
|
display,
|
|
4215
4228
|
force: true,
|
|
4216
4229
|
items: normalized,
|
|
4217
4230
|
locale,
|
|
4218
|
-
messages
|
|
4231
|
+
messages: messages3
|
|
4219
4232
|
}) : null
|
|
4220
4233
|
]
|
|
4221
4234
|
});
|
|
4222
4235
|
};
|
|
4223
|
-
var DataTableListSummary = (props) => /* @__PURE__ */
|
|
4236
|
+
var DataTableListSummary = (props) => /* @__PURE__ */ jsx16(DataTableListSummaryContent, {
|
|
4224
4237
|
...props,
|
|
4225
4238
|
showMenu: true
|
|
4226
4239
|
});
|
|
@@ -4228,17 +4241,17 @@ var DataTableListEntry = ({
|
|
|
4228
4241
|
item,
|
|
4229
4242
|
appearance
|
|
4230
4243
|
}) => {
|
|
4231
|
-
const icon = /* @__PURE__ */
|
|
4244
|
+
const icon = /* @__PURE__ */ jsx16("span", {
|
|
4232
4245
|
"aria-hidden": "true",
|
|
4233
4246
|
className: "bg-secondary text-secondary-foreground flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-full",
|
|
4234
|
-
children: item.imageSrc ? /* @__PURE__ */
|
|
4247
|
+
children: item.imageSrc ? /* @__PURE__ */ jsx16("img", {
|
|
4235
4248
|
alt: "",
|
|
4236
4249
|
src: item.imageSrc,
|
|
4237
4250
|
className: "size-full object-cover"
|
|
4238
4251
|
}) : item.icon ?? item.label.slice(0, 2).toUpperCase()
|
|
4239
4252
|
});
|
|
4240
4253
|
if (appearance === "list") {
|
|
4241
|
-
return /* @__PURE__ */
|
|
4254
|
+
return /* @__PURE__ */ jsx16("span", {
|
|
4242
4255
|
className: "min-w-0 flex-1 truncate",
|
|
4243
4256
|
title: item.label,
|
|
4244
4257
|
children: item.label
|
|
@@ -4246,14 +4259,14 @@ var DataTableListEntry = ({
|
|
|
4246
4259
|
}
|
|
4247
4260
|
return appearance === "icon" ? /* @__PURE__ */ jsxs9(Tooltip, {
|
|
4248
4261
|
children: [
|
|
4249
|
-
/* @__PURE__ */
|
|
4250
|
-
render: /* @__PURE__ */
|
|
4262
|
+
/* @__PURE__ */ jsx16(TooltipTrigger, {
|
|
4263
|
+
render: /* @__PURE__ */ jsx16("span", {
|
|
4251
4264
|
className: "-ml-1 inline-flex rounded-full",
|
|
4252
4265
|
"aria-label": item.label
|
|
4253
4266
|
}),
|
|
4254
4267
|
children: icon
|
|
4255
4268
|
}),
|
|
4256
|
-
/* @__PURE__ */
|
|
4269
|
+
/* @__PURE__ */ jsx16(TooltipContent, {
|
|
4257
4270
|
children: item.label
|
|
4258
4271
|
})
|
|
4259
4272
|
]
|
|
@@ -4261,7 +4274,7 @@ var DataTableListEntry = ({
|
|
|
4261
4274
|
className: "flex min-w-0 flex-1 items-center gap-2 text-left",
|
|
4262
4275
|
children: [
|
|
4263
4276
|
icon,
|
|
4264
|
-
/* @__PURE__ */
|
|
4277
|
+
/* @__PURE__ */ jsx16("span", {
|
|
4265
4278
|
className: "truncate",
|
|
4266
4279
|
children: item.label
|
|
4267
4280
|
})
|
|
@@ -4269,26 +4282,26 @@ var DataTableListEntry = ({
|
|
|
4269
4282
|
});
|
|
4270
4283
|
};
|
|
4271
4284
|
export {
|
|
4272
|
-
|
|
4273
|
-
DataTableListCell,
|
|
4274
|
-
DataTableListSummary,
|
|
4275
|
-
DataTableReferenceCell,
|
|
4276
|
-
DataTableRowActions,
|
|
4277
|
-
buildDataTableRows,
|
|
4278
|
-
dataTableMessages,
|
|
4279
|
-
downloadCsv,
|
|
4280
|
-
downloadJson,
|
|
4281
|
-
filterDataTableColumnRows,
|
|
4282
|
-
filterDataTableRows,
|
|
4283
|
-
getDataTableExportColumns,
|
|
4284
|
-
getDataTableExportValue,
|
|
4285
|
-
getDataTableFilterColumns,
|
|
4286
|
-
getDataTableSelectableRows,
|
|
4287
|
-
getDataTableSortColumns,
|
|
4288
|
-
getDataTableWidth,
|
|
4289
|
-
groupDataTableRows,
|
|
4290
|
-
normalizeDataTableColumns,
|
|
4291
|
-
paginateDataTableRows,
|
|
4285
|
+
sortDataTableRows,
|
|
4292
4286
|
reorderDataTableRows,
|
|
4293
|
-
|
|
4287
|
+
paginateDataTableRows,
|
|
4288
|
+
normalizeDataTableColumns,
|
|
4289
|
+
groupDataTableRows,
|
|
4290
|
+
getDataTableWidth,
|
|
4291
|
+
getDataTableSortColumns,
|
|
4292
|
+
getDataTableSelectableRows,
|
|
4293
|
+
getDataTableFilterColumns,
|
|
4294
|
+
getDataTableExportValue,
|
|
4295
|
+
getDataTableExportColumns,
|
|
4296
|
+
filterDataTableRows,
|
|
4297
|
+
filterDataTableColumnRows,
|
|
4298
|
+
downloadJson,
|
|
4299
|
+
downloadCsv,
|
|
4300
|
+
dataTableMessages,
|
|
4301
|
+
buildDataTableRows,
|
|
4302
|
+
DataTableRowActions,
|
|
4303
|
+
DataTableReferenceCell,
|
|
4304
|
+
DataTableListSummary,
|
|
4305
|
+
DataTableListCell,
|
|
4306
|
+
DataTable
|
|
4294
4307
|
};
|