@ai-matrx/design-system 0.21.2 → 0.21.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/content-transfer.cjs +20 -6
- package/dist/content-transfer.cjs.map +1 -1
- package/dist/content-transfer.d.cts +38 -4
- package/dist/content-transfer.d.ts +38 -4
- package/dist/content-transfer.js +20 -6
- package/dist/content-transfer.js.map +1 -1
- package/dist/data-table/copy-helpers.d.cts +4 -3
- package/dist/data-table/copy-helpers.d.ts +4 -3
- package/dist/data-table/copy-types.cjs.map +1 -1
- package/dist/data-table/copy-types.d.cts +7 -2
- package/dist/data-table/copy-types.d.ts +7 -2
- package/dist/data-table/data-row-inspector.cjs +23 -6
- package/dist/data-table/data-row-inspector.cjs.map +1 -1
- package/dist/data-table/data-row-inspector.js +23 -6
- package/dist/data-table/data-row-inspector.js.map +1 -1
- package/dist/data-table/data-row-window.cjs +23 -6
- package/dist/data-table/data-row-window.cjs.map +1 -1
- package/dist/data-table/data-row-window.js +23 -6
- package/dist/data-table/data-row-window.js.map +1 -1
- package/dist/data-table/filter-engine.d.cts +4 -3
- package/dist/data-table/filter-engine.d.ts +4 -3
- package/dist/data-table/host.cjs +12 -1
- package/dist/data-table/host.cjs.map +1 -1
- package/dist/data-table/host.d.cts +16 -3
- package/dist/data-table/host.d.ts +16 -3
- package/dist/data-table/host.js +12 -1
- package/dist/data-table/host.js.map +1 -1
- package/dist/data-table/index.cjs +799 -724
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.d.cts +15 -6
- package/dist/data-table/index.d.ts +15 -6
- package/dist/data-table/index.js +755 -680
- package/dist/data-table/index.js.map +1 -1
- package/dist/data-table/infer-filter.d.cts +4 -3
- package/dist/data-table/infer-filter.d.ts +4 -3
- package/dist/data-table/layered-filters.d.cts +4 -3
- package/dist/data-table/layered-filters.d.ts +4 -3
- package/dist/data-table/pagination.cjs +3 -0
- package/dist/data-table/pagination.cjs.map +1 -1
- package/dist/data-table/pagination.js +3 -0
- package/dist/data-table/pagination.js.map +1 -1
- package/dist/data-table/query-control.d.cts +4 -3
- package/dist/data-table/query-control.d.ts +4 -3
- package/dist/data-table/types.cjs.map +1 -1
- package/dist/data-table/types.d.cts +3 -2
- package/dist/data-table/types.d.ts +3 -2
- package/dist/data-table/url-state.d.cts +4 -3
- package/dist/data-table/url-state.d.ts +4 -3
- package/dist/data-table/uuid-cell.cjs +3 -0
- package/dist/data-table/uuid-cell.cjs.map +1 -1
- package/dist/data-table/uuid-cell.js +3 -0
- package/dist/data-table/uuid-cell.js.map +1 -1
- package/dist/data-table/xlsx.d.cts +4 -3
- package/dist/data-table/xlsx.d.ts +4 -3
- package/dist/{types-Bt-0UhEw.d.cts → types-BarjBFyG.d.cts} +3 -1
- package/dist/{types-DnnvjGV4.d.ts → types-JFlsIv-0.d.ts} +3 -1
- package/package.json +1 -1
- package/dist/extensions-DCHtNwG3.d.cts +0 -32
- package/dist/extensions-DCHtNwG3.d.ts +0 -32
package/dist/data-table/index.js
CHANGED
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
Fragment as Fragment6,
|
|
7
7
|
isValidElement as isValidElement2,
|
|
8
8
|
useCallback as useCallback6,
|
|
9
|
-
useEffect as
|
|
9
|
+
useEffect as useEffect14,
|
|
10
10
|
useId as useId2,
|
|
11
11
|
useLayoutEffect as useLayoutEffect2,
|
|
12
12
|
useMemo as useMemo7,
|
|
13
|
-
useRef as
|
|
14
|
-
useState as
|
|
13
|
+
useRef as useRef12,
|
|
14
|
+
useState as useState21
|
|
15
15
|
} from "react";
|
|
16
16
|
import {
|
|
17
17
|
DndContext,
|
|
@@ -1877,6 +1877,15 @@ function MatrxDataTableProvider({ value, children }) {
|
|
|
1877
1877
|
function useMatrxDataTableHost() {
|
|
1878
1878
|
return useContext4(HostContext);
|
|
1879
1879
|
}
|
|
1880
|
+
var ROW_ALCHEMY_SLOT = /* @__PURE__ */ Symbol.for("ai-matrx.design-system.table-row-alchemy-context");
|
|
1881
|
+
var rowAlchemyRegistry = globalThis;
|
|
1882
|
+
var RowAlchemyContext = rowAlchemyRegistry[ROW_ALCHEMY_SLOT] ??= createContext4(null);
|
|
1883
|
+
function MatrxTableRowAlchemyScope({ value, children }) {
|
|
1884
|
+
return /* @__PURE__ */ jsx18(RowAlchemyContext.Provider, { value, children });
|
|
1885
|
+
}
|
|
1886
|
+
function useMatrxTableRowAlchemy() {
|
|
1887
|
+
return useContext4(RowAlchemyContext);
|
|
1888
|
+
}
|
|
1880
1889
|
|
|
1881
1890
|
// src/data-table/useTableNotice.tsx
|
|
1882
1891
|
import { jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
@@ -3215,8 +3224,9 @@ function ContentTransferMenu(props) {
|
|
|
3215
3224
|
const identityKey = props.capabilities?.identityKey ?? inherited.identityKey;
|
|
3216
3225
|
return /* @__PURE__ */ jsx25(ContentTransferMenuSession, { ...props }, identityKey ?? "anonymous");
|
|
3217
3226
|
}
|
|
3218
|
-
function ContentTransferMenuSession({ references = [], referenceActions = [], source, surface, label, projection, sections, preferences, table, formatSources, sourceFormats = true, variants = EMPTY_VARIANTS, actions = [], capabilities: local, disabled, enabled = true, className, stopPropagation = true, hide = [], controllerRef, icon = "portal", triggerVariant = "transparent", triggerSize = "default" }) {
|
|
3227
|
+
function ContentTransferMenuSession({ references = [], referenceActions = [], source, surface, label, projection, sections, preferences, table, formatSources, sourceFormats = true, variants = EMPTY_VARIANTS, actions = [], capabilities: local, disabled, enabled = true, className, stopPropagation = true, hide = [], controllerRef, icon = "portal", triggerVariant = "transparent", triggerSize = "default", triggerHidden = false }) {
|
|
3219
3228
|
const triggerRef = React14.useRef(null);
|
|
3229
|
+
const restoreFocusRef = React14.useRef(null);
|
|
3220
3230
|
const inherited = React14.useContext(CapabilityContext);
|
|
3221
3231
|
const nearestSurface = React14.useContext(SurfaceContext);
|
|
3222
3232
|
const fence = useFence();
|
|
@@ -3466,13 +3476,21 @@ function ContentTransferMenuSession({ references = [], referenceActions = [], so
|
|
|
3466
3476
|
);
|
|
3467
3477
|
React14.useImperativeHandle(controllerRef, () => ({
|
|
3468
3478
|
focusTrigger: () => triggerRef.current?.focus(),
|
|
3479
|
+
preparePrimary: async (options) => {
|
|
3480
|
+
if (!enabled) throw new Error("Alchemy is not enabled for this record.");
|
|
3481
|
+
if (disabled) throw new Error("Alchemy is disabled for this record.");
|
|
3482
|
+
if (hide.includes("prepare")) throw new Error("Alchemy preparation is unavailable for this record.");
|
|
3483
|
+
if (!primary) throw new Error("Alchemy has no source to prepare.");
|
|
3484
|
+
restoreFocusRef.current = options?.restoreFocus ?? null;
|
|
3485
|
+
await openWorkspace(primaryWorkspaceKey, { source: primary, label: sourceLabel });
|
|
3486
|
+
},
|
|
3469
3487
|
prepare: async (requestedSource, options) => {
|
|
3470
3488
|
const requestedLabel = options?.label ?? ("label" in requestedSource ? requestedSource.label : "content");
|
|
3471
3489
|
const requestedKey = `controller:${options?.id ?? "source"}:${materialIdentity(requestedSource)}`;
|
|
3472
3490
|
externalWorkspaceKeys.current.add(requestedKey);
|
|
3473
3491
|
await openWorkspace(requestedKey, { source: requestedSource, label: requestedLabel });
|
|
3474
3492
|
}
|
|
3475
|
-
}), [openWorkspace]);
|
|
3493
|
+
}), [disabled, enabled, hide, openWorkspace, primary, primaryWorkspaceKey, sourceLabel]);
|
|
3476
3494
|
const runAction = React14.useCallback(async (action) => {
|
|
3477
3495
|
const { controller, id } = fence.begin();
|
|
3478
3496
|
try {
|
|
@@ -3555,7 +3573,7 @@ function ContentTransferMenuSession({ references = [], referenceActions = [], so
|
|
|
3555
3573
|
] }, id);
|
|
3556
3574
|
};
|
|
3557
3575
|
return /* @__PURE__ */ jsxs17("span", { className: cn("matrx-alchemy", className), onClick: stopPropagation ? (event) => event.stopPropagation() : void 0, children: [
|
|
3558
|
-
/* @__PURE__ */ jsxs17(Popover, { open: paletteOpen, onOpenChange: (open) => {
|
|
3576
|
+
!triggerHidden ? /* @__PURE__ */ jsxs17(Popover, { open: paletteOpen, onOpenChange: (open) => {
|
|
3559
3577
|
setPaletteOpen(open);
|
|
3560
3578
|
if (open) {
|
|
3561
3579
|
setMode("copy");
|
|
@@ -3664,13 +3682,13 @@ function ContentTransferMenuSession({ references = [], referenceActions = [], so
|
|
|
3664
3682
|
] }, group) : null;
|
|
3665
3683
|
})
|
|
3666
3684
|
] })
|
|
3667
|
-
] }),
|
|
3685
|
+
] }) : null,
|
|
3668
3686
|
notice && triggerRef.current ? createPortal(/* @__PURE__ */ jsxs17("div", { className: "matrx-alchemy-feedback", children: [
|
|
3669
3687
|
/* @__PURE__ */ jsx25("span", { role: "status", children: notice }),
|
|
3670
3688
|
/* @__PURE__ */ jsx25(ReceiptLink, { target: receiptTarget }),
|
|
3671
3689
|
/* @__PURE__ */ jsx25("button", { type: "button", "aria-label": "Dismiss Alchemy feedback", onClick: () => setNotice(null), children: "\xD7" })
|
|
3672
3690
|
] }), triggerRef.current.ownerDocument.body) : null,
|
|
3673
|
-
Object.values(workspaces).map((saved) => /* @__PURE__ */ jsx25(PreparationWorkspace, { restoreFocus: () => triggerRef.current?.focus(), open: workspaceOpen && workspaceKey === saved.key, state: saved, scopes, scopeLabels: table?.scopeLabels, onClose: () => setWorkspaceOpen(false), onChange: (next) => setWorkspaces((current) => ({ ...current, [saved.key]: next })), transport, adapters, actions: preparedActions, captureScope: workspaceCaptures.current.get(saved.key) ?? capturePrimary, ...ai ? { ai } : {}, onOutcome: report }, saved.key)),
|
|
3691
|
+
Object.values(workspaces).map((saved) => /* @__PURE__ */ jsx25(PreparationWorkspace, { restoreFocus: () => restoreFocusRef.current?.() ?? triggerRef.current?.focus(), open: workspaceOpen && workspaceKey === saved.key, state: saved, scopes, scopeLabels: table?.scopeLabels, onClose: () => setWorkspaceOpen(false), onChange: (next) => setWorkspaces((current) => ({ ...current, [saved.key]: next })), transport, adapters, actions: preparedActions, captureScope: workspaceCaptures.current.get(saved.key) ?? capturePrimary, ...ai ? { ai } : {}, onOutcome: report }, saved.key)),
|
|
3674
3692
|
emailReview
|
|
3675
3693
|
] });
|
|
3676
3694
|
}
|
|
@@ -4477,7 +4495,12 @@ function MatrxCopyMenuSession(props) {
|
|
|
4477
4495
|
...props.referenceActions ? { referenceActions: props.referenceActions } : {},
|
|
4478
4496
|
...props.icon !== void 0 ? { icon: props.icon } : {},
|
|
4479
4497
|
...props.triggerVariant !== void 0 ? { triggerVariant: props.triggerVariant } : {},
|
|
4480
|
-
controllerRef:
|
|
4498
|
+
controllerRef: (value) => {
|
|
4499
|
+
controller.current = value;
|
|
4500
|
+
if (typeof props.controllerRef === "function") props.controllerRef(value);
|
|
4501
|
+
else if (props.controllerRef) props.controllerRef.current = value;
|
|
4502
|
+
},
|
|
4503
|
+
...props.triggerHidden ? { triggerHidden: true } : {},
|
|
4481
4504
|
label: props.label,
|
|
4482
4505
|
variants,
|
|
4483
4506
|
actions,
|
|
@@ -5566,12 +5589,47 @@ import {
|
|
|
5566
5589
|
useUrlState
|
|
5567
5590
|
} from "@ai-matrx/kit/url-state";
|
|
5568
5591
|
|
|
5592
|
+
// src/data-table/RowAlchemyLauncher.tsx
|
|
5593
|
+
import { useEffect as useEffect8, useRef as useRef9, useState as useState13 } from "react";
|
|
5594
|
+
import { jsx as jsx29, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
5595
|
+
function MatrxTableRowAlchemyProvider({ copy, placement, children }) {
|
|
5596
|
+
const controller = useRef9(null);
|
|
5597
|
+
const { CopyControls } = useMatrxDataTableHost();
|
|
5598
|
+
const [active, setActive] = useState13(false);
|
|
5599
|
+
const [fallback, setFallback] = useState13(false);
|
|
5600
|
+
useEffect8(() => {
|
|
5601
|
+
if (placement !== "menu" || active) return;
|
|
5602
|
+
const timer = window.setTimeout(() => {
|
|
5603
|
+
if (!active) {
|
|
5604
|
+
console.warn("MatrxDataTable rowCopyPlacement='menu' requires an ItemMenu in rowActions; showing inline Alchemy instead.");
|
|
5605
|
+
setFallback(true);
|
|
5606
|
+
}
|
|
5607
|
+
}, 0);
|
|
5608
|
+
return () => window.clearTimeout(timer);
|
|
5609
|
+
}, [active, placement]);
|
|
5610
|
+
const value = {
|
|
5611
|
+
copy,
|
|
5612
|
+
placement,
|
|
5613
|
+
ready: active,
|
|
5614
|
+
activate: () => setActive(true),
|
|
5615
|
+
prepare: async (restoreFocus) => {
|
|
5616
|
+
if (copy.disabled) throw new Error("Alchemy is disabled for this record.");
|
|
5617
|
+
if (!controller.current) throw new Error("Alchemy is unavailable because its launcher did not mount.");
|
|
5618
|
+
await controller.current.preparePrimary(restoreFocus ? { restoreFocus } : void 0);
|
|
5619
|
+
}
|
|
5620
|
+
};
|
|
5621
|
+
return /* @__PURE__ */ jsxs20(MatrxTableRowAlchemyScope, { value, children: [
|
|
5622
|
+
active || fallback ? CopyControls ? /* @__PURE__ */ jsx29(CopyControls, { ...copy, triggerHidden: active, controllerRef: controller }) : /* @__PURE__ */ jsx29(MatrxCopyMenu, { ...copy, triggerHidden: active, controllerRef: controller }) : null,
|
|
5623
|
+
children
|
|
5624
|
+
] });
|
|
5625
|
+
}
|
|
5626
|
+
|
|
5569
5627
|
// src/data-table/ColumnHeaderCell.tsx
|
|
5570
5628
|
import {
|
|
5571
5629
|
forwardRef as forwardRef12,
|
|
5572
|
-
useEffect as
|
|
5630
|
+
useEffect as useEffect9,
|
|
5573
5631
|
useMemo as useMemo5,
|
|
5574
|
-
useState as
|
|
5632
|
+
useState as useState14
|
|
5575
5633
|
} from "react";
|
|
5576
5634
|
import { useDraggable } from "@dnd-kit/core";
|
|
5577
5635
|
|
|
@@ -5579,8 +5637,8 @@ import { useDraggable } from "@dnd-kit/core";
|
|
|
5579
5637
|
import * as DialogPrimitive2 from "@radix-ui/react-dialog";
|
|
5580
5638
|
import { Command as CommandPrimitive } from "cmdk";
|
|
5581
5639
|
import * as React16 from "react";
|
|
5582
|
-
import { jsx as
|
|
5583
|
-
var Command = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
5640
|
+
import { jsx as jsx30, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
5641
|
+
var Command = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx30(
|
|
5584
5642
|
CommandPrimitive,
|
|
5585
5643
|
{
|
|
5586
5644
|
ref,
|
|
@@ -5599,8 +5657,8 @@ var CommandDialogContent = React16.forwardRef(({ className, children, container,
|
|
|
5599
5657
|
const isMobile = useIsMobile();
|
|
5600
5658
|
const isModal = useRadixDialogModal();
|
|
5601
5659
|
const portalContainer = usePortalContainer(container);
|
|
5602
|
-
return /* @__PURE__ */
|
|
5603
|
-
isModal ? /* @__PURE__ */
|
|
5660
|
+
return /* @__PURE__ */ jsxs21(DialogPrimitive2.Portal, { container: portalContainer, children: [
|
|
5661
|
+
isModal ? /* @__PURE__ */ jsx30(
|
|
5604
5662
|
DialogPrimitive2.Overlay,
|
|
5605
5663
|
{
|
|
5606
5664
|
className: cn(
|
|
@@ -5609,7 +5667,7 @@ var CommandDialogContent = React16.forwardRef(({ className, children, container,
|
|
|
5609
5667
|
)
|
|
5610
5668
|
}
|
|
5611
5669
|
) : null,
|
|
5612
|
-
/* @__PURE__ */
|
|
5670
|
+
/* @__PURE__ */ jsxs21(
|
|
5613
5671
|
DialogPrimitive2.Content,
|
|
5614
5672
|
{
|
|
5615
5673
|
ref,
|
|
@@ -5625,9 +5683,9 @@ var CommandDialogContent = React16.forwardRef(({ className, children, container,
|
|
|
5625
5683
|
...props,
|
|
5626
5684
|
children: [
|
|
5627
5685
|
children,
|
|
5628
|
-
/* @__PURE__ */
|
|
5629
|
-
/* @__PURE__ */
|
|
5630
|
-
/* @__PURE__ */
|
|
5686
|
+
/* @__PURE__ */ jsxs21(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: [
|
|
5687
|
+
/* @__PURE__ */ jsx30(XIcon, { className: "h-4 w-4" }),
|
|
5688
|
+
/* @__PURE__ */ jsx30("span", { className: "sr-only", children: "Close" })
|
|
5631
5689
|
] })
|
|
5632
5690
|
]
|
|
5633
5691
|
}
|
|
@@ -5635,9 +5693,9 @@ var CommandDialogContent = React16.forwardRef(({ className, children, container,
|
|
|
5635
5693
|
] });
|
|
5636
5694
|
});
|
|
5637
5695
|
CommandDialogContent.displayName = "CommandDialogContent";
|
|
5638
|
-
var CommandInput = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
5639
|
-
/* @__PURE__ */
|
|
5640
|
-
/* @__PURE__ */
|
|
5696
|
+
var CommandInput = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs21("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
|
5697
|
+
/* @__PURE__ */ jsx30(MagnifyingGlassIcon, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
5698
|
+
/* @__PURE__ */ jsx30(
|
|
5641
5699
|
CommandPrimitive.Input,
|
|
5642
5700
|
{
|
|
5643
5701
|
ref,
|
|
@@ -5650,7 +5708,7 @@ var CommandInput = React16.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
5650
5708
|
)
|
|
5651
5709
|
] }));
|
|
5652
5710
|
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
|
5653
|
-
var CommandList = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
5711
|
+
var CommandList = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx30(
|
|
5654
5712
|
CommandPrimitive.List,
|
|
5655
5713
|
{
|
|
5656
5714
|
ref,
|
|
@@ -5659,7 +5717,7 @@ var CommandList = React16.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5659
5717
|
}
|
|
5660
5718
|
));
|
|
5661
5719
|
CommandList.displayName = CommandPrimitive.List.displayName;
|
|
5662
|
-
var CommandEmpty = React16.forwardRef((props, ref) => /* @__PURE__ */
|
|
5720
|
+
var CommandEmpty = React16.forwardRef((props, ref) => /* @__PURE__ */ jsx30(
|
|
5663
5721
|
CommandPrimitive.Empty,
|
|
5664
5722
|
{
|
|
5665
5723
|
ref,
|
|
@@ -5668,7 +5726,7 @@ var CommandEmpty = React16.forwardRef((props, ref) => /* @__PURE__ */ jsx29(
|
|
|
5668
5726
|
}
|
|
5669
5727
|
));
|
|
5670
5728
|
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
|
5671
|
-
var CommandGroup = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
5729
|
+
var CommandGroup = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx30(
|
|
5672
5730
|
CommandPrimitive.Group,
|
|
5673
5731
|
{
|
|
5674
5732
|
ref,
|
|
@@ -5680,7 +5738,7 @@ var CommandGroup = React16.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
5680
5738
|
}
|
|
5681
5739
|
));
|
|
5682
5740
|
CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
|
5683
|
-
var CommandSeparator = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
5741
|
+
var CommandSeparator = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx30(
|
|
5684
5742
|
CommandPrimitive.Separator,
|
|
5685
5743
|
{
|
|
5686
5744
|
ref,
|
|
@@ -5689,7 +5747,7 @@ var CommandSeparator = React16.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
5689
5747
|
}
|
|
5690
5748
|
));
|
|
5691
5749
|
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
|
|
5692
|
-
var CommandItem = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
5750
|
+
var CommandItem = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx30(
|
|
5693
5751
|
CommandPrimitive.Item,
|
|
5694
5752
|
{
|
|
5695
5753
|
ref,
|
|
@@ -5705,7 +5763,7 @@ var CommandShortcut = ({
|
|
|
5705
5763
|
className,
|
|
5706
5764
|
...props
|
|
5707
5765
|
}) => {
|
|
5708
|
-
return /* @__PURE__ */
|
|
5766
|
+
return /* @__PURE__ */ jsx30(
|
|
5709
5767
|
"span",
|
|
5710
5768
|
{
|
|
5711
5769
|
className: cn(
|
|
@@ -5719,10 +5777,10 @@ var CommandShortcut = ({
|
|
|
5719
5777
|
CommandShortcut.displayName = "CommandShortcut";
|
|
5720
5778
|
|
|
5721
5779
|
// src/data-table/ColumnHeaderCell.tsx
|
|
5722
|
-
import { Fragment as Fragment4, jsx as
|
|
5780
|
+
import { Fragment as Fragment4, jsx as jsx31, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5723
5781
|
var HeaderButton = forwardRef12(({ dragDescription, "aria-describedby": tooltipDescription, ...props }, ref) => {
|
|
5724
5782
|
const descriptions = [tooltipDescription, dragDescription].filter((value) => Boolean(value)).join(" ");
|
|
5725
|
-
return /* @__PURE__ */
|
|
5783
|
+
return /* @__PURE__ */ jsx31(
|
|
5726
5784
|
"button",
|
|
5727
5785
|
{
|
|
5728
5786
|
ref,
|
|
@@ -5780,9 +5838,9 @@ function ColumnHeaderCell({
|
|
|
5780
5838
|
const reorderClass = reorderEnabled ? "touch-none cursor-grab active:cursor-grabbing" : void 0;
|
|
5781
5839
|
const filterActive = isColumnFilterActive(filterValue);
|
|
5782
5840
|
const deferredFilter = filterApplyLabel !== void 0 || filterShowCancel || filterFooterHint !== void 0;
|
|
5783
|
-
const [filterOpen, setFilterOpen] =
|
|
5784
|
-
const [draftFilter, setDraftFilter] =
|
|
5785
|
-
|
|
5841
|
+
const [filterOpen, setFilterOpen] = useState14(false);
|
|
5842
|
+
const [draftFilter, setDraftFilter] = useState14(filterValue);
|
|
5843
|
+
useEffect9(() => {
|
|
5786
5844
|
if (!filterOpen) setDraftFilter(filterValue);
|
|
5787
5845
|
}, [filterOpen, filterValue]);
|
|
5788
5846
|
const applyFilter = () => {
|
|
@@ -5802,7 +5860,7 @@ function ColumnHeaderCell({
|
|
|
5802
5860
|
else onFilterChange(next);
|
|
5803
5861
|
};
|
|
5804
5862
|
const menuLabel = labelText ? `Sort or filter ${labelText}` : "Sort or filter column";
|
|
5805
|
-
const menuContent = /* @__PURE__ */
|
|
5863
|
+
const menuContent = /* @__PURE__ */ jsxs22(
|
|
5806
5864
|
PopoverContent,
|
|
5807
5865
|
{
|
|
5808
5866
|
align: "start",
|
|
@@ -5819,9 +5877,9 @@ function ColumnHeaderCell({
|
|
|
5819
5877
|
input.focus();
|
|
5820
5878
|
},
|
|
5821
5879
|
children: [
|
|
5822
|
-
sortable ? /* @__PURE__ */
|
|
5823
|
-
/* @__PURE__ */
|
|
5824
|
-
/* @__PURE__ */
|
|
5880
|
+
sortable ? /* @__PURE__ */ jsxs22(Fragment4, { children: [
|
|
5881
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-0.5 pb-2", children: [
|
|
5882
|
+
/* @__PURE__ */ jsxs22(
|
|
5825
5883
|
Button,
|
|
5826
5884
|
{
|
|
5827
5885
|
variant: isSorted && sortDirection === "asc" ? "secondary" : "ghost",
|
|
@@ -5829,12 +5887,12 @@ function ColumnHeaderCell({
|
|
|
5829
5887
|
className: "h-8 justify-start gap-2 px-2 text-xs font-normal",
|
|
5830
5888
|
onClick: onSortAsc,
|
|
5831
5889
|
children: [
|
|
5832
|
-
/* @__PURE__ */
|
|
5890
|
+
/* @__PURE__ */ jsx31(ArrowUp, { className: "h-3.5 w-3.5" }),
|
|
5833
5891
|
"Sort ascending"
|
|
5834
5892
|
]
|
|
5835
5893
|
}
|
|
5836
5894
|
),
|
|
5837
|
-
/* @__PURE__ */
|
|
5895
|
+
/* @__PURE__ */ jsxs22(
|
|
5838
5896
|
Button,
|
|
5839
5897
|
{
|
|
5840
5898
|
variant: isSorted && sortDirection === "desc" ? "secondary" : "ghost",
|
|
@@ -5842,12 +5900,12 @@ function ColumnHeaderCell({
|
|
|
5842
5900
|
className: "h-8 justify-start gap-2 px-2 text-xs font-normal",
|
|
5843
5901
|
onClick: onSortDesc,
|
|
5844
5902
|
children: [
|
|
5845
|
-
/* @__PURE__ */
|
|
5903
|
+
/* @__PURE__ */ jsx31(ArrowDown, { className: "h-3.5 w-3.5" }),
|
|
5846
5904
|
"Sort descending"
|
|
5847
5905
|
]
|
|
5848
5906
|
}
|
|
5849
5907
|
),
|
|
5850
|
-
isSorted ? /* @__PURE__ */
|
|
5908
|
+
isSorted ? /* @__PURE__ */ jsxs22(
|
|
5851
5909
|
Button,
|
|
5852
5910
|
{
|
|
5853
5911
|
variant: "ghost",
|
|
@@ -5855,15 +5913,15 @@ function ColumnHeaderCell({
|
|
|
5855
5913
|
className: "h-8 justify-start gap-2 px-2 text-xs font-normal text-muted-foreground",
|
|
5856
5914
|
onClick: onClearSort,
|
|
5857
5915
|
children: [
|
|
5858
|
-
/* @__PURE__ */
|
|
5916
|
+
/* @__PURE__ */ jsx31(ListX, { className: "h-3.5 w-3.5" }),
|
|
5859
5917
|
"Clear sort"
|
|
5860
5918
|
]
|
|
5861
5919
|
}
|
|
5862
5920
|
) : null
|
|
5863
5921
|
] }),
|
|
5864
|
-
filterKind ? /* @__PURE__ */
|
|
5922
|
+
filterKind ? /* @__PURE__ */ jsx31("div", { className: "mb-2 h-px bg-border" }) : null
|
|
5865
5923
|
] }) : null,
|
|
5866
|
-
filterKind ? /* @__PURE__ */
|
|
5924
|
+
filterKind ? /* @__PURE__ */ jsx31(
|
|
5867
5925
|
FilterBody,
|
|
5868
5926
|
{
|
|
5869
5927
|
kind: filterKind,
|
|
@@ -5878,10 +5936,10 @@ function ColumnHeaderCell({
|
|
|
5878
5936
|
allowNullModes
|
|
5879
5937
|
}
|
|
5880
5938
|
) : null,
|
|
5881
|
-
filterKind && visibleFilter && allowNegation ? /* @__PURE__ */
|
|
5882
|
-
/* @__PURE__ */
|
|
5883
|
-
/* @__PURE__ */
|
|
5884
|
-
/* @__PURE__ */
|
|
5939
|
+
filterKind && visibleFilter && allowNegation ? /* @__PURE__ */ jsxs22("div", { className: "mt-2 border-t border-border pt-2", children: [
|
|
5940
|
+
/* @__PURE__ */ jsx31("p", { className: "mb-1 text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: "Match mode" }),
|
|
5941
|
+
/* @__PURE__ */ jsxs22("div", { className: "grid grid-cols-2 gap-1 rounded-md border p-0.5", children: [
|
|
5942
|
+
/* @__PURE__ */ jsx31(
|
|
5885
5943
|
"button",
|
|
5886
5944
|
{
|
|
5887
5945
|
type: "button",
|
|
@@ -5894,7 +5952,7 @@ function ColumnHeaderCell({
|
|
|
5894
5952
|
children: "Include"
|
|
5895
5953
|
}
|
|
5896
5954
|
),
|
|
5897
|
-
/* @__PURE__ */
|
|
5955
|
+
/* @__PURE__ */ jsx31(
|
|
5898
5956
|
"button",
|
|
5899
5957
|
{
|
|
5900
5958
|
type: "button",
|
|
@@ -5909,11 +5967,11 @@ function ColumnHeaderCell({
|
|
|
5909
5967
|
)
|
|
5910
5968
|
] })
|
|
5911
5969
|
] }) : null,
|
|
5912
|
-
filterKind && deferredFilter ? /* @__PURE__ */
|
|
5913
|
-
filterFooterHint ? /* @__PURE__ */
|
|
5914
|
-
/* @__PURE__ */
|
|
5915
|
-
filterShowCancel ? /* @__PURE__ */
|
|
5916
|
-
/* @__PURE__ */
|
|
5970
|
+
filterKind && deferredFilter ? /* @__PURE__ */ jsxs22("div", { className: "mt-2 border-t border-border pt-2", children: [
|
|
5971
|
+
filterFooterHint ? /* @__PURE__ */ jsx31("div", { className: "mb-2 text-xs text-muted-foreground", children: filterFooterHint }) : null,
|
|
5972
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex justify-end gap-2", children: [
|
|
5973
|
+
filterShowCancel ? /* @__PURE__ */ jsx31(Button, { type: "button", variant: "ghost", size: "sm", onClick: cancelFilter, children: "Cancel" }) : null,
|
|
5974
|
+
/* @__PURE__ */ jsx31(Button, { type: "button", size: "sm", onClick: applyFilter, children: filterApplyLabel ?? "Apply" })
|
|
5917
5975
|
] })
|
|
5918
5976
|
] }) : null
|
|
5919
5977
|
]
|
|
@@ -5922,10 +5980,10 @@ function ColumnHeaderCell({
|
|
|
5922
5980
|
if (compact) {
|
|
5923
5981
|
if (!sortable && !filterKind) {
|
|
5924
5982
|
if (!reorderEnabled) {
|
|
5925
|
-
return /* @__PURE__ */
|
|
5983
|
+
return /* @__PURE__ */ jsx31("div", { className: cn("flex items-center justify-center", className), children: label });
|
|
5926
5984
|
}
|
|
5927
|
-
return /* @__PURE__ */
|
|
5928
|
-
/* @__PURE__ */
|
|
5985
|
+
return /* @__PURE__ */ jsx31("div", { className: cn("flex items-center justify-center", className), children: /* @__PURE__ */ jsxs22(Tooltip, { children: [
|
|
5986
|
+
/* @__PURE__ */ jsx31(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx31(
|
|
5929
5987
|
HeaderButton,
|
|
5930
5988
|
{
|
|
5931
5989
|
type: "button",
|
|
@@ -5937,14 +5995,14 @@ function ColumnHeaderCell({
|
|
|
5937
5995
|
children: label
|
|
5938
5996
|
}
|
|
5939
5997
|
) }),
|
|
5940
|
-
/* @__PURE__ */
|
|
5998
|
+
/* @__PURE__ */ jsxs22(TooltipContent, { children: [
|
|
5941
5999
|
"Drag to reorder ",
|
|
5942
6000
|
reorderLabel,
|
|
5943
6001
|
"."
|
|
5944
6002
|
] })
|
|
5945
6003
|
] }) });
|
|
5946
6004
|
}
|
|
5947
|
-
return /* @__PURE__ */
|
|
6005
|
+
return /* @__PURE__ */ jsx31(
|
|
5948
6006
|
"div",
|
|
5949
6007
|
{
|
|
5950
6008
|
className: cn(
|
|
@@ -5952,9 +6010,9 @@ function ColumnHeaderCell({
|
|
|
5952
6010
|
align === "right" ? "justify-end" : "justify-center",
|
|
5953
6011
|
className
|
|
5954
6012
|
),
|
|
5955
|
-
children: /* @__PURE__ */
|
|
5956
|
-
/* @__PURE__ */
|
|
5957
|
-
/* @__PURE__ */
|
|
6013
|
+
children: /* @__PURE__ */ jsxs22(Popover, { open: filterOpen, onOpenChange: setFilterOpen, children: [
|
|
6014
|
+
/* @__PURE__ */ jsxs22(Tooltip, { children: [
|
|
6015
|
+
/* @__PURE__ */ jsx31(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx31(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs22(
|
|
5958
6016
|
HeaderButton,
|
|
5959
6017
|
{
|
|
5960
6018
|
type: "button",
|
|
@@ -5972,8 +6030,8 @@ function ColumnHeaderCell({
|
|
|
5972
6030
|
),
|
|
5973
6031
|
children: [
|
|
5974
6032
|
label,
|
|
5975
|
-
isSorted ? sortDirection === "asc" ? /* @__PURE__ */
|
|
5976
|
-
filterActive ? /* @__PURE__ */
|
|
6033
|
+
isSorted ? sortDirection === "asc" ? /* @__PURE__ */ jsx31(ArrowUp, { className: "absolute -top-1 right-0 h-2 w-2 text-primary" }) : /* @__PURE__ */ jsx31(ArrowDown, { className: "absolute -top-1 right-0 h-2 w-2 text-primary" }) : null,
|
|
6034
|
+
filterActive ? /* @__PURE__ */ jsx31(
|
|
5977
6035
|
"span",
|
|
5978
6036
|
{
|
|
5979
6037
|
"aria-hidden": true,
|
|
@@ -5983,7 +6041,7 @@ function ColumnHeaderCell({
|
|
|
5983
6041
|
]
|
|
5984
6042
|
}
|
|
5985
6043
|
) }) }),
|
|
5986
|
-
/* @__PURE__ */
|
|
6044
|
+
/* @__PURE__ */ jsxs22(TooltipContent, { children: [
|
|
5987
6045
|
"Canonical Matrx table \xB7 ",
|
|
5988
6046
|
menuLabel
|
|
5989
6047
|
] })
|
|
@@ -5993,7 +6051,7 @@ function ColumnHeaderCell({
|
|
|
5993
6051
|
}
|
|
5994
6052
|
);
|
|
5995
6053
|
}
|
|
5996
|
-
return /* @__PURE__ */
|
|
6054
|
+
return /* @__PURE__ */ jsxs22(
|
|
5997
6055
|
"div",
|
|
5998
6056
|
{
|
|
5999
6057
|
className: cn(
|
|
@@ -6003,8 +6061,8 @@ function ColumnHeaderCell({
|
|
|
6003
6061
|
className
|
|
6004
6062
|
),
|
|
6005
6063
|
children: [
|
|
6006
|
-
sortable ? /* @__PURE__ */
|
|
6007
|
-
/* @__PURE__ */
|
|
6064
|
+
sortable ? /* @__PURE__ */ jsxs22(Tooltip, { children: [
|
|
6065
|
+
/* @__PURE__ */ jsx31(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs22(
|
|
6008
6066
|
HeaderButton,
|
|
6009
6067
|
{
|
|
6010
6068
|
type: "button",
|
|
@@ -6016,14 +6074,14 @@ function ColumnHeaderCell({
|
|
|
6016
6074
|
isSorted ? "text-foreground" : "text-muted-foreground hover:text-foreground"
|
|
6017
6075
|
),
|
|
6018
6076
|
children: [
|
|
6019
|
-
/* @__PURE__ */
|
|
6020
|
-
isSorted ? sortDirection === "asc" ? /* @__PURE__ */
|
|
6077
|
+
/* @__PURE__ */ jsx31("span", { className: "truncate", children: label }),
|
|
6078
|
+
isSorted ? sortDirection === "asc" ? /* @__PURE__ */ jsx31(ArrowUp, { className: "h-3 w-3 shrink-0 text-primary" }) : /* @__PURE__ */ jsx31(ArrowDown, { className: "h-3 w-3 shrink-0 text-primary" }) : /* @__PURE__ */ jsx31(ArrowUpDown, { className: "h-3 w-3 shrink-0 opacity-40" })
|
|
6021
6079
|
]
|
|
6022
6080
|
}
|
|
6023
6081
|
) }),
|
|
6024
|
-
/* @__PURE__ */
|
|
6025
|
-
] }) : reorderEnabled ? /* @__PURE__ */
|
|
6026
|
-
/* @__PURE__ */
|
|
6082
|
+
/* @__PURE__ */ jsx31(TooltipContent, { children: reorderEnabled ? `Drag to reorder ${reorderLabel}.` : labelText ?? "Sort column" })
|
|
6083
|
+
] }) : reorderEnabled ? /* @__PURE__ */ jsxs22(Tooltip, { children: [
|
|
6084
|
+
/* @__PURE__ */ jsx31(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx31(
|
|
6027
6085
|
HeaderButton,
|
|
6028
6086
|
{
|
|
6029
6087
|
type: "button",
|
|
@@ -6035,16 +6093,16 @@ function ColumnHeaderCell({
|
|
|
6035
6093
|
children: label
|
|
6036
6094
|
}
|
|
6037
6095
|
) }),
|
|
6038
|
-
/* @__PURE__ */
|
|
6096
|
+
/* @__PURE__ */ jsxs22(TooltipContent, { children: [
|
|
6039
6097
|
"Drag to reorder ",
|
|
6040
6098
|
reorderLabel,
|
|
6041
6099
|
"."
|
|
6042
6100
|
] })
|
|
6043
|
-
] }) : /* @__PURE__ */
|
|
6044
|
-
filterKind || sortable ? /* @__PURE__ */
|
|
6045
|
-
/* @__PURE__ */
|
|
6046
|
-
/* @__PURE__ */
|
|
6047
|
-
/* @__PURE__ */
|
|
6101
|
+
] }) : /* @__PURE__ */ jsx31("span", { className: "truncate text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: label }),
|
|
6102
|
+
filterKind || sortable ? /* @__PURE__ */ jsxs22("div", { className: "inline-flex items-center", children: [
|
|
6103
|
+
/* @__PURE__ */ jsxs22(Popover, { open: filterOpen, onOpenChange: setFilterOpen, children: [
|
|
6104
|
+
/* @__PURE__ */ jsxs22(Tooltip, { children: [
|
|
6105
|
+
/* @__PURE__ */ jsx31(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx31(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx31(
|
|
6048
6106
|
"button",
|
|
6049
6107
|
{
|
|
6050
6108
|
type: "button",
|
|
@@ -6056,15 +6114,15 @@ function ColumnHeaderCell({
|
|
|
6056
6114
|
"rounded p-0.5 transition-colors",
|
|
6057
6115
|
filterActive ? "text-primary hover:text-primary/80" : "text-muted-foreground/40 hover:text-muted-foreground"
|
|
6058
6116
|
),
|
|
6059
|
-
children: filterKind ? /* @__PURE__ */
|
|
6117
|
+
children: filterKind ? /* @__PURE__ */ jsx31(ListFilter, { className: cn("h-3 w-3", filterActive && "fill-primary/20") }) : /* @__PURE__ */ jsx31(ArrowUpDown, { className: "h-3 w-3" })
|
|
6060
6118
|
}
|
|
6061
6119
|
) }) }),
|
|
6062
|
-
/* @__PURE__ */
|
|
6120
|
+
/* @__PURE__ */ jsx31(TooltipContent, { children: menuLabel })
|
|
6063
6121
|
] }),
|
|
6064
6122
|
menuContent
|
|
6065
6123
|
] }),
|
|
6066
|
-
filterActive ? /* @__PURE__ */
|
|
6067
|
-
/* @__PURE__ */
|
|
6124
|
+
filterActive ? /* @__PURE__ */ jsxs22(Tooltip, { children: [
|
|
6125
|
+
/* @__PURE__ */ jsx31(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx31(
|
|
6068
6126
|
"button",
|
|
6069
6127
|
{
|
|
6070
6128
|
type: "button",
|
|
@@ -6074,10 +6132,10 @@ function ColumnHeaderCell({
|
|
|
6074
6132
|
onFilterChange(void 0);
|
|
6075
6133
|
},
|
|
6076
6134
|
className: "rounded p-0.5 text-primary hover:bg-muted hover:text-foreground",
|
|
6077
|
-
children: /* @__PURE__ */
|
|
6135
|
+
children: /* @__PURE__ */ jsx31(X, { className: "h-3 w-3" })
|
|
6078
6136
|
}
|
|
6079
6137
|
) }),
|
|
6080
|
-
/* @__PURE__ */
|
|
6138
|
+
/* @__PURE__ */ jsx31(TooltipContent, { children: labelText ? `Clear ${labelText} filter` : "Clear this filter" })
|
|
6081
6139
|
] }) : null
|
|
6082
6140
|
] }) : null
|
|
6083
6141
|
]
|
|
@@ -6102,14 +6160,14 @@ function FilterBody({
|
|
|
6102
6160
|
onChange({ kind: "text", value: "", mode: next });
|
|
6103
6161
|
}
|
|
6104
6162
|
};
|
|
6105
|
-
return /* @__PURE__ */
|
|
6106
|
-
/* @__PURE__ */
|
|
6107
|
-
/* @__PURE__ */
|
|
6163
|
+
return /* @__PURE__ */ jsxs22("div", { className: "space-y-1.5 px-1", children: [
|
|
6164
|
+
/* @__PURE__ */ jsx31("p", { className: "text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: "Filter" }),
|
|
6165
|
+
/* @__PURE__ */ jsx31("div", { className: "flex gap-1", children: [
|
|
6108
6166
|
["contains", "Contains"],
|
|
6109
6167
|
["empty", "(empty)"],
|
|
6110
6168
|
["not_empty", "(not empty)"],
|
|
6111
6169
|
...allowNullModes ? [["null", "(null)"], ["not_null", "(not null)"]] : []
|
|
6112
|
-
].map(([m, label]) => /* @__PURE__ */
|
|
6170
|
+
].map(([m, label]) => /* @__PURE__ */ jsx31(
|
|
6113
6171
|
"button",
|
|
6114
6172
|
{
|
|
6115
6173
|
type: "button",
|
|
@@ -6123,8 +6181,8 @@ function FilterBody({
|
|
|
6123
6181
|
},
|
|
6124
6182
|
m
|
|
6125
6183
|
)) }),
|
|
6126
|
-
mode === "contains" && /* @__PURE__ */
|
|
6127
|
-
/* @__PURE__ */
|
|
6184
|
+
mode === "contains" && /* @__PURE__ */ jsxs22("div", { className: "relative", children: [
|
|
6185
|
+
/* @__PURE__ */ jsx31(
|
|
6128
6186
|
Input,
|
|
6129
6187
|
{
|
|
6130
6188
|
"data-matrx-filter-autofocus": true,
|
|
@@ -6137,14 +6195,14 @@ function FilterBody({
|
|
|
6137
6195
|
style: { fontSize: "16px" }
|
|
6138
6196
|
}
|
|
6139
6197
|
),
|
|
6140
|
-
text ? /* @__PURE__ */
|
|
6198
|
+
text ? /* @__PURE__ */ jsx31(
|
|
6141
6199
|
"button",
|
|
6142
6200
|
{
|
|
6143
6201
|
type: "button",
|
|
6144
6202
|
"aria-label": "Clear filter text",
|
|
6145
6203
|
className: "absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground hover:text-foreground",
|
|
6146
6204
|
onClick: () => onChange(void 0),
|
|
6147
|
-
children: /* @__PURE__ */
|
|
6205
|
+
children: /* @__PURE__ */ jsx31(X, { className: "h-3.5 w-3.5" })
|
|
6148
6206
|
}
|
|
6149
6207
|
) : null
|
|
6150
6208
|
] })
|
|
@@ -6152,7 +6210,7 @@ function FilterBody({
|
|
|
6152
6210
|
}
|
|
6153
6211
|
if (kind === "select") {
|
|
6154
6212
|
const selected = value?.kind === "select" ? value.values ?? (value.value && value.value !== "__all__" ? [value.value] : []) : [];
|
|
6155
|
-
return /* @__PURE__ */
|
|
6213
|
+
return /* @__PURE__ */ jsx31(
|
|
6156
6214
|
SearchableSelectFilter,
|
|
6157
6215
|
{
|
|
6158
6216
|
selected,
|
|
@@ -6164,9 +6222,9 @@ function FilterBody({
|
|
|
6164
6222
|
}
|
|
6165
6223
|
if (kind === "boolean") {
|
|
6166
6224
|
const current = value?.kind === "boolean" ? value.value : "__all__";
|
|
6167
|
-
return /* @__PURE__ */
|
|
6168
|
-
/* @__PURE__ */
|
|
6169
|
-
/* @__PURE__ */
|
|
6225
|
+
return /* @__PURE__ */ jsxs22("div", { className: "space-y-1.5 px-1", children: [
|
|
6226
|
+
/* @__PURE__ */ jsx31("p", { className: "text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: "Filter" }),
|
|
6227
|
+
/* @__PURE__ */ jsxs22(
|
|
6170
6228
|
Select,
|
|
6171
6229
|
{
|
|
6172
6230
|
value: current === "__all__" ? "__all__" : current ? "true" : "false",
|
|
@@ -6175,18 +6233,18 @@ function FilterBody({
|
|
|
6175
6233
|
else onChange({ kind: "boolean", value: v === "true" });
|
|
6176
6234
|
},
|
|
6177
6235
|
children: [
|
|
6178
|
-
/* @__PURE__ */
|
|
6179
|
-
/* @__PURE__ */
|
|
6180
|
-
/* @__PURE__ */
|
|
6181
|
-
/* @__PURE__ */
|
|
6182
|
-
/* @__PURE__ */
|
|
6236
|
+
/* @__PURE__ */ jsx31(SelectTrigger, { className: "h-8 text-xs", children: /* @__PURE__ */ jsx31(SelectValue, {}) }),
|
|
6237
|
+
/* @__PURE__ */ jsxs22(SelectContent, { children: [
|
|
6238
|
+
/* @__PURE__ */ jsx31(SelectItem, { value: "__all__", children: "All" }),
|
|
6239
|
+
/* @__PURE__ */ jsx31(SelectItem, { value: "true", children: "Yes" }),
|
|
6240
|
+
/* @__PURE__ */ jsx31(SelectItem, { value: "false", children: "No" })
|
|
6183
6241
|
] })
|
|
6184
6242
|
]
|
|
6185
6243
|
}
|
|
6186
6244
|
)
|
|
6187
6245
|
] });
|
|
6188
6246
|
}
|
|
6189
|
-
return /* @__PURE__ */
|
|
6247
|
+
return /* @__PURE__ */ jsx31(NumberFilterBody, { value, onChange });
|
|
6190
6248
|
}
|
|
6191
6249
|
function SearchableSelectFilter({
|
|
6192
6250
|
selected,
|
|
@@ -6194,7 +6252,7 @@ function SearchableSelectFilter({
|
|
|
6194
6252
|
onChange,
|
|
6195
6253
|
single = false
|
|
6196
6254
|
}) {
|
|
6197
|
-
const [query, setQuery] =
|
|
6255
|
+
const [query, setQuery] = useState14("");
|
|
6198
6256
|
const filtered = useMemo5(() => {
|
|
6199
6257
|
const q = query.trim().toLowerCase();
|
|
6200
6258
|
if (!q) return options;
|
|
@@ -6214,13 +6272,13 @@ function SearchableSelectFilter({
|
|
|
6214
6272
|
next.length === 0 ? void 0 : { kind: "select", value: next[0] ?? "", values: next }
|
|
6215
6273
|
);
|
|
6216
6274
|
};
|
|
6217
|
-
return /* @__PURE__ */
|
|
6218
|
-
/* @__PURE__ */
|
|
6219
|
-
/* @__PURE__ */
|
|
6275
|
+
return /* @__PURE__ */ jsxs22("div", { className: "space-y-1 px-0", children: [
|
|
6276
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between px-1 pb-1", children: [
|
|
6277
|
+
/* @__PURE__ */ jsxs22("p", { className: "text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: [
|
|
6220
6278
|
"Filter",
|
|
6221
6279
|
selected.length > 1 ? ` (any of ${selected.length})` : ""
|
|
6222
6280
|
] }),
|
|
6223
|
-
selected.length > 0 ? /* @__PURE__ */
|
|
6281
|
+
selected.length > 0 ? /* @__PURE__ */ jsx31(
|
|
6224
6282
|
"button",
|
|
6225
6283
|
{
|
|
6226
6284
|
type: "button",
|
|
@@ -6230,8 +6288,8 @@ function SearchableSelectFilter({
|
|
|
6230
6288
|
}
|
|
6231
6289
|
) : null
|
|
6232
6290
|
] }),
|
|
6233
|
-
/* @__PURE__ */
|
|
6234
|
-
/* @__PURE__ */
|
|
6291
|
+
/* @__PURE__ */ jsxs22(Command, { className: "rounded-md border border-border", shouldFilter: false, children: [
|
|
6292
|
+
/* @__PURE__ */ jsx31(
|
|
6235
6293
|
CommandInput,
|
|
6236
6294
|
{
|
|
6237
6295
|
"data-matrx-filter-autofocus": true,
|
|
@@ -6241,10 +6299,10 @@ function SearchableSelectFilter({
|
|
|
6241
6299
|
className: "h-8 text-sm"
|
|
6242
6300
|
}
|
|
6243
6301
|
),
|
|
6244
|
-
/* @__PURE__ */
|
|
6245
|
-
/* @__PURE__ */
|
|
6246
|
-
/* @__PURE__ */
|
|
6247
|
-
/* @__PURE__ */
|
|
6302
|
+
/* @__PURE__ */ jsxs22(CommandList, { className: "max-h-48", children: [
|
|
6303
|
+
/* @__PURE__ */ jsx31(CommandEmpty, { className: "py-3 text-xs text-muted-foreground", children: "No matches" }),
|
|
6304
|
+
/* @__PURE__ */ jsxs22(CommandGroup, { children: [
|
|
6305
|
+
/* @__PURE__ */ jsx31(
|
|
6248
6306
|
CommandItem,
|
|
6249
6307
|
{
|
|
6250
6308
|
value: "__all__",
|
|
@@ -6255,7 +6313,7 @@ function SearchableSelectFilter({
|
|
|
6255
6313
|
),
|
|
6256
6314
|
filtered.map((o) => {
|
|
6257
6315
|
const active = selected.includes(o.value);
|
|
6258
|
-
return /* @__PURE__ */
|
|
6316
|
+
return /* @__PURE__ */ jsxs22(
|
|
6259
6317
|
CommandItem,
|
|
6260
6318
|
{
|
|
6261
6319
|
value: o.value,
|
|
@@ -6265,7 +6323,7 @@ function SearchableSelectFilter({
|
|
|
6265
6323
|
active && "bg-accent text-accent-foreground"
|
|
6266
6324
|
),
|
|
6267
6325
|
children: [
|
|
6268
|
-
/* @__PURE__ */
|
|
6326
|
+
/* @__PURE__ */ jsx31(
|
|
6269
6327
|
"span",
|
|
6270
6328
|
{
|
|
6271
6329
|
className: cn(
|
|
@@ -6273,7 +6331,7 @@ function SearchableSelectFilter({
|
|
|
6273
6331
|
single ? "rounded-full" : "rounded-sm",
|
|
6274
6332
|
active ? "border-primary bg-primary text-primary-foreground" : "border-muted-foreground/40"
|
|
6275
6333
|
),
|
|
6276
|
-
children: active && /* @__PURE__ */
|
|
6334
|
+
children: active && /* @__PURE__ */ jsx31(Check, { className: "h-2.5 w-2.5" })
|
|
6277
6335
|
}
|
|
6278
6336
|
),
|
|
6279
6337
|
o.label
|
|
@@ -6293,8 +6351,8 @@ function NumberFilterBody({
|
|
|
6293
6351
|
}) {
|
|
6294
6352
|
const min = value?.kind === "number" ? value.min : void 0;
|
|
6295
6353
|
const max = value?.kind === "number" ? value.max : void 0;
|
|
6296
|
-
const [minText, setMinText] =
|
|
6297
|
-
const [maxText, setMaxText] =
|
|
6354
|
+
const [minText, setMinText] = useState14(min !== void 0 ? String(min) : "");
|
|
6355
|
+
const [maxText, setMaxText] = useState14(max !== void 0 ? String(max) : "");
|
|
6298
6356
|
const commit = (raw, which) => {
|
|
6299
6357
|
const nextMin = which === "min" ? parseOptionalNumber(raw) : min;
|
|
6300
6358
|
const nextMax = which === "max" ? parseOptionalNumber(raw) : max;
|
|
@@ -6304,10 +6362,10 @@ function NumberFilterBody({
|
|
|
6304
6362
|
}
|
|
6305
6363
|
onChange({ kind: "number", min: nextMin, max: nextMax });
|
|
6306
6364
|
};
|
|
6307
|
-
return /* @__PURE__ */
|
|
6308
|
-
/* @__PURE__ */
|
|
6309
|
-
/* @__PURE__ */
|
|
6310
|
-
(min !== void 0 || max !== void 0) && /* @__PURE__ */
|
|
6365
|
+
return /* @__PURE__ */ jsxs22("div", { className: "space-y-1.5 px-1", children: [
|
|
6366
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between", children: [
|
|
6367
|
+
/* @__PURE__ */ jsx31("p", { className: "text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: "Range" }),
|
|
6368
|
+
(min !== void 0 || max !== void 0) && /* @__PURE__ */ jsx31(
|
|
6311
6369
|
"button",
|
|
6312
6370
|
{
|
|
6313
6371
|
type: "button",
|
|
@@ -6321,8 +6379,8 @@ function NumberFilterBody({
|
|
|
6321
6379
|
}
|
|
6322
6380
|
)
|
|
6323
6381
|
] }),
|
|
6324
|
-
/* @__PURE__ */
|
|
6325
|
-
/* @__PURE__ */
|
|
6382
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex items-center gap-1.5", children: [
|
|
6383
|
+
/* @__PURE__ */ jsx31(
|
|
6326
6384
|
Input,
|
|
6327
6385
|
{
|
|
6328
6386
|
"data-matrx-filter-autofocus": true,
|
|
@@ -6337,8 +6395,8 @@ function NumberFilterBody({
|
|
|
6337
6395
|
style: { fontSize: "16px" }
|
|
6338
6396
|
}
|
|
6339
6397
|
),
|
|
6340
|
-
/* @__PURE__ */
|
|
6341
|
-
/* @__PURE__ */
|
|
6398
|
+
/* @__PURE__ */ jsx31("span", { className: "text-xs text-muted-foreground", children: "\u2013" }),
|
|
6399
|
+
/* @__PURE__ */ jsx31(
|
|
6342
6400
|
Input,
|
|
6343
6401
|
{
|
|
6344
6402
|
value: maxText,
|
|
@@ -6364,9 +6422,9 @@ function parseOptionalNumber(raw) {
|
|
|
6364
6422
|
// src/data-table/ColumnResizeHandle.tsx
|
|
6365
6423
|
import {
|
|
6366
6424
|
useCallback as useCallback5,
|
|
6367
|
-
useEffect as
|
|
6368
|
-
useRef as
|
|
6369
|
-
useState as
|
|
6425
|
+
useEffect as useEffect10,
|
|
6426
|
+
useRef as useRef10,
|
|
6427
|
+
useState as useState15
|
|
6370
6428
|
} from "react";
|
|
6371
6429
|
|
|
6372
6430
|
// src/data-table/column-resize.ts
|
|
@@ -6395,7 +6453,7 @@ function normalizeColumnWidthMap(widths, knownColumnIds) {
|
|
|
6395
6453
|
}
|
|
6396
6454
|
|
|
6397
6455
|
// src/data-table/ColumnResizeHandle.tsx
|
|
6398
|
-
import { jsx as
|
|
6456
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
6399
6457
|
var KEYBOARD_STEP = 8;
|
|
6400
6458
|
var KEYBOARD_LARGE_STEP = 24;
|
|
6401
6459
|
function ColumnResizeHandle({
|
|
@@ -6409,12 +6467,12 @@ function ColumnResizeHandle({
|
|
|
6409
6467
|
onResizeCancel,
|
|
6410
6468
|
onResizeCommit
|
|
6411
6469
|
}) {
|
|
6412
|
-
const handleRef =
|
|
6413
|
-
const activeResizeRef =
|
|
6414
|
-
const previewRafRef =
|
|
6415
|
-
const queuedWidthRef =
|
|
6416
|
-
const keyboardWidthRef =
|
|
6417
|
-
const [announcedWidth, setAnnouncedWidth] =
|
|
6470
|
+
const handleRef = useRef10(null);
|
|
6471
|
+
const activeResizeRef = useRef10(null);
|
|
6472
|
+
const previewRafRef = useRef10(null);
|
|
6473
|
+
const queuedWidthRef = useRef10(null);
|
|
6474
|
+
const keyboardWidthRef = useRef10(null);
|
|
6475
|
+
const [announcedWidth, setAnnouncedWidth] = useState15(null);
|
|
6418
6476
|
const bounds = resolveColumnResizeBounds(minWidth, maxWidth);
|
|
6419
6477
|
const cssVar = columnResizeCssVar(columnId2);
|
|
6420
6478
|
const readWidth = useCallback5(() => {
|
|
@@ -6461,7 +6519,7 @@ function ColumnResizeHandle({
|
|
|
6461
6519
|
handleRef.current.releasePointerCapture(active.pointerId);
|
|
6462
6520
|
}
|
|
6463
6521
|
}, [clearQueuedPreview, columnId2, cssVar, onResizeCancel, onResizeCommit, tableRef, writePreview]);
|
|
6464
|
-
|
|
6522
|
+
useEffect10(() => () => clearQueuedPreview(), [clearQueuedPreview]);
|
|
6465
6523
|
const onPointerDown = (event) => {
|
|
6466
6524
|
if (disabled || event.button !== 0 || !event.isPrimary) return;
|
|
6467
6525
|
event.preventDefault();
|
|
@@ -6514,7 +6572,7 @@ function ColumnResizeHandle({
|
|
|
6514
6572
|
onResizeCommit(columnId2, nextWidth);
|
|
6515
6573
|
};
|
|
6516
6574
|
const currentWidth = announcedWidth ?? keyboardWidthRef.current ?? bounds.minWidth;
|
|
6517
|
-
return /* @__PURE__ */
|
|
6575
|
+
return /* @__PURE__ */ jsx32(
|
|
6518
6576
|
"button",
|
|
6519
6577
|
{
|
|
6520
6578
|
ref: handleRef,
|
|
@@ -6616,9 +6674,9 @@ function rankTableSearchRows(rows, columns, query, options = {}, extraText) {
|
|
|
6616
6674
|
}
|
|
6617
6675
|
|
|
6618
6676
|
// src/data-table/ColumnManager.tsx
|
|
6619
|
-
import { useEffect as
|
|
6677
|
+
import { useEffect as useEffect11, useMemo as useMemo6, useState as useState16 } from "react";
|
|
6620
6678
|
import { useDndMonitor, useDraggable as useDraggable2, useDroppable } from "@dnd-kit/core";
|
|
6621
|
-
import { jsx as
|
|
6679
|
+
import { jsx as jsx33, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
6622
6680
|
function ColumnManager({
|
|
6623
6681
|
open,
|
|
6624
6682
|
onOpenChange,
|
|
@@ -6631,11 +6689,11 @@ function ColumnManager({
|
|
|
6631
6689
|
() => new Map(columns.map((column) => [columnId(column), column])),
|
|
6632
6690
|
[columns]
|
|
6633
6691
|
);
|
|
6634
|
-
const [draftOrder, setDraftOrder] =
|
|
6635
|
-
const [draftHidden, setDraftHidden] =
|
|
6636
|
-
const [draggedColumnId, setDraggedColumnId] =
|
|
6637
|
-
const [dropTarget, setDropTarget] =
|
|
6638
|
-
|
|
6692
|
+
const [draftOrder, setDraftOrder] = useState16(order);
|
|
6693
|
+
const [draftHidden, setDraftHidden] = useState16(() => new Set(hidden));
|
|
6694
|
+
const [draggedColumnId, setDraggedColumnId] = useState16(null);
|
|
6695
|
+
const [dropTarget, setDropTarget] = useState16(null);
|
|
6696
|
+
useEffect11(() => {
|
|
6639
6697
|
if (!open) return;
|
|
6640
6698
|
setDraftOrder(order);
|
|
6641
6699
|
setDraftHidden(new Set(hidden));
|
|
@@ -6692,18 +6750,18 @@ function ColumnManager({
|
|
|
6692
6750
|
if (target) moveTo(dragged, String(target));
|
|
6693
6751
|
}
|
|
6694
6752
|
});
|
|
6695
|
-
return /* @__PURE__ */
|
|
6696
|
-
/* @__PURE__ */
|
|
6697
|
-
/* @__PURE__ */
|
|
6698
|
-
/* @__PURE__ */
|
|
6753
|
+
return /* @__PURE__ */ jsx33(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs23(DialogContent, { className: "max-w-md", children: [
|
|
6754
|
+
/* @__PURE__ */ jsxs23(DialogHeader, { children: [
|
|
6755
|
+
/* @__PURE__ */ jsx33(DialogTitle, { children: "Columns" }),
|
|
6756
|
+
/* @__PURE__ */ jsx33(DialogDescription, { children: "Choose the columns to show and set their order." })
|
|
6699
6757
|
] }),
|
|
6700
|
-
/* @__PURE__ */
|
|
6758
|
+
/* @__PURE__ */ jsx33("div", { className: "max-h-[55dvh] divide-y overflow-y-auto rounded-md border", children: draftOrder.map((id, index) => {
|
|
6701
6759
|
const column = byId.get(id);
|
|
6702
6760
|
if (!column) return null;
|
|
6703
6761
|
const label = typeof column.header === "string" ? column.header : id;
|
|
6704
6762
|
const hideable = column.hideable !== false;
|
|
6705
6763
|
const visible = !draftHidden.has(id);
|
|
6706
|
-
return /* @__PURE__ */
|
|
6764
|
+
return /* @__PURE__ */ jsxs23(
|
|
6707
6765
|
ColumnManagerDropTarget,
|
|
6708
6766
|
{
|
|
6709
6767
|
id,
|
|
@@ -6713,8 +6771,8 @@ function ColumnManager({
|
|
|
6713
6771
|
dropTarget === id && draggedColumnId !== id && "border-t-2 border-primary"
|
|
6714
6772
|
),
|
|
6715
6773
|
children: [
|
|
6716
|
-
/* @__PURE__ */
|
|
6717
|
-
/* @__PURE__ */
|
|
6774
|
+
/* @__PURE__ */ jsx33(ColumnManagerDragHandle, { id, label }),
|
|
6775
|
+
/* @__PURE__ */ jsx33(
|
|
6718
6776
|
Checkbox,
|
|
6719
6777
|
{
|
|
6720
6778
|
checked: visible,
|
|
@@ -6731,8 +6789,8 @@ function ColumnManager({
|
|
|
6731
6789
|
}
|
|
6732
6790
|
}
|
|
6733
6791
|
),
|
|
6734
|
-
/* @__PURE__ */
|
|
6735
|
-
/* @__PURE__ */
|
|
6792
|
+
/* @__PURE__ */ jsx33("span", { className: "min-w-0 flex-1 truncate text-sm", children: label }),
|
|
6793
|
+
/* @__PURE__ */ jsx33(
|
|
6736
6794
|
Button,
|
|
6737
6795
|
{
|
|
6738
6796
|
type: "button",
|
|
@@ -6742,10 +6800,10 @@ function ColumnManager({
|
|
|
6742
6800
|
"aria-label": `Move ${label} earlier`,
|
|
6743
6801
|
disabled: index === 0,
|
|
6744
6802
|
onClick: () => move(id, -1),
|
|
6745
|
-
children: /* @__PURE__ */
|
|
6803
|
+
children: /* @__PURE__ */ jsx33(ArrowUp, { className: "h-4 w-4" })
|
|
6746
6804
|
}
|
|
6747
6805
|
),
|
|
6748
|
-
/* @__PURE__ */
|
|
6806
|
+
/* @__PURE__ */ jsx33(
|
|
6749
6807
|
Button,
|
|
6750
6808
|
{
|
|
6751
6809
|
type: "button",
|
|
@@ -6755,7 +6813,7 @@ function ColumnManager({
|
|
|
6755
6813
|
"aria-label": `Move ${label} later`,
|
|
6756
6814
|
disabled: index === draftOrder.length - 1,
|
|
6757
6815
|
onClick: () => move(id, 1),
|
|
6758
|
-
children: /* @__PURE__ */
|
|
6816
|
+
children: /* @__PURE__ */ jsx33(ArrowDown, { className: "h-4 w-4" })
|
|
6759
6817
|
}
|
|
6760
6818
|
)
|
|
6761
6819
|
]
|
|
@@ -6763,9 +6821,9 @@ function ColumnManager({
|
|
|
6763
6821
|
id
|
|
6764
6822
|
);
|
|
6765
6823
|
}) }),
|
|
6766
|
-
/* @__PURE__ */
|
|
6767
|
-
/* @__PURE__ */
|
|
6768
|
-
/* @__PURE__ */
|
|
6824
|
+
/* @__PURE__ */ jsxs23(DialogFooter, { children: [
|
|
6825
|
+
/* @__PURE__ */ jsx33(Button, { type: "button", variant: "outline", onClick: () => onOpenChange(false), children: "Cancel" }),
|
|
6826
|
+
/* @__PURE__ */ jsx33(
|
|
6769
6827
|
Button,
|
|
6770
6828
|
{
|
|
6771
6829
|
type: "button",
|
|
@@ -6788,14 +6846,14 @@ function ColumnManagerDropTarget({
|
|
|
6788
6846
|
id: `matrx-column-manager:${id}`,
|
|
6789
6847
|
data: { matrxDragKind: "column-manager", columnId: id }
|
|
6790
6848
|
});
|
|
6791
|
-
return /* @__PURE__ */
|
|
6849
|
+
return /* @__PURE__ */ jsx33("div", { ref: setNodeRef, "data-matrx-column-manager-drop-target": id, className, children });
|
|
6792
6850
|
}
|
|
6793
6851
|
function ColumnManagerDragHandle({ id, label }) {
|
|
6794
6852
|
const { attributes, listeners, setNodeRef } = useDraggable2({
|
|
6795
6853
|
id: `matrx-column-manager:${id}`,
|
|
6796
6854
|
data: { matrxDragKind: "column-manager", columnId: id }
|
|
6797
6855
|
});
|
|
6798
|
-
return /* @__PURE__ */
|
|
6856
|
+
return /* @__PURE__ */ jsx33(
|
|
6799
6857
|
"button",
|
|
6800
6858
|
{
|
|
6801
6859
|
ref: setNodeRef,
|
|
@@ -6805,7 +6863,7 @@ function ColumnManagerDragHandle({ id, label }) {
|
|
|
6805
6863
|
title: `Drag to reorder ${label}`,
|
|
6806
6864
|
...attributes,
|
|
6807
6865
|
...listeners,
|
|
6808
|
-
children: /* @__PURE__ */
|
|
6866
|
+
children: /* @__PURE__ */ jsx33(GripVertical, { className: "h-4 w-4" })
|
|
6809
6867
|
}
|
|
6810
6868
|
);
|
|
6811
6869
|
}
|
|
@@ -6869,11 +6927,11 @@ function parseTableViewSnapshot(raw) {
|
|
|
6869
6927
|
|
|
6870
6928
|
// src/data-table/MatrxUuidCell.tsx
|
|
6871
6929
|
import {
|
|
6872
|
-
useEffect as
|
|
6873
|
-
useRef as
|
|
6874
|
-
useState as
|
|
6930
|
+
useEffect as useEffect12,
|
|
6931
|
+
useRef as useRef11,
|
|
6932
|
+
useState as useState17
|
|
6875
6933
|
} from "react";
|
|
6876
|
-
import { jsx as
|
|
6934
|
+
import { jsx as jsx34, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
6877
6935
|
var SHORT_LEN = 8;
|
|
6878
6936
|
function shortUuid(id, len = SHORT_LEN) {
|
|
6879
6937
|
return id.slice(0, len);
|
|
@@ -6912,18 +6970,18 @@ function MatrxUuidCell({
|
|
|
6912
6970
|
}) {
|
|
6913
6971
|
const { resolveEntityDoors, ResourcePeek } = useMatrxDataTableHost();
|
|
6914
6972
|
const { notify, notice } = useTableNotice();
|
|
6915
|
-
const [copied, setCopied] =
|
|
6916
|
-
const [opening, setOpening] =
|
|
6917
|
-
const [peekOpen, setPeekOpen] =
|
|
6918
|
-
const timer =
|
|
6919
|
-
|
|
6973
|
+
const [copied, setCopied] = useState17(false);
|
|
6974
|
+
const [opening, setOpening] = useState17(false);
|
|
6975
|
+
const [peekOpen, setPeekOpen] = useState17(false);
|
|
6976
|
+
const timer = useRef11(null);
|
|
6977
|
+
useEffect12(
|
|
6920
6978
|
() => () => {
|
|
6921
6979
|
if (timer.current) clearTimeout(timer.current);
|
|
6922
6980
|
},
|
|
6923
6981
|
[]
|
|
6924
6982
|
);
|
|
6925
6983
|
if (!value) {
|
|
6926
|
-
return /* @__PURE__ */
|
|
6984
|
+
return /* @__PURE__ */ jsx34("span", { className: "text-muted-foreground/40", children: "\u2014" });
|
|
6927
6985
|
}
|
|
6928
6986
|
const doors = token ? resolveEntityDoors?.(token, value, href) ?? null : null;
|
|
6929
6987
|
const resolvedHref = doors?.href ?? href ?? null;
|
|
@@ -6966,13 +7024,13 @@ function MatrxUuidCell({
|
|
|
6966
7024
|
};
|
|
6967
7025
|
const idNode = (() => {
|
|
6968
7026
|
if (forbidden) {
|
|
6969
|
-
return /* @__PURE__ */
|
|
6970
|
-
/* @__PURE__ */
|
|
6971
|
-
/* @__PURE__ */
|
|
7027
|
+
return /* @__PURE__ */ jsxs24("span", { className: "inline-flex min-w-0 items-center gap-1 font-mono text-xs text-muted-foreground/70 tabular-nums", children: [
|
|
7028
|
+
/* @__PURE__ */ jsx34("span", { className: "min-w-0 truncate", children: display }),
|
|
7029
|
+
/* @__PURE__ */ jsx34(ShieldOff, { className: "h-3 w-3 shrink-0 opacity-60", "aria-hidden": true })
|
|
6972
7030
|
] });
|
|
6973
7031
|
}
|
|
6974
7032
|
if (onOpen) {
|
|
6975
|
-
return /* @__PURE__ */
|
|
7033
|
+
return /* @__PURE__ */ jsxs24(
|
|
6976
7034
|
"button",
|
|
6977
7035
|
{
|
|
6978
7036
|
type: "button",
|
|
@@ -6981,14 +7039,14 @@ function MatrxUuidCell({
|
|
|
6981
7039
|
disabled: opening,
|
|
6982
7040
|
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",
|
|
6983
7041
|
children: [
|
|
6984
|
-
/* @__PURE__ */
|
|
6985
|
-
/* @__PURE__ */
|
|
7042
|
+
/* @__PURE__ */ jsx34("span", { className: "min-w-0 truncate tabular-nums", children: display }),
|
|
7043
|
+
/* @__PURE__ */ jsx34(PanelRight, { className: "h-3 w-3 shrink-0 opacity-50" })
|
|
6986
7044
|
]
|
|
6987
7045
|
}
|
|
6988
7046
|
);
|
|
6989
7047
|
}
|
|
6990
7048
|
if (resolvedHref) {
|
|
6991
|
-
return /* @__PURE__ */
|
|
7049
|
+
return /* @__PURE__ */ jsxs24(
|
|
6992
7050
|
"a",
|
|
6993
7051
|
{
|
|
6994
7052
|
href: resolvedHref,
|
|
@@ -6998,15 +7056,15 @@ function MatrxUuidCell({
|
|
|
6998
7056
|
onClick: stop,
|
|
6999
7057
|
className: "inline-flex min-w-0 items-center gap-1 font-mono text-xs text-sky-600 hover:underline dark:text-sky-400",
|
|
7000
7058
|
children: [
|
|
7001
|
-
/* @__PURE__ */
|
|
7002
|
-
/* @__PURE__ */
|
|
7059
|
+
/* @__PURE__ */ jsx34("span", { className: "min-w-0 truncate tabular-nums", children: display }),
|
|
7060
|
+
/* @__PURE__ */ jsx34(ExternalLink, { className: "h-3 w-3 shrink-0 opacity-50" })
|
|
7003
7061
|
]
|
|
7004
7062
|
}
|
|
7005
7063
|
);
|
|
7006
7064
|
}
|
|
7007
|
-
return /* @__PURE__ */
|
|
7065
|
+
return /* @__PURE__ */ jsx34("span", { className: "min-w-0 truncate font-mono text-xs text-muted-foreground tabular-nums select-all", children: display });
|
|
7008
7066
|
})();
|
|
7009
|
-
return /* @__PURE__ */
|
|
7067
|
+
return /* @__PURE__ */ jsx34(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ jsxs24(
|
|
7010
7068
|
"span",
|
|
7011
7069
|
{
|
|
7012
7070
|
"data-matrx-cell-control": true,
|
|
@@ -7016,12 +7074,12 @@ function MatrxUuidCell({
|
|
|
7016
7074
|
),
|
|
7017
7075
|
onClick: stop,
|
|
7018
7076
|
children: [
|
|
7019
|
-
/* @__PURE__ */
|
|
7020
|
-
/* @__PURE__ */
|
|
7021
|
-
/* @__PURE__ */
|
|
7077
|
+
/* @__PURE__ */ jsxs24(Tooltip, { children: [
|
|
7078
|
+
/* @__PURE__ */ jsx34(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx34("span", { className: "inline-flex min-w-0 max-w-full items-center", children: idNode }) }),
|
|
7079
|
+
/* @__PURE__ */ jsx34(TooltipContent, { side: "top", className: "max-w-sm break-all font-mono", children: forbidden ? `No access \xB7 ${tip}` : tip })
|
|
7022
7080
|
] }),
|
|
7023
|
-
/* @__PURE__ */
|
|
7024
|
-
/* @__PURE__ */
|
|
7081
|
+
/* @__PURE__ */ jsxs24(Tooltip, { children: [
|
|
7082
|
+
/* @__PURE__ */ jsx34(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx34(
|
|
7025
7083
|
"button",
|
|
7026
7084
|
{
|
|
7027
7085
|
type: "button",
|
|
@@ -7031,13 +7089,13 @@ function MatrxUuidCell({
|
|
|
7031
7089
|
"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground focus:outline-none",
|
|
7032
7090
|
copied && "text-primary"
|
|
7033
7091
|
),
|
|
7034
|
-
children: copied ? /* @__PURE__ */
|
|
7092
|
+
children: copied ? /* @__PURE__ */ jsx34(Check, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx34(Copy, { className: "h-3 w-3" })
|
|
7035
7093
|
}
|
|
7036
7094
|
) }),
|
|
7037
|
-
/* @__PURE__ */
|
|
7095
|
+
/* @__PURE__ */ jsx34(TooltipContent, { side: "top", children: copied ? "Copied" : `Copy ${label ?? "id"}: ${value}` })
|
|
7038
7096
|
] }),
|
|
7039
|
-
canPeek ? /* @__PURE__ */
|
|
7040
|
-
/* @__PURE__ */
|
|
7097
|
+
canPeek ? /* @__PURE__ */ jsxs24(Tooltip, { children: [
|
|
7098
|
+
/* @__PURE__ */ jsx34(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx34(
|
|
7041
7099
|
"button",
|
|
7042
7100
|
{
|
|
7043
7101
|
type: "button",
|
|
@@ -7047,16 +7105,16 @@ function MatrxUuidCell({
|
|
|
7047
7105
|
},
|
|
7048
7106
|
"aria-label": `Quick look at ${label ?? "record"}`,
|
|
7049
7107
|
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",
|
|
7050
|
-
children: /* @__PURE__ */
|
|
7108
|
+
children: /* @__PURE__ */ jsx34(Lightbulb, { className: "h-3 w-3" })
|
|
7051
7109
|
}
|
|
7052
7110
|
) }),
|
|
7053
|
-
/* @__PURE__ */
|
|
7111
|
+
/* @__PURE__ */ jsxs24(TooltipContent, { side: "top", children: [
|
|
7054
7112
|
"Quick look at ",
|
|
7055
7113
|
label ?? "record"
|
|
7056
7114
|
] })
|
|
7057
7115
|
] }) : null,
|
|
7058
|
-
onOpen && resolvedHref && !forbidden ? /* @__PURE__ */
|
|
7059
|
-
/* @__PURE__ */
|
|
7116
|
+
onOpen && resolvedHref && !forbidden ? /* @__PURE__ */ jsxs24(Tooltip, { children: [
|
|
7117
|
+
/* @__PURE__ */ jsx34(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx34(
|
|
7060
7118
|
"a",
|
|
7061
7119
|
{
|
|
7062
7120
|
href: resolvedHref,
|
|
@@ -7065,10 +7123,10 @@ function MatrxUuidCell({
|
|
|
7065
7123
|
onClick: stop,
|
|
7066
7124
|
"aria-label": `Open ${label ?? "record"} in a new tab`,
|
|
7067
7125
|
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",
|
|
7068
|
-
children: /* @__PURE__ */
|
|
7126
|
+
children: /* @__PURE__ */ jsx34(ExternalLink, { className: "h-3 w-3" })
|
|
7069
7127
|
}
|
|
7070
7128
|
) }),
|
|
7071
|
-
/* @__PURE__ */
|
|
7129
|
+
/* @__PURE__ */ jsxs24(TooltipContent, { side: "top", children: [
|
|
7072
7130
|
"Open ",
|
|
7073
7131
|
label ?? "record",
|
|
7074
7132
|
" in a new tab"
|
|
@@ -7076,7 +7134,7 @@ function MatrxUuidCell({
|
|
|
7076
7134
|
] }) : null,
|
|
7077
7135
|
trailing,
|
|
7078
7136
|
notice,
|
|
7079
|
-
canPeek && peekOpen && ResourcePeek ? /* @__PURE__ */
|
|
7137
|
+
canPeek && peekOpen && ResourcePeek ? /* @__PURE__ */ jsx34(
|
|
7080
7138
|
ResourcePeek,
|
|
7081
7139
|
{
|
|
7082
7140
|
kind: doors?.peekKind ?? token ?? "record",
|
|
@@ -7110,7 +7168,7 @@ function formatTableDisplayValue(value) {
|
|
|
7110
7168
|
}
|
|
7111
7169
|
|
|
7112
7170
|
// src/data-table/DataRowInspector.tsx
|
|
7113
|
-
import { jsx as
|
|
7171
|
+
import { jsx as jsx35, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
7114
7172
|
var noFieldToken = () => null;
|
|
7115
7173
|
function formatValue(value) {
|
|
7116
7174
|
if (value == null) return "\u2014";
|
|
@@ -7139,7 +7197,7 @@ function DataRowInspector({
|
|
|
7139
7197
|
tokenForField = noFieldToken
|
|
7140
7198
|
}) {
|
|
7141
7199
|
const entries = isPlainObject(row) ? Object.entries(row) : [["value", row]];
|
|
7142
|
-
const fieldButtons = (key, value) => fieldCopy ? /* @__PURE__ */
|
|
7200
|
+
const fieldButtons = (key, value) => fieldCopy ? /* @__PURE__ */ jsx35("div", { className: "absolute right-1 top-1 opacity-0 transition-opacity focus-within:opacity-100 group-hover/field:opacity-100", children: /* @__PURE__ */ jsx35(
|
|
7143
7201
|
CopyButtons,
|
|
7144
7202
|
{
|
|
7145
7203
|
size: "xs",
|
|
@@ -7154,21 +7212,21 @@ function DataRowInspector({
|
|
|
7154
7212
|
})
|
|
7155
7213
|
}
|
|
7156
7214
|
) }) : null;
|
|
7157
|
-
return /* @__PURE__ */
|
|
7215
|
+
return /* @__PURE__ */ jsxs25(
|
|
7158
7216
|
"div",
|
|
7159
7217
|
{
|
|
7160
7218
|
className: cn("flex h-full min-h-0 flex-col overflow-hidden", className),
|
|
7161
7219
|
children: [
|
|
7162
|
-
title ? /* @__PURE__ */
|
|
7163
|
-
/* @__PURE__ */
|
|
7220
|
+
title ? /* @__PURE__ */ jsx35("div", { className: "shrink-0 border-b border-border px-3 py-2 text-sm font-medium", children: title }) : null,
|
|
7221
|
+
/* @__PURE__ */ jsx35("div", { className: "min-h-0 flex-1 overflow-auto p-3", children: /* @__PURE__ */ jsx35("dl", { className: "space-y-2", children: entries.map(([key, value]) => {
|
|
7164
7222
|
if (isUuidValue(value)) {
|
|
7165
|
-
return /* @__PURE__ */
|
|
7223
|
+
return /* @__PURE__ */ jsxs25(
|
|
7166
7224
|
"div",
|
|
7167
7225
|
{
|
|
7168
7226
|
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",
|
|
7169
7227
|
children: [
|
|
7170
|
-
/* @__PURE__ */
|
|
7171
|
-
/* @__PURE__ */
|
|
7228
|
+
/* @__PURE__ */ jsx35("dt", { className: "truncate text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: key }),
|
|
7229
|
+
/* @__PURE__ */ jsx35("dd", { className: "min-w-0", children: /* @__PURE__ */ jsx35(
|
|
7172
7230
|
MatrxUuidCell,
|
|
7173
7231
|
{
|
|
7174
7232
|
value,
|
|
@@ -7183,13 +7241,13 @@ function DataRowInspector({
|
|
|
7183
7241
|
}
|
|
7184
7242
|
const formatted = value !== null && typeof value === "object" && !(value instanceof Date) ? formatValue(value) : formatTableDisplayValue(value);
|
|
7185
7243
|
const multiline = formatted.includes("\n") || formatted.length > 80;
|
|
7186
|
-
return /* @__PURE__ */
|
|
7244
|
+
return /* @__PURE__ */ jsxs25(
|
|
7187
7245
|
"div",
|
|
7188
7246
|
{
|
|
7189
7247
|
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",
|
|
7190
7248
|
children: [
|
|
7191
|
-
/* @__PURE__ */
|
|
7192
|
-
/* @__PURE__ */
|
|
7249
|
+
/* @__PURE__ */ jsx35("dt", { className: "truncate text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: key }),
|
|
7250
|
+
/* @__PURE__ */ jsx35(
|
|
7193
7251
|
"dd",
|
|
7194
7252
|
{
|
|
7195
7253
|
className: cn(
|
|
@@ -7211,8 +7269,8 @@ function DataRowInspector({
|
|
|
7211
7269
|
}
|
|
7212
7270
|
|
|
7213
7271
|
// src/data-table/DataRowWindow.tsx
|
|
7214
|
-
import { useEffect as
|
|
7215
|
-
import { jsx as
|
|
7272
|
+
import { useEffect as useEffect13, useState as useState18 } from "react";
|
|
7273
|
+
import { jsx as jsx36, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
7216
7274
|
function DataRowWindow({
|
|
7217
7275
|
isOpen,
|
|
7218
7276
|
onClose,
|
|
@@ -7232,15 +7290,15 @@ function DataRowWindow({
|
|
|
7232
7290
|
const hasEdit = editContent != null;
|
|
7233
7291
|
const hasTabs = hasEdit && children == null;
|
|
7234
7292
|
const initialTab = defaultTab ?? (hasEdit ? "edit" : "view");
|
|
7235
|
-
const [tab, setTab] =
|
|
7236
|
-
|
|
7293
|
+
const [tab, setTab] = useState18(initialTab);
|
|
7294
|
+
useEffect13(() => {
|
|
7237
7295
|
if (!isOpen) return;
|
|
7238
7296
|
setTab(defaultTab ?? (hasEdit ? "edit" : "view"));
|
|
7239
7297
|
}, [isOpen, windowId, hasEdit, defaultTab]);
|
|
7240
7298
|
if (!isOpen) return null;
|
|
7241
|
-
const viewBody = viewContent ?? /* @__PURE__ */
|
|
7242
|
-
const body = children ?? /* @__PURE__ */
|
|
7243
|
-
return /* @__PURE__ */
|
|
7299
|
+
const viewBody = viewContent ?? /* @__PURE__ */ jsx36(DataRowInspector, { row });
|
|
7300
|
+
const body = children ?? /* @__PURE__ */ jsx36("div", { className: "flex h-full min-h-0 flex-1 flex-col overflow-hidden", children: hasTabs ? tab === "edit" ? /* @__PURE__ */ jsx36("div", { className: "min-h-0 flex-1 overflow-y-auto", children: editContent }) : /* @__PURE__ */ jsx36("div", { className: "min-h-0 flex-1 overflow-y-auto", children: viewBody }) : /* @__PURE__ */ jsx36("div", { className: "min-h-0 flex-1 overflow-y-auto", children: viewBody }) });
|
|
7301
|
+
return /* @__PURE__ */ jsx36(
|
|
7244
7302
|
WindowPanel,
|
|
7245
7303
|
{
|
|
7246
7304
|
id: windowId,
|
|
@@ -7254,26 +7312,26 @@ function DataRowWindow({
|
|
|
7254
7312
|
bodyClassName: "flex min-h-0 flex-1 flex-col overflow-hidden p-0",
|
|
7255
7313
|
sidebarDefaultSize: 140,
|
|
7256
7314
|
sidebarMinSize: 110,
|
|
7257
|
-
sidebar: hasTabs ? /* @__PURE__ */
|
|
7315
|
+
sidebar: hasTabs ? /* @__PURE__ */ jsxs26(
|
|
7258
7316
|
"nav",
|
|
7259
7317
|
{
|
|
7260
7318
|
"aria-label": "Row window tabs",
|
|
7261
7319
|
className: "flex h-full flex-col gap-0.5 overflow-y-auto p-1.5",
|
|
7262
7320
|
children: [
|
|
7263
|
-
/* @__PURE__ */
|
|
7321
|
+
/* @__PURE__ */ jsx36(
|
|
7264
7322
|
TabButton,
|
|
7265
7323
|
{
|
|
7266
7324
|
active: tab === "view",
|
|
7267
|
-
icon: /* @__PURE__ */
|
|
7325
|
+
icon: /* @__PURE__ */ jsx36(Eye, { className: "h-4 w-4 shrink-0" }),
|
|
7268
7326
|
label: "View",
|
|
7269
7327
|
onClick: () => setTab("view")
|
|
7270
7328
|
}
|
|
7271
7329
|
),
|
|
7272
|
-
/* @__PURE__ */
|
|
7330
|
+
/* @__PURE__ */ jsx36(
|
|
7273
7331
|
TabButton,
|
|
7274
7332
|
{
|
|
7275
7333
|
active: tab === "edit",
|
|
7276
|
-
icon: /* @__PURE__ */
|
|
7334
|
+
icon: /* @__PURE__ */ jsx36(Pencil, { className: "h-4 w-4 shrink-0" }),
|
|
7277
7335
|
label: "Edit",
|
|
7278
7336
|
onClick: () => setTab("edit")
|
|
7279
7337
|
}
|
|
@@ -7291,7 +7349,7 @@ function TabButton({
|
|
|
7291
7349
|
label,
|
|
7292
7350
|
onClick
|
|
7293
7351
|
}) {
|
|
7294
|
-
return /* @__PURE__ */
|
|
7352
|
+
return /* @__PURE__ */ jsxs26(
|
|
7295
7353
|
"button",
|
|
7296
7354
|
{
|
|
7297
7355
|
type: "button",
|
|
@@ -7304,7 +7362,7 @@ function TabButton({
|
|
|
7304
7362
|
),
|
|
7305
7363
|
children: [
|
|
7306
7364
|
icon,
|
|
7307
|
-
/* @__PURE__ */
|
|
7365
|
+
/* @__PURE__ */ jsx36("span", { className: "min-w-0 flex-1 truncate", children: label })
|
|
7308
7366
|
]
|
|
7309
7367
|
}
|
|
7310
7368
|
);
|
|
@@ -7327,7 +7385,7 @@ function defaultRowTitle(row, columns) {
|
|
|
7327
7385
|
}
|
|
7328
7386
|
|
|
7329
7387
|
// src/data-table/DirtySavePill.tsx
|
|
7330
|
-
import { jsx as
|
|
7388
|
+
import { jsx as jsx37, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
7331
7389
|
function DirtySavePill({
|
|
7332
7390
|
changeCount,
|
|
7333
7391
|
saving,
|
|
@@ -7336,20 +7394,20 @@ function DirtySavePill({
|
|
|
7336
7394
|
className
|
|
7337
7395
|
}) {
|
|
7338
7396
|
if (changeCount <= 0) return null;
|
|
7339
|
-
return /* @__PURE__ */
|
|
7397
|
+
return /* @__PURE__ */ jsx37(
|
|
7340
7398
|
"div",
|
|
7341
7399
|
{
|
|
7342
7400
|
className: cn(
|
|
7343
7401
|
"pointer-events-none fixed inset-x-0 bottom-6 z-50 flex justify-center pb-safe",
|
|
7344
7402
|
className
|
|
7345
7403
|
),
|
|
7346
|
-
children: /* @__PURE__ */
|
|
7347
|
-
/* @__PURE__ */
|
|
7404
|
+
children: /* @__PURE__ */ jsxs27("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: [
|
|
7405
|
+
/* @__PURE__ */ jsxs27("span", { className: "px-1 text-xs font-medium text-muted-foreground", children: [
|
|
7348
7406
|
changeCount,
|
|
7349
7407
|
" unsaved change",
|
|
7350
7408
|
changeCount === 1 ? "" : "s"
|
|
7351
7409
|
] }),
|
|
7352
|
-
/* @__PURE__ */
|
|
7410
|
+
/* @__PURE__ */ jsxs27(
|
|
7353
7411
|
Button,
|
|
7354
7412
|
{
|
|
7355
7413
|
type: "button",
|
|
@@ -7359,12 +7417,12 @@ function DirtySavePill({
|
|
|
7359
7417
|
disabled: saving,
|
|
7360
7418
|
onClick: onCancel,
|
|
7361
7419
|
children: [
|
|
7362
|
-
/* @__PURE__ */
|
|
7420
|
+
/* @__PURE__ */ jsx37(X, { className: "h-3.5 w-3.5" }),
|
|
7363
7421
|
"Cancel"
|
|
7364
7422
|
]
|
|
7365
7423
|
}
|
|
7366
7424
|
),
|
|
7367
|
-
/* @__PURE__ */
|
|
7425
|
+
/* @__PURE__ */ jsxs27(
|
|
7368
7426
|
Button,
|
|
7369
7427
|
{
|
|
7370
7428
|
type: "button",
|
|
@@ -7373,7 +7431,7 @@ function DirtySavePill({
|
|
|
7373
7431
|
disabled: saving,
|
|
7374
7432
|
onClick: onSave,
|
|
7375
7433
|
children: [
|
|
7376
|
-
saving ? /* @__PURE__ */
|
|
7434
|
+
saving ? /* @__PURE__ */ jsx37(Loader2, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ jsx37(Save, { className: "h-3.5 w-3.5" }),
|
|
7377
7435
|
"Save"
|
|
7378
7436
|
]
|
|
7379
7437
|
}
|
|
@@ -7384,8 +7442,8 @@ function DirtySavePill({
|
|
|
7384
7442
|
}
|
|
7385
7443
|
|
|
7386
7444
|
// src/data-table/EditableTableCell.tsx
|
|
7387
|
-
import { useState as
|
|
7388
|
-
import { jsx as
|
|
7445
|
+
import { useState as useState19 } from "react";
|
|
7446
|
+
import { jsx as jsx38, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
7389
7447
|
function CellEditShell({
|
|
7390
7448
|
href,
|
|
7391
7449
|
display,
|
|
@@ -7394,8 +7452,8 @@ function CellEditShell({
|
|
|
7394
7452
|
editButton
|
|
7395
7453
|
}) {
|
|
7396
7454
|
const { Link: HostLink } = useMatrxDataTableHost();
|
|
7397
|
-
const Link = HostLink ?? ((props) => /* @__PURE__ */
|
|
7398
|
-
return /* @__PURE__ */
|
|
7455
|
+
const Link = HostLink ?? ((props) => /* @__PURE__ */ jsx38("a", { ...props }));
|
|
7456
|
+
return /* @__PURE__ */ jsxs28(
|
|
7399
7457
|
"span",
|
|
7400
7458
|
{
|
|
7401
7459
|
className: cn(
|
|
@@ -7407,7 +7465,7 @@ function CellEditShell({
|
|
|
7407
7465
|
className
|
|
7408
7466
|
),
|
|
7409
7467
|
children: [
|
|
7410
|
-
href ? /* @__PURE__ */
|
|
7468
|
+
href ? /* @__PURE__ */ jsx38(
|
|
7411
7469
|
Link,
|
|
7412
7470
|
{
|
|
7413
7471
|
href,
|
|
@@ -7415,7 +7473,7 @@ function CellEditShell({
|
|
|
7415
7473
|
className: "min-w-0 flex-1 overflow-hidden truncate rounded outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
7416
7474
|
children: display
|
|
7417
7475
|
}
|
|
7418
|
-
) : /* @__PURE__ */
|
|
7476
|
+
) : /* @__PURE__ */ jsx38("span", { className: "block min-w-0 flex-1 overflow-hidden", children: display }),
|
|
7419
7477
|
editButton
|
|
7420
7478
|
]
|
|
7421
7479
|
}
|
|
@@ -7433,10 +7491,10 @@ function EditableTableCell({
|
|
|
7433
7491
|
href,
|
|
7434
7492
|
editTrigger = "click"
|
|
7435
7493
|
}) {
|
|
7436
|
-
const [open, setOpen] =
|
|
7494
|
+
const [open, setOpen] = useState19(false);
|
|
7437
7495
|
const usePencil = Boolean(href) || editTrigger === "pencil";
|
|
7438
7496
|
if (editType === "string") {
|
|
7439
|
-
return /* @__PURE__ */
|
|
7497
|
+
return /* @__PURE__ */ jsx38(
|
|
7440
7498
|
InlineStringEditor,
|
|
7441
7499
|
{
|
|
7442
7500
|
value: stringifyCellValue(value),
|
|
@@ -7449,30 +7507,30 @@ function EditableTableCell({
|
|
|
7449
7507
|
}
|
|
7450
7508
|
);
|
|
7451
7509
|
}
|
|
7452
|
-
return /* @__PURE__ */
|
|
7453
|
-
usePencil ? /* @__PURE__ */
|
|
7510
|
+
return /* @__PURE__ */ jsxs28(Popover, { open, onOpenChange: setOpen, children: [
|
|
7511
|
+
usePencil ? /* @__PURE__ */ jsx38(
|
|
7454
7512
|
CellEditShell,
|
|
7455
7513
|
{
|
|
7456
7514
|
...href === void 0 ? {} : { href },
|
|
7457
7515
|
display,
|
|
7458
7516
|
...dirty === void 0 ? {} : { dirty },
|
|
7459
7517
|
...className === void 0 ? {} : { className },
|
|
7460
|
-
editButton: /* @__PURE__ */
|
|
7461
|
-
/* @__PURE__ */
|
|
7518
|
+
editButton: /* @__PURE__ */ jsxs28(Tooltip, { children: [
|
|
7519
|
+
/* @__PURE__ */ jsx38(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx38(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx38(
|
|
7462
7520
|
"button",
|
|
7463
7521
|
{
|
|
7464
7522
|
type: "button",
|
|
7465
7523
|
"aria-label": "Edit",
|
|
7466
7524
|
onClick: (e) => e.stopPropagation(),
|
|
7467
7525
|
className: CELL_PENCIL_CLASS,
|
|
7468
|
-
children: /* @__PURE__ */
|
|
7526
|
+
children: /* @__PURE__ */ jsx38(Pencil, { className: "h-3 w-3" })
|
|
7469
7527
|
}
|
|
7470
7528
|
) }) }),
|
|
7471
|
-
/* @__PURE__ */
|
|
7529
|
+
/* @__PURE__ */ jsx38(TooltipContent, { children: "Edit" })
|
|
7472
7530
|
] })
|
|
7473
7531
|
}
|
|
7474
|
-
) : /* @__PURE__ */
|
|
7475
|
-
/* @__PURE__ */
|
|
7532
|
+
) : /* @__PURE__ */ jsxs28(Tooltip, { children: [
|
|
7533
|
+
/* @__PURE__ */ jsx38(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx38(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs28(
|
|
7476
7534
|
"button",
|
|
7477
7535
|
{
|
|
7478
7536
|
type: "button",
|
|
@@ -7483,20 +7541,20 @@ function EditableTableCell({
|
|
|
7483
7541
|
className
|
|
7484
7542
|
),
|
|
7485
7543
|
children: [
|
|
7486
|
-
/* @__PURE__ */
|
|
7487
|
-
editType === "select" ? /* @__PURE__ */
|
|
7544
|
+
/* @__PURE__ */ jsx38("span", { className: "min-w-0 flex-1 overflow-hidden", children: display }),
|
|
7545
|
+
editType === "select" ? /* @__PURE__ */ jsx38(ChevronDown, { className: "h-3 w-3 shrink-0 text-muted-foreground/70 transition-colors group-hover/cell-select:text-foreground" }) : null
|
|
7488
7546
|
]
|
|
7489
7547
|
}
|
|
7490
7548
|
) }) }),
|
|
7491
|
-
/* @__PURE__ */
|
|
7549
|
+
/* @__PURE__ */ jsx38(TooltipContent, { children: "Edit value" })
|
|
7492
7550
|
] }),
|
|
7493
|
-
/* @__PURE__ */
|
|
7551
|
+
/* @__PURE__ */ jsx38(
|
|
7494
7552
|
PopoverContent,
|
|
7495
7553
|
{
|
|
7496
7554
|
align: "start",
|
|
7497
7555
|
className: "w-56 p-2",
|
|
7498
7556
|
onClick: (e) => e.stopPropagation(),
|
|
7499
|
-
children: /* @__PURE__ */
|
|
7557
|
+
children: /* @__PURE__ */ jsx38(
|
|
7500
7558
|
TypedEditor,
|
|
7501
7559
|
{
|
|
7502
7560
|
editType,
|
|
@@ -7522,19 +7580,19 @@ function InlineStringEditor({
|
|
|
7522
7580
|
href,
|
|
7523
7581
|
usePencil
|
|
7524
7582
|
}) {
|
|
7525
|
-
const [editing, setEditing] =
|
|
7526
|
-
const [draft, setDraft] =
|
|
7583
|
+
const [editing, setEditing] = useState19(false);
|
|
7584
|
+
const [draft, setDraft] = useState19(value);
|
|
7527
7585
|
if (!editing) {
|
|
7528
7586
|
if (usePencil) {
|
|
7529
|
-
return /* @__PURE__ */
|
|
7587
|
+
return /* @__PURE__ */ jsx38(
|
|
7530
7588
|
CellEditShell,
|
|
7531
7589
|
{
|
|
7532
7590
|
...href === void 0 ? {} : { href },
|
|
7533
7591
|
display,
|
|
7534
7592
|
...dirty === void 0 ? {} : { dirty },
|
|
7535
7593
|
...className === void 0 ? {} : { className },
|
|
7536
|
-
editButton: /* @__PURE__ */
|
|
7537
|
-
/* @__PURE__ */
|
|
7594
|
+
editButton: /* @__PURE__ */ jsxs28(Tooltip, { children: [
|
|
7595
|
+
/* @__PURE__ */ jsx38(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx38(
|
|
7538
7596
|
"button",
|
|
7539
7597
|
{
|
|
7540
7598
|
type: "button",
|
|
@@ -7545,16 +7603,16 @@ function InlineStringEditor({
|
|
|
7545
7603
|
setEditing(true);
|
|
7546
7604
|
},
|
|
7547
7605
|
className: CELL_PENCIL_CLASS,
|
|
7548
|
-
children: /* @__PURE__ */
|
|
7606
|
+
children: /* @__PURE__ */ jsx38(Pencil, { className: "h-3 w-3" })
|
|
7549
7607
|
}
|
|
7550
7608
|
) }),
|
|
7551
|
-
/* @__PURE__ */
|
|
7609
|
+
/* @__PURE__ */ jsx38(TooltipContent, { children: "Edit" })
|
|
7552
7610
|
] })
|
|
7553
7611
|
}
|
|
7554
7612
|
);
|
|
7555
7613
|
}
|
|
7556
|
-
return /* @__PURE__ */
|
|
7557
|
-
/* @__PURE__ */
|
|
7614
|
+
return /* @__PURE__ */ jsxs28(Tooltip, { children: [
|
|
7615
|
+
/* @__PURE__ */ jsx38(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx38(
|
|
7558
7616
|
"button",
|
|
7559
7617
|
{
|
|
7560
7618
|
type: "button",
|
|
@@ -7571,10 +7629,10 @@ function InlineStringEditor({
|
|
|
7571
7629
|
children: display
|
|
7572
7630
|
}
|
|
7573
7631
|
) }),
|
|
7574
|
-
/* @__PURE__ */
|
|
7632
|
+
/* @__PURE__ */ jsx38(TooltipContent, { children: "Click to edit" })
|
|
7575
7633
|
] });
|
|
7576
7634
|
}
|
|
7577
|
-
return /* @__PURE__ */
|
|
7635
|
+
return /* @__PURE__ */ jsx38(
|
|
7578
7636
|
Input,
|
|
7579
7637
|
{
|
|
7580
7638
|
autoFocus: true,
|
|
@@ -7610,9 +7668,9 @@ function TypedEditor({
|
|
|
7610
7668
|
}) {
|
|
7611
7669
|
if (editType === "boolean") {
|
|
7612
7670
|
const checked = Boolean(value);
|
|
7613
|
-
return /* @__PURE__ */
|
|
7614
|
-
/* @__PURE__ */
|
|
7615
|
-
/* @__PURE__ */
|
|
7671
|
+
return /* @__PURE__ */ jsxs28("div", { className: "flex items-center justify-between gap-2", children: [
|
|
7672
|
+
/* @__PURE__ */ jsx38("span", { className: "text-xs font-medium", children: "Value" }),
|
|
7673
|
+
/* @__PURE__ */ jsx38(
|
|
7616
7674
|
Checkbox,
|
|
7617
7675
|
{
|
|
7618
7676
|
checked,
|
|
@@ -7622,7 +7680,7 @@ function TypedEditor({
|
|
|
7622
7680
|
] });
|
|
7623
7681
|
}
|
|
7624
7682
|
if (editType === "number") {
|
|
7625
|
-
return /* @__PURE__ */
|
|
7683
|
+
return /* @__PURE__ */ jsx38(
|
|
7626
7684
|
NumberEditor,
|
|
7627
7685
|
{
|
|
7628
7686
|
value: typeof value === "number" ? value : Number(value) || 0,
|
|
@@ -7632,7 +7690,7 @@ function TypedEditor({
|
|
|
7632
7690
|
);
|
|
7633
7691
|
}
|
|
7634
7692
|
if (editType === "tags") {
|
|
7635
|
-
return /* @__PURE__ */
|
|
7693
|
+
return /* @__PURE__ */ jsx38(
|
|
7636
7694
|
TagsEditor,
|
|
7637
7695
|
{
|
|
7638
7696
|
value: Array.isArray(value) ? value.map(String) : [],
|
|
@@ -7643,19 +7701,19 @@ function TypedEditor({
|
|
|
7643
7701
|
);
|
|
7644
7702
|
}
|
|
7645
7703
|
if (editType === "select") {
|
|
7646
|
-
return /* @__PURE__ */
|
|
7704
|
+
return /* @__PURE__ */ jsxs28(
|
|
7647
7705
|
Select,
|
|
7648
7706
|
{
|
|
7649
7707
|
value: stringifyCellValue(value),
|
|
7650
7708
|
onValueChange: (v) => onCommit(v),
|
|
7651
7709
|
children: [
|
|
7652
|
-
/* @__PURE__ */
|
|
7653
|
-
/* @__PURE__ */
|
|
7710
|
+
/* @__PURE__ */ jsx38(SelectTrigger, { className: "h-8 text-xs", children: /* @__PURE__ */ jsx38(SelectValue, {}) }),
|
|
7711
|
+
/* @__PURE__ */ jsx38(SelectContent, { children: editOptions.map((o) => /* @__PURE__ */ jsx38(SelectItem, { value: o.value, children: o.label }, o.value)) })
|
|
7654
7712
|
]
|
|
7655
7713
|
}
|
|
7656
7714
|
);
|
|
7657
7715
|
}
|
|
7658
|
-
return /* @__PURE__ */
|
|
7716
|
+
return /* @__PURE__ */ jsx38(
|
|
7659
7717
|
Input,
|
|
7660
7718
|
{
|
|
7661
7719
|
type: "date",
|
|
@@ -7674,8 +7732,8 @@ function TagsEditor({
|
|
|
7674
7732
|
onCommit,
|
|
7675
7733
|
onCancel
|
|
7676
7734
|
}) {
|
|
7677
|
-
const [tags, setTags] =
|
|
7678
|
-
const [draft, setDraft] =
|
|
7735
|
+
const [tags, setTags] = useState19(value);
|
|
7736
|
+
const [draft, setDraft] = useState19("");
|
|
7679
7737
|
const add = (raw) => {
|
|
7680
7738
|
const next = raw.trim();
|
|
7681
7739
|
if (!next || tags.includes(next)) return;
|
|
@@ -7685,11 +7743,11 @@ function TagsEditor({
|
|
|
7685
7743
|
const matches = suggestions.filter(
|
|
7686
7744
|
(s) => !tags.includes(s.value) && s.value !== "__none__" && (!draft || s.label.toLowerCase().includes(draft.trim().toLowerCase()))
|
|
7687
7745
|
).slice(0, 6);
|
|
7688
|
-
return /* @__PURE__ */
|
|
7689
|
-
/* @__PURE__ */
|
|
7690
|
-
tags.length === 0 && /* @__PURE__ */
|
|
7691
|
-
tags.map((tag) => /* @__PURE__ */
|
|
7692
|
-
/* @__PURE__ */
|
|
7746
|
+
return /* @__PURE__ */ jsxs28("div", { className: "space-y-2", onClick: (e) => e.stopPropagation(), children: [
|
|
7747
|
+
/* @__PURE__ */ jsxs28("div", { className: "flex flex-wrap gap-1", children: [
|
|
7748
|
+
tags.length === 0 && /* @__PURE__ */ jsx38("span", { className: "text-xs text-muted-foreground", children: "No tags" }),
|
|
7749
|
+
tags.map((tag) => /* @__PURE__ */ jsxs28(Tooltip, { children: [
|
|
7750
|
+
/* @__PURE__ */ jsx38(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs28(
|
|
7693
7751
|
"button",
|
|
7694
7752
|
{
|
|
7695
7753
|
type: "button",
|
|
@@ -7698,17 +7756,17 @@ function TagsEditor({
|
|
|
7698
7756
|
className: "inline-flex items-center gap-1 rounded-full border border-border px-2 py-0.5 text-[11px] hover:border-destructive hover:text-destructive",
|
|
7699
7757
|
children: [
|
|
7700
7758
|
tag,
|
|
7701
|
-
/* @__PURE__ */
|
|
7759
|
+
/* @__PURE__ */ jsx38(X, { className: "h-2.5 w-2.5" })
|
|
7702
7760
|
]
|
|
7703
7761
|
}
|
|
7704
7762
|
) }),
|
|
7705
|
-
/* @__PURE__ */
|
|
7763
|
+
/* @__PURE__ */ jsxs28(TooltipContent, { children: [
|
|
7706
7764
|
"Remove ",
|
|
7707
7765
|
tag
|
|
7708
7766
|
] })
|
|
7709
7767
|
] }, tag))
|
|
7710
7768
|
] }),
|
|
7711
|
-
/* @__PURE__ */
|
|
7769
|
+
/* @__PURE__ */ jsx38(
|
|
7712
7770
|
Input,
|
|
7713
7771
|
{
|
|
7714
7772
|
autoFocus: true,
|
|
@@ -7729,7 +7787,7 @@ function TagsEditor({
|
|
|
7729
7787
|
className: "h-8 text-xs"
|
|
7730
7788
|
}
|
|
7731
7789
|
),
|
|
7732
|
-
matches.length > 0 && /* @__PURE__ */
|
|
7790
|
+
matches.length > 0 && /* @__PURE__ */ jsx38("div", { className: "flex flex-wrap gap-1", children: matches.map((s) => /* @__PURE__ */ jsxs28(
|
|
7733
7791
|
"button",
|
|
7734
7792
|
{
|
|
7735
7793
|
type: "button",
|
|
@@ -7742,8 +7800,8 @@ function TagsEditor({
|
|
|
7742
7800
|
},
|
|
7743
7801
|
s.value
|
|
7744
7802
|
)) }),
|
|
7745
|
-
/* @__PURE__ */
|
|
7746
|
-
/* @__PURE__ */
|
|
7803
|
+
/* @__PURE__ */ jsxs28("div", { className: "flex justify-end gap-1 pt-1", children: [
|
|
7804
|
+
/* @__PURE__ */ jsx38(
|
|
7747
7805
|
Button,
|
|
7748
7806
|
{
|
|
7749
7807
|
size: "sm",
|
|
@@ -7751,17 +7809,17 @@ function TagsEditor({
|
|
|
7751
7809
|
className: "h-7 px-2",
|
|
7752
7810
|
"aria-label": "Cancel edit",
|
|
7753
7811
|
onClick: onCancel,
|
|
7754
|
-
children: /* @__PURE__ */
|
|
7812
|
+
children: /* @__PURE__ */ jsx38(X, { className: "h-3.5 w-3.5" })
|
|
7755
7813
|
}
|
|
7756
7814
|
),
|
|
7757
|
-
/* @__PURE__ */
|
|
7815
|
+
/* @__PURE__ */ jsx38(
|
|
7758
7816
|
Button,
|
|
7759
7817
|
{
|
|
7760
7818
|
size: "sm",
|
|
7761
7819
|
className: "h-7 px-2",
|
|
7762
7820
|
"aria-label": "Apply tags",
|
|
7763
7821
|
onClick: () => onCommit(tags),
|
|
7764
|
-
children: /* @__PURE__ */
|
|
7822
|
+
children: /* @__PURE__ */ jsx38(Check, { className: "h-3.5 w-3.5" })
|
|
7765
7823
|
}
|
|
7766
7824
|
)
|
|
7767
7825
|
] })
|
|
@@ -7772,9 +7830,9 @@ function NumberEditor({
|
|
|
7772
7830
|
onCommit,
|
|
7773
7831
|
onCancel
|
|
7774
7832
|
}) {
|
|
7775
|
-
const [draft, setDraft] =
|
|
7776
|
-
return /* @__PURE__ */
|
|
7777
|
-
/* @__PURE__ */
|
|
7833
|
+
const [draft, setDraft] = useState19(String(value));
|
|
7834
|
+
return /* @__PURE__ */ jsxs28("div", { className: "flex flex-col gap-2", children: [
|
|
7835
|
+
/* @__PURE__ */ jsx38(
|
|
7778
7836
|
Input,
|
|
7779
7837
|
{
|
|
7780
7838
|
autoFocus: true,
|
|
@@ -7791,8 +7849,8 @@ function NumberEditor({
|
|
|
7791
7849
|
}
|
|
7792
7850
|
}
|
|
7793
7851
|
),
|
|
7794
|
-
/* @__PURE__ */
|
|
7795
|
-
/* @__PURE__ */
|
|
7852
|
+
/* @__PURE__ */ jsxs28("div", { className: "flex justify-end gap-1", children: [
|
|
7853
|
+
/* @__PURE__ */ jsx38(
|
|
7796
7854
|
Button,
|
|
7797
7855
|
{
|
|
7798
7856
|
type: "button",
|
|
@@ -7801,10 +7859,10 @@ function NumberEditor({
|
|
|
7801
7859
|
className: "h-7",
|
|
7802
7860
|
"aria-label": "Cancel edit",
|
|
7803
7861
|
onClick: onCancel,
|
|
7804
|
-
children: /* @__PURE__ */
|
|
7862
|
+
children: /* @__PURE__ */ jsx38(X, { className: "h-3.5 w-3.5" })
|
|
7805
7863
|
}
|
|
7806
7864
|
),
|
|
7807
|
-
/* @__PURE__ */
|
|
7865
|
+
/* @__PURE__ */ jsx38(
|
|
7808
7866
|
Button,
|
|
7809
7867
|
{
|
|
7810
7868
|
type: "button",
|
|
@@ -7815,7 +7873,7 @@ function NumberEditor({
|
|
|
7815
7873
|
const n = Number(draft);
|
|
7816
7874
|
if (Number.isFinite(n)) onCommit(n);
|
|
7817
7875
|
},
|
|
7818
|
-
children: /* @__PURE__ */
|
|
7876
|
+
children: /* @__PURE__ */ jsx38(Check, { className: "h-3.5 w-3.5" })
|
|
7819
7877
|
}
|
|
7820
7878
|
)
|
|
7821
7879
|
] })
|
|
@@ -7823,24 +7881,24 @@ function NumberEditor({
|
|
|
7823
7881
|
}
|
|
7824
7882
|
|
|
7825
7883
|
// src/data-table/ToolbarFacets.tsx
|
|
7826
|
-
import { jsx as
|
|
7884
|
+
import { jsx as jsx39, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
7827
7885
|
function ToolbarFacets({ facets }) {
|
|
7828
7886
|
if (facets.length === 0) return null;
|
|
7829
|
-
return /* @__PURE__ */
|
|
7887
|
+
return /* @__PURE__ */ jsx39("div", { className: "flex flex-wrap items-center gap-2", children: facets.map((facet) => {
|
|
7830
7888
|
if (facet.type === "custom") {
|
|
7831
|
-
return /* @__PURE__ */
|
|
7889
|
+
return /* @__PURE__ */ jsx39("div", { children: facet.render() }, facet.id);
|
|
7832
7890
|
}
|
|
7833
7891
|
const defaultValue = facet.defaultValue ?? facet.options[0]?.value ?? "";
|
|
7834
7892
|
const isNonDefault = facet.value !== defaultValue;
|
|
7835
|
-
return /* @__PURE__ */
|
|
7893
|
+
return /* @__PURE__ */ jsxs29(
|
|
7836
7894
|
"div",
|
|
7837
7895
|
{
|
|
7838
7896
|
className: "flex flex-wrap items-center gap-1.5 max-sm:grid max-sm:w-full max-sm:grid-cols-3",
|
|
7839
7897
|
children: [
|
|
7840
|
-
facet.label ? /* @__PURE__ */
|
|
7898
|
+
facet.label ? /* @__PURE__ */ jsx39("span", { className: "mr-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: facet.label }) : null,
|
|
7841
7899
|
facet.options.map((opt) => {
|
|
7842
7900
|
const active = facet.value === opt.value;
|
|
7843
|
-
return /* @__PURE__ */
|
|
7901
|
+
return /* @__PURE__ */ jsxs29(
|
|
7844
7902
|
Button,
|
|
7845
7903
|
{
|
|
7846
7904
|
type: "button",
|
|
@@ -7854,8 +7912,8 @@ function ToolbarFacets({ facets }) {
|
|
|
7854
7912
|
children: [
|
|
7855
7913
|
opt.icon,
|
|
7856
7914
|
opt.label,
|
|
7857
|
-
active && isNonDefault ? /* @__PURE__ */
|
|
7858
|
-
/* @__PURE__ */
|
|
7915
|
+
active && isNonDefault ? /* @__PURE__ */ jsx39(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ jsxs29(Tooltip, { children: [
|
|
7916
|
+
/* @__PURE__ */ jsx39(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx39(
|
|
7859
7917
|
"span",
|
|
7860
7918
|
{
|
|
7861
7919
|
role: "button",
|
|
@@ -7873,10 +7931,10 @@ function ToolbarFacets({ facets }) {
|
|
|
7873
7931
|
facet.onChange(defaultValue);
|
|
7874
7932
|
}
|
|
7875
7933
|
},
|
|
7876
|
-
children: /* @__PURE__ */
|
|
7934
|
+
children: /* @__PURE__ */ jsx39(X, { className: "h-3 w-3" })
|
|
7877
7935
|
}
|
|
7878
7936
|
) }),
|
|
7879
|
-
/* @__PURE__ */
|
|
7937
|
+
/* @__PURE__ */ jsx39(TooltipContent, { side: "top", children: "Clear this filter" })
|
|
7880
7938
|
] }) }) : null
|
|
7881
7939
|
]
|
|
7882
7940
|
},
|
|
@@ -7902,8 +7960,8 @@ function resetToolbarFacets(facets) {
|
|
|
7902
7960
|
}
|
|
7903
7961
|
|
|
7904
7962
|
// src/data-table/LayeredFilterBuilder.tsx
|
|
7905
|
-
import { useState as
|
|
7906
|
-
import { Fragment as Fragment5, jsx as
|
|
7963
|
+
import { useState as useState20 } from "react";
|
|
7964
|
+
import { Fragment as Fragment5, jsx as jsx40, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
7907
7965
|
function moveRule(rules, from, to) {
|
|
7908
7966
|
if (from === to || to < 0 || to >= rules.length) return [...rules];
|
|
7909
7967
|
const next = [...rules];
|
|
@@ -7919,8 +7977,8 @@ function LayeredFilterBuilder({
|
|
|
7919
7977
|
maxRules = 20,
|
|
7920
7978
|
label = "Advanced filters"
|
|
7921
7979
|
}) {
|
|
7922
|
-
const [open, setOpen] =
|
|
7923
|
-
const [draggedIndex, setDraggedIndex] =
|
|
7980
|
+
const [open, setOpen] = useState20(false);
|
|
7981
|
+
const [draggedIndex, setDraggedIndex] = useState20(null);
|
|
7924
7982
|
if (fields.length === 0) return null;
|
|
7925
7983
|
const updateRule = (index, patch) => {
|
|
7926
7984
|
onChange(
|
|
@@ -7949,8 +8007,8 @@ function LayeredFilterBuilder({
|
|
|
7949
8007
|
const reorder = (from, to) => {
|
|
7950
8008
|
onChange(moveRule(rules, from, to));
|
|
7951
8009
|
};
|
|
7952
|
-
return /* @__PURE__ */
|
|
7953
|
-
/* @__PURE__ */
|
|
8010
|
+
return /* @__PURE__ */ jsxs30("div", { className: "flex min-w-0 flex-wrap items-center gap-1", children: [
|
|
8011
|
+
/* @__PURE__ */ jsxs30(
|
|
7954
8012
|
Popover,
|
|
7955
8013
|
{
|
|
7956
8014
|
open,
|
|
@@ -7962,7 +8020,7 @@ function LayeredFilterBuilder({
|
|
|
7962
8020
|
}
|
|
7963
8021
|
},
|
|
7964
8022
|
children: [
|
|
7965
|
-
/* @__PURE__ */
|
|
8023
|
+
/* @__PURE__ */ jsx40(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs30(
|
|
7966
8024
|
Button,
|
|
7967
8025
|
{
|
|
7968
8026
|
type: "button",
|
|
@@ -7971,25 +8029,25 @@ function LayeredFilterBuilder({
|
|
|
7971
8029
|
className: "h-8 gap-1.5 px-2 text-xs",
|
|
7972
8030
|
"aria-label": label,
|
|
7973
8031
|
children: [
|
|
7974
|
-
/* @__PURE__ */
|
|
7975
|
-
/* @__PURE__ */
|
|
7976
|
-
rules.length > 0 ? /* @__PURE__ */
|
|
8032
|
+
/* @__PURE__ */ jsx40(SlidersHorizontal, { className: "h-3.5 w-3.5" }),
|
|
8033
|
+
/* @__PURE__ */ jsx40("span", { className: "hidden sm:inline", children: rules.length > 0 ? `${rules.length} layers` : "Advanced" }),
|
|
8034
|
+
rules.length > 0 ? /* @__PURE__ */ jsx40("span", { className: "sm:hidden", children: rules.length }) : null
|
|
7977
8035
|
]
|
|
7978
8036
|
}
|
|
7979
8037
|
) }),
|
|
7980
|
-
/* @__PURE__ */
|
|
8038
|
+
/* @__PURE__ */ jsxs30(
|
|
7981
8039
|
PopoverContent,
|
|
7982
8040
|
{
|
|
7983
8041
|
align: "start",
|
|
7984
8042
|
sideOffset: 6,
|
|
7985
8043
|
className: "w-[min(46rem,calc(100vw-1rem))] p-0",
|
|
7986
8044
|
children: [
|
|
7987
|
-
/* @__PURE__ */
|
|
7988
|
-
/* @__PURE__ */
|
|
7989
|
-
/* @__PURE__ */
|
|
7990
|
-
/* @__PURE__ */
|
|
8045
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex items-start justify-between gap-3 border-b border-border px-3 py-2.5", children: [
|
|
8046
|
+
/* @__PURE__ */ jsxs30("div", { children: [
|
|
8047
|
+
/* @__PURE__ */ jsx40("p", { className: "text-sm font-semibold text-foreground", children: "Narrow these results" }),
|
|
8048
|
+
/* @__PURE__ */ jsx40("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." })
|
|
7991
8049
|
] }),
|
|
7992
|
-
rules.length > 0 ? /* @__PURE__ */
|
|
8050
|
+
rules.length > 0 ? /* @__PURE__ */ jsx40(
|
|
7993
8051
|
Button,
|
|
7994
8052
|
{
|
|
7995
8053
|
type: "button",
|
|
@@ -8001,10 +8059,10 @@ function LayeredFilterBuilder({
|
|
|
8001
8059
|
}
|
|
8002
8060
|
) : null
|
|
8003
8061
|
] }),
|
|
8004
|
-
/* @__PURE__ */
|
|
8005
|
-
/* @__PURE__ */
|
|
8006
|
-
/* @__PURE__ */
|
|
8007
|
-
] }) : rules.map((rule, index) => /* @__PURE__ */
|
|
8062
|
+
/* @__PURE__ */ jsx40("div", { className: "max-h-[min(28rem,65dvh)] space-y-1.5 overflow-y-auto p-2.5 scrollbar-thin", children: rules.length === 0 ? /* @__PURE__ */ jsxs30("div", { className: "rounded-md border border-dashed border-border px-3 py-5 text-center", children: [
|
|
8063
|
+
/* @__PURE__ */ jsx40("p", { className: "text-sm font-medium text-foreground", children: "Start with one simple layer" }),
|
|
8064
|
+
/* @__PURE__ */ jsx40("p", { className: "mt-1 text-xs text-muted-foreground", children: "For example: Keyword contains ITAD, then Keyword doesn't have the word \u201Cwhat\u201D." })
|
|
8065
|
+
] }) : rules.map((rule, index) => /* @__PURE__ */ jsx40(
|
|
8008
8066
|
LayeredRuleRow,
|
|
8009
8067
|
{
|
|
8010
8068
|
index,
|
|
@@ -8024,9 +8082,9 @@ function LayeredFilterBuilder({
|
|
|
8024
8082
|
},
|
|
8025
8083
|
rule.id
|
|
8026
8084
|
)) }),
|
|
8027
|
-
/* @__PURE__ */
|
|
8028
|
-
/* @__PURE__ */
|
|
8029
|
-
/* @__PURE__ */
|
|
8085
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex items-center justify-between gap-2 border-t border-border px-3 py-2", children: [
|
|
8086
|
+
/* @__PURE__ */ jsx40("p", { className: "text-[11px] text-muted-foreground", children: "The regular search still works and is applied before these layers." }),
|
|
8087
|
+
/* @__PURE__ */ jsxs30(
|
|
8030
8088
|
Button,
|
|
8031
8089
|
{
|
|
8032
8090
|
type: "button",
|
|
@@ -8036,7 +8094,7 @@ function LayeredFilterBuilder({
|
|
|
8036
8094
|
disabled: rules.length >= maxRules,
|
|
8037
8095
|
onClick: addRule,
|
|
8038
8096
|
children: [
|
|
8039
|
-
/* @__PURE__ */
|
|
8097
|
+
/* @__PURE__ */ jsx40(Plus, { className: "h-3.5 w-3.5" }),
|
|
8040
8098
|
" Add layer"
|
|
8041
8099
|
]
|
|
8042
8100
|
}
|
|
@@ -8048,7 +8106,7 @@ function LayeredFilterBuilder({
|
|
|
8048
8106
|
]
|
|
8049
8107
|
}
|
|
8050
8108
|
),
|
|
8051
|
-
rules.map((rule, index) => /* @__PURE__ */
|
|
8109
|
+
rules.map((rule, index) => /* @__PURE__ */ jsxs30(
|
|
8052
8110
|
"span",
|
|
8053
8111
|
{
|
|
8054
8112
|
className: cn(
|
|
@@ -8056,7 +8114,7 @@ function LayeredFilterBuilder({
|
|
|
8056
8114
|
isCompleteLayeredFilterRule(rule) ? "border-border bg-muted/50 text-foreground" : "border-dashed border-warning/50 bg-warning/10 text-warning"
|
|
8057
8115
|
),
|
|
8058
8116
|
children: [
|
|
8059
|
-
/* @__PURE__ */
|
|
8117
|
+
/* @__PURE__ */ jsxs30(
|
|
8060
8118
|
"button",
|
|
8061
8119
|
{
|
|
8062
8120
|
type: "button",
|
|
@@ -8064,19 +8122,19 @@ function LayeredFilterBuilder({
|
|
|
8064
8122
|
onClick: () => setOpen(true),
|
|
8065
8123
|
title: isCompleteLayeredFilterRule(rule) ? layeredFilterRuleSummary(rule, fields) : `Layer ${index + 1} needs a value`,
|
|
8066
8124
|
children: [
|
|
8067
|
-
/* @__PURE__ */
|
|
8125
|
+
/* @__PURE__ */ jsx40("span", { className: "mr-1 text-muted-foreground", children: index + 1 }),
|
|
8068
8126
|
isCompleteLayeredFilterRule(rule) ? layeredFilterRuleSummary(rule, fields) : "Choose a value"
|
|
8069
8127
|
]
|
|
8070
8128
|
}
|
|
8071
8129
|
),
|
|
8072
|
-
/* @__PURE__ */
|
|
8130
|
+
/* @__PURE__ */ jsx40(
|
|
8073
8131
|
"button",
|
|
8074
8132
|
{
|
|
8075
8133
|
type: "button",
|
|
8076
8134
|
className: "shrink-0 rounded-full p-0.5 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
8077
8135
|
"aria-label": `Remove filter layer ${index + 1}`,
|
|
8078
8136
|
onClick: () => removeRule(index),
|
|
8079
|
-
children: /* @__PURE__ */
|
|
8137
|
+
children: /* @__PURE__ */ jsx40(X, { className: "h-3 w-3" })
|
|
8080
8138
|
}
|
|
8081
8139
|
)
|
|
8082
8140
|
]
|
|
@@ -8106,7 +8164,7 @@ function LayeredRuleRow({
|
|
|
8106
8164
|
event.preventDefault();
|
|
8107
8165
|
onKeyboardMove(event.key === "ArrowUp" ? -1 : 1);
|
|
8108
8166
|
};
|
|
8109
|
-
return /* @__PURE__ */
|
|
8167
|
+
return /* @__PURE__ */ jsxs30(
|
|
8110
8168
|
"div",
|
|
8111
8169
|
{
|
|
8112
8170
|
className: cn(
|
|
@@ -8119,7 +8177,7 @@ function LayeredRuleRow({
|
|
|
8119
8177
|
onDrop(index);
|
|
8120
8178
|
},
|
|
8121
8179
|
children: [
|
|
8122
|
-
/* @__PURE__ */
|
|
8180
|
+
/* @__PURE__ */ jsx40(
|
|
8123
8181
|
"button",
|
|
8124
8182
|
{
|
|
8125
8183
|
type: "button",
|
|
@@ -8133,10 +8191,10 @@ function LayeredRuleRow({
|
|
|
8133
8191
|
},
|
|
8134
8192
|
onDragEnd,
|
|
8135
8193
|
onKeyDown: handleMoveKey,
|
|
8136
|
-
children: /* @__PURE__ */
|
|
8194
|
+
children: /* @__PURE__ */ jsx40(GripVertical, { className: "h-3.5 w-3.5" })
|
|
8137
8195
|
}
|
|
8138
8196
|
),
|
|
8139
|
-
/* @__PURE__ */
|
|
8197
|
+
/* @__PURE__ */ jsxs30(
|
|
8140
8198
|
Select,
|
|
8141
8199
|
{
|
|
8142
8200
|
value: field.id,
|
|
@@ -8154,16 +8212,16 @@ function LayeredRuleRow({
|
|
|
8154
8212
|
});
|
|
8155
8213
|
},
|
|
8156
8214
|
children: [
|
|
8157
|
-
/* @__PURE__ */
|
|
8215
|
+
/* @__PURE__ */ jsx40(
|
|
8158
8216
|
SelectTrigger,
|
|
8159
8217
|
{
|
|
8160
8218
|
size: "sm",
|
|
8161
8219
|
className: "h-7 w-full text-xs max-sm:col-span-1",
|
|
8162
8220
|
"aria-label": `Filter layer ${index + 1} field`,
|
|
8163
|
-
children: /* @__PURE__ */
|
|
8221
|
+
children: /* @__PURE__ */ jsx40(SelectValue, {})
|
|
8164
8222
|
}
|
|
8165
8223
|
),
|
|
8166
|
-
/* @__PURE__ */
|
|
8224
|
+
/* @__PURE__ */ jsx40(SelectContent, { children: fields.map((candidate) => /* @__PURE__ */ jsx40(
|
|
8167
8225
|
SelectItem,
|
|
8168
8226
|
{
|
|
8169
8227
|
value: candidate.id,
|
|
@@ -8175,7 +8233,7 @@ function LayeredRuleRow({
|
|
|
8175
8233
|
]
|
|
8176
8234
|
}
|
|
8177
8235
|
),
|
|
8178
|
-
/* @__PURE__ */
|
|
8236
|
+
/* @__PURE__ */ jsxs30(
|
|
8179
8237
|
Select,
|
|
8180
8238
|
{
|
|
8181
8239
|
value: rule.operator,
|
|
@@ -8187,35 +8245,35 @@ function LayeredRuleRow({
|
|
|
8187
8245
|
});
|
|
8188
8246
|
},
|
|
8189
8247
|
children: [
|
|
8190
|
-
/* @__PURE__ */
|
|
8248
|
+
/* @__PURE__ */ jsx40(
|
|
8191
8249
|
SelectTrigger,
|
|
8192
8250
|
{
|
|
8193
8251
|
size: "sm",
|
|
8194
8252
|
className: "h-7 w-full text-xs max-sm:col-start-2",
|
|
8195
8253
|
"aria-label": `Filter layer ${index + 1} operator`,
|
|
8196
|
-
children: /* @__PURE__ */
|
|
8254
|
+
children: /* @__PURE__ */ jsx40(SelectValue, {})
|
|
8197
8255
|
}
|
|
8198
8256
|
),
|
|
8199
|
-
/* @__PURE__ */
|
|
8257
|
+
/* @__PURE__ */ jsx40(SelectContent, { children: operators.map((operator) => /* @__PURE__ */ jsx40(SelectItem, { value: operator, className: "text-xs", children: LAYERED_FILTER_OPERATOR_LABELS[operator] }, operator)) })
|
|
8200
8258
|
]
|
|
8201
8259
|
}
|
|
8202
8260
|
),
|
|
8203
|
-
/* @__PURE__ */
|
|
8261
|
+
/* @__PURE__ */ jsx40("div", { className: "min-w-0 max-sm:col-span-3 max-sm:col-start-1", children: !needsValue ? /* @__PURE__ */ jsx40("span", { className: "flex h-7 items-center px-2 text-xs text-muted-foreground", children: "No value needed" }) : field.kind === "select" ? /* @__PURE__ */ jsxs30(
|
|
8204
8262
|
Select,
|
|
8205
8263
|
{
|
|
8206
8264
|
value: rule.value,
|
|
8207
8265
|
onValueChange: (value) => onChange({ value }),
|
|
8208
8266
|
children: [
|
|
8209
|
-
/* @__PURE__ */
|
|
8267
|
+
/* @__PURE__ */ jsx40(
|
|
8210
8268
|
SelectTrigger,
|
|
8211
8269
|
{
|
|
8212
8270
|
size: "sm",
|
|
8213
8271
|
className: "h-7 w-full text-xs",
|
|
8214
8272
|
"aria-label": `Filter layer ${index + 1} value`,
|
|
8215
|
-
children: /* @__PURE__ */
|
|
8273
|
+
children: /* @__PURE__ */ jsx40(SelectValue, {})
|
|
8216
8274
|
}
|
|
8217
8275
|
),
|
|
8218
|
-
/* @__PURE__ */
|
|
8276
|
+
/* @__PURE__ */ jsx40(SelectContent, { children: field.options.map((option) => /* @__PURE__ */ jsx40(
|
|
8219
8277
|
SelectItem,
|
|
8220
8278
|
{
|
|
8221
8279
|
value: option.value,
|
|
@@ -8226,8 +8284,8 @@ function LayeredRuleRow({
|
|
|
8226
8284
|
)) })
|
|
8227
8285
|
]
|
|
8228
8286
|
}
|
|
8229
|
-
) : /* @__PURE__ */
|
|
8230
|
-
/* @__PURE__ */
|
|
8287
|
+
) : /* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-1", children: [
|
|
8288
|
+
/* @__PURE__ */ jsx40(
|
|
8231
8289
|
Input,
|
|
8232
8290
|
{
|
|
8233
8291
|
value: rule.value,
|
|
@@ -8238,9 +8296,9 @@ function LayeredRuleRow({
|
|
|
8238
8296
|
"aria-label": `Filter layer ${index + 1} value`
|
|
8239
8297
|
}
|
|
8240
8298
|
),
|
|
8241
|
-
rule.operator === "between" ? /* @__PURE__ */
|
|
8242
|
-
/* @__PURE__ */
|
|
8243
|
-
/* @__PURE__ */
|
|
8299
|
+
rule.operator === "between" ? /* @__PURE__ */ jsxs30(Fragment5, { children: [
|
|
8300
|
+
/* @__PURE__ */ jsx40("span", { className: "text-[11px] text-muted-foreground", children: "and" }),
|
|
8301
|
+
/* @__PURE__ */ jsx40(
|
|
8244
8302
|
Input,
|
|
8245
8303
|
{
|
|
8246
8304
|
value: rule.valueTo ?? "",
|
|
@@ -8253,7 +8311,7 @@ function LayeredRuleRow({
|
|
|
8253
8311
|
)
|
|
8254
8312
|
] }) : null
|
|
8255
8313
|
] }) }),
|
|
8256
|
-
/* @__PURE__ */
|
|
8314
|
+
/* @__PURE__ */ jsx40(
|
|
8257
8315
|
Button,
|
|
8258
8316
|
{
|
|
8259
8317
|
type: "button",
|
|
@@ -8262,7 +8320,7 @@ function LayeredRuleRow({
|
|
|
8262
8320
|
className: "h-7 w-7 p-0 text-muted-foreground hover:text-destructive max-sm:col-start-3 max-sm:row-start-1",
|
|
8263
8321
|
"aria-label": `Remove filter layer ${index + 1}`,
|
|
8264
8322
|
onClick: onRemove,
|
|
8265
|
-
children: /* @__PURE__ */
|
|
8323
|
+
children: /* @__PURE__ */ jsx40(Trash2, { className: "h-3.5 w-3.5" })
|
|
8266
8324
|
}
|
|
8267
8325
|
)
|
|
8268
8326
|
]
|
|
@@ -8362,7 +8420,7 @@ function safeQueryPage(requestedPage, totalItems, pageSize) {
|
|
|
8362
8420
|
}
|
|
8363
8421
|
|
|
8364
8422
|
// src/data-table/MatrxDataTable.tsx
|
|
8365
|
-
import { Fragment as Fragment7, jsx as
|
|
8423
|
+
import { Fragment as Fragment7, jsx as jsx41, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
8366
8424
|
function TableToolbarAction({
|
|
8367
8425
|
HostAction,
|
|
8368
8426
|
ariaLabel,
|
|
@@ -8373,10 +8431,10 @@ function TableToolbarAction({
|
|
|
8373
8431
|
children
|
|
8374
8432
|
}) {
|
|
8375
8433
|
if (HostAction) {
|
|
8376
|
-
return /* @__PURE__ */
|
|
8434
|
+
return /* @__PURE__ */ jsx41("span", { "data-matrx-table-toolbar-action": true, children: /* @__PURE__ */ jsx41(HostAction, { ariaLabel, tooltip, disabled, busy, onClick, children }) });
|
|
8377
8435
|
}
|
|
8378
|
-
return /* @__PURE__ */
|
|
8379
|
-
/* @__PURE__ */
|
|
8436
|
+
return /* @__PURE__ */ jsxs31(Tooltip, { children: [
|
|
8437
|
+
/* @__PURE__ */ jsx41(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx41("span", { "data-matrx-table-toolbar-action": true, className: "inline-flex", children: /* @__PURE__ */ jsx41(
|
|
8380
8438
|
Button,
|
|
8381
8439
|
{
|
|
8382
8440
|
type: "button",
|
|
@@ -8391,7 +8449,7 @@ function TableToolbarAction({
|
|
|
8391
8449
|
children: isValidElement2(children) ? cloneElement2(children, { className: cn("h-5 w-5", children.props.className) }) : children
|
|
8392
8450
|
}
|
|
8393
8451
|
) }) }),
|
|
8394
|
-
/* @__PURE__ */
|
|
8452
|
+
/* @__PURE__ */ jsx41(TooltipContent, { children: tooltip ?? ariaLabel })
|
|
8395
8453
|
] });
|
|
8396
8454
|
}
|
|
8397
8455
|
function hasSameRowReferences(previous, next) {
|
|
@@ -8404,20 +8462,20 @@ function TableRowCopyControl({
|
|
|
8404
8462
|
sourceId,
|
|
8405
8463
|
defaultColumns
|
|
8406
8464
|
}) {
|
|
8407
|
-
return /* @__PURE__ */
|
|
8408
|
-
|
|
8409
|
-
|
|
8410
|
-
|
|
8411
|
-
|
|
8412
|
-
|
|
8413
|
-
|
|
8414
|
-
|
|
8415
|
-
|
|
8416
|
-
|
|
8417
|
-
|
|
8418
|
-
|
|
8419
|
-
}
|
|
8420
|
-
|
|
8465
|
+
return /* @__PURE__ */ jsx41(CopyButtons, { size, ...tableRowCopyProps(copy, row, sourceId, defaultColumns) });
|
|
8466
|
+
}
|
|
8467
|
+
function tableRowCopyProps(copy, row, sourceId, defaultColumns) {
|
|
8468
|
+
const aiVariants = copy.rowAiVariants?.(row);
|
|
8469
|
+
return {
|
|
8470
|
+
sourceId,
|
|
8471
|
+
label: copy.label,
|
|
8472
|
+
...copy.rowReferences ? { references: copy.rowReferences(row) } : {},
|
|
8473
|
+
...copy.triggerVariant ? { triggerVariant: copy.triggerVariant } : {},
|
|
8474
|
+
human: () => copy.humanRow(row),
|
|
8475
|
+
json: () => copy.agentRow ? copy.agentRow(row) : row,
|
|
8476
|
+
agent: () => defaultColumns ? buildDefaultTableRowAgentInput(copy, row, defaultColumns) : buildRowAgentInput(copy, row),
|
|
8477
|
+
...aiVariants === void 0 ? {} : { aiVariants }
|
|
8478
|
+
};
|
|
8421
8479
|
}
|
|
8422
8480
|
function dragPointerY(event) {
|
|
8423
8481
|
const activator = event.activatorEvent;
|
|
@@ -8428,8 +8486,8 @@ function isStringArray(value) {
|
|
|
8428
8486
|
}
|
|
8429
8487
|
var activeUrlTableIds = /* @__PURE__ */ new Set();
|
|
8430
8488
|
function MatrxDataTable(props) {
|
|
8431
|
-
if (!props.urlState) return /* @__PURE__ */
|
|
8432
|
-
return /* @__PURE__ */
|
|
8489
|
+
if (!props.urlState) return /* @__PURE__ */ jsx41(MatrxDataTableCore, { ...props });
|
|
8490
|
+
return /* @__PURE__ */ jsx41(MatrxDataTableWithUrlState, { ...props, urlState: props.urlState });
|
|
8433
8491
|
}
|
|
8434
8492
|
function MatrxDataTableWithUrlState({
|
|
8435
8493
|
urlState,
|
|
@@ -8447,7 +8505,7 @@ function MatrxDataTableWithUrlState({
|
|
|
8447
8505
|
...urlState.history === void 0 ? {} : { history: urlState.history },
|
|
8448
8506
|
...urlState.textHistory === void 0 ? {} : { textHistory: urlState.textHistory }
|
|
8449
8507
|
});
|
|
8450
|
-
|
|
8508
|
+
useEffect14(() => {
|
|
8451
8509
|
if (activeUrlTableIds.has(urlState.id)) {
|
|
8452
8510
|
throw new Error(
|
|
8453
8511
|
`Duplicate MatrxDataTable urlState.id "${urlState.id}" on one page. Give every table a unique stable id.`
|
|
@@ -8484,7 +8542,7 @@ function MatrxDataTableWithUrlState({
|
|
|
8484
8542
|
props.selection?.onSelectedIdsChange(ids);
|
|
8485
8543
|
}
|
|
8486
8544
|
} : props.selection;
|
|
8487
|
-
return /* @__PURE__ */
|
|
8545
|
+
return /* @__PURE__ */ jsx41(
|
|
8488
8546
|
MatrxDataTableCore,
|
|
8489
8547
|
{
|
|
8490
8548
|
...props,
|
|
@@ -8543,6 +8601,7 @@ function MatrxDataTableCore({
|
|
|
8543
8601
|
detail,
|
|
8544
8602
|
window: windowConfig,
|
|
8545
8603
|
copy,
|
|
8604
|
+
rowCopyPlacement = "inline",
|
|
8546
8605
|
edit,
|
|
8547
8606
|
hierarchy,
|
|
8548
8607
|
selectedId: controlledSelectedId,
|
|
@@ -8571,7 +8630,7 @@ function MatrxDataTableCore({
|
|
|
8571
8630
|
}) {
|
|
8572
8631
|
const appendQuery = query?.mode === "controlled-append" ? query : null;
|
|
8573
8632
|
const appendQueryKey = appendQuery?.pagination.queryKey ?? null;
|
|
8574
|
-
const committedAppendQueryKey =
|
|
8633
|
+
const committedAppendQueryKey = useRef12(appendQueryKey);
|
|
8575
8634
|
const appendSourceChanged = appendQuery !== null && committedAppendQueryKey.current !== appendQueryKey;
|
|
8576
8635
|
const data = appendQuery ? appendQuery.pagination.rows : suppliedData;
|
|
8577
8636
|
const isLoading = appendQuery ? appendQuery.pagination.loading : suppliedLoading;
|
|
@@ -8582,10 +8641,10 @@ function MatrxDataTableCore({
|
|
|
8582
8641
|
const Link = host.Link ?? DefaultTableLink;
|
|
8583
8642
|
const SidePanelSurface = host.SidePanelSurface ?? DefaultTableSidePanel;
|
|
8584
8643
|
const { notify: toast, notice } = useTableNotice();
|
|
8585
|
-
const [savedViewError, setSavedViewError] =
|
|
8586
|
-
const [toolbarActionError, setToolbarActionError] =
|
|
8587
|
-
const [toolbarActionPending, setToolbarActionPending] =
|
|
8588
|
-
const toolbarActionPendingRef =
|
|
8644
|
+
const [savedViewError, setSavedViewError] = useState21(null);
|
|
8645
|
+
const [toolbarActionError, setToolbarActionError] = useState21(null);
|
|
8646
|
+
const [toolbarActionPending, setToolbarActionPending] = useState21({ refresh: false, add: false });
|
|
8647
|
+
const toolbarActionPendingRef = useRef12({ refresh: false, add: false });
|
|
8589
8648
|
const CHECKBOX_TAP_AREA = "h-4 w-4 touch-manipulation";
|
|
8590
8649
|
const mobileCardsClass = mobileCardsBreakpoint === "lg" ? "lg:hidden" : "sm:hidden";
|
|
8591
8650
|
const tableWithCardsClass = mobileCardsBreakpoint === "lg" ? "max-lg:hidden" : "max-sm:hidden";
|
|
@@ -8607,8 +8666,8 @@ function MatrxDataTableCore({
|
|
|
8607
8666
|
},
|
|
8608
8667
|
[controlledQuery]
|
|
8609
8668
|
);
|
|
8610
|
-
const [internalSearch, setInternalSearch] =
|
|
8611
|
-
const [draggedRowId, setDraggedRowId] =
|
|
8669
|
+
const [internalSearch, setInternalSearch] = useState21("");
|
|
8670
|
+
const [draggedRowId, setDraggedRowId] = useState21(null);
|
|
8612
8671
|
const hierarchySensors = useSensors(
|
|
8613
8672
|
useSensor(PointerSensor, {
|
|
8614
8673
|
activationConstraint: { distance: COLUMN_REORDER_ACTIVATION_DISTANCE }
|
|
@@ -8624,7 +8683,7 @@ function MatrxDataTableCore({
|
|
|
8624
8683
|
}
|
|
8625
8684
|
toolbar?.onSearchChange?.(v);
|
|
8626
8685
|
};
|
|
8627
|
-
const [internalSearchMatchMode, setInternalSearchMatchMode] =
|
|
8686
|
+
const [internalSearchMatchMode, setInternalSearchMatchMode] = useState21(
|
|
8628
8687
|
toolbar?.searchMatch?.defaultMode ?? "contains"
|
|
8629
8688
|
);
|
|
8630
8689
|
const searchMatchMode = controlledQuery ? controlledQuery.state.searchMatchMode ?? toolbar?.searchMatch?.defaultMode ?? "contains" : internalSearchMatchMode;
|
|
@@ -8635,7 +8694,7 @@ function MatrxDataTableCore({
|
|
|
8635
8694
|
}
|
|
8636
8695
|
setInternalSearchMatchMode(mode);
|
|
8637
8696
|
};
|
|
8638
|
-
const [internalSearchScope, setInternalSearchScope] =
|
|
8697
|
+
const [internalSearchScope, setInternalSearchScope] = useState21("all");
|
|
8639
8698
|
const searchScope = controlledQuery ? controlledQuery.state.searchScope ?? "all" : internalSearchScope;
|
|
8640
8699
|
const setSearchScope = (scope) => {
|
|
8641
8700
|
if (controlledQuery) {
|
|
@@ -8644,7 +8703,7 @@ function MatrxDataTableCore({
|
|
|
8644
8703
|
}
|
|
8645
8704
|
setInternalSearchScope(scope);
|
|
8646
8705
|
};
|
|
8647
|
-
const [internalAnyOf, setInternalAnyOf] =
|
|
8706
|
+
const [internalAnyOf, setInternalAnyOf] = useState21("");
|
|
8648
8707
|
const toolbarAnyOfControlled = toolbar?.anyOf?.value !== void 0;
|
|
8649
8708
|
const anyOfValue = controlledQuery ? controlledQuery.state.anyOf : toolbarAnyOfControlled ? toolbar?.anyOf?.value ?? "" : internalAnyOf;
|
|
8650
8709
|
const setAnyOfValue = (v) => {
|
|
@@ -8655,7 +8714,7 @@ function MatrxDataTableCore({
|
|
|
8655
8714
|
}
|
|
8656
8715
|
toolbar?.anyOf?.onChange?.(v);
|
|
8657
8716
|
};
|
|
8658
|
-
const [internalLayeredFilters, setInternalLayeredFilters] =
|
|
8717
|
+
const [internalLayeredFilters, setInternalLayeredFilters] = useState21([]);
|
|
8659
8718
|
const layeredFilters = controlledQuery ? controlledQuery.state.layeredFilters ?? [] : internalLayeredFilters;
|
|
8660
8719
|
const setLayeredFilters = (next) => {
|
|
8661
8720
|
if (controlledQuery) {
|
|
@@ -8664,7 +8723,7 @@ function MatrxDataTableCore({
|
|
|
8664
8723
|
}
|
|
8665
8724
|
setInternalLayeredFilters(next);
|
|
8666
8725
|
};
|
|
8667
|
-
const [internalColumnFilters, setInternalColumnFilters] =
|
|
8726
|
+
const [internalColumnFilters, setInternalColumnFilters] = useState21({});
|
|
8668
8727
|
const columnFilters = controlledQuery ? controlledQuery.state.columnFilters : internalColumnFilters;
|
|
8669
8728
|
const setColumnFilter = (id, next) => {
|
|
8670
8729
|
const nextFilters = { ...columnFilters, [id]: next };
|
|
@@ -8677,7 +8736,7 @@ function MatrxDataTableCore({
|
|
|
8677
8736
|
}
|
|
8678
8737
|
setInternalColumnFilters(nextFilters);
|
|
8679
8738
|
};
|
|
8680
|
-
const [internalSort, setInternalSort] =
|
|
8739
|
+
const [internalSort, setInternalSort] = useState21(defaultSort);
|
|
8681
8740
|
const sort = controlledQuery ? controlledQuery.state.sort : internalSort;
|
|
8682
8741
|
const setSort = (next) => {
|
|
8683
8742
|
if (controlledQuery) {
|
|
@@ -8686,7 +8745,7 @@ function MatrxDataTableCore({
|
|
|
8686
8745
|
}
|
|
8687
8746
|
setInternalSort(next);
|
|
8688
8747
|
};
|
|
8689
|
-
const [internalPage, setInternalPage] =
|
|
8748
|
+
const [internalPage, setInternalPage] = useState21(1);
|
|
8690
8749
|
const page = controlledQuery ? controlledQuery.state.page : internalPage;
|
|
8691
8750
|
const setPage = (next) => {
|
|
8692
8751
|
if (controlledQuery) {
|
|
@@ -8695,7 +8754,7 @@ function MatrxDataTableCore({
|
|
|
8695
8754
|
}
|
|
8696
8755
|
setInternalPage(next);
|
|
8697
8756
|
};
|
|
8698
|
-
const [internalPageSize, setInternalPageSize] =
|
|
8757
|
+
const [internalPageSize, setInternalPageSize] = useState21(
|
|
8699
8758
|
defaultPageSize === 0 ? Math.max(data.length, 1) : defaultPageSize
|
|
8700
8759
|
);
|
|
8701
8760
|
const pageSize = controlledQuery ? controlledQuery.state.pageSize : internalPageSize;
|
|
@@ -8706,26 +8765,26 @@ function MatrxDataTableCore({
|
|
|
8706
8765
|
}
|
|
8707
8766
|
setInternalPageSize(next);
|
|
8708
8767
|
};
|
|
8709
|
-
const [uncontrolledSelectedId, setUncontrolledSelectedId] =
|
|
8768
|
+
const [uncontrolledSelectedId, setUncontrolledSelectedId] = useState21(null);
|
|
8710
8769
|
const rawSelectedId = controlledSelectedId !== void 0 ? controlledSelectedId : uncontrolledSelectedId;
|
|
8711
8770
|
const selectedId = appendSourceChanged ? null : rawSelectedId;
|
|
8712
8771
|
const setSelectedId = (id) => {
|
|
8713
8772
|
if (controlledSelectedId === void 0) setUncontrolledSelectedId(id);
|
|
8714
8773
|
onSelectedIdChange?.(id);
|
|
8715
8774
|
};
|
|
8716
|
-
const [uncontrolledWindowRowId, setUncontrolledWindowRowId] =
|
|
8775
|
+
const [uncontrolledWindowRowId, setUncontrolledWindowRowId] = useState21(null);
|
|
8717
8776
|
const rawWindowRowId = controlledWindowRowId !== void 0 ? controlledWindowRowId : uncontrolledWindowRowId;
|
|
8718
8777
|
const windowRowId = appendSourceChanged ? null : rawWindowRowId;
|
|
8719
8778
|
const setWindowRowId = (id) => {
|
|
8720
8779
|
if (controlledWindowRowId === void 0) setUncontrolledWindowRowId(id);
|
|
8721
8780
|
onWindowRowIdChange?.(id);
|
|
8722
8781
|
};
|
|
8723
|
-
const [windowRowSnapshot, setWindowRowSnapshot] =
|
|
8782
|
+
const [windowRowSnapshot, setWindowRowSnapshot] = useState21(null);
|
|
8724
8783
|
const editScopeKey = appendQueryKey === null ? "\0local" : `append:${appendQueryKey}`;
|
|
8725
|
-
const [editsByScope, setEditsByScope] =
|
|
8726
|
-
const editRevisionRef =
|
|
8727
|
-
const [savingByScope, setSavingByScope] =
|
|
8728
|
-
const [confirmForeignDraftDiscard, setConfirmForeignDraftDiscard] =
|
|
8784
|
+
const [editsByScope, setEditsByScope] = useState21({});
|
|
8785
|
+
const editRevisionRef = useRef12({});
|
|
8786
|
+
const [savingByScope, setSavingByScope] = useState21({});
|
|
8787
|
+
const [confirmForeignDraftDiscard, setConfirmForeignDraftDiscard] = useState21(false);
|
|
8729
8788
|
const edits = editsByScope[editScopeKey]?.values ?? {};
|
|
8730
8789
|
const saving = (savingByScope[editScopeKey] ?? 0) > 0;
|
|
8731
8790
|
const setEdits = (next) => {
|
|
@@ -8792,7 +8851,7 @@ function MatrxDataTableCore({
|
|
|
8792
8851
|
rows: Object.entries(draft.values).map(([rowId, columns2]) => ({ rowId, columns: columns2 }))
|
|
8793
8852
|
}));
|
|
8794
8853
|
const selection = appendSourceChanged && selectionConfig ? { ...selectionConfig, selectedIds: [] } : selectionConfig;
|
|
8795
|
-
|
|
8854
|
+
useEffect14(() => {
|
|
8796
8855
|
const previous = committedAppendQueryKey.current;
|
|
8797
8856
|
committedAppendQueryKey.current = appendQueryKey;
|
|
8798
8857
|
if (previous === null || appendQueryKey === null || previous === appendQueryKey) {
|
|
@@ -8810,13 +8869,13 @@ function MatrxDataTableCore({
|
|
|
8810
8869
|
onWindowRowIdChange,
|
|
8811
8870
|
selectionConfig
|
|
8812
8871
|
]);
|
|
8813
|
-
const scrollRef =
|
|
8814
|
-
const tableRef =
|
|
8815
|
-
const tableHeaderRef =
|
|
8816
|
-
const cardsScrollRef =
|
|
8817
|
-
const [documentStickyHeader, setDocumentStickyHeader] =
|
|
8818
|
-
const documentStickyHeaderRef =
|
|
8819
|
-
const previousAppendKeyForScrollReset =
|
|
8872
|
+
const scrollRef = useRef12(null);
|
|
8873
|
+
const tableRef = useRef12(null);
|
|
8874
|
+
const tableHeaderRef = useRef12(null);
|
|
8875
|
+
const cardsScrollRef = useRef12(null);
|
|
8876
|
+
const [documentStickyHeader, setDocumentStickyHeader] = useState21(false);
|
|
8877
|
+
const documentStickyHeaderRef = useRef12(false);
|
|
8878
|
+
const previousAppendKeyForScrollReset = useRef12(appendQueryKey);
|
|
8820
8879
|
useLayoutEffect2(() => {
|
|
8821
8880
|
const previous = previousAppendKeyForScrollReset.current;
|
|
8822
8881
|
previousAppendKeyForScrollReset.current = appendQueryKey;
|
|
@@ -8842,12 +8901,12 @@ function MatrxDataTableCore({
|
|
|
8842
8901
|
...appendScrollPolicy?.mode === "scroll" && appendScrollPolicy.thresholdPx !== void 0 ? { thresholdPx: appendScrollPolicy.thresholdPx } : {},
|
|
8843
8902
|
...appendScrollPolicy?.mode === "scroll" && appendScrollPolicy.intentTimeoutMs !== void 0 ? { intentTimeoutMs: appendScrollPolicy.intentTimeoutMs } : {}
|
|
8844
8903
|
});
|
|
8845
|
-
const rootRef =
|
|
8904
|
+
const rootRef = useRef12(null);
|
|
8846
8905
|
useClippedContentGuard(rootRef, {
|
|
8847
8906
|
label: typeof copy === "object" && copy.listLabel ? `Table: ${copy.listLabel}` : "MatrxDataTable"
|
|
8848
8907
|
});
|
|
8849
|
-
const [scrollHintRight, setScrollHintRight] =
|
|
8850
|
-
const [scrollHintLeft, setScrollHintLeft] =
|
|
8908
|
+
const [scrollHintRight, setScrollHintRight] = useState21(false);
|
|
8909
|
+
const [scrollHintLeft, setScrollHintLeft] = useState21(false);
|
|
8851
8910
|
const updateScrollHint = useCallback6(() => {
|
|
8852
8911
|
const el = scrollRef.current;
|
|
8853
8912
|
if (!el) return;
|
|
@@ -8862,7 +8921,7 @@ function MatrxDataTableCore({
|
|
|
8862
8921
|
behavior: "smooth"
|
|
8863
8922
|
});
|
|
8864
8923
|
};
|
|
8865
|
-
|
|
8924
|
+
useEffect14(() => {
|
|
8866
8925
|
updateScrollHint();
|
|
8867
8926
|
window.addEventListener("resize", updateScrollHint);
|
|
8868
8927
|
const el = scrollRef.current;
|
|
@@ -8936,26 +8995,26 @@ function MatrxDataTableCore({
|
|
|
8936
8995
|
window.removeEventListener("resize", requestUpdate);
|
|
8937
8996
|
};
|
|
8938
8997
|
}, [stickyHeader, data, columns]);
|
|
8939
|
-
const [columnOrder, setColumnOrder] =
|
|
8940
|
-
const [hiddenColumnIds, setHiddenColumnIds] =
|
|
8998
|
+
const [columnOrder, setColumnOrder] = useState21(() => columnState?.order ?? columns.map(columnId));
|
|
8999
|
+
const [hiddenColumnIds, setHiddenColumnIds] = useState21(
|
|
8941
9000
|
() => new Set(columnState?.hidden ?? columns.filter((column) => column.hidden).map(columnId))
|
|
8942
9001
|
);
|
|
8943
|
-
const [columnWidths, setColumnWidths] =
|
|
9002
|
+
const [columnWidths, setColumnWidths] = useState21(
|
|
8944
9003
|
() => normalizeColumnWidthsForColumns(columnState?.widths, columns)
|
|
8945
9004
|
);
|
|
8946
|
-
const [fixedTableGeometry, setFixedTableGeometry] =
|
|
8947
|
-
const knownColumnIds =
|
|
8948
|
-
const draggedColumnId =
|
|
8949
|
-
const columnDragActive =
|
|
8950
|
-
const columnDragRaf =
|
|
8951
|
-
const columnDragScrollDirection =
|
|
8952
|
-
const [columnDragPreview, setColumnDragPreview] =
|
|
9005
|
+
const [fixedTableGeometry, setFixedTableGeometry] = useState21(null);
|
|
9006
|
+
const knownColumnIds = useRef12(new Set(columns.map(columnId)));
|
|
9007
|
+
const draggedColumnId = useRef12(null);
|
|
9008
|
+
const columnDragActive = useRef12(false);
|
|
9009
|
+
const columnDragRaf = useRef12(null);
|
|
9010
|
+
const columnDragScrollDirection = useRef12(0);
|
|
9011
|
+
const [columnDragPreview, setColumnDragPreview] = useState21(null);
|
|
8953
9012
|
const stopColumnDragScroll = useCallback6(() => {
|
|
8954
9013
|
if (columnDragRaf.current !== null) cancelAnimationFrame(columnDragRaf.current);
|
|
8955
9014
|
columnDragRaf.current = null;
|
|
8956
9015
|
columnDragScrollDirection.current = 0;
|
|
8957
9016
|
}, []);
|
|
8958
|
-
|
|
9017
|
+
useEffect14(() => () => {
|
|
8959
9018
|
columnDragActive.current = false;
|
|
8960
9019
|
stopColumnDragScroll();
|
|
8961
9020
|
}, [stopColumnDragScroll]);
|
|
@@ -8993,7 +9052,7 @@ function MatrxDataTableCore({
|
|
|
8993
9052
|
setHiddenColumnIds(hidden);
|
|
8994
9053
|
}
|
|
8995
9054
|
}, [columnState]);
|
|
8996
|
-
const [internalColumnManagerOpen, setInternalColumnManagerOpen] =
|
|
9055
|
+
const [internalColumnManagerOpen, setInternalColumnManagerOpen] = useState21(false);
|
|
8997
9056
|
const columnManagerOpen = controlledColumnManager?.open ?? internalColumnManagerOpen;
|
|
8998
9057
|
const setColumnManagerOpen = controlledColumnManager?.onOpenChange ?? setInternalColumnManagerOpen;
|
|
8999
9058
|
const columnIds = useMemo7(() => columns.map(columnId), [columns]);
|
|
@@ -9003,7 +9062,7 @@ function MatrxDataTableCore({
|
|
|
9003
9062
|
() => normalizeColumnWidthsForColumns(columnState?.widths ?? columnWidths, columns),
|
|
9004
9063
|
[columns, columnState?.widths, columnWidths]
|
|
9005
9064
|
);
|
|
9006
|
-
const resizeGestureSnapshotRef =
|
|
9065
|
+
const resizeGestureSnapshotRef = useRef12(null);
|
|
9007
9066
|
const measureVisibleColumnWidths = useCallback6(() => {
|
|
9008
9067
|
const measured = {};
|
|
9009
9068
|
const headers = tableRef.current ? Array.from(tableRef.current.querySelectorAll(
|
|
@@ -9076,7 +9135,7 @@ function MatrxDataTableCore({
|
|
|
9076
9135
|
}
|
|
9077
9136
|
setColumnWidths(normalized);
|
|
9078
9137
|
}, [columnIds, columnState, columns, measureFixedTableGeometry, measureVisibleColumnWidths]);
|
|
9079
|
-
|
|
9138
|
+
useEffect14(() => {
|
|
9080
9139
|
const ids = columns.map(columnId);
|
|
9081
9140
|
if (columnState) return;
|
|
9082
9141
|
const previousIds = knownColumnIds.current;
|
|
@@ -9261,8 +9320,8 @@ function MatrxDataTableCore({
|
|
|
9261
9320
|
intelligentSearchEnabled,
|
|
9262
9321
|
searchScope
|
|
9263
9322
|
]);
|
|
9264
|
-
const lastNotifiedViewRows =
|
|
9265
|
-
|
|
9323
|
+
const lastNotifiedViewRows = useRef12(null);
|
|
9324
|
+
useEffect14(() => {
|
|
9266
9325
|
if (!onViewChange) {
|
|
9267
9326
|
lastNotifiedViewRows.current = null;
|
|
9268
9327
|
return;
|
|
@@ -9271,7 +9330,7 @@ function MatrxDataTableCore({
|
|
|
9271
9330
|
lastNotifiedViewRows.current = processed;
|
|
9272
9331
|
if (changed) onViewChange(processed);
|
|
9273
9332
|
}, [processed, onViewChange]);
|
|
9274
|
-
|
|
9333
|
+
useEffect14(() => {
|
|
9275
9334
|
if (controlledQuery) return;
|
|
9276
9335
|
setInternalPage(1);
|
|
9277
9336
|
}, [
|
|
@@ -9323,7 +9382,7 @@ function MatrxDataTableCore({
|
|
|
9323
9382
|
const start = (safePage - 1) * effectivePageSize;
|
|
9324
9383
|
return processed.slice(start, start + effectivePageSize);
|
|
9325
9384
|
}, [processed, safePage, effectivePageSize, pageSize, remoteQuery, hidePagination, localProgressiveEnabled, progressiveRows.rows]);
|
|
9326
|
-
|
|
9385
|
+
useEffect14(() => {
|
|
9327
9386
|
if (!controlledQuery || controlledQuery.state.page === safePage) return;
|
|
9328
9387
|
emitControlledQueryChange({ page: safePage });
|
|
9329
9388
|
}, [controlledQuery, emitControlledQueryChange, safePage]);
|
|
@@ -9342,7 +9401,21 @@ function MatrxDataTableCore({
|
|
|
9342
9401
|
);
|
|
9343
9402
|
const editEnabled = Boolean(edit?.enabled && edit.onSave);
|
|
9344
9403
|
const showRowCopy = effectiveCopy !== void 0 && effectiveCopy.showRow !== false;
|
|
9404
|
+
const rowCopyInMenu = rowCopyPlacement === "menu" && Boolean(rowActions);
|
|
9405
|
+
const showInlineRowCopy = showRowCopy && !rowCopyInMenu;
|
|
9345
9406
|
const showToolbarCopy = effectiveCopy !== void 0 && effectiveCopy.showToolbar !== false;
|
|
9407
|
+
const renderRowActions = (row, controls) => {
|
|
9408
|
+
const actions = rowActions?.(row, controls);
|
|
9409
|
+
if (!effectiveCopy || !showRowCopy) return actions;
|
|
9410
|
+
return /* @__PURE__ */ jsx41(
|
|
9411
|
+
MatrxTableRowAlchemyProvider,
|
|
9412
|
+
{
|
|
9413
|
+
copy: tableRowCopyProps(effectiveCopy, row, `${tableCopySourceNamespace}:row:${getRowId(row)}`, copy === void 0 ? declaredVisibleCopyColumns : void 0),
|
|
9414
|
+
placement: rowCopyInMenu ? "menu" : "inline",
|
|
9415
|
+
children: actions
|
|
9416
|
+
}
|
|
9417
|
+
);
|
|
9418
|
+
};
|
|
9346
9419
|
const activeFilterCount = countActiveColumnFilters(columnFilters);
|
|
9347
9420
|
const facetActive = (toolbar?.facets ?? []).some((f) => {
|
|
9348
9421
|
if (f.type === "custom") return f.filter?.active ?? false;
|
|
@@ -9417,7 +9490,7 @@ function MatrxDataTableCore({
|
|
|
9417
9490
|
const renderedEmptyState = remoteQuery === null && data.length > 0 && hasActiveFilters ? {
|
|
9418
9491
|
title: "No matching rows",
|
|
9419
9492
|
description: "No rows match the current search or filters.",
|
|
9420
|
-
action: /* @__PURE__ */
|
|
9493
|
+
action: /* @__PURE__ */ jsx41(Button, { type: "button", variant: "outline", size: "sm", onClick: clearAllFilters, children: "Clear filters" }),
|
|
9421
9494
|
icon: void 0
|
|
9422
9495
|
} : emptyState;
|
|
9423
9496
|
const commitCell = (rowId, field, next) => {
|
|
@@ -9669,7 +9742,7 @@ function MatrxDataTableCore({
|
|
|
9669
9742
|
setEdits({});
|
|
9670
9743
|
edit?.onCancel?.();
|
|
9671
9744
|
};
|
|
9672
|
-
const showActionsCol = windowEnabled || Boolean(rowActions) ||
|
|
9745
|
+
const showActionsCol = windowEnabled || Boolean(rowActions) || showInlineRowCopy;
|
|
9673
9746
|
const selectedIdSet = useMemo7(
|
|
9674
9747
|
() => new Set(selection?.selectedIds ?? []),
|
|
9675
9748
|
[selection?.selectedIds]
|
|
@@ -9686,7 +9759,7 @@ function MatrxDataTableCore({
|
|
|
9686
9759
|
() => data.filter((row) => selectedIdSet.has(getRowId(row))),
|
|
9687
9760
|
[data, selectedIdSet, getRowId]
|
|
9688
9761
|
);
|
|
9689
|
-
const lastToggledIndex =
|
|
9762
|
+
const lastToggledIndex = useRef12(null);
|
|
9690
9763
|
const setSelectedIds = (next) => selection?.onSelectedIdsChange([...next]);
|
|
9691
9764
|
const toggleRowSelected = (index, shiftKey) => {
|
|
9692
9765
|
if (!selection) return;
|
|
@@ -9739,7 +9812,7 @@ function MatrxDataTableCore({
|
|
|
9739
9812
|
const display = renderCell(applyRowEdits(row, rowEdits), col, index);
|
|
9740
9813
|
const href = col.href?.(row) ?? void 0;
|
|
9741
9814
|
if (editEnabled && col.editable && (col.editableIf?.(row) ?? true)) {
|
|
9742
|
-
return /* @__PURE__ */
|
|
9815
|
+
return /* @__PURE__ */ jsx41(
|
|
9743
9816
|
EditableTableCell,
|
|
9744
9817
|
{
|
|
9745
9818
|
value: rowEdits && field in rowEdits ? rowEdits[field] : getCellValue(row, col),
|
|
@@ -9753,7 +9826,7 @@ function MatrxDataTableCore({
|
|
|
9753
9826
|
}
|
|
9754
9827
|
);
|
|
9755
9828
|
}
|
|
9756
|
-
return href ? /* @__PURE__ */
|
|
9829
|
+
return href ? /* @__PURE__ */ jsx41(Link, { href, onClick: (event) => event.stopPropagation(), className: "block w-full min-w-0 rounded outline-none focus-visible:ring-2 focus-visible:ring-ring", children: display }) : display;
|
|
9757
9830
|
};
|
|
9758
9831
|
const currentViewSnapshot = useMemo7(
|
|
9759
9832
|
() => ({
|
|
@@ -9859,7 +9932,7 @@ function MatrxDataTableCore({
|
|
|
9859
9932
|
},
|
|
9860
9933
|
[columns, commitColumnState, commitColumnWidths, controlledQuery, intelligentSearchEnabled, intelligentSearchScopes, toolbar]
|
|
9861
9934
|
);
|
|
9862
|
-
return /* @__PURE__ */
|
|
9935
|
+
return /* @__PURE__ */ jsx41(TooltipProvider, { children: /* @__PURE__ */ jsxs31(
|
|
9863
9936
|
DndContext,
|
|
9864
9937
|
{
|
|
9865
9938
|
id: tableDndContextId,
|
|
@@ -9952,7 +10025,7 @@ function MatrxDataTableCore({
|
|
|
9952
10025
|
commitColumnState(order, effectiveHiddenColumnIds);
|
|
9953
10026
|
},
|
|
9954
10027
|
children: [
|
|
9955
|
-
/* @__PURE__ */
|
|
10028
|
+
/* @__PURE__ */ jsxs31(
|
|
9956
10029
|
"div",
|
|
9957
10030
|
{
|
|
9958
10031
|
ref: rootRef,
|
|
@@ -9966,14 +10039,14 @@ function MatrxDataTableCore({
|
|
|
9966
10039
|
),
|
|
9967
10040
|
children: [
|
|
9968
10041
|
notice,
|
|
9969
|
-
savedViewError ? /* @__PURE__ */
|
|
9970
|
-
toolbarActionError ? /* @__PURE__ */
|
|
9971
|
-
!hideToolbar && (viewTabs || toolbar?.title || showSearch || toolbar?.anyOf || toolbar?.layeredFilters || toolbar?.facets && toolbar.facets.length > 0 || toolbar?.leading || toolbar?.actions || toolbar?.refresh || toolbar?.add || tableId && SavedViews || hasActiveFilters || showToolbarCopy || columns.length > 0) && /* @__PURE__ */
|
|
10042
|
+
savedViewError ? /* @__PURE__ */ jsx41("p", { role: "alert", className: "shrink-0 text-xs text-destructive", children: savedViewError }) : null,
|
|
10043
|
+
toolbarActionError ? /* @__PURE__ */ jsx41("p", { role: "alert", className: "shrink-0 text-xs text-destructive", children: toolbarActionError }) : null,
|
|
10044
|
+
!hideToolbar && (viewTabs || toolbar?.title || showSearch || toolbar?.anyOf || toolbar?.layeredFilters || toolbar?.facets && toolbar.facets.length > 0 || toolbar?.leading || toolbar?.actions || toolbar?.refresh || toolbar?.add || tableId && SavedViews || hasActiveFilters || showToolbarCopy || columns.length > 0) && /* @__PURE__ */ jsxs31(
|
|
9972
10045
|
TableTitleRow,
|
|
9973
10046
|
{
|
|
9974
|
-
tabs: viewTabs ? /* @__PURE__ */
|
|
10047
|
+
tabs: viewTabs ? /* @__PURE__ */ jsx41(TableViewWorkspace, { snapshot: currentViewSnapshot, onApply: applySavedView, related: relatedTableActions }, tableId ?? "table") : void 0,
|
|
9975
10048
|
...toolbar?.title === void 0 ? {} : { title: toolbar.title },
|
|
9976
|
-
context: tableId && SavedViews ? /* @__PURE__ */
|
|
10049
|
+
context: tableId && SavedViews ? /* @__PURE__ */ jsx41("span", { "data-matrx-table-view-control": true, children: /* @__PURE__ */ jsx41(
|
|
9977
10050
|
SavedViews,
|
|
9978
10051
|
{
|
|
9979
10052
|
tableId,
|
|
@@ -9982,7 +10055,7 @@ function MatrxDataTableCore({
|
|
|
9982
10055
|
onApply: applySavedView
|
|
9983
10056
|
}
|
|
9984
10057
|
) }) : void 0,
|
|
9985
|
-
search: showSearch ? intelligentSearchEnabled ? /* @__PURE__ */
|
|
10058
|
+
search: showSearch ? intelligentSearchEnabled ? /* @__PURE__ */ jsx41(
|
|
9986
10059
|
TableSearch,
|
|
9987
10060
|
{
|
|
9988
10061
|
value: searchValue,
|
|
@@ -9992,7 +10065,7 @@ function MatrxDataTableCore({
|
|
|
9992
10065
|
scopes: intelligentSearchScopes,
|
|
9993
10066
|
...toolbar?.searchPlaceholder === void 0 ? {} : { placeholder: toolbar.searchPlaceholder }
|
|
9994
10067
|
}
|
|
9995
|
-
) : /* @__PURE__ */
|
|
10068
|
+
) : /* @__PURE__ */ jsxs31(
|
|
9996
10069
|
"div",
|
|
9997
10070
|
{
|
|
9998
10071
|
"data-matrx-table-search": true,
|
|
@@ -10001,9 +10074,9 @@ function MatrxDataTableCore({
|
|
|
10001
10074
|
toolbar?.searchMatch ? "sm:max-w-md" : "sm:max-w-xs"
|
|
10002
10075
|
),
|
|
10003
10076
|
children: [
|
|
10004
|
-
/* @__PURE__ */
|
|
10005
|
-
/* @__PURE__ */
|
|
10006
|
-
/* @__PURE__ */
|
|
10077
|
+
/* @__PURE__ */ jsxs31("div", { className: "relative min-w-0 flex-1", children: [
|
|
10078
|
+
/* @__PURE__ */ jsx41(Search, { className: "absolute left-2 top-1/2 h-5 w-5 -translate-y-1/2 text-muted-foreground" }),
|
|
10079
|
+
/* @__PURE__ */ jsx41(
|
|
10007
10080
|
Input,
|
|
10008
10081
|
{
|
|
10009
10082
|
value: searchValue,
|
|
@@ -10016,22 +10089,22 @@ function MatrxDataTableCore({
|
|
|
10016
10089
|
style: { fontSize: "16px" }
|
|
10017
10090
|
}
|
|
10018
10091
|
),
|
|
10019
|
-
searchValue ? /* @__PURE__ */
|
|
10020
|
-
/* @__PURE__ */
|
|
10092
|
+
searchValue ? /* @__PURE__ */ jsxs31(Tooltip, { children: [
|
|
10093
|
+
/* @__PURE__ */ jsx41(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx41(
|
|
10021
10094
|
"button",
|
|
10022
10095
|
{
|
|
10023
10096
|
type: "button",
|
|
10024
10097
|
"aria-label": "Clear search",
|
|
10025
10098
|
className: "absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground hover:text-foreground",
|
|
10026
10099
|
onClick: () => setSearchValue(""),
|
|
10027
|
-
children: /* @__PURE__ */
|
|
10100
|
+
children: /* @__PURE__ */ jsx41(X, { className: "h-5 w-5" })
|
|
10028
10101
|
}
|
|
10029
10102
|
) }),
|
|
10030
|
-
/* @__PURE__ */
|
|
10103
|
+
/* @__PURE__ */ jsx41(TooltipContent, { children: "Clear search" })
|
|
10031
10104
|
] }) : null
|
|
10032
10105
|
] }),
|
|
10033
|
-
toolbar?.searchMatch ? /* @__PURE__ */
|
|
10034
|
-
/* @__PURE__ */
|
|
10106
|
+
toolbar?.searchMatch ? /* @__PURE__ */ jsxs31(Tooltip, { children: [
|
|
10107
|
+
/* @__PURE__ */ jsx41(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs31(
|
|
10035
10108
|
Button,
|
|
10036
10109
|
{
|
|
10037
10110
|
type: "button",
|
|
@@ -10044,18 +10117,18 @@ function MatrxDataTableCore({
|
|
|
10044
10117
|
searchMatchMode === "whole_words" ? "contains" : "whole_words"
|
|
10045
10118
|
),
|
|
10046
10119
|
children: [
|
|
10047
|
-
/* @__PURE__ */
|
|
10120
|
+
/* @__PURE__ */ jsx41(WholeWord, { className: "h-5 w-5" }),
|
|
10048
10121
|
searchMatchMode === "whole_words" ? "Whole words" : "Contains"
|
|
10049
10122
|
]
|
|
10050
10123
|
}
|
|
10051
10124
|
) }),
|
|
10052
|
-
/* @__PURE__ */
|
|
10125
|
+
/* @__PURE__ */ jsx41(TooltipContent, { children: searchMatchMode === "whole_words" ? "Whole words \u2014 click to match text anywhere" : "Contains text \u2014 click to require whole words" })
|
|
10053
10126
|
] }) : null
|
|
10054
10127
|
]
|
|
10055
10128
|
}
|
|
10056
10129
|
) : null,
|
|
10057
10130
|
children: [
|
|
10058
|
-
toolbar?.layeredFilters ? /* @__PURE__ */
|
|
10131
|
+
toolbar?.layeredFilters ? /* @__PURE__ */ jsx41(
|
|
10059
10132
|
LayeredFilterBuilder,
|
|
10060
10133
|
{
|
|
10061
10134
|
fields: toolbar.layeredFilters.fields,
|
|
@@ -10065,9 +10138,9 @@ function MatrxDataTableCore({
|
|
|
10065
10138
|
label: toolbar.layeredFilters.label
|
|
10066
10139
|
}
|
|
10067
10140
|
) : null,
|
|
10068
|
-
toolbar?.anyOf ? /* @__PURE__ */
|
|
10069
|
-
/* @__PURE__ */
|
|
10070
|
-
/* @__PURE__ */
|
|
10141
|
+
toolbar?.anyOf ? /* @__PURE__ */ jsxs31("div", { className: "relative w-full max-w-xs", children: [
|
|
10142
|
+
/* @__PURE__ */ jsx41(Search, { className: "absolute left-2 top-1/2 h-5 w-5 -translate-y-1/2 text-muted-foreground" }),
|
|
10143
|
+
/* @__PURE__ */ jsx41(
|
|
10071
10144
|
Input,
|
|
10072
10145
|
{
|
|
10073
10146
|
value: anyOfValue,
|
|
@@ -10077,22 +10150,22 @@ function MatrxDataTableCore({
|
|
|
10077
10150
|
style: { fontSize: "16px" }
|
|
10078
10151
|
}
|
|
10079
10152
|
),
|
|
10080
|
-
anyOfValue ? /* @__PURE__ */
|
|
10081
|
-
/* @__PURE__ */
|
|
10153
|
+
anyOfValue ? /* @__PURE__ */ jsxs31(Tooltip, { children: [
|
|
10154
|
+
/* @__PURE__ */ jsx41(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx41(
|
|
10082
10155
|
"button",
|
|
10083
10156
|
{
|
|
10084
10157
|
type: "button",
|
|
10085
10158
|
"aria-label": "Clear match-any search",
|
|
10086
10159
|
className: "absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground hover:text-foreground",
|
|
10087
10160
|
onClick: () => setAnyOfValue(""),
|
|
10088
|
-
children: /* @__PURE__ */
|
|
10161
|
+
children: /* @__PURE__ */ jsx41(X, { className: "h-5 w-5" })
|
|
10089
10162
|
}
|
|
10090
10163
|
) }),
|
|
10091
|
-
/* @__PURE__ */
|
|
10164
|
+
/* @__PURE__ */ jsx41(TooltipContent, { children: "Clear match-any search" })
|
|
10092
10165
|
] }) : null
|
|
10093
10166
|
] }) : null,
|
|
10094
|
-
renderedFacets ? /* @__PURE__ */
|
|
10095
|
-
toolbar?.leading ? /* @__PURE__ */
|
|
10167
|
+
renderedFacets ? /* @__PURE__ */ jsx41(ToolbarFacets, { facets: renderedFacets }) : null,
|
|
10168
|
+
toolbar?.leading ? /* @__PURE__ */ jsx41(
|
|
10096
10169
|
"div",
|
|
10097
10170
|
{
|
|
10098
10171
|
"data-matrx-table-toolbar-extras": true,
|
|
@@ -10100,13 +10173,13 @@ function MatrxDataTableCore({
|
|
|
10100
10173
|
children: toolbar.leading
|
|
10101
10174
|
}
|
|
10102
10175
|
) : null,
|
|
10103
|
-
/* @__PURE__ */
|
|
10176
|
+
/* @__PURE__ */ jsxs31(
|
|
10104
10177
|
"div",
|
|
10105
10178
|
{
|
|
10106
10179
|
"data-matrx-table-actions": true,
|
|
10107
10180
|
className: "ml-auto flex min-w-0 flex-wrap items-center gap-0",
|
|
10108
10181
|
children: [
|
|
10109
|
-
sourceTotal !== void 0 ? /* @__PURE__ */
|
|
10182
|
+
sourceTotal !== void 0 ? /* @__PURE__ */ jsxs31(
|
|
10110
10183
|
"span",
|
|
10111
10184
|
{
|
|
10112
10185
|
"data-matrx-table-source-total": true,
|
|
@@ -10123,7 +10196,7 @@ function MatrxDataTableCore({
|
|
|
10123
10196
|
]
|
|
10124
10197
|
}
|
|
10125
10198
|
) : null,
|
|
10126
|
-
/* @__PURE__ */
|
|
10199
|
+
/* @__PURE__ */ jsx41(
|
|
10127
10200
|
TableToolbarAction,
|
|
10128
10201
|
{
|
|
10129
10202
|
HostAction: host.ToolbarAction,
|
|
@@ -10131,10 +10204,10 @@ function MatrxDataTableCore({
|
|
|
10131
10204
|
tooltip: hasActiveFilters ? "Clear search and filters; keep columns and sort" : "No search or filters to clear",
|
|
10132
10205
|
disabled: !hasActiveFilters,
|
|
10133
10206
|
onClick: clearAllFilters,
|
|
10134
|
-
children: /* @__PURE__ */
|
|
10207
|
+
children: /* @__PURE__ */ jsx41(Eraser, {})
|
|
10135
10208
|
}
|
|
10136
10209
|
),
|
|
10137
|
-
showToolbarCopy && effectiveCopy ? /* @__PURE__ */
|
|
10210
|
+
showToolbarCopy && effectiveCopy ? /* @__PURE__ */ jsx41(
|
|
10138
10211
|
CopyButtons,
|
|
10139
10212
|
{
|
|
10140
10213
|
size: "toolbar",
|
|
@@ -10177,17 +10250,17 @@ function MatrxDataTableCore({
|
|
|
10177
10250
|
}
|
|
10178
10251
|
}
|
|
10179
10252
|
) : null,
|
|
10180
|
-
columns.length > 0 ? /* @__PURE__ */
|
|
10253
|
+
columns.length > 0 ? /* @__PURE__ */ jsx41(
|
|
10181
10254
|
TableToolbarAction,
|
|
10182
10255
|
{
|
|
10183
10256
|
HostAction: host.ToolbarAction,
|
|
10184
10257
|
ariaLabel: "Columns",
|
|
10185
10258
|
tooltip: "Show, hide, or reorder columns",
|
|
10186
10259
|
onClick: () => setColumnManagerOpen(true),
|
|
10187
|
-
children: /* @__PURE__ */
|
|
10260
|
+
children: /* @__PURE__ */ jsx41(SlidersHorizontal, {})
|
|
10188
10261
|
}
|
|
10189
10262
|
) : null,
|
|
10190
|
-
toolbar?.refresh ? /* @__PURE__ */
|
|
10263
|
+
toolbar?.refresh ? /* @__PURE__ */ jsx41(
|
|
10191
10264
|
TableToolbarAction,
|
|
10192
10265
|
{
|
|
10193
10266
|
HostAction: host.ToolbarAction,
|
|
@@ -10209,10 +10282,10 @@ function MatrxDataTableCore({
|
|
|
10209
10282
|
setToolbarActionPending((current) => ({ ...current, refresh: false }));
|
|
10210
10283
|
});
|
|
10211
10284
|
},
|
|
10212
|
-
children: /* @__PURE__ */
|
|
10285
|
+
children: /* @__PURE__ */ jsx41(RefreshControlIcon, { spinning: isFetching || toolbarActionPending.refresh })
|
|
10213
10286
|
}
|
|
10214
10287
|
) : null,
|
|
10215
|
-
toolbar?.add ? /* @__PURE__ */
|
|
10288
|
+
toolbar?.add ? /* @__PURE__ */ jsx41(
|
|
10216
10289
|
TableToolbarAction,
|
|
10217
10290
|
{
|
|
10218
10291
|
HostAction: host.ToolbarAction,
|
|
@@ -10234,7 +10307,7 @@ function MatrxDataTableCore({
|
|
|
10234
10307
|
setToolbarActionPending((current) => ({ ...current, add: false }));
|
|
10235
10308
|
});
|
|
10236
10309
|
},
|
|
10237
|
-
children: /* @__PURE__ */
|
|
10310
|
+
children: /* @__PURE__ */ jsx41(Plus, {})
|
|
10238
10311
|
}
|
|
10239
10312
|
) : null,
|
|
10240
10313
|
toolbar?.actions
|
|
@@ -10244,15 +10317,15 @@ function MatrxDataTableCore({
|
|
|
10244
10317
|
]
|
|
10245
10318
|
}
|
|
10246
10319
|
),
|
|
10247
|
-
selection && selectionCount > 0 ? /* @__PURE__ */
|
|
10248
|
-
/* @__PURE__ */
|
|
10320
|
+
selection && selectionCount > 0 ? /* @__PURE__ */ jsxs31("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: [
|
|
10321
|
+
/* @__PURE__ */ jsxs31("span", { className: "text-xs font-medium text-foreground", children: [
|
|
10249
10322
|
formatCount3(selectionCount),
|
|
10250
10323
|
" ",
|
|
10251
10324
|
selectionNoun,
|
|
10252
10325
|
selectionCount === 1 ? "" : "s",
|
|
10253
10326
|
" selected"
|
|
10254
10327
|
] }),
|
|
10255
|
-
/* @__PURE__ */
|
|
10328
|
+
/* @__PURE__ */ jsxs31(
|
|
10256
10329
|
Button,
|
|
10257
10330
|
{
|
|
10258
10331
|
type: "button",
|
|
@@ -10264,13 +10337,13 @@ function MatrxDataTableCore({
|
|
|
10264
10337
|
selection.onSelectedIdsChange([]);
|
|
10265
10338
|
},
|
|
10266
10339
|
children: [
|
|
10267
|
-
/* @__PURE__ */
|
|
10340
|
+
/* @__PURE__ */ jsx41(X, { className: "h-3.5 w-3.5" }),
|
|
10268
10341
|
"Clear"
|
|
10269
10342
|
]
|
|
10270
10343
|
}
|
|
10271
10344
|
),
|
|
10272
|
-
/* @__PURE__ */
|
|
10273
|
-
effectiveCopy && selectedRows.length > 0 ? /* @__PURE__ */
|
|
10345
|
+
/* @__PURE__ */ jsxs31("div", { className: "ml-auto flex flex-wrap items-center gap-1.5", children: [
|
|
10346
|
+
effectiveCopy && selectedRows.length > 0 ? /* @__PURE__ */ jsx41(
|
|
10274
10347
|
CopyButtons,
|
|
10275
10348
|
{
|
|
10276
10349
|
size: "icon",
|
|
@@ -10303,9 +10376,9 @@ function MatrxDataTableCore({
|
|
|
10303
10376
|
selection.actions?.(selectedRows, selection.selectedIds)
|
|
10304
10377
|
] })
|
|
10305
10378
|
] }) : null,
|
|
10306
|
-
/* @__PURE__ */
|
|
10307
|
-
/* @__PURE__ */
|
|
10308
|
-
mobileCards ? /* @__PURE__ */
|
|
10379
|
+
/* @__PURE__ */ jsxs31("div", { "data-matrx-table-body-region": true, className: "flex min-h-0 flex-1 flex-col gap-2", children: [
|
|
10380
|
+
/* @__PURE__ */ jsxs31("div", { className: "relative min-h-0 flex-1", children: [
|
|
10381
|
+
mobileCards ? /* @__PURE__ */ jsxs31(
|
|
10309
10382
|
"div",
|
|
10310
10383
|
{
|
|
10311
10384
|
ref: cardsScrollRef,
|
|
@@ -10317,33 +10390,33 @@ function MatrxDataTableCore({
|
|
|
10317
10390
|
mobileCardsClass
|
|
10318
10391
|
),
|
|
10319
10392
|
children: [
|
|
10320
|
-
isFetching && !isLoading && appendQuery === null ? /* @__PURE__ */
|
|
10393
|
+
isFetching && !isLoading && appendQuery === null ? /* @__PURE__ */ jsxs31(
|
|
10321
10394
|
"div",
|
|
10322
10395
|
{
|
|
10323
10396
|
role: "status",
|
|
10324
10397
|
className: "pointer-events-none absolute inset-x-0 top-0 z-20 h-0.5 overflow-hidden bg-primary/15",
|
|
10325
10398
|
children: [
|
|
10326
|
-
/* @__PURE__ */
|
|
10327
|
-
/* @__PURE__ */
|
|
10399
|
+
/* @__PURE__ */ jsx41("div", { className: "h-full w-full animate-pulse bg-primary" }),
|
|
10400
|
+
/* @__PURE__ */ jsx41("span", { className: "sr-only", children: "Refreshing table data" })
|
|
10328
10401
|
]
|
|
10329
10402
|
}
|
|
10330
10403
|
) : null,
|
|
10331
|
-
isLoading ? Array.from({ length: 4 }).map((_, index) => /* @__PURE__ */
|
|
10404
|
+
isLoading ? Array.from({ length: 4 }).map((_, index) => /* @__PURE__ */ jsx41(
|
|
10332
10405
|
Skeleton,
|
|
10333
10406
|
{
|
|
10334
10407
|
className: "h-52 w-full shrink-0 rounded-lg"
|
|
10335
10408
|
},
|
|
10336
10409
|
`mobile-card-sk-${index}`
|
|
10337
|
-
)) : paginated.length === 0 ? /* @__PURE__ */
|
|
10410
|
+
)) : paginated.length === 0 ? /* @__PURE__ */ jsx41("div", { className: "flex min-h-48 flex-1 items-center justify-center px-4 py-12 text-center", children: /* @__PURE__ */ jsxs31("div", { className: "flex max-w-sm flex-col items-center gap-2", children: [
|
|
10338
10411
|
renderedEmptyState?.icon,
|
|
10339
|
-
/* @__PURE__ */
|
|
10340
|
-
renderedEmptyState?.description ? /* @__PURE__ */
|
|
10412
|
+
/* @__PURE__ */ jsx41("p", { className: "text-sm font-medium text-foreground", children: renderedEmptyState?.title ?? "No rows" }),
|
|
10413
|
+
renderedEmptyState?.description ? /* @__PURE__ */ jsx41("p", { className: "text-xs text-muted-foreground", children: renderedEmptyState.description }) : null,
|
|
10341
10414
|
renderedEmptyState?.action
|
|
10342
10415
|
] }) }) : paginated.map((row, index) => {
|
|
10343
10416
|
const id = getRowId(row);
|
|
10344
10417
|
const displayRow = applyRowEdits(row, edits[id]);
|
|
10345
10418
|
const selectable = selection?.isRowSelectable?.(row) ?? Boolean(selection);
|
|
10346
|
-
return /* @__PURE__ */
|
|
10419
|
+
return /* @__PURE__ */ jsx41(Fragment6, { children: mobileCards(displayRow, index, {
|
|
10347
10420
|
renderCell: (columnKey) => {
|
|
10348
10421
|
const column = columns.find((candidate) => columnId(candidate) === columnKey);
|
|
10349
10422
|
return column ? renderRecordCell(row, column, index) : null;
|
|
@@ -10359,14 +10432,14 @@ function MatrxDataTableCore({
|
|
|
10359
10432
|
else next.delete(id);
|
|
10360
10433
|
setSelectedIds(next);
|
|
10361
10434
|
},
|
|
10362
|
-
actions:
|
|
10435
|
+
actions: showInlineRowCopy || rowActions ? /* @__PURE__ */ jsxs31(
|
|
10363
10436
|
"div",
|
|
10364
10437
|
{
|
|
10365
10438
|
"data-matrx-table-row-actions": true,
|
|
10366
10439
|
className: "inline-flex items-center justify-end gap-0",
|
|
10367
10440
|
onClick: (event) => event.stopPropagation(),
|
|
10368
10441
|
children: [
|
|
10369
|
-
|
|
10442
|
+
showInlineRowCopy && effectiveCopy ? /* @__PURE__ */ jsx41(
|
|
10370
10443
|
TableRowCopyControl,
|
|
10371
10444
|
{
|
|
10372
10445
|
size: "toolbar",
|
|
@@ -10376,7 +10449,7 @@ function MatrxDataTableCore({
|
|
|
10376
10449
|
...copy === void 0 ? { defaultColumns: declaredVisibleCopyColumns } : {}
|
|
10377
10450
|
}
|
|
10378
10451
|
) : null,
|
|
10379
|
-
|
|
10452
|
+
renderRowActions(displayRow, {
|
|
10380
10453
|
closeDetail: () => setSelectedId(null),
|
|
10381
10454
|
openDetail: () => openDetail(displayRow),
|
|
10382
10455
|
openWindow: () => openWindow(displayRow),
|
|
@@ -10389,7 +10462,7 @@ function MatrxDataTableCore({
|
|
|
10389
10462
|
) : null
|
|
10390
10463
|
}) }, id);
|
|
10391
10464
|
}),
|
|
10392
|
-
appendQuery !== null && isFetching && !isLoading ? /* @__PURE__ */
|
|
10465
|
+
appendQuery !== null && isFetching && !isLoading ? /* @__PURE__ */ jsxs31(
|
|
10393
10466
|
"div",
|
|
10394
10467
|
{
|
|
10395
10468
|
"data-matrx-table-append-loading-card": true,
|
|
@@ -10397,7 +10470,7 @@ function MatrxDataTableCore({
|
|
|
10397
10470
|
"aria-live": "polite",
|
|
10398
10471
|
className: "sticky bottom-0 z-20 flex h-16 w-full max-w-[100cqw] shrink-0 items-center justify-center gap-2 rounded-md border border-border bg-card/95 px-3 text-sm font-medium text-foreground shadow-sm backdrop-blur-sm",
|
|
10399
10472
|
children: [
|
|
10400
|
-
/* @__PURE__ */
|
|
10473
|
+
/* @__PURE__ */ jsx41(
|
|
10401
10474
|
Loader2,
|
|
10402
10475
|
{
|
|
10403
10476
|
"aria-hidden": "true",
|
|
@@ -10411,7 +10484,7 @@ function MatrxDataTableCore({
|
|
|
10411
10484
|
]
|
|
10412
10485
|
}
|
|
10413
10486
|
) : null,
|
|
10414
|
-
/* @__PURE__ */
|
|
10487
|
+
/* @__PURE__ */ jsxs31(
|
|
10415
10488
|
"div",
|
|
10416
10489
|
{
|
|
10417
10490
|
ref: scrollRef,
|
|
@@ -10425,32 +10498,32 @@ function MatrxDataTableCore({
|
|
|
10425
10498
|
tableClassName
|
|
10426
10499
|
),
|
|
10427
10500
|
children: [
|
|
10428
|
-
hierarchy && draggedRow ? /* @__PURE__ */
|
|
10501
|
+
hierarchy && draggedRow ? /* @__PURE__ */ jsx41(
|
|
10429
10502
|
HierarchyRootDropTarget,
|
|
10430
10503
|
{
|
|
10431
10504
|
label: hierarchy.rootDropLabel ?? "Drop here to move to the top level",
|
|
10432
10505
|
draggedLabel: hierarchy.itemLabel?.(draggedRow) ?? "Moving row"
|
|
10433
10506
|
}
|
|
10434
10507
|
) : null,
|
|
10435
|
-
hierarchy && draggedRowId ? /* @__PURE__ */
|
|
10508
|
+
hierarchy && draggedRowId ? /* @__PURE__ */ jsx41(
|
|
10436
10509
|
HierarchyDragIndicatorLayer,
|
|
10437
10510
|
{
|
|
10438
10511
|
scrollRef,
|
|
10439
10512
|
resolve: resolveHierarchyMove
|
|
10440
10513
|
}
|
|
10441
10514
|
) : null,
|
|
10442
|
-
isFetching && !isLoading && appendQuery === null ? /* @__PURE__ */
|
|
10515
|
+
isFetching && !isLoading && appendQuery === null ? /* @__PURE__ */ jsxs31(
|
|
10443
10516
|
"div",
|
|
10444
10517
|
{
|
|
10445
10518
|
role: "status",
|
|
10446
10519
|
className: "pointer-events-none absolute inset-x-0 top-0 z-20 h-0.5 overflow-hidden bg-primary/15",
|
|
10447
10520
|
children: [
|
|
10448
|
-
/* @__PURE__ */
|
|
10449
|
-
/* @__PURE__ */
|
|
10521
|
+
/* @__PURE__ */ jsx41("div", { className: "h-full w-full animate-pulse bg-primary" }),
|
|
10522
|
+
/* @__PURE__ */ jsx41("span", { className: "sr-only", children: "Refreshing table data" })
|
|
10450
10523
|
]
|
|
10451
10524
|
}
|
|
10452
10525
|
) : null,
|
|
10453
|
-
/* @__PURE__ */
|
|
10526
|
+
/* @__PURE__ */ jsxs31(
|
|
10454
10527
|
"table",
|
|
10455
10528
|
{
|
|
10456
10529
|
ref: tableRef,
|
|
@@ -10468,7 +10541,7 @@ function MatrxDataTableCore({
|
|
|
10468
10541
|
fixedLayoutActive && "sm:table-fixed sm:max-w-none sm:w-[var(--matrx-resized-table-width)]"
|
|
10469
10542
|
),
|
|
10470
10543
|
children: [
|
|
10471
|
-
/* @__PURE__ */
|
|
10544
|
+
/* @__PURE__ */ jsx41(
|
|
10472
10545
|
"thead",
|
|
10473
10546
|
{
|
|
10474
10547
|
ref: tableHeaderRef,
|
|
@@ -10477,14 +10550,14 @@ function MatrxDataTableCore({
|
|
|
10477
10550
|
"z-10 border-b border-border bg-muted/90 shadow-[0_1px_0_0_var(--border)] backdrop-blur-sm",
|
|
10478
10551
|
stickyHeader && (documentStickyHeader ? "relative translate-y-[var(--matrx-document-sticky-offset)]" : "sticky top-0")
|
|
10479
10552
|
),
|
|
10480
|
-
children: /* @__PURE__ */
|
|
10481
|
-
selection ? /* @__PURE__ */
|
|
10553
|
+
children: /* @__PURE__ */ jsxs31("tr", { children: [
|
|
10554
|
+
selection ? /* @__PURE__ */ jsx41(
|
|
10482
10555
|
"th",
|
|
10483
10556
|
{
|
|
10484
10557
|
"data-matrx-table-selection-column": true,
|
|
10485
10558
|
className: "h-9 w-9 px-2 text-left align-middle",
|
|
10486
10559
|
style: fixedUtilityWidth(fixedTableGeometry?.selectionWidth),
|
|
10487
|
-
children: /* @__PURE__ */
|
|
10560
|
+
children: /* @__PURE__ */ jsx41(
|
|
10488
10561
|
"div",
|
|
10489
10562
|
{
|
|
10490
10563
|
"data-matrx-table-selection-target": true,
|
|
@@ -10493,7 +10566,7 @@ function MatrxDataTableCore({
|
|
|
10493
10566
|
event.currentTarget.querySelector('[role="checkbox"]')?.click();
|
|
10494
10567
|
}
|
|
10495
10568
|
},
|
|
10496
|
-
children: /* @__PURE__ */
|
|
10569
|
+
children: /* @__PURE__ */ jsx41(
|
|
10497
10570
|
Checkbox,
|
|
10498
10571
|
{
|
|
10499
10572
|
className: CHECKBOX_TAP_AREA,
|
|
@@ -10515,7 +10588,7 @@ function MatrxDataTableCore({
|
|
|
10515
10588
|
const defaultSortDirection = col.defaultSortDirection ?? "asc";
|
|
10516
10589
|
const isColumnDragShadow = columnDragPreview?.draggedId === id && columnDragPreview.targetId !== null;
|
|
10517
10590
|
const columnResizable = resizableColumns && col.resizable !== false;
|
|
10518
|
-
return /* @__PURE__ */
|
|
10591
|
+
return /* @__PURE__ */ jsxs31(
|
|
10519
10592
|
"th",
|
|
10520
10593
|
{
|
|
10521
10594
|
"data-matrx-table-column-id": id,
|
|
@@ -10545,7 +10618,7 @@ function MatrxDataTableCore({
|
|
|
10545
10618
|
),
|
|
10546
10619
|
style: columnWidthVar(col.width, effectiveColumnWidths[id], id, columnResizable),
|
|
10547
10620
|
children: [
|
|
10548
|
-
/* @__PURE__ */
|
|
10621
|
+
/* @__PURE__ */ jsx41(ColumnHeaderDropZone, { id, enabled: reorderableColumns, children: /* @__PURE__ */ jsx41(
|
|
10549
10622
|
ColumnHeaderCell,
|
|
10550
10623
|
{
|
|
10551
10624
|
label: col.header,
|
|
@@ -10582,7 +10655,7 @@ function MatrxDataTableCore({
|
|
|
10582
10655
|
reorderColumn: reorderableColumns ? { id, label: headerLabel } : void 0
|
|
10583
10656
|
}
|
|
10584
10657
|
) }),
|
|
10585
|
-
columnResizable ? /* @__PURE__ */
|
|
10658
|
+
columnResizable ? /* @__PURE__ */ jsx41(
|
|
10586
10659
|
ColumnResizeHandle,
|
|
10587
10660
|
{
|
|
10588
10661
|
columnId: id,
|
|
@@ -10603,7 +10676,7 @@ function MatrxDataTableCore({
|
|
|
10603
10676
|
id
|
|
10604
10677
|
);
|
|
10605
10678
|
}),
|
|
10606
|
-
showActionsCol && /* @__PURE__ */
|
|
10679
|
+
showActionsCol && /* @__PURE__ */ jsx41(
|
|
10607
10680
|
"th",
|
|
10608
10681
|
{
|
|
10609
10682
|
"data-matrx-table-actions-column": true,
|
|
@@ -10615,10 +10688,10 @@ function MatrxDataTableCore({
|
|
|
10615
10688
|
] })
|
|
10616
10689
|
}
|
|
10617
10690
|
),
|
|
10618
|
-
/* @__PURE__ */
|
|
10619
|
-
isLoading ? Array.from({ length: 6 }).map((_, i) => /* @__PURE__ */
|
|
10620
|
-
selection ? /* @__PURE__ */
|
|
10621
|
-
visibleColumns.map((col) => /* @__PURE__ */
|
|
10691
|
+
/* @__PURE__ */ jsxs31("tbody", { children: [
|
|
10692
|
+
isLoading ? Array.from({ length: 6 }).map((_, i) => /* @__PURE__ */ jsxs31("tr", { className: "border-b border-border/60", children: [
|
|
10693
|
+
selection ? /* @__PURE__ */ jsx41("td", { className: "px-2 py-2", style: fixedUtilityWidth(fixedTableGeometry?.selectionWidth), children: /* @__PURE__ */ jsx41(Skeleton, { className: "h-3.5 w-3.5" }) }) : null,
|
|
10694
|
+
visibleColumns.map((col) => /* @__PURE__ */ jsx41(
|
|
10622
10695
|
"td",
|
|
10623
10696
|
{
|
|
10624
10697
|
className: cn(
|
|
@@ -10626,20 +10699,20 @@ function MatrxDataTableCore({
|
|
|
10626
10699
|
col.compact ? "px-1" : "px-2",
|
|
10627
10700
|
col.mobileHidden && "max-sm:hidden"
|
|
10628
10701
|
),
|
|
10629
|
-
children: /* @__PURE__ */
|
|
10702
|
+
children: /* @__PURE__ */ jsx41(Skeleton, { className: "h-5 w-full" })
|
|
10630
10703
|
},
|
|
10631
10704
|
columnId(col)
|
|
10632
10705
|
)),
|
|
10633
|
-
showActionsCol && /* @__PURE__ */
|
|
10634
|
-
] }, `sk-${i}`)) : paginated.length === 0 ? /* @__PURE__ */
|
|
10706
|
+
showActionsCol && /* @__PURE__ */ jsx41("td", { className: "text-right align-middle", style: fixedUtilityWidth(fixedTableGeometry?.actionsWidth), children: /* @__PURE__ */ jsx41(Skeleton, { className: "ml-auto h-5 w-10" }) })
|
|
10707
|
+
] }, `sk-${i}`)) : paginated.length === 0 ? /* @__PURE__ */ jsx41("tr", { children: /* @__PURE__ */ jsx41(
|
|
10635
10708
|
"td",
|
|
10636
10709
|
{
|
|
10637
10710
|
colSpan: visibleColumns.length + leadingCols + (showActionsCol ? 1 : 0),
|
|
10638
10711
|
className: "px-0 py-12 text-center",
|
|
10639
|
-
children: /* @__PURE__ */
|
|
10712
|
+
children: /* @__PURE__ */ jsxs31("div", { "data-matrx-table-empty-state": true, className: "sticky left-0 flex flex-col items-center gap-2 whitespace-normal px-4", style: { width: "100cqw", maxWidth: "100%" }, children: [
|
|
10640
10713
|
renderedEmptyState?.icon,
|
|
10641
|
-
/* @__PURE__ */
|
|
10642
|
-
renderedEmptyState?.description ? /* @__PURE__ */
|
|
10714
|
+
/* @__PURE__ */ jsx41("p", { className: "text-sm font-medium text-foreground", children: renderedEmptyState?.title ?? "No rows" }),
|
|
10715
|
+
renderedEmptyState?.description ? /* @__PURE__ */ jsx41("p", { className: "text-xs text-muted-foreground", children: renderedEmptyState.description }) : null,
|
|
10643
10716
|
renderedEmptyState?.action
|
|
10644
10717
|
] })
|
|
10645
10718
|
}
|
|
@@ -10649,7 +10722,7 @@ function MatrxDataTableCore({
|
|
|
10649
10722
|
const rowEdits = edits[id];
|
|
10650
10723
|
const displayRow = applyRowEdits(row, rowEdits);
|
|
10651
10724
|
const isChecked = selectedIdSet.has(id);
|
|
10652
|
-
const rowNode = /* @__PURE__ */
|
|
10725
|
+
const rowNode = /* @__PURE__ */ jsxs31(
|
|
10653
10726
|
"tr",
|
|
10654
10727
|
{
|
|
10655
10728
|
"data-row-id": id,
|
|
@@ -10672,13 +10745,13 @@ function MatrxDataTableCore({
|
|
|
10672
10745
|
zebra && index % 2 === 1 && !isSelected && !isChecked && "sm:bg-muted/20"
|
|
10673
10746
|
),
|
|
10674
10747
|
children: [
|
|
10675
|
-
selection ? /* @__PURE__ */
|
|
10748
|
+
selection ? /* @__PURE__ */ jsx41(
|
|
10676
10749
|
"td",
|
|
10677
10750
|
{
|
|
10678
10751
|
className: "px-2 py-1.5 align-middle lg:py-0.5",
|
|
10679
10752
|
style: fixedUtilityWidth(fixedTableGeometry?.selectionWidth),
|
|
10680
10753
|
onClick: (e) => e.stopPropagation(),
|
|
10681
|
-
children: selection.isRowSelectable?.(row) ?? true ? /* @__PURE__ */
|
|
10754
|
+
children: selection.isRowSelectable?.(row) ?? true ? /* @__PURE__ */ jsx41(
|
|
10682
10755
|
"div",
|
|
10683
10756
|
{
|
|
10684
10757
|
"data-matrx-table-selection-target": true,
|
|
@@ -10687,7 +10760,7 @@ function MatrxDataTableCore({
|
|
|
10687
10760
|
event.currentTarget.querySelector('[role="checkbox"]')?.click();
|
|
10688
10761
|
}
|
|
10689
10762
|
},
|
|
10690
|
-
children: /* @__PURE__ */
|
|
10763
|
+
children: /* @__PURE__ */ jsx41(
|
|
10691
10764
|
Checkbox,
|
|
10692
10765
|
{
|
|
10693
10766
|
className: CHECKBOX_TAP_AREA,
|
|
@@ -10702,7 +10775,7 @@ function MatrxDataTableCore({
|
|
|
10702
10775
|
) : null,
|
|
10703
10776
|
visibleColumns.map((col, colIdx) => {
|
|
10704
10777
|
const isColumnDragShadow = columnDragPreview?.draggedId === columnId(col) && columnDragPreview.targetId !== null;
|
|
10705
|
-
return /* @__PURE__ */
|
|
10778
|
+
return /* @__PURE__ */ jsx41(
|
|
10706
10779
|
"td",
|
|
10707
10780
|
{
|
|
10708
10781
|
"data-matrx-table-column-id": columnId(col),
|
|
@@ -10726,14 +10799,14 @@ function MatrxDataTableCore({
|
|
|
10726
10799
|
columnId(col),
|
|
10727
10800
|
resizableColumns && col.resizable !== false
|
|
10728
10801
|
),
|
|
10729
|
-
children: /* @__PURE__ */
|
|
10802
|
+
children: /* @__PURE__ */ jsxs31(
|
|
10730
10803
|
"div",
|
|
10731
10804
|
{
|
|
10732
10805
|
className: cn(
|
|
10733
10806
|
colIdx === 0 && hierarchy && "flex min-w-0 items-center"
|
|
10734
10807
|
),
|
|
10735
10808
|
children: [
|
|
10736
|
-
colIdx === 0 && hierarchy ? /* @__PURE__ */
|
|
10809
|
+
colIdx === 0 && hierarchy ? /* @__PURE__ */ jsx41(
|
|
10737
10810
|
HierarchyDragHandle,
|
|
10738
10811
|
{
|
|
10739
10812
|
id,
|
|
@@ -10741,7 +10814,7 @@ function MatrxDataTableCore({
|
|
|
10741
10814
|
disabled: !(hierarchy.canReparent?.(row) ?? true)
|
|
10742
10815
|
}
|
|
10743
10816
|
) : null,
|
|
10744
|
-
/* @__PURE__ */
|
|
10817
|
+
/* @__PURE__ */ jsx41(
|
|
10745
10818
|
"div",
|
|
10746
10819
|
{
|
|
10747
10820
|
"data-matrx-cell-content": true,
|
|
@@ -10756,20 +10829,20 @@ function MatrxDataTableCore({
|
|
|
10756
10829
|
columnId(col)
|
|
10757
10830
|
);
|
|
10758
10831
|
}),
|
|
10759
|
-
showActionsCol && /* @__PURE__ */
|
|
10832
|
+
showActionsCol && /* @__PURE__ */ jsx41(
|
|
10760
10833
|
"td",
|
|
10761
10834
|
{
|
|
10762
10835
|
"data-matrx-table-row-action-cell": true,
|
|
10763
10836
|
className: "text-right align-middle",
|
|
10764
10837
|
style: fixedUtilityWidth(fixedTableGeometry?.actionsWidth),
|
|
10765
|
-
children: /* @__PURE__ */
|
|
10838
|
+
children: /* @__PURE__ */ jsxs31(
|
|
10766
10839
|
"div",
|
|
10767
10840
|
{
|
|
10768
10841
|
"data-matrx-table-row-actions": true,
|
|
10769
10842
|
className: "inline-flex items-center justify-end gap-0",
|
|
10770
10843
|
onClick: (e) => e.stopPropagation(),
|
|
10771
10844
|
children: [
|
|
10772
|
-
|
|
10845
|
+
showInlineRowCopy && effectiveCopy ? /* @__PURE__ */ jsx41(
|
|
10773
10846
|
TableRowCopyControl,
|
|
10774
10847
|
{
|
|
10775
10848
|
size: "toolbar",
|
|
@@ -10779,7 +10852,7 @@ function MatrxDataTableCore({
|
|
|
10779
10852
|
...copy === void 0 ? { defaultColumns: declaredVisibleCopyColumns } : {}
|
|
10780
10853
|
}
|
|
10781
10854
|
) : null,
|
|
10782
|
-
|
|
10855
|
+
renderRowActions(displayRow, {
|
|
10783
10856
|
closeDetail: () => setSelectedId(null),
|
|
10784
10857
|
openDetail: () => openDetail(displayRow),
|
|
10785
10858
|
openWindow: () => openWindow(displayRow),
|
|
@@ -10787,8 +10860,8 @@ function MatrxDataTableCore({
|
|
|
10787
10860
|
hasPendingEdits: Boolean(rowEdits),
|
|
10788
10861
|
discardPendingEdits: () => discardRowEdits(id)
|
|
10789
10862
|
}),
|
|
10790
|
-
windowEnabled ? /* @__PURE__ */
|
|
10791
|
-
/* @__PURE__ */
|
|
10863
|
+
windowEnabled ? /* @__PURE__ */ jsxs31(Tooltip, { children: [
|
|
10864
|
+
/* @__PURE__ */ jsx41(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx41(
|
|
10792
10865
|
Button,
|
|
10793
10866
|
{
|
|
10794
10867
|
type: "button",
|
|
@@ -10802,10 +10875,10 @@ function MatrxDataTableCore({
|
|
|
10802
10875
|
if (windowConfig?.openOnRowClick === true) openDetail(row);
|
|
10803
10876
|
else openWindow(row);
|
|
10804
10877
|
},
|
|
10805
|
-
children: opensWindowOnRowClick ? /* @__PURE__ */
|
|
10878
|
+
children: opensWindowOnRowClick ? /* @__PURE__ */ jsx41(PanelRightOpen, { className: "h-5 w-5" }) : /* @__PURE__ */ jsx41(PanelRight, { className: "h-5 w-5" })
|
|
10806
10879
|
}
|
|
10807
10880
|
) }),
|
|
10808
|
-
/* @__PURE__ */
|
|
10881
|
+
/* @__PURE__ */ jsx41(TooltipContent, { children: windowConfig?.openOnRowClick === true ? "Open in side panel" : "Open in window" })
|
|
10809
10882
|
] }) : null
|
|
10810
10883
|
]
|
|
10811
10884
|
}
|
|
@@ -10817,7 +10890,7 @@ function MatrxDataTableCore({
|
|
|
10817
10890
|
id
|
|
10818
10891
|
);
|
|
10819
10892
|
const wrappedRow = rowWrapper ? rowWrapper(row, rowNode) : rowNode;
|
|
10820
|
-
return hierarchy ? /* @__PURE__ */
|
|
10893
|
+
return hierarchy ? /* @__PURE__ */ jsx41(
|
|
10821
10894
|
HierarchyDroppableRow,
|
|
10822
10895
|
{
|
|
10823
10896
|
id,
|
|
@@ -10825,21 +10898,21 @@ function MatrxDataTableCore({
|
|
|
10825
10898
|
children: wrappedRow
|
|
10826
10899
|
},
|
|
10827
10900
|
id
|
|
10828
|
-
) : /* @__PURE__ */
|
|
10901
|
+
) : /* @__PURE__ */ jsx41(Fragment6, { children: wrappedRow }, id);
|
|
10829
10902
|
}),
|
|
10830
|
-
appendQuery !== null && isFetching && !isLoading ? /* @__PURE__ */
|
|
10903
|
+
appendQuery !== null && isFetching && !isLoading ? /* @__PURE__ */ jsx41("tr", { "data-matrx-table-append-loading-row": true, children: /* @__PURE__ */ jsx41(
|
|
10831
10904
|
"td",
|
|
10832
10905
|
{
|
|
10833
10906
|
colSpan: visibleColumns.length + leadingCols + (showActionsCol ? 1 : 0),
|
|
10834
10907
|
className: "sticky bottom-0 z-20 h-16 border-y border-border bg-card/95 px-0 py-0 text-left shadow-sm backdrop-blur-sm",
|
|
10835
|
-
children: /* @__PURE__ */
|
|
10908
|
+
children: /* @__PURE__ */ jsxs31(
|
|
10836
10909
|
"div",
|
|
10837
10910
|
{
|
|
10838
10911
|
role: "status",
|
|
10839
10912
|
"aria-live": "polite",
|
|
10840
10913
|
className: "sticky left-0 flex h-16 w-fit max-w-[100cqw] items-center justify-center gap-2 px-3 text-sm font-medium text-foreground",
|
|
10841
10914
|
children: [
|
|
10842
|
-
/* @__PURE__ */
|
|
10915
|
+
/* @__PURE__ */ jsx41(
|
|
10843
10916
|
Loader2,
|
|
10844
10917
|
{
|
|
10845
10918
|
"aria-hidden": "true",
|
|
@@ -10853,9 +10926,9 @@ function MatrxDataTableCore({
|
|
|
10853
10926
|
}
|
|
10854
10927
|
) }) : null
|
|
10855
10928
|
] }),
|
|
10856
|
-
footerRows.length > 0 ? /* @__PURE__ */
|
|
10857
|
-
selection ? /* @__PURE__ */
|
|
10858
|
-
visibleColumns.map((column) => /* @__PURE__ */
|
|
10929
|
+
footerRows.length > 0 ? /* @__PURE__ */ jsx41("tfoot", { className: "border-t-2 border-border bg-muted/50 font-semibold", children: footerRows.map((row, index) => /* @__PURE__ */ jsxs31("tr", { children: [
|
|
10930
|
+
selection ? /* @__PURE__ */ jsx41("td", { className: "px-2 py-2" }) : null,
|
|
10931
|
+
visibleColumns.map((column) => /* @__PURE__ */ jsx41(
|
|
10859
10932
|
"td",
|
|
10860
10933
|
{
|
|
10861
10934
|
className: cn(
|
|
@@ -10875,7 +10948,7 @@ function MatrxDataTableCore({
|
|
|
10875
10948
|
},
|
|
10876
10949
|
columnId(column)
|
|
10877
10950
|
)),
|
|
10878
|
-
showActionsCol ? /* @__PURE__ */
|
|
10951
|
+
showActionsCol ? /* @__PURE__ */ jsx41("td", {}) : null
|
|
10879
10952
|
] }, `footer-${index}`)) }) : null
|
|
10880
10953
|
]
|
|
10881
10954
|
}
|
|
@@ -10883,8 +10956,8 @@ function MatrxDataTableCore({
|
|
|
10883
10956
|
]
|
|
10884
10957
|
}
|
|
10885
10958
|
),
|
|
10886
|
-
scrollHintLeft ? /* @__PURE__ */
|
|
10887
|
-
/* @__PURE__ */
|
|
10959
|
+
scrollHintLeft ? /* @__PURE__ */ jsxs31(Tooltip, { children: [
|
|
10960
|
+
/* @__PURE__ */ jsx41(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx41(
|
|
10888
10961
|
Button,
|
|
10889
10962
|
{
|
|
10890
10963
|
type: "button",
|
|
@@ -10895,13 +10968,13 @@ function MatrxDataTableCore({
|
|
|
10895
10968
|
"data-matrx-table-scroll-control": "left",
|
|
10896
10969
|
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",
|
|
10897
10970
|
onClick: () => scrollTableHorizontally("left"),
|
|
10898
|
-
children: /* @__PURE__ */
|
|
10971
|
+
children: /* @__PURE__ */ jsx41(ChevronLeft, { className: "h-5 w-5" })
|
|
10899
10972
|
}
|
|
10900
10973
|
) }),
|
|
10901
|
-
/* @__PURE__ */
|
|
10974
|
+
/* @__PURE__ */ jsx41(TooltipContent, { children: "More columns to the left" })
|
|
10902
10975
|
] }) : null,
|
|
10903
|
-
scrollHintRight ? /* @__PURE__ */
|
|
10904
|
-
/* @__PURE__ */
|
|
10976
|
+
scrollHintRight ? /* @__PURE__ */ jsxs31(Tooltip, { children: [
|
|
10977
|
+
/* @__PURE__ */ jsx41(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx41(
|
|
10905
10978
|
Button,
|
|
10906
10979
|
{
|
|
10907
10980
|
type: "button",
|
|
@@ -10912,26 +10985,26 @@ function MatrxDataTableCore({
|
|
|
10912
10985
|
"data-matrx-table-scroll-control": "right",
|
|
10913
10986
|
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",
|
|
10914
10987
|
onClick: () => scrollTableHorizontally("right"),
|
|
10915
|
-
children: /* @__PURE__ */
|
|
10988
|
+
children: /* @__PURE__ */ jsx41(ChevronRight, { className: "h-5 w-5" })
|
|
10916
10989
|
}
|
|
10917
10990
|
) }),
|
|
10918
|
-
/* @__PURE__ */
|
|
10991
|
+
/* @__PURE__ */ jsx41(TooltipContent, { children: "More columns to the right" })
|
|
10919
10992
|
] }) : null
|
|
10920
10993
|
] }),
|
|
10921
|
-
appendQuery ? /* @__PURE__ */
|
|
10994
|
+
appendQuery ? /* @__PURE__ */ jsxs31(
|
|
10922
10995
|
"div",
|
|
10923
10996
|
{
|
|
10924
10997
|
"data-matrx-table-footer": true,
|
|
10925
10998
|
className: "flex min-h-11 shrink-0 flex-wrap items-center gap-0 border-t border-border",
|
|
10926
10999
|
"aria-busy": isLoading || isFetching,
|
|
10927
11000
|
children: [
|
|
10928
|
-
/* @__PURE__ */
|
|
11001
|
+
/* @__PURE__ */ jsxs31(
|
|
10929
11002
|
"div",
|
|
10930
11003
|
{
|
|
10931
11004
|
...isFetching && !isLoading ? {} : { role: "status", "aria-live": "polite" },
|
|
10932
11005
|
className: "flex w-full min-w-0 items-center gap-2 text-xs text-muted-foreground sm:w-auto sm:flex-1 sm:text-sm",
|
|
10933
11006
|
children: [
|
|
10934
|
-
isLoading ? /* @__PURE__ */
|
|
11007
|
+
isLoading ? /* @__PURE__ */ jsx41(
|
|
10935
11008
|
Loader2,
|
|
10936
11009
|
{
|
|
10937
11010
|
"data-matrx-table-append-loader": true,
|
|
@@ -10939,17 +11012,17 @@ function MatrxDataTableCore({
|
|
|
10939
11012
|
className: "h-5 w-5 shrink-0 animate-spin text-primary motion-reduce:animate-none"
|
|
10940
11013
|
}
|
|
10941
11014
|
) : null,
|
|
10942
|
-
/* @__PURE__ */
|
|
10943
|
-
/* @__PURE__ */
|
|
10944
|
-
appendQuery.pagination.sourceUntil ? /* @__PURE__ */
|
|
11015
|
+
/* @__PURE__ */ jsxs31("div", { className: "min-w-0 flex-1", children: [
|
|
11016
|
+
/* @__PURE__ */ jsx41("p", { className: "font-medium text-foreground", children: isLoading ? "Loading rows\u2026" : `${formatCount3(data.length)} loaded${appendQuery.pagination.totalItems === void 0 ? "" : ` of ${formatCount3(appendQuery.pagination.totalItems)}`}` }),
|
|
11017
|
+
appendQuery.pagination.sourceUntil ? /* @__PURE__ */ jsxs31("p", { children: [
|
|
10945
11018
|
"Source fixed through",
|
|
10946
11019
|
" ",
|
|
10947
11020
|
new Date(appendQuery.pagination.sourceUntil).toLocaleString(),
|
|
10948
11021
|
"."
|
|
10949
11022
|
] }) : null,
|
|
10950
|
-
!isLoading && !isFetching && !appendQuery.pagination.loadAll?.isLoading && !scrollPagination.error && !appendQuery.pagination.hasNextPage && appendQuery.pagination.totalItems !== void 0 && data.length === appendQuery.pagination.totalItems ? /* @__PURE__ */
|
|
10951
|
-
scrollPagination.error ? /* @__PURE__ */
|
|
10952
|
-
appendScrollPolicy?.mode === "suspended" ? /* @__PURE__ */
|
|
11023
|
+
!isLoading && !isFetching && !appendQuery.pagination.loadAll?.isLoading && !scrollPagination.error && !appendQuery.pagination.hasNextPage && appendQuery.pagination.totalItems !== void 0 && data.length === appendQuery.pagination.totalItems ? /* @__PURE__ */ jsx41("p", { children: "All source rows are loaded." }) : appendUsesLocalProcessing ? /* @__PURE__ */ jsx41("p", { children: "Local search and filters cover loaded rows." }) : null,
|
|
11024
|
+
scrollPagination.error ? /* @__PURE__ */ jsx41("p", { role: "alert", className: "text-destructive", children: scrollPagination.error.message }) : null,
|
|
11025
|
+
appendScrollPolicy?.mode === "suspended" ? /* @__PURE__ */ jsxs31("p", { role: "status", children: [
|
|
10953
11026
|
appendScrollPolicy.reason,
|
|
10954
11027
|
" Load more remains available."
|
|
10955
11028
|
] }) : null
|
|
@@ -10957,26 +11030,26 @@ function MatrxDataTableCore({
|
|
|
10957
11030
|
]
|
|
10958
11031
|
}
|
|
10959
11032
|
),
|
|
10960
|
-
appendQuery.pagination.sourcePageSize ? /* @__PURE__ */
|
|
11033
|
+
appendQuery.pagination.sourcePageSize ? /* @__PURE__ */ jsxs31(
|
|
10961
11034
|
Select,
|
|
10962
11035
|
{
|
|
10963
11036
|
value: String(appendQuery.pagination.sourcePageSize.value),
|
|
10964
11037
|
onValueChange: (value) => appendQuery.pagination.sourcePageSize?.onChange(Number(value)),
|
|
10965
11038
|
children: [
|
|
10966
|
-
/* @__PURE__ */
|
|
11039
|
+
/* @__PURE__ */ jsx41(
|
|
10967
11040
|
SelectTrigger,
|
|
10968
11041
|
{
|
|
10969
11042
|
"aria-label": "Rows per load",
|
|
10970
11043
|
className: "h-11 min-w-20 shrink-0 rounded-md border border-border bg-card px-3 text-sm [&_svg]:size-5",
|
|
10971
11044
|
disabled: isLoading || isFetching || appendQuery.pagination.loadAll?.isLoading,
|
|
10972
|
-
children: /* @__PURE__ */
|
|
11045
|
+
children: /* @__PURE__ */ jsx41(SelectValue, {})
|
|
10973
11046
|
}
|
|
10974
11047
|
),
|
|
10975
|
-
/* @__PURE__ */
|
|
11048
|
+
/* @__PURE__ */ jsx41(SelectContent, { children: appendQuery.pagination.sourcePageSize.options.map((size) => /* @__PURE__ */ jsx41(SelectItem, { value: String(size), children: size }, size)) })
|
|
10976
11049
|
]
|
|
10977
11050
|
}
|
|
10978
11051
|
) : null,
|
|
10979
|
-
appendQuery.pagination.loadAll?.isLoading ? /* @__PURE__ */
|
|
11052
|
+
appendQuery.pagination.loadAll?.isLoading ? /* @__PURE__ */ jsx41(
|
|
10980
11053
|
Button,
|
|
10981
11054
|
{
|
|
10982
11055
|
type: "button",
|
|
@@ -10985,7 +11058,7 @@ function MatrxDataTableCore({
|
|
|
10985
11058
|
onClick: appendQuery.pagination.loadAll.stop,
|
|
10986
11059
|
children: "Stop loading"
|
|
10987
11060
|
}
|
|
10988
|
-
) : scrollPagination.error ? /* @__PURE__ */
|
|
11061
|
+
) : scrollPagination.error ? /* @__PURE__ */ jsx41(
|
|
10989
11062
|
Button,
|
|
10990
11063
|
{
|
|
10991
11064
|
type: "button",
|
|
@@ -10994,8 +11067,8 @@ function MatrxDataTableCore({
|
|
|
10994
11067
|
onClick: appendQuery.pagination.retrySource ?? (appendQuery.pagination.hasNextPage ? appendQuery.pagination.loadNextPage : appendQuery.pagination.refresh),
|
|
10995
11068
|
children: appendQuery.pagination.retrySource ? "Retry source" : appendQuery.pagination.hasNextPage ? "Retry" : "Reload rows"
|
|
10996
11069
|
}
|
|
10997
|
-
) : appendQuery.pagination.hasNextPage || scrollPagination.error ? /* @__PURE__ */
|
|
10998
|
-
/* @__PURE__ */
|
|
11070
|
+
) : appendQuery.pagination.hasNextPage || scrollPagination.error ? /* @__PURE__ */ jsxs31("div", { className: "flex min-w-0 max-w-full flex-wrap gap-0", children: [
|
|
11071
|
+
/* @__PURE__ */ jsx41(
|
|
10999
11072
|
Button,
|
|
11000
11073
|
{
|
|
11001
11074
|
type: "button",
|
|
@@ -11006,7 +11079,7 @@ function MatrxDataTableCore({
|
|
|
11006
11079
|
children: "Load more"
|
|
11007
11080
|
}
|
|
11008
11081
|
),
|
|
11009
|
-
appendQuery.pagination.loadAll ? /* @__PURE__ */
|
|
11082
|
+
appendQuery.pagination.loadAll ? /* @__PURE__ */ jsx41(
|
|
11010
11083
|
Button,
|
|
11011
11084
|
{
|
|
11012
11085
|
type: "button",
|
|
@@ -11017,10 +11090,10 @@ function MatrxDataTableCore({
|
|
|
11017
11090
|
children: "Load all"
|
|
11018
11091
|
}
|
|
11019
11092
|
) : null
|
|
11020
|
-
] }) : !isLoading && appendQuery.pagination.totalItems !== void 0 && data.length === appendQuery.pagination.totalItems ? /* @__PURE__ */
|
|
11093
|
+
] }) : !isLoading && appendQuery.pagination.totalItems !== void 0 && data.length === appendQuery.pagination.totalItems ? /* @__PURE__ */ jsx41("span", { className: "min-w-0 max-w-full break-words whitespace-normal px-3 text-xs text-muted-foreground sm:text-sm", children: "All rows loaded" }) : null
|
|
11021
11094
|
]
|
|
11022
11095
|
}
|
|
11023
|
-
) : !hidePagination && totalItems > 0 ? /* @__PURE__ */
|
|
11096
|
+
) : !hidePagination && totalItems > 0 ? /* @__PURE__ */ jsx41("div", { className: "shrink-0", children: /* @__PURE__ */ jsx41(
|
|
11024
11097
|
GenericTablePagination,
|
|
11025
11098
|
{
|
|
11026
11099
|
totalItems,
|
|
@@ -11046,7 +11119,7 @@ function MatrxDataTableCore({
|
|
|
11046
11119
|
}
|
|
11047
11120
|
) }) : null
|
|
11048
11121
|
] }),
|
|
11049
|
-
/* @__PURE__ */
|
|
11122
|
+
/* @__PURE__ */ jsx41(
|
|
11050
11123
|
ColumnManager,
|
|
11051
11124
|
{
|
|
11052
11125
|
open: columnManagerOpen,
|
|
@@ -11057,7 +11130,7 @@ function MatrxDataTableCore({
|
|
|
11057
11130
|
onApply: commitColumnState
|
|
11058
11131
|
}
|
|
11059
11132
|
),
|
|
11060
|
-
detailEnabled && selectedRow ? /* @__PURE__ */
|
|
11133
|
+
detailEnabled && selectedRow ? /* @__PURE__ */ jsx41(
|
|
11061
11134
|
SidePanelSurface,
|
|
11062
11135
|
{
|
|
11063
11136
|
title: resolveStringTitle(
|
|
@@ -11068,8 +11141,8 @@ function MatrxDataTableCore({
|
|
|
11068
11141
|
description: detail?.description?.(selectedRow),
|
|
11069
11142
|
onClose: () => setSelectedId(null),
|
|
11070
11143
|
defaultWidth: detail?.defaultWidth ?? 480,
|
|
11071
|
-
headerActions: /* @__PURE__ */
|
|
11072
|
-
effectiveCopy && showRowCopy ? /* @__PURE__ */
|
|
11144
|
+
headerActions: /* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-1", children: [
|
|
11145
|
+
effectiveCopy && showRowCopy ? /* @__PURE__ */ jsx41(
|
|
11073
11146
|
TableRowCopyControl,
|
|
11074
11147
|
{
|
|
11075
11148
|
size: "icon",
|
|
@@ -11081,8 +11154,8 @@ function MatrxDataTableCore({
|
|
|
11081
11154
|
}
|
|
11082
11155
|
) : null,
|
|
11083
11156
|
detail?.headerActions?.(selectedRow),
|
|
11084
|
-
windowEnabled ? /* @__PURE__ */
|
|
11085
|
-
/* @__PURE__ */
|
|
11157
|
+
windowEnabled ? /* @__PURE__ */ jsxs31(Tooltip, { children: [
|
|
11158
|
+
/* @__PURE__ */ jsx41(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx41(
|
|
11086
11159
|
Button,
|
|
11087
11160
|
{
|
|
11088
11161
|
type: "button",
|
|
@@ -11092,10 +11165,10 @@ function MatrxDataTableCore({
|
|
|
11092
11165
|
className: "h-7 w-7",
|
|
11093
11166
|
"aria-label": "Open in window",
|
|
11094
11167
|
onClick: () => openWindow(selectedRow),
|
|
11095
|
-
children: /* @__PURE__ */
|
|
11168
|
+
children: /* @__PURE__ */ jsx41(PanelRight, { className: "h-5 w-5" })
|
|
11096
11169
|
}
|
|
11097
11170
|
) }),
|
|
11098
|
-
/* @__PURE__ */
|
|
11171
|
+
/* @__PURE__ */ jsx41(TooltipContent, { children: "Open in window" })
|
|
11099
11172
|
] }) : null
|
|
11100
11173
|
] }),
|
|
11101
11174
|
children: detail?.render ? (
|
|
@@ -11106,7 +11179,7 @@ function MatrxDataTableCore({
|
|
|
11106
11179
|
// fixes the whole class at once — a custom body that already
|
|
11107
11180
|
// scrolls (`h-full` + `overflow-y-auto` root) still resolves to
|
|
11108
11181
|
// this container's height, so no second scrollbar appears.
|
|
11109
|
-
/* @__PURE__ */
|
|
11182
|
+
/* @__PURE__ */ jsx41("div", { className: "h-full min-h-0 overflow-y-auto", children: detail.render(selectedRow, {
|
|
11110
11183
|
closeDetail: () => setSelectedId(null),
|
|
11111
11184
|
openDetail: () => openDetail(selectedRow),
|
|
11112
11185
|
openWindow: () => openWindow(selectedRow),
|
|
@@ -11114,7 +11187,7 @@ function MatrxDataTableCore({
|
|
|
11114
11187
|
hasPendingEdits: Boolean(edits[getRowId(selectedRow)]),
|
|
11115
11188
|
discardPendingEdits: () => discardRowEdits(getRowId(selectedRow))
|
|
11116
11189
|
}) })
|
|
11117
|
-
) : /* @__PURE__ */
|
|
11190
|
+
) : /* @__PURE__ */ jsx41(
|
|
11118
11191
|
DataRowInspector,
|
|
11119
11192
|
{
|
|
11120
11193
|
row: selectedRow,
|
|
@@ -11126,7 +11199,7 @@ function MatrxDataTableCore({
|
|
|
11126
11199
|
)
|
|
11127
11200
|
}
|
|
11128
11201
|
) : null,
|
|
11129
|
-
windowRow ? /* @__PURE__ */
|
|
11202
|
+
windowRow ? /* @__PURE__ */ jsx41(
|
|
11130
11203
|
DataRowWindow,
|
|
11131
11204
|
{
|
|
11132
11205
|
isOpen: true,
|
|
@@ -11137,9 +11210,9 @@ function MatrxDataTableCore({
|
|
|
11137
11210
|
height: windowConfig?.height,
|
|
11138
11211
|
windowId: `matrx-data-row-${urlState?.id ?? "local"}-${getRowId(windowRow)}`,
|
|
11139
11212
|
defaultTab: windowConfig?.defaultTab,
|
|
11140
|
-
headerActions: /* @__PURE__ */
|
|
11141
|
-
windowConfig?.openOnRowClick === true && detail?.enabled === true ? /* @__PURE__ */
|
|
11142
|
-
/* @__PURE__ */
|
|
11213
|
+
headerActions: /* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-1", children: [
|
|
11214
|
+
windowConfig?.openOnRowClick === true && detail?.enabled === true ? /* @__PURE__ */ jsxs31(Tooltip, { children: [
|
|
11215
|
+
/* @__PURE__ */ jsx41(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx41(
|
|
11143
11216
|
Button,
|
|
11144
11217
|
{
|
|
11145
11218
|
type: "button",
|
|
@@ -11152,12 +11225,12 @@ function MatrxDataTableCore({
|
|
|
11152
11225
|
closeWindow();
|
|
11153
11226
|
openDetail(windowRow);
|
|
11154
11227
|
},
|
|
11155
|
-
children: /* @__PURE__ */
|
|
11228
|
+
children: /* @__PURE__ */ jsx41(PanelRightOpen, { className: "h-5 w-5" })
|
|
11156
11229
|
}
|
|
11157
11230
|
) }),
|
|
11158
|
-
/* @__PURE__ */
|
|
11231
|
+
/* @__PURE__ */ jsx41(TooltipContent, { children: "Open in side panel" })
|
|
11159
11232
|
] }) : null,
|
|
11160
|
-
effectiveCopy && showRowCopy ? /* @__PURE__ */
|
|
11233
|
+
effectiveCopy && showRowCopy ? /* @__PURE__ */ jsx41(
|
|
11161
11234
|
TableRowCopyControl,
|
|
11162
11235
|
{
|
|
11163
11236
|
size: "icon",
|
|
@@ -11176,7 +11249,7 @@ function MatrxDataTableCore({
|
|
|
11176
11249
|
closeWindow,
|
|
11177
11250
|
hasPendingEdits: Boolean(edits[getRowId(windowRow)]),
|
|
11178
11251
|
discardPendingEdits: () => discardRowEdits(getRowId(windowRow))
|
|
11179
|
-
}) ?? /* @__PURE__ */
|
|
11252
|
+
}) ?? /* @__PURE__ */ jsx41(
|
|
11180
11253
|
DataRowInspector,
|
|
11181
11254
|
{
|
|
11182
11255
|
row: windowRow,
|
|
@@ -11212,15 +11285,15 @@ function MatrxDataTableCore({
|
|
|
11212
11285
|
})
|
|
11213
11286
|
}
|
|
11214
11287
|
) : null,
|
|
11215
|
-
editEnabled ? /* @__PURE__ */
|
|
11216
|
-
foreignDrafts.length > 0 ? /* @__PURE__ */
|
|
11288
|
+
editEnabled ? /* @__PURE__ */ jsxs31(Fragment7, { children: [
|
|
11289
|
+
foreignDrafts.length > 0 ? /* @__PURE__ */ jsxs31(
|
|
11217
11290
|
"div",
|
|
11218
11291
|
{
|
|
11219
11292
|
"data-matrx-foreign-drafts": true,
|
|
11220
11293
|
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",
|
|
11221
11294
|
children: [
|
|
11222
|
-
/* @__PURE__ */
|
|
11223
|
-
/* @__PURE__ */
|
|
11295
|
+
/* @__PURE__ */ jsx41("span", { children: "Unsaved edits from previous results" }),
|
|
11296
|
+
/* @__PURE__ */ jsx41(
|
|
11224
11297
|
CopyButtons,
|
|
11225
11298
|
{
|
|
11226
11299
|
size: "xs",
|
|
@@ -11229,11 +11302,11 @@ function MatrxDataTableCore({
|
|
|
11229
11302
|
json: () => foreignDraftPayload
|
|
11230
11303
|
}
|
|
11231
11304
|
),
|
|
11232
|
-
/* @__PURE__ */
|
|
11305
|
+
/* @__PURE__ */ jsx41(Button, { type: "button", size: "sm", variant: "ghost", className: "h-7 text-xs text-destructive", onClick: () => setConfirmForeignDraftDiscard(true), children: "Discard drafts" })
|
|
11233
11306
|
]
|
|
11234
11307
|
}
|
|
11235
11308
|
) : null,
|
|
11236
|
-
/* @__PURE__ */
|
|
11309
|
+
/* @__PURE__ */ jsx41(
|
|
11237
11310
|
ConfirmDialog,
|
|
11238
11311
|
{
|
|
11239
11312
|
open: confirmForeignDraftDiscard,
|
|
@@ -11253,7 +11326,7 @@ function MatrxDataTableCore({
|
|
|
11253
11326
|
}
|
|
11254
11327
|
}
|
|
11255
11328
|
),
|
|
11256
|
-
/* @__PURE__ */
|
|
11329
|
+
/* @__PURE__ */ jsx41(
|
|
11257
11330
|
DirtySavePill,
|
|
11258
11331
|
{
|
|
11259
11332
|
changeCount,
|
|
@@ -11266,11 +11339,11 @@ function MatrxDataTableCore({
|
|
|
11266
11339
|
]
|
|
11267
11340
|
}
|
|
11268
11341
|
),
|
|
11269
|
-
/* @__PURE__ */
|
|
11342
|
+
/* @__PURE__ */ jsx41(DragOverlay, { children: draggedRow ? (
|
|
11270
11343
|
// w-max: the overlay inherits the ACTIVE node's size, and the active
|
|
11271
11344
|
// node is the 16px grip handle — without it the label wraps to one
|
|
11272
11345
|
// character per line.
|
|
11273
|
-
/* @__PURE__ */
|
|
11346
|
+
/* @__PURE__ */ jsx41("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" })
|
|
11274
11347
|
) : null })
|
|
11275
11348
|
]
|
|
11276
11349
|
}
|
|
@@ -11285,7 +11358,7 @@ function HierarchyDragHandle({
|
|
|
11285
11358
|
id,
|
|
11286
11359
|
disabled
|
|
11287
11360
|
});
|
|
11288
|
-
return /* @__PURE__ */
|
|
11361
|
+
return /* @__PURE__ */ jsx41(
|
|
11289
11362
|
"button",
|
|
11290
11363
|
{
|
|
11291
11364
|
ref: setNodeRef,
|
|
@@ -11297,7 +11370,7 @@ function HierarchyDragHandle({
|
|
|
11297
11370
|
onClick: (event) => event.stopPropagation(),
|
|
11298
11371
|
...attributes,
|
|
11299
11372
|
...listeners,
|
|
11300
|
-
children: /* @__PURE__ */
|
|
11373
|
+
children: /* @__PURE__ */ jsx41(GripVertical, { className: "h-3.5 w-3.5" })
|
|
11301
11374
|
}
|
|
11302
11375
|
);
|
|
11303
11376
|
}
|
|
@@ -11306,7 +11379,7 @@ function HierarchyRootDropTarget({
|
|
|
11306
11379
|
draggedLabel
|
|
11307
11380
|
}) {
|
|
11308
11381
|
const { isOver, setNodeRef } = useDroppable2({ id: "__root__" });
|
|
11309
|
-
return /* @__PURE__ */
|
|
11382
|
+
return /* @__PURE__ */ jsxs31(
|
|
11310
11383
|
"div",
|
|
11311
11384
|
{
|
|
11312
11385
|
ref: setNodeRef,
|
|
@@ -11316,8 +11389,8 @@ function HierarchyRootDropTarget({
|
|
|
11316
11389
|
isOver && "border-solid bg-primary/20 shadow-md shadow-primary/25"
|
|
11317
11390
|
),
|
|
11318
11391
|
children: [
|
|
11319
|
-
/* @__PURE__ */
|
|
11320
|
-
/* @__PURE__ */
|
|
11392
|
+
/* @__PURE__ */ jsx41("span", { className: "truncate", children: draggedLabel }),
|
|
11393
|
+
/* @__PURE__ */ jsx41("span", { className: "text-primary/75", children: label })
|
|
11321
11394
|
]
|
|
11322
11395
|
}
|
|
11323
11396
|
);
|
|
@@ -11326,7 +11399,7 @@ function HierarchyDragIndicatorLayer({
|
|
|
11326
11399
|
scrollRef,
|
|
11327
11400
|
resolve: resolve2
|
|
11328
11401
|
}) {
|
|
11329
|
-
const [indicator, setIndicator] =
|
|
11402
|
+
const [indicator, setIndicator] = useState21(
|
|
11330
11403
|
null
|
|
11331
11404
|
);
|
|
11332
11405
|
useDndMonitor2({
|
|
@@ -11366,7 +11439,7 @@ function HierarchyDragIndicatorLayer({
|
|
|
11366
11439
|
const { preview: preview2 } = indicator;
|
|
11367
11440
|
const indent = indicator.left + 10 + preview2.depth * 12;
|
|
11368
11441
|
if (preview2.position === "inside") {
|
|
11369
|
-
return /* @__PURE__ */
|
|
11442
|
+
return /* @__PURE__ */ jsx41(
|
|
11370
11443
|
"div",
|
|
11371
11444
|
{
|
|
11372
11445
|
"aria-hidden": "true",
|
|
@@ -11378,7 +11451,7 @@ function HierarchyDragIndicatorLayer({
|
|
|
11378
11451
|
width: Math.max(0, indicator.width - 4),
|
|
11379
11452
|
height: indicator.height
|
|
11380
11453
|
},
|
|
11381
|
-
children: /* @__PURE__ */
|
|
11454
|
+
children: /* @__PURE__ */ jsxs31(
|
|
11382
11455
|
"span",
|
|
11383
11456
|
{
|
|
11384
11457
|
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",
|
|
@@ -11393,7 +11466,7 @@ function HierarchyDragIndicatorLayer({
|
|
|
11393
11466
|
);
|
|
11394
11467
|
}
|
|
11395
11468
|
const lineTop = preview2.position === "before" ? indicator.top - 1 : indicator.top + indicator.height - 1;
|
|
11396
|
-
return /* @__PURE__ */
|
|
11469
|
+
return /* @__PURE__ */ jsx41(
|
|
11397
11470
|
"div",
|
|
11398
11471
|
{
|
|
11399
11472
|
"aria-hidden": "true",
|
|
@@ -11404,9 +11477,9 @@ function HierarchyDragIndicatorLayer({
|
|
|
11404
11477
|
left: indent,
|
|
11405
11478
|
width: Math.max(0, indicator.left + indicator.width - indent - 8)
|
|
11406
11479
|
},
|
|
11407
|
-
children: /* @__PURE__ */
|
|
11408
|
-
/* @__PURE__ */
|
|
11409
|
-
/* @__PURE__ */
|
|
11480
|
+
children: /* @__PURE__ */ jsxs31("div", { className: "relative h-0.5 rounded-full bg-primary", children: [
|
|
11481
|
+
/* @__PURE__ */ jsx41("span", { className: "absolute -left-1 top-1/2 h-2 w-2 -translate-y-1/2 rounded-full border-2 border-primary bg-card" }),
|
|
11482
|
+
/* @__PURE__ */ jsxs31(
|
|
11410
11483
|
"span",
|
|
11411
11484
|
{
|
|
11412
11485
|
className: cn(
|
|
@@ -11447,7 +11520,7 @@ function ColumnHeaderDropZone({
|
|
|
11447
11520
|
disabled: !enabled,
|
|
11448
11521
|
data: { matrxDragKind: "column-header", columnId: id }
|
|
11449
11522
|
});
|
|
11450
|
-
return /* @__PURE__ */
|
|
11523
|
+
return /* @__PURE__ */ jsx41("div", { ref: setNodeRef, className: "flex min-w-0 items-center", children });
|
|
11451
11524
|
}
|
|
11452
11525
|
function fixedUtilityWidth(width) {
|
|
11453
11526
|
return width === void 0 ? void 0 : { width: `${width}px`, minWidth: `${width}px`, maxWidth: `${width}px` };
|
|
@@ -11472,14 +11545,14 @@ function columnWidthVar(width, resizedWidth, id, resizable) {
|
|
|
11472
11545
|
};
|
|
11473
11546
|
}
|
|
11474
11547
|
function DefaultJsonCell({ value }) {
|
|
11475
|
-
const [open, setOpen] =
|
|
11548
|
+
const [open, setOpen] = useState21(false);
|
|
11476
11549
|
const host = useMatrxDataTableHost();
|
|
11477
11550
|
const Viewer = host.JsonViewer;
|
|
11478
11551
|
const text = JSON.stringify(value, null, 2);
|
|
11479
11552
|
const summary = Array.isArray(value) ? `${value.length} items` : Object.keys(value).slice(0, 3).join(", ") || "Empty object";
|
|
11480
|
-
return /* @__PURE__ */
|
|
11481
|
-
/* @__PURE__ */
|
|
11482
|
-
/* @__PURE__ */
|
|
11553
|
+
return /* @__PURE__ */ jsxs31(Fragment7, { children: [
|
|
11554
|
+
/* @__PURE__ */ jsxs31(Tooltip, { children: [
|
|
11555
|
+
/* @__PURE__ */ jsx41(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs31("button", { type: "button", className: "block max-w-full truncate text-left text-sm text-foreground", onClick: (event) => {
|
|
11483
11556
|
event.stopPropagation();
|
|
11484
11557
|
setOpen(true);
|
|
11485
11558
|
}, style: { display: "-webkit-box", WebkitLineClamp: 2, WebkitBoxOrient: "vertical", overflow: "hidden", whiteSpace: "normal", overflowWrap: "anywhere" }, "aria-label": "Open JSON value", children: [
|
|
@@ -11487,9 +11560,9 @@ function DefaultJsonCell({ value }) {
|
|
|
11487
11560
|
" ",
|
|
11488
11561
|
summary
|
|
11489
11562
|
] }) }),
|
|
11490
|
-
/* @__PURE__ */
|
|
11563
|
+
/* @__PURE__ */ jsx41(TooltipContent, { className: "max-w-md max-h-80 overflow-auto whitespace-pre-wrap break-words", children: text })
|
|
11491
11564
|
] }),
|
|
11492
|
-
/* @__PURE__ */
|
|
11565
|
+
/* @__PURE__ */ jsx41(DataRowWindow, { isOpen: open, onClose: () => setOpen(false), title: "JSON value", row: value, viewContent: Viewer ? /* @__PURE__ */ jsx41(Viewer, { data: value }) : /* @__PURE__ */ jsx41("pre", { className: "overflow-auto whitespace-pre-wrap p-3 text-xs", children: text }) })
|
|
11493
11566
|
] });
|
|
11494
11567
|
}
|
|
11495
11568
|
function renderCell(row, col, index) {
|
|
@@ -11500,7 +11573,7 @@ function renderCell(row, col, index) {
|
|
|
11500
11573
|
if (asUuid && typeof raw === "string") {
|
|
11501
11574
|
const forbidden = typeof col.fk?.forbidden === "function" ? col.fk.forbidden(raw, row) : Boolean(col.fk?.forbidden);
|
|
11502
11575
|
const declaredToken = typeof col.fk?.token === "function" ? col.fk.token(row) : col.fk?.token;
|
|
11503
|
-
return /* @__PURE__ */
|
|
11576
|
+
return /* @__PURE__ */ jsx41(
|
|
11504
11577
|
MatrxUuidCell,
|
|
11505
11578
|
{
|
|
11506
11579
|
value: raw,
|
|
@@ -11512,14 +11585,14 @@ function renderCell(row, col, index) {
|
|
|
11512
11585
|
}
|
|
11513
11586
|
);
|
|
11514
11587
|
}
|
|
11515
|
-
if (raw !== null && typeof raw === "object" && !(raw instanceof Date)) return /* @__PURE__ */
|
|
11588
|
+
if (raw !== null && typeof raw === "object" && !(raw instanceof Date)) return /* @__PURE__ */ jsx41(DefaultJsonCell, { value: raw });
|
|
11516
11589
|
if (typeof raw === "boolean") {
|
|
11517
|
-
return /* @__PURE__ */
|
|
11590
|
+
return /* @__PURE__ */ jsx41("span", { className: raw ? "rounded bg-emerald-500/10 px-1.5 py-0.5 text-xs text-emerald-600" : "rounded bg-slate-500/10 px-1.5 py-0.5 text-xs text-muted-foreground", children: raw ? "Yes" : "No" });
|
|
11518
11591
|
}
|
|
11519
11592
|
const formatted = formatTableDisplayValue(raw);
|
|
11520
|
-
return /* @__PURE__ */
|
|
11521
|
-
/* @__PURE__ */
|
|
11522
|
-
/* @__PURE__ */
|
|
11593
|
+
return /* @__PURE__ */ jsxs31(Tooltip, { children: [
|
|
11594
|
+
/* @__PURE__ */ jsx41(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx41("span", { className: "block text-sm text-foreground", style: { display: "-webkit-box", WebkitLineClamp: 2, WebkitBoxOrient: "vertical", overflow: "hidden", overflowWrap: "anywhere" }, children: formatted }) }),
|
|
11595
|
+
/* @__PURE__ */ jsx41(TooltipContent, { className: "max-w-md whitespace-pre-wrap break-words max-h-80 overflow-auto", children: typeof raw === "object" && raw !== null ? JSON.stringify(raw, null, 2) : formatted })
|
|
11523
11596
|
] });
|
|
11524
11597
|
}
|
|
11525
11598
|
function resolveStringTitle(title, fallback) {
|
|
@@ -11529,19 +11602,19 @@ function resolveStringTitle(title, fallback) {
|
|
|
11529
11602
|
}
|
|
11530
11603
|
|
|
11531
11604
|
// src/data-table/SavedViewsControl.tsx
|
|
11532
|
-
import { useId as useId3, useState as
|
|
11605
|
+
import { useId as useId3, useState as useState22 } from "react";
|
|
11533
11606
|
|
|
11534
11607
|
// src/dropdown-menu.tsx
|
|
11535
11608
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
11536
11609
|
import * as React17 from "react";
|
|
11537
|
-
import { jsx as
|
|
11610
|
+
import { jsx as jsx42, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
11538
11611
|
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
11539
11612
|
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
11540
11613
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
11541
11614
|
var MENU_SURFACE_CLASS = "z-[10001] min-w-[8rem] max-h-[var(--radix-dropdown-menu-content-available-height)] overflow-y-auto overflow-x-hidden overscroll-contain rounded-md border bg-popover p-1 text-popover-foreground";
|
|
11542
11615
|
var MENU_ITEM_CLASS = "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50";
|
|
11543
11616
|
var MENU_INDICATOR_ITEM_CLASS = "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50";
|
|
11544
|
-
var DropdownMenuSubTrigger = React17.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */
|
|
11617
|
+
var DropdownMenuSubTrigger = React17.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs32(
|
|
11545
11618
|
DropdownMenuPrimitive.SubTrigger,
|
|
11546
11619
|
{
|
|
11547
11620
|
ref,
|
|
@@ -11554,12 +11627,12 @@ var DropdownMenuSubTrigger = React17.forwardRef(({ className, inset, children, .
|
|
|
11554
11627
|
...props,
|
|
11555
11628
|
children: [
|
|
11556
11629
|
children,
|
|
11557
|
-
/* @__PURE__ */
|
|
11630
|
+
/* @__PURE__ */ jsx42(RadixChevronRightIcon, { className: "ml-auto h-4 w-4" })
|
|
11558
11631
|
]
|
|
11559
11632
|
}
|
|
11560
11633
|
));
|
|
11561
11634
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
11562
|
-
var DropdownMenuSubContent = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
11635
|
+
var DropdownMenuSubContent = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx42(
|
|
11563
11636
|
DropdownMenuPrimitive.SubContent,
|
|
11564
11637
|
{
|
|
11565
11638
|
ref,
|
|
@@ -11571,7 +11644,7 @@ var DropdownMenuSubContent = React17.forwardRef(({ className, ...props }, ref) =
|
|
|
11571
11644
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
11572
11645
|
var DropdownMenuContent = React17.forwardRef(({ className, sideOffset = 4, container, ...props }, ref) => {
|
|
11573
11646
|
const portalContainer = usePortalContainer(container);
|
|
11574
|
-
return /* @__PURE__ */
|
|
11647
|
+
return /* @__PURE__ */ jsx42(DropdownMenuPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx42(
|
|
11575
11648
|
DropdownMenuPrimitive.Content,
|
|
11576
11649
|
{
|
|
11577
11650
|
ref,
|
|
@@ -11588,7 +11661,7 @@ var DropdownMenuContent = React17.forwardRef(({ className, sideOffset = 4, conta
|
|
|
11588
11661
|
) });
|
|
11589
11662
|
});
|
|
11590
11663
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
11591
|
-
var DropdownMenuItem = React17.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */
|
|
11664
|
+
var DropdownMenuItem = React17.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx42(
|
|
11592
11665
|
DropdownMenuPrimitive.Item,
|
|
11593
11666
|
{
|
|
11594
11667
|
ref,
|
|
@@ -11598,7 +11671,7 @@ var DropdownMenuItem = React17.forwardRef(({ className, inset, ...props }, ref)
|
|
|
11598
11671
|
}
|
|
11599
11672
|
));
|
|
11600
11673
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
11601
|
-
var DropdownMenuCheckboxItem = React17.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
11674
|
+
var DropdownMenuCheckboxItem = React17.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs32(
|
|
11602
11675
|
DropdownMenuPrimitive.CheckboxItem,
|
|
11603
11676
|
{
|
|
11604
11677
|
ref,
|
|
@@ -11606,13 +11679,13 @@ var DropdownMenuCheckboxItem = React17.forwardRef(({ className, children, ...pro
|
|
|
11606
11679
|
className: cn(MENU_INDICATOR_ITEM_CLASS, className),
|
|
11607
11680
|
...props,
|
|
11608
11681
|
children: [
|
|
11609
|
-
/* @__PURE__ */
|
|
11682
|
+
/* @__PURE__ */ jsx42("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx42(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx42(CheckIcon, { className: "h-4 w-4" }) }) }),
|
|
11610
11683
|
children
|
|
11611
11684
|
]
|
|
11612
11685
|
}
|
|
11613
11686
|
));
|
|
11614
11687
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
11615
|
-
var DropdownMenuRadioItem = React17.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
11688
|
+
var DropdownMenuRadioItem = React17.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs32(
|
|
11616
11689
|
DropdownMenuPrimitive.RadioItem,
|
|
11617
11690
|
{
|
|
11618
11691
|
ref,
|
|
@@ -11620,13 +11693,13 @@ var DropdownMenuRadioItem = React17.forwardRef(({ className, children, ...props
|
|
|
11620
11693
|
className: cn(MENU_INDICATOR_ITEM_CLASS, className),
|
|
11621
11694
|
...props,
|
|
11622
11695
|
children: [
|
|
11623
|
-
/* @__PURE__ */
|
|
11696
|
+
/* @__PURE__ */ jsx42("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx42(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx42(DotFilledIcon, { className: "h-4 w-4 fill-current" }) }) }),
|
|
11624
11697
|
children
|
|
11625
11698
|
]
|
|
11626
11699
|
}
|
|
11627
11700
|
));
|
|
11628
11701
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
11629
|
-
var DropdownMenuLabel = React17.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */
|
|
11702
|
+
var DropdownMenuLabel = React17.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx42(
|
|
11630
11703
|
DropdownMenuPrimitive.Label,
|
|
11631
11704
|
{
|
|
11632
11705
|
ref,
|
|
@@ -11636,7 +11709,7 @@ var DropdownMenuLabel = React17.forwardRef(({ className, inset, ...props }, ref)
|
|
|
11636
11709
|
}
|
|
11637
11710
|
));
|
|
11638
11711
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
11639
|
-
var DropdownMenuSeparator = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
11712
|
+
var DropdownMenuSeparator = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx42(
|
|
11640
11713
|
DropdownMenuPrimitive.Separator,
|
|
11641
11714
|
{
|
|
11642
11715
|
ref,
|
|
@@ -11649,7 +11722,7 @@ DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
|
11649
11722
|
var DropdownMenuShortcut = ({
|
|
11650
11723
|
className,
|
|
11651
11724
|
...props
|
|
11652
|
-
}) => /* @__PURE__ */
|
|
11725
|
+
}) => /* @__PURE__ */ jsx42(
|
|
11653
11726
|
"span",
|
|
11654
11727
|
{
|
|
11655
11728
|
"data-slot": "dropdown-menu-shortcut",
|
|
@@ -11660,7 +11733,7 @@ var DropdownMenuShortcut = ({
|
|
|
11660
11733
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
11661
11734
|
|
|
11662
11735
|
// src/data-table/SavedViewsControl.tsx
|
|
11663
|
-
import { jsx as
|
|
11736
|
+
import { jsx as jsx43, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
11664
11737
|
function SavedViewsControl({
|
|
11665
11738
|
views,
|
|
11666
11739
|
activeId = null,
|
|
@@ -11673,10 +11746,10 @@ function SavedViewsControl({
|
|
|
11673
11746
|
onReload
|
|
11674
11747
|
}) {
|
|
11675
11748
|
const unsavedChangesId = useId3();
|
|
11676
|
-
const [saveOpen, setSaveOpen] =
|
|
11677
|
-
const [name, setName] =
|
|
11678
|
-
const [saving, setSaving] =
|
|
11679
|
-
const [actionError, setActionError] =
|
|
11749
|
+
const [saveOpen, setSaveOpen] = useState22(false);
|
|
11750
|
+
const [name, setName] = useState22("");
|
|
11751
|
+
const [saving, setSaving] = useState22(false);
|
|
11752
|
+
const [actionError, setActionError] = useState22(null);
|
|
11680
11753
|
const visibleError = actionError ?? error;
|
|
11681
11754
|
const save = async () => {
|
|
11682
11755
|
const next = name.trim();
|
|
@@ -11718,10 +11791,10 @@ function SavedViewsControl({
|
|
|
11718
11791
|
}
|
|
11719
11792
|
};
|
|
11720
11793
|
const activeName = activeId ? views.find((view) => view.id === activeId)?.name : void 0;
|
|
11721
|
-
return /* @__PURE__ */
|
|
11722
|
-
/* @__PURE__ */
|
|
11723
|
-
/* @__PURE__ */
|
|
11724
|
-
/* @__PURE__ */
|
|
11794
|
+
return /* @__PURE__ */ jsxs33("div", { className: "flex min-w-0 flex-wrap items-center gap-1", "data-matrx-table-saved-views": true, children: [
|
|
11795
|
+
/* @__PURE__ */ jsxs33(DropdownMenu, { children: [
|
|
11796
|
+
/* @__PURE__ */ jsxs33(Tooltip, { children: [
|
|
11797
|
+
/* @__PURE__ */ jsx43(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx43(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs33(
|
|
11725
11798
|
Button,
|
|
11726
11799
|
{
|
|
11727
11800
|
type: "button",
|
|
@@ -11732,38 +11805,38 @@ function SavedViewsControl({
|
|
|
11732
11805
|
"aria-describedby": dirty ? unsavedChangesId : void 0,
|
|
11733
11806
|
disabled: saving,
|
|
11734
11807
|
children: [
|
|
11735
|
-
/* @__PURE__ */
|
|
11736
|
-
dirty ? /* @__PURE__ */
|
|
11737
|
-
/* @__PURE__ */
|
|
11808
|
+
/* @__PURE__ */ jsx43("span", { className: "min-w-0 flex-1 truncate", children: loading ? "Loading views\u2026" : activeName ?? "Default view" }),
|
|
11809
|
+
dirty ? /* @__PURE__ */ jsx43("span", { "aria-hidden": "true", className: "size-1.5 shrink-0 rounded-full bg-amber-500" }) : null,
|
|
11810
|
+
/* @__PURE__ */ jsx43(ChevronDown, { className: "size-3.5 shrink-0" })
|
|
11738
11811
|
]
|
|
11739
11812
|
}
|
|
11740
11813
|
) }) }),
|
|
11741
|
-
/* @__PURE__ */
|
|
11814
|
+
/* @__PURE__ */ jsx43(TooltipContent, { children: "Choose or save a table view" })
|
|
11742
11815
|
] }),
|
|
11743
|
-
/* @__PURE__ */
|
|
11744
|
-
/* @__PURE__ */
|
|
11745
|
-
/* @__PURE__ */
|
|
11746
|
-
/* @__PURE__ */
|
|
11747
|
-
views.map((view) => /* @__PURE__ */
|
|
11816
|
+
/* @__PURE__ */ jsxs33(DropdownMenuContent, { align: "end", children: [
|
|
11817
|
+
/* @__PURE__ */ jsx43(DropdownMenuLabel, { children: "Views" }),
|
|
11818
|
+
/* @__PURE__ */ jsxs33(DropdownMenuRadioGroup, { value: activeId ?? "__default__", onValueChange: (value) => onSelect(value === "__default__" ? null : value), children: [
|
|
11819
|
+
/* @__PURE__ */ jsx43(DropdownMenuRadioItem, { value: "__default__", children: "Default view" }),
|
|
11820
|
+
views.map((view) => /* @__PURE__ */ jsx43(DropdownMenuRadioItem, { value: view.id, children: view.name }, view.id))
|
|
11748
11821
|
] }),
|
|
11749
|
-
/* @__PURE__ */
|
|
11750
|
-
/* @__PURE__ */
|
|
11822
|
+
/* @__PURE__ */ jsx43(DropdownMenuSeparator, {}),
|
|
11823
|
+
/* @__PURE__ */ jsx43(DropdownMenuItem, { disabled: saving, onSelect: () => {
|
|
11751
11824
|
setActionError(null);
|
|
11752
11825
|
setSaveOpen(true);
|
|
11753
11826
|
}, children: "Save current view\u2026" }),
|
|
11754
|
-
activeId && onUpdate ? /* @__PURE__ */
|
|
11755
|
-
onReload ? /* @__PURE__ */
|
|
11827
|
+
activeId && onUpdate ? /* @__PURE__ */ jsx43(DropdownMenuItem, { disabled: saving, onSelect: () => void update(), children: "Update current view" }) : null,
|
|
11828
|
+
onReload ? /* @__PURE__ */ jsx43(DropdownMenuItem, { disabled: saving || loading, onSelect: () => void reload(), children: "Reload views" }) : null
|
|
11756
11829
|
] })
|
|
11757
11830
|
] }),
|
|
11758
|
-
dirty ? /* @__PURE__ */
|
|
11759
|
-
visibleError ? /* @__PURE__ */
|
|
11760
|
-
/* @__PURE__ */
|
|
11761
|
-
/* @__PURE__ */
|
|
11762
|
-
visibleError ? /* @__PURE__ */
|
|
11763
|
-
/* @__PURE__ */
|
|
11764
|
-
/* @__PURE__ */
|
|
11765
|
-
/* @__PURE__ */
|
|
11766
|
-
/* @__PURE__ */
|
|
11831
|
+
dirty ? /* @__PURE__ */ jsx43("span", { id: unsavedChangesId, className: "sr-only", children: "This table view has unsaved changes. Open the view menu to save or update it." }) : null,
|
|
11832
|
+
visibleError ? /* @__PURE__ */ jsx43("p", { role: "alert", className: "basis-full break-words text-xs text-destructive", children: visibleError }) : null,
|
|
11833
|
+
/* @__PURE__ */ jsx43(Dialog, { open: saveOpen, onOpenChange: setSaveOpen, children: /* @__PURE__ */ jsxs33(DialogContent, { children: [
|
|
11834
|
+
/* @__PURE__ */ jsx43(DialogHeader, { children: /* @__PURE__ */ jsx43(DialogTitle, { children: "Save current view" }) }),
|
|
11835
|
+
visibleError ? /* @__PURE__ */ jsx43("p", { role: "alert", className: "text-sm text-destructive", children: visibleError }) : null,
|
|
11836
|
+
/* @__PURE__ */ jsx43(Input, { "aria-label": "View name", value: name, onChange: (event) => setName(event.target.value), placeholder: "View name", autoFocus: true }),
|
|
11837
|
+
/* @__PURE__ */ jsxs33(DialogFooter, { children: [
|
|
11838
|
+
/* @__PURE__ */ jsx43(Button, { type: "button", variant: "outline", onClick: () => setSaveOpen(false), children: "Cancel" }),
|
|
11839
|
+
/* @__PURE__ */ jsx43(Button, { type: "button", disabled: !name.trim() || saving, onClick: () => void save(), children: saving ? "Saving\u2026" : "Save view" })
|
|
11767
11840
|
] })
|
|
11768
11841
|
] }) })
|
|
11769
11842
|
] });
|
|
@@ -11810,6 +11883,7 @@ export {
|
|
|
11810
11883
|
GenericTablePagination,
|
|
11811
11884
|
MatrxDataTable,
|
|
11812
11885
|
MatrxDataTableProvider,
|
|
11886
|
+
MatrxTableRowAlchemyProvider,
|
|
11813
11887
|
MatrxUuidCell,
|
|
11814
11888
|
SavedViewsControl,
|
|
11815
11889
|
TableTitleRow,
|
|
@@ -11828,6 +11902,7 @@ export {
|
|
|
11828
11902
|
shortUuid,
|
|
11829
11903
|
tableUrlParamPrefix,
|
|
11830
11904
|
useMatrxDataTableHost,
|
|
11905
|
+
useMatrxTableRowAlchemy,
|
|
11831
11906
|
useScrollPagination,
|
|
11832
11907
|
useTableUrlState
|
|
11833
11908
|
};
|