@ai-matrx/design-system 0.15.1 → 0.15.2
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 +16 -0
- package/README.md +6 -0
- package/dist/data-table/index.cjs +1009 -676
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.js +1010 -677
- package/dist/data-table/index.js.map +1 -1
- package/dist/data-table/infer-filter.cjs +0 -3
- package/dist/data-table/infer-filter.cjs.map +1 -1
- package/dist/data-table/infer-filter.js +0 -3
- package/dist/data-table/infer-filter.js.map +1 -1
- package/dist/data-table/query-control.cjs +0 -3
- package/dist/data-table/query-control.cjs.map +1 -1
- package/dist/data-table/query-control.js +0 -3
- package/dist/data-table/query-control.js.map +1 -1
- package/package.json +1 -1
package/dist/data-table/index.js
CHANGED
|
@@ -586,6 +586,9 @@ function lucideProps(props) {
|
|
|
586
586
|
...props
|
|
587
587
|
};
|
|
588
588
|
}
|
|
589
|
+
function Loader2Icon(props) {
|
|
590
|
+
return /* @__PURE__ */ jsx3("svg", { ...lucideProps(props), children: /* @__PURE__ */ jsx3("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) });
|
|
591
|
+
}
|
|
589
592
|
function XIcon(props) {
|
|
590
593
|
return /* @__PURE__ */ jsxs2("svg", { ...lucideProps(props), children: [
|
|
591
594
|
/* @__PURE__ */ jsx3("path", { d: "M18 6 6 18" }),
|
|
@@ -709,9 +712,268 @@ var Checkbox = React2.forwardRef(({ className, size = "md", ...props }, ref) =>
|
|
|
709
712
|
));
|
|
710
713
|
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
711
714
|
|
|
712
|
-
// src/
|
|
715
|
+
// src/alert-dialog.tsx
|
|
716
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
717
|
+
import { treeContainsComponent } from "@ai-matrx/kit/react-tree";
|
|
718
|
+
import * as React4 from "react";
|
|
719
|
+
|
|
720
|
+
// src/motion.ts
|
|
721
|
+
var MOTION_OVERLAY = "matrx-motion-overlay";
|
|
722
|
+
var MOTION_DIALOG = "matrx-motion-dialog";
|
|
723
|
+
var CENTERED_DIALOG = "matrx-dialog-centered";
|
|
724
|
+
var POPPER_OFFSET = "matrx-popper-offset";
|
|
725
|
+
var MOTION_BOTTOM_SHEET = "matrx-motion-bottom-sheet";
|
|
726
|
+
var MOTION_POPPER = "matrx-motion-popper";
|
|
727
|
+
var MOTION_SHEET = {
|
|
728
|
+
top: "matrx-motion-sheet-top",
|
|
729
|
+
bottom: "matrx-motion-sheet-bottom",
|
|
730
|
+
left: "matrx-motion-sheet-left",
|
|
731
|
+
right: "matrx-motion-sheet-right",
|
|
732
|
+
center: "matrx-motion-sheet-center"
|
|
733
|
+
};
|
|
734
|
+
var MOTION_PULSE = "matrx-pulse";
|
|
735
|
+
var MOTION_SPIN = "matrx-spin";
|
|
736
|
+
var ALL_MOTION_CLASSES = [
|
|
737
|
+
MOTION_OVERLAY,
|
|
738
|
+
MOTION_DIALOG,
|
|
739
|
+
MOTION_BOTTOM_SHEET,
|
|
740
|
+
MOTION_POPPER,
|
|
741
|
+
...Object.values(MOTION_SHEET),
|
|
742
|
+
MOTION_PULSE,
|
|
743
|
+
MOTION_SPIN
|
|
744
|
+
];
|
|
745
|
+
|
|
746
|
+
// src/portal-container.tsx
|
|
713
747
|
import * as React3 from "react";
|
|
714
|
-
import { jsx as jsx5
|
|
748
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
749
|
+
var CONTEXT_SLOT = /* @__PURE__ */ Symbol.for("ai-matrx.design-system.portal-container-context");
|
|
750
|
+
var contextRegistry = globalThis;
|
|
751
|
+
var PortalContainerContext = contextRegistry[CONTEXT_SLOT] ??= React3.createContext(void 0);
|
|
752
|
+
function PortalContainerProvider({
|
|
753
|
+
container,
|
|
754
|
+
children
|
|
755
|
+
}) {
|
|
756
|
+
return /* @__PURE__ */ jsx5(PortalContainerContext.Provider, { value: container ?? void 0, children });
|
|
757
|
+
}
|
|
758
|
+
function usePortalContainer(explicit) {
|
|
759
|
+
const injected = React3.useContext(PortalContainerContext);
|
|
760
|
+
if (explicit !== void 0) {
|
|
761
|
+
return explicit ?? void 0;
|
|
762
|
+
}
|
|
763
|
+
return injected ?? void 0;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
// src/alert-dialog.tsx
|
|
767
|
+
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
768
|
+
var AlertDialog = AlertDialogPrimitive.Root;
|
|
769
|
+
var AlertDialogPortal = ({
|
|
770
|
+
container,
|
|
771
|
+
...props
|
|
772
|
+
}) => {
|
|
773
|
+
const resolved = usePortalContainer(container);
|
|
774
|
+
return /* @__PURE__ */ jsx6(AlertDialogPrimitive.Portal, { container: resolved ?? null, ...props });
|
|
775
|
+
};
|
|
776
|
+
AlertDialogPortal.displayName = "AlertDialogPortal";
|
|
777
|
+
var AlertDialogOverlay = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx6(
|
|
778
|
+
AlertDialogPrimitive.Overlay,
|
|
779
|
+
{
|
|
780
|
+
ref,
|
|
781
|
+
"data-slot": "alert-dialog-overlay",
|
|
782
|
+
className: cn(
|
|
783
|
+
"fixed inset-0 z-[10000] bg-[var(--matrx-overlay-scrim)]",
|
|
784
|
+
MOTION_OVERLAY,
|
|
785
|
+
className
|
|
786
|
+
),
|
|
787
|
+
...props
|
|
788
|
+
}
|
|
789
|
+
));
|
|
790
|
+
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
791
|
+
var AlertDialogContentPrimitive = React4.forwardRef((props, ref) => /* @__PURE__ */ jsx6(AlertDialogPrimitive.Content, { ...props, ref, "aria-modal": "true" }));
|
|
792
|
+
AlertDialogContentPrimitive.displayName = "AlertDialogContentPrimitive";
|
|
793
|
+
var AlertDialogDescription = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx6(
|
|
794
|
+
AlertDialogPrimitive.Description,
|
|
795
|
+
{
|
|
796
|
+
ref,
|
|
797
|
+
"data-slot": "alert-dialog-description",
|
|
798
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
799
|
+
...props
|
|
800
|
+
}
|
|
801
|
+
));
|
|
802
|
+
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
|
|
803
|
+
var AlertDialogContent = React4.forwardRef(({ className, children, container, animated = true, ...props }, ref) => {
|
|
804
|
+
const hasDescription = treeContainsComponent(children, AlertDialogDescription) || treeContainsComponent(children, AlertDialogPrimitive.Description);
|
|
805
|
+
return /* @__PURE__ */ jsxs3(AlertDialogPortal, { container, children: [
|
|
806
|
+
/* @__PURE__ */ jsx6(AlertDialogOverlay, {}),
|
|
807
|
+
/* @__PURE__ */ jsxs3(
|
|
808
|
+
AlertDialogContentPrimitive,
|
|
809
|
+
{
|
|
810
|
+
ref,
|
|
811
|
+
"data-slot": "alert-dialog-content",
|
|
812
|
+
className: cn(
|
|
813
|
+
`matrx-dialog-card fixed left-[50%] top-[50%] z-[10000] grid min-w-0 w-full max-w-lg ${CENTERED_DIALOG} gap-4 border bg-background p-6 shadow-lg`,
|
|
814
|
+
// Ruling 3 — never taller than the viewport, always scrollable, and
|
|
815
|
+
// the footer stays reachable via --dialog-pad like Dialog's.
|
|
816
|
+
// Ruling 5 (0.11.3) — `matrx-dialog-card` hands the bottom padding to
|
|
817
|
+
// a sticky footer when there is one, so the footer's box matches the
|
|
818
|
+
// space the grid gave it and sticky never clamps it up over the
|
|
819
|
+
// consequence copy.
|
|
820
|
+
"max-h-[85dvh] overflow-y-auto overscroll-contain [--dialog-pad:1.5rem] overflow-x-clip [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full",
|
|
821
|
+
"sm:rounded-lg",
|
|
822
|
+
animated && MOTION_DIALOG,
|
|
823
|
+
className
|
|
824
|
+
),
|
|
825
|
+
...props,
|
|
826
|
+
children: [
|
|
827
|
+
hasDescription ? null : /* @__PURE__ */ jsx6(AlertDialogPrimitive.Description, { className: "sr-only", children: "Please confirm the action described in this dialog." }),
|
|
828
|
+
children
|
|
829
|
+
]
|
|
830
|
+
}
|
|
831
|
+
)
|
|
832
|
+
] });
|
|
833
|
+
});
|
|
834
|
+
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
835
|
+
var AlertDialogHeader = ({
|
|
836
|
+
className,
|
|
837
|
+
...props
|
|
838
|
+
}) => /* @__PURE__ */ jsx6(
|
|
839
|
+
"div",
|
|
840
|
+
{
|
|
841
|
+
"data-slot": "alert-dialog-header",
|
|
842
|
+
className: cn("flex flex-col space-y-2 text-center sm:text-left", className),
|
|
843
|
+
...props
|
|
844
|
+
}
|
|
845
|
+
);
|
|
846
|
+
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
847
|
+
var AlertDialogFooter = ({
|
|
848
|
+
className,
|
|
849
|
+
...props
|
|
850
|
+
}) => /* @__PURE__ */ jsx6(
|
|
851
|
+
"div",
|
|
852
|
+
{
|
|
853
|
+
"data-slot": "alert-dialog-footer",
|
|
854
|
+
className: cn(
|
|
855
|
+
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
856
|
+
// Ruling 3/4 — sticky to the card edges so a scrolled body never shows
|
|
857
|
+
// through under the actions, and safe-area padded on a phone.
|
|
858
|
+
//
|
|
859
|
+
// 🚨 THERE IS NO `mb-[…]` HERE, AND THERE MUST NEVER BE ONE AGAIN
|
|
860
|
+
// (0.11.3, feedback bf8fb00b). The bleed over the card's bottom padding
|
|
861
|
+
// used to be a NEGATIVE BLOCK MARGIN, which makes this box taller than
|
|
862
|
+
// the grid area the card allocates it — and `position: sticky` CLAMPS a
|
|
863
|
+
// box to its containing block, so the browser yanked the footer UP by
|
|
864
|
+
// `--dialog-pad` against the card's `gap-4` and painted 8px of opaque
|
|
865
|
+
// footer over the last line of the consequence, at every length. The
|
|
866
|
+
// card now RESERVES this footer's block size instead (`matrx-dialog-card`
|
|
867
|
+
// in styles.css hands over its `padding-bottom`), so the bleed costs no
|
|
868
|
+
// margin at all. Guard: `sticky-footer-geometry.test.tsx`.
|
|
869
|
+
//
|
|
870
|
+
// These stay UTILITIES rather than a shipped rule so a caller's
|
|
871
|
+
// `className` still wins through tailwind-merge — a shipped rule would
|
|
872
|
+
// have to be unlayered to survive Tailwind preflight (§ THE PREFLIGHT
|
|
873
|
+
// RULE in styles.css) and would then override every caller's padding.
|
|
874
|
+
"sticky bottom-0 z-10 bg-background pt-3",
|
|
875
|
+
"mx-[calc(var(--dialog-pad,0px)*-1)] px-[var(--dialog-pad,0px)] pb-[var(--dialog-pad,0px)]",
|
|
876
|
+
className
|
|
877
|
+
),
|
|
878
|
+
...props
|
|
879
|
+
}
|
|
880
|
+
);
|
|
881
|
+
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
882
|
+
var AlertDialogTitle = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx6(
|
|
883
|
+
AlertDialogPrimitive.Title,
|
|
884
|
+
{
|
|
885
|
+
ref,
|
|
886
|
+
"data-slot": "alert-dialog-title",
|
|
887
|
+
className: cn("text-lg font-semibold", className),
|
|
888
|
+
...props
|
|
889
|
+
}
|
|
890
|
+
));
|
|
891
|
+
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
892
|
+
var AlertDialogAction = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx6(
|
|
893
|
+
AlertDialogPrimitive.Action,
|
|
894
|
+
{
|
|
895
|
+
ref,
|
|
896
|
+
"data-slot": "alert-dialog-action",
|
|
897
|
+
className: cn(buttonVariants(), className),
|
|
898
|
+
...props
|
|
899
|
+
}
|
|
900
|
+
));
|
|
901
|
+
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
902
|
+
var AlertDialogCancel = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx6(
|
|
903
|
+
AlertDialogPrimitive.Cancel,
|
|
904
|
+
{
|
|
905
|
+
ref,
|
|
906
|
+
"data-slot": "alert-dialog-cancel",
|
|
907
|
+
className: cn(
|
|
908
|
+
buttonVariants({ variant: "outline" }),
|
|
909
|
+
"mt-2 sm:mt-0",
|
|
910
|
+
className
|
|
911
|
+
),
|
|
912
|
+
...props
|
|
913
|
+
}
|
|
914
|
+
));
|
|
915
|
+
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
916
|
+
|
|
917
|
+
// src/confirm-dialog.tsx
|
|
918
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
919
|
+
function ConfirmDialog({
|
|
920
|
+
open,
|
|
921
|
+
onOpenChange,
|
|
922
|
+
title,
|
|
923
|
+
description,
|
|
924
|
+
content,
|
|
925
|
+
contentClassName,
|
|
926
|
+
confirmLabel = "Confirm",
|
|
927
|
+
cancelLabel = "Cancel",
|
|
928
|
+
variant = "default",
|
|
929
|
+
busy = false,
|
|
930
|
+
confirmDisabled = false,
|
|
931
|
+
portalContainer,
|
|
932
|
+
onConfirm
|
|
933
|
+
}) {
|
|
934
|
+
return /* @__PURE__ */ jsx7(AlertDialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs4(
|
|
935
|
+
AlertDialogContent,
|
|
936
|
+
{
|
|
937
|
+
className: contentClassName,
|
|
938
|
+
...portalContainer === void 0 ? {} : { container: portalContainer },
|
|
939
|
+
children: [
|
|
940
|
+
/* @__PURE__ */ jsxs4(AlertDialogHeader, { children: [
|
|
941
|
+
/* @__PURE__ */ jsx7(AlertDialogTitle, { children: title }),
|
|
942
|
+
description ? /* @__PURE__ */ jsx7(AlertDialogDescription, { asChild: true, children: /* @__PURE__ */ jsx7("div", { children: description }) }) : null
|
|
943
|
+
] }),
|
|
944
|
+
content ?? null,
|
|
945
|
+
/* @__PURE__ */ jsxs4(AlertDialogFooter, { children: [
|
|
946
|
+
cancelLabel === null ? null : /* @__PURE__ */ jsx7(AlertDialogCancel, { className: "max-lg:min-h-11", disabled: busy, children: cancelLabel }),
|
|
947
|
+
/* @__PURE__ */ jsxs4(
|
|
948
|
+
AlertDialogAction,
|
|
949
|
+
{
|
|
950
|
+
disabled: busy || confirmDisabled,
|
|
951
|
+
onClick: (event) => {
|
|
952
|
+
event.preventDefault();
|
|
953
|
+
void onConfirm();
|
|
954
|
+
},
|
|
955
|
+
className: cn(
|
|
956
|
+
"max-lg:min-h-11",
|
|
957
|
+
// One source of button appearance: the destructive look comes
|
|
958
|
+
// from `buttonVariants`, not a second hand-written copy of it.
|
|
959
|
+
// tailwind-merge makes it WIN over the default variant classes.
|
|
960
|
+
variant === "destructive" && buttonVariants({ variant: "destructive" })
|
|
961
|
+
),
|
|
962
|
+
children: [
|
|
963
|
+
busy ? /* @__PURE__ */ jsx7(Loader2Icon, { className: cn("mr-2 h-4 w-4", MOTION_SPIN) }) : null,
|
|
964
|
+
confirmLabel
|
|
965
|
+
]
|
|
966
|
+
}
|
|
967
|
+
)
|
|
968
|
+
] })
|
|
969
|
+
]
|
|
970
|
+
}
|
|
971
|
+
) });
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
// src/input.tsx
|
|
975
|
+
import * as React5 from "react";
|
|
976
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
715
977
|
var getVariantStyles = (variant = "default") => {
|
|
716
978
|
const baseStyles = `flex h-10 w-full border border-border bg-background text-foreground shadow-input rounded-md px-3 py-2 text-sm file:border-0 file:bg-transparent
|
|
717
979
|
file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground
|
|
@@ -739,9 +1001,9 @@ var getVariantStyles = (variant = "default") => {
|
|
|
739
1001
|
return baseStyles;
|
|
740
1002
|
}
|
|
741
1003
|
};
|
|
742
|
-
var Input =
|
|
1004
|
+
var Input = React5.forwardRef(
|
|
743
1005
|
({ className, type, variant = "default", ...props }, ref) => {
|
|
744
|
-
return /* @__PURE__ */
|
|
1006
|
+
return /* @__PURE__ */ jsx8(
|
|
745
1007
|
"input",
|
|
746
1008
|
{
|
|
747
1009
|
type,
|
|
@@ -753,7 +1015,7 @@ var Input = React3.forwardRef(
|
|
|
753
1015
|
}
|
|
754
1016
|
);
|
|
755
1017
|
Input.displayName = "Input";
|
|
756
|
-
var EnterInput =
|
|
1018
|
+
var EnterInput = React5.forwardRef(
|
|
757
1019
|
({ onEnter, ...props }, ref) => {
|
|
758
1020
|
const handleKeyDown = (e) => {
|
|
759
1021
|
if (e.key === "Enter" && onEnter) {
|
|
@@ -761,7 +1023,7 @@ var EnterInput = React3.forwardRef(
|
|
|
761
1023
|
onEnter();
|
|
762
1024
|
}
|
|
763
1025
|
};
|
|
764
|
-
return /* @__PURE__ */
|
|
1026
|
+
return /* @__PURE__ */ jsx8(
|
|
765
1027
|
Input,
|
|
766
1028
|
{
|
|
767
1029
|
...props,
|
|
@@ -777,11 +1039,11 @@ var EnterInput = React3.forwardRef(
|
|
|
777
1039
|
}
|
|
778
1040
|
);
|
|
779
1041
|
EnterInput.displayName = "EnterInput";
|
|
780
|
-
var BasicInput =
|
|
1042
|
+
var BasicInput = React5.forwardRef(
|
|
781
1043
|
// `variant` is accepted (prop-compatible with Input) but intentionally
|
|
782
1044
|
// unused — and destructured so it never leaks onto the DOM element.
|
|
783
1045
|
({ className, type, variant: _variant = "default", ...props }, ref) => {
|
|
784
|
-
return /* @__PURE__ */
|
|
1046
|
+
return /* @__PURE__ */ jsx8(
|
|
785
1047
|
"input",
|
|
786
1048
|
{
|
|
787
1049
|
type,
|
|
@@ -796,10 +1058,10 @@ var BasicInput = React3.forwardRef(
|
|
|
796
1058
|
}
|
|
797
1059
|
);
|
|
798
1060
|
BasicInput.displayName = "BasicInput";
|
|
799
|
-
var InputWithPrefix =
|
|
800
|
-
return /* @__PURE__ */
|
|
801
|
-
prefix && /* @__PURE__ */
|
|
802
|
-
/* @__PURE__ */
|
|
1061
|
+
var InputWithPrefix = React5.forwardRef(({ prefix, className, wrapperClassName, ...props }, ref) => {
|
|
1062
|
+
return /* @__PURE__ */ jsxs5("div", { className: cn("relative", wrapperClassName), children: [
|
|
1063
|
+
prefix && /* @__PURE__ */ jsx8("div", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground", children: prefix }),
|
|
1064
|
+
/* @__PURE__ */ jsx8(
|
|
803
1065
|
Input,
|
|
804
1066
|
{
|
|
805
1067
|
ref,
|
|
@@ -811,36 +1073,10 @@ var InputWithPrefix = React3.forwardRef(({ prefix, className, wrapperClassName,
|
|
|
811
1073
|
});
|
|
812
1074
|
InputWithPrefix.displayName = "InputWithPrefix";
|
|
813
1075
|
|
|
814
|
-
// src/motion.ts
|
|
815
|
-
var MOTION_OVERLAY = "matrx-motion-overlay";
|
|
816
|
-
var MOTION_DIALOG = "matrx-motion-dialog";
|
|
817
|
-
var CENTERED_DIALOG = "matrx-dialog-centered";
|
|
818
|
-
var POPPER_OFFSET = "matrx-popper-offset";
|
|
819
|
-
var MOTION_BOTTOM_SHEET = "matrx-motion-bottom-sheet";
|
|
820
|
-
var MOTION_POPPER = "matrx-motion-popper";
|
|
821
|
-
var MOTION_SHEET = {
|
|
822
|
-
top: "matrx-motion-sheet-top",
|
|
823
|
-
bottom: "matrx-motion-sheet-bottom",
|
|
824
|
-
left: "matrx-motion-sheet-left",
|
|
825
|
-
right: "matrx-motion-sheet-right",
|
|
826
|
-
center: "matrx-motion-sheet-center"
|
|
827
|
-
};
|
|
828
|
-
var MOTION_PULSE = "matrx-pulse";
|
|
829
|
-
var MOTION_SPIN = "matrx-spin";
|
|
830
|
-
var ALL_MOTION_CLASSES = [
|
|
831
|
-
MOTION_OVERLAY,
|
|
832
|
-
MOTION_DIALOG,
|
|
833
|
-
MOTION_BOTTOM_SHEET,
|
|
834
|
-
MOTION_POPPER,
|
|
835
|
-
...Object.values(MOTION_SHEET),
|
|
836
|
-
MOTION_PULSE,
|
|
837
|
-
MOTION_SPIN
|
|
838
|
-
];
|
|
839
|
-
|
|
840
1076
|
// src/skeleton.tsx
|
|
841
|
-
import { jsx as
|
|
1077
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
842
1078
|
function Skeleton({ className, animated = true, ...props }) {
|
|
843
|
-
return /* @__PURE__ */
|
|
1079
|
+
return /* @__PURE__ */ jsx9(
|
|
844
1080
|
"div",
|
|
845
1081
|
{
|
|
846
1082
|
"data-slot": "skeleton",
|
|
@@ -1053,52 +1289,32 @@ function useScrollPagination({
|
|
|
1053
1289
|
// src/dialog.tsx
|
|
1054
1290
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
1055
1291
|
import * as VisuallyHidden from "@radix-ui/react-visually-hidden";
|
|
1056
|
-
import { treeContainsComponent } from "@ai-matrx/kit/react-tree";
|
|
1057
|
-
import * as
|
|
1058
|
-
|
|
1059
|
-
// src/portal-container.tsx
|
|
1060
|
-
import * as React4 from "react";
|
|
1061
|
-
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
1062
|
-
var CONTEXT_SLOT = /* @__PURE__ */ Symbol.for("ai-matrx.design-system.portal-container-context");
|
|
1063
|
-
var contextRegistry = globalThis;
|
|
1064
|
-
var PortalContainerContext = contextRegistry[CONTEXT_SLOT] ??= React4.createContext(void 0);
|
|
1065
|
-
function PortalContainerProvider({
|
|
1066
|
-
container,
|
|
1067
|
-
children
|
|
1068
|
-
}) {
|
|
1069
|
-
return /* @__PURE__ */ jsx7(PortalContainerContext.Provider, { value: container ?? void 0, children });
|
|
1070
|
-
}
|
|
1071
|
-
function usePortalContainer(explicit) {
|
|
1072
|
-
const injected = React4.useContext(PortalContainerContext);
|
|
1073
|
-
if (explicit !== void 0) {
|
|
1074
|
-
return explicit ?? void 0;
|
|
1075
|
-
}
|
|
1076
|
-
return injected ?? void 0;
|
|
1077
|
-
}
|
|
1292
|
+
import { treeContainsComponent as treeContainsComponent2 } from "@ai-matrx/kit/react-tree";
|
|
1293
|
+
import * as React8 from "react";
|
|
1078
1294
|
|
|
1079
1295
|
// src/radix-dialog-modal-context.tsx
|
|
1080
|
-
import * as
|
|
1081
|
-
import { jsx as
|
|
1296
|
+
import * as React6 from "react";
|
|
1297
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1082
1298
|
var CONTEXT_SLOT2 = /* @__PURE__ */ Symbol.for("ai-matrx.design-system.dialog-modal-context");
|
|
1083
1299
|
var contextRegistry2 = globalThis;
|
|
1084
|
-
var RadixDialogModalContext = contextRegistry2[CONTEXT_SLOT2] ??=
|
|
1300
|
+
var RadixDialogModalContext = contextRegistry2[CONTEXT_SLOT2] ??= React6.createContext(true);
|
|
1085
1301
|
function RadixDialogModalProvider({
|
|
1086
1302
|
children,
|
|
1087
1303
|
modal
|
|
1088
1304
|
}) {
|
|
1089
|
-
return /* @__PURE__ */
|
|
1305
|
+
return /* @__PURE__ */ jsx10(RadixDialogModalContext.Provider, { value: modal, children });
|
|
1090
1306
|
}
|
|
1091
1307
|
function useRadixDialogModal() {
|
|
1092
|
-
return
|
|
1308
|
+
return React6.useContext(RadixDialogModalContext);
|
|
1093
1309
|
}
|
|
1094
1310
|
|
|
1095
1311
|
// src/use-is-mobile.ts
|
|
1096
|
-
import * as
|
|
1312
|
+
import * as React7 from "react";
|
|
1097
1313
|
var MOBILE_BREAKPOINT = 768;
|
|
1098
1314
|
function useIsMobile() {
|
|
1099
|
-
const [isMobile, setIsMobile] =
|
|
1100
|
-
const [hasMounted, setHasMounted] =
|
|
1101
|
-
|
|
1315
|
+
const [isMobile, setIsMobile] = React7.useState(false);
|
|
1316
|
+
const [hasMounted, setHasMounted] = React7.useState(false);
|
|
1317
|
+
React7.useEffect(() => {
|
|
1102
1318
|
setHasMounted(true);
|
|
1103
1319
|
const onChange = () => {
|
|
1104
1320
|
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
@@ -1118,13 +1334,13 @@ function useIsMobile() {
|
|
|
1118
1334
|
}
|
|
1119
1335
|
|
|
1120
1336
|
// src/dialog.tsx
|
|
1121
|
-
import { jsx as
|
|
1337
|
+
import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1122
1338
|
var Dialog = ({
|
|
1123
1339
|
children,
|
|
1124
1340
|
...props
|
|
1125
1341
|
}) => {
|
|
1126
1342
|
const modal = props.modal ?? true;
|
|
1127
|
-
return /* @__PURE__ */
|
|
1343
|
+
return /* @__PURE__ */ jsx11(RadixDialogModalProvider, { modal, children: /* @__PURE__ */ jsx11(DialogPrimitive.Root, { ...props, modal, children }) });
|
|
1128
1344
|
};
|
|
1129
1345
|
Dialog.displayName = "Dialog";
|
|
1130
1346
|
var DialogPortal = ({
|
|
@@ -1132,13 +1348,13 @@ var DialogPortal = ({
|
|
|
1132
1348
|
...props
|
|
1133
1349
|
}) => {
|
|
1134
1350
|
const resolved = usePortalContainer(container);
|
|
1135
|
-
return /* @__PURE__ */
|
|
1351
|
+
return /* @__PURE__ */ jsx11(DialogPrimitive.Portal, { container: resolved ?? null, ...props });
|
|
1136
1352
|
};
|
|
1137
1353
|
DialogPortal.displayName = "DialogPortal";
|
|
1138
1354
|
var CONTEXT_SLOT3 = /* @__PURE__ */ Symbol.for("ai-matrx.design-system.dialog-container-context");
|
|
1139
1355
|
var contextRegistry3 = globalThis;
|
|
1140
|
-
var DialogContainerContext = contextRegistry3[CONTEXT_SLOT3] ??=
|
|
1141
|
-
var DialogOverlay =
|
|
1356
|
+
var DialogContainerContext = contextRegistry3[CONTEXT_SLOT3] ??= React8.createContext(null);
|
|
1357
|
+
var DialogOverlay = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
1142
1358
|
DialogPrimitive.Overlay,
|
|
1143
1359
|
{
|
|
1144
1360
|
ref,
|
|
@@ -1154,9 +1370,9 @@ var DialogOverlay = React7.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
1154
1370
|
}
|
|
1155
1371
|
));
|
|
1156
1372
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
1157
|
-
var DialogContentPrimitive =
|
|
1373
|
+
var DialogContentPrimitive = React8.forwardRef((props, ref) => {
|
|
1158
1374
|
const isModal = useRadixDialogModal();
|
|
1159
|
-
return /* @__PURE__ */
|
|
1375
|
+
return /* @__PURE__ */ jsx11(
|
|
1160
1376
|
DialogPrimitive.Content,
|
|
1161
1377
|
{
|
|
1162
1378
|
...props,
|
|
@@ -1169,7 +1385,7 @@ DialogContentPrimitive.displayName = "DialogContentPrimitive";
|
|
|
1169
1385
|
var DIALOG_DESKTOP_CLASSES = "matrx-dialog-card fixed inset-0 z-[10000] m-auto grid h-fit min-w-0 w-full max-w-lg gap-4 max-h-[85dvh] overflow-y-auto overscroll-contain [--dialog-pad:1.5rem] overflow-x-clip border bg-background p-6 shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full sm:rounded-lg";
|
|
1170
1386
|
var DIALOG_MOBILE_SHEET_CLASSES = "matrx-mobile-sheet matrx-dialog-card fixed inset-x-0 bottom-0 left-0 right-0 top-auto z-[10000] flex min-w-0 flex-col w-full max-w-full max-h-[90dvh] gap-4 [--dialog-pad:1rem] overflow-x-clip border-t bg-background p-4 pb-safe shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full rounded-t-2xl rounded-b-none overflow-y-auto overscroll-contain";
|
|
1171
1387
|
var DIALOG_MOBILE_SHEET_OVERRIDE = "inset-x-0 bottom-0 left-0 right-0 top-auto translate-none w-full max-w-full max-h-[90dvh] rounded-b-none rounded-t-2xl overflow-y-auto";
|
|
1172
|
-
var DialogContent =
|
|
1388
|
+
var DialogContent = React8.forwardRef(
|
|
1173
1389
|
({
|
|
1174
1390
|
className,
|
|
1175
1391
|
children,
|
|
@@ -1183,10 +1399,10 @@ var DialogContent = React7.forwardRef(
|
|
|
1183
1399
|
const isModal = useRadixDialogModal();
|
|
1184
1400
|
const injectedContainer = usePortalContainer(container);
|
|
1185
1401
|
const asSheet = mobileSheet && isMobile;
|
|
1186
|
-
const [containerEl, setContainerEl] =
|
|
1402
|
+
const [containerEl, setContainerEl] = React8.useState(
|
|
1187
1403
|
null
|
|
1188
1404
|
);
|
|
1189
|
-
const mergedRef =
|
|
1405
|
+
const mergedRef = React8.useCallback(
|
|
1190
1406
|
(node) => {
|
|
1191
1407
|
setContainerEl(node);
|
|
1192
1408
|
if (typeof ref === "function") ref(node);
|
|
@@ -1195,11 +1411,11 @@ var DialogContent = React7.forwardRef(
|
|
|
1195
1411
|
},
|
|
1196
1412
|
[ref]
|
|
1197
1413
|
);
|
|
1198
|
-
const hasTitle =
|
|
1199
|
-
const hasDescription =
|
|
1200
|
-
return /* @__PURE__ */
|
|
1201
|
-
isModal ? /* @__PURE__ */
|
|
1202
|
-
/* @__PURE__ */
|
|
1414
|
+
const hasTitle = treeContainsComponent2(children, DialogTitle) || treeContainsComponent2(children, DialogPrimitive.Title);
|
|
1415
|
+
const hasDescription = treeContainsComponent2(children, DialogDescription) || treeContainsComponent2(children, DialogPrimitive.Description);
|
|
1416
|
+
return /* @__PURE__ */ jsxs6(DialogPortal, { container, children: [
|
|
1417
|
+
isModal ? /* @__PURE__ */ jsx11(DialogOverlay, {}) : null,
|
|
1418
|
+
/* @__PURE__ */ jsxs6(
|
|
1203
1419
|
DialogContentPrimitive,
|
|
1204
1420
|
{
|
|
1205
1421
|
ref: mergedRef,
|
|
@@ -1218,23 +1434,23 @@ var DialogContent = React7.forwardRef(
|
|
|
1218
1434
|
...hasDescription ? {} : { "aria-describedby": void 0 },
|
|
1219
1435
|
...props,
|
|
1220
1436
|
children: [
|
|
1221
|
-
hasTitle ? null : /* @__PURE__ */
|
|
1222
|
-
/* @__PURE__ */
|
|
1437
|
+
hasTitle ? null : /* @__PURE__ */ jsx11(VisuallyHidden.Root, { children: /* @__PURE__ */ jsx11(DialogPrimitive.Title, { children: "Dialog" }) }),
|
|
1438
|
+
/* @__PURE__ */ jsx11(DialogContainerContext.Provider, { value: containerEl, children: /* @__PURE__ */ jsx11(
|
|
1223
1439
|
PortalContainerProvider,
|
|
1224
1440
|
{
|
|
1225
1441
|
container: containerEl ?? injectedContainer ?? null,
|
|
1226
1442
|
children
|
|
1227
1443
|
}
|
|
1228
1444
|
) }),
|
|
1229
|
-
showCloseButton ? /* @__PURE__ */
|
|
1445
|
+
showCloseButton ? /* @__PURE__ */ jsxs6(
|
|
1230
1446
|
DialogPrimitive.Close,
|
|
1231
1447
|
{
|
|
1232
1448
|
"data-slot": "dialog-close",
|
|
1233
1449
|
"aria-label": "Close",
|
|
1234
1450
|
className: "absolute right-2 top-4 flex h-11 w-11 items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground sm:right-4 lg:h-10 lg:w-10",
|
|
1235
1451
|
children: [
|
|
1236
|
-
/* @__PURE__ */
|
|
1237
|
-
/* @__PURE__ */
|
|
1452
|
+
/* @__PURE__ */ jsx11(XIcon, { className: "h-4 w-4" }),
|
|
1453
|
+
/* @__PURE__ */ jsx11("span", { className: "sr-only", children: "Close" })
|
|
1238
1454
|
]
|
|
1239
1455
|
}
|
|
1240
1456
|
) : null
|
|
@@ -1248,7 +1464,7 @@ DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
|
1248
1464
|
var DialogHeader = ({
|
|
1249
1465
|
className,
|
|
1250
1466
|
...props
|
|
1251
|
-
}) => /* @__PURE__ */
|
|
1467
|
+
}) => /* @__PURE__ */ jsx11(
|
|
1252
1468
|
"div",
|
|
1253
1469
|
{
|
|
1254
1470
|
"data-slot": "dialog-header",
|
|
@@ -1265,7 +1481,7 @@ DialogHeader.displayName = "DialogHeader";
|
|
|
1265
1481
|
var DialogFooter = ({
|
|
1266
1482
|
className,
|
|
1267
1483
|
...props
|
|
1268
|
-
}) => /* @__PURE__ */
|
|
1484
|
+
}) => /* @__PURE__ */ jsx11(
|
|
1269
1485
|
"div",
|
|
1270
1486
|
{
|
|
1271
1487
|
"data-slot": "dialog-footer",
|
|
@@ -1297,7 +1513,7 @@ var DialogFooter = ({
|
|
|
1297
1513
|
}
|
|
1298
1514
|
);
|
|
1299
1515
|
DialogFooter.displayName = "DialogFooter";
|
|
1300
|
-
var DialogTitle =
|
|
1516
|
+
var DialogTitle = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
1301
1517
|
DialogPrimitive.Title,
|
|
1302
1518
|
{
|
|
1303
1519
|
ref,
|
|
@@ -1307,7 +1523,7 @@ var DialogTitle = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
1307
1523
|
}
|
|
1308
1524
|
));
|
|
1309
1525
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
1310
|
-
var DialogDescription =
|
|
1526
|
+
var DialogDescription = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
1311
1527
|
DialogPrimitive.Description,
|
|
1312
1528
|
{
|
|
1313
1529
|
ref,
|
|
@@ -1320,13 +1536,13 @@ DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
|
1320
1536
|
|
|
1321
1537
|
// src/sheet.tsx
|
|
1322
1538
|
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
1323
|
-
import { treeContainsComponent as
|
|
1539
|
+
import { treeContainsComponent as treeContainsComponent3 } from "@ai-matrx/kit/react-tree";
|
|
1324
1540
|
import { cva as cva2 } from "class-variance-authority";
|
|
1325
|
-
import * as
|
|
1326
|
-
import { jsx as
|
|
1327
|
-
var SheetContentBase =
|
|
1541
|
+
import * as React9 from "react";
|
|
1542
|
+
import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1543
|
+
var SheetContentBase = React9.forwardRef(({ ...props }, ref) => {
|
|
1328
1544
|
const isModal = useRadixDialogModal();
|
|
1329
|
-
return /* @__PURE__ */
|
|
1545
|
+
return /* @__PURE__ */ jsx12(
|
|
1330
1546
|
SheetPrimitive.Content,
|
|
1331
1547
|
{
|
|
1332
1548
|
...props,
|
|
@@ -1336,13 +1552,13 @@ var SheetContentBase = React8.forwardRef(({ ...props }, ref) => {
|
|
|
1336
1552
|
);
|
|
1337
1553
|
});
|
|
1338
1554
|
SheetContentBase.displayName = "SheetContentBase";
|
|
1339
|
-
var Sheet =
|
|
1555
|
+
var Sheet = React9.forwardRef(({ children, ...props }, _ref) => {
|
|
1340
1556
|
const modal = props.modal ?? true;
|
|
1341
|
-
return /* @__PURE__ */
|
|
1557
|
+
return /* @__PURE__ */ jsx12(RadixDialogModalProvider, { modal, children: /* @__PURE__ */ jsx12(SheetPrimitive.Root, { ...props, modal, children }) });
|
|
1342
1558
|
});
|
|
1343
1559
|
Sheet.displayName = "Sheet";
|
|
1344
1560
|
var SheetPortal = SheetPrimitive.Portal;
|
|
1345
|
-
var SheetOverlay =
|
|
1561
|
+
var SheetOverlay = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx12(
|
|
1346
1562
|
SheetPrimitive.Overlay,
|
|
1347
1563
|
{
|
|
1348
1564
|
className: cn(
|
|
@@ -1379,7 +1595,7 @@ var sheetVariants = cva2(
|
|
|
1379
1595
|
}
|
|
1380
1596
|
}
|
|
1381
1597
|
);
|
|
1382
|
-
var SheetDescription =
|
|
1598
|
+
var SheetDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx12(
|
|
1383
1599
|
SheetPrimitive.Description,
|
|
1384
1600
|
{
|
|
1385
1601
|
ref,
|
|
@@ -1388,7 +1604,7 @@ var SheetDescription = React8.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
1388
1604
|
}
|
|
1389
1605
|
));
|
|
1390
1606
|
SheetDescription.displayName = SheetPrimitive.Description.displayName;
|
|
1391
|
-
var SheetContent =
|
|
1607
|
+
var SheetContent = React9.forwardRef(
|
|
1392
1608
|
({
|
|
1393
1609
|
side = "right",
|
|
1394
1610
|
className,
|
|
@@ -1399,10 +1615,10 @@ var SheetContent = React8.forwardRef(
|
|
|
1399
1615
|
animated = true,
|
|
1400
1616
|
...props
|
|
1401
1617
|
}, ref) => {
|
|
1402
|
-
const hasDescription =
|
|
1403
|
-
return /* @__PURE__ */
|
|
1404
|
-
!hideOverlay && /* @__PURE__ */
|
|
1405
|
-
/* @__PURE__ */
|
|
1618
|
+
const hasDescription = treeContainsComponent3(children, SheetDescription) || treeContainsComponent3(children, SheetPrimitive.Description);
|
|
1619
|
+
return /* @__PURE__ */ jsxs7(SheetPortal, { children: [
|
|
1620
|
+
!hideOverlay && /* @__PURE__ */ jsx12(SheetOverlay, { className: overlayClassName }),
|
|
1621
|
+
/* @__PURE__ */ jsxs7(
|
|
1406
1622
|
SheetContentBase,
|
|
1407
1623
|
{
|
|
1408
1624
|
ref,
|
|
@@ -1414,9 +1630,9 @@ var SheetContent = React8.forwardRef(
|
|
|
1414
1630
|
...hasDescription ? {} : { "aria-describedby": void 0 },
|
|
1415
1631
|
...props,
|
|
1416
1632
|
children: [
|
|
1417
|
-
!hideCloseButton && /* @__PURE__ */
|
|
1418
|
-
/* @__PURE__ */
|
|
1419
|
-
/* @__PURE__ */
|
|
1633
|
+
!hideCloseButton && /* @__PURE__ */ jsxs7(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
|
|
1634
|
+
/* @__PURE__ */ jsx12(Cross2Icon, { className: "h-4 w-4" }),
|
|
1635
|
+
/* @__PURE__ */ jsx12("span", { className: "sr-only", children: "Close" })
|
|
1420
1636
|
] }),
|
|
1421
1637
|
children
|
|
1422
1638
|
]
|
|
@@ -1429,7 +1645,7 @@ SheetContent.displayName = SheetPrimitive.Content.displayName;
|
|
|
1429
1645
|
var SheetHeader = ({
|
|
1430
1646
|
className,
|
|
1431
1647
|
...props
|
|
1432
|
-
}) => /* @__PURE__ */
|
|
1648
|
+
}) => /* @__PURE__ */ jsx12(
|
|
1433
1649
|
"div",
|
|
1434
1650
|
{
|
|
1435
1651
|
className: cn(
|
|
@@ -1443,7 +1659,7 @@ SheetHeader.displayName = "SheetHeader";
|
|
|
1443
1659
|
var SheetFooter = ({
|
|
1444
1660
|
className,
|
|
1445
1661
|
...props
|
|
1446
|
-
}) => /* @__PURE__ */
|
|
1662
|
+
}) => /* @__PURE__ */ jsx12(
|
|
1447
1663
|
"div",
|
|
1448
1664
|
{
|
|
1449
1665
|
"data-slot": "sheet-footer",
|
|
@@ -1455,7 +1671,7 @@ var SheetFooter = ({
|
|
|
1455
1671
|
}
|
|
1456
1672
|
);
|
|
1457
1673
|
SheetFooter.displayName = "SheetFooter";
|
|
1458
|
-
var SheetTitle =
|
|
1674
|
+
var SheetTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx12(
|
|
1459
1675
|
SheetPrimitive.Title,
|
|
1460
1676
|
{
|
|
1461
1677
|
ref,
|
|
@@ -1466,33 +1682,33 @@ var SheetTitle = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
1466
1682
|
SheetTitle.displayName = SheetPrimitive.Title.displayName;
|
|
1467
1683
|
|
|
1468
1684
|
// src/data-table/default-host.tsx
|
|
1469
|
-
import { jsx as
|
|
1685
|
+
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1470
1686
|
function DefaultTableLink(props) {
|
|
1471
|
-
return /* @__PURE__ */
|
|
1687
|
+
return /* @__PURE__ */ jsx13("a", { ...props });
|
|
1472
1688
|
}
|
|
1473
1689
|
function DefaultTableSidePanel({ title, titleNode, description, defaultWidth = 480, onClose, headerActions, children }) {
|
|
1474
|
-
return /* @__PURE__ */
|
|
1690
|
+
return /* @__PURE__ */ jsx13(Sheet, { open: true, onOpenChange: (open) => {
|
|
1475
1691
|
if (!open) onClose();
|
|
1476
|
-
}, children: /* @__PURE__ */
|
|
1477
|
-
/* @__PURE__ */
|
|
1478
|
-
/* @__PURE__ */
|
|
1479
|
-
description ? /* @__PURE__ */
|
|
1692
|
+
}, children: /* @__PURE__ */ jsxs8(SheetContent, { side: "right", className: "flex h-full flex-col", style: { width: `min(${defaultWidth}px, 100vw)` }, children: [
|
|
1693
|
+
/* @__PURE__ */ jsxs8(SheetHeader, { children: [
|
|
1694
|
+
/* @__PURE__ */ jsx13(SheetTitle, { children: titleNode ?? title }),
|
|
1695
|
+
description ? /* @__PURE__ */ jsx13(SheetDescription, { children: description }) : null,
|
|
1480
1696
|
headerActions
|
|
1481
1697
|
] }),
|
|
1482
|
-
/* @__PURE__ */
|
|
1698
|
+
/* @__PURE__ */ jsx13("div", { className: "min-h-0 flex-1 overflow-auto", children })
|
|
1483
1699
|
] }) });
|
|
1484
1700
|
}
|
|
1485
1701
|
function DefaultTableWindow({ title, onClose, width = 720, height = 560, actionsRight, sidebar, children }) {
|
|
1486
|
-
return /* @__PURE__ */
|
|
1702
|
+
return /* @__PURE__ */ jsx13(Dialog, { open: true, onOpenChange: (open) => {
|
|
1487
1703
|
if (!open) onClose();
|
|
1488
|
-
}, children: /* @__PURE__ */
|
|
1489
|
-
/* @__PURE__ */
|
|
1490
|
-
/* @__PURE__ */
|
|
1704
|
+
}, children: /* @__PURE__ */ jsxs8(DialogContent, { className: "flex flex-col overflow-hidden", style: { width: `min(${width}px, calc(100vw - 2rem))`, height: `min(${height}px, 85dvh)` }, children: [
|
|
1705
|
+
/* @__PURE__ */ jsxs8(DialogHeader, { children: [
|
|
1706
|
+
/* @__PURE__ */ jsx13(DialogTitle, { children: title }),
|
|
1491
1707
|
actionsRight
|
|
1492
1708
|
] }),
|
|
1493
|
-
/* @__PURE__ */
|
|
1494
|
-
sidebar ? /* @__PURE__ */
|
|
1495
|
-
/* @__PURE__ */
|
|
1709
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex min-h-0 flex-1", children: [
|
|
1710
|
+
sidebar ? /* @__PURE__ */ jsx13("aside", { className: "shrink-0 border-r pr-2", children: sidebar }) : null,
|
|
1711
|
+
/* @__PURE__ */ jsx13("div", { className: "min-h-0 min-w-0 flex-1 overflow-auto", children })
|
|
1496
1712
|
] })
|
|
1497
1713
|
] }) });
|
|
1498
1714
|
}
|
|
@@ -1502,19 +1718,19 @@ import { useState as useState4 } from "react";
|
|
|
1502
1718
|
|
|
1503
1719
|
// src/data-table/host.tsx
|
|
1504
1720
|
import { createContext as createContext4, useContext as useContext4 } from "react";
|
|
1505
|
-
import { jsx as
|
|
1721
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1506
1722
|
var HOST_SLOT = /* @__PURE__ */ Symbol.for("ai-matrx.design-system.table-host-context");
|
|
1507
1723
|
var hostRegistry = globalThis;
|
|
1508
1724
|
var HostContext = hostRegistry[HOST_SLOT] ??= createContext4({});
|
|
1509
1725
|
function MatrxDataTableProvider({ value, children }) {
|
|
1510
|
-
return /* @__PURE__ */
|
|
1726
|
+
return /* @__PURE__ */ jsx14(HostContext.Provider, { value, children });
|
|
1511
1727
|
}
|
|
1512
1728
|
function useMatrxDataTableHost() {
|
|
1513
1729
|
return useContext4(HostContext);
|
|
1514
1730
|
}
|
|
1515
1731
|
|
|
1516
1732
|
// src/data-table/useTableNotice.tsx
|
|
1517
|
-
import { jsx as
|
|
1733
|
+
import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1518
1734
|
function useTableNotice() {
|
|
1519
1735
|
const host = useMatrxDataTableHost();
|
|
1520
1736
|
const [message, setMessage] = useState4(null);
|
|
@@ -1528,9 +1744,9 @@ function useTableNotice() {
|
|
|
1528
1744
|
else setMessage({ text, error: true });
|
|
1529
1745
|
}
|
|
1530
1746
|
};
|
|
1531
|
-
const notice = message ? /* @__PURE__ */
|
|
1747
|
+
const notice = message ? /* @__PURE__ */ jsxs9("span", { role: message.error ? "alert" : "status", className: message.error ? "text-xs text-destructive" : "text-xs text-muted-foreground", children: [
|
|
1532
1748
|
message.text,
|
|
1533
|
-
/* @__PURE__ */
|
|
1749
|
+
/* @__PURE__ */ jsx15("button", { type: "button", "aria-label": "Dismiss notification", className: "ml-2 underline", onClick: () => setMessage(null), children: "Dismiss" })
|
|
1534
1750
|
] }) : null;
|
|
1535
1751
|
return { notify, notice };
|
|
1536
1752
|
}
|
|
@@ -1538,8 +1754,8 @@ function useTableNotice() {
|
|
|
1538
1754
|
// src/select.tsx
|
|
1539
1755
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
1540
1756
|
import { cva as cva3 } from "class-variance-authority";
|
|
1541
|
-
import * as
|
|
1542
|
-
import { jsx as
|
|
1757
|
+
import * as React10 from "react";
|
|
1758
|
+
import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1543
1759
|
var Select = SelectPrimitive.Root;
|
|
1544
1760
|
var SelectValue = SelectPrimitive.Value;
|
|
1545
1761
|
var selectTriggerVariants = cva3(
|
|
@@ -1557,7 +1773,7 @@ var selectTriggerVariants = cva3(
|
|
|
1557
1773
|
}
|
|
1558
1774
|
}
|
|
1559
1775
|
);
|
|
1560
|
-
var SelectTrigger =
|
|
1776
|
+
var SelectTrigger = React10.forwardRef(({ className, children, hideArrow = false, size, ...props }, ref) => /* @__PURE__ */ jsxs10(
|
|
1561
1777
|
SelectPrimitive.Trigger,
|
|
1562
1778
|
{
|
|
1563
1779
|
ref,
|
|
@@ -1565,12 +1781,12 @@ var SelectTrigger = React9.forwardRef(({ className, children, hideArrow = false,
|
|
|
1565
1781
|
...props,
|
|
1566
1782
|
children: [
|
|
1567
1783
|
children,
|
|
1568
|
-
!hideArrow && /* @__PURE__ */
|
|
1784
|
+
!hideArrow && /* @__PURE__ */ jsx16(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx16(RadixChevronDownIcon, { className: "h-4 w-4 opacity-50" }) })
|
|
1569
1785
|
]
|
|
1570
1786
|
}
|
|
1571
1787
|
));
|
|
1572
1788
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
1573
|
-
var SelectScrollUpButton =
|
|
1789
|
+
var SelectScrollUpButton = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx16(
|
|
1574
1790
|
SelectPrimitive.ScrollUpButton,
|
|
1575
1791
|
{
|
|
1576
1792
|
ref,
|
|
@@ -1579,11 +1795,11 @@ var SelectScrollUpButton = React9.forwardRef(({ className, ...props }, ref) => /
|
|
|
1579
1795
|
className
|
|
1580
1796
|
),
|
|
1581
1797
|
...props,
|
|
1582
|
-
children: /* @__PURE__ */
|
|
1798
|
+
children: /* @__PURE__ */ jsx16(RadixChevronUpIcon, {})
|
|
1583
1799
|
}
|
|
1584
1800
|
));
|
|
1585
1801
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
1586
|
-
var SelectScrollDownButton =
|
|
1802
|
+
var SelectScrollDownButton = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx16(
|
|
1587
1803
|
SelectPrimitive.ScrollDownButton,
|
|
1588
1804
|
{
|
|
1589
1805
|
ref,
|
|
@@ -1592,11 +1808,11 @@ var SelectScrollDownButton = React9.forwardRef(({ className, ...props }, ref) =>
|
|
|
1592
1808
|
className
|
|
1593
1809
|
),
|
|
1594
1810
|
...props,
|
|
1595
|
-
children: /* @__PURE__ */
|
|
1811
|
+
children: /* @__PURE__ */ jsx16(RadixChevronDownIcon, {})
|
|
1596
1812
|
}
|
|
1597
1813
|
));
|
|
1598
1814
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
1599
|
-
var SelectContent =
|
|
1815
|
+
var SelectContent = React10.forwardRef(
|
|
1600
1816
|
({
|
|
1601
1817
|
className,
|
|
1602
1818
|
children,
|
|
@@ -1606,7 +1822,7 @@ var SelectContent = React9.forwardRef(
|
|
|
1606
1822
|
...props
|
|
1607
1823
|
}, ref) => {
|
|
1608
1824
|
const portalContainer = usePortalContainer(container);
|
|
1609
|
-
return /* @__PURE__ */
|
|
1825
|
+
return /* @__PURE__ */ jsx16(SelectPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxs10(
|
|
1610
1826
|
SelectPrimitive.Content,
|
|
1611
1827
|
{
|
|
1612
1828
|
ref,
|
|
@@ -1624,8 +1840,8 @@ var SelectContent = React9.forwardRef(
|
|
|
1624
1840
|
position,
|
|
1625
1841
|
...props,
|
|
1626
1842
|
children: [
|
|
1627
|
-
/* @__PURE__ */
|
|
1628
|
-
/* @__PURE__ */
|
|
1843
|
+
/* @__PURE__ */ jsx16(SelectScrollUpButton, {}),
|
|
1844
|
+
/* @__PURE__ */ jsx16(
|
|
1629
1845
|
SelectPrimitive.Viewport,
|
|
1630
1846
|
{
|
|
1631
1847
|
className: cn(
|
|
@@ -1635,14 +1851,14 @@ var SelectContent = React9.forwardRef(
|
|
|
1635
1851
|
children
|
|
1636
1852
|
}
|
|
1637
1853
|
),
|
|
1638
|
-
/* @__PURE__ */
|
|
1854
|
+
/* @__PURE__ */ jsx16(SelectScrollDownButton, {})
|
|
1639
1855
|
]
|
|
1640
1856
|
}
|
|
1641
1857
|
) });
|
|
1642
1858
|
}
|
|
1643
1859
|
);
|
|
1644
1860
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
1645
|
-
var SelectLabel =
|
|
1861
|
+
var SelectLabel = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx16(
|
|
1646
1862
|
SelectPrimitive.Label,
|
|
1647
1863
|
{
|
|
1648
1864
|
ref,
|
|
@@ -1651,7 +1867,7 @@ var SelectLabel = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
1651
1867
|
}
|
|
1652
1868
|
));
|
|
1653
1869
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
1654
|
-
var SelectItem =
|
|
1870
|
+
var SelectItem = React10.forwardRef(({ className, children, description, ...props }, ref) => /* @__PURE__ */ jsxs10(
|
|
1655
1871
|
SelectPrimitive.Item,
|
|
1656
1872
|
{
|
|
1657
1873
|
ref,
|
|
@@ -1662,14 +1878,14 @@ var SelectItem = React9.forwardRef(({ className, children, description, ...props
|
|
|
1662
1878
|
),
|
|
1663
1879
|
...props,
|
|
1664
1880
|
children: [
|
|
1665
|
-
/* @__PURE__ */
|
|
1666
|
-
/* @__PURE__ */
|
|
1667
|
-
description ? /* @__PURE__ */
|
|
1881
|
+
/* @__PURE__ */ jsx16("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx16(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx16(CheckIcon, { className: "h-4 w-4" }) }) }),
|
|
1882
|
+
/* @__PURE__ */ jsx16(SelectPrimitive.ItemText, { children }),
|
|
1883
|
+
description ? /* @__PURE__ */ jsx16("span", { className: "block text-xs leading-snug text-muted-foreground", children: description }) : null
|
|
1668
1884
|
]
|
|
1669
1885
|
}
|
|
1670
1886
|
));
|
|
1671
1887
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
1672
|
-
var SelectSeparator =
|
|
1888
|
+
var SelectSeparator = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx16(
|
|
1673
1889
|
SelectPrimitive.Separator,
|
|
1674
1890
|
{
|
|
1675
1891
|
ref,
|
|
@@ -1680,7 +1896,7 @@ var SelectSeparator = React9.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
1680
1896
|
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
1681
1897
|
|
|
1682
1898
|
// src/data-table/pagination.tsx
|
|
1683
|
-
import { Fragment, jsx as
|
|
1899
|
+
import { Fragment, jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1684
1900
|
function GenericTablePagination({
|
|
1685
1901
|
totalItems,
|
|
1686
1902
|
itemsPerPage,
|
|
@@ -1739,8 +1955,8 @@ function GenericTablePagination({
|
|
|
1739
1955
|
className,
|
|
1740
1956
|
containerClassName
|
|
1741
1957
|
);
|
|
1742
|
-
return /* @__PURE__ */
|
|
1743
|
-
showItemsPerPageSelect && /* @__PURE__ */
|
|
1958
|
+
return /* @__PURE__ */ jsxs11("div", { "data-matrx-table-footer": true, className: containerClass, children: [
|
|
1959
|
+
showItemsPerPageSelect && /* @__PURE__ */ jsx17(
|
|
1744
1960
|
"div",
|
|
1745
1961
|
{
|
|
1746
1962
|
className: cn(
|
|
@@ -1748,13 +1964,13 @@ function GenericTablePagination({
|
|
|
1748
1964
|
!compact && "sm:p-1",
|
|
1749
1965
|
selectContainerClassName
|
|
1750
1966
|
),
|
|
1751
|
-
children: /* @__PURE__ */
|
|
1967
|
+
children: /* @__PURE__ */ jsxs11(
|
|
1752
1968
|
Select,
|
|
1753
1969
|
{
|
|
1754
1970
|
value: itemsPerPage.toString(),
|
|
1755
1971
|
onValueChange: (value) => onItemsPerPageChange(parseInt(value)),
|
|
1756
1972
|
children: [
|
|
1757
|
-
/* @__PURE__ */
|
|
1973
|
+
/* @__PURE__ */ jsx17(
|
|
1758
1974
|
SelectTrigger,
|
|
1759
1975
|
{
|
|
1760
1976
|
"aria-label": "Rows per page",
|
|
@@ -1762,31 +1978,31 @@ function GenericTablePagination({
|
|
|
1762
1978
|
"focus:ring-0",
|
|
1763
1979
|
compact ? "relative isolate h-11 w-14 border-0 bg-transparent px-2 text-xs before:absolute before:inset-x-1 before:inset-y-1.5 before:z-0 before:rounded-md before:border before:border-border before:bg-card before:content-[''] hover:before:bg-accent [&>*]:relative [&>*]:z-10 lg:h-7 lg:min-h-7 lg:w-16 lg:border lg:border-input lg:bg-background lg:px-2 lg:before:hidden" : "h-8 w-[3.75rem] text-xs sm:w-36 sm:text-sm"
|
|
1764
1980
|
),
|
|
1765
|
-
children: /* @__PURE__ */
|
|
1981
|
+
children: /* @__PURE__ */ jsx17(SelectValue, { placeholder: itemsPerPage.toString() })
|
|
1766
1982
|
}
|
|
1767
1983
|
),
|
|
1768
|
-
/* @__PURE__ */
|
|
1769
|
-
availablePageSizes.map((size) => /* @__PURE__ */
|
|
1770
|
-
showAllOption ? /* @__PURE__ */
|
|
1984
|
+
/* @__PURE__ */ jsxs11(SelectContent, { children: [
|
|
1985
|
+
availablePageSizes.map((size) => /* @__PURE__ */ jsx17(SelectItem, { value: size.toString(), children: size }, size)),
|
|
1986
|
+
showAllOption ? /* @__PURE__ */ jsx17(SelectItem, { value: allValue.toString(), children: allOptionLabel }) : null
|
|
1771
1987
|
] })
|
|
1772
1988
|
]
|
|
1773
1989
|
}
|
|
1774
1990
|
)
|
|
1775
1991
|
}
|
|
1776
1992
|
),
|
|
1777
|
-
/* @__PURE__ */
|
|
1993
|
+
/* @__PURE__ */ jsx17(
|
|
1778
1994
|
"div",
|
|
1779
1995
|
{
|
|
1780
1996
|
className: cn("flex min-w-0 justify-center", infoContainerClassName),
|
|
1781
|
-
children: showPageInfo && !hideEntriesInfo && /* @__PURE__ */
|
|
1782
|
-
/* @__PURE__ */
|
|
1997
|
+
children: showPageInfo && !hideEntriesInfo && /* @__PURE__ */ jsxs11(Fragment, { children: [
|
|
1998
|
+
/* @__PURE__ */ jsxs11("span", { className: "truncate text-[10px] tabular-nums text-muted-foreground sm:hidden", children: [
|
|
1783
1999
|
startItem,
|
|
1784
2000
|
"-",
|
|
1785
2001
|
endItem,
|
|
1786
2002
|
" / ",
|
|
1787
2003
|
totalItems
|
|
1788
2004
|
] }),
|
|
1789
|
-
/* @__PURE__ */
|
|
2005
|
+
/* @__PURE__ */ jsx17(
|
|
1790
2006
|
"span",
|
|
1791
2007
|
{
|
|
1792
2008
|
className: `hidden whitespace-nowrap ${compact ? "text-xs" : "text-sm"} text-muted-foreground sm:inline`,
|
|
@@ -1796,7 +2012,7 @@ function GenericTablePagination({
|
|
|
1796
2012
|
] })
|
|
1797
2013
|
}
|
|
1798
2014
|
),
|
|
1799
|
-
showPageControls && /* @__PURE__ */
|
|
2015
|
+
showPageControls && /* @__PURE__ */ jsxs11(
|
|
1800
2016
|
"div",
|
|
1801
2017
|
{
|
|
1802
2018
|
className: cn(
|
|
@@ -1805,7 +2021,7 @@ function GenericTablePagination({
|
|
|
1805
2021
|
controlsContainerClassName
|
|
1806
2022
|
),
|
|
1807
2023
|
children: [
|
|
1808
|
-
/* @__PURE__ */
|
|
2024
|
+
/* @__PURE__ */ jsx17(
|
|
1809
2025
|
Button,
|
|
1810
2026
|
{
|
|
1811
2027
|
variant: "outline",
|
|
@@ -1819,10 +2035,10 @@ function GenericTablePagination({
|
|
|
1819
2035
|
compact ? compactButtonClass : "h-8 w-8 p-0",
|
|
1820
2036
|
navButtonClassName
|
|
1821
2037
|
),
|
|
1822
|
-
children: /* @__PURE__ */
|
|
2038
|
+
children: /* @__PURE__ */ jsx17(ChevronsLeft, { className: compact ? "h-3.5 w-3.5" : "h-4 w-4" })
|
|
1823
2039
|
}
|
|
1824
2040
|
),
|
|
1825
|
-
/* @__PURE__ */
|
|
2041
|
+
/* @__PURE__ */ jsx17(
|
|
1826
2042
|
Button,
|
|
1827
2043
|
{
|
|
1828
2044
|
variant: "outline",
|
|
@@ -1835,10 +2051,10 @@ function GenericTablePagination({
|
|
|
1835
2051
|
compact ? compactButtonClass : "h-8 w-8 p-0",
|
|
1836
2052
|
navButtonClassName
|
|
1837
2053
|
),
|
|
1838
|
-
children: /* @__PURE__ */
|
|
2054
|
+
children: /* @__PURE__ */ jsx17(ChevronLeft, { className: compact ? "h-3.5 w-3.5" : "h-4 w-4" })
|
|
1839
2055
|
}
|
|
1840
2056
|
),
|
|
1841
|
-
getPageNumbers(3).map((page) => /* @__PURE__ */
|
|
2057
|
+
getPageNumbers(3).map((page) => /* @__PURE__ */ jsx17(
|
|
1842
2058
|
Button,
|
|
1843
2059
|
{
|
|
1844
2060
|
variant: currentPage === page ? "default" : "outline",
|
|
@@ -1853,11 +2069,11 @@ function GenericTablePagination({
|
|
|
1853
2069
|
compact && page === currentPage && compactActiveButtonClass,
|
|
1854
2070
|
page === currentPage ? pageActiveButtonClassName : pageButtonClassName
|
|
1855
2071
|
),
|
|
1856
|
-
children: /* @__PURE__ */
|
|
2072
|
+
children: /* @__PURE__ */ jsx17("span", { className: "relative z-10", children: page })
|
|
1857
2073
|
},
|
|
1858
2074
|
`mobile-${page}`
|
|
1859
2075
|
)),
|
|
1860
|
-
getPageNumbers().map((page) => /* @__PURE__ */
|
|
2076
|
+
getPageNumbers().map((page) => /* @__PURE__ */ jsx17(
|
|
1861
2077
|
Button,
|
|
1862
2078
|
{
|
|
1863
2079
|
variant: currentPage === page ? "default" : "outline",
|
|
@@ -1871,11 +2087,11 @@ function GenericTablePagination({
|
|
|
1871
2087
|
compact && page === currentPage && compactActiveButtonClass,
|
|
1872
2088
|
currentPage === page ? pageActiveButtonClassName : pageButtonClassName
|
|
1873
2089
|
),
|
|
1874
|
-
children: /* @__PURE__ */
|
|
2090
|
+
children: /* @__PURE__ */ jsx17("span", { className: "relative z-10", children: page })
|
|
1875
2091
|
},
|
|
1876
2092
|
`desktop-${page}`
|
|
1877
2093
|
)),
|
|
1878
|
-
/* @__PURE__ */
|
|
2094
|
+
/* @__PURE__ */ jsx17(
|
|
1879
2095
|
Button,
|
|
1880
2096
|
{
|
|
1881
2097
|
variant: "outline",
|
|
@@ -1888,10 +2104,10 @@ function GenericTablePagination({
|
|
|
1888
2104
|
compact ? compactButtonClass : "h-8 w-8 p-0",
|
|
1889
2105
|
navButtonClassName
|
|
1890
2106
|
),
|
|
1891
|
-
children: /* @__PURE__ */
|
|
2107
|
+
children: /* @__PURE__ */ jsx17(ChevronRight, { className: compact ? "h-3.5 w-3.5" : "h-4 w-4" })
|
|
1892
2108
|
}
|
|
1893
2109
|
),
|
|
1894
|
-
/* @__PURE__ */
|
|
2110
|
+
/* @__PURE__ */ jsx17(
|
|
1895
2111
|
Button,
|
|
1896
2112
|
{
|
|
1897
2113
|
variant: "outline",
|
|
@@ -1905,7 +2121,7 @@ function GenericTablePagination({
|
|
|
1905
2121
|
compact ? compactButtonClass : "h-8 w-8 p-0",
|
|
1906
2122
|
navButtonClassName
|
|
1907
2123
|
),
|
|
1908
|
-
children: /* @__PURE__ */
|
|
2124
|
+
children: /* @__PURE__ */ jsx17(ChevronsRight, { className: compact ? "h-3.5 w-3.5" : "h-4 w-4" })
|
|
1909
2125
|
}
|
|
1910
2126
|
)
|
|
1911
2127
|
]
|
|
@@ -1920,11 +2136,11 @@ import { useClipboard } from "@ai-matrx/kit/clipboard";
|
|
|
1920
2136
|
|
|
1921
2137
|
// src/popover.tsx
|
|
1922
2138
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
1923
|
-
import * as
|
|
1924
|
-
import { jsx as
|
|
2139
|
+
import * as React11 from "react";
|
|
2140
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1925
2141
|
var Popover = PopoverPrimitive.Root;
|
|
1926
2142
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
1927
|
-
var PopoverContent =
|
|
2143
|
+
var PopoverContent = React11.forwardRef(
|
|
1928
2144
|
({
|
|
1929
2145
|
className,
|
|
1930
2146
|
align = "center",
|
|
@@ -1934,7 +2150,7 @@ var PopoverContent = React10.forwardRef(
|
|
|
1934
2150
|
...props
|
|
1935
2151
|
}, ref) => {
|
|
1936
2152
|
const portalContainer = usePortalContainer(container);
|
|
1937
|
-
return /* @__PURE__ */
|
|
2153
|
+
return /* @__PURE__ */ jsx18(PopoverPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx18(
|
|
1938
2154
|
PopoverPrimitive.Content,
|
|
1939
2155
|
{
|
|
1940
2156
|
ref,
|
|
@@ -1986,7 +2202,7 @@ ${JSON.stringify(value.data, null, 2)}
|
|
|
1986
2202
|
}
|
|
1987
2203
|
|
|
1988
2204
|
// src/data-table/copy.tsx
|
|
1989
|
-
import { jsx as
|
|
2205
|
+
import { jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1990
2206
|
function resolve(value) {
|
|
1991
2207
|
return typeof value === "function" ? value() : value;
|
|
1992
2208
|
}
|
|
@@ -2007,8 +2223,8 @@ function download(item) {
|
|
|
2007
2223
|
}
|
|
2008
2224
|
function CopyButtons(props) {
|
|
2009
2225
|
const { CopyControls } = useMatrxDataTableHost();
|
|
2010
|
-
if (CopyControls) return /* @__PURE__ */
|
|
2011
|
-
return /* @__PURE__ */
|
|
2226
|
+
if (CopyControls) return /* @__PURE__ */ jsx19(CopyControls, { ...props });
|
|
2227
|
+
return /* @__PURE__ */ jsx19(DefaultCopyButtons, { ...props });
|
|
2012
2228
|
}
|
|
2013
2229
|
function DefaultCopyButtons({ human, agent, json, label, size = "icon", appearance = "segmented", disabled = false, stopPropagation = true, className, aiVariants = [], agentVariant, aiCustom, export: exportConfig, hide }) {
|
|
2014
2230
|
const { notify, notice } = useTableNotice();
|
|
@@ -2041,23 +2257,23 @@ function DefaultCopyButtons({ human, agent, json, label, size = "icon", appearan
|
|
|
2041
2257
|
const exports = hide?.includes("export") ? void 0 : exportConfig;
|
|
2042
2258
|
const showCustom = aiCustom && !hide?.includes("ai");
|
|
2043
2259
|
const buttonClass = `${size === "xs" ? "h-8 w-8 lg:h-5 lg:w-8" : ""} ${appearance === "bare" ? "border-0 bg-transparent shadow-none" : ""}`;
|
|
2044
|
-
return /* @__PURE__ */
|
|
2045
|
-
human !== void 0 && !hide?.includes("copy") ? /* @__PURE__ */
|
|
2046
|
-
variants.length > 0 || showCustom || exports ? /* @__PURE__ */
|
|
2047
|
-
/* @__PURE__ */
|
|
2048
|
-
/* @__PURE__ */
|
|
2049
|
-
variants.map((variant) => /* @__PURE__ */
|
|
2260
|
+
return /* @__PURE__ */ jsxs12("span", { className: `inline-flex flex-wrap items-center gap-0.5 ${className ?? ""}`, onClick: stopPropagation ? (event) => event.stopPropagation() : void 0, children: [
|
|
2261
|
+
human !== void 0 && !hide?.includes("copy") ? /* @__PURE__ */ jsx19(Button, { type: "button", variant: "ghost", size: "icon", className: buttonClass, disabled: disabled || busy, "aria-label": `Copy ${label}`, onClick: () => void run(() => clipboard.copyText(resolve(human), `${label} copied`)), children: /* @__PURE__ */ jsx19(Copy, { className: "h-3.5 w-3.5" }) }) : null,
|
|
2262
|
+
variants.length > 0 || showCustom || exports ? /* @__PURE__ */ jsxs12(Popover, { children: [
|
|
2263
|
+
/* @__PURE__ */ jsx19(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx19(Button, { type: "button", variant: "ghost", size: "icon", className: buttonClass, disabled: disabled || busy, "aria-label": `Copy ${label} for AI or export`, children: /* @__PURE__ */ jsx19(SlidersHorizontal, { className: "h-3.5 w-3.5" }) }) }),
|
|
2264
|
+
/* @__PURE__ */ jsxs12(PopoverContent, { align: "end", className: "w-64 p-1", children: [
|
|
2265
|
+
variants.map((variant) => /* @__PURE__ */ jsx19(Button, { type: "button", variant: "ghost", size: "sm", className: "w-full justify-start", disabled: busy, onClick: () => void run(async () => {
|
|
2050
2266
|
if (variant.onSelect) variant.onSelect();
|
|
2051
2267
|
else if (variant.modal) setModal(variant.id);
|
|
2052
2268
|
else if (variant.build) await clipboard.copyText(tableAgentText(await variant.build()), variant.successMessage ?? `${label} copied`);
|
|
2053
2269
|
else throw new Error(`No copy action is available for ${variant.label}.`);
|
|
2054
2270
|
}), children: variant.label }, variant.id)),
|
|
2055
|
-
showCustom ? /* @__PURE__ */
|
|
2056
|
-
exports?.items.map((item) => /* @__PURE__ */
|
|
2271
|
+
showCustom ? /* @__PURE__ */ jsx19(Button, { type: "button", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: () => setModal("custom"), children: aiCustom.label ?? "Custom copy\u2026" }) : null,
|
|
2272
|
+
exports?.items.map((item) => /* @__PURE__ */ jsx19(Button, { type: "button", variant: "ghost", size: "sm", className: "w-full justify-start", disabled: busy, onClick: () => void run(async () => {
|
|
2057
2273
|
if (item.onSelect) await item.onSelect();
|
|
2058
2274
|
else download(item);
|
|
2059
2275
|
}), children: item.label }, item.id)),
|
|
2060
|
-
exports?.sheetRows ? /* @__PURE__ */
|
|
2276
|
+
exports?.sheetRows ? /* @__PURE__ */ jsx19(Button, { type: "button", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: () => void run(async () => {
|
|
2061
2277
|
const rows = exports.sheetRows?.();
|
|
2062
2278
|
if (!rows) return;
|
|
2063
2279
|
const keys = [...new Set(rows.flatMap((row) => Object.keys(row)))];
|
|
@@ -2066,8 +2282,8 @@ function DefaultCopyButtons({ human, agent, json, label, size = "icon", appearan
|
|
|
2066
2282
|
}), children: "Copy for Google Sheets" }) : null
|
|
2067
2283
|
] })
|
|
2068
2284
|
] }) : null,
|
|
2069
|
-
variants.map((variant) => variant.modal && modal === variant.id ? /* @__PURE__ */
|
|
2070
|
-
modal === "custom" && aiCustom ? /* @__PURE__ */
|
|
2285
|
+
variants.map((variant) => variant.modal && modal === variant.id ? /* @__PURE__ */ jsx19("span", { children: variant.modal({ open: true, onOpenChange: (open) => setModal(open ? variant.id : null) }) }, variant.id) : null),
|
|
2286
|
+
modal === "custom" && aiCustom ? /* @__PURE__ */ jsx19(CustomCopy, { source: aiCustom, onClose: () => setModal(null) }) : null,
|
|
2071
2287
|
notice
|
|
2072
2288
|
] });
|
|
2073
2289
|
}
|
|
@@ -2083,25 +2299,25 @@ function CustomCopy({ source, onClose }) {
|
|
|
2083
2299
|
} catch (raw) {
|
|
2084
2300
|
error = raw instanceof Error ? raw.message : String(raw);
|
|
2085
2301
|
}
|
|
2086
|
-
return /* @__PURE__ */
|
|
2302
|
+
return /* @__PURE__ */ jsx19(Dialog, { open: true, onOpenChange: (open) => {
|
|
2087
2303
|
if (!open) onClose();
|
|
2088
|
-
}, children: /* @__PURE__ */
|
|
2089
|
-
/* @__PURE__ */
|
|
2090
|
-
source.dialogDescription ? /* @__PURE__ */
|
|
2091
|
-
source.options.map((option) => /* @__PURE__ */
|
|
2304
|
+
}, children: /* @__PURE__ */ jsxs12(DialogContent, { children: [
|
|
2305
|
+
/* @__PURE__ */ jsx19(DialogHeader, { children: /* @__PURE__ */ jsx19(DialogTitle, { children: source.dialogTitle ?? "Custom copy" }) }),
|
|
2306
|
+
source.dialogDescription ? /* @__PURE__ */ jsx19("p", { className: "text-sm", children: source.dialogDescription }) : null,
|
|
2307
|
+
source.options.map((option) => /* @__PURE__ */ jsxs12("label", { className: "flex items-center justify-between gap-3 text-sm", children: [
|
|
2092
2308
|
option.label,
|
|
2093
|
-
option.kind === "toggle" ? /* @__PURE__ */
|
|
2094
|
-
option.presets?.map((choice) => /* @__PURE__ */
|
|
2095
|
-
/* @__PURE__ */
|
|
2309
|
+
option.kind === "toggle" ? /* @__PURE__ */ jsx19("input", { type: "checkbox", checked: values[option.key] === true, onChange: (e) => setValues({ ...values, [option.key]: e.target.checked }) }) : option.kind === "preset" ? /* @__PURE__ */ jsx19("select", { "aria-label": option.label, value: Number(values[option.key]), onChange: (e) => setValues({ ...values, [option.key]: Number(e.target.value) }), children: option.options.map((choice) => /* @__PURE__ */ jsx19("option", { value: choice.value, children: choice.label }, choice.value)) }) : option.kind === "slider" ? /* @__PURE__ */ jsx19("input", { "aria-label": option.label, type: "range", min: 0, max: option.stops.length - 1, step: 1, value: Math.max(0, option.stops.indexOf(Number(values[option.key]))), onChange: (e) => setValues({ ...values, [option.key]: option.stops[Number(e.target.value)] ?? option.default }) }) : /* @__PURE__ */ jsxs12("span", { className: "flex gap-1", children: [
|
|
2310
|
+
option.presets?.map((choice) => /* @__PURE__ */ jsx19(Button, { type: "button", size: "sm", variant: "outline", onClick: () => setValues({ ...values, [option.key]: choice.value }), children: choice.label }, choice.value)),
|
|
2311
|
+
/* @__PURE__ */ jsx19("input", { "aria-label": option.label, type: "number", value: Number(values[option.key]), min: option.min, step: option.step, onChange: (e) => {
|
|
2096
2312
|
if (Number.isFinite(e.target.valueAsNumber)) setValues({ ...values, [option.key]: e.target.valueAsNumber });
|
|
2097
2313
|
} })
|
|
2098
2314
|
] })
|
|
2099
2315
|
] }, option.key)),
|
|
2100
|
-
error ? /* @__PURE__ */
|
|
2316
|
+
error ? /* @__PURE__ */ jsx19("p", { role: "alert", className: "text-destructive", children: error }) : /* @__PURE__ */ jsx19("pre", { className: "max-h-48 overflow-auto whitespace-pre-wrap text-xs", children: text }),
|
|
2101
2317
|
notice,
|
|
2102
|
-
/* @__PURE__ */
|
|
2103
|
-
/* @__PURE__ */
|
|
2104
|
-
/* @__PURE__ */
|
|
2318
|
+
/* @__PURE__ */ jsxs12(DialogFooter, { children: [
|
|
2319
|
+
/* @__PURE__ */ jsx19(Button, { type: "button", variant: "outline", onClick: onClose, children: "Close" }),
|
|
2320
|
+
/* @__PURE__ */ jsx19(Button, { type: "button", disabled: error !== null, onClick: () => void clipboard.copyText(text, "Custom copy copied"), children: "Copy" })
|
|
2105
2321
|
] })
|
|
2106
2322
|
] }) });
|
|
2107
2323
|
}
|
|
@@ -2207,7 +2423,7 @@ function buildViewHuman(config, visible, columns) {
|
|
|
2207
2423
|
}
|
|
2208
2424
|
|
|
2209
2425
|
// src/data-table/CopySubset.tsx
|
|
2210
|
-
import { jsx as
|
|
2426
|
+
import { jsx as jsx20, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2211
2427
|
function CopySubsetDialog({ source, onClose }) {
|
|
2212
2428
|
const [rows] = useState6(() => [...source.rows]);
|
|
2213
2429
|
const [hidden, setHidden] = useState6(() => new Set(source.columns.filter((c) => c.hidden).map((c) => c.id)));
|
|
@@ -2228,14 +2444,14 @@ function CopySubsetDialog({ source, onClose }) {
|
|
|
2228
2444
|
} catch (raw) {
|
|
2229
2445
|
buildError = raw instanceof Error ? raw.message : String(raw);
|
|
2230
2446
|
}
|
|
2231
|
-
return /* @__PURE__ */
|
|
2447
|
+
return /* @__PURE__ */ jsx20(Dialog, { open: true, onOpenChange: (open) => {
|
|
2232
2448
|
if (!open) onClose();
|
|
2233
|
-
}, children: /* @__PURE__ */
|
|
2234
|
-
/* @__PURE__ */
|
|
2235
|
-
/* @__PURE__ */
|
|
2236
|
-
/* @__PURE__ */
|
|
2237
|
-
source.columns.map((column) => /* @__PURE__ */
|
|
2238
|
-
/* @__PURE__ */
|
|
2449
|
+
}, children: /* @__PURE__ */ jsxs13(DialogContent, { className: "flex h-[80dvh] max-w-5xl flex-col overflow-hidden", children: [
|
|
2450
|
+
/* @__PURE__ */ jsx20(DialogHeader, { children: /* @__PURE__ */ jsx20(DialogTitle, { children: "Filter & sort before copying" }) }),
|
|
2451
|
+
/* @__PURE__ */ jsxs13("fieldset", { className: "max-h-24 shrink-0 overflow-auto text-xs", children: [
|
|
2452
|
+
/* @__PURE__ */ jsx20("legend", { children: "Visible columns" }),
|
|
2453
|
+
source.columns.map((column) => /* @__PURE__ */ jsxs13("label", { className: "mr-3 inline-flex items-center gap-1", children: [
|
|
2454
|
+
/* @__PURE__ */ jsx20("input", { type: "checkbox", checked: !hidden.has(column.id), onChange: () => setHidden((current) => {
|
|
2239
2455
|
const next = new Set(current);
|
|
2240
2456
|
next.has(column.id) ? next.delete(column.id) : next.add(column.id);
|
|
2241
2457
|
return next;
|
|
@@ -2243,20 +2459,20 @@ function CopySubsetDialog({ source, onClose }) {
|
|
|
2243
2459
|
column.header
|
|
2244
2460
|
] }, column.id))
|
|
2245
2461
|
] }),
|
|
2246
|
-
columns.length ? /* @__PURE__ */
|
|
2247
|
-
buildError ? /* @__PURE__ */
|
|
2462
|
+
columns.length ? /* @__PURE__ */ jsx20("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ jsx20(MatrxDataTable, { data: rows, columns, getRowId: source.getRowId, query: { mode: "controlled-local", state: query, onStateChange: setQuery }, selection: { selectedIds, onSelectedIdsChange: setSelectedIds }, detail: { enabled: false }, window: { enabled: false }, toolbar: { searchMatch: {} } }) }) : /* @__PURE__ */ jsx20("p", { children: "Show at least one column to copy." }),
|
|
2463
|
+
buildError ? /* @__PURE__ */ jsx20("p", { role: "alert", className: "text-destructive", children: buildError }) : null,
|
|
2248
2464
|
notice,
|
|
2249
|
-
/* @__PURE__ */
|
|
2250
|
-
/* @__PURE__ */
|
|
2465
|
+
/* @__PURE__ */ jsxs13(DialogFooter, { children: [
|
|
2466
|
+
/* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
2251
2467
|
"Format",
|
|
2252
|
-
/* @__PURE__ */
|
|
2253
|
-
/* @__PURE__ */
|
|
2254
|
-
/* @__PURE__ */
|
|
2255
|
-
/* @__PURE__ */
|
|
2256
|
-
/* @__PURE__ */
|
|
2468
|
+
/* @__PURE__ */ jsxs13("select", { "aria-label": "Copy format", value: format, onChange: (event) => setFormat(event.target.value), children: [
|
|
2469
|
+
/* @__PURE__ */ jsx20("option", { value: "ai", children: "For AI" }),
|
|
2470
|
+
/* @__PURE__ */ jsx20("option", { value: "markdown", children: "Markdown" }),
|
|
2471
|
+
/* @__PURE__ */ jsx20("option", { value: "csv", children: "CSV" }),
|
|
2472
|
+
/* @__PURE__ */ jsx20("option", { value: "json", children: "JSON" })
|
|
2257
2473
|
] })
|
|
2258
2474
|
] }),
|
|
2259
|
-
/* @__PURE__ */
|
|
2475
|
+
/* @__PURE__ */ jsxs13("span", { role: "status", className: "text-xs", children: [
|
|
2260
2476
|
shaped.length,
|
|
2261
2477
|
" of ",
|
|
2262
2478
|
rows.length,
|
|
@@ -2266,13 +2482,13 @@ function CopySubsetDialog({ source, onClose }) {
|
|
|
2266
2482
|
text.length.toLocaleString(),
|
|
2267
2483
|
" characters"
|
|
2268
2484
|
] }),
|
|
2269
|
-
/* @__PURE__ */
|
|
2270
|
-
/* @__PURE__ */
|
|
2485
|
+
/* @__PURE__ */ jsx20(Button, { type: "button", variant: "outline", onClick: onClose, children: "Close" }),
|
|
2486
|
+
/* @__PURE__ */ jsx20(Button, { type: "button", disabled: buildError !== null || !columns.length || !shaped.length, onClick: () => void clipboard.copyText(text, `${source.label} copied`), children: "Copy subset" })
|
|
2271
2487
|
] })
|
|
2272
2488
|
] }) });
|
|
2273
2489
|
}
|
|
2274
2490
|
function useCopySubsetVariant() {
|
|
2275
|
-
return (getSource) => ({ id: "copy-subset", label: "Filter & sort before copying\u2026", section: "ai", modal: ({ open, onOpenChange }) => open ? /* @__PURE__ */
|
|
2491
|
+
return (getSource) => ({ id: "copy-subset", label: "Filter & sort before copying\u2026", section: "ai", modal: ({ open, onOpenChange }) => open ? /* @__PURE__ */ jsx20(CopySubsetDialog, { source: getSource(), onClose: () => onOpenChange(false) }) : null });
|
|
2276
2492
|
}
|
|
2277
2493
|
|
|
2278
2494
|
// src/data-table/clipping.ts
|
|
@@ -2481,9 +2697,9 @@ import { useEffect as useEffect5, useMemo as useMemo2, useState as useState8 } f
|
|
|
2481
2697
|
// src/command.tsx
|
|
2482
2698
|
import * as DialogPrimitive2 from "@radix-ui/react-dialog";
|
|
2483
2699
|
import { Command as CommandPrimitive } from "cmdk";
|
|
2484
|
-
import * as
|
|
2485
|
-
import { jsx as
|
|
2486
|
-
var Command =
|
|
2700
|
+
import * as React12 from "react";
|
|
2701
|
+
import { jsx as jsx21, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2702
|
+
var Command = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx21(
|
|
2487
2703
|
CommandPrimitive,
|
|
2488
2704
|
{
|
|
2489
2705
|
ref,
|
|
@@ -2498,12 +2714,12 @@ Command.displayName = CommandPrimitive.displayName;
|
|
|
2498
2714
|
var DIALOG_DESKTOP_CLASSES2 = `fixed left-[50%] top-[50%] z-[10000] grid min-w-0 w-full max-w-lg ${CENTERED_DIALOG} gap-4 overflow-x-clip border bg-background p-6 shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full sm:rounded-lg`;
|
|
2499
2715
|
var DIALOG_MOBILE_SHEET_CLASSES2 = "fixed inset-x-0 bottom-0 left-0 right-0 top-auto z-[10000] flex min-w-0 flex-col w-full max-w-full max-h-[90dvh] translate-x-0 translate-y-0 gap-4 overflow-x-clip border-t bg-background p-4 pb-safe shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full rounded-t-2xl rounded-b-none overflow-y-auto overscroll-contain";
|
|
2500
2716
|
var DIALOG_MOBILE_SHEET_OVERRIDE2 = "inset-x-0 bottom-0 left-0 right-0 top-auto translate-x-0 translate-y-0 w-full max-w-full max-h-[90dvh] rounded-b-none rounded-t-2xl overflow-y-auto";
|
|
2501
|
-
var CommandDialogContent =
|
|
2717
|
+
var CommandDialogContent = React12.forwardRef(({ className, children, container, ...props }, ref) => {
|
|
2502
2718
|
const isMobile = useIsMobile();
|
|
2503
2719
|
const isModal = useRadixDialogModal();
|
|
2504
2720
|
const portalContainer = usePortalContainer(container);
|
|
2505
|
-
return /* @__PURE__ */
|
|
2506
|
-
isModal ? /* @__PURE__ */
|
|
2721
|
+
return /* @__PURE__ */ jsxs14(DialogPrimitive2.Portal, { container: portalContainer, children: [
|
|
2722
|
+
isModal ? /* @__PURE__ */ jsx21(
|
|
2507
2723
|
DialogPrimitive2.Overlay,
|
|
2508
2724
|
{
|
|
2509
2725
|
className: cn(
|
|
@@ -2512,7 +2728,7 @@ var CommandDialogContent = React11.forwardRef(({ className, children, container,
|
|
|
2512
2728
|
)
|
|
2513
2729
|
}
|
|
2514
2730
|
) : null,
|
|
2515
|
-
/* @__PURE__ */
|
|
2731
|
+
/* @__PURE__ */ jsxs14(
|
|
2516
2732
|
DialogPrimitive2.Content,
|
|
2517
2733
|
{
|
|
2518
2734
|
ref,
|
|
@@ -2528,9 +2744,9 @@ var CommandDialogContent = React11.forwardRef(({ className, children, container,
|
|
|
2528
2744
|
...props,
|
|
2529
2745
|
children: [
|
|
2530
2746
|
children,
|
|
2531
|
-
/* @__PURE__ */
|
|
2532
|
-
/* @__PURE__ */
|
|
2533
|
-
/* @__PURE__ */
|
|
2747
|
+
/* @__PURE__ */ jsxs14(DialogPrimitive2.Close, { className: "absolute right-2 top-4 flex h-10 w-10 items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground sm:right-4", children: [
|
|
2748
|
+
/* @__PURE__ */ jsx21(XIcon, { className: "h-4 w-4" }),
|
|
2749
|
+
/* @__PURE__ */ jsx21("span", { className: "sr-only", children: "Close" })
|
|
2534
2750
|
] })
|
|
2535
2751
|
]
|
|
2536
2752
|
}
|
|
@@ -2538,9 +2754,9 @@ var CommandDialogContent = React11.forwardRef(({ className, children, container,
|
|
|
2538
2754
|
] });
|
|
2539
2755
|
});
|
|
2540
2756
|
CommandDialogContent.displayName = "CommandDialogContent";
|
|
2541
|
-
var CommandInput =
|
|
2542
|
-
/* @__PURE__ */
|
|
2543
|
-
/* @__PURE__ */
|
|
2757
|
+
var CommandInput = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs14("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
|
2758
|
+
/* @__PURE__ */ jsx21(MagnifyingGlassIcon, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
2759
|
+
/* @__PURE__ */ jsx21(
|
|
2544
2760
|
CommandPrimitive.Input,
|
|
2545
2761
|
{
|
|
2546
2762
|
ref,
|
|
@@ -2553,7 +2769,7 @@ var CommandInput = React11.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
2553
2769
|
)
|
|
2554
2770
|
] }));
|
|
2555
2771
|
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
|
2556
|
-
var CommandList =
|
|
2772
|
+
var CommandList = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx21(
|
|
2557
2773
|
CommandPrimitive.List,
|
|
2558
2774
|
{
|
|
2559
2775
|
ref,
|
|
@@ -2562,7 +2778,7 @@ var CommandList = React11.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
2562
2778
|
}
|
|
2563
2779
|
));
|
|
2564
2780
|
CommandList.displayName = CommandPrimitive.List.displayName;
|
|
2565
|
-
var CommandEmpty =
|
|
2781
|
+
var CommandEmpty = React12.forwardRef((props, ref) => /* @__PURE__ */ jsx21(
|
|
2566
2782
|
CommandPrimitive.Empty,
|
|
2567
2783
|
{
|
|
2568
2784
|
ref,
|
|
@@ -2571,7 +2787,7 @@ var CommandEmpty = React11.forwardRef((props, ref) => /* @__PURE__ */ jsx19(
|
|
|
2571
2787
|
}
|
|
2572
2788
|
));
|
|
2573
2789
|
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
|
2574
|
-
var CommandGroup =
|
|
2790
|
+
var CommandGroup = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx21(
|
|
2575
2791
|
CommandPrimitive.Group,
|
|
2576
2792
|
{
|
|
2577
2793
|
ref,
|
|
@@ -2583,7 +2799,7 @@ var CommandGroup = React11.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
2583
2799
|
}
|
|
2584
2800
|
));
|
|
2585
2801
|
CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
|
2586
|
-
var CommandSeparator =
|
|
2802
|
+
var CommandSeparator = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx21(
|
|
2587
2803
|
CommandPrimitive.Separator,
|
|
2588
2804
|
{
|
|
2589
2805
|
ref,
|
|
@@ -2592,7 +2808,7 @@ var CommandSeparator = React11.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
2592
2808
|
}
|
|
2593
2809
|
));
|
|
2594
2810
|
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
|
|
2595
|
-
var CommandItem =
|
|
2811
|
+
var CommandItem = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx21(
|
|
2596
2812
|
CommandPrimitive.Item,
|
|
2597
2813
|
{
|
|
2598
2814
|
ref,
|
|
@@ -2608,7 +2824,7 @@ var CommandShortcut = ({
|
|
|
2608
2824
|
className,
|
|
2609
2825
|
...props
|
|
2610
2826
|
}) => {
|
|
2611
|
-
return /* @__PURE__ */
|
|
2827
|
+
return /* @__PURE__ */ jsx21(
|
|
2612
2828
|
"span",
|
|
2613
2829
|
{
|
|
2614
2830
|
className: cn(
|
|
@@ -2623,7 +2839,7 @@ CommandShortcut.displayName = "CommandShortcut";
|
|
|
2623
2839
|
|
|
2624
2840
|
// src/data-table/ColumnHeaderCell.tsx
|
|
2625
2841
|
init_filter_engine();
|
|
2626
|
-
import { Fragment as Fragment2, jsx as
|
|
2842
|
+
import { Fragment as Fragment2, jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2627
2843
|
function ColumnHeaderCell({
|
|
2628
2844
|
label,
|
|
2629
2845
|
labelText,
|
|
@@ -2672,7 +2888,7 @@ function ColumnHeaderCell({
|
|
|
2672
2888
|
else onFilterChange(next);
|
|
2673
2889
|
};
|
|
2674
2890
|
const menuLabel = labelText ? `Sort or filter ${labelText}` : "Sort or filter column";
|
|
2675
|
-
const menuContent = /* @__PURE__ */
|
|
2891
|
+
const menuContent = /* @__PURE__ */ jsxs15(
|
|
2676
2892
|
PopoverContent,
|
|
2677
2893
|
{
|
|
2678
2894
|
align: "start",
|
|
@@ -2689,9 +2905,9 @@ function ColumnHeaderCell({
|
|
|
2689
2905
|
input.focus();
|
|
2690
2906
|
},
|
|
2691
2907
|
children: [
|
|
2692
|
-
sortable ? /* @__PURE__ */
|
|
2693
|
-
/* @__PURE__ */
|
|
2694
|
-
/* @__PURE__ */
|
|
2908
|
+
sortable ? /* @__PURE__ */ jsxs15(Fragment2, { children: [
|
|
2909
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex flex-col gap-0.5 pb-2", children: [
|
|
2910
|
+
/* @__PURE__ */ jsxs15(
|
|
2695
2911
|
Button,
|
|
2696
2912
|
{
|
|
2697
2913
|
variant: isSorted && sortDirection === "asc" ? "secondary" : "ghost",
|
|
@@ -2699,12 +2915,12 @@ function ColumnHeaderCell({
|
|
|
2699
2915
|
className: "h-8 justify-start gap-2 px-2 text-xs font-normal",
|
|
2700
2916
|
onClick: onSortAsc,
|
|
2701
2917
|
children: [
|
|
2702
|
-
/* @__PURE__ */
|
|
2918
|
+
/* @__PURE__ */ jsx22(ArrowUp, { className: "h-3.5 w-3.5" }),
|
|
2703
2919
|
"Sort ascending"
|
|
2704
2920
|
]
|
|
2705
2921
|
}
|
|
2706
2922
|
),
|
|
2707
|
-
/* @__PURE__ */
|
|
2923
|
+
/* @__PURE__ */ jsxs15(
|
|
2708
2924
|
Button,
|
|
2709
2925
|
{
|
|
2710
2926
|
variant: isSorted && sortDirection === "desc" ? "secondary" : "ghost",
|
|
@@ -2712,12 +2928,12 @@ function ColumnHeaderCell({
|
|
|
2712
2928
|
className: "h-8 justify-start gap-2 px-2 text-xs font-normal",
|
|
2713
2929
|
onClick: onSortDesc,
|
|
2714
2930
|
children: [
|
|
2715
|
-
/* @__PURE__ */
|
|
2931
|
+
/* @__PURE__ */ jsx22(ArrowDown, { className: "h-3.5 w-3.5" }),
|
|
2716
2932
|
"Sort descending"
|
|
2717
2933
|
]
|
|
2718
2934
|
}
|
|
2719
2935
|
),
|
|
2720
|
-
isSorted ? /* @__PURE__ */
|
|
2936
|
+
isSorted ? /* @__PURE__ */ jsxs15(
|
|
2721
2937
|
Button,
|
|
2722
2938
|
{
|
|
2723
2939
|
variant: "ghost",
|
|
@@ -2725,15 +2941,15 @@ function ColumnHeaderCell({
|
|
|
2725
2941
|
className: "h-8 justify-start gap-2 px-2 text-xs font-normal text-muted-foreground",
|
|
2726
2942
|
onClick: onClearSort,
|
|
2727
2943
|
children: [
|
|
2728
|
-
/* @__PURE__ */
|
|
2944
|
+
/* @__PURE__ */ jsx22(ListX, { className: "h-3.5 w-3.5" }),
|
|
2729
2945
|
"Clear sort"
|
|
2730
2946
|
]
|
|
2731
2947
|
}
|
|
2732
2948
|
) : null
|
|
2733
2949
|
] }),
|
|
2734
|
-
filterKind ? /* @__PURE__ */
|
|
2950
|
+
filterKind ? /* @__PURE__ */ jsx22("div", { className: "mb-2 h-px bg-border" }) : null
|
|
2735
2951
|
] }) : null,
|
|
2736
|
-
filterKind ? /* @__PURE__ */
|
|
2952
|
+
filterKind ? /* @__PURE__ */ jsx22(
|
|
2737
2953
|
FilterBody,
|
|
2738
2954
|
{
|
|
2739
2955
|
kind: filterKind,
|
|
@@ -2748,10 +2964,10 @@ function ColumnHeaderCell({
|
|
|
2748
2964
|
allowNullModes
|
|
2749
2965
|
}
|
|
2750
2966
|
) : null,
|
|
2751
|
-
filterKind && visibleFilter && allowNegation ? /* @__PURE__ */
|
|
2752
|
-
/* @__PURE__ */
|
|
2753
|
-
/* @__PURE__ */
|
|
2754
|
-
/* @__PURE__ */
|
|
2967
|
+
filterKind && visibleFilter && allowNegation ? /* @__PURE__ */ jsxs15("div", { className: "mt-2 border-t border-border pt-2", children: [
|
|
2968
|
+
/* @__PURE__ */ jsx22("p", { className: "mb-1 text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: "Match mode" }),
|
|
2969
|
+
/* @__PURE__ */ jsxs15("div", { className: "grid grid-cols-2 gap-1 rounded-md border p-0.5", children: [
|
|
2970
|
+
/* @__PURE__ */ jsx22(
|
|
2755
2971
|
"button",
|
|
2756
2972
|
{
|
|
2757
2973
|
type: "button",
|
|
@@ -2764,7 +2980,7 @@ function ColumnHeaderCell({
|
|
|
2764
2980
|
children: "Include"
|
|
2765
2981
|
}
|
|
2766
2982
|
),
|
|
2767
|
-
/* @__PURE__ */
|
|
2983
|
+
/* @__PURE__ */ jsx22(
|
|
2768
2984
|
"button",
|
|
2769
2985
|
{
|
|
2770
2986
|
type: "button",
|
|
@@ -2779,11 +2995,11 @@ function ColumnHeaderCell({
|
|
|
2779
2995
|
)
|
|
2780
2996
|
] })
|
|
2781
2997
|
] }) : null,
|
|
2782
|
-
filterKind && deferredFilter ? /* @__PURE__ */
|
|
2783
|
-
filterFooterHint ? /* @__PURE__ */
|
|
2784
|
-
/* @__PURE__ */
|
|
2785
|
-
filterShowCancel ? /* @__PURE__ */
|
|
2786
|
-
/* @__PURE__ */
|
|
2998
|
+
filterKind && deferredFilter ? /* @__PURE__ */ jsxs15("div", { className: "mt-2 border-t border-border pt-2", children: [
|
|
2999
|
+
filterFooterHint ? /* @__PURE__ */ jsx22("div", { className: "mb-2 text-xs text-muted-foreground", children: filterFooterHint }) : null,
|
|
3000
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex justify-end gap-2", children: [
|
|
3001
|
+
filterShowCancel ? /* @__PURE__ */ jsx22(Button, { type: "button", variant: "ghost", size: "sm", onClick: cancelFilter, children: "Cancel" }) : null,
|
|
3002
|
+
/* @__PURE__ */ jsx22(Button, { type: "button", size: "sm", onClick: applyFilter, children: filterApplyLabel ?? "Apply" })
|
|
2787
3003
|
] })
|
|
2788
3004
|
] }) : null
|
|
2789
3005
|
]
|
|
@@ -2791,9 +3007,9 @@ function ColumnHeaderCell({
|
|
|
2791
3007
|
);
|
|
2792
3008
|
if (compact) {
|
|
2793
3009
|
if (!sortable && !filterKind) {
|
|
2794
|
-
return /* @__PURE__ */
|
|
3010
|
+
return /* @__PURE__ */ jsx22("div", { className: cn("flex items-center justify-center", className), children: label });
|
|
2795
3011
|
}
|
|
2796
|
-
return /* @__PURE__ */
|
|
3012
|
+
return /* @__PURE__ */ jsx22(
|
|
2797
3013
|
"div",
|
|
2798
3014
|
{
|
|
2799
3015
|
className: cn(
|
|
@@ -2801,8 +3017,8 @@ function ColumnHeaderCell({
|
|
|
2801
3017
|
align === "right" ? "justify-end" : "justify-center",
|
|
2802
3018
|
className
|
|
2803
3019
|
),
|
|
2804
|
-
children: /* @__PURE__ */
|
|
2805
|
-
/* @__PURE__ */
|
|
3020
|
+
children: /* @__PURE__ */ jsxs15(Popover, { open: filterOpen, onOpenChange: setFilterOpen, children: [
|
|
3021
|
+
/* @__PURE__ */ jsx22(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs15(
|
|
2806
3022
|
"button",
|
|
2807
3023
|
{
|
|
2808
3024
|
type: "button",
|
|
@@ -2815,8 +3031,8 @@ function ColumnHeaderCell({
|
|
|
2815
3031
|
),
|
|
2816
3032
|
children: [
|
|
2817
3033
|
label,
|
|
2818
|
-
isSorted ? sortDirection === "asc" ? /* @__PURE__ */
|
|
2819
|
-
filterActive ? /* @__PURE__ */
|
|
3034
|
+
isSorted ? sortDirection === "asc" ? /* @__PURE__ */ jsx22(ArrowUp, { className: "absolute -top-1 right-0 h-2 w-2 text-primary" }) : /* @__PURE__ */ jsx22(ArrowDown, { className: "absolute -top-1 right-0 h-2 w-2 text-primary" }) : null,
|
|
3035
|
+
filterActive ? /* @__PURE__ */ jsx22(
|
|
2820
3036
|
"span",
|
|
2821
3037
|
{
|
|
2822
3038
|
"aria-hidden": true,
|
|
@@ -2831,7 +3047,7 @@ function ColumnHeaderCell({
|
|
|
2831
3047
|
}
|
|
2832
3048
|
);
|
|
2833
3049
|
}
|
|
2834
|
-
return /* @__PURE__ */
|
|
3050
|
+
return /* @__PURE__ */ jsxs15(
|
|
2835
3051
|
"div",
|
|
2836
3052
|
{
|
|
2837
3053
|
className: cn(
|
|
@@ -2841,7 +3057,7 @@ function ColumnHeaderCell({
|
|
|
2841
3057
|
className
|
|
2842
3058
|
),
|
|
2843
3059
|
children: [
|
|
2844
|
-
sortable ? /* @__PURE__ */
|
|
3060
|
+
sortable ? /* @__PURE__ */ jsxs15(
|
|
2845
3061
|
"button",
|
|
2846
3062
|
{
|
|
2847
3063
|
type: "button",
|
|
@@ -2851,14 +3067,14 @@ function ColumnHeaderCell({
|
|
|
2851
3067
|
isSorted ? "text-foreground" : "text-muted-foreground hover:text-foreground"
|
|
2852
3068
|
),
|
|
2853
3069
|
children: [
|
|
2854
|
-
/* @__PURE__ */
|
|
2855
|
-
isSorted ? sortDirection === "asc" ? /* @__PURE__ */
|
|
3070
|
+
/* @__PURE__ */ jsx22("span", { className: "truncate", children: label }),
|
|
3071
|
+
isSorted ? sortDirection === "asc" ? /* @__PURE__ */ jsx22(ArrowUp, { className: "h-3 w-3 shrink-0 text-primary" }) : /* @__PURE__ */ jsx22(ArrowDown, { className: "h-3 w-3 shrink-0 text-primary" }) : /* @__PURE__ */ jsx22(ArrowUpDown, { className: "h-3 w-3 shrink-0 opacity-40" })
|
|
2856
3072
|
]
|
|
2857
3073
|
}
|
|
2858
|
-
) : /* @__PURE__ */
|
|
2859
|
-
filterKind ? /* @__PURE__ */
|
|
2860
|
-
/* @__PURE__ */
|
|
2861
|
-
/* @__PURE__ */
|
|
3074
|
+
) : /* @__PURE__ */ jsx22("span", { className: "truncate text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: label }),
|
|
3075
|
+
filterKind ? /* @__PURE__ */ jsxs15("div", { className: "inline-flex items-center", children: [
|
|
3076
|
+
/* @__PURE__ */ jsxs15(Popover, { open: filterOpen, onOpenChange: setFilterOpen, children: [
|
|
3077
|
+
/* @__PURE__ */ jsx22(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx22(
|
|
2862
3078
|
"button",
|
|
2863
3079
|
{
|
|
2864
3080
|
type: "button",
|
|
@@ -2869,7 +3085,7 @@ function ColumnHeaderCell({
|
|
|
2869
3085
|
"rounded p-0.5 transition-colors",
|
|
2870
3086
|
filterActive ? "text-primary hover:text-primary/80" : "text-muted-foreground/40 hover:text-muted-foreground"
|
|
2871
3087
|
),
|
|
2872
|
-
children: /* @__PURE__ */
|
|
3088
|
+
children: /* @__PURE__ */ jsx22(
|
|
2873
3089
|
ListFilter,
|
|
2874
3090
|
{
|
|
2875
3091
|
className: cn("h-3 w-3", filterActive && "fill-primary/20")
|
|
@@ -2879,7 +3095,7 @@ function ColumnHeaderCell({
|
|
|
2879
3095
|
) }),
|
|
2880
3096
|
menuContent
|
|
2881
3097
|
] }),
|
|
2882
|
-
filterActive ? /* @__PURE__ */
|
|
3098
|
+
filterActive ? /* @__PURE__ */ jsx22(
|
|
2883
3099
|
"button",
|
|
2884
3100
|
{
|
|
2885
3101
|
type: "button",
|
|
@@ -2890,7 +3106,7 @@ function ColumnHeaderCell({
|
|
|
2890
3106
|
onFilterChange(void 0);
|
|
2891
3107
|
},
|
|
2892
3108
|
className: "rounded p-0.5 text-primary hover:bg-muted hover:text-foreground",
|
|
2893
|
-
children: /* @__PURE__ */
|
|
3109
|
+
children: /* @__PURE__ */ jsx22(X, { className: "h-3 w-3" })
|
|
2894
3110
|
}
|
|
2895
3111
|
) : null
|
|
2896
3112
|
] }) : null
|
|
@@ -2916,14 +3132,14 @@ function FilterBody({
|
|
|
2916
3132
|
onChange({ kind: "text", value: "", mode: next });
|
|
2917
3133
|
}
|
|
2918
3134
|
};
|
|
2919
|
-
return /* @__PURE__ */
|
|
2920
|
-
/* @__PURE__ */
|
|
2921
|
-
/* @__PURE__ */
|
|
3135
|
+
return /* @__PURE__ */ jsxs15("div", { className: "space-y-1.5 px-1", children: [
|
|
3136
|
+
/* @__PURE__ */ jsx22("p", { className: "text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: "Filter" }),
|
|
3137
|
+
/* @__PURE__ */ jsx22("div", { className: "flex gap-1", children: [
|
|
2922
3138
|
["contains", "Contains"],
|
|
2923
3139
|
["empty", "(empty)"],
|
|
2924
3140
|
["not_empty", "(not empty)"],
|
|
2925
3141
|
...allowNullModes ? [["null", "(null)"], ["not_null", "(not null)"]] : []
|
|
2926
|
-
].map(([m, label]) => /* @__PURE__ */
|
|
3142
|
+
].map(([m, label]) => /* @__PURE__ */ jsx22(
|
|
2927
3143
|
"button",
|
|
2928
3144
|
{
|
|
2929
3145
|
type: "button",
|
|
@@ -2937,8 +3153,8 @@ function FilterBody({
|
|
|
2937
3153
|
},
|
|
2938
3154
|
m
|
|
2939
3155
|
)) }),
|
|
2940
|
-
mode === "contains" && /* @__PURE__ */
|
|
2941
|
-
/* @__PURE__ */
|
|
3156
|
+
mode === "contains" && /* @__PURE__ */ jsxs15("div", { className: "relative", children: [
|
|
3157
|
+
/* @__PURE__ */ jsx22(
|
|
2942
3158
|
Input,
|
|
2943
3159
|
{
|
|
2944
3160
|
"data-matrx-filter-autofocus": true,
|
|
@@ -2951,14 +3167,14 @@ function FilterBody({
|
|
|
2951
3167
|
style: { fontSize: "16px" }
|
|
2952
3168
|
}
|
|
2953
3169
|
),
|
|
2954
|
-
text ? /* @__PURE__ */
|
|
3170
|
+
text ? /* @__PURE__ */ jsx22(
|
|
2955
3171
|
"button",
|
|
2956
3172
|
{
|
|
2957
3173
|
type: "button",
|
|
2958
3174
|
"aria-label": "Clear filter text",
|
|
2959
3175
|
className: "absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground hover:text-foreground",
|
|
2960
3176
|
onClick: () => onChange(void 0),
|
|
2961
|
-
children: /* @__PURE__ */
|
|
3177
|
+
children: /* @__PURE__ */ jsx22(X, { className: "h-3.5 w-3.5" })
|
|
2962
3178
|
}
|
|
2963
3179
|
) : null
|
|
2964
3180
|
] })
|
|
@@ -2966,7 +3182,7 @@ function FilterBody({
|
|
|
2966
3182
|
}
|
|
2967
3183
|
if (kind === "select") {
|
|
2968
3184
|
const selected = value?.kind === "select" ? value.values ?? (value.value && value.value !== "__all__" ? [value.value] : []) : [];
|
|
2969
|
-
return /* @__PURE__ */
|
|
3185
|
+
return /* @__PURE__ */ jsx22(
|
|
2970
3186
|
SearchableSelectFilter,
|
|
2971
3187
|
{
|
|
2972
3188
|
selected,
|
|
@@ -2978,9 +3194,9 @@ function FilterBody({
|
|
|
2978
3194
|
}
|
|
2979
3195
|
if (kind === "boolean") {
|
|
2980
3196
|
const current = value?.kind === "boolean" ? value.value : "__all__";
|
|
2981
|
-
return /* @__PURE__ */
|
|
2982
|
-
/* @__PURE__ */
|
|
2983
|
-
/* @__PURE__ */
|
|
3197
|
+
return /* @__PURE__ */ jsxs15("div", { className: "space-y-1.5 px-1", children: [
|
|
3198
|
+
/* @__PURE__ */ jsx22("p", { className: "text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: "Filter" }),
|
|
3199
|
+
/* @__PURE__ */ jsxs15(
|
|
2984
3200
|
Select,
|
|
2985
3201
|
{
|
|
2986
3202
|
value: current === "__all__" ? "__all__" : current ? "true" : "false",
|
|
@@ -2989,18 +3205,18 @@ function FilterBody({
|
|
|
2989
3205
|
else onChange({ kind: "boolean", value: v === "true" });
|
|
2990
3206
|
},
|
|
2991
3207
|
children: [
|
|
2992
|
-
/* @__PURE__ */
|
|
2993
|
-
/* @__PURE__ */
|
|
2994
|
-
/* @__PURE__ */
|
|
2995
|
-
/* @__PURE__ */
|
|
2996
|
-
/* @__PURE__ */
|
|
3208
|
+
/* @__PURE__ */ jsx22(SelectTrigger, { className: "h-8 text-xs", children: /* @__PURE__ */ jsx22(SelectValue, {}) }),
|
|
3209
|
+
/* @__PURE__ */ jsxs15(SelectContent, { children: [
|
|
3210
|
+
/* @__PURE__ */ jsx22(SelectItem, { value: "__all__", children: "All" }),
|
|
3211
|
+
/* @__PURE__ */ jsx22(SelectItem, { value: "true", children: "Yes" }),
|
|
3212
|
+
/* @__PURE__ */ jsx22(SelectItem, { value: "false", children: "No" })
|
|
2997
3213
|
] })
|
|
2998
3214
|
]
|
|
2999
3215
|
}
|
|
3000
3216
|
)
|
|
3001
3217
|
] });
|
|
3002
3218
|
}
|
|
3003
|
-
return /* @__PURE__ */
|
|
3219
|
+
return /* @__PURE__ */ jsx22(NumberFilterBody, { value, onChange });
|
|
3004
3220
|
}
|
|
3005
3221
|
function SearchableSelectFilter({
|
|
3006
3222
|
selected,
|
|
@@ -3028,13 +3244,13 @@ function SearchableSelectFilter({
|
|
|
3028
3244
|
next.length === 0 ? void 0 : { kind: "select", value: next[0] ?? "", values: next }
|
|
3029
3245
|
);
|
|
3030
3246
|
};
|
|
3031
|
-
return /* @__PURE__ */
|
|
3032
|
-
/* @__PURE__ */
|
|
3033
|
-
/* @__PURE__ */
|
|
3247
|
+
return /* @__PURE__ */ jsxs15("div", { className: "space-y-1 px-0", children: [
|
|
3248
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between px-1 pb-1", children: [
|
|
3249
|
+
/* @__PURE__ */ jsxs15("p", { className: "text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: [
|
|
3034
3250
|
"Filter",
|
|
3035
3251
|
selected.length > 1 ? ` (any of ${selected.length})` : ""
|
|
3036
3252
|
] }),
|
|
3037
|
-
selected.length > 0 ? /* @__PURE__ */
|
|
3253
|
+
selected.length > 0 ? /* @__PURE__ */ jsx22(
|
|
3038
3254
|
"button",
|
|
3039
3255
|
{
|
|
3040
3256
|
type: "button",
|
|
@@ -3044,8 +3260,8 @@ function SearchableSelectFilter({
|
|
|
3044
3260
|
}
|
|
3045
3261
|
) : null
|
|
3046
3262
|
] }),
|
|
3047
|
-
/* @__PURE__ */
|
|
3048
|
-
/* @__PURE__ */
|
|
3263
|
+
/* @__PURE__ */ jsxs15(Command, { className: "rounded-md border border-border", shouldFilter: false, children: [
|
|
3264
|
+
/* @__PURE__ */ jsx22(
|
|
3049
3265
|
CommandInput,
|
|
3050
3266
|
{
|
|
3051
3267
|
"data-matrx-filter-autofocus": true,
|
|
@@ -3055,10 +3271,10 @@ function SearchableSelectFilter({
|
|
|
3055
3271
|
className: "h-8 text-sm"
|
|
3056
3272
|
}
|
|
3057
3273
|
),
|
|
3058
|
-
/* @__PURE__ */
|
|
3059
|
-
/* @__PURE__ */
|
|
3060
|
-
/* @__PURE__ */
|
|
3061
|
-
/* @__PURE__ */
|
|
3274
|
+
/* @__PURE__ */ jsxs15(CommandList, { className: "max-h-48", children: [
|
|
3275
|
+
/* @__PURE__ */ jsx22(CommandEmpty, { className: "py-3 text-xs text-muted-foreground", children: "No matches" }),
|
|
3276
|
+
/* @__PURE__ */ jsxs15(CommandGroup, { children: [
|
|
3277
|
+
/* @__PURE__ */ jsx22(
|
|
3062
3278
|
CommandItem,
|
|
3063
3279
|
{
|
|
3064
3280
|
value: "__all__",
|
|
@@ -3069,7 +3285,7 @@ function SearchableSelectFilter({
|
|
|
3069
3285
|
),
|
|
3070
3286
|
filtered.map((o) => {
|
|
3071
3287
|
const active = selected.includes(o.value);
|
|
3072
|
-
return /* @__PURE__ */
|
|
3288
|
+
return /* @__PURE__ */ jsxs15(
|
|
3073
3289
|
CommandItem,
|
|
3074
3290
|
{
|
|
3075
3291
|
value: o.value,
|
|
@@ -3079,7 +3295,7 @@ function SearchableSelectFilter({
|
|
|
3079
3295
|
active && "bg-accent text-accent-foreground"
|
|
3080
3296
|
),
|
|
3081
3297
|
children: [
|
|
3082
|
-
/* @__PURE__ */
|
|
3298
|
+
/* @__PURE__ */ jsx22(
|
|
3083
3299
|
"span",
|
|
3084
3300
|
{
|
|
3085
3301
|
className: cn(
|
|
@@ -3087,7 +3303,7 @@ function SearchableSelectFilter({
|
|
|
3087
3303
|
single ? "rounded-full" : "rounded-sm",
|
|
3088
3304
|
active ? "border-primary bg-primary text-primary-foreground" : "border-muted-foreground/40"
|
|
3089
3305
|
),
|
|
3090
|
-
children: active && /* @__PURE__ */
|
|
3306
|
+
children: active && /* @__PURE__ */ jsx22(Check, { className: "h-2.5 w-2.5" })
|
|
3091
3307
|
}
|
|
3092
3308
|
),
|
|
3093
3309
|
o.label
|
|
@@ -3118,10 +3334,10 @@ function NumberFilterBody({
|
|
|
3118
3334
|
}
|
|
3119
3335
|
onChange({ kind: "number", min: nextMin, max: nextMax });
|
|
3120
3336
|
};
|
|
3121
|
-
return /* @__PURE__ */
|
|
3122
|
-
/* @__PURE__ */
|
|
3123
|
-
/* @__PURE__ */
|
|
3124
|
-
(min !== void 0 || max !== void 0) && /* @__PURE__ */
|
|
3337
|
+
return /* @__PURE__ */ jsxs15("div", { className: "space-y-1.5 px-1", children: [
|
|
3338
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between", children: [
|
|
3339
|
+
/* @__PURE__ */ jsx22("p", { className: "text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: "Range" }),
|
|
3340
|
+
(min !== void 0 || max !== void 0) && /* @__PURE__ */ jsx22(
|
|
3125
3341
|
"button",
|
|
3126
3342
|
{
|
|
3127
3343
|
type: "button",
|
|
@@ -3135,8 +3351,8 @@ function NumberFilterBody({
|
|
|
3135
3351
|
}
|
|
3136
3352
|
)
|
|
3137
3353
|
] }),
|
|
3138
|
-
/* @__PURE__ */
|
|
3139
|
-
/* @__PURE__ */
|
|
3354
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-1.5", children: [
|
|
3355
|
+
/* @__PURE__ */ jsx22(
|
|
3140
3356
|
Input,
|
|
3141
3357
|
{
|
|
3142
3358
|
"data-matrx-filter-autofocus": true,
|
|
@@ -3151,8 +3367,8 @@ function NumberFilterBody({
|
|
|
3151
3367
|
style: { fontSize: "16px" }
|
|
3152
3368
|
}
|
|
3153
3369
|
),
|
|
3154
|
-
/* @__PURE__ */
|
|
3155
|
-
/* @__PURE__ */
|
|
3370
|
+
/* @__PURE__ */ jsx22("span", { className: "text-xs text-muted-foreground", children: "\u2013" }),
|
|
3371
|
+
/* @__PURE__ */ jsx22(
|
|
3156
3372
|
Input,
|
|
3157
3373
|
{
|
|
3158
3374
|
value: maxText,
|
|
@@ -3178,7 +3394,7 @@ function parseOptionalNumber(raw) {
|
|
|
3178
3394
|
// src/data-table/ColumnManager.tsx
|
|
3179
3395
|
import { useEffect as useEffect6, useMemo as useMemo3, useState as useState9 } from "react";
|
|
3180
3396
|
init_filter_engine();
|
|
3181
|
-
import { jsx as
|
|
3397
|
+
import { jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3182
3398
|
function ColumnManager({
|
|
3183
3399
|
open,
|
|
3184
3400
|
onOpenChange,
|
|
@@ -3211,18 +3427,18 @@ function ColumnManager({
|
|
|
3211
3427
|
return next;
|
|
3212
3428
|
});
|
|
3213
3429
|
};
|
|
3214
|
-
return /* @__PURE__ */
|
|
3215
|
-
/* @__PURE__ */
|
|
3216
|
-
/* @__PURE__ */
|
|
3217
|
-
/* @__PURE__ */
|
|
3430
|
+
return /* @__PURE__ */ jsx23(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs16(DialogContent, { className: "max-w-md", children: [
|
|
3431
|
+
/* @__PURE__ */ jsxs16(DialogHeader, { children: [
|
|
3432
|
+
/* @__PURE__ */ jsx23(DialogTitle, { children: "Columns" }),
|
|
3433
|
+
/* @__PURE__ */ jsx23(DialogDescription, { children: "Choose the columns to show and set their order." })
|
|
3218
3434
|
] }),
|
|
3219
|
-
/* @__PURE__ */
|
|
3435
|
+
/* @__PURE__ */ jsx23("div", { className: "max-h-[55dvh] divide-y overflow-y-auto rounded-md border", children: draftOrder.map((id, index) => {
|
|
3220
3436
|
const column = byId.get(id);
|
|
3221
3437
|
if (!column) return null;
|
|
3222
3438
|
const label = typeof column.header === "string" ? column.header : id;
|
|
3223
3439
|
const hideable = column.hideable !== false;
|
|
3224
3440
|
const visible = !draftHidden.has(id);
|
|
3225
|
-
return /* @__PURE__ */
|
|
3441
|
+
return /* @__PURE__ */ jsxs16(
|
|
3226
3442
|
"div",
|
|
3227
3443
|
{
|
|
3228
3444
|
className: cn(
|
|
@@ -3230,8 +3446,8 @@ function ColumnManager({
|
|
|
3230
3446
|
!visible && "bg-muted/30 text-muted-foreground"
|
|
3231
3447
|
),
|
|
3232
3448
|
children: [
|
|
3233
|
-
/* @__PURE__ */
|
|
3234
|
-
/* @__PURE__ */
|
|
3449
|
+
/* @__PURE__ */ jsx23(GripVertical, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
|
|
3450
|
+
/* @__PURE__ */ jsx23(
|
|
3235
3451
|
Checkbox,
|
|
3236
3452
|
{
|
|
3237
3453
|
checked: visible,
|
|
@@ -3248,8 +3464,8 @@ function ColumnManager({
|
|
|
3248
3464
|
}
|
|
3249
3465
|
}
|
|
3250
3466
|
),
|
|
3251
|
-
/* @__PURE__ */
|
|
3252
|
-
/* @__PURE__ */
|
|
3467
|
+
/* @__PURE__ */ jsx23("span", { className: "min-w-0 flex-1 truncate text-sm", children: label }),
|
|
3468
|
+
/* @__PURE__ */ jsx23(
|
|
3253
3469
|
Button,
|
|
3254
3470
|
{
|
|
3255
3471
|
type: "button",
|
|
@@ -3259,10 +3475,10 @@ function ColumnManager({
|
|
|
3259
3475
|
"aria-label": `Move ${label} earlier`,
|
|
3260
3476
|
disabled: index === 0,
|
|
3261
3477
|
onClick: () => move(id, -1),
|
|
3262
|
-
children: /* @__PURE__ */
|
|
3478
|
+
children: /* @__PURE__ */ jsx23(ArrowUp, { className: "h-4 w-4" })
|
|
3263
3479
|
}
|
|
3264
3480
|
),
|
|
3265
|
-
/* @__PURE__ */
|
|
3481
|
+
/* @__PURE__ */ jsx23(
|
|
3266
3482
|
Button,
|
|
3267
3483
|
{
|
|
3268
3484
|
type: "button",
|
|
@@ -3272,7 +3488,7 @@ function ColumnManager({
|
|
|
3272
3488
|
"aria-label": `Move ${label} later`,
|
|
3273
3489
|
disabled: index === draftOrder.length - 1,
|
|
3274
3490
|
onClick: () => move(id, 1),
|
|
3275
|
-
children: /* @__PURE__ */
|
|
3491
|
+
children: /* @__PURE__ */ jsx23(ArrowDown, { className: "h-4 w-4" })
|
|
3276
3492
|
}
|
|
3277
3493
|
)
|
|
3278
3494
|
]
|
|
@@ -3280,9 +3496,9 @@ function ColumnManager({
|
|
|
3280
3496
|
id
|
|
3281
3497
|
);
|
|
3282
3498
|
}) }),
|
|
3283
|
-
/* @__PURE__ */
|
|
3284
|
-
/* @__PURE__ */
|
|
3285
|
-
/* @__PURE__ */
|
|
3499
|
+
/* @__PURE__ */ jsxs16(DialogFooter, { children: [
|
|
3500
|
+
/* @__PURE__ */ jsx23(Button, { type: "button", variant: "outline", onClick: () => onOpenChange(false), children: "Cancel" }),
|
|
3501
|
+
/* @__PURE__ */ jsx23(
|
|
3286
3502
|
Button,
|
|
3287
3503
|
{
|
|
3288
3504
|
type: "button",
|
|
@@ -3306,14 +3522,14 @@ import {
|
|
|
3306
3522
|
|
|
3307
3523
|
// src/tooltip.tsx
|
|
3308
3524
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
3309
|
-
import * as
|
|
3310
|
-
import { jsx as
|
|
3525
|
+
import * as React13 from "react";
|
|
3526
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
3311
3527
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
3312
3528
|
var Tooltip = TooltipPrimitive.Root;
|
|
3313
3529
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
3314
|
-
var TooltipContent =
|
|
3530
|
+
var TooltipContent = React13.forwardRef(({ className, sideOffset = 4, container, animated = true, ...props }, ref) => {
|
|
3315
3531
|
const resolved = usePortalContainer(container);
|
|
3316
|
-
return /* @__PURE__ */
|
|
3532
|
+
return /* @__PURE__ */ jsx24(TooltipPrimitive.Portal, { container: resolved ?? null, children: /* @__PURE__ */ jsx24(
|
|
3317
3533
|
TooltipPrimitive.Content,
|
|
3318
3534
|
{
|
|
3319
3535
|
ref,
|
|
@@ -3331,7 +3547,7 @@ var TooltipContent = React12.forwardRef(({ className, sideOffset = 4, container,
|
|
|
3331
3547
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
3332
3548
|
|
|
3333
3549
|
// src/data-table/MatrxUuidCell.tsx
|
|
3334
|
-
import { jsx as
|
|
3550
|
+
import { jsx as jsx25, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3335
3551
|
var SHORT_LEN = 8;
|
|
3336
3552
|
function shortUuid(id, len = SHORT_LEN) {
|
|
3337
3553
|
return id.slice(0, len);
|
|
@@ -3381,7 +3597,7 @@ function MatrxUuidCell({
|
|
|
3381
3597
|
[]
|
|
3382
3598
|
);
|
|
3383
3599
|
if (!value) {
|
|
3384
|
-
return /* @__PURE__ */
|
|
3600
|
+
return /* @__PURE__ */ jsx25("span", { className: "text-muted-foreground/40", children: "\u2014" });
|
|
3385
3601
|
}
|
|
3386
3602
|
const doors = token ? resolveEntityDoors?.(token, value, href) ?? null : null;
|
|
3387
3603
|
const resolvedHref = doors?.href ?? href ?? null;
|
|
@@ -3424,13 +3640,13 @@ function MatrxUuidCell({
|
|
|
3424
3640
|
};
|
|
3425
3641
|
const idNode = (() => {
|
|
3426
3642
|
if (forbidden) {
|
|
3427
|
-
return /* @__PURE__ */
|
|
3428
|
-
/* @__PURE__ */
|
|
3429
|
-
/* @__PURE__ */
|
|
3643
|
+
return /* @__PURE__ */ jsxs17("span", { className: "inline-flex min-w-0 items-center gap-1 font-mono text-xs text-muted-foreground/70 tabular-nums", children: [
|
|
3644
|
+
/* @__PURE__ */ jsx25("span", { className: "min-w-0 truncate", children: display }),
|
|
3645
|
+
/* @__PURE__ */ jsx25(ShieldOff, { className: "h-3 w-3 shrink-0 opacity-60", "aria-hidden": true })
|
|
3430
3646
|
] });
|
|
3431
3647
|
}
|
|
3432
3648
|
if (onOpen) {
|
|
3433
|
-
return /* @__PURE__ */
|
|
3649
|
+
return /* @__PURE__ */ jsxs17(
|
|
3434
3650
|
"button",
|
|
3435
3651
|
{
|
|
3436
3652
|
type: "button",
|
|
@@ -3439,14 +3655,14 @@ function MatrxUuidCell({
|
|
|
3439
3655
|
disabled: opening,
|
|
3440
3656
|
className: "inline-flex min-w-0 items-center gap-1 font-mono text-xs text-sky-600 hover:underline dark:text-sky-400 disabled:opacity-60",
|
|
3441
3657
|
children: [
|
|
3442
|
-
/* @__PURE__ */
|
|
3443
|
-
/* @__PURE__ */
|
|
3658
|
+
/* @__PURE__ */ jsx25("span", { className: "min-w-0 truncate tabular-nums", children: display }),
|
|
3659
|
+
/* @__PURE__ */ jsx25(PanelRight, { className: "h-3 w-3 shrink-0 opacity-50" })
|
|
3444
3660
|
]
|
|
3445
3661
|
}
|
|
3446
3662
|
);
|
|
3447
3663
|
}
|
|
3448
3664
|
if (resolvedHref) {
|
|
3449
|
-
return /* @__PURE__ */
|
|
3665
|
+
return /* @__PURE__ */ jsxs17(
|
|
3450
3666
|
"a",
|
|
3451
3667
|
{
|
|
3452
3668
|
href: resolvedHref,
|
|
@@ -3456,15 +3672,15 @@ function MatrxUuidCell({
|
|
|
3456
3672
|
onClick: stop,
|
|
3457
3673
|
className: "inline-flex min-w-0 items-center gap-1 font-mono text-xs text-sky-600 hover:underline dark:text-sky-400",
|
|
3458
3674
|
children: [
|
|
3459
|
-
/* @__PURE__ */
|
|
3460
|
-
/* @__PURE__ */
|
|
3675
|
+
/* @__PURE__ */ jsx25("span", { className: "min-w-0 truncate tabular-nums", children: display }),
|
|
3676
|
+
/* @__PURE__ */ jsx25(ExternalLink, { className: "h-3 w-3 shrink-0 opacity-50" })
|
|
3461
3677
|
]
|
|
3462
3678
|
}
|
|
3463
3679
|
);
|
|
3464
3680
|
}
|
|
3465
|
-
return /* @__PURE__ */
|
|
3681
|
+
return /* @__PURE__ */ jsx25("span", { className: "min-w-0 truncate font-mono text-xs text-muted-foreground tabular-nums select-all", children: display });
|
|
3466
3682
|
})();
|
|
3467
|
-
return /* @__PURE__ */
|
|
3683
|
+
return /* @__PURE__ */ jsxs17(
|
|
3468
3684
|
"span",
|
|
3469
3685
|
{
|
|
3470
3686
|
"data-matrx-cell-control": true,
|
|
@@ -3474,11 +3690,11 @@ function MatrxUuidCell({
|
|
|
3474
3690
|
),
|
|
3475
3691
|
onClick: stop,
|
|
3476
3692
|
children: [
|
|
3477
|
-
/* @__PURE__ */
|
|
3478
|
-
/* @__PURE__ */
|
|
3479
|
-
/* @__PURE__ */
|
|
3693
|
+
/* @__PURE__ */ jsx25(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ jsxs17(Tooltip, { children: [
|
|
3694
|
+
/* @__PURE__ */ jsx25(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx25("span", { className: "inline-flex min-w-0 max-w-full items-center", children: idNode }) }),
|
|
3695
|
+
/* @__PURE__ */ jsx25(TooltipContent, { side: "top", className: "max-w-sm break-all font-mono", children: forbidden ? `No access \xB7 ${tip}` : tip })
|
|
3480
3696
|
] }) }),
|
|
3481
|
-
/* @__PURE__ */
|
|
3697
|
+
/* @__PURE__ */ jsx25(
|
|
3482
3698
|
"button",
|
|
3483
3699
|
{
|
|
3484
3700
|
type: "button",
|
|
@@ -3489,10 +3705,10 @@ function MatrxUuidCell({
|
|
|
3489
3705
|
"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground focus:outline-none",
|
|
3490
3706
|
copied && "text-primary"
|
|
3491
3707
|
),
|
|
3492
|
-
children: copied ? /* @__PURE__ */
|
|
3708
|
+
children: copied ? /* @__PURE__ */ jsx25(Check, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx25(Copy, { className: "h-3 w-3" })
|
|
3493
3709
|
}
|
|
3494
3710
|
),
|
|
3495
|
-
canPeek ? /* @__PURE__ */
|
|
3711
|
+
canPeek ? /* @__PURE__ */ jsx25(
|
|
3496
3712
|
"button",
|
|
3497
3713
|
{
|
|
3498
3714
|
type: "button",
|
|
@@ -3503,10 +3719,10 @@ function MatrxUuidCell({
|
|
|
3503
3719
|
"aria-label": `Quick look at ${label ?? "record"}`,
|
|
3504
3720
|
title: `Quick look at ${label ?? "record"}`,
|
|
3505
3721
|
className: "inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground focus:outline-none",
|
|
3506
|
-
children: /* @__PURE__ */
|
|
3722
|
+
children: /* @__PURE__ */ jsx25(Lightbulb, { className: "h-3 w-3" })
|
|
3507
3723
|
}
|
|
3508
3724
|
) : null,
|
|
3509
|
-
onOpen && resolvedHref && !forbidden ? /* @__PURE__ */
|
|
3725
|
+
onOpen && resolvedHref && !forbidden ? /* @__PURE__ */ jsx25(
|
|
3510
3726
|
"a",
|
|
3511
3727
|
{
|
|
3512
3728
|
href: resolvedHref,
|
|
@@ -3516,12 +3732,12 @@ function MatrxUuidCell({
|
|
|
3516
3732
|
"aria-label": `Open ${label ?? "record"} in a new tab`,
|
|
3517
3733
|
title: `Open ${label ?? "record"} in a new tab`,
|
|
3518
3734
|
className: "inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground focus:outline-none",
|
|
3519
|
-
children: /* @__PURE__ */
|
|
3735
|
+
children: /* @__PURE__ */ jsx25(ExternalLink, { className: "h-3 w-3" })
|
|
3520
3736
|
}
|
|
3521
3737
|
) : null,
|
|
3522
3738
|
trailing,
|
|
3523
3739
|
notice,
|
|
3524
|
-
canPeek && peekOpen && ResourcePeek ? /* @__PURE__ */
|
|
3740
|
+
canPeek && peekOpen && ResourcePeek ? /* @__PURE__ */ jsx25(
|
|
3525
3741
|
ResourcePeek,
|
|
3526
3742
|
{
|
|
3527
3743
|
kind: doors?.peekKind ?? token ?? "record",
|
|
@@ -3544,7 +3760,7 @@ function tokenFromColumnName(name) {
|
|
|
3544
3760
|
}
|
|
3545
3761
|
|
|
3546
3762
|
// src/data-table/DataRowInspector.tsx
|
|
3547
|
-
import { jsx as
|
|
3763
|
+
import { jsx as jsx26, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3548
3764
|
var noFieldToken = () => null;
|
|
3549
3765
|
function formatValue(value) {
|
|
3550
3766
|
if (value == null) return "\u2014";
|
|
@@ -3573,7 +3789,7 @@ function DataRowInspector({
|
|
|
3573
3789
|
tokenForField = noFieldToken
|
|
3574
3790
|
}) {
|
|
3575
3791
|
const entries = isPlainObject(row) ? Object.entries(row) : [["value", row]];
|
|
3576
|
-
const fieldButtons = (key, value) => fieldCopy ? /* @__PURE__ */
|
|
3792
|
+
const fieldButtons = (key, value) => fieldCopy ? /* @__PURE__ */ jsx26("div", { className: "absolute right-1 top-1 opacity-0 transition-opacity focus-within:opacity-100 group-hover/field:opacity-100", children: /* @__PURE__ */ jsx26(
|
|
3577
3793
|
CopyButtons,
|
|
3578
3794
|
{
|
|
3579
3795
|
size: "xs",
|
|
@@ -3588,21 +3804,21 @@ function DataRowInspector({
|
|
|
3588
3804
|
})
|
|
3589
3805
|
}
|
|
3590
3806
|
) }) : null;
|
|
3591
|
-
return /* @__PURE__ */
|
|
3807
|
+
return /* @__PURE__ */ jsxs18(
|
|
3592
3808
|
"div",
|
|
3593
3809
|
{
|
|
3594
3810
|
className: cn("flex h-full min-h-0 flex-col overflow-hidden", className),
|
|
3595
3811
|
children: [
|
|
3596
|
-
title ? /* @__PURE__ */
|
|
3597
|
-
/* @__PURE__ */
|
|
3812
|
+
title ? /* @__PURE__ */ jsx26("div", { className: "shrink-0 border-b border-border px-3 py-2 text-sm font-medium", children: title }) : null,
|
|
3813
|
+
/* @__PURE__ */ jsx26("div", { className: "min-h-0 flex-1 overflow-auto p-3", children: /* @__PURE__ */ jsx26("dl", { className: "space-y-2", children: entries.map(([key, value]) => {
|
|
3598
3814
|
if (isUuidValue(value)) {
|
|
3599
|
-
return /* @__PURE__ */
|
|
3815
|
+
return /* @__PURE__ */ jsxs18(
|
|
3600
3816
|
"div",
|
|
3601
3817
|
{
|
|
3602
3818
|
className: "group/field relative grid grid-cols-[minmax(7rem,9rem)_1fr] gap-2 rounded-md border border-border/60 bg-muted/20 px-2.5 py-2",
|
|
3603
3819
|
children: [
|
|
3604
|
-
/* @__PURE__ */
|
|
3605
|
-
/* @__PURE__ */
|
|
3820
|
+
/* @__PURE__ */ jsx26("dt", { className: "truncate text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: key }),
|
|
3821
|
+
/* @__PURE__ */ jsx26("dd", { className: "min-w-0", children: /* @__PURE__ */ jsx26(
|
|
3606
3822
|
MatrxUuidCell,
|
|
3607
3823
|
{
|
|
3608
3824
|
value,
|
|
@@ -3617,13 +3833,13 @@ function DataRowInspector({
|
|
|
3617
3833
|
}
|
|
3618
3834
|
const formatted = formatValue(value);
|
|
3619
3835
|
const multiline = formatted.includes("\n") || formatted.length > 80;
|
|
3620
|
-
return /* @__PURE__ */
|
|
3836
|
+
return /* @__PURE__ */ jsxs18(
|
|
3621
3837
|
"div",
|
|
3622
3838
|
{
|
|
3623
3839
|
className: "group/field relative grid grid-cols-[minmax(7rem,9rem)_1fr] gap-2 rounded-md border border-border/60 bg-muted/20 py-2 pl-2.5 pr-12",
|
|
3624
3840
|
children: [
|
|
3625
|
-
/* @__PURE__ */
|
|
3626
|
-
/* @__PURE__ */
|
|
3841
|
+
/* @__PURE__ */ jsx26("dt", { className: "truncate text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: key }),
|
|
3842
|
+
/* @__PURE__ */ jsx26(
|
|
3627
3843
|
"dd",
|
|
3628
3844
|
{
|
|
3629
3845
|
className: cn(
|
|
@@ -3646,7 +3862,7 @@ function DataRowInspector({
|
|
|
3646
3862
|
|
|
3647
3863
|
// src/data-table/DataRowWindow.tsx
|
|
3648
3864
|
import { useEffect as useEffect8, useState as useState11 } from "react";
|
|
3649
|
-
import { jsx as
|
|
3865
|
+
import { jsx as jsx27, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3650
3866
|
function DataRowWindow({
|
|
3651
3867
|
isOpen,
|
|
3652
3868
|
onClose,
|
|
@@ -3672,9 +3888,9 @@ function DataRowWindow({
|
|
|
3672
3888
|
setTab(defaultTab ?? (hasEdit ? "edit" : "view"));
|
|
3673
3889
|
}, [isOpen, windowId, hasEdit, defaultTab]);
|
|
3674
3890
|
if (!isOpen) return null;
|
|
3675
|
-
const viewBody = viewContent ?? /* @__PURE__ */
|
|
3676
|
-
const body = children ?? /* @__PURE__ */
|
|
3677
|
-
return /* @__PURE__ */
|
|
3891
|
+
const viewBody = viewContent ?? /* @__PURE__ */ jsx27(DataRowInspector, { row });
|
|
3892
|
+
const body = children ?? /* @__PURE__ */ jsx27("div", { className: "flex h-full min-h-0 flex-1 flex-col overflow-hidden", children: hasTabs ? tab === "edit" ? /* @__PURE__ */ jsx27("div", { className: "min-h-0 flex-1 overflow-y-auto", children: editContent }) : /* @__PURE__ */ jsx27("div", { className: "min-h-0 flex-1 overflow-y-auto", children: viewBody }) : /* @__PURE__ */ jsx27("div", { className: "min-h-0 flex-1 overflow-y-auto", children: viewBody }) });
|
|
3893
|
+
return /* @__PURE__ */ jsx27(
|
|
3678
3894
|
WindowPanel,
|
|
3679
3895
|
{
|
|
3680
3896
|
id: windowId,
|
|
@@ -3688,26 +3904,26 @@ function DataRowWindow({
|
|
|
3688
3904
|
bodyClassName: "flex min-h-0 flex-1 flex-col overflow-hidden p-0",
|
|
3689
3905
|
sidebarDefaultSize: 140,
|
|
3690
3906
|
sidebarMinSize: 110,
|
|
3691
|
-
sidebar: hasTabs ? /* @__PURE__ */
|
|
3907
|
+
sidebar: hasTabs ? /* @__PURE__ */ jsxs19(
|
|
3692
3908
|
"nav",
|
|
3693
3909
|
{
|
|
3694
3910
|
"aria-label": "Row window tabs",
|
|
3695
3911
|
className: "flex h-full flex-col gap-0.5 overflow-y-auto p-1.5",
|
|
3696
3912
|
children: [
|
|
3697
|
-
/* @__PURE__ */
|
|
3913
|
+
/* @__PURE__ */ jsx27(
|
|
3698
3914
|
TabButton,
|
|
3699
3915
|
{
|
|
3700
3916
|
active: tab === "view",
|
|
3701
|
-
icon: /* @__PURE__ */
|
|
3917
|
+
icon: /* @__PURE__ */ jsx27(Eye, { className: "h-4 w-4 shrink-0" }),
|
|
3702
3918
|
label: "View",
|
|
3703
3919
|
onClick: () => setTab("view")
|
|
3704
3920
|
}
|
|
3705
3921
|
),
|
|
3706
|
-
/* @__PURE__ */
|
|
3922
|
+
/* @__PURE__ */ jsx27(
|
|
3707
3923
|
TabButton,
|
|
3708
3924
|
{
|
|
3709
3925
|
active: tab === "edit",
|
|
3710
|
-
icon: /* @__PURE__ */
|
|
3926
|
+
icon: /* @__PURE__ */ jsx27(Pencil, { className: "h-4 w-4 shrink-0" }),
|
|
3711
3927
|
label: "Edit",
|
|
3712
3928
|
onClick: () => setTab("edit")
|
|
3713
3929
|
}
|
|
@@ -3725,7 +3941,7 @@ function TabButton({
|
|
|
3725
3941
|
label,
|
|
3726
3942
|
onClick
|
|
3727
3943
|
}) {
|
|
3728
|
-
return /* @__PURE__ */
|
|
3944
|
+
return /* @__PURE__ */ jsxs19(
|
|
3729
3945
|
"button",
|
|
3730
3946
|
{
|
|
3731
3947
|
type: "button",
|
|
@@ -3738,14 +3954,14 @@ function TabButton({
|
|
|
3738
3954
|
),
|
|
3739
3955
|
children: [
|
|
3740
3956
|
icon,
|
|
3741
|
-
/* @__PURE__ */
|
|
3957
|
+
/* @__PURE__ */ jsx27("span", { className: "min-w-0 flex-1 truncate", children: label })
|
|
3742
3958
|
]
|
|
3743
3959
|
}
|
|
3744
3960
|
);
|
|
3745
3961
|
}
|
|
3746
3962
|
|
|
3747
3963
|
// src/data-table/DirtySavePill.tsx
|
|
3748
|
-
import { jsx as
|
|
3964
|
+
import { jsx as jsx28, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3749
3965
|
function DirtySavePill({
|
|
3750
3966
|
changeCount,
|
|
3751
3967
|
saving,
|
|
@@ -3754,20 +3970,20 @@ function DirtySavePill({
|
|
|
3754
3970
|
className
|
|
3755
3971
|
}) {
|
|
3756
3972
|
if (changeCount <= 0) return null;
|
|
3757
|
-
return /* @__PURE__ */
|
|
3973
|
+
return /* @__PURE__ */ jsx28(
|
|
3758
3974
|
"div",
|
|
3759
3975
|
{
|
|
3760
3976
|
className: cn(
|
|
3761
3977
|
"pointer-events-none fixed inset-x-0 bottom-6 z-50 flex justify-center pb-safe",
|
|
3762
3978
|
className
|
|
3763
3979
|
),
|
|
3764
|
-
children: /* @__PURE__ */
|
|
3765
|
-
/* @__PURE__ */
|
|
3980
|
+
children: /* @__PURE__ */ jsxs20("div", { className: "pointer-events-auto flex items-center gap-2 rounded-full border border-border bg-card px-3 py-1.5 shadow-lg elevation-2", children: [
|
|
3981
|
+
/* @__PURE__ */ jsxs20("span", { className: "px-1 text-xs font-medium text-muted-foreground", children: [
|
|
3766
3982
|
changeCount,
|
|
3767
3983
|
" unsaved change",
|
|
3768
3984
|
changeCount === 1 ? "" : "s"
|
|
3769
3985
|
] }),
|
|
3770
|
-
/* @__PURE__ */
|
|
3986
|
+
/* @__PURE__ */ jsxs20(
|
|
3771
3987
|
Button,
|
|
3772
3988
|
{
|
|
3773
3989
|
type: "button",
|
|
@@ -3777,12 +3993,12 @@ function DirtySavePill({
|
|
|
3777
3993
|
disabled: saving,
|
|
3778
3994
|
onClick: onCancel,
|
|
3779
3995
|
children: [
|
|
3780
|
-
/* @__PURE__ */
|
|
3996
|
+
/* @__PURE__ */ jsx28(X, { className: "h-3.5 w-3.5" }),
|
|
3781
3997
|
"Cancel"
|
|
3782
3998
|
]
|
|
3783
3999
|
}
|
|
3784
4000
|
),
|
|
3785
|
-
/* @__PURE__ */
|
|
4001
|
+
/* @__PURE__ */ jsxs20(
|
|
3786
4002
|
Button,
|
|
3787
4003
|
{
|
|
3788
4004
|
type: "button",
|
|
@@ -3791,7 +4007,7 @@ function DirtySavePill({
|
|
|
3791
4007
|
disabled: saving,
|
|
3792
4008
|
onClick: onSave,
|
|
3793
4009
|
children: [
|
|
3794
|
-
saving ? /* @__PURE__ */
|
|
4010
|
+
saving ? /* @__PURE__ */ jsx28(Loader2, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ jsx28(Save, { className: "h-3.5 w-3.5" }),
|
|
3795
4011
|
"Save"
|
|
3796
4012
|
]
|
|
3797
4013
|
}
|
|
@@ -3804,7 +4020,7 @@ function DirtySavePill({
|
|
|
3804
4020
|
// src/data-table/EditableTableCell.tsx
|
|
3805
4021
|
import { useState as useState12 } from "react";
|
|
3806
4022
|
init_filter_engine();
|
|
3807
|
-
import { jsx as
|
|
4023
|
+
import { jsx as jsx29, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3808
4024
|
function CellEditShell({
|
|
3809
4025
|
href,
|
|
3810
4026
|
display,
|
|
@@ -3813,8 +4029,8 @@ function CellEditShell({
|
|
|
3813
4029
|
editButton
|
|
3814
4030
|
}) {
|
|
3815
4031
|
const { Link: HostLink } = useMatrxDataTableHost();
|
|
3816
|
-
const Link = HostLink ?? ((props) => /* @__PURE__ */
|
|
3817
|
-
return /* @__PURE__ */
|
|
4032
|
+
const Link = HostLink ?? ((props) => /* @__PURE__ */ jsx29("a", { ...props }));
|
|
4033
|
+
return /* @__PURE__ */ jsxs21(
|
|
3818
4034
|
"span",
|
|
3819
4035
|
{
|
|
3820
4036
|
className: cn(
|
|
@@ -3826,7 +4042,7 @@ function CellEditShell({
|
|
|
3826
4042
|
className
|
|
3827
4043
|
),
|
|
3828
4044
|
children: [
|
|
3829
|
-
href ? /* @__PURE__ */
|
|
4045
|
+
href ? /* @__PURE__ */ jsx29(
|
|
3830
4046
|
Link,
|
|
3831
4047
|
{
|
|
3832
4048
|
href,
|
|
@@ -3834,7 +4050,7 @@ function CellEditShell({
|
|
|
3834
4050
|
className: "min-w-0 flex-1 overflow-hidden truncate rounded outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
3835
4051
|
children: display
|
|
3836
4052
|
}
|
|
3837
|
-
) : /* @__PURE__ */
|
|
4053
|
+
) : /* @__PURE__ */ jsx29("span", { className: "block min-w-0 flex-1 overflow-hidden", children: display }),
|
|
3838
4054
|
editButton
|
|
3839
4055
|
]
|
|
3840
4056
|
}
|
|
@@ -3855,7 +4071,7 @@ function EditableTableCell({
|
|
|
3855
4071
|
const [open, setOpen] = useState12(false);
|
|
3856
4072
|
const usePencil = Boolean(href) || editTrigger === "pencil";
|
|
3857
4073
|
if (editType === "string") {
|
|
3858
|
-
return /* @__PURE__ */
|
|
4074
|
+
return /* @__PURE__ */ jsx29(
|
|
3859
4075
|
InlineStringEditor,
|
|
3860
4076
|
{
|
|
3861
4077
|
value: stringifyCellValue(value),
|
|
@@ -3868,15 +4084,15 @@ function EditableTableCell({
|
|
|
3868
4084
|
}
|
|
3869
4085
|
);
|
|
3870
4086
|
}
|
|
3871
|
-
return /* @__PURE__ */
|
|
3872
|
-
usePencil ? /* @__PURE__ */
|
|
4087
|
+
return /* @__PURE__ */ jsxs21(Popover, { open, onOpenChange: setOpen, children: [
|
|
4088
|
+
usePencil ? /* @__PURE__ */ jsx29(
|
|
3873
4089
|
CellEditShell,
|
|
3874
4090
|
{
|
|
3875
4091
|
...href === void 0 ? {} : { href },
|
|
3876
4092
|
display,
|
|
3877
4093
|
...dirty === void 0 ? {} : { dirty },
|
|
3878
4094
|
...className === void 0 ? {} : { className },
|
|
3879
|
-
editButton: /* @__PURE__ */
|
|
4095
|
+
editButton: /* @__PURE__ */ jsx29(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx29(
|
|
3880
4096
|
"button",
|
|
3881
4097
|
{
|
|
3882
4098
|
type: "button",
|
|
@@ -3884,11 +4100,11 @@ function EditableTableCell({
|
|
|
3884
4100
|
title: "Edit",
|
|
3885
4101
|
onClick: (e) => e.stopPropagation(),
|
|
3886
4102
|
className: CELL_PENCIL_CLASS,
|
|
3887
|
-
children: /* @__PURE__ */
|
|
4103
|
+
children: /* @__PURE__ */ jsx29(Pencil, { className: "h-3 w-3" })
|
|
3888
4104
|
}
|
|
3889
4105
|
) })
|
|
3890
4106
|
}
|
|
3891
|
-
) : /* @__PURE__ */
|
|
4107
|
+
) : /* @__PURE__ */ jsx29(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs21(
|
|
3892
4108
|
"button",
|
|
3893
4109
|
{
|
|
3894
4110
|
type: "button",
|
|
@@ -3900,18 +4116,18 @@ function EditableTableCell({
|
|
|
3900
4116
|
),
|
|
3901
4117
|
title: "Edit",
|
|
3902
4118
|
children: [
|
|
3903
|
-
/* @__PURE__ */
|
|
3904
|
-
editType === "select" ? /* @__PURE__ */
|
|
4119
|
+
/* @__PURE__ */ jsx29("span", { className: "min-w-0 flex-1 overflow-hidden", children: display }),
|
|
4120
|
+
editType === "select" ? /* @__PURE__ */ jsx29(ChevronDown, { className: "h-3 w-3 shrink-0 text-muted-foreground/70 transition-colors group-hover/cell-select:text-foreground" }) : null
|
|
3905
4121
|
]
|
|
3906
4122
|
}
|
|
3907
4123
|
) }),
|
|
3908
|
-
/* @__PURE__ */
|
|
4124
|
+
/* @__PURE__ */ jsx29(
|
|
3909
4125
|
PopoverContent,
|
|
3910
4126
|
{
|
|
3911
4127
|
align: "start",
|
|
3912
4128
|
className: "w-56 p-2",
|
|
3913
4129
|
onClick: (e) => e.stopPropagation(),
|
|
3914
|
-
children: /* @__PURE__ */
|
|
4130
|
+
children: /* @__PURE__ */ jsx29(
|
|
3915
4131
|
TypedEditor,
|
|
3916
4132
|
{
|
|
3917
4133
|
editType,
|
|
@@ -3941,14 +4157,14 @@ function InlineStringEditor({
|
|
|
3941
4157
|
const [draft, setDraft] = useState12(value);
|
|
3942
4158
|
if (!editing) {
|
|
3943
4159
|
if (usePencil) {
|
|
3944
|
-
return /* @__PURE__ */
|
|
4160
|
+
return /* @__PURE__ */ jsx29(
|
|
3945
4161
|
CellEditShell,
|
|
3946
4162
|
{
|
|
3947
4163
|
...href === void 0 ? {} : { href },
|
|
3948
4164
|
display,
|
|
3949
4165
|
...dirty === void 0 ? {} : { dirty },
|
|
3950
4166
|
...className === void 0 ? {} : { className },
|
|
3951
|
-
editButton: /* @__PURE__ */
|
|
4167
|
+
editButton: /* @__PURE__ */ jsx29(
|
|
3952
4168
|
"button",
|
|
3953
4169
|
{
|
|
3954
4170
|
type: "button",
|
|
@@ -3960,13 +4176,13 @@ function InlineStringEditor({
|
|
|
3960
4176
|
setEditing(true);
|
|
3961
4177
|
},
|
|
3962
4178
|
className: CELL_PENCIL_CLASS,
|
|
3963
|
-
children: /* @__PURE__ */
|
|
4179
|
+
children: /* @__PURE__ */ jsx29(Pencil, { className: "h-3 w-3" })
|
|
3964
4180
|
}
|
|
3965
4181
|
)
|
|
3966
4182
|
}
|
|
3967
4183
|
);
|
|
3968
4184
|
}
|
|
3969
|
-
return /* @__PURE__ */
|
|
4185
|
+
return /* @__PURE__ */ jsx29(
|
|
3970
4186
|
"button",
|
|
3971
4187
|
{
|
|
3972
4188
|
type: "button",
|
|
@@ -3985,7 +4201,7 @@ function InlineStringEditor({
|
|
|
3985
4201
|
}
|
|
3986
4202
|
);
|
|
3987
4203
|
}
|
|
3988
|
-
return /* @__PURE__ */
|
|
4204
|
+
return /* @__PURE__ */ jsx29(
|
|
3989
4205
|
Input,
|
|
3990
4206
|
{
|
|
3991
4207
|
autoFocus: true,
|
|
@@ -4021,9 +4237,9 @@ function TypedEditor({
|
|
|
4021
4237
|
}) {
|
|
4022
4238
|
if (editType === "boolean") {
|
|
4023
4239
|
const checked = Boolean(value);
|
|
4024
|
-
return /* @__PURE__ */
|
|
4025
|
-
/* @__PURE__ */
|
|
4026
|
-
/* @__PURE__ */
|
|
4240
|
+
return /* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between gap-2", children: [
|
|
4241
|
+
/* @__PURE__ */ jsx29("span", { className: "text-xs font-medium", children: "Value" }),
|
|
4242
|
+
/* @__PURE__ */ jsx29(
|
|
4027
4243
|
Checkbox,
|
|
4028
4244
|
{
|
|
4029
4245
|
checked,
|
|
@@ -4033,7 +4249,7 @@ function TypedEditor({
|
|
|
4033
4249
|
] });
|
|
4034
4250
|
}
|
|
4035
4251
|
if (editType === "number") {
|
|
4036
|
-
return /* @__PURE__ */
|
|
4252
|
+
return /* @__PURE__ */ jsx29(
|
|
4037
4253
|
NumberEditor,
|
|
4038
4254
|
{
|
|
4039
4255
|
value: typeof value === "number" ? value : Number(value) || 0,
|
|
@@ -4043,7 +4259,7 @@ function TypedEditor({
|
|
|
4043
4259
|
);
|
|
4044
4260
|
}
|
|
4045
4261
|
if (editType === "tags") {
|
|
4046
|
-
return /* @__PURE__ */
|
|
4262
|
+
return /* @__PURE__ */ jsx29(
|
|
4047
4263
|
TagsEditor,
|
|
4048
4264
|
{
|
|
4049
4265
|
value: Array.isArray(value) ? value.map(String) : [],
|
|
@@ -4054,19 +4270,19 @@ function TypedEditor({
|
|
|
4054
4270
|
);
|
|
4055
4271
|
}
|
|
4056
4272
|
if (editType === "select") {
|
|
4057
|
-
return /* @__PURE__ */
|
|
4273
|
+
return /* @__PURE__ */ jsxs21(
|
|
4058
4274
|
Select,
|
|
4059
4275
|
{
|
|
4060
4276
|
value: stringifyCellValue(value),
|
|
4061
4277
|
onValueChange: (v) => onCommit(v),
|
|
4062
4278
|
children: [
|
|
4063
|
-
/* @__PURE__ */
|
|
4064
|
-
/* @__PURE__ */
|
|
4279
|
+
/* @__PURE__ */ jsx29(SelectTrigger, { className: "h-8 text-xs", children: /* @__PURE__ */ jsx29(SelectValue, {}) }),
|
|
4280
|
+
/* @__PURE__ */ jsx29(SelectContent, { children: editOptions.map((o) => /* @__PURE__ */ jsx29(SelectItem, { value: o.value, children: o.label }, o.value)) })
|
|
4065
4281
|
]
|
|
4066
4282
|
}
|
|
4067
4283
|
);
|
|
4068
4284
|
}
|
|
4069
|
-
return /* @__PURE__ */
|
|
4285
|
+
return /* @__PURE__ */ jsx29(
|
|
4070
4286
|
Input,
|
|
4071
4287
|
{
|
|
4072
4288
|
type: "date",
|
|
@@ -4096,10 +4312,10 @@ function TagsEditor({
|
|
|
4096
4312
|
const matches = suggestions.filter(
|
|
4097
4313
|
(s) => !tags.includes(s.value) && s.value !== "__none__" && (!draft || s.label.toLowerCase().includes(draft.trim().toLowerCase()))
|
|
4098
4314
|
).slice(0, 6);
|
|
4099
|
-
return /* @__PURE__ */
|
|
4100
|
-
/* @__PURE__ */
|
|
4101
|
-
tags.length === 0 && /* @__PURE__ */
|
|
4102
|
-
tags.map((tag) => /* @__PURE__ */
|
|
4315
|
+
return /* @__PURE__ */ jsxs21("div", { className: "space-y-2", onClick: (e) => e.stopPropagation(), children: [
|
|
4316
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex flex-wrap gap-1", children: [
|
|
4317
|
+
tags.length === 0 && /* @__PURE__ */ jsx29("span", { className: "text-xs text-muted-foreground", children: "No tags" }),
|
|
4318
|
+
tags.map((tag) => /* @__PURE__ */ jsxs21(
|
|
4103
4319
|
"button",
|
|
4104
4320
|
{
|
|
4105
4321
|
type: "button",
|
|
@@ -4108,13 +4324,13 @@ function TagsEditor({
|
|
|
4108
4324
|
title: `Remove ${tag}`,
|
|
4109
4325
|
children: [
|
|
4110
4326
|
tag,
|
|
4111
|
-
/* @__PURE__ */
|
|
4327
|
+
/* @__PURE__ */ jsx29(X, { className: "h-2.5 w-2.5" })
|
|
4112
4328
|
]
|
|
4113
4329
|
},
|
|
4114
4330
|
tag
|
|
4115
4331
|
))
|
|
4116
4332
|
] }),
|
|
4117
|
-
/* @__PURE__ */
|
|
4333
|
+
/* @__PURE__ */ jsx29(
|
|
4118
4334
|
Input,
|
|
4119
4335
|
{
|
|
4120
4336
|
autoFocus: true,
|
|
@@ -4135,7 +4351,7 @@ function TagsEditor({
|
|
|
4135
4351
|
className: "h-8 text-xs"
|
|
4136
4352
|
}
|
|
4137
4353
|
),
|
|
4138
|
-
matches.length > 0 && /* @__PURE__ */
|
|
4354
|
+
matches.length > 0 && /* @__PURE__ */ jsx29("div", { className: "flex flex-wrap gap-1", children: matches.map((s) => /* @__PURE__ */ jsxs21(
|
|
4139
4355
|
"button",
|
|
4140
4356
|
{
|
|
4141
4357
|
type: "button",
|
|
@@ -4148,8 +4364,8 @@ function TagsEditor({
|
|
|
4148
4364
|
},
|
|
4149
4365
|
s.value
|
|
4150
4366
|
)) }),
|
|
4151
|
-
/* @__PURE__ */
|
|
4152
|
-
/* @__PURE__ */
|
|
4367
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex justify-end gap-1 pt-1", children: [
|
|
4368
|
+
/* @__PURE__ */ jsx29(
|
|
4153
4369
|
Button,
|
|
4154
4370
|
{
|
|
4155
4371
|
size: "sm",
|
|
@@ -4157,17 +4373,17 @@ function TagsEditor({
|
|
|
4157
4373
|
className: "h-7 px-2",
|
|
4158
4374
|
"aria-label": "Cancel edit",
|
|
4159
4375
|
onClick: onCancel,
|
|
4160
|
-
children: /* @__PURE__ */
|
|
4376
|
+
children: /* @__PURE__ */ jsx29(X, { className: "h-3.5 w-3.5" })
|
|
4161
4377
|
}
|
|
4162
4378
|
),
|
|
4163
|
-
/* @__PURE__ */
|
|
4379
|
+
/* @__PURE__ */ jsx29(
|
|
4164
4380
|
Button,
|
|
4165
4381
|
{
|
|
4166
4382
|
size: "sm",
|
|
4167
4383
|
className: "h-7 px-2",
|
|
4168
4384
|
"aria-label": "Apply tags",
|
|
4169
4385
|
onClick: () => onCommit(tags),
|
|
4170
|
-
children: /* @__PURE__ */
|
|
4386
|
+
children: /* @__PURE__ */ jsx29(Check, { className: "h-3.5 w-3.5" })
|
|
4171
4387
|
}
|
|
4172
4388
|
)
|
|
4173
4389
|
] })
|
|
@@ -4179,8 +4395,8 @@ function NumberEditor({
|
|
|
4179
4395
|
onCancel
|
|
4180
4396
|
}) {
|
|
4181
4397
|
const [draft, setDraft] = useState12(String(value));
|
|
4182
|
-
return /* @__PURE__ */
|
|
4183
|
-
/* @__PURE__ */
|
|
4398
|
+
return /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-2", children: [
|
|
4399
|
+
/* @__PURE__ */ jsx29(
|
|
4184
4400
|
Input,
|
|
4185
4401
|
{
|
|
4186
4402
|
autoFocus: true,
|
|
@@ -4197,8 +4413,8 @@ function NumberEditor({
|
|
|
4197
4413
|
}
|
|
4198
4414
|
}
|
|
4199
4415
|
),
|
|
4200
|
-
/* @__PURE__ */
|
|
4201
|
-
/* @__PURE__ */
|
|
4416
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex justify-end gap-1", children: [
|
|
4417
|
+
/* @__PURE__ */ jsx29(
|
|
4202
4418
|
Button,
|
|
4203
4419
|
{
|
|
4204
4420
|
type: "button",
|
|
@@ -4207,10 +4423,10 @@ function NumberEditor({
|
|
|
4207
4423
|
className: "h-7",
|
|
4208
4424
|
"aria-label": "Cancel edit",
|
|
4209
4425
|
onClick: onCancel,
|
|
4210
|
-
children: /* @__PURE__ */
|
|
4426
|
+
children: /* @__PURE__ */ jsx29(X, { className: "h-3.5 w-3.5" })
|
|
4211
4427
|
}
|
|
4212
4428
|
),
|
|
4213
|
-
/* @__PURE__ */
|
|
4429
|
+
/* @__PURE__ */ jsx29(
|
|
4214
4430
|
Button,
|
|
4215
4431
|
{
|
|
4216
4432
|
type: "button",
|
|
@@ -4221,7 +4437,7 @@ function NumberEditor({
|
|
|
4221
4437
|
const n = Number(draft);
|
|
4222
4438
|
if (Number.isFinite(n)) onCommit(n);
|
|
4223
4439
|
},
|
|
4224
|
-
children: /* @__PURE__ */
|
|
4440
|
+
children: /* @__PURE__ */ jsx29(Check, { className: "h-3.5 w-3.5" })
|
|
4225
4441
|
}
|
|
4226
4442
|
)
|
|
4227
4443
|
] })
|
|
@@ -4229,24 +4445,24 @@ function NumberEditor({
|
|
|
4229
4445
|
}
|
|
4230
4446
|
|
|
4231
4447
|
// src/data-table/ToolbarFacets.tsx
|
|
4232
|
-
import { jsx as
|
|
4448
|
+
import { jsx as jsx30, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4233
4449
|
function ToolbarFacets({ facets }) {
|
|
4234
4450
|
if (facets.length === 0) return null;
|
|
4235
|
-
return /* @__PURE__ */
|
|
4451
|
+
return /* @__PURE__ */ jsx30("div", { className: "flex flex-wrap items-center gap-2", children: facets.map((facet) => {
|
|
4236
4452
|
if (facet.type === "custom") {
|
|
4237
|
-
return /* @__PURE__ */
|
|
4453
|
+
return /* @__PURE__ */ jsx30("div", { children: facet.render() }, facet.id);
|
|
4238
4454
|
}
|
|
4239
4455
|
const defaultValue = facet.defaultValue ?? facet.options[0]?.value ?? "";
|
|
4240
4456
|
const isNonDefault = facet.value !== defaultValue;
|
|
4241
|
-
return /* @__PURE__ */
|
|
4457
|
+
return /* @__PURE__ */ jsxs22(
|
|
4242
4458
|
"div",
|
|
4243
4459
|
{
|
|
4244
4460
|
className: "flex flex-wrap items-center gap-1.5 max-sm:grid max-sm:w-full max-sm:grid-cols-3",
|
|
4245
4461
|
children: [
|
|
4246
|
-
facet.label ? /* @__PURE__ */
|
|
4462
|
+
facet.label ? /* @__PURE__ */ jsx30("span", { className: "mr-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: facet.label }) : null,
|
|
4247
4463
|
facet.options.map((opt) => {
|
|
4248
4464
|
const active = facet.value === opt.value;
|
|
4249
|
-
return /* @__PURE__ */
|
|
4465
|
+
return /* @__PURE__ */ jsxs22(
|
|
4250
4466
|
Button,
|
|
4251
4467
|
{
|
|
4252
4468
|
type: "button",
|
|
@@ -4260,7 +4476,7 @@ function ToolbarFacets({ facets }) {
|
|
|
4260
4476
|
children: [
|
|
4261
4477
|
opt.icon,
|
|
4262
4478
|
opt.label,
|
|
4263
|
-
active && isNonDefault ? /* @__PURE__ */
|
|
4479
|
+
active && isNonDefault ? /* @__PURE__ */ jsx30(
|
|
4264
4480
|
"span",
|
|
4265
4481
|
{
|
|
4266
4482
|
role: "button",
|
|
@@ -4279,7 +4495,7 @@ function ToolbarFacets({ facets }) {
|
|
|
4279
4495
|
facet.onChange(defaultValue);
|
|
4280
4496
|
}
|
|
4281
4497
|
},
|
|
4282
|
-
children: /* @__PURE__ */
|
|
4498
|
+
children: /* @__PURE__ */ jsx30(X, { className: "h-3 w-3" })
|
|
4283
4499
|
}
|
|
4284
4500
|
) : null
|
|
4285
4501
|
]
|
|
@@ -4305,7 +4521,7 @@ function resetToolbarFacets(facets) {
|
|
|
4305
4521
|
// src/data-table/LayeredFilterBuilder.tsx
|
|
4306
4522
|
import { useState as useState13 } from "react";
|
|
4307
4523
|
init_layered_filters();
|
|
4308
|
-
import { Fragment as Fragment3, jsx as
|
|
4524
|
+
import { Fragment as Fragment3, jsx as jsx31, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4309
4525
|
function moveRule(rules, from, to) {
|
|
4310
4526
|
if (from === to || to < 0 || to >= rules.length) return [...rules];
|
|
4311
4527
|
const next = [...rules];
|
|
@@ -4351,8 +4567,8 @@ function LayeredFilterBuilder({
|
|
|
4351
4567
|
const reorder = (from, to) => {
|
|
4352
4568
|
onChange(moveRule(rules, from, to));
|
|
4353
4569
|
};
|
|
4354
|
-
return /* @__PURE__ */
|
|
4355
|
-
/* @__PURE__ */
|
|
4570
|
+
return /* @__PURE__ */ jsxs23("div", { className: "flex min-w-0 flex-wrap items-center gap-1", children: [
|
|
4571
|
+
/* @__PURE__ */ jsxs23(
|
|
4356
4572
|
Popover,
|
|
4357
4573
|
{
|
|
4358
4574
|
open,
|
|
@@ -4364,7 +4580,7 @@ function LayeredFilterBuilder({
|
|
|
4364
4580
|
}
|
|
4365
4581
|
},
|
|
4366
4582
|
children: [
|
|
4367
|
-
/* @__PURE__ */
|
|
4583
|
+
/* @__PURE__ */ jsx31(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs23(
|
|
4368
4584
|
Button,
|
|
4369
4585
|
{
|
|
4370
4586
|
type: "button",
|
|
@@ -4373,25 +4589,25 @@ function LayeredFilterBuilder({
|
|
|
4373
4589
|
className: "h-8 gap-1.5 px-2 text-xs",
|
|
4374
4590
|
"aria-label": label,
|
|
4375
4591
|
children: [
|
|
4376
|
-
/* @__PURE__ */
|
|
4377
|
-
/* @__PURE__ */
|
|
4378
|
-
rules.length > 0 ? /* @__PURE__ */
|
|
4592
|
+
/* @__PURE__ */ jsx31(SlidersHorizontal, { className: "h-3.5 w-3.5" }),
|
|
4593
|
+
/* @__PURE__ */ jsx31("span", { className: "hidden sm:inline", children: rules.length > 0 ? `${rules.length} layers` : "Advanced" }),
|
|
4594
|
+
rules.length > 0 ? /* @__PURE__ */ jsx31("span", { className: "sm:hidden", children: rules.length }) : null
|
|
4379
4595
|
]
|
|
4380
4596
|
}
|
|
4381
4597
|
) }),
|
|
4382
|
-
/* @__PURE__ */
|
|
4598
|
+
/* @__PURE__ */ jsxs23(
|
|
4383
4599
|
PopoverContent,
|
|
4384
4600
|
{
|
|
4385
4601
|
align: "start",
|
|
4386
4602
|
sideOffset: 6,
|
|
4387
4603
|
className: "w-[min(46rem,calc(100vw-1rem))] p-0",
|
|
4388
4604
|
children: [
|
|
4389
|
-
/* @__PURE__ */
|
|
4390
|
-
/* @__PURE__ */
|
|
4391
|
-
/* @__PURE__ */
|
|
4392
|
-
/* @__PURE__ */
|
|
4605
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex items-start justify-between gap-3 border-b border-border px-3 py-2.5", children: [
|
|
4606
|
+
/* @__PURE__ */ jsxs23("div", { children: [
|
|
4607
|
+
/* @__PURE__ */ jsx31("p", { className: "text-sm font-semibold text-foreground", children: "Narrow these results" }),
|
|
4608
|
+
/* @__PURE__ */ jsx31("p", { className: "text-xs text-muted-foreground", children: "Every layer must match. Drag layers to put them in the order that makes sense to you." })
|
|
4393
4609
|
] }),
|
|
4394
|
-
rules.length > 0 ? /* @__PURE__ */
|
|
4610
|
+
rules.length > 0 ? /* @__PURE__ */ jsx31(
|
|
4395
4611
|
Button,
|
|
4396
4612
|
{
|
|
4397
4613
|
type: "button",
|
|
@@ -4403,10 +4619,10 @@ function LayeredFilterBuilder({
|
|
|
4403
4619
|
}
|
|
4404
4620
|
) : null
|
|
4405
4621
|
] }),
|
|
4406
|
-
/* @__PURE__ */
|
|
4407
|
-
/* @__PURE__ */
|
|
4408
|
-
/* @__PURE__ */
|
|
4409
|
-
] }) : rules.map((rule, index) => /* @__PURE__ */
|
|
4622
|
+
/* @__PURE__ */ jsx31("div", { className: "max-h-[min(28rem,65dvh)] space-y-1.5 overflow-y-auto p-2.5 scrollbar-thin", children: rules.length === 0 ? /* @__PURE__ */ jsxs23("div", { className: "rounded-md border border-dashed border-border px-3 py-5 text-center", children: [
|
|
4623
|
+
/* @__PURE__ */ jsx31("p", { className: "text-sm font-medium text-foreground", children: "Start with one simple layer" }),
|
|
4624
|
+
/* @__PURE__ */ jsx31("p", { className: "mt-1 text-xs text-muted-foreground", children: "For example: Keyword contains ITAD, then Keyword doesn't have the word \u201Cwhat\u201D." })
|
|
4625
|
+
] }) : rules.map((rule, index) => /* @__PURE__ */ jsx31(
|
|
4410
4626
|
LayeredRuleRow,
|
|
4411
4627
|
{
|
|
4412
4628
|
index,
|
|
@@ -4426,9 +4642,9 @@ function LayeredFilterBuilder({
|
|
|
4426
4642
|
},
|
|
4427
4643
|
rule.id
|
|
4428
4644
|
)) }),
|
|
4429
|
-
/* @__PURE__ */
|
|
4430
|
-
/* @__PURE__ */
|
|
4431
|
-
/* @__PURE__ */
|
|
4645
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex items-center justify-between gap-2 border-t border-border px-3 py-2", children: [
|
|
4646
|
+
/* @__PURE__ */ jsx31("p", { className: "text-[11px] text-muted-foreground", children: "The regular search still works and is applied before these layers." }),
|
|
4647
|
+
/* @__PURE__ */ jsxs23(
|
|
4432
4648
|
Button,
|
|
4433
4649
|
{
|
|
4434
4650
|
type: "button",
|
|
@@ -4438,7 +4654,7 @@ function LayeredFilterBuilder({
|
|
|
4438
4654
|
disabled: rules.length >= maxRules,
|
|
4439
4655
|
onClick: addRule,
|
|
4440
4656
|
children: [
|
|
4441
|
-
/* @__PURE__ */
|
|
4657
|
+
/* @__PURE__ */ jsx31(Plus, { className: "h-3.5 w-3.5" }),
|
|
4442
4658
|
" Add layer"
|
|
4443
4659
|
]
|
|
4444
4660
|
}
|
|
@@ -4450,7 +4666,7 @@ function LayeredFilterBuilder({
|
|
|
4450
4666
|
]
|
|
4451
4667
|
}
|
|
4452
4668
|
),
|
|
4453
|
-
rules.map((rule, index) => /* @__PURE__ */
|
|
4669
|
+
rules.map((rule, index) => /* @__PURE__ */ jsxs23(
|
|
4454
4670
|
"span",
|
|
4455
4671
|
{
|
|
4456
4672
|
className: cn(
|
|
@@ -4458,7 +4674,7 @@ function LayeredFilterBuilder({
|
|
|
4458
4674
|
isCompleteLayeredFilterRule(rule) ? "border-border bg-muted/50 text-foreground" : "border-dashed border-warning/50 bg-warning/10 text-warning"
|
|
4459
4675
|
),
|
|
4460
4676
|
children: [
|
|
4461
|
-
/* @__PURE__ */
|
|
4677
|
+
/* @__PURE__ */ jsxs23(
|
|
4462
4678
|
"button",
|
|
4463
4679
|
{
|
|
4464
4680
|
type: "button",
|
|
@@ -4466,19 +4682,19 @@ function LayeredFilterBuilder({
|
|
|
4466
4682
|
onClick: () => setOpen(true),
|
|
4467
4683
|
title: isCompleteLayeredFilterRule(rule) ? layeredFilterRuleSummary(rule, fields) : `Layer ${index + 1} needs a value`,
|
|
4468
4684
|
children: [
|
|
4469
|
-
/* @__PURE__ */
|
|
4685
|
+
/* @__PURE__ */ jsx31("span", { className: "mr-1 text-muted-foreground", children: index + 1 }),
|
|
4470
4686
|
isCompleteLayeredFilterRule(rule) ? layeredFilterRuleSummary(rule, fields) : "Choose a value"
|
|
4471
4687
|
]
|
|
4472
4688
|
}
|
|
4473
4689
|
),
|
|
4474
|
-
/* @__PURE__ */
|
|
4690
|
+
/* @__PURE__ */ jsx31(
|
|
4475
4691
|
"button",
|
|
4476
4692
|
{
|
|
4477
4693
|
type: "button",
|
|
4478
4694
|
className: "shrink-0 rounded-full p-0.5 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
4479
4695
|
"aria-label": `Remove filter layer ${index + 1}`,
|
|
4480
4696
|
onClick: () => removeRule(index),
|
|
4481
|
-
children: /* @__PURE__ */
|
|
4697
|
+
children: /* @__PURE__ */ jsx31(X, { className: "h-3 w-3" })
|
|
4482
4698
|
}
|
|
4483
4699
|
)
|
|
4484
4700
|
]
|
|
@@ -4508,7 +4724,7 @@ function LayeredRuleRow({
|
|
|
4508
4724
|
event.preventDefault();
|
|
4509
4725
|
onKeyboardMove(event.key === "ArrowUp" ? -1 : 1);
|
|
4510
4726
|
};
|
|
4511
|
-
return /* @__PURE__ */
|
|
4727
|
+
return /* @__PURE__ */ jsxs23(
|
|
4512
4728
|
"div",
|
|
4513
4729
|
{
|
|
4514
4730
|
className: cn(
|
|
@@ -4521,7 +4737,7 @@ function LayeredRuleRow({
|
|
|
4521
4737
|
onDrop(index);
|
|
4522
4738
|
},
|
|
4523
4739
|
children: [
|
|
4524
|
-
/* @__PURE__ */
|
|
4740
|
+
/* @__PURE__ */ jsx31(
|
|
4525
4741
|
"button",
|
|
4526
4742
|
{
|
|
4527
4743
|
type: "button",
|
|
@@ -4535,10 +4751,10 @@ function LayeredRuleRow({
|
|
|
4535
4751
|
},
|
|
4536
4752
|
onDragEnd,
|
|
4537
4753
|
onKeyDown: handleMoveKey,
|
|
4538
|
-
children: /* @__PURE__ */
|
|
4754
|
+
children: /* @__PURE__ */ jsx31(GripVertical, { className: "h-3.5 w-3.5" })
|
|
4539
4755
|
}
|
|
4540
4756
|
),
|
|
4541
|
-
/* @__PURE__ */
|
|
4757
|
+
/* @__PURE__ */ jsxs23(
|
|
4542
4758
|
Select,
|
|
4543
4759
|
{
|
|
4544
4760
|
value: field.id,
|
|
@@ -4556,16 +4772,16 @@ function LayeredRuleRow({
|
|
|
4556
4772
|
});
|
|
4557
4773
|
},
|
|
4558
4774
|
children: [
|
|
4559
|
-
/* @__PURE__ */
|
|
4775
|
+
/* @__PURE__ */ jsx31(
|
|
4560
4776
|
SelectTrigger,
|
|
4561
4777
|
{
|
|
4562
4778
|
size: "sm",
|
|
4563
4779
|
className: "h-7 w-full text-xs max-sm:col-span-1",
|
|
4564
4780
|
"aria-label": `Filter layer ${index + 1} field`,
|
|
4565
|
-
children: /* @__PURE__ */
|
|
4781
|
+
children: /* @__PURE__ */ jsx31(SelectValue, {})
|
|
4566
4782
|
}
|
|
4567
4783
|
),
|
|
4568
|
-
/* @__PURE__ */
|
|
4784
|
+
/* @__PURE__ */ jsx31(SelectContent, { children: fields.map((candidate) => /* @__PURE__ */ jsx31(
|
|
4569
4785
|
SelectItem,
|
|
4570
4786
|
{
|
|
4571
4787
|
value: candidate.id,
|
|
@@ -4577,7 +4793,7 @@ function LayeredRuleRow({
|
|
|
4577
4793
|
]
|
|
4578
4794
|
}
|
|
4579
4795
|
),
|
|
4580
|
-
/* @__PURE__ */
|
|
4796
|
+
/* @__PURE__ */ jsxs23(
|
|
4581
4797
|
Select,
|
|
4582
4798
|
{
|
|
4583
4799
|
value: rule.operator,
|
|
@@ -4589,35 +4805,35 @@ function LayeredRuleRow({
|
|
|
4589
4805
|
});
|
|
4590
4806
|
},
|
|
4591
4807
|
children: [
|
|
4592
|
-
/* @__PURE__ */
|
|
4808
|
+
/* @__PURE__ */ jsx31(
|
|
4593
4809
|
SelectTrigger,
|
|
4594
4810
|
{
|
|
4595
4811
|
size: "sm",
|
|
4596
4812
|
className: "h-7 w-full text-xs max-sm:col-start-2",
|
|
4597
4813
|
"aria-label": `Filter layer ${index + 1} operator`,
|
|
4598
|
-
children: /* @__PURE__ */
|
|
4814
|
+
children: /* @__PURE__ */ jsx31(SelectValue, {})
|
|
4599
4815
|
}
|
|
4600
4816
|
),
|
|
4601
|
-
/* @__PURE__ */
|
|
4817
|
+
/* @__PURE__ */ jsx31(SelectContent, { children: operators.map((operator) => /* @__PURE__ */ jsx31(SelectItem, { value: operator, className: "text-xs", children: LAYERED_FILTER_OPERATOR_LABELS[operator] }, operator)) })
|
|
4602
4818
|
]
|
|
4603
4819
|
}
|
|
4604
4820
|
),
|
|
4605
|
-
/* @__PURE__ */
|
|
4821
|
+
/* @__PURE__ */ jsx31("div", { className: "min-w-0 max-sm:col-span-3 max-sm:col-start-1", children: !needsValue ? /* @__PURE__ */ jsx31("span", { className: "flex h-7 items-center px-2 text-xs text-muted-foreground", children: "No value needed" }) : field.kind === "select" ? /* @__PURE__ */ jsxs23(
|
|
4606
4822
|
Select,
|
|
4607
4823
|
{
|
|
4608
4824
|
value: rule.value,
|
|
4609
4825
|
onValueChange: (value) => onChange({ value }),
|
|
4610
4826
|
children: [
|
|
4611
|
-
/* @__PURE__ */
|
|
4827
|
+
/* @__PURE__ */ jsx31(
|
|
4612
4828
|
SelectTrigger,
|
|
4613
4829
|
{
|
|
4614
4830
|
size: "sm",
|
|
4615
4831
|
className: "h-7 w-full text-xs",
|
|
4616
4832
|
"aria-label": `Filter layer ${index + 1} value`,
|
|
4617
|
-
children: /* @__PURE__ */
|
|
4833
|
+
children: /* @__PURE__ */ jsx31(SelectValue, {})
|
|
4618
4834
|
}
|
|
4619
4835
|
),
|
|
4620
|
-
/* @__PURE__ */
|
|
4836
|
+
/* @__PURE__ */ jsx31(SelectContent, { children: field.options.map((option) => /* @__PURE__ */ jsx31(
|
|
4621
4837
|
SelectItem,
|
|
4622
4838
|
{
|
|
4623
4839
|
value: option.value,
|
|
@@ -4628,8 +4844,8 @@ function LayeredRuleRow({
|
|
|
4628
4844
|
)) })
|
|
4629
4845
|
]
|
|
4630
4846
|
}
|
|
4631
|
-
) : /* @__PURE__ */
|
|
4632
|
-
/* @__PURE__ */
|
|
4847
|
+
) : /* @__PURE__ */ jsxs23("div", { className: "flex items-center gap-1", children: [
|
|
4848
|
+
/* @__PURE__ */ jsx31(
|
|
4633
4849
|
Input,
|
|
4634
4850
|
{
|
|
4635
4851
|
value: rule.value,
|
|
@@ -4640,9 +4856,9 @@ function LayeredRuleRow({
|
|
|
4640
4856
|
"aria-label": `Filter layer ${index + 1} value`
|
|
4641
4857
|
}
|
|
4642
4858
|
),
|
|
4643
|
-
rule.operator === "between" ? /* @__PURE__ */
|
|
4644
|
-
/* @__PURE__ */
|
|
4645
|
-
/* @__PURE__ */
|
|
4859
|
+
rule.operator === "between" ? /* @__PURE__ */ jsxs23(Fragment3, { children: [
|
|
4860
|
+
/* @__PURE__ */ jsx31("span", { className: "text-[11px] text-muted-foreground", children: "and" }),
|
|
4861
|
+
/* @__PURE__ */ jsx31(
|
|
4646
4862
|
Input,
|
|
4647
4863
|
{
|
|
4648
4864
|
value: rule.valueTo ?? "",
|
|
@@ -4655,7 +4871,7 @@ function LayeredRuleRow({
|
|
|
4655
4871
|
)
|
|
4656
4872
|
] }) : null
|
|
4657
4873
|
] }) }),
|
|
4658
|
-
/* @__PURE__ */
|
|
4874
|
+
/* @__PURE__ */ jsx31(
|
|
4659
4875
|
Button,
|
|
4660
4876
|
{
|
|
4661
4877
|
type: "button",
|
|
@@ -4664,7 +4880,7 @@ function LayeredRuleRow({
|
|
|
4664
4880
|
className: "h-7 w-7 p-0 text-muted-foreground hover:text-destructive max-sm:col-start-3 max-sm:row-start-1",
|
|
4665
4881
|
"aria-label": `Remove filter layer ${index + 1}`,
|
|
4666
4882
|
onClick: onRemove,
|
|
4667
|
-
children: /* @__PURE__ */
|
|
4883
|
+
children: /* @__PURE__ */ jsx31(Trash2, { className: "h-3.5 w-3.5" })
|
|
4668
4884
|
}
|
|
4669
4885
|
)
|
|
4670
4886
|
]
|
|
@@ -4679,7 +4895,6 @@ init_filter_engine();
|
|
|
4679
4895
|
// src/data-table/infer-filter.ts
|
|
4680
4896
|
init_filter_engine();
|
|
4681
4897
|
var SELECT_CARDINALITY_CAP = 24;
|
|
4682
|
-
var EXPLICIT_SELECT_CAP = 500;
|
|
4683
4898
|
function resolveFilterKind(col, sampleRows) {
|
|
4684
4899
|
if (col.filter === false) return null;
|
|
4685
4900
|
if (col.filter && col.filter !== "auto") return col.filter;
|
|
@@ -4697,7 +4912,6 @@ function resolveFilterKind(col, sampleRows) {
|
|
|
4697
4912
|
return "text";
|
|
4698
4913
|
}
|
|
4699
4914
|
function collectSelectOptions(col, rows) {
|
|
4700
|
-
const cap = col.filter === "select" ? EXPLICIT_SELECT_CAP : SELECT_CARDINALITY_CAP;
|
|
4701
4915
|
const seen = /* @__PURE__ */ new Set();
|
|
4702
4916
|
const options = [];
|
|
4703
4917
|
let hasEmpty = false;
|
|
@@ -4711,7 +4925,6 @@ function collectSelectOptions(col, rows) {
|
|
|
4711
4925
|
if (col.filterOptions?.length || seen.has(value)) continue;
|
|
4712
4926
|
seen.add(value);
|
|
4713
4927
|
options.push({ value, label: value });
|
|
4714
|
-
if (options.length >= cap) break;
|
|
4715
4928
|
}
|
|
4716
4929
|
const base = col.filterOptions?.length ? [...col.filterOptions] : options.sort((a, b) => a.label.localeCompare(b.label));
|
|
4717
4930
|
if (hasEmpty) {
|
|
@@ -4771,13 +4984,13 @@ function safeQueryPage(requestedPage, totalItems, pageSize) {
|
|
|
4771
4984
|
}
|
|
4772
4985
|
|
|
4773
4986
|
// src/data-table/MatrxDataTable.tsx
|
|
4774
|
-
import { jsx as
|
|
4987
|
+
import { Fragment as Fragment5, jsx as jsx32, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
4775
4988
|
function TableRowCopyControl({
|
|
4776
4989
|
copy,
|
|
4777
4990
|
row,
|
|
4778
4991
|
size
|
|
4779
4992
|
}) {
|
|
4780
|
-
return /* @__PURE__ */
|
|
4993
|
+
return /* @__PURE__ */ jsx32(
|
|
4781
4994
|
CopyButtons,
|
|
4782
4995
|
{
|
|
4783
4996
|
size,
|
|
@@ -4798,8 +5011,8 @@ function isStringArray(value) {
|
|
|
4798
5011
|
}
|
|
4799
5012
|
var activeUrlTableIds = /* @__PURE__ */ new Set();
|
|
4800
5013
|
function MatrxDataTable(props) {
|
|
4801
|
-
if (!props.urlState) return /* @__PURE__ */
|
|
4802
|
-
return /* @__PURE__ */
|
|
5014
|
+
if (!props.urlState) return /* @__PURE__ */ jsx32(MatrxDataTableCore, { ...props });
|
|
5015
|
+
return /* @__PURE__ */ jsx32(MatrxDataTableWithUrlState, { ...props, urlState: props.urlState });
|
|
4803
5016
|
}
|
|
4804
5017
|
function MatrxDataTableWithUrlState({
|
|
4805
5018
|
urlState,
|
|
@@ -4854,7 +5067,7 @@ function MatrxDataTableWithUrlState({
|
|
|
4854
5067
|
props.selection?.onSelectedIdsChange(ids);
|
|
4855
5068
|
}
|
|
4856
5069
|
} : props.selection;
|
|
4857
|
-
return /* @__PURE__ */
|
|
5070
|
+
return /* @__PURE__ */ jsx32(
|
|
4858
5071
|
MatrxDataTableCore,
|
|
4859
5072
|
{
|
|
4860
5073
|
...props,
|
|
@@ -5055,18 +5268,76 @@ function MatrxDataTableCore({
|
|
|
5055
5268
|
onWindowRowIdChange?.(id);
|
|
5056
5269
|
};
|
|
5057
5270
|
const [windowRowSnapshot, setWindowRowSnapshot] = useState14(null);
|
|
5058
|
-
const
|
|
5059
|
-
const
|
|
5271
|
+
const editScopeKey = appendQueryKey === null ? "\0local" : `append:${appendQueryKey}`;
|
|
5272
|
+
const [editsByScope, setEditsByScope] = useState14({});
|
|
5273
|
+
const editRevisionRef = useRef4({});
|
|
5274
|
+
const [savingByScope, setSavingByScope] = useState14({});
|
|
5275
|
+
const [confirmForeignDraftDiscard, setConfirmForeignDraftDiscard] = useState14(false);
|
|
5276
|
+
const edits = editsByScope[editScopeKey]?.values ?? {};
|
|
5277
|
+
const saving = (savingByScope[editScopeKey] ?? 0) > 0;
|
|
5060
5278
|
const setEdits = (next) => {
|
|
5061
|
-
|
|
5062
|
-
|
|
5279
|
+
const scope = editScopeKey;
|
|
5280
|
+
setEditsByScope((current) => {
|
|
5281
|
+
const previous = current[scope];
|
|
5282
|
+
const values = typeof next === "function" ? next(previous?.values ?? {}) : next;
|
|
5063
5283
|
return {
|
|
5064
|
-
|
|
5065
|
-
|
|
5284
|
+
...current,
|
|
5285
|
+
[scope]: {
|
|
5286
|
+
sourceKey: appendQueryKey,
|
|
5287
|
+
values,
|
|
5288
|
+
rows: appendQueryKey === null ? data : [...data],
|
|
5289
|
+
revisions: previous?.revisions ?? {}
|
|
5290
|
+
}
|
|
5066
5291
|
};
|
|
5067
5292
|
});
|
|
5068
5293
|
};
|
|
5069
|
-
const
|
|
5294
|
+
const setCellEdit = (rowId, field, value) => {
|
|
5295
|
+
const scope = editScopeKey;
|
|
5296
|
+
const scopeRevisions = editRevisionRef.current[scope] ?? {};
|
|
5297
|
+
const revision = (scopeRevisions[rowId]?.[field] ?? 0) + 1;
|
|
5298
|
+
editRevisionRef.current[scope] = {
|
|
5299
|
+
...scopeRevisions,
|
|
5300
|
+
[rowId]: { ...scopeRevisions[rowId] ?? {}, [field]: revision }
|
|
5301
|
+
};
|
|
5302
|
+
setEditsByScope((current) => {
|
|
5303
|
+
const previous = current[scope];
|
|
5304
|
+
const values = {
|
|
5305
|
+
...previous?.values ?? {},
|
|
5306
|
+
[rowId]: { ...previous?.values[rowId] ?? {}, [field]: value }
|
|
5307
|
+
};
|
|
5308
|
+
const revisions = {
|
|
5309
|
+
...previous?.revisions ?? {},
|
|
5310
|
+
[rowId]: { ...previous?.revisions[rowId] ?? {}, [field]: revision }
|
|
5311
|
+
};
|
|
5312
|
+
return {
|
|
5313
|
+
...current,
|
|
5314
|
+
[scope]: {
|
|
5315
|
+
sourceKey: appendQueryKey,
|
|
5316
|
+
values,
|
|
5317
|
+
rows: appendQueryKey === null ? data : [...data],
|
|
5318
|
+
revisions
|
|
5319
|
+
}
|
|
5320
|
+
};
|
|
5321
|
+
});
|
|
5322
|
+
return revision;
|
|
5323
|
+
};
|
|
5324
|
+
const startSaving = (scope) => {
|
|
5325
|
+
setSavingByScope((current) => ({ ...current, [scope]: (current[scope] ?? 0) + 1 }));
|
|
5326
|
+
};
|
|
5327
|
+
const finishSaving = (scope) => {
|
|
5328
|
+
setSavingByScope((current) => {
|
|
5329
|
+
const remaining = Math.max(0, (current[scope] ?? 1) - 1);
|
|
5330
|
+
const next = { ...current };
|
|
5331
|
+
if (remaining === 0) delete next[scope];
|
|
5332
|
+
else next[scope] = remaining;
|
|
5333
|
+
return next;
|
|
5334
|
+
});
|
|
5335
|
+
};
|
|
5336
|
+
const foreignDrafts = Object.entries(editsByScope).filter(([scope, draft]) => scope !== editScopeKey && Object.keys(draft.values).length > 0).map(([, draft]) => draft);
|
|
5337
|
+
const foreignDraftPayload = foreignDrafts.map((draft) => ({
|
|
5338
|
+
sourceKey: draft.sourceKey,
|
|
5339
|
+
rows: Object.entries(draft.values).map(([rowId, columns2]) => ({ rowId, columns: columns2 }))
|
|
5340
|
+
}));
|
|
5070
5341
|
const selection = appendSourceChanged && selectionConfig ? { ...selectionConfig, selectedIds: [] } : selectionConfig;
|
|
5071
5342
|
useEffect9(() => {
|
|
5072
5343
|
const previous = committedAppendQueryKey.current;
|
|
@@ -5077,8 +5348,6 @@ function MatrxDataTableCore({
|
|
|
5077
5348
|
setUncontrolledSelectedId(null);
|
|
5078
5349
|
setUncontrolledWindowRowId(null);
|
|
5079
5350
|
setWindowRowSnapshot(null);
|
|
5080
|
-
setEdits({});
|
|
5081
|
-
setSaving(false);
|
|
5082
5351
|
onSelectedIdChange?.(null);
|
|
5083
5352
|
onWindowRowIdChange?.(null);
|
|
5084
5353
|
selectionConfig?.onSelectedIdsChange([]);
|
|
@@ -5353,32 +5622,31 @@ function MatrxDataTableCore({
|
|
|
5353
5622
|
resetToolbarFacets(toolbar?.facets);
|
|
5354
5623
|
};
|
|
5355
5624
|
const commitCell = (rowId, field, next) => {
|
|
5625
|
+
const scope = editScopeKey;
|
|
5356
5626
|
const nextEdits = { [rowId]: { [field]: next } };
|
|
5357
|
-
|
|
5358
|
-
const rowEdits = { ...prev[rowId] ?? {}, [field]: next };
|
|
5359
|
-
return { ...prev, [rowId]: rowEdits };
|
|
5360
|
-
});
|
|
5627
|
+
const revision = setCellEdit(rowId, field, next);
|
|
5361
5628
|
if (edit?.autoSave && edit.onSave) {
|
|
5362
|
-
|
|
5363
|
-
|
|
5364
|
-
|
|
5365
|
-
|
|
5366
|
-
|
|
5629
|
+
const rowsAtCommit = appendQueryKey === null ? data : [...data];
|
|
5630
|
+
const save = edit.onSave;
|
|
5631
|
+
startSaving(scope);
|
|
5632
|
+
void Promise.resolve().then(() => save(nextEdits, rowsAtCommit)).then(() => {
|
|
5633
|
+
setEditsByScope((current) => {
|
|
5634
|
+
const draft = current[scope];
|
|
5635
|
+
if (!draft || draft.revisions[rowId]?.[field] !== revision) return current;
|
|
5636
|
+
const rowDraft = draft.values[rowId];
|
|
5637
|
+
if (!rowDraft) return current;
|
|
5367
5638
|
const { [field]: _saved, ...remainingFields } = rowDraft;
|
|
5368
|
-
const
|
|
5369
|
-
if (Object.keys(remainingFields).length === 0)
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
nextDrafts[rowId] = remainingFields;
|
|
5373
|
-
}
|
|
5374
|
-
return nextDrafts;
|
|
5639
|
+
const values = { ...draft.values };
|
|
5640
|
+
if (Object.keys(remainingFields).length === 0) delete values[rowId];
|
|
5641
|
+
else values[rowId] = remainingFields;
|
|
5642
|
+
return { ...current, [scope]: { ...draft, values } };
|
|
5375
5643
|
});
|
|
5376
5644
|
toast.success("Change saved");
|
|
5377
5645
|
}).catch((error) => {
|
|
5378
5646
|
toast.error(
|
|
5379
5647
|
`Couldn't save: ${error instanceof Error ? error.message : String(error)}`
|
|
5380
5648
|
);
|
|
5381
|
-
}).finally(() =>
|
|
5649
|
+
}).finally(() => finishSaving(scope));
|
|
5382
5650
|
}
|
|
5383
5651
|
};
|
|
5384
5652
|
const discardRowEdits = (rowId) => {
|
|
@@ -5562,17 +5830,40 @@ function MatrxDataTableCore({
|
|
|
5562
5830
|
};
|
|
5563
5831
|
const handleSaveEdits = async () => {
|
|
5564
5832
|
if (!edit?.onSave || changeCount === 0) return;
|
|
5565
|
-
|
|
5833
|
+
const scope = editScopeKey;
|
|
5834
|
+
const draft = editsByScope[scope];
|
|
5835
|
+
if (!draft) return;
|
|
5836
|
+
const values = draft.values;
|
|
5837
|
+
const revisions = draft.revisions;
|
|
5838
|
+
const rows = appendQueryKey === null ? data : draft.rows;
|
|
5839
|
+
const save = edit.onSave;
|
|
5840
|
+
startSaving(scope);
|
|
5566
5841
|
try {
|
|
5567
|
-
await
|
|
5568
|
-
|
|
5842
|
+
await Promise.resolve().then(() => save(values, rows));
|
|
5843
|
+
setEditsByScope((current) => {
|
|
5844
|
+
const currentDraft = current[scope];
|
|
5845
|
+
if (!currentDraft) return current;
|
|
5846
|
+
const nextValues = {};
|
|
5847
|
+
for (const [rowId, rowValues] of Object.entries(currentDraft.values)) {
|
|
5848
|
+
const savedRow = values[rowId];
|
|
5849
|
+
const savedRevisions = revisions[rowId];
|
|
5850
|
+
const currentRevisions = currentDraft.revisions[rowId];
|
|
5851
|
+
const remaining = Object.fromEntries(
|
|
5852
|
+
Object.entries(rowValues).filter(
|
|
5853
|
+
([field]) => !Object.hasOwn(savedRow ?? {}, field) || currentRevisions?.[field] !== savedRevisions?.[field]
|
|
5854
|
+
)
|
|
5855
|
+
);
|
|
5856
|
+
if (Object.keys(remaining).length > 0) nextValues[rowId] = remaining;
|
|
5857
|
+
}
|
|
5858
|
+
return { ...current, [scope]: { ...currentDraft, values: nextValues } };
|
|
5859
|
+
});
|
|
5569
5860
|
toast.success("Changes saved");
|
|
5570
5861
|
} catch (e) {
|
|
5571
5862
|
toast.error(
|
|
5572
5863
|
`Couldn't save: ${e instanceof Error ? e.message : String(e)}`
|
|
5573
5864
|
);
|
|
5574
5865
|
} finally {
|
|
5575
|
-
|
|
5866
|
+
finishSaving(scope);
|
|
5576
5867
|
}
|
|
5577
5868
|
};
|
|
5578
5869
|
const handleCancelEdits = () => {
|
|
@@ -5642,7 +5933,7 @@ function MatrxDataTableCore({
|
|
|
5642
5933
|
}
|
|
5643
5934
|
} : facet
|
|
5644
5935
|
) : toolbar?.facets;
|
|
5645
|
-
return /* @__PURE__ */
|
|
5936
|
+
return /* @__PURE__ */ jsxs24(
|
|
5646
5937
|
DndContext,
|
|
5647
5938
|
{
|
|
5648
5939
|
sensors: hierarchySensors,
|
|
@@ -5654,7 +5945,7 @@ function MatrxDataTableCore({
|
|
|
5654
5945
|
onDragCancel: () => setDraggedRowId(null),
|
|
5655
5946
|
onDragEnd: endHierarchyDrag,
|
|
5656
5947
|
children: [
|
|
5657
|
-
/* @__PURE__ */
|
|
5948
|
+
/* @__PURE__ */ jsxs24(
|
|
5658
5949
|
"div",
|
|
5659
5950
|
{
|
|
5660
5951
|
ref: rootRef,
|
|
@@ -5672,13 +5963,13 @@ function MatrxDataTableCore({
|
|
|
5672
5963
|
),
|
|
5673
5964
|
children: [
|
|
5674
5965
|
notice,
|
|
5675
|
-
!hideToolbar && (showSearch || toolbar?.anyOf || toolbar?.layeredFilters || toolbar?.facets && toolbar.facets.length > 0 || toolbar?.leading || toolbar?.actions || hasActiveFilters || showToolbarCopy || columns.length > 0) && /* @__PURE__ */
|
|
5966
|
+
!hideToolbar && (showSearch || toolbar?.anyOf || toolbar?.layeredFilters || toolbar?.facets && toolbar.facets.length > 0 || toolbar?.leading || toolbar?.actions || hasActiveFilters || showToolbarCopy || columns.length > 0) && /* @__PURE__ */ jsxs24(
|
|
5676
5967
|
"div",
|
|
5677
5968
|
{
|
|
5678
5969
|
"data-matrx-table-toolbar": true,
|
|
5679
5970
|
className: "flex shrink-0 flex-nowrap items-center gap-2 sm:flex-wrap",
|
|
5680
5971
|
children: [
|
|
5681
|
-
showSearch ? /* @__PURE__ */
|
|
5972
|
+
showSearch ? /* @__PURE__ */ jsxs24(
|
|
5682
5973
|
"div",
|
|
5683
5974
|
{
|
|
5684
5975
|
"data-matrx-table-search": true,
|
|
@@ -5687,9 +5978,9 @@ function MatrxDataTableCore({
|
|
|
5687
5978
|
toolbar?.searchMatch ? "sm:max-w-md" : "sm:max-w-xs"
|
|
5688
5979
|
),
|
|
5689
5980
|
children: [
|
|
5690
|
-
/* @__PURE__ */
|
|
5691
|
-
/* @__PURE__ */
|
|
5692
|
-
/* @__PURE__ */
|
|
5981
|
+
/* @__PURE__ */ jsxs24("div", { className: "relative min-w-0 flex-1", children: [
|
|
5982
|
+
/* @__PURE__ */ jsx32(Search, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
|
|
5983
|
+
/* @__PURE__ */ jsx32(
|
|
5693
5984
|
Input,
|
|
5694
5985
|
{
|
|
5695
5986
|
value: searchValue,
|
|
@@ -5702,18 +5993,18 @@ function MatrxDataTableCore({
|
|
|
5702
5993
|
style: { fontSize: "16px" }
|
|
5703
5994
|
}
|
|
5704
5995
|
),
|
|
5705
|
-
searchValue ? /* @__PURE__ */
|
|
5996
|
+
searchValue ? /* @__PURE__ */ jsx32(
|
|
5706
5997
|
"button",
|
|
5707
5998
|
{
|
|
5708
5999
|
type: "button",
|
|
5709
6000
|
"aria-label": "Clear search",
|
|
5710
6001
|
className: "absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground hover:text-foreground",
|
|
5711
6002
|
onClick: () => setSearchValue(""),
|
|
5712
|
-
children: /* @__PURE__ */
|
|
6003
|
+
children: /* @__PURE__ */ jsx32(X, { className: "h-3.5 w-3.5" })
|
|
5713
6004
|
}
|
|
5714
6005
|
) : null
|
|
5715
6006
|
] }),
|
|
5716
|
-
toolbar?.searchMatch ? /* @__PURE__ */
|
|
6007
|
+
toolbar?.searchMatch ? /* @__PURE__ */ jsxs24(
|
|
5717
6008
|
Button,
|
|
5718
6009
|
{
|
|
5719
6010
|
type: "button",
|
|
@@ -5727,7 +6018,7 @@ function MatrxDataTableCore({
|
|
|
5727
6018
|
searchMatchMode === "whole_words" ? "contains" : "whole_words"
|
|
5728
6019
|
),
|
|
5729
6020
|
children: [
|
|
5730
|
-
/* @__PURE__ */
|
|
6021
|
+
/* @__PURE__ */ jsx32(WholeWord, { className: "h-3.5 w-3.5" }),
|
|
5731
6022
|
searchMatchMode === "whole_words" ? "Whole words" : "Contains"
|
|
5732
6023
|
]
|
|
5733
6024
|
}
|
|
@@ -5735,7 +6026,7 @@ function MatrxDataTableCore({
|
|
|
5735
6026
|
]
|
|
5736
6027
|
}
|
|
5737
6028
|
) : null,
|
|
5738
|
-
toolbar?.layeredFilters ? /* @__PURE__ */
|
|
6029
|
+
toolbar?.layeredFilters ? /* @__PURE__ */ jsx32(
|
|
5739
6030
|
LayeredFilterBuilder,
|
|
5740
6031
|
{
|
|
5741
6032
|
fields: toolbar.layeredFilters.fields,
|
|
@@ -5745,9 +6036,9 @@ function MatrxDataTableCore({
|
|
|
5745
6036
|
label: toolbar.layeredFilters.label
|
|
5746
6037
|
}
|
|
5747
6038
|
) : null,
|
|
5748
|
-
toolbar?.anyOf ? /* @__PURE__ */
|
|
5749
|
-
/* @__PURE__ */
|
|
5750
|
-
/* @__PURE__ */
|
|
6039
|
+
toolbar?.anyOf ? /* @__PURE__ */ jsxs24("div", { className: "relative w-full max-w-xs", children: [
|
|
6040
|
+
/* @__PURE__ */ jsx32(Search, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
|
|
6041
|
+
/* @__PURE__ */ jsx32(
|
|
5751
6042
|
Input,
|
|
5752
6043
|
{
|
|
5753
6044
|
value: anyOfValue,
|
|
@@ -5757,26 +6048,26 @@ function MatrxDataTableCore({
|
|
|
5757
6048
|
style: { fontSize: "16px" }
|
|
5758
6049
|
}
|
|
5759
6050
|
),
|
|
5760
|
-
anyOfValue ? /* @__PURE__ */
|
|
6051
|
+
anyOfValue ? /* @__PURE__ */ jsx32(
|
|
5761
6052
|
"button",
|
|
5762
6053
|
{
|
|
5763
6054
|
type: "button",
|
|
5764
6055
|
"aria-label": "Clear match-any search",
|
|
5765
6056
|
className: "absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground hover:text-foreground",
|
|
5766
6057
|
onClick: () => setAnyOfValue(""),
|
|
5767
|
-
children: /* @__PURE__ */
|
|
6058
|
+
children: /* @__PURE__ */ jsx32(X, { className: "h-3.5 w-3.5" })
|
|
5768
6059
|
}
|
|
5769
6060
|
) : null
|
|
5770
6061
|
] }) : null,
|
|
5771
|
-
renderedFacets ? /* @__PURE__ */
|
|
6062
|
+
renderedFacets ? /* @__PURE__ */ jsx32(ToolbarFacets, { facets: renderedFacets }) : null,
|
|
5772
6063
|
toolbar?.leading,
|
|
5773
|
-
/* @__PURE__ */
|
|
6064
|
+
/* @__PURE__ */ jsxs24(
|
|
5774
6065
|
"div",
|
|
5775
6066
|
{
|
|
5776
6067
|
"data-matrx-table-actions": true,
|
|
5777
6068
|
className: "ml-auto flex shrink-0 flex-nowrap items-center gap-2 sm:flex-wrap",
|
|
5778
6069
|
children: [
|
|
5779
|
-
sourceTotal !== void 0 ? /* @__PURE__ */
|
|
6070
|
+
sourceTotal !== void 0 ? /* @__PURE__ */ jsxs24(
|
|
5780
6071
|
"span",
|
|
5781
6072
|
{
|
|
5782
6073
|
"data-matrx-table-source-total": true,
|
|
@@ -5791,7 +6082,7 @@ function MatrxDataTableCore({
|
|
|
5791
6082
|
]
|
|
5792
6083
|
}
|
|
5793
6084
|
) : null,
|
|
5794
|
-
hasActiveFilters ? /* @__PURE__ */
|
|
6085
|
+
hasActiveFilters ? /* @__PURE__ */ jsxs24(
|
|
5795
6086
|
Button,
|
|
5796
6087
|
{
|
|
5797
6088
|
type: "button",
|
|
@@ -5801,12 +6092,12 @@ function MatrxDataTableCore({
|
|
|
5801
6092
|
onClick: clearAllFilters,
|
|
5802
6093
|
title: "Clear all filters",
|
|
5803
6094
|
children: [
|
|
5804
|
-
/* @__PURE__ */
|
|
5805
|
-
/* @__PURE__ */
|
|
6095
|
+
/* @__PURE__ */ jsx32(Eraser, { className: "h-3.5 w-3.5" }),
|
|
6096
|
+
/* @__PURE__ */ jsx32("span", { className: "max-sm:sr-only", children: "Clear all" })
|
|
5806
6097
|
]
|
|
5807
6098
|
}
|
|
5808
6099
|
) : null,
|
|
5809
|
-
showToolbarCopy && copy ? /* @__PURE__ */
|
|
6100
|
+
showToolbarCopy && copy ? /* @__PURE__ */ jsx32(
|
|
5810
6101
|
CopyButtons,
|
|
5811
6102
|
{
|
|
5812
6103
|
size: "icon",
|
|
@@ -5862,7 +6153,7 @@ function MatrxDataTableCore({
|
|
|
5862
6153
|
}
|
|
5863
6154
|
}
|
|
5864
6155
|
) : null,
|
|
5865
|
-
columns.length > 0 ? /* @__PURE__ */
|
|
6156
|
+
columns.length > 0 ? /* @__PURE__ */ jsxs24(
|
|
5866
6157
|
Button,
|
|
5867
6158
|
{
|
|
5868
6159
|
type: "button",
|
|
@@ -5873,8 +6164,8 @@ function MatrxDataTableCore({
|
|
|
5873
6164
|
className: "h-8 w-8",
|
|
5874
6165
|
onClick: () => setColumnManagerOpen(true),
|
|
5875
6166
|
children: [
|
|
5876
|
-
/* @__PURE__ */
|
|
5877
|
-
hiddenColumnIds.size > 0 ? /* @__PURE__ */
|
|
6167
|
+
/* @__PURE__ */ jsx32(SlidersHorizontal, { className: "h-4 w-4" }),
|
|
6168
|
+
hiddenColumnIds.size > 0 ? /* @__PURE__ */ jsxs24("span", { className: "sr-only", children: [
|
|
5878
6169
|
hiddenColumnIds.size,
|
|
5879
6170
|
" hidden"
|
|
5880
6171
|
] }) : null
|
|
@@ -5888,15 +6179,15 @@ function MatrxDataTableCore({
|
|
|
5888
6179
|
]
|
|
5889
6180
|
}
|
|
5890
6181
|
),
|
|
5891
|
-
selection && selectionCount > 0 ? /* @__PURE__ */
|
|
5892
|
-
/* @__PURE__ */
|
|
6182
|
+
selection && selectionCount > 0 ? /* @__PURE__ */ jsxs24("div", { className: "flex shrink-0 flex-wrap items-center gap-2 rounded-md border border-primary/30 bg-primary/5 px-2 py-1.5", children: [
|
|
6183
|
+
/* @__PURE__ */ jsxs24("span", { className: "text-xs font-medium text-foreground", children: [
|
|
5893
6184
|
selectionCount.toLocaleString(),
|
|
5894
6185
|
" ",
|
|
5895
6186
|
selectionNoun,
|
|
5896
6187
|
selectionCount === 1 ? "" : "s",
|
|
5897
6188
|
" selected"
|
|
5898
6189
|
] }),
|
|
5899
|
-
/* @__PURE__ */
|
|
6190
|
+
/* @__PURE__ */ jsxs24(
|
|
5900
6191
|
Button,
|
|
5901
6192
|
{
|
|
5902
6193
|
type: "button",
|
|
@@ -5908,13 +6199,13 @@ function MatrxDataTableCore({
|
|
|
5908
6199
|
selection.onSelectedIdsChange([]);
|
|
5909
6200
|
},
|
|
5910
6201
|
children: [
|
|
5911
|
-
/* @__PURE__ */
|
|
6202
|
+
/* @__PURE__ */ jsx32(X, { className: "h-3.5 w-3.5" }),
|
|
5912
6203
|
"Clear"
|
|
5913
6204
|
]
|
|
5914
6205
|
}
|
|
5915
6206
|
),
|
|
5916
|
-
/* @__PURE__ */
|
|
5917
|
-
copy && selectedRows.length > 0 ? /* @__PURE__ */
|
|
6207
|
+
/* @__PURE__ */ jsxs24("div", { className: "ml-auto flex flex-wrap items-center gap-1.5", children: [
|
|
6208
|
+
copy && selectedRows.length > 0 ? /* @__PURE__ */ jsx32(
|
|
5918
6209
|
CopyButtons,
|
|
5919
6210
|
{
|
|
5920
6211
|
size: "icon",
|
|
@@ -5970,9 +6261,9 @@ function MatrxDataTableCore({
|
|
|
5970
6261
|
selection.actions?.(selectedRows, selection.selectedIds)
|
|
5971
6262
|
] })
|
|
5972
6263
|
] }) : null,
|
|
5973
|
-
/* @__PURE__ */
|
|
5974
|
-
/* @__PURE__ */
|
|
5975
|
-
mobileCards ? /* @__PURE__ */
|
|
6264
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex min-h-0 flex-1 flex-col", children: [
|
|
6265
|
+
/* @__PURE__ */ jsxs24("div", { className: "relative min-h-0 flex-1", children: [
|
|
6266
|
+
mobileCards ? /* @__PURE__ */ jsxs24(
|
|
5976
6267
|
"div",
|
|
5977
6268
|
{
|
|
5978
6269
|
ref: cardsScrollRef,
|
|
@@ -5983,33 +6274,33 @@ function MatrxDataTableCore({
|
|
|
5983
6274
|
mobileCardsClass
|
|
5984
6275
|
),
|
|
5985
6276
|
children: [
|
|
5986
|
-
isFetching && !isLoading ? /* @__PURE__ */
|
|
6277
|
+
isFetching && !isLoading ? /* @__PURE__ */ jsxs24(
|
|
5987
6278
|
"div",
|
|
5988
6279
|
{
|
|
5989
6280
|
role: "status",
|
|
5990
6281
|
className: "h-0.5 shrink-0 overflow-hidden rounded-full bg-primary/15",
|
|
5991
6282
|
children: [
|
|
5992
|
-
/* @__PURE__ */
|
|
5993
|
-
/* @__PURE__ */
|
|
6283
|
+
/* @__PURE__ */ jsx32("div", { className: "h-full w-full animate-pulse bg-primary" }),
|
|
6284
|
+
/* @__PURE__ */ jsx32("span", { className: "sr-only", children: "Refreshing table data" })
|
|
5994
6285
|
]
|
|
5995
6286
|
}
|
|
5996
6287
|
) : null,
|
|
5997
|
-
isLoading ? Array.from({ length: 4 }).map((_, index) => /* @__PURE__ */
|
|
6288
|
+
isLoading ? Array.from({ length: 4 }).map((_, index) => /* @__PURE__ */ jsx32(
|
|
5998
6289
|
Skeleton,
|
|
5999
6290
|
{
|
|
6000
6291
|
className: "h-52 w-full shrink-0 rounded-lg"
|
|
6001
6292
|
},
|
|
6002
6293
|
`mobile-card-sk-${index}`
|
|
6003
|
-
)) : paginated.length === 0 ? /* @__PURE__ */
|
|
6294
|
+
)) : paginated.length === 0 ? /* @__PURE__ */ jsx32("div", { className: "flex min-h-48 flex-1 items-center justify-center px-4 py-12 text-center", children: /* @__PURE__ */ jsxs24("div", { className: "flex max-w-sm flex-col items-center gap-2", children: [
|
|
6004
6295
|
emptyState?.icon,
|
|
6005
|
-
/* @__PURE__ */
|
|
6006
|
-
emptyState?.description ? /* @__PURE__ */
|
|
6296
|
+
/* @__PURE__ */ jsx32("p", { className: "text-sm font-medium text-foreground", children: emptyState?.title ?? "No rows" }),
|
|
6297
|
+
emptyState?.description ? /* @__PURE__ */ jsx32("p", { className: "text-xs text-muted-foreground", children: emptyState.description }) : null,
|
|
6007
6298
|
emptyState?.action
|
|
6008
6299
|
] }) }) : paginated.map((row, index) => {
|
|
6009
6300
|
const id = getRowId(row);
|
|
6010
6301
|
const displayRow = applyRowEdits(row, edits[id]);
|
|
6011
6302
|
const selectable = selection?.isRowSelectable?.(row) ?? Boolean(selection);
|
|
6012
|
-
return /* @__PURE__ */
|
|
6303
|
+
return /* @__PURE__ */ jsx32(Fragment4, { children: mobileCards(displayRow, index, {
|
|
6013
6304
|
selected: selectedIdSet.has(id),
|
|
6014
6305
|
selectable,
|
|
6015
6306
|
onSelectedChange: (nextSelected) => {
|
|
@@ -6021,13 +6312,13 @@ function MatrxDataTableCore({
|
|
|
6021
6312
|
else next.delete(id);
|
|
6022
6313
|
setSelectedIds(next);
|
|
6023
6314
|
},
|
|
6024
|
-
actions: showRowCopy || rowActions ? /* @__PURE__ */
|
|
6315
|
+
actions: showRowCopy || rowActions ? /* @__PURE__ */ jsxs24(
|
|
6025
6316
|
"div",
|
|
6026
6317
|
{
|
|
6027
6318
|
className: "inline-flex items-center gap-1",
|
|
6028
6319
|
onClick: (event) => event.stopPropagation(),
|
|
6029
6320
|
children: [
|
|
6030
|
-
showRowCopy && copy ? /* @__PURE__ */
|
|
6321
|
+
showRowCopy && copy ? /* @__PURE__ */ jsx32(
|
|
6031
6322
|
TableRowCopyControl,
|
|
6032
6323
|
{
|
|
6033
6324
|
size: "xs",
|
|
@@ -6051,7 +6342,7 @@ function MatrxDataTableCore({
|
|
|
6051
6342
|
]
|
|
6052
6343
|
}
|
|
6053
6344
|
) : null,
|
|
6054
|
-
/* @__PURE__ */
|
|
6345
|
+
/* @__PURE__ */ jsxs24(
|
|
6055
6346
|
"div",
|
|
6056
6347
|
{
|
|
6057
6348
|
ref: scrollRef,
|
|
@@ -6064,34 +6355,34 @@ function MatrxDataTableCore({
|
|
|
6064
6355
|
tableClassName
|
|
6065
6356
|
),
|
|
6066
6357
|
children: [
|
|
6067
|
-
hierarchy && draggedRow ? /* @__PURE__ */
|
|
6358
|
+
hierarchy && draggedRow ? /* @__PURE__ */ jsx32(
|
|
6068
6359
|
HierarchyRootDropTarget,
|
|
6069
6360
|
{
|
|
6070
6361
|
label: hierarchy.rootDropLabel ?? "Drop here to move to the top level",
|
|
6071
6362
|
draggedLabel: hierarchy.itemLabel?.(draggedRow) ?? "Moving row"
|
|
6072
6363
|
}
|
|
6073
6364
|
) : null,
|
|
6074
|
-
hierarchy && draggedRowId ? /* @__PURE__ */
|
|
6365
|
+
hierarchy && draggedRowId ? /* @__PURE__ */ jsx32(
|
|
6075
6366
|
HierarchyDragIndicatorLayer,
|
|
6076
6367
|
{
|
|
6077
6368
|
scrollRef,
|
|
6078
6369
|
resolve: resolveHierarchyMove
|
|
6079
6370
|
}
|
|
6080
6371
|
) : null,
|
|
6081
|
-
isFetching && !isLoading ? /* @__PURE__ */
|
|
6372
|
+
isFetching && !isLoading ? /* @__PURE__ */ jsxs24(
|
|
6082
6373
|
"div",
|
|
6083
6374
|
{
|
|
6084
6375
|
role: "status",
|
|
6085
6376
|
className: "sticky left-0 top-0 z-20 h-0.5 w-full overflow-hidden bg-primary/15",
|
|
6086
6377
|
children: [
|
|
6087
|
-
/* @__PURE__ */
|
|
6088
|
-
/* @__PURE__ */
|
|
6378
|
+
/* @__PURE__ */ jsx32("div", { className: "h-full w-full animate-pulse bg-primary" }),
|
|
6379
|
+
/* @__PURE__ */ jsx32("span", { className: "sr-only", children: "Refreshing table data" })
|
|
6089
6380
|
]
|
|
6090
6381
|
}
|
|
6091
6382
|
) : null,
|
|
6092
|
-
/* @__PURE__ */
|
|
6093
|
-
/* @__PURE__ */
|
|
6094
|
-
selection ? /* @__PURE__ */
|
|
6383
|
+
/* @__PURE__ */ jsxs24("table", { className: "table w-max min-w-full max-w-none caption-bottom overflow-visible text-sm sm:w-full sm:min-w-0 sm:max-w-full", children: [
|
|
6384
|
+
/* @__PURE__ */ jsx32("thead", { className: "sticky top-0 z-10 border-b border-border bg-muted/90 shadow-[0_1px_0_0_var(--border)] backdrop-blur-sm", children: /* @__PURE__ */ jsxs24("tr", { children: [
|
|
6385
|
+
selection ? /* @__PURE__ */ jsx32("th", { className: "h-9 w-9 px-2 text-left align-middle", children: /* @__PURE__ */ jsx32(
|
|
6095
6386
|
Checkbox,
|
|
6096
6387
|
{
|
|
6097
6388
|
className: CHECKBOX_TAP_AREA,
|
|
@@ -6107,7 +6398,7 @@ function MatrxDataTableCore({
|
|
|
6107
6398
|
const isSorted = sort?.id === id;
|
|
6108
6399
|
const headerLabel = col.label ?? (typeof col.header === "string" ? col.header : id);
|
|
6109
6400
|
const defaultSortDirection = col.defaultSortDirection ?? "asc";
|
|
6110
|
-
return /* @__PURE__ */
|
|
6401
|
+
return /* @__PURE__ */ jsx32(
|
|
6111
6402
|
"th",
|
|
6112
6403
|
{
|
|
6113
6404
|
"aria-sort": isSorted ? sort?.direction === "asc" ? "ascending" : "descending" : void 0,
|
|
@@ -6133,7 +6424,7 @@ function MatrxDataTableCore({
|
|
|
6133
6424
|
col.align === "right" && "text-right"
|
|
6134
6425
|
),
|
|
6135
6426
|
style: columnWidthVar(col.width),
|
|
6136
|
-
children: /* @__PURE__ */
|
|
6427
|
+
children: /* @__PURE__ */ jsx32(
|
|
6137
6428
|
ColumnHeaderCell,
|
|
6138
6429
|
{
|
|
6139
6430
|
label: col.header,
|
|
@@ -6173,11 +6464,11 @@ function MatrxDataTableCore({
|
|
|
6173
6464
|
id
|
|
6174
6465
|
);
|
|
6175
6466
|
}),
|
|
6176
|
-
showActionsCol && /* @__PURE__ */
|
|
6467
|
+
showActionsCol && /* @__PURE__ */ jsx32("th", { className: "h-9 w-28 px-2 text-right align-middle text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: "Actions" })
|
|
6177
6468
|
] }) }),
|
|
6178
|
-
/* @__PURE__ */
|
|
6179
|
-
selection ? /* @__PURE__ */
|
|
6180
|
-
visibleColumns.map((col) => /* @__PURE__ */
|
|
6469
|
+
/* @__PURE__ */ jsx32("tbody", { children: isLoading ? Array.from({ length: 6 }).map((_, i) => /* @__PURE__ */ jsxs24("tr", { className: "border-b border-border/60", children: [
|
|
6470
|
+
selection ? /* @__PURE__ */ jsx32("td", { className: "px-2 py-2", children: /* @__PURE__ */ jsx32(Skeleton, { className: "h-3.5 w-3.5" }) }) : null,
|
|
6471
|
+
visibleColumns.map((col) => /* @__PURE__ */ jsx32(
|
|
6181
6472
|
"td",
|
|
6182
6473
|
{
|
|
6183
6474
|
className: cn(
|
|
@@ -6185,20 +6476,20 @@ function MatrxDataTableCore({
|
|
|
6185
6476
|
col.compact ? "px-1" : "px-2",
|
|
6186
6477
|
col.mobileHidden && "max-sm:hidden"
|
|
6187
6478
|
),
|
|
6188
|
-
children: /* @__PURE__ */
|
|
6479
|
+
children: /* @__PURE__ */ jsx32(Skeleton, { className: "h-5 w-full" })
|
|
6189
6480
|
},
|
|
6190
6481
|
columnId(col)
|
|
6191
6482
|
)),
|
|
6192
|
-
showActionsCol && /* @__PURE__ */
|
|
6193
|
-
] }, `sk-${i}`)) : paginated.length === 0 ? /* @__PURE__ */
|
|
6483
|
+
showActionsCol && /* @__PURE__ */ jsx32("td", { className: "px-2 py-2", children: /* @__PURE__ */ jsx32(Skeleton, { className: "ml-auto h-5 w-10" }) })
|
|
6484
|
+
] }, `sk-${i}`)) : paginated.length === 0 ? /* @__PURE__ */ jsx32("tr", { children: /* @__PURE__ */ jsx32(
|
|
6194
6485
|
"td",
|
|
6195
6486
|
{
|
|
6196
6487
|
colSpan: visibleColumns.length + leadingCols + (showActionsCol ? 1 : 0),
|
|
6197
6488
|
className: "px-4 py-12 text-center",
|
|
6198
|
-
children: /* @__PURE__ */
|
|
6489
|
+
children: /* @__PURE__ */ jsxs24("div", { className: "mx-auto flex max-w-sm flex-col items-center gap-2", children: [
|
|
6199
6490
|
emptyState?.icon,
|
|
6200
|
-
/* @__PURE__ */
|
|
6201
|
-
emptyState?.description ? /* @__PURE__ */
|
|
6491
|
+
/* @__PURE__ */ jsx32("p", { className: "text-sm font-medium text-foreground", children: emptyState?.title ?? "No rows" }),
|
|
6492
|
+
emptyState?.description ? /* @__PURE__ */ jsx32("p", { className: "text-xs text-muted-foreground", children: emptyState.description }) : null,
|
|
6202
6493
|
emptyState?.action
|
|
6203
6494
|
] })
|
|
6204
6495
|
}
|
|
@@ -6208,7 +6499,7 @@ function MatrxDataTableCore({
|
|
|
6208
6499
|
const rowEdits = edits[id];
|
|
6209
6500
|
const displayRow = applyRowEdits(row, rowEdits);
|
|
6210
6501
|
const isChecked = selectedIdSet.has(id);
|
|
6211
|
-
const rowNode = /* @__PURE__ */
|
|
6502
|
+
const rowNode = /* @__PURE__ */ jsxs24(
|
|
6212
6503
|
"tr",
|
|
6213
6504
|
{
|
|
6214
6505
|
"data-row-id": id,
|
|
@@ -6231,12 +6522,12 @@ function MatrxDataTableCore({
|
|
|
6231
6522
|
zebra && index % 2 === 1 && !isSelected && !isChecked && "sm:bg-muted/20"
|
|
6232
6523
|
),
|
|
6233
6524
|
children: [
|
|
6234
|
-
selection ? /* @__PURE__ */
|
|
6525
|
+
selection ? /* @__PURE__ */ jsx32(
|
|
6235
6526
|
"td",
|
|
6236
6527
|
{
|
|
6237
6528
|
className: "px-2 py-1.5 align-middle lg:py-0.5",
|
|
6238
6529
|
onClick: (e) => e.stopPropagation(),
|
|
6239
|
-
children: selection.isRowSelectable?.(row) ?? true ? /* @__PURE__ */
|
|
6530
|
+
children: selection.isRowSelectable?.(row) ?? true ? /* @__PURE__ */ jsx32(
|
|
6240
6531
|
Checkbox,
|
|
6241
6532
|
{
|
|
6242
6533
|
className: CHECKBOX_TAP_AREA,
|
|
@@ -6257,7 +6548,7 @@ function MatrxDataTableCore({
|
|
|
6257
6548
|
rowEdits && field in rowEdits
|
|
6258
6549
|
);
|
|
6259
6550
|
const cellHref = col.href?.(row) ?? void 0;
|
|
6260
|
-
return /* @__PURE__ */
|
|
6551
|
+
return /* @__PURE__ */ jsx32(
|
|
6261
6552
|
"td",
|
|
6262
6553
|
{
|
|
6263
6554
|
className: cn(
|
|
@@ -6273,14 +6564,14 @@ function MatrxDataTableCore({
|
|
|
6273
6564
|
col.align === "right" && "text-right"
|
|
6274
6565
|
),
|
|
6275
6566
|
style: columnWidthVar(col.width),
|
|
6276
|
-
children: /* @__PURE__ */
|
|
6567
|
+
children: /* @__PURE__ */ jsxs24(
|
|
6277
6568
|
"div",
|
|
6278
6569
|
{
|
|
6279
6570
|
className: cn(
|
|
6280
6571
|
colIdx === 0 && hierarchy && "flex min-w-0 items-center"
|
|
6281
6572
|
),
|
|
6282
6573
|
children: [
|
|
6283
|
-
colIdx === 0 && hierarchy ? /* @__PURE__ */
|
|
6574
|
+
colIdx === 0 && hierarchy ? /* @__PURE__ */ jsx32(
|
|
6284
6575
|
HierarchyDragHandle,
|
|
6285
6576
|
{
|
|
6286
6577
|
id,
|
|
@@ -6288,12 +6579,12 @@ function MatrxDataTableCore({
|
|
|
6288
6579
|
disabled: !(hierarchy.canReparent?.(row) ?? true)
|
|
6289
6580
|
}
|
|
6290
6581
|
) : null,
|
|
6291
|
-
/* @__PURE__ */
|
|
6582
|
+
/* @__PURE__ */ jsx32(
|
|
6292
6583
|
"div",
|
|
6293
6584
|
{
|
|
6294
6585
|
"data-matrx-cell-content": true,
|
|
6295
6586
|
className: "min-w-0 max-w-full flex-1 whitespace-normal break-words [overflow-wrap:anywhere] sm:[&_*]:min-w-0 sm:[&_*]:max-w-full sm:[&_*]:whitespace-normal sm:[&_*]:[overflow-wrap:anywhere] sm:[&_[data-matrx-cell-control]]:w-max sm:[&_[data-matrx-cell-control]]:min-w-max sm:[&_[data-matrx-cell-control]]:max-w-none sm:[&_[data-matrx-cell-control]]:whitespace-nowrap sm:[&_[data-matrx-cell-control]]:[overflow-wrap:normal] sm:[&_[data-matrx-cell-control]_*]:whitespace-nowrap sm:[&_[data-matrx-cell-control]_*]:[overflow-wrap:normal]",
|
|
6296
|
-
children: editable && col.editable ? /* @__PURE__ */
|
|
6587
|
+
children: editable && col.editable ? /* @__PURE__ */ jsx32(
|
|
6297
6588
|
EditableTableCell,
|
|
6298
6589
|
{
|
|
6299
6590
|
value: rowEdits && field in rowEdits ? rowEdits[field] : getCellValue(row, col),
|
|
@@ -6305,7 +6596,7 @@ function MatrxDataTableCore({
|
|
|
6305
6596
|
...cellHref === void 0 ? {} : { href: cellHref },
|
|
6306
6597
|
...col.editTrigger === void 0 ? {} : { editTrigger: col.editTrigger }
|
|
6307
6598
|
}
|
|
6308
|
-
) : cellHref ? /* @__PURE__ */
|
|
6599
|
+
) : cellHref ? /* @__PURE__ */ jsx32(
|
|
6309
6600
|
Link,
|
|
6310
6601
|
{
|
|
6311
6602
|
href: cellHref,
|
|
@@ -6323,13 +6614,13 @@ function MatrxDataTableCore({
|
|
|
6323
6614
|
columnId(col)
|
|
6324
6615
|
);
|
|
6325
6616
|
}),
|
|
6326
|
-
showActionsCol && /* @__PURE__ */
|
|
6617
|
+
showActionsCol && /* @__PURE__ */ jsx32("td", { className: "px-2 py-1.5 text-right align-middle lg:py-0.5", children: /* @__PURE__ */ jsxs24(
|
|
6327
6618
|
"div",
|
|
6328
6619
|
{
|
|
6329
6620
|
className: "inline-flex items-center justify-end gap-0.5",
|
|
6330
6621
|
onClick: (e) => e.stopPropagation(),
|
|
6331
6622
|
children: [
|
|
6332
|
-
showRowCopy && copy ? /* @__PURE__ */
|
|
6623
|
+
showRowCopy && copy ? /* @__PURE__ */ jsx32(
|
|
6333
6624
|
TableRowCopyControl,
|
|
6334
6625
|
{
|
|
6335
6626
|
size: "xs",
|
|
@@ -6345,7 +6636,7 @@ function MatrxDataTableCore({
|
|
|
6345
6636
|
hasPendingEdits: Boolean(rowEdits),
|
|
6346
6637
|
discardPendingEdits: () => discardRowEdits(id)
|
|
6347
6638
|
}),
|
|
6348
|
-
windowEnabled ? /* @__PURE__ */
|
|
6639
|
+
windowEnabled ? /* @__PURE__ */ jsx32(
|
|
6349
6640
|
Button,
|
|
6350
6641
|
{
|
|
6351
6642
|
type: "button",
|
|
@@ -6362,7 +6653,7 @@ function MatrxDataTableCore({
|
|
|
6362
6653
|
openWindow(row);
|
|
6363
6654
|
}
|
|
6364
6655
|
},
|
|
6365
|
-
children: opensWindowOnRowClick ? /* @__PURE__ */
|
|
6656
|
+
children: opensWindowOnRowClick ? /* @__PURE__ */ jsx32(PanelRightOpen, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx32(PanelRight, { className: "h-3.5 w-3.5" })
|
|
6366
6657
|
}
|
|
6367
6658
|
) : null
|
|
6368
6659
|
]
|
|
@@ -6373,7 +6664,7 @@ function MatrxDataTableCore({
|
|
|
6373
6664
|
id
|
|
6374
6665
|
);
|
|
6375
6666
|
const wrappedRow = rowWrapper ? rowWrapper(row, rowNode) : rowNode;
|
|
6376
|
-
return hierarchy ? /* @__PURE__ */
|
|
6667
|
+
return hierarchy ? /* @__PURE__ */ jsx32(
|
|
6377
6668
|
HierarchyDroppableRow,
|
|
6378
6669
|
{
|
|
6379
6670
|
id,
|
|
@@ -6381,11 +6672,11 @@ function MatrxDataTableCore({
|
|
|
6381
6672
|
children: wrappedRow
|
|
6382
6673
|
},
|
|
6383
6674
|
id
|
|
6384
|
-
) : /* @__PURE__ */
|
|
6675
|
+
) : /* @__PURE__ */ jsx32(Fragment4, { children: wrappedRow }, id);
|
|
6385
6676
|
}) }),
|
|
6386
|
-
footerRows.length > 0 ? /* @__PURE__ */
|
|
6387
|
-
selection ? /* @__PURE__ */
|
|
6388
|
-
visibleColumns.map((column) => /* @__PURE__ */
|
|
6677
|
+
footerRows.length > 0 ? /* @__PURE__ */ jsx32("tfoot", { className: "border-t-2 border-border bg-muted/50 font-semibold", children: footerRows.map((row, index) => /* @__PURE__ */ jsxs24("tr", { children: [
|
|
6678
|
+
selection ? /* @__PURE__ */ jsx32("td", { className: "px-2 py-2" }) : null,
|
|
6679
|
+
visibleColumns.map((column) => /* @__PURE__ */ jsx32(
|
|
6389
6680
|
"td",
|
|
6390
6681
|
{
|
|
6391
6682
|
className: cn(
|
|
@@ -6400,13 +6691,13 @@ function MatrxDataTableCore({
|
|
|
6400
6691
|
},
|
|
6401
6692
|
columnId(column)
|
|
6402
6693
|
)),
|
|
6403
|
-
showActionsCol ? /* @__PURE__ */
|
|
6694
|
+
showActionsCol ? /* @__PURE__ */ jsx32("td", { className: "px-2 py-2" }) : null
|
|
6404
6695
|
] }, `footer-${index}`)) }) : null
|
|
6405
6696
|
] })
|
|
6406
6697
|
]
|
|
6407
6698
|
}
|
|
6408
6699
|
),
|
|
6409
|
-
scrollHintLeft ? /* @__PURE__ */
|
|
6700
|
+
scrollHintLeft ? /* @__PURE__ */ jsx32(
|
|
6410
6701
|
Button,
|
|
6411
6702
|
{
|
|
6412
6703
|
type: "button",
|
|
@@ -6417,10 +6708,10 @@ function MatrxDataTableCore({
|
|
|
6417
6708
|
"data-matrx-table-scroll-control": "left",
|
|
6418
6709
|
className: "absolute left-1.5 top-1/2 z-30 hidden h-11 w-11 -translate-y-1/2 rounded-full border border-glass-edge bg-glass p-0 text-foreground shadow-glass backdrop-blur-glass backdrop-saturate-glass hover:bg-glass-hover active:bg-glass-active sm:inline-flex",
|
|
6419
6710
|
onClick: () => scrollTableHorizontally("left"),
|
|
6420
|
-
children: /* @__PURE__ */
|
|
6711
|
+
children: /* @__PURE__ */ jsx32(ChevronLeft, { className: "h-5 w-5" })
|
|
6421
6712
|
}
|
|
6422
6713
|
) : null,
|
|
6423
|
-
scrollHintRight ? /* @__PURE__ */
|
|
6714
|
+
scrollHintRight ? /* @__PURE__ */ jsx32(
|
|
6424
6715
|
Button,
|
|
6425
6716
|
{
|
|
6426
6717
|
type: "button",
|
|
@@ -6431,17 +6722,17 @@ function MatrxDataTableCore({
|
|
|
6431
6722
|
"data-matrx-table-scroll-control": "right",
|
|
6432
6723
|
className: "absolute right-1.5 top-1/2 z-30 hidden h-11 w-11 -translate-y-1/2 rounded-full border border-glass-edge bg-glass p-0 text-foreground shadow-glass backdrop-blur-glass backdrop-saturate-glass hover:bg-glass-hover active:bg-glass-active sm:inline-flex",
|
|
6433
6724
|
onClick: () => scrollTableHorizontally("right"),
|
|
6434
|
-
children: /* @__PURE__ */
|
|
6725
|
+
children: /* @__PURE__ */ jsx32(ChevronRight, { className: "h-5 w-5" })
|
|
6435
6726
|
}
|
|
6436
6727
|
) : null
|
|
6437
6728
|
] }),
|
|
6438
|
-
appendQuery ? /* @__PURE__ */
|
|
6439
|
-
/* @__PURE__ */
|
|
6729
|
+
appendQuery ? /* @__PURE__ */ jsxs24("div", { "data-matrx-table-footer": true, className: "flex min-h-16 shrink-0 items-center justify-between gap-3 border-t border-border px-3 py-2", "aria-busy": isLoading || isFetching, children: [
|
|
6730
|
+
/* @__PURE__ */ jsxs24("div", { role: "status", "aria-live": "polite", className: "text-xs text-muted-foreground", children: [
|
|
6440
6731
|
isFetching ? "Loading more rows\u2026" : isLoading ? "Loading rows\u2026" : `${data.length.toLocaleString()} loaded${appendQuery.pagination.totalItems === void 0 ? "" : ` of ${appendQuery.pagination.totalItems.toLocaleString()}`}`,
|
|
6441
|
-
scrollPagination.error ? /* @__PURE__ */
|
|
6732
|
+
scrollPagination.error ? /* @__PURE__ */ jsx32("p", { role: "alert", className: "text-destructive", children: scrollPagination.error.message }) : null
|
|
6442
6733
|
] }),
|
|
6443
|
-
scrollPagination.error && !appendQuery.pagination.hasNextPage ? /* @__PURE__ */
|
|
6444
|
-
] }) : !hidePagination && totalItems > 0 ? /* @__PURE__ */
|
|
6734
|
+
scrollPagination.error && !appendQuery.pagination.hasNextPage ? /* @__PURE__ */ jsx32(Button, { type: "button", variant: "outline", onClick: appendQuery.pagination.refresh, children: "Reload rows" }) : appendQuery.pagination.hasNextPage || scrollPagination.error ? /* @__PURE__ */ jsx32(Button, { type: "button", variant: "outline", disabled: isLoading || isFetching, onClick: () => void scrollPagination.requestNextPage(), children: scrollPagination.error ? "Retry" : "Load more" }) : !isLoading ? /* @__PURE__ */ jsx32("span", { className: "text-xs text-muted-foreground", children: "All rows loaded" }) : null
|
|
6735
|
+
] }) : !hidePagination && totalItems > 0 ? /* @__PURE__ */ jsx32("div", { className: "shrink-0", children: /* @__PURE__ */ jsx32(
|
|
6445
6736
|
GenericTablePagination,
|
|
6446
6737
|
{
|
|
6447
6738
|
totalItems,
|
|
@@ -6461,7 +6752,7 @@ function MatrxDataTableCore({
|
|
|
6461
6752
|
}
|
|
6462
6753
|
) }) : null
|
|
6463
6754
|
] }),
|
|
6464
|
-
/* @__PURE__ */
|
|
6755
|
+
/* @__PURE__ */ jsx32(
|
|
6465
6756
|
ColumnManager,
|
|
6466
6757
|
{
|
|
6467
6758
|
open: columnManagerOpen,
|
|
@@ -6475,7 +6766,7 @@ function MatrxDataTableCore({
|
|
|
6475
6766
|
}
|
|
6476
6767
|
}
|
|
6477
6768
|
),
|
|
6478
|
-
detailEnabled && selectedRow ? /* @__PURE__ */
|
|
6769
|
+
detailEnabled && selectedRow ? /* @__PURE__ */ jsx32(
|
|
6479
6770
|
SidePanelSurface,
|
|
6480
6771
|
{
|
|
6481
6772
|
title: resolveStringTitle(
|
|
@@ -6486,8 +6777,8 @@ function MatrxDataTableCore({
|
|
|
6486
6777
|
description: detail?.description?.(selectedRow),
|
|
6487
6778
|
onClose: () => setSelectedId(null),
|
|
6488
6779
|
defaultWidth: detail?.defaultWidth ?? 480,
|
|
6489
|
-
headerActions: /* @__PURE__ */
|
|
6490
|
-
copy && showRowCopy ? /* @__PURE__ */
|
|
6780
|
+
headerActions: /* @__PURE__ */ jsxs24("div", { className: "flex items-center gap-1", children: [
|
|
6781
|
+
copy && showRowCopy ? /* @__PURE__ */ jsx32(
|
|
6491
6782
|
TableRowCopyControl,
|
|
6492
6783
|
{
|
|
6493
6784
|
size: "icon",
|
|
@@ -6496,7 +6787,7 @@ function MatrxDataTableCore({
|
|
|
6496
6787
|
}
|
|
6497
6788
|
) : null,
|
|
6498
6789
|
detail?.headerActions?.(selectedRow),
|
|
6499
|
-
windowEnabled ? /* @__PURE__ */
|
|
6790
|
+
windowEnabled ? /* @__PURE__ */ jsx32(
|
|
6500
6791
|
Button,
|
|
6501
6792
|
{
|
|
6502
6793
|
type: "button",
|
|
@@ -6506,7 +6797,7 @@ function MatrxDataTableCore({
|
|
|
6506
6797
|
"aria-label": "Open in window",
|
|
6507
6798
|
title: "Open in window",
|
|
6508
6799
|
onClick: () => openWindow(selectedRow),
|
|
6509
|
-
children: /* @__PURE__ */
|
|
6800
|
+
children: /* @__PURE__ */ jsx32(PanelRight, { className: "h-3.5 w-3.5" })
|
|
6510
6801
|
}
|
|
6511
6802
|
) : null
|
|
6512
6803
|
] }),
|
|
@@ -6518,7 +6809,7 @@ function MatrxDataTableCore({
|
|
|
6518
6809
|
// fixes the whole class at once — a custom body that already
|
|
6519
6810
|
// scrolls (`h-full` + `overflow-y-auto` root) still resolves to
|
|
6520
6811
|
// this container's height, so no second scrollbar appears.
|
|
6521
|
-
/* @__PURE__ */
|
|
6812
|
+
/* @__PURE__ */ jsx32("div", { className: "h-full min-h-0 overflow-y-auto", children: detail.render(selectedRow, {
|
|
6522
6813
|
closeDetail: () => setSelectedId(null),
|
|
6523
6814
|
openDetail: () => openDetail(selectedRow),
|
|
6524
6815
|
openWindow: () => openWindow(selectedRow),
|
|
@@ -6526,7 +6817,7 @@ function MatrxDataTableCore({
|
|
|
6526
6817
|
hasPendingEdits: Boolean(edits[getRowId(selectedRow)]),
|
|
6527
6818
|
discardPendingEdits: () => discardRowEdits(getRowId(selectedRow))
|
|
6528
6819
|
}) })
|
|
6529
|
-
) : /* @__PURE__ */
|
|
6820
|
+
) : /* @__PURE__ */ jsx32(
|
|
6530
6821
|
DataRowInspector,
|
|
6531
6822
|
{
|
|
6532
6823
|
row: selectedRow,
|
|
@@ -6538,7 +6829,7 @@ function MatrxDataTableCore({
|
|
|
6538
6829
|
)
|
|
6539
6830
|
}
|
|
6540
6831
|
) : null,
|
|
6541
|
-
windowRow ? /* @__PURE__ */
|
|
6832
|
+
windowRow ? /* @__PURE__ */ jsx32(
|
|
6542
6833
|
DataRowWindow,
|
|
6543
6834
|
{
|
|
6544
6835
|
isOpen: true,
|
|
@@ -6549,8 +6840,8 @@ function MatrxDataTableCore({
|
|
|
6549
6840
|
height: windowConfig?.height,
|
|
6550
6841
|
windowId: `matrx-data-row-${urlState?.id ?? "local"}-${getRowId(windowRow)}`,
|
|
6551
6842
|
defaultTab: windowConfig?.defaultTab,
|
|
6552
|
-
headerActions: /* @__PURE__ */
|
|
6553
|
-
opensWindowOnRowClick && detailEnabled ? /* @__PURE__ */
|
|
6843
|
+
headerActions: /* @__PURE__ */ jsxs24("div", { className: "flex items-center gap-1", children: [
|
|
6844
|
+
opensWindowOnRowClick && detailEnabled ? /* @__PURE__ */ jsx32(
|
|
6554
6845
|
Button,
|
|
6555
6846
|
{
|
|
6556
6847
|
type: "button",
|
|
@@ -6563,10 +6854,10 @@ function MatrxDataTableCore({
|
|
|
6563
6854
|
closeWindow();
|
|
6564
6855
|
openDetail(windowRow);
|
|
6565
6856
|
},
|
|
6566
|
-
children: /* @__PURE__ */
|
|
6857
|
+
children: /* @__PURE__ */ jsx32(PanelRightOpen, { className: "h-3.5 w-3.5" })
|
|
6567
6858
|
}
|
|
6568
6859
|
) : null,
|
|
6569
|
-
copy ? /* @__PURE__ */
|
|
6860
|
+
copy ? /* @__PURE__ */ jsx32(
|
|
6570
6861
|
TableRowCopyControl,
|
|
6571
6862
|
{
|
|
6572
6863
|
size: "icon",
|
|
@@ -6582,7 +6873,7 @@ function MatrxDataTableCore({
|
|
|
6582
6873
|
closeWindow,
|
|
6583
6874
|
hasPendingEdits: Boolean(edits[getRowId(windowRow)]),
|
|
6584
6875
|
discardPendingEdits: () => discardRowEdits(getRowId(windowRow))
|
|
6585
|
-
}) ?? (copy ? /* @__PURE__ */
|
|
6876
|
+
}) ?? (copy ? /* @__PURE__ */ jsx32(
|
|
6586
6877
|
DataRowInspector,
|
|
6587
6878
|
{
|
|
6588
6879
|
row: windowRow,
|
|
@@ -6617,23 +6908,65 @@ function MatrxDataTableCore({
|
|
|
6617
6908
|
})
|
|
6618
6909
|
}
|
|
6619
6910
|
) : null,
|
|
6620
|
-
editEnabled ? /* @__PURE__ */
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6911
|
+
editEnabled ? /* @__PURE__ */ jsxs24(Fragment5, { children: [
|
|
6912
|
+
foreignDrafts.length > 0 ? /* @__PURE__ */ jsxs24(
|
|
6913
|
+
"div",
|
|
6914
|
+
{
|
|
6915
|
+
"data-matrx-foreign-drafts": true,
|
|
6916
|
+
className: "fixed inset-x-3 bottom-20 z-50 flex flex-wrap items-center justify-center gap-2 rounded-lg border border-amber-500/40 bg-card px-3 py-2 text-xs shadow-lg sm:inset-x-auto sm:left-1/2 sm:-translate-x-1/2 sm:flex-nowrap",
|
|
6917
|
+
children: [
|
|
6918
|
+
/* @__PURE__ */ jsx32("span", { children: "Unsaved edits from previous results" }),
|
|
6919
|
+
/* @__PURE__ */ jsx32(
|
|
6920
|
+
CopyButtons,
|
|
6921
|
+
{
|
|
6922
|
+
size: "xs",
|
|
6923
|
+
label: "retained drafts",
|
|
6924
|
+
human: () => JSON.stringify(foreignDraftPayload, null, 2),
|
|
6925
|
+
json: () => foreignDraftPayload
|
|
6926
|
+
}
|
|
6927
|
+
),
|
|
6928
|
+
/* @__PURE__ */ jsx32(Button, { type: "button", size: "sm", variant: "ghost", className: "h-7 text-xs text-destructive", onClick: () => setConfirmForeignDraftDiscard(true), children: "Discard drafts" })
|
|
6929
|
+
]
|
|
6930
|
+
}
|
|
6931
|
+
) : null,
|
|
6932
|
+
/* @__PURE__ */ jsx32(
|
|
6933
|
+
ConfirmDialog,
|
|
6934
|
+
{
|
|
6935
|
+
open: confirmForeignDraftDiscard,
|
|
6936
|
+
onOpenChange: setConfirmForeignDraftDiscard,
|
|
6937
|
+
title: "Discard unsaved edits from previous results?",
|
|
6938
|
+
description: "This permanently removes edits retained for other result sets. Copy drafts first if you may need them.",
|
|
6939
|
+
confirmLabel: "Discard drafts",
|
|
6940
|
+
cancelLabel: "Keep drafts",
|
|
6941
|
+
variant: "destructive",
|
|
6942
|
+
onConfirm: () => {
|
|
6943
|
+
setEditsByScope(
|
|
6944
|
+
(current) => Object.fromEntries(
|
|
6945
|
+
Object.entries(current).filter(([scope]) => scope === editScopeKey)
|
|
6946
|
+
)
|
|
6947
|
+
);
|
|
6948
|
+
setConfirmForeignDraftDiscard(false);
|
|
6949
|
+
}
|
|
6950
|
+
}
|
|
6951
|
+
),
|
|
6952
|
+
/* @__PURE__ */ jsx32(
|
|
6953
|
+
DirtySavePill,
|
|
6954
|
+
{
|
|
6955
|
+
changeCount,
|
|
6956
|
+
saving,
|
|
6957
|
+
onSave: () => void handleSaveEdits(),
|
|
6958
|
+
onCancel: handleCancelEdits
|
|
6959
|
+
}
|
|
6960
|
+
)
|
|
6961
|
+
] }) : null
|
|
6629
6962
|
]
|
|
6630
6963
|
}
|
|
6631
6964
|
),
|
|
6632
|
-
/* @__PURE__ */
|
|
6965
|
+
/* @__PURE__ */ jsx32(DragOverlay, { children: draggedRow ? (
|
|
6633
6966
|
// w-max: the overlay inherits the ACTIVE node's size, and the active
|
|
6634
6967
|
// node is the 16px grip handle — without it the label wraps to one
|
|
6635
6968
|
// character per line.
|
|
6636
|
-
/* @__PURE__ */
|
|
6969
|
+
/* @__PURE__ */ jsx32("div", { className: "w-max max-w-xs truncate rounded border border-border bg-card px-2.5 py-1.5 text-sm font-medium text-foreground shadow-md", children: hierarchy?.itemLabel?.(draggedRow) ?? "Moving row" })
|
|
6637
6970
|
) : null })
|
|
6638
6971
|
]
|
|
6639
6972
|
}
|
|
@@ -6648,7 +6981,7 @@ function HierarchyDragHandle({
|
|
|
6648
6981
|
id,
|
|
6649
6982
|
disabled
|
|
6650
6983
|
});
|
|
6651
|
-
return /* @__PURE__ */
|
|
6984
|
+
return /* @__PURE__ */ jsx32(
|
|
6652
6985
|
"button",
|
|
6653
6986
|
{
|
|
6654
6987
|
ref: setNodeRef,
|
|
@@ -6660,7 +6993,7 @@ function HierarchyDragHandle({
|
|
|
6660
6993
|
onClick: (event) => event.stopPropagation(),
|
|
6661
6994
|
...attributes,
|
|
6662
6995
|
...listeners,
|
|
6663
|
-
children: /* @__PURE__ */
|
|
6996
|
+
children: /* @__PURE__ */ jsx32(GripVertical, { className: "h-3.5 w-3.5" })
|
|
6664
6997
|
}
|
|
6665
6998
|
);
|
|
6666
6999
|
}
|
|
@@ -6669,7 +7002,7 @@ function HierarchyRootDropTarget({
|
|
|
6669
7002
|
draggedLabel
|
|
6670
7003
|
}) {
|
|
6671
7004
|
const { isOver, setNodeRef } = useDroppable({ id: "__root__" });
|
|
6672
|
-
return /* @__PURE__ */
|
|
7005
|
+
return /* @__PURE__ */ jsxs24(
|
|
6673
7006
|
"div",
|
|
6674
7007
|
{
|
|
6675
7008
|
ref: setNodeRef,
|
|
@@ -6679,8 +7012,8 @@ function HierarchyRootDropTarget({
|
|
|
6679
7012
|
isOver && "border-solid bg-primary/20 shadow-md shadow-primary/25"
|
|
6680
7013
|
),
|
|
6681
7014
|
children: [
|
|
6682
|
-
/* @__PURE__ */
|
|
6683
|
-
/* @__PURE__ */
|
|
7015
|
+
/* @__PURE__ */ jsx32("span", { className: "truncate", children: draggedLabel }),
|
|
7016
|
+
/* @__PURE__ */ jsx32("span", { className: "text-primary/75", children: label })
|
|
6684
7017
|
]
|
|
6685
7018
|
}
|
|
6686
7019
|
);
|
|
@@ -6729,7 +7062,7 @@ function HierarchyDragIndicatorLayer({
|
|
|
6729
7062
|
const { preview } = indicator;
|
|
6730
7063
|
const indent = indicator.left + 10 + preview.depth * 12;
|
|
6731
7064
|
if (preview.position === "inside") {
|
|
6732
|
-
return /* @__PURE__ */
|
|
7065
|
+
return /* @__PURE__ */ jsx32(
|
|
6733
7066
|
"div",
|
|
6734
7067
|
{
|
|
6735
7068
|
"aria-hidden": "true",
|
|
@@ -6741,7 +7074,7 @@ function HierarchyDragIndicatorLayer({
|
|
|
6741
7074
|
width: Math.max(0, indicator.width - 4),
|
|
6742
7075
|
height: indicator.height
|
|
6743
7076
|
},
|
|
6744
|
-
children: /* @__PURE__ */
|
|
7077
|
+
children: /* @__PURE__ */ jsxs24(
|
|
6745
7078
|
"span",
|
|
6746
7079
|
{
|
|
6747
7080
|
className: "absolute top-1/2 -translate-y-1/2 whitespace-nowrap rounded bg-card/95 px-1.5 py-0.5 text-[10px] font-medium text-primary",
|
|
@@ -6756,7 +7089,7 @@ function HierarchyDragIndicatorLayer({
|
|
|
6756
7089
|
);
|
|
6757
7090
|
}
|
|
6758
7091
|
const lineTop = preview.position === "before" ? indicator.top - 1 : indicator.top + indicator.height - 1;
|
|
6759
|
-
return /* @__PURE__ */
|
|
7092
|
+
return /* @__PURE__ */ jsx32(
|
|
6760
7093
|
"div",
|
|
6761
7094
|
{
|
|
6762
7095
|
"aria-hidden": "true",
|
|
@@ -6767,9 +7100,9 @@ function HierarchyDragIndicatorLayer({
|
|
|
6767
7100
|
left: indent,
|
|
6768
7101
|
width: Math.max(0, indicator.left + indicator.width - indent - 8)
|
|
6769
7102
|
},
|
|
6770
|
-
children: /* @__PURE__ */
|
|
6771
|
-
/* @__PURE__ */
|
|
6772
|
-
/* @__PURE__ */
|
|
7103
|
+
children: /* @__PURE__ */ jsxs24("div", { className: "relative h-0.5 rounded-full bg-primary", children: [
|
|
7104
|
+
/* @__PURE__ */ jsx32("span", { className: "absolute -left-1 top-1/2 h-2 w-2 -translate-y-1/2 rounded-full border-2 border-primary bg-card" }),
|
|
7105
|
+
/* @__PURE__ */ jsxs24(
|
|
6773
7106
|
"span",
|
|
6774
7107
|
{
|
|
6775
7108
|
className: cn(
|
|
@@ -6814,7 +7147,7 @@ function renderCell(row, col, index) {
|
|
|
6814
7147
|
if (asUuid && typeof raw === "string") {
|
|
6815
7148
|
const forbidden = typeof col.fk?.forbidden === "function" ? col.fk.forbidden(raw, row) : Boolean(col.fk?.forbidden);
|
|
6816
7149
|
const declaredToken = typeof col.fk?.token === "function" ? col.fk.token(row) : col.fk?.token;
|
|
6817
|
-
return /* @__PURE__ */
|
|
7150
|
+
return /* @__PURE__ */ jsx32(
|
|
6818
7151
|
MatrxUuidCell,
|
|
6819
7152
|
{
|
|
6820
7153
|
value: raw,
|
|
@@ -6826,7 +7159,7 @@ function renderCell(row, col, index) {
|
|
|
6826
7159
|
}
|
|
6827
7160
|
);
|
|
6828
7161
|
}
|
|
6829
|
-
return /* @__PURE__ */
|
|
7162
|
+
return /* @__PURE__ */ jsx32("span", { className: "text-sm text-foreground", children: stringifyCellValue(raw) || "\u2014" });
|
|
6830
7163
|
}
|
|
6831
7164
|
function defaultRowTitle(row, columns) {
|
|
6832
7165
|
for (const col of columns) {
|