@ai-matrx/design-system 0.21.2 → 0.21.4
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 +26 -6
- package/dist/data-table/data-row-inspector.cjs.map +1 -1
- package/dist/data-table/data-row-inspector.js +26 -6
- package/dist/data-table/data-row-inspector.js.map +1 -1
- package/dist/data-table/data-row-window.cjs +26 -6
- package/dist/data-table/data-row-window.cjs.map +1 -1
- package/dist/data-table/data-row-window.js +26 -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 +23 -1
- package/dist/data-table/host.cjs.map +1 -1
- package/dist/data-table/host.d.cts +33 -4
- package/dist/data-table/host.d.ts +33 -4
- package/dist/data-table/host.js +23 -1
- package/dist/data-table/host.js.map +1 -1
- package/dist/data-table/index.cjs +890 -751
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.d.cts +16 -6
- package/dist/data-table/index.d.ts +16 -6
- package/dist/data-table/index.js +846 -707
- 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 +6 -0
- package/dist/data-table/pagination.cjs.map +1 -1
- package/dist/data-table/pagination.js +6 -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 +6 -0
- package/dist/data-table/uuid-cell.cjs.map +1 -1
- package/dist/data-table/uuid-cell.js +6 -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-DnnvjGV4.d.ts → types-CbGNfo7r.d.ts} +13 -2
- package/dist/{types-Bt-0UhEw.d.cts → types-DRusLYrU.d.cts} +13 -2
- 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 useEffect15,
|
|
10
10
|
useId as useId2,
|
|
11
11
|
useLayoutEffect as useLayoutEffect2,
|
|
12
12
|
useMemo as useMemo7,
|
|
13
|
-
useRef as
|
|
14
|
-
useState as
|
|
13
|
+
useRef as useRef13,
|
|
14
|
+
useState as useState21
|
|
15
15
|
} from "react";
|
|
16
16
|
import {
|
|
17
17
|
DndContext,
|
|
@@ -1877,6 +1877,21 @@ 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
|
+
}
|
|
1889
|
+
var ROW_CONTROLS_SLOT = /* @__PURE__ */ Symbol.for("ai-matrx.design-system.table-row-controls-context");
|
|
1890
|
+
var rowControlsRegistry = globalThis;
|
|
1891
|
+
var RowControlsContext = rowControlsRegistry[ROW_CONTROLS_SLOT] ??= createContext4(null);
|
|
1892
|
+
function MatrxTableRowControlsScope({ value, children }) {
|
|
1893
|
+
return /* @__PURE__ */ jsx18(RowControlsContext.Provider, { value, children });
|
|
1894
|
+
}
|
|
1880
1895
|
|
|
1881
1896
|
// src/data-table/useTableNotice.tsx
|
|
1882
1897
|
import { jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
@@ -3215,8 +3230,9 @@ function ContentTransferMenu(props) {
|
|
|
3215
3230
|
const identityKey = props.capabilities?.identityKey ?? inherited.identityKey;
|
|
3216
3231
|
return /* @__PURE__ */ jsx25(ContentTransferMenuSession, { ...props }, identityKey ?? "anonymous");
|
|
3217
3232
|
}
|
|
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" }) {
|
|
3233
|
+
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
3234
|
const triggerRef = React14.useRef(null);
|
|
3235
|
+
const restoreFocusRef = React14.useRef(null);
|
|
3220
3236
|
const inherited = React14.useContext(CapabilityContext);
|
|
3221
3237
|
const nearestSurface = React14.useContext(SurfaceContext);
|
|
3222
3238
|
const fence = useFence();
|
|
@@ -3466,13 +3482,21 @@ function ContentTransferMenuSession({ references = [], referenceActions = [], so
|
|
|
3466
3482
|
);
|
|
3467
3483
|
React14.useImperativeHandle(controllerRef, () => ({
|
|
3468
3484
|
focusTrigger: () => triggerRef.current?.focus(),
|
|
3485
|
+
preparePrimary: async (options) => {
|
|
3486
|
+
if (!enabled) throw new Error("Alchemy is not enabled for this record.");
|
|
3487
|
+
if (disabled) throw new Error("Alchemy is disabled for this record.");
|
|
3488
|
+
if (hide.includes("prepare")) throw new Error("Alchemy preparation is unavailable for this record.");
|
|
3489
|
+
if (!primary) throw new Error("Alchemy has no source to prepare.");
|
|
3490
|
+
restoreFocusRef.current = options?.restoreFocus ?? null;
|
|
3491
|
+
await openWorkspace(primaryWorkspaceKey, { source: primary, label: sourceLabel });
|
|
3492
|
+
},
|
|
3469
3493
|
prepare: async (requestedSource, options) => {
|
|
3470
3494
|
const requestedLabel = options?.label ?? ("label" in requestedSource ? requestedSource.label : "content");
|
|
3471
3495
|
const requestedKey = `controller:${options?.id ?? "source"}:${materialIdentity(requestedSource)}`;
|
|
3472
3496
|
externalWorkspaceKeys.current.add(requestedKey);
|
|
3473
3497
|
await openWorkspace(requestedKey, { source: requestedSource, label: requestedLabel });
|
|
3474
3498
|
}
|
|
3475
|
-
}), [openWorkspace]);
|
|
3499
|
+
}), [disabled, enabled, hide, openWorkspace, primary, primaryWorkspaceKey, sourceLabel]);
|
|
3476
3500
|
const runAction = React14.useCallback(async (action) => {
|
|
3477
3501
|
const { controller, id } = fence.begin();
|
|
3478
3502
|
try {
|
|
@@ -3555,7 +3579,7 @@ function ContentTransferMenuSession({ references = [], referenceActions = [], so
|
|
|
3555
3579
|
] }, id);
|
|
3556
3580
|
};
|
|
3557
3581
|
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) => {
|
|
3582
|
+
!triggerHidden ? /* @__PURE__ */ jsxs17(Popover, { open: paletteOpen, onOpenChange: (open) => {
|
|
3559
3583
|
setPaletteOpen(open);
|
|
3560
3584
|
if (open) {
|
|
3561
3585
|
setMode("copy");
|
|
@@ -3664,13 +3688,13 @@ function ContentTransferMenuSession({ references = [], referenceActions = [], so
|
|
|
3664
3688
|
] }, group) : null;
|
|
3665
3689
|
})
|
|
3666
3690
|
] })
|
|
3667
|
-
] }),
|
|
3691
|
+
] }) : null,
|
|
3668
3692
|
notice && triggerRef.current ? createPortal(/* @__PURE__ */ jsxs17("div", { className: "matrx-alchemy-feedback", children: [
|
|
3669
3693
|
/* @__PURE__ */ jsx25("span", { role: "status", children: notice }),
|
|
3670
3694
|
/* @__PURE__ */ jsx25(ReceiptLink, { target: receiptTarget }),
|
|
3671
3695
|
/* @__PURE__ */ jsx25("button", { type: "button", "aria-label": "Dismiss Alchemy feedback", onClick: () => setNotice(null), children: "\xD7" })
|
|
3672
3696
|
] }), 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)),
|
|
3697
|
+
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
3698
|
emailReview
|
|
3675
3699
|
] });
|
|
3676
3700
|
}
|
|
@@ -4477,7 +4501,12 @@ function MatrxCopyMenuSession(props) {
|
|
|
4477
4501
|
...props.referenceActions ? { referenceActions: props.referenceActions } : {},
|
|
4478
4502
|
...props.icon !== void 0 ? { icon: props.icon } : {},
|
|
4479
4503
|
...props.triggerVariant !== void 0 ? { triggerVariant: props.triggerVariant } : {},
|
|
4480
|
-
controllerRef:
|
|
4504
|
+
controllerRef: (value) => {
|
|
4505
|
+
controller.current = value;
|
|
4506
|
+
if (typeof props.controllerRef === "function") props.controllerRef(value);
|
|
4507
|
+
else if (props.controllerRef) props.controllerRef.current = value;
|
|
4508
|
+
},
|
|
4509
|
+
...props.triggerHidden ? { triggerHidden: true } : {},
|
|
4481
4510
|
label: props.label,
|
|
4482
4511
|
variants,
|
|
4483
4512
|
actions,
|
|
@@ -5566,12 +5595,48 @@ import {
|
|
|
5566
5595
|
useUrlState
|
|
5567
5596
|
} from "@ai-matrx/kit/url-state";
|
|
5568
5597
|
|
|
5598
|
+
// src/data-table/RowAlchemyLauncher.tsx
|
|
5599
|
+
import { useEffect as useEffect8, useRef as useRef9, useState as useState13 } from "react";
|
|
5600
|
+
import { jsx as jsx29, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
5601
|
+
function MatrxTableRowAlchemyProvider({ copy, placement, controls, children }) {
|
|
5602
|
+
const controller = useRef9(null);
|
|
5603
|
+
const { CopyControls } = useMatrxDataTableHost();
|
|
5604
|
+
const [active, setActive] = useState13(false);
|
|
5605
|
+
const [fallback, setFallback] = useState13(false);
|
|
5606
|
+
useEffect8(() => {
|
|
5607
|
+
if (placement !== "menu" || active) return;
|
|
5608
|
+
const timer = window.setTimeout(() => {
|
|
5609
|
+
if (!active) {
|
|
5610
|
+
console.warn("MatrxDataTable rowCopyPlacement='menu' requires an ItemMenu in rowActions; showing inline Alchemy instead.");
|
|
5611
|
+
setFallback(true);
|
|
5612
|
+
}
|
|
5613
|
+
}, 0);
|
|
5614
|
+
return () => window.clearTimeout(timer);
|
|
5615
|
+
}, [active, placement]);
|
|
5616
|
+
const value = {
|
|
5617
|
+
copy,
|
|
5618
|
+
controls,
|
|
5619
|
+
placement,
|
|
5620
|
+
ready: active,
|
|
5621
|
+
activate: () => setActive(true),
|
|
5622
|
+
prepare: async (restoreFocus) => {
|
|
5623
|
+
if (copy.disabled) throw new Error("Alchemy is disabled for this record.");
|
|
5624
|
+
if (!controller.current) throw new Error("Alchemy is unavailable because its launcher did not mount.");
|
|
5625
|
+
await controller.current.preparePrimary(restoreFocus ? { restoreFocus } : void 0);
|
|
5626
|
+
}
|
|
5627
|
+
};
|
|
5628
|
+
return /* @__PURE__ */ jsxs20(MatrxTableRowAlchemyScope, { value, children: [
|
|
5629
|
+
active || fallback ? CopyControls ? /* @__PURE__ */ jsx29(CopyControls, { ...copy, triggerHidden: active, controllerRef: controller }) : /* @__PURE__ */ jsx29(MatrxCopyMenu, { ...copy, triggerHidden: active, controllerRef: controller }) : null,
|
|
5630
|
+
children
|
|
5631
|
+
] });
|
|
5632
|
+
}
|
|
5633
|
+
|
|
5569
5634
|
// src/data-table/ColumnHeaderCell.tsx
|
|
5570
5635
|
import {
|
|
5571
5636
|
forwardRef as forwardRef12,
|
|
5572
|
-
useEffect as
|
|
5637
|
+
useEffect as useEffect9,
|
|
5573
5638
|
useMemo as useMemo5,
|
|
5574
|
-
useState as
|
|
5639
|
+
useState as useState14
|
|
5575
5640
|
} from "react";
|
|
5576
5641
|
import { useDraggable } from "@dnd-kit/core";
|
|
5577
5642
|
|
|
@@ -5579,8 +5644,8 @@ import { useDraggable } from "@dnd-kit/core";
|
|
|
5579
5644
|
import * as DialogPrimitive2 from "@radix-ui/react-dialog";
|
|
5580
5645
|
import { Command as CommandPrimitive } from "cmdk";
|
|
5581
5646
|
import * as React16 from "react";
|
|
5582
|
-
import { jsx as
|
|
5583
|
-
var Command = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
5647
|
+
import { jsx as jsx30, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
5648
|
+
var Command = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx30(
|
|
5584
5649
|
CommandPrimitive,
|
|
5585
5650
|
{
|
|
5586
5651
|
ref,
|
|
@@ -5599,8 +5664,8 @@ var CommandDialogContent = React16.forwardRef(({ className, children, container,
|
|
|
5599
5664
|
const isMobile = useIsMobile();
|
|
5600
5665
|
const isModal = useRadixDialogModal();
|
|
5601
5666
|
const portalContainer = usePortalContainer(container);
|
|
5602
|
-
return /* @__PURE__ */
|
|
5603
|
-
isModal ? /* @__PURE__ */
|
|
5667
|
+
return /* @__PURE__ */ jsxs21(DialogPrimitive2.Portal, { container: portalContainer, children: [
|
|
5668
|
+
isModal ? /* @__PURE__ */ jsx30(
|
|
5604
5669
|
DialogPrimitive2.Overlay,
|
|
5605
5670
|
{
|
|
5606
5671
|
className: cn(
|
|
@@ -5609,7 +5674,7 @@ var CommandDialogContent = React16.forwardRef(({ className, children, container,
|
|
|
5609
5674
|
)
|
|
5610
5675
|
}
|
|
5611
5676
|
) : null,
|
|
5612
|
-
/* @__PURE__ */
|
|
5677
|
+
/* @__PURE__ */ jsxs21(
|
|
5613
5678
|
DialogPrimitive2.Content,
|
|
5614
5679
|
{
|
|
5615
5680
|
ref,
|
|
@@ -5625,9 +5690,9 @@ var CommandDialogContent = React16.forwardRef(({ className, children, container,
|
|
|
5625
5690
|
...props,
|
|
5626
5691
|
children: [
|
|
5627
5692
|
children,
|
|
5628
|
-
/* @__PURE__ */
|
|
5629
|
-
/* @__PURE__ */
|
|
5630
|
-
/* @__PURE__ */
|
|
5693
|
+
/* @__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: [
|
|
5694
|
+
/* @__PURE__ */ jsx30(XIcon, { className: "h-4 w-4" }),
|
|
5695
|
+
/* @__PURE__ */ jsx30("span", { className: "sr-only", children: "Close" })
|
|
5631
5696
|
] })
|
|
5632
5697
|
]
|
|
5633
5698
|
}
|
|
@@ -5635,9 +5700,9 @@ var CommandDialogContent = React16.forwardRef(({ className, children, container,
|
|
|
5635
5700
|
] });
|
|
5636
5701
|
});
|
|
5637
5702
|
CommandDialogContent.displayName = "CommandDialogContent";
|
|
5638
|
-
var CommandInput = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
5639
|
-
/* @__PURE__ */
|
|
5640
|
-
/* @__PURE__ */
|
|
5703
|
+
var CommandInput = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs21("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
|
5704
|
+
/* @__PURE__ */ jsx30(MagnifyingGlassIcon, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
5705
|
+
/* @__PURE__ */ jsx30(
|
|
5641
5706
|
CommandPrimitive.Input,
|
|
5642
5707
|
{
|
|
5643
5708
|
ref,
|
|
@@ -5650,7 +5715,7 @@ var CommandInput = React16.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
5650
5715
|
)
|
|
5651
5716
|
] }));
|
|
5652
5717
|
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
|
5653
|
-
var CommandList = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
5718
|
+
var CommandList = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx30(
|
|
5654
5719
|
CommandPrimitive.List,
|
|
5655
5720
|
{
|
|
5656
5721
|
ref,
|
|
@@ -5659,7 +5724,7 @@ var CommandList = React16.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5659
5724
|
}
|
|
5660
5725
|
));
|
|
5661
5726
|
CommandList.displayName = CommandPrimitive.List.displayName;
|
|
5662
|
-
var CommandEmpty = React16.forwardRef((props, ref) => /* @__PURE__ */
|
|
5727
|
+
var CommandEmpty = React16.forwardRef((props, ref) => /* @__PURE__ */ jsx30(
|
|
5663
5728
|
CommandPrimitive.Empty,
|
|
5664
5729
|
{
|
|
5665
5730
|
ref,
|
|
@@ -5668,7 +5733,7 @@ var CommandEmpty = React16.forwardRef((props, ref) => /* @__PURE__ */ jsx29(
|
|
|
5668
5733
|
}
|
|
5669
5734
|
));
|
|
5670
5735
|
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
|
5671
|
-
var CommandGroup = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
5736
|
+
var CommandGroup = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx30(
|
|
5672
5737
|
CommandPrimitive.Group,
|
|
5673
5738
|
{
|
|
5674
5739
|
ref,
|
|
@@ -5680,7 +5745,7 @@ var CommandGroup = React16.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
5680
5745
|
}
|
|
5681
5746
|
));
|
|
5682
5747
|
CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
|
5683
|
-
var CommandSeparator = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
5748
|
+
var CommandSeparator = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx30(
|
|
5684
5749
|
CommandPrimitive.Separator,
|
|
5685
5750
|
{
|
|
5686
5751
|
ref,
|
|
@@ -5689,7 +5754,7 @@ var CommandSeparator = React16.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
5689
5754
|
}
|
|
5690
5755
|
));
|
|
5691
5756
|
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
|
|
5692
|
-
var CommandItem = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
5757
|
+
var CommandItem = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx30(
|
|
5693
5758
|
CommandPrimitive.Item,
|
|
5694
5759
|
{
|
|
5695
5760
|
ref,
|
|
@@ -5705,7 +5770,7 @@ var CommandShortcut = ({
|
|
|
5705
5770
|
className,
|
|
5706
5771
|
...props
|
|
5707
5772
|
}) => {
|
|
5708
|
-
return /* @__PURE__ */
|
|
5773
|
+
return /* @__PURE__ */ jsx30(
|
|
5709
5774
|
"span",
|
|
5710
5775
|
{
|
|
5711
5776
|
className: cn(
|
|
@@ -5719,10 +5784,10 @@ var CommandShortcut = ({
|
|
|
5719
5784
|
CommandShortcut.displayName = "CommandShortcut";
|
|
5720
5785
|
|
|
5721
5786
|
// src/data-table/ColumnHeaderCell.tsx
|
|
5722
|
-
import { Fragment as Fragment4, jsx as
|
|
5787
|
+
import { Fragment as Fragment4, jsx as jsx31, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5723
5788
|
var HeaderButton = forwardRef12(({ dragDescription, "aria-describedby": tooltipDescription, ...props }, ref) => {
|
|
5724
5789
|
const descriptions = [tooltipDescription, dragDescription].filter((value) => Boolean(value)).join(" ");
|
|
5725
|
-
return /* @__PURE__ */
|
|
5790
|
+
return /* @__PURE__ */ jsx31(
|
|
5726
5791
|
"button",
|
|
5727
5792
|
{
|
|
5728
5793
|
ref,
|
|
@@ -5780,9 +5845,9 @@ function ColumnHeaderCell({
|
|
|
5780
5845
|
const reorderClass = reorderEnabled ? "touch-none cursor-grab active:cursor-grabbing" : void 0;
|
|
5781
5846
|
const filterActive = isColumnFilterActive(filterValue);
|
|
5782
5847
|
const deferredFilter = filterApplyLabel !== void 0 || filterShowCancel || filterFooterHint !== void 0;
|
|
5783
|
-
const [filterOpen, setFilterOpen] =
|
|
5784
|
-
const [draftFilter, setDraftFilter] =
|
|
5785
|
-
|
|
5848
|
+
const [filterOpen, setFilterOpen] = useState14(false);
|
|
5849
|
+
const [draftFilter, setDraftFilter] = useState14(filterValue);
|
|
5850
|
+
useEffect9(() => {
|
|
5786
5851
|
if (!filterOpen) setDraftFilter(filterValue);
|
|
5787
5852
|
}, [filterOpen, filterValue]);
|
|
5788
5853
|
const applyFilter = () => {
|
|
@@ -5802,7 +5867,7 @@ function ColumnHeaderCell({
|
|
|
5802
5867
|
else onFilterChange(next);
|
|
5803
5868
|
};
|
|
5804
5869
|
const menuLabel = labelText ? `Sort or filter ${labelText}` : "Sort or filter column";
|
|
5805
|
-
const menuContent = /* @__PURE__ */
|
|
5870
|
+
const menuContent = /* @__PURE__ */ jsxs22(
|
|
5806
5871
|
PopoverContent,
|
|
5807
5872
|
{
|
|
5808
5873
|
align: "start",
|
|
@@ -5819,9 +5884,9 @@ function ColumnHeaderCell({
|
|
|
5819
5884
|
input.focus();
|
|
5820
5885
|
},
|
|
5821
5886
|
children: [
|
|
5822
|
-
sortable ? /* @__PURE__ */
|
|
5823
|
-
/* @__PURE__ */
|
|
5824
|
-
/* @__PURE__ */
|
|
5887
|
+
sortable ? /* @__PURE__ */ jsxs22(Fragment4, { children: [
|
|
5888
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-0.5 pb-2", children: [
|
|
5889
|
+
/* @__PURE__ */ jsxs22(
|
|
5825
5890
|
Button,
|
|
5826
5891
|
{
|
|
5827
5892
|
variant: isSorted && sortDirection === "asc" ? "secondary" : "ghost",
|
|
@@ -5829,12 +5894,12 @@ function ColumnHeaderCell({
|
|
|
5829
5894
|
className: "h-8 justify-start gap-2 px-2 text-xs font-normal",
|
|
5830
5895
|
onClick: onSortAsc,
|
|
5831
5896
|
children: [
|
|
5832
|
-
/* @__PURE__ */
|
|
5897
|
+
/* @__PURE__ */ jsx31(ArrowUp, { className: "h-3.5 w-3.5" }),
|
|
5833
5898
|
"Sort ascending"
|
|
5834
5899
|
]
|
|
5835
5900
|
}
|
|
5836
5901
|
),
|
|
5837
|
-
/* @__PURE__ */
|
|
5902
|
+
/* @__PURE__ */ jsxs22(
|
|
5838
5903
|
Button,
|
|
5839
5904
|
{
|
|
5840
5905
|
variant: isSorted && sortDirection === "desc" ? "secondary" : "ghost",
|
|
@@ -5842,12 +5907,12 @@ function ColumnHeaderCell({
|
|
|
5842
5907
|
className: "h-8 justify-start gap-2 px-2 text-xs font-normal",
|
|
5843
5908
|
onClick: onSortDesc,
|
|
5844
5909
|
children: [
|
|
5845
|
-
/* @__PURE__ */
|
|
5910
|
+
/* @__PURE__ */ jsx31(ArrowDown, { className: "h-3.5 w-3.5" }),
|
|
5846
5911
|
"Sort descending"
|
|
5847
5912
|
]
|
|
5848
5913
|
}
|
|
5849
5914
|
),
|
|
5850
|
-
isSorted ? /* @__PURE__ */
|
|
5915
|
+
isSorted ? /* @__PURE__ */ jsxs22(
|
|
5851
5916
|
Button,
|
|
5852
5917
|
{
|
|
5853
5918
|
variant: "ghost",
|
|
@@ -5855,15 +5920,15 @@ function ColumnHeaderCell({
|
|
|
5855
5920
|
className: "h-8 justify-start gap-2 px-2 text-xs font-normal text-muted-foreground",
|
|
5856
5921
|
onClick: onClearSort,
|
|
5857
5922
|
children: [
|
|
5858
|
-
/* @__PURE__ */
|
|
5923
|
+
/* @__PURE__ */ jsx31(ListX, { className: "h-3.5 w-3.5" }),
|
|
5859
5924
|
"Clear sort"
|
|
5860
5925
|
]
|
|
5861
5926
|
}
|
|
5862
5927
|
) : null
|
|
5863
5928
|
] }),
|
|
5864
|
-
filterKind ? /* @__PURE__ */
|
|
5929
|
+
filterKind ? /* @__PURE__ */ jsx31("div", { className: "mb-2 h-px bg-border" }) : null
|
|
5865
5930
|
] }) : null,
|
|
5866
|
-
filterKind ? /* @__PURE__ */
|
|
5931
|
+
filterKind ? /* @__PURE__ */ jsx31(
|
|
5867
5932
|
FilterBody,
|
|
5868
5933
|
{
|
|
5869
5934
|
kind: filterKind,
|
|
@@ -5878,10 +5943,10 @@ function ColumnHeaderCell({
|
|
|
5878
5943
|
allowNullModes
|
|
5879
5944
|
}
|
|
5880
5945
|
) : null,
|
|
5881
|
-
filterKind && visibleFilter && allowNegation ? /* @__PURE__ */
|
|
5882
|
-
/* @__PURE__ */
|
|
5883
|
-
/* @__PURE__ */
|
|
5884
|
-
/* @__PURE__ */
|
|
5946
|
+
filterKind && visibleFilter && allowNegation ? /* @__PURE__ */ jsxs22("div", { className: "mt-2 border-t border-border pt-2", children: [
|
|
5947
|
+
/* @__PURE__ */ jsx31("p", { className: "mb-1 text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: "Match mode" }),
|
|
5948
|
+
/* @__PURE__ */ jsxs22("div", { className: "grid grid-cols-2 gap-1 rounded-md border p-0.5", children: [
|
|
5949
|
+
/* @__PURE__ */ jsx31(
|
|
5885
5950
|
"button",
|
|
5886
5951
|
{
|
|
5887
5952
|
type: "button",
|
|
@@ -5894,7 +5959,7 @@ function ColumnHeaderCell({
|
|
|
5894
5959
|
children: "Include"
|
|
5895
5960
|
}
|
|
5896
5961
|
),
|
|
5897
|
-
/* @__PURE__ */
|
|
5962
|
+
/* @__PURE__ */ jsx31(
|
|
5898
5963
|
"button",
|
|
5899
5964
|
{
|
|
5900
5965
|
type: "button",
|
|
@@ -5909,11 +5974,11 @@ function ColumnHeaderCell({
|
|
|
5909
5974
|
)
|
|
5910
5975
|
] })
|
|
5911
5976
|
] }) : null,
|
|
5912
|
-
filterKind && deferredFilter ? /* @__PURE__ */
|
|
5913
|
-
filterFooterHint ? /* @__PURE__ */
|
|
5914
|
-
/* @__PURE__ */
|
|
5915
|
-
filterShowCancel ? /* @__PURE__ */
|
|
5916
|
-
/* @__PURE__ */
|
|
5977
|
+
filterKind && deferredFilter ? /* @__PURE__ */ jsxs22("div", { className: "mt-2 border-t border-border pt-2", children: [
|
|
5978
|
+
filterFooterHint ? /* @__PURE__ */ jsx31("div", { className: "mb-2 text-xs text-muted-foreground", children: filterFooterHint }) : null,
|
|
5979
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex justify-end gap-2", children: [
|
|
5980
|
+
filterShowCancel ? /* @__PURE__ */ jsx31(Button, { type: "button", variant: "ghost", size: "sm", onClick: cancelFilter, children: "Cancel" }) : null,
|
|
5981
|
+
/* @__PURE__ */ jsx31(Button, { type: "button", size: "sm", onClick: applyFilter, children: filterApplyLabel ?? "Apply" })
|
|
5917
5982
|
] })
|
|
5918
5983
|
] }) : null
|
|
5919
5984
|
]
|
|
@@ -5922,10 +5987,10 @@ function ColumnHeaderCell({
|
|
|
5922
5987
|
if (compact) {
|
|
5923
5988
|
if (!sortable && !filterKind) {
|
|
5924
5989
|
if (!reorderEnabled) {
|
|
5925
|
-
return /* @__PURE__ */
|
|
5990
|
+
return /* @__PURE__ */ jsx31("div", { className: cn("flex items-center justify-center", className), children: label });
|
|
5926
5991
|
}
|
|
5927
|
-
return /* @__PURE__ */
|
|
5928
|
-
/* @__PURE__ */
|
|
5992
|
+
return /* @__PURE__ */ jsx31("div", { className: cn("flex items-center justify-center", className), children: /* @__PURE__ */ jsxs22(Tooltip, { children: [
|
|
5993
|
+
/* @__PURE__ */ jsx31(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx31(
|
|
5929
5994
|
HeaderButton,
|
|
5930
5995
|
{
|
|
5931
5996
|
type: "button",
|
|
@@ -5937,14 +6002,14 @@ function ColumnHeaderCell({
|
|
|
5937
6002
|
children: label
|
|
5938
6003
|
}
|
|
5939
6004
|
) }),
|
|
5940
|
-
/* @__PURE__ */
|
|
6005
|
+
/* @__PURE__ */ jsxs22(TooltipContent, { children: [
|
|
5941
6006
|
"Drag to reorder ",
|
|
5942
6007
|
reorderLabel,
|
|
5943
6008
|
"."
|
|
5944
6009
|
] })
|
|
5945
6010
|
] }) });
|
|
5946
6011
|
}
|
|
5947
|
-
return /* @__PURE__ */
|
|
6012
|
+
return /* @__PURE__ */ jsx31(
|
|
5948
6013
|
"div",
|
|
5949
6014
|
{
|
|
5950
6015
|
className: cn(
|
|
@@ -5952,9 +6017,9 @@ function ColumnHeaderCell({
|
|
|
5952
6017
|
align === "right" ? "justify-end" : "justify-center",
|
|
5953
6018
|
className
|
|
5954
6019
|
),
|
|
5955
|
-
children: /* @__PURE__ */
|
|
5956
|
-
/* @__PURE__ */
|
|
5957
|
-
/* @__PURE__ */
|
|
6020
|
+
children: /* @__PURE__ */ jsxs22(Popover, { open: filterOpen, onOpenChange: setFilterOpen, children: [
|
|
6021
|
+
/* @__PURE__ */ jsxs22(Tooltip, { children: [
|
|
6022
|
+
/* @__PURE__ */ jsx31(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx31(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs22(
|
|
5958
6023
|
HeaderButton,
|
|
5959
6024
|
{
|
|
5960
6025
|
type: "button",
|
|
@@ -5972,8 +6037,8 @@ function ColumnHeaderCell({
|
|
|
5972
6037
|
),
|
|
5973
6038
|
children: [
|
|
5974
6039
|
label,
|
|
5975
|
-
isSorted ? sortDirection === "asc" ? /* @__PURE__ */
|
|
5976
|
-
filterActive ? /* @__PURE__ */
|
|
6040
|
+
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,
|
|
6041
|
+
filterActive ? /* @__PURE__ */ jsx31(
|
|
5977
6042
|
"span",
|
|
5978
6043
|
{
|
|
5979
6044
|
"aria-hidden": true,
|
|
@@ -5983,7 +6048,7 @@ function ColumnHeaderCell({
|
|
|
5983
6048
|
]
|
|
5984
6049
|
}
|
|
5985
6050
|
) }) }),
|
|
5986
|
-
/* @__PURE__ */
|
|
6051
|
+
/* @__PURE__ */ jsxs22(TooltipContent, { children: [
|
|
5987
6052
|
"Canonical Matrx table \xB7 ",
|
|
5988
6053
|
menuLabel
|
|
5989
6054
|
] })
|
|
@@ -5993,7 +6058,7 @@ function ColumnHeaderCell({
|
|
|
5993
6058
|
}
|
|
5994
6059
|
);
|
|
5995
6060
|
}
|
|
5996
|
-
return /* @__PURE__ */
|
|
6061
|
+
return /* @__PURE__ */ jsxs22(
|
|
5997
6062
|
"div",
|
|
5998
6063
|
{
|
|
5999
6064
|
className: cn(
|
|
@@ -6003,8 +6068,8 @@ function ColumnHeaderCell({
|
|
|
6003
6068
|
className
|
|
6004
6069
|
),
|
|
6005
6070
|
children: [
|
|
6006
|
-
sortable ? /* @__PURE__ */
|
|
6007
|
-
/* @__PURE__ */
|
|
6071
|
+
sortable ? /* @__PURE__ */ jsxs22(Tooltip, { children: [
|
|
6072
|
+
/* @__PURE__ */ jsx31(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs22(
|
|
6008
6073
|
HeaderButton,
|
|
6009
6074
|
{
|
|
6010
6075
|
type: "button",
|
|
@@ -6016,14 +6081,14 @@ function ColumnHeaderCell({
|
|
|
6016
6081
|
isSorted ? "text-foreground" : "text-muted-foreground hover:text-foreground"
|
|
6017
6082
|
),
|
|
6018
6083
|
children: [
|
|
6019
|
-
/* @__PURE__ */
|
|
6020
|
-
isSorted ? sortDirection === "asc" ? /* @__PURE__ */
|
|
6084
|
+
/* @__PURE__ */ jsx31("span", { className: "truncate", children: label }),
|
|
6085
|
+
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
6086
|
]
|
|
6022
6087
|
}
|
|
6023
6088
|
) }),
|
|
6024
|
-
/* @__PURE__ */
|
|
6025
|
-
] }) : reorderEnabled ? /* @__PURE__ */
|
|
6026
|
-
/* @__PURE__ */
|
|
6089
|
+
/* @__PURE__ */ jsx31(TooltipContent, { children: reorderEnabled ? `Drag to reorder ${reorderLabel}.` : labelText ?? "Sort column" })
|
|
6090
|
+
] }) : reorderEnabled ? /* @__PURE__ */ jsxs22(Tooltip, { children: [
|
|
6091
|
+
/* @__PURE__ */ jsx31(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx31(
|
|
6027
6092
|
HeaderButton,
|
|
6028
6093
|
{
|
|
6029
6094
|
type: "button",
|
|
@@ -6035,16 +6100,16 @@ function ColumnHeaderCell({
|
|
|
6035
6100
|
children: label
|
|
6036
6101
|
}
|
|
6037
6102
|
) }),
|
|
6038
|
-
/* @__PURE__ */
|
|
6103
|
+
/* @__PURE__ */ jsxs22(TooltipContent, { children: [
|
|
6039
6104
|
"Drag to reorder ",
|
|
6040
6105
|
reorderLabel,
|
|
6041
6106
|
"."
|
|
6042
6107
|
] })
|
|
6043
|
-
] }) : /* @__PURE__ */
|
|
6044
|
-
filterKind || sortable ? /* @__PURE__ */
|
|
6045
|
-
/* @__PURE__ */
|
|
6046
|
-
/* @__PURE__ */
|
|
6047
|
-
/* @__PURE__ */
|
|
6108
|
+
] }) : /* @__PURE__ */ jsx31("span", { className: "truncate text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: label }),
|
|
6109
|
+
filterKind || sortable ? /* @__PURE__ */ jsxs22("div", { className: "inline-flex items-center", children: [
|
|
6110
|
+
/* @__PURE__ */ jsxs22(Popover, { open: filterOpen, onOpenChange: setFilterOpen, children: [
|
|
6111
|
+
/* @__PURE__ */ jsxs22(Tooltip, { children: [
|
|
6112
|
+
/* @__PURE__ */ jsx31(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx31(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx31(
|
|
6048
6113
|
"button",
|
|
6049
6114
|
{
|
|
6050
6115
|
type: "button",
|
|
@@ -6056,15 +6121,15 @@ function ColumnHeaderCell({
|
|
|
6056
6121
|
"rounded p-0.5 transition-colors",
|
|
6057
6122
|
filterActive ? "text-primary hover:text-primary/80" : "text-muted-foreground/40 hover:text-muted-foreground"
|
|
6058
6123
|
),
|
|
6059
|
-
children: filterKind ? /* @__PURE__ */
|
|
6124
|
+
children: filterKind ? /* @__PURE__ */ jsx31(ListFilter, { className: cn("h-3 w-3", filterActive && "fill-primary/20") }) : /* @__PURE__ */ jsx31(ArrowUpDown, { className: "h-3 w-3" })
|
|
6060
6125
|
}
|
|
6061
6126
|
) }) }),
|
|
6062
|
-
/* @__PURE__ */
|
|
6127
|
+
/* @__PURE__ */ jsx31(TooltipContent, { children: menuLabel })
|
|
6063
6128
|
] }),
|
|
6064
6129
|
menuContent
|
|
6065
6130
|
] }),
|
|
6066
|
-
filterActive ? /* @__PURE__ */
|
|
6067
|
-
/* @__PURE__ */
|
|
6131
|
+
filterActive ? /* @__PURE__ */ jsxs22(Tooltip, { children: [
|
|
6132
|
+
/* @__PURE__ */ jsx31(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx31(
|
|
6068
6133
|
"button",
|
|
6069
6134
|
{
|
|
6070
6135
|
type: "button",
|
|
@@ -6074,10 +6139,10 @@ function ColumnHeaderCell({
|
|
|
6074
6139
|
onFilterChange(void 0);
|
|
6075
6140
|
},
|
|
6076
6141
|
className: "rounded p-0.5 text-primary hover:bg-muted hover:text-foreground",
|
|
6077
|
-
children: /* @__PURE__ */
|
|
6142
|
+
children: /* @__PURE__ */ jsx31(X, { className: "h-3 w-3" })
|
|
6078
6143
|
}
|
|
6079
6144
|
) }),
|
|
6080
|
-
/* @__PURE__ */
|
|
6145
|
+
/* @__PURE__ */ jsx31(TooltipContent, { children: labelText ? `Clear ${labelText} filter` : "Clear this filter" })
|
|
6081
6146
|
] }) : null
|
|
6082
6147
|
] }) : null
|
|
6083
6148
|
]
|
|
@@ -6102,14 +6167,14 @@ function FilterBody({
|
|
|
6102
6167
|
onChange({ kind: "text", value: "", mode: next });
|
|
6103
6168
|
}
|
|
6104
6169
|
};
|
|
6105
|
-
return /* @__PURE__ */
|
|
6106
|
-
/* @__PURE__ */
|
|
6107
|
-
/* @__PURE__ */
|
|
6170
|
+
return /* @__PURE__ */ jsxs22("div", { className: "space-y-1.5 px-1", children: [
|
|
6171
|
+
/* @__PURE__ */ jsx31("p", { className: "text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: "Filter" }),
|
|
6172
|
+
/* @__PURE__ */ jsx31("div", { className: "flex gap-1", children: [
|
|
6108
6173
|
["contains", "Contains"],
|
|
6109
6174
|
["empty", "(empty)"],
|
|
6110
6175
|
["not_empty", "(not empty)"],
|
|
6111
6176
|
...allowNullModes ? [["null", "(null)"], ["not_null", "(not null)"]] : []
|
|
6112
|
-
].map(([m, label]) => /* @__PURE__ */
|
|
6177
|
+
].map(([m, label]) => /* @__PURE__ */ jsx31(
|
|
6113
6178
|
"button",
|
|
6114
6179
|
{
|
|
6115
6180
|
type: "button",
|
|
@@ -6123,8 +6188,8 @@ function FilterBody({
|
|
|
6123
6188
|
},
|
|
6124
6189
|
m
|
|
6125
6190
|
)) }),
|
|
6126
|
-
mode === "contains" && /* @__PURE__ */
|
|
6127
|
-
/* @__PURE__ */
|
|
6191
|
+
mode === "contains" && /* @__PURE__ */ jsxs22("div", { className: "relative", children: [
|
|
6192
|
+
/* @__PURE__ */ jsx31(
|
|
6128
6193
|
Input,
|
|
6129
6194
|
{
|
|
6130
6195
|
"data-matrx-filter-autofocus": true,
|
|
@@ -6137,14 +6202,14 @@ function FilterBody({
|
|
|
6137
6202
|
style: { fontSize: "16px" }
|
|
6138
6203
|
}
|
|
6139
6204
|
),
|
|
6140
|
-
text ? /* @__PURE__ */
|
|
6205
|
+
text ? /* @__PURE__ */ jsx31(
|
|
6141
6206
|
"button",
|
|
6142
6207
|
{
|
|
6143
6208
|
type: "button",
|
|
6144
6209
|
"aria-label": "Clear filter text",
|
|
6145
6210
|
className: "absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground hover:text-foreground",
|
|
6146
6211
|
onClick: () => onChange(void 0),
|
|
6147
|
-
children: /* @__PURE__ */
|
|
6212
|
+
children: /* @__PURE__ */ jsx31(X, { className: "h-3.5 w-3.5" })
|
|
6148
6213
|
}
|
|
6149
6214
|
) : null
|
|
6150
6215
|
] })
|
|
@@ -6152,7 +6217,7 @@ function FilterBody({
|
|
|
6152
6217
|
}
|
|
6153
6218
|
if (kind === "select") {
|
|
6154
6219
|
const selected = value?.kind === "select" ? value.values ?? (value.value && value.value !== "__all__" ? [value.value] : []) : [];
|
|
6155
|
-
return /* @__PURE__ */
|
|
6220
|
+
return /* @__PURE__ */ jsx31(
|
|
6156
6221
|
SearchableSelectFilter,
|
|
6157
6222
|
{
|
|
6158
6223
|
selected,
|
|
@@ -6164,9 +6229,9 @@ function FilterBody({
|
|
|
6164
6229
|
}
|
|
6165
6230
|
if (kind === "boolean") {
|
|
6166
6231
|
const current = value?.kind === "boolean" ? value.value : "__all__";
|
|
6167
|
-
return /* @__PURE__ */
|
|
6168
|
-
/* @__PURE__ */
|
|
6169
|
-
/* @__PURE__ */
|
|
6232
|
+
return /* @__PURE__ */ jsxs22("div", { className: "space-y-1.5 px-1", children: [
|
|
6233
|
+
/* @__PURE__ */ jsx31("p", { className: "text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: "Filter" }),
|
|
6234
|
+
/* @__PURE__ */ jsxs22(
|
|
6170
6235
|
Select,
|
|
6171
6236
|
{
|
|
6172
6237
|
value: current === "__all__" ? "__all__" : current ? "true" : "false",
|
|
@@ -6175,18 +6240,18 @@ function FilterBody({
|
|
|
6175
6240
|
else onChange({ kind: "boolean", value: v === "true" });
|
|
6176
6241
|
},
|
|
6177
6242
|
children: [
|
|
6178
|
-
/* @__PURE__ */
|
|
6179
|
-
/* @__PURE__ */
|
|
6180
|
-
/* @__PURE__ */
|
|
6181
|
-
/* @__PURE__ */
|
|
6182
|
-
/* @__PURE__ */
|
|
6243
|
+
/* @__PURE__ */ jsx31(SelectTrigger, { className: "h-8 text-xs", children: /* @__PURE__ */ jsx31(SelectValue, {}) }),
|
|
6244
|
+
/* @__PURE__ */ jsxs22(SelectContent, { children: [
|
|
6245
|
+
/* @__PURE__ */ jsx31(SelectItem, { value: "__all__", children: "All" }),
|
|
6246
|
+
/* @__PURE__ */ jsx31(SelectItem, { value: "true", children: "Yes" }),
|
|
6247
|
+
/* @__PURE__ */ jsx31(SelectItem, { value: "false", children: "No" })
|
|
6183
6248
|
] })
|
|
6184
6249
|
]
|
|
6185
6250
|
}
|
|
6186
6251
|
)
|
|
6187
6252
|
] });
|
|
6188
6253
|
}
|
|
6189
|
-
return /* @__PURE__ */
|
|
6254
|
+
return /* @__PURE__ */ jsx31(NumberFilterBody, { value, onChange });
|
|
6190
6255
|
}
|
|
6191
6256
|
function SearchableSelectFilter({
|
|
6192
6257
|
selected,
|
|
@@ -6194,7 +6259,7 @@ function SearchableSelectFilter({
|
|
|
6194
6259
|
onChange,
|
|
6195
6260
|
single = false
|
|
6196
6261
|
}) {
|
|
6197
|
-
const [query, setQuery] =
|
|
6262
|
+
const [query, setQuery] = useState14("");
|
|
6198
6263
|
const filtered = useMemo5(() => {
|
|
6199
6264
|
const q = query.trim().toLowerCase();
|
|
6200
6265
|
if (!q) return options;
|
|
@@ -6214,13 +6279,13 @@ function SearchableSelectFilter({
|
|
|
6214
6279
|
next.length === 0 ? void 0 : { kind: "select", value: next[0] ?? "", values: next }
|
|
6215
6280
|
);
|
|
6216
6281
|
};
|
|
6217
|
-
return /* @__PURE__ */
|
|
6218
|
-
/* @__PURE__ */
|
|
6219
|
-
/* @__PURE__ */
|
|
6282
|
+
return /* @__PURE__ */ jsxs22("div", { className: "space-y-1 px-0", children: [
|
|
6283
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between px-1 pb-1", children: [
|
|
6284
|
+
/* @__PURE__ */ jsxs22("p", { className: "text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: [
|
|
6220
6285
|
"Filter",
|
|
6221
6286
|
selected.length > 1 ? ` (any of ${selected.length})` : ""
|
|
6222
6287
|
] }),
|
|
6223
|
-
selected.length > 0 ? /* @__PURE__ */
|
|
6288
|
+
selected.length > 0 ? /* @__PURE__ */ jsx31(
|
|
6224
6289
|
"button",
|
|
6225
6290
|
{
|
|
6226
6291
|
type: "button",
|
|
@@ -6230,8 +6295,8 @@ function SearchableSelectFilter({
|
|
|
6230
6295
|
}
|
|
6231
6296
|
) : null
|
|
6232
6297
|
] }),
|
|
6233
|
-
/* @__PURE__ */
|
|
6234
|
-
/* @__PURE__ */
|
|
6298
|
+
/* @__PURE__ */ jsxs22(Command, { className: "rounded-md border border-border", shouldFilter: false, children: [
|
|
6299
|
+
/* @__PURE__ */ jsx31(
|
|
6235
6300
|
CommandInput,
|
|
6236
6301
|
{
|
|
6237
6302
|
"data-matrx-filter-autofocus": true,
|
|
@@ -6241,10 +6306,10 @@ function SearchableSelectFilter({
|
|
|
6241
6306
|
className: "h-8 text-sm"
|
|
6242
6307
|
}
|
|
6243
6308
|
),
|
|
6244
|
-
/* @__PURE__ */
|
|
6245
|
-
/* @__PURE__ */
|
|
6246
|
-
/* @__PURE__ */
|
|
6247
|
-
/* @__PURE__ */
|
|
6309
|
+
/* @__PURE__ */ jsxs22(CommandList, { className: "max-h-48", children: [
|
|
6310
|
+
/* @__PURE__ */ jsx31(CommandEmpty, { className: "py-3 text-xs text-muted-foreground", children: "No matches" }),
|
|
6311
|
+
/* @__PURE__ */ jsxs22(CommandGroup, { children: [
|
|
6312
|
+
/* @__PURE__ */ jsx31(
|
|
6248
6313
|
CommandItem,
|
|
6249
6314
|
{
|
|
6250
6315
|
value: "__all__",
|
|
@@ -6255,7 +6320,7 @@ function SearchableSelectFilter({
|
|
|
6255
6320
|
),
|
|
6256
6321
|
filtered.map((o) => {
|
|
6257
6322
|
const active = selected.includes(o.value);
|
|
6258
|
-
return /* @__PURE__ */
|
|
6323
|
+
return /* @__PURE__ */ jsxs22(
|
|
6259
6324
|
CommandItem,
|
|
6260
6325
|
{
|
|
6261
6326
|
value: o.value,
|
|
@@ -6265,7 +6330,7 @@ function SearchableSelectFilter({
|
|
|
6265
6330
|
active && "bg-accent text-accent-foreground"
|
|
6266
6331
|
),
|
|
6267
6332
|
children: [
|
|
6268
|
-
/* @__PURE__ */
|
|
6333
|
+
/* @__PURE__ */ jsx31(
|
|
6269
6334
|
"span",
|
|
6270
6335
|
{
|
|
6271
6336
|
className: cn(
|
|
@@ -6273,7 +6338,7 @@ function SearchableSelectFilter({
|
|
|
6273
6338
|
single ? "rounded-full" : "rounded-sm",
|
|
6274
6339
|
active ? "border-primary bg-primary text-primary-foreground" : "border-muted-foreground/40"
|
|
6275
6340
|
),
|
|
6276
|
-
children: active && /* @__PURE__ */
|
|
6341
|
+
children: active && /* @__PURE__ */ jsx31(Check, { className: "h-2.5 w-2.5" })
|
|
6277
6342
|
}
|
|
6278
6343
|
),
|
|
6279
6344
|
o.label
|
|
@@ -6293,8 +6358,8 @@ function NumberFilterBody({
|
|
|
6293
6358
|
}) {
|
|
6294
6359
|
const min = value?.kind === "number" ? value.min : void 0;
|
|
6295
6360
|
const max = value?.kind === "number" ? value.max : void 0;
|
|
6296
|
-
const [minText, setMinText] =
|
|
6297
|
-
const [maxText, setMaxText] =
|
|
6361
|
+
const [minText, setMinText] = useState14(min !== void 0 ? String(min) : "");
|
|
6362
|
+
const [maxText, setMaxText] = useState14(max !== void 0 ? String(max) : "");
|
|
6298
6363
|
const commit = (raw, which) => {
|
|
6299
6364
|
const nextMin = which === "min" ? parseOptionalNumber(raw) : min;
|
|
6300
6365
|
const nextMax = which === "max" ? parseOptionalNumber(raw) : max;
|
|
@@ -6304,10 +6369,10 @@ function NumberFilterBody({
|
|
|
6304
6369
|
}
|
|
6305
6370
|
onChange({ kind: "number", min: nextMin, max: nextMax });
|
|
6306
6371
|
};
|
|
6307
|
-
return /* @__PURE__ */
|
|
6308
|
-
/* @__PURE__ */
|
|
6309
|
-
/* @__PURE__ */
|
|
6310
|
-
(min !== void 0 || max !== void 0) && /* @__PURE__ */
|
|
6372
|
+
return /* @__PURE__ */ jsxs22("div", { className: "space-y-1.5 px-1", children: [
|
|
6373
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between", children: [
|
|
6374
|
+
/* @__PURE__ */ jsx31("p", { className: "text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: "Range" }),
|
|
6375
|
+
(min !== void 0 || max !== void 0) && /* @__PURE__ */ jsx31(
|
|
6311
6376
|
"button",
|
|
6312
6377
|
{
|
|
6313
6378
|
type: "button",
|
|
@@ -6321,8 +6386,8 @@ function NumberFilterBody({
|
|
|
6321
6386
|
}
|
|
6322
6387
|
)
|
|
6323
6388
|
] }),
|
|
6324
|
-
/* @__PURE__ */
|
|
6325
|
-
/* @__PURE__ */
|
|
6389
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex items-center gap-1.5", children: [
|
|
6390
|
+
/* @__PURE__ */ jsx31(
|
|
6326
6391
|
Input,
|
|
6327
6392
|
{
|
|
6328
6393
|
"data-matrx-filter-autofocus": true,
|
|
@@ -6337,8 +6402,8 @@ function NumberFilterBody({
|
|
|
6337
6402
|
style: { fontSize: "16px" }
|
|
6338
6403
|
}
|
|
6339
6404
|
),
|
|
6340
|
-
/* @__PURE__ */
|
|
6341
|
-
/* @__PURE__ */
|
|
6405
|
+
/* @__PURE__ */ jsx31("span", { className: "text-xs text-muted-foreground", children: "\u2013" }),
|
|
6406
|
+
/* @__PURE__ */ jsx31(
|
|
6342
6407
|
Input,
|
|
6343
6408
|
{
|
|
6344
6409
|
value: maxText,
|
|
@@ -6364,9 +6429,9 @@ function parseOptionalNumber(raw) {
|
|
|
6364
6429
|
// src/data-table/ColumnResizeHandle.tsx
|
|
6365
6430
|
import {
|
|
6366
6431
|
useCallback as useCallback5,
|
|
6367
|
-
useEffect as
|
|
6368
|
-
useRef as
|
|
6369
|
-
useState as
|
|
6432
|
+
useEffect as useEffect10,
|
|
6433
|
+
useRef as useRef10,
|
|
6434
|
+
useState as useState15
|
|
6370
6435
|
} from "react";
|
|
6371
6436
|
|
|
6372
6437
|
// src/data-table/column-resize.ts
|
|
@@ -6395,7 +6460,7 @@ function normalizeColumnWidthMap(widths, knownColumnIds) {
|
|
|
6395
6460
|
}
|
|
6396
6461
|
|
|
6397
6462
|
// src/data-table/ColumnResizeHandle.tsx
|
|
6398
|
-
import { jsx as
|
|
6463
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
6399
6464
|
var KEYBOARD_STEP = 8;
|
|
6400
6465
|
var KEYBOARD_LARGE_STEP = 24;
|
|
6401
6466
|
function ColumnResizeHandle({
|
|
@@ -6409,12 +6474,12 @@ function ColumnResizeHandle({
|
|
|
6409
6474
|
onResizeCancel,
|
|
6410
6475
|
onResizeCommit
|
|
6411
6476
|
}) {
|
|
6412
|
-
const handleRef =
|
|
6413
|
-
const activeResizeRef =
|
|
6414
|
-
const previewRafRef =
|
|
6415
|
-
const queuedWidthRef =
|
|
6416
|
-
const keyboardWidthRef =
|
|
6417
|
-
const [announcedWidth, setAnnouncedWidth] =
|
|
6477
|
+
const handleRef = useRef10(null);
|
|
6478
|
+
const activeResizeRef = useRef10(null);
|
|
6479
|
+
const previewRafRef = useRef10(null);
|
|
6480
|
+
const queuedWidthRef = useRef10(null);
|
|
6481
|
+
const keyboardWidthRef = useRef10(null);
|
|
6482
|
+
const [announcedWidth, setAnnouncedWidth] = useState15(null);
|
|
6418
6483
|
const bounds = resolveColumnResizeBounds(minWidth, maxWidth);
|
|
6419
6484
|
const cssVar = columnResizeCssVar(columnId2);
|
|
6420
6485
|
const readWidth = useCallback5(() => {
|
|
@@ -6461,7 +6526,7 @@ function ColumnResizeHandle({
|
|
|
6461
6526
|
handleRef.current.releasePointerCapture(active.pointerId);
|
|
6462
6527
|
}
|
|
6463
6528
|
}, [clearQueuedPreview, columnId2, cssVar, onResizeCancel, onResizeCommit, tableRef, writePreview]);
|
|
6464
|
-
|
|
6529
|
+
useEffect10(() => () => clearQueuedPreview(), [clearQueuedPreview]);
|
|
6465
6530
|
const onPointerDown = (event) => {
|
|
6466
6531
|
if (disabled || event.button !== 0 || !event.isPrimary) return;
|
|
6467
6532
|
event.preventDefault();
|
|
@@ -6514,7 +6579,7 @@ function ColumnResizeHandle({
|
|
|
6514
6579
|
onResizeCommit(columnId2, nextWidth);
|
|
6515
6580
|
};
|
|
6516
6581
|
const currentWidth = announcedWidth ?? keyboardWidthRef.current ?? bounds.minWidth;
|
|
6517
|
-
return /* @__PURE__ */
|
|
6582
|
+
return /* @__PURE__ */ jsx32(
|
|
6518
6583
|
"button",
|
|
6519
6584
|
{
|
|
6520
6585
|
ref: handleRef,
|
|
@@ -6616,9 +6681,9 @@ function rankTableSearchRows(rows, columns, query, options = {}, extraText) {
|
|
|
6616
6681
|
}
|
|
6617
6682
|
|
|
6618
6683
|
// src/data-table/ColumnManager.tsx
|
|
6619
|
-
import { useEffect as
|
|
6684
|
+
import { useEffect as useEffect11, useMemo as useMemo6, useState as useState16 } from "react";
|
|
6620
6685
|
import { useDndMonitor, useDraggable as useDraggable2, useDroppable } from "@dnd-kit/core";
|
|
6621
|
-
import { jsx as
|
|
6686
|
+
import { jsx as jsx33, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
6622
6687
|
function ColumnManager({
|
|
6623
6688
|
open,
|
|
6624
6689
|
onOpenChange,
|
|
@@ -6631,11 +6696,11 @@ function ColumnManager({
|
|
|
6631
6696
|
() => new Map(columns.map((column) => [columnId(column), column])),
|
|
6632
6697
|
[columns]
|
|
6633
6698
|
);
|
|
6634
|
-
const [draftOrder, setDraftOrder] =
|
|
6635
|
-
const [draftHidden, setDraftHidden] =
|
|
6636
|
-
const [draggedColumnId, setDraggedColumnId] =
|
|
6637
|
-
const [dropTarget, setDropTarget] =
|
|
6638
|
-
|
|
6699
|
+
const [draftOrder, setDraftOrder] = useState16(order);
|
|
6700
|
+
const [draftHidden, setDraftHidden] = useState16(() => new Set(hidden));
|
|
6701
|
+
const [draggedColumnId, setDraggedColumnId] = useState16(null);
|
|
6702
|
+
const [dropTarget, setDropTarget] = useState16(null);
|
|
6703
|
+
useEffect11(() => {
|
|
6639
6704
|
if (!open) return;
|
|
6640
6705
|
setDraftOrder(order);
|
|
6641
6706
|
setDraftHidden(new Set(hidden));
|
|
@@ -6692,18 +6757,18 @@ function ColumnManager({
|
|
|
6692
6757
|
if (target) moveTo(dragged, String(target));
|
|
6693
6758
|
}
|
|
6694
6759
|
});
|
|
6695
|
-
return /* @__PURE__ */
|
|
6696
|
-
/* @__PURE__ */
|
|
6697
|
-
/* @__PURE__ */
|
|
6698
|
-
/* @__PURE__ */
|
|
6760
|
+
return /* @__PURE__ */ jsx33(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs23(DialogContent, { className: "max-w-md", children: [
|
|
6761
|
+
/* @__PURE__ */ jsxs23(DialogHeader, { children: [
|
|
6762
|
+
/* @__PURE__ */ jsx33(DialogTitle, { children: "Columns" }),
|
|
6763
|
+
/* @__PURE__ */ jsx33(DialogDescription, { children: "Choose the columns to show and set their order." })
|
|
6699
6764
|
] }),
|
|
6700
|
-
/* @__PURE__ */
|
|
6765
|
+
/* @__PURE__ */ jsx33("div", { className: "max-h-[55dvh] divide-y overflow-y-auto rounded-md border", children: draftOrder.map((id, index) => {
|
|
6701
6766
|
const column = byId.get(id);
|
|
6702
6767
|
if (!column) return null;
|
|
6703
6768
|
const label = typeof column.header === "string" ? column.header : id;
|
|
6704
6769
|
const hideable = column.hideable !== false;
|
|
6705
6770
|
const visible = !draftHidden.has(id);
|
|
6706
|
-
return /* @__PURE__ */
|
|
6771
|
+
return /* @__PURE__ */ jsxs23(
|
|
6707
6772
|
ColumnManagerDropTarget,
|
|
6708
6773
|
{
|
|
6709
6774
|
id,
|
|
@@ -6713,8 +6778,8 @@ function ColumnManager({
|
|
|
6713
6778
|
dropTarget === id && draggedColumnId !== id && "border-t-2 border-primary"
|
|
6714
6779
|
),
|
|
6715
6780
|
children: [
|
|
6716
|
-
/* @__PURE__ */
|
|
6717
|
-
/* @__PURE__ */
|
|
6781
|
+
/* @__PURE__ */ jsx33(ColumnManagerDragHandle, { id, label }),
|
|
6782
|
+
/* @__PURE__ */ jsx33(
|
|
6718
6783
|
Checkbox,
|
|
6719
6784
|
{
|
|
6720
6785
|
checked: visible,
|
|
@@ -6731,8 +6796,8 @@ function ColumnManager({
|
|
|
6731
6796
|
}
|
|
6732
6797
|
}
|
|
6733
6798
|
),
|
|
6734
|
-
/* @__PURE__ */
|
|
6735
|
-
/* @__PURE__ */
|
|
6799
|
+
/* @__PURE__ */ jsx33("span", { className: "min-w-0 flex-1 truncate text-sm", children: label }),
|
|
6800
|
+
/* @__PURE__ */ jsx33(
|
|
6736
6801
|
Button,
|
|
6737
6802
|
{
|
|
6738
6803
|
type: "button",
|
|
@@ -6742,10 +6807,10 @@ function ColumnManager({
|
|
|
6742
6807
|
"aria-label": `Move ${label} earlier`,
|
|
6743
6808
|
disabled: index === 0,
|
|
6744
6809
|
onClick: () => move(id, -1),
|
|
6745
|
-
children: /* @__PURE__ */
|
|
6810
|
+
children: /* @__PURE__ */ jsx33(ArrowUp, { className: "h-4 w-4" })
|
|
6746
6811
|
}
|
|
6747
6812
|
),
|
|
6748
|
-
/* @__PURE__ */
|
|
6813
|
+
/* @__PURE__ */ jsx33(
|
|
6749
6814
|
Button,
|
|
6750
6815
|
{
|
|
6751
6816
|
type: "button",
|
|
@@ -6755,7 +6820,7 @@ function ColumnManager({
|
|
|
6755
6820
|
"aria-label": `Move ${label} later`,
|
|
6756
6821
|
disabled: index === draftOrder.length - 1,
|
|
6757
6822
|
onClick: () => move(id, 1),
|
|
6758
|
-
children: /* @__PURE__ */
|
|
6823
|
+
children: /* @__PURE__ */ jsx33(ArrowDown, { className: "h-4 w-4" })
|
|
6759
6824
|
}
|
|
6760
6825
|
)
|
|
6761
6826
|
]
|
|
@@ -6763,9 +6828,9 @@ function ColumnManager({
|
|
|
6763
6828
|
id
|
|
6764
6829
|
);
|
|
6765
6830
|
}) }),
|
|
6766
|
-
/* @__PURE__ */
|
|
6767
|
-
/* @__PURE__ */
|
|
6768
|
-
/* @__PURE__ */
|
|
6831
|
+
/* @__PURE__ */ jsxs23(DialogFooter, { children: [
|
|
6832
|
+
/* @__PURE__ */ jsx33(Button, { type: "button", variant: "outline", onClick: () => onOpenChange(false), children: "Cancel" }),
|
|
6833
|
+
/* @__PURE__ */ jsx33(
|
|
6769
6834
|
Button,
|
|
6770
6835
|
{
|
|
6771
6836
|
type: "button",
|
|
@@ -6788,14 +6853,14 @@ function ColumnManagerDropTarget({
|
|
|
6788
6853
|
id: `matrx-column-manager:${id}`,
|
|
6789
6854
|
data: { matrxDragKind: "column-manager", columnId: id }
|
|
6790
6855
|
});
|
|
6791
|
-
return /* @__PURE__ */
|
|
6856
|
+
return /* @__PURE__ */ jsx33("div", { ref: setNodeRef, "data-matrx-column-manager-drop-target": id, className, children });
|
|
6792
6857
|
}
|
|
6793
6858
|
function ColumnManagerDragHandle({ id, label }) {
|
|
6794
6859
|
const { attributes, listeners, setNodeRef } = useDraggable2({
|
|
6795
6860
|
id: `matrx-column-manager:${id}`,
|
|
6796
6861
|
data: { matrxDragKind: "column-manager", columnId: id }
|
|
6797
6862
|
});
|
|
6798
|
-
return /* @__PURE__ */
|
|
6863
|
+
return /* @__PURE__ */ jsx33(
|
|
6799
6864
|
"button",
|
|
6800
6865
|
{
|
|
6801
6866
|
ref: setNodeRef,
|
|
@@ -6805,7 +6870,7 @@ function ColumnManagerDragHandle({ id, label }) {
|
|
|
6805
6870
|
title: `Drag to reorder ${label}`,
|
|
6806
6871
|
...attributes,
|
|
6807
6872
|
...listeners,
|
|
6808
|
-
children: /* @__PURE__ */
|
|
6873
|
+
children: /* @__PURE__ */ jsx33(GripVertical, { className: "h-4 w-4" })
|
|
6809
6874
|
}
|
|
6810
6875
|
);
|
|
6811
6876
|
}
|
|
@@ -6869,11 +6934,11 @@ function parseTableViewSnapshot(raw) {
|
|
|
6869
6934
|
|
|
6870
6935
|
// src/data-table/MatrxUuidCell.tsx
|
|
6871
6936
|
import {
|
|
6872
|
-
useEffect as
|
|
6873
|
-
useRef as
|
|
6874
|
-
useState as
|
|
6937
|
+
useEffect as useEffect12,
|
|
6938
|
+
useRef as useRef11,
|
|
6939
|
+
useState as useState17
|
|
6875
6940
|
} from "react";
|
|
6876
|
-
import { jsx as
|
|
6941
|
+
import { jsx as jsx34, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
6877
6942
|
var SHORT_LEN = 8;
|
|
6878
6943
|
function shortUuid(id, len = SHORT_LEN) {
|
|
6879
6944
|
return id.slice(0, len);
|
|
@@ -6912,18 +6977,18 @@ function MatrxUuidCell({
|
|
|
6912
6977
|
}) {
|
|
6913
6978
|
const { resolveEntityDoors, ResourcePeek } = useMatrxDataTableHost();
|
|
6914
6979
|
const { notify, notice } = useTableNotice();
|
|
6915
|
-
const [copied, setCopied] =
|
|
6916
|
-
const [opening, setOpening] =
|
|
6917
|
-
const [peekOpen, setPeekOpen] =
|
|
6918
|
-
const timer =
|
|
6919
|
-
|
|
6980
|
+
const [copied, setCopied] = useState17(false);
|
|
6981
|
+
const [opening, setOpening] = useState17(false);
|
|
6982
|
+
const [peekOpen, setPeekOpen] = useState17(false);
|
|
6983
|
+
const timer = useRef11(null);
|
|
6984
|
+
useEffect12(
|
|
6920
6985
|
() => () => {
|
|
6921
6986
|
if (timer.current) clearTimeout(timer.current);
|
|
6922
6987
|
},
|
|
6923
6988
|
[]
|
|
6924
6989
|
);
|
|
6925
6990
|
if (!value) {
|
|
6926
|
-
return /* @__PURE__ */
|
|
6991
|
+
return /* @__PURE__ */ jsx34("span", { className: "text-muted-foreground/40", children: "\u2014" });
|
|
6927
6992
|
}
|
|
6928
6993
|
const doors = token ? resolveEntityDoors?.(token, value, href) ?? null : null;
|
|
6929
6994
|
const resolvedHref = doors?.href ?? href ?? null;
|
|
@@ -6966,13 +7031,13 @@ function MatrxUuidCell({
|
|
|
6966
7031
|
};
|
|
6967
7032
|
const idNode = (() => {
|
|
6968
7033
|
if (forbidden) {
|
|
6969
|
-
return /* @__PURE__ */
|
|
6970
|
-
/* @__PURE__ */
|
|
6971
|
-
/* @__PURE__ */
|
|
7034
|
+
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: [
|
|
7035
|
+
/* @__PURE__ */ jsx34("span", { className: "min-w-0 truncate", children: display }),
|
|
7036
|
+
/* @__PURE__ */ jsx34(ShieldOff, { className: "h-3 w-3 shrink-0 opacity-60", "aria-hidden": true })
|
|
6972
7037
|
] });
|
|
6973
7038
|
}
|
|
6974
7039
|
if (onOpen) {
|
|
6975
|
-
return /* @__PURE__ */
|
|
7040
|
+
return /* @__PURE__ */ jsxs24(
|
|
6976
7041
|
"button",
|
|
6977
7042
|
{
|
|
6978
7043
|
type: "button",
|
|
@@ -6981,14 +7046,14 @@ function MatrxUuidCell({
|
|
|
6981
7046
|
disabled: opening,
|
|
6982
7047
|
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
7048
|
children: [
|
|
6984
|
-
/* @__PURE__ */
|
|
6985
|
-
/* @__PURE__ */
|
|
7049
|
+
/* @__PURE__ */ jsx34("span", { className: "min-w-0 truncate tabular-nums", children: display }),
|
|
7050
|
+
/* @__PURE__ */ jsx34(PanelRight, { className: "h-3 w-3 shrink-0 opacity-50" })
|
|
6986
7051
|
]
|
|
6987
7052
|
}
|
|
6988
7053
|
);
|
|
6989
7054
|
}
|
|
6990
7055
|
if (resolvedHref) {
|
|
6991
|
-
return /* @__PURE__ */
|
|
7056
|
+
return /* @__PURE__ */ jsxs24(
|
|
6992
7057
|
"a",
|
|
6993
7058
|
{
|
|
6994
7059
|
href: resolvedHref,
|
|
@@ -6998,15 +7063,15 @@ function MatrxUuidCell({
|
|
|
6998
7063
|
onClick: stop,
|
|
6999
7064
|
className: "inline-flex min-w-0 items-center gap-1 font-mono text-xs text-sky-600 hover:underline dark:text-sky-400",
|
|
7000
7065
|
children: [
|
|
7001
|
-
/* @__PURE__ */
|
|
7002
|
-
/* @__PURE__ */
|
|
7066
|
+
/* @__PURE__ */ jsx34("span", { className: "min-w-0 truncate tabular-nums", children: display }),
|
|
7067
|
+
/* @__PURE__ */ jsx34(ExternalLink, { className: "h-3 w-3 shrink-0 opacity-50" })
|
|
7003
7068
|
]
|
|
7004
7069
|
}
|
|
7005
7070
|
);
|
|
7006
7071
|
}
|
|
7007
|
-
return /* @__PURE__ */
|
|
7072
|
+
return /* @__PURE__ */ jsx34("span", { className: "min-w-0 truncate font-mono text-xs text-muted-foreground tabular-nums select-all", children: display });
|
|
7008
7073
|
})();
|
|
7009
|
-
return /* @__PURE__ */
|
|
7074
|
+
return /* @__PURE__ */ jsx34(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ jsxs24(
|
|
7010
7075
|
"span",
|
|
7011
7076
|
{
|
|
7012
7077
|
"data-matrx-cell-control": true,
|
|
@@ -7016,12 +7081,12 @@ function MatrxUuidCell({
|
|
|
7016
7081
|
),
|
|
7017
7082
|
onClick: stop,
|
|
7018
7083
|
children: [
|
|
7019
|
-
/* @__PURE__ */
|
|
7020
|
-
/* @__PURE__ */
|
|
7021
|
-
/* @__PURE__ */
|
|
7084
|
+
/* @__PURE__ */ jsxs24(Tooltip, { children: [
|
|
7085
|
+
/* @__PURE__ */ jsx34(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx34("span", { className: "inline-flex min-w-0 max-w-full items-center", children: idNode }) }),
|
|
7086
|
+
/* @__PURE__ */ jsx34(TooltipContent, { side: "top", className: "max-w-sm break-all font-mono", children: forbidden ? `No access \xB7 ${tip}` : tip })
|
|
7022
7087
|
] }),
|
|
7023
|
-
/* @__PURE__ */
|
|
7024
|
-
/* @__PURE__ */
|
|
7088
|
+
/* @__PURE__ */ jsxs24(Tooltip, { children: [
|
|
7089
|
+
/* @__PURE__ */ jsx34(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx34(
|
|
7025
7090
|
"button",
|
|
7026
7091
|
{
|
|
7027
7092
|
type: "button",
|
|
@@ -7031,13 +7096,13 @@ function MatrxUuidCell({
|
|
|
7031
7096
|
"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
7097
|
copied && "text-primary"
|
|
7033
7098
|
),
|
|
7034
|
-
children: copied ? /* @__PURE__ */
|
|
7099
|
+
children: copied ? /* @__PURE__ */ jsx34(Check, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx34(Copy, { className: "h-3 w-3" })
|
|
7035
7100
|
}
|
|
7036
7101
|
) }),
|
|
7037
|
-
/* @__PURE__ */
|
|
7102
|
+
/* @__PURE__ */ jsx34(TooltipContent, { side: "top", children: copied ? "Copied" : `Copy ${label ?? "id"}: ${value}` })
|
|
7038
7103
|
] }),
|
|
7039
|
-
canPeek ? /* @__PURE__ */
|
|
7040
|
-
/* @__PURE__ */
|
|
7104
|
+
canPeek ? /* @__PURE__ */ jsxs24(Tooltip, { children: [
|
|
7105
|
+
/* @__PURE__ */ jsx34(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx34(
|
|
7041
7106
|
"button",
|
|
7042
7107
|
{
|
|
7043
7108
|
type: "button",
|
|
@@ -7047,16 +7112,16 @@ function MatrxUuidCell({
|
|
|
7047
7112
|
},
|
|
7048
7113
|
"aria-label": `Quick look at ${label ?? "record"}`,
|
|
7049
7114
|
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__ */
|
|
7115
|
+
children: /* @__PURE__ */ jsx34(Lightbulb, { className: "h-3 w-3" })
|
|
7051
7116
|
}
|
|
7052
7117
|
) }),
|
|
7053
|
-
/* @__PURE__ */
|
|
7118
|
+
/* @__PURE__ */ jsxs24(TooltipContent, { side: "top", children: [
|
|
7054
7119
|
"Quick look at ",
|
|
7055
7120
|
label ?? "record"
|
|
7056
7121
|
] })
|
|
7057
7122
|
] }) : null,
|
|
7058
|
-
onOpen && resolvedHref && !forbidden ? /* @__PURE__ */
|
|
7059
|
-
/* @__PURE__ */
|
|
7123
|
+
onOpen && resolvedHref && !forbidden ? /* @__PURE__ */ jsxs24(Tooltip, { children: [
|
|
7124
|
+
/* @__PURE__ */ jsx34(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx34(
|
|
7060
7125
|
"a",
|
|
7061
7126
|
{
|
|
7062
7127
|
href: resolvedHref,
|
|
@@ -7065,10 +7130,10 @@ function MatrxUuidCell({
|
|
|
7065
7130
|
onClick: stop,
|
|
7066
7131
|
"aria-label": `Open ${label ?? "record"} in a new tab`,
|
|
7067
7132
|
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__ */
|
|
7133
|
+
children: /* @__PURE__ */ jsx34(ExternalLink, { className: "h-3 w-3" })
|
|
7069
7134
|
}
|
|
7070
7135
|
) }),
|
|
7071
|
-
/* @__PURE__ */
|
|
7136
|
+
/* @__PURE__ */ jsxs24(TooltipContent, { side: "top", children: [
|
|
7072
7137
|
"Open ",
|
|
7073
7138
|
label ?? "record",
|
|
7074
7139
|
" in a new tab"
|
|
@@ -7076,7 +7141,7 @@ function MatrxUuidCell({
|
|
|
7076
7141
|
] }) : null,
|
|
7077
7142
|
trailing,
|
|
7078
7143
|
notice,
|
|
7079
|
-
canPeek && peekOpen && ResourcePeek ? /* @__PURE__ */
|
|
7144
|
+
canPeek && peekOpen && ResourcePeek ? /* @__PURE__ */ jsx34(
|
|
7080
7145
|
ResourcePeek,
|
|
7081
7146
|
{
|
|
7082
7147
|
kind: doors?.peekKind ?? token ?? "record",
|
|
@@ -7110,7 +7175,7 @@ function formatTableDisplayValue(value) {
|
|
|
7110
7175
|
}
|
|
7111
7176
|
|
|
7112
7177
|
// src/data-table/DataRowInspector.tsx
|
|
7113
|
-
import { jsx as
|
|
7178
|
+
import { jsx as jsx35, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
7114
7179
|
var noFieldToken = () => null;
|
|
7115
7180
|
function formatValue(value) {
|
|
7116
7181
|
if (value == null) return "\u2014";
|
|
@@ -7139,7 +7204,7 @@ function DataRowInspector({
|
|
|
7139
7204
|
tokenForField = noFieldToken
|
|
7140
7205
|
}) {
|
|
7141
7206
|
const entries = isPlainObject(row) ? Object.entries(row) : [["value", row]];
|
|
7142
|
-
const fieldButtons = (key, value) => fieldCopy ? /* @__PURE__ */
|
|
7207
|
+
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
7208
|
CopyButtons,
|
|
7144
7209
|
{
|
|
7145
7210
|
size: "xs",
|
|
@@ -7154,21 +7219,21 @@ function DataRowInspector({
|
|
|
7154
7219
|
})
|
|
7155
7220
|
}
|
|
7156
7221
|
) }) : null;
|
|
7157
|
-
return /* @__PURE__ */
|
|
7222
|
+
return /* @__PURE__ */ jsxs25(
|
|
7158
7223
|
"div",
|
|
7159
7224
|
{
|
|
7160
7225
|
className: cn("flex h-full min-h-0 flex-col overflow-hidden", className),
|
|
7161
7226
|
children: [
|
|
7162
|
-
title ? /* @__PURE__ */
|
|
7163
|
-
/* @__PURE__ */
|
|
7227
|
+
title ? /* @__PURE__ */ jsx35("div", { className: "shrink-0 border-b border-border px-3 py-2 text-sm font-medium", children: title }) : null,
|
|
7228
|
+
/* @__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
7229
|
if (isUuidValue(value)) {
|
|
7165
|
-
return /* @__PURE__ */
|
|
7230
|
+
return /* @__PURE__ */ jsxs25(
|
|
7166
7231
|
"div",
|
|
7167
7232
|
{
|
|
7168
7233
|
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
7234
|
children: [
|
|
7170
|
-
/* @__PURE__ */
|
|
7171
|
-
/* @__PURE__ */
|
|
7235
|
+
/* @__PURE__ */ jsx35("dt", { className: "truncate text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: key }),
|
|
7236
|
+
/* @__PURE__ */ jsx35("dd", { className: "min-w-0", children: /* @__PURE__ */ jsx35(
|
|
7172
7237
|
MatrxUuidCell,
|
|
7173
7238
|
{
|
|
7174
7239
|
value,
|
|
@@ -7183,13 +7248,13 @@ function DataRowInspector({
|
|
|
7183
7248
|
}
|
|
7184
7249
|
const formatted = value !== null && typeof value === "object" && !(value instanceof Date) ? formatValue(value) : formatTableDisplayValue(value);
|
|
7185
7250
|
const multiline = formatted.includes("\n") || formatted.length > 80;
|
|
7186
|
-
return /* @__PURE__ */
|
|
7251
|
+
return /* @__PURE__ */ jsxs25(
|
|
7187
7252
|
"div",
|
|
7188
7253
|
{
|
|
7189
7254
|
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
7255
|
children: [
|
|
7191
|
-
/* @__PURE__ */
|
|
7192
|
-
/* @__PURE__ */
|
|
7256
|
+
/* @__PURE__ */ jsx35("dt", { className: "truncate text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: key }),
|
|
7257
|
+
/* @__PURE__ */ jsx35(
|
|
7193
7258
|
"dd",
|
|
7194
7259
|
{
|
|
7195
7260
|
className: cn(
|
|
@@ -7211,8 +7276,8 @@ function DataRowInspector({
|
|
|
7211
7276
|
}
|
|
7212
7277
|
|
|
7213
7278
|
// src/data-table/DataRowWindow.tsx
|
|
7214
|
-
import { useEffect as
|
|
7215
|
-
import { jsx as
|
|
7279
|
+
import { useEffect as useEffect13, useState as useState18 } from "react";
|
|
7280
|
+
import { jsx as jsx36, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
7216
7281
|
function DataRowWindow({
|
|
7217
7282
|
isOpen,
|
|
7218
7283
|
onClose,
|
|
@@ -7232,15 +7297,15 @@ function DataRowWindow({
|
|
|
7232
7297
|
const hasEdit = editContent != null;
|
|
7233
7298
|
const hasTabs = hasEdit && children == null;
|
|
7234
7299
|
const initialTab = defaultTab ?? (hasEdit ? "edit" : "view");
|
|
7235
|
-
const [tab, setTab] =
|
|
7236
|
-
|
|
7300
|
+
const [tab, setTab] = useState18(initialTab);
|
|
7301
|
+
useEffect13(() => {
|
|
7237
7302
|
if (!isOpen) return;
|
|
7238
7303
|
setTab(defaultTab ?? (hasEdit ? "edit" : "view"));
|
|
7239
7304
|
}, [isOpen, windowId, hasEdit, defaultTab]);
|
|
7240
7305
|
if (!isOpen) return null;
|
|
7241
|
-
const viewBody = viewContent ?? /* @__PURE__ */
|
|
7242
|
-
const body = children ?? /* @__PURE__ */
|
|
7243
|
-
return /* @__PURE__ */
|
|
7306
|
+
const viewBody = viewContent ?? /* @__PURE__ */ jsx36(DataRowInspector, { row });
|
|
7307
|
+
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 }) });
|
|
7308
|
+
return /* @__PURE__ */ jsx36(
|
|
7244
7309
|
WindowPanel,
|
|
7245
7310
|
{
|
|
7246
7311
|
id: windowId,
|
|
@@ -7254,26 +7319,26 @@ function DataRowWindow({
|
|
|
7254
7319
|
bodyClassName: "flex min-h-0 flex-1 flex-col overflow-hidden p-0",
|
|
7255
7320
|
sidebarDefaultSize: 140,
|
|
7256
7321
|
sidebarMinSize: 110,
|
|
7257
|
-
sidebar: hasTabs ? /* @__PURE__ */
|
|
7322
|
+
sidebar: hasTabs ? /* @__PURE__ */ jsxs26(
|
|
7258
7323
|
"nav",
|
|
7259
7324
|
{
|
|
7260
7325
|
"aria-label": "Row window tabs",
|
|
7261
7326
|
className: "flex h-full flex-col gap-0.5 overflow-y-auto p-1.5",
|
|
7262
7327
|
children: [
|
|
7263
|
-
/* @__PURE__ */
|
|
7328
|
+
/* @__PURE__ */ jsx36(
|
|
7264
7329
|
TabButton,
|
|
7265
7330
|
{
|
|
7266
7331
|
active: tab === "view",
|
|
7267
|
-
icon: /* @__PURE__ */
|
|
7332
|
+
icon: /* @__PURE__ */ jsx36(Eye, { className: "h-4 w-4 shrink-0" }),
|
|
7268
7333
|
label: "View",
|
|
7269
7334
|
onClick: () => setTab("view")
|
|
7270
7335
|
}
|
|
7271
7336
|
),
|
|
7272
|
-
/* @__PURE__ */
|
|
7337
|
+
/* @__PURE__ */ jsx36(
|
|
7273
7338
|
TabButton,
|
|
7274
7339
|
{
|
|
7275
7340
|
active: tab === "edit",
|
|
7276
|
-
icon: /* @__PURE__ */
|
|
7341
|
+
icon: /* @__PURE__ */ jsx36(Pencil, { className: "h-4 w-4 shrink-0" }),
|
|
7277
7342
|
label: "Edit",
|
|
7278
7343
|
onClick: () => setTab("edit")
|
|
7279
7344
|
}
|
|
@@ -7291,7 +7356,7 @@ function TabButton({
|
|
|
7291
7356
|
label,
|
|
7292
7357
|
onClick
|
|
7293
7358
|
}) {
|
|
7294
|
-
return /* @__PURE__ */
|
|
7359
|
+
return /* @__PURE__ */ jsxs26(
|
|
7295
7360
|
"button",
|
|
7296
7361
|
{
|
|
7297
7362
|
type: "button",
|
|
@@ -7304,7 +7369,7 @@ function TabButton({
|
|
|
7304
7369
|
),
|
|
7305
7370
|
children: [
|
|
7306
7371
|
icon,
|
|
7307
|
-
/* @__PURE__ */
|
|
7372
|
+
/* @__PURE__ */ jsx36("span", { className: "min-w-0 flex-1 truncate", children: label })
|
|
7308
7373
|
]
|
|
7309
7374
|
}
|
|
7310
7375
|
);
|
|
@@ -7327,7 +7392,7 @@ function defaultRowTitle(row, columns) {
|
|
|
7327
7392
|
}
|
|
7328
7393
|
|
|
7329
7394
|
// src/data-table/DirtySavePill.tsx
|
|
7330
|
-
import { jsx as
|
|
7395
|
+
import { jsx as jsx37, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
7331
7396
|
function DirtySavePill({
|
|
7332
7397
|
changeCount,
|
|
7333
7398
|
saving,
|
|
@@ -7336,20 +7401,20 @@ function DirtySavePill({
|
|
|
7336
7401
|
className
|
|
7337
7402
|
}) {
|
|
7338
7403
|
if (changeCount <= 0) return null;
|
|
7339
|
-
return /* @__PURE__ */
|
|
7404
|
+
return /* @__PURE__ */ jsx37(
|
|
7340
7405
|
"div",
|
|
7341
7406
|
{
|
|
7342
7407
|
className: cn(
|
|
7343
7408
|
"pointer-events-none fixed inset-x-0 bottom-6 z-50 flex justify-center pb-safe",
|
|
7344
7409
|
className
|
|
7345
7410
|
),
|
|
7346
|
-
children: /* @__PURE__ */
|
|
7347
|
-
/* @__PURE__ */
|
|
7411
|
+
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: [
|
|
7412
|
+
/* @__PURE__ */ jsxs27("span", { className: "px-1 text-xs font-medium text-muted-foreground", children: [
|
|
7348
7413
|
changeCount,
|
|
7349
7414
|
" unsaved change",
|
|
7350
7415
|
changeCount === 1 ? "" : "s"
|
|
7351
7416
|
] }),
|
|
7352
|
-
/* @__PURE__ */
|
|
7417
|
+
/* @__PURE__ */ jsxs27(
|
|
7353
7418
|
Button,
|
|
7354
7419
|
{
|
|
7355
7420
|
type: "button",
|
|
@@ -7359,12 +7424,12 @@ function DirtySavePill({
|
|
|
7359
7424
|
disabled: saving,
|
|
7360
7425
|
onClick: onCancel,
|
|
7361
7426
|
children: [
|
|
7362
|
-
/* @__PURE__ */
|
|
7427
|
+
/* @__PURE__ */ jsx37(X, { className: "h-3.5 w-3.5" }),
|
|
7363
7428
|
"Cancel"
|
|
7364
7429
|
]
|
|
7365
7430
|
}
|
|
7366
7431
|
),
|
|
7367
|
-
/* @__PURE__ */
|
|
7432
|
+
/* @__PURE__ */ jsxs27(
|
|
7368
7433
|
Button,
|
|
7369
7434
|
{
|
|
7370
7435
|
type: "button",
|
|
@@ -7373,7 +7438,7 @@ function DirtySavePill({
|
|
|
7373
7438
|
disabled: saving,
|
|
7374
7439
|
onClick: onSave,
|
|
7375
7440
|
children: [
|
|
7376
|
-
saving ? /* @__PURE__ */
|
|
7441
|
+
saving ? /* @__PURE__ */ jsx37(Loader2, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ jsx37(Save, { className: "h-3.5 w-3.5" }),
|
|
7377
7442
|
"Save"
|
|
7378
7443
|
]
|
|
7379
7444
|
}
|
|
@@ -7384,8 +7449,8 @@ function DirtySavePill({
|
|
|
7384
7449
|
}
|
|
7385
7450
|
|
|
7386
7451
|
// src/data-table/EditableTableCell.tsx
|
|
7387
|
-
import { useState as
|
|
7388
|
-
import { jsx as
|
|
7452
|
+
import { useEffect as useEffect14, useRef as useRef12, useState as useState19 } from "react";
|
|
7453
|
+
import { jsx as jsx38, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
7389
7454
|
function CellEditShell({
|
|
7390
7455
|
href,
|
|
7391
7456
|
display,
|
|
@@ -7394,8 +7459,8 @@ function CellEditShell({
|
|
|
7394
7459
|
editButton
|
|
7395
7460
|
}) {
|
|
7396
7461
|
const { Link: HostLink } = useMatrxDataTableHost();
|
|
7397
|
-
const Link = HostLink ?? ((props) => /* @__PURE__ */
|
|
7398
|
-
return /* @__PURE__ */
|
|
7462
|
+
const Link = HostLink ?? ((props) => /* @__PURE__ */ jsx38("a", { ...props }));
|
|
7463
|
+
return /* @__PURE__ */ jsxs28(
|
|
7399
7464
|
"span",
|
|
7400
7465
|
{
|
|
7401
7466
|
className: cn(
|
|
@@ -7407,7 +7472,7 @@ function CellEditShell({
|
|
|
7407
7472
|
className
|
|
7408
7473
|
),
|
|
7409
7474
|
children: [
|
|
7410
|
-
href ? /* @__PURE__ */
|
|
7475
|
+
href ? /* @__PURE__ */ jsx38(
|
|
7411
7476
|
Link,
|
|
7412
7477
|
{
|
|
7413
7478
|
href,
|
|
@@ -7415,7 +7480,7 @@ function CellEditShell({
|
|
|
7415
7480
|
className: "min-w-0 flex-1 overflow-hidden truncate rounded outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
7416
7481
|
children: display
|
|
7417
7482
|
}
|
|
7418
|
-
) : /* @__PURE__ */
|
|
7483
|
+
) : /* @__PURE__ */ jsx38("span", { className: "block min-w-0 flex-1 overflow-hidden", children: display }),
|
|
7419
7484
|
editButton
|
|
7420
7485
|
]
|
|
7421
7486
|
}
|
|
@@ -7431,12 +7496,16 @@ function EditableTableCell({
|
|
|
7431
7496
|
onCommit,
|
|
7432
7497
|
className,
|
|
7433
7498
|
href,
|
|
7434
|
-
editTrigger = "click"
|
|
7499
|
+
editTrigger = "click",
|
|
7500
|
+
editRequest
|
|
7435
7501
|
}) {
|
|
7436
|
-
const [open, setOpen] =
|
|
7502
|
+
const [open, setOpen] = useState19(false);
|
|
7503
|
+
useEffect14(() => {
|
|
7504
|
+
if (editRequest !== void 0) setOpen(true);
|
|
7505
|
+
}, [editRequest]);
|
|
7437
7506
|
const usePencil = Boolean(href) || editTrigger === "pencil";
|
|
7438
7507
|
if (editType === "string") {
|
|
7439
|
-
return /* @__PURE__ */
|
|
7508
|
+
return /* @__PURE__ */ jsx38(
|
|
7440
7509
|
InlineStringEditor,
|
|
7441
7510
|
{
|
|
7442
7511
|
value: stringifyCellValue(value),
|
|
@@ -7445,34 +7514,35 @@ function EditableTableCell({
|
|
|
7445
7514
|
onCommit,
|
|
7446
7515
|
...className === void 0 ? {} : { className },
|
|
7447
7516
|
...href === void 0 ? {} : { href },
|
|
7448
|
-
usePencil
|
|
7517
|
+
usePencil,
|
|
7518
|
+
...editRequest === void 0 ? {} : { editRequest }
|
|
7449
7519
|
}
|
|
7450
7520
|
);
|
|
7451
7521
|
}
|
|
7452
|
-
return /* @__PURE__ */
|
|
7453
|
-
usePencil ? /* @__PURE__ */
|
|
7522
|
+
return /* @__PURE__ */ jsxs28(Popover, { open, onOpenChange: setOpen, children: [
|
|
7523
|
+
usePencil ? /* @__PURE__ */ jsx38(
|
|
7454
7524
|
CellEditShell,
|
|
7455
7525
|
{
|
|
7456
7526
|
...href === void 0 ? {} : { href },
|
|
7457
7527
|
display,
|
|
7458
7528
|
...dirty === void 0 ? {} : { dirty },
|
|
7459
7529
|
...className === void 0 ? {} : { className },
|
|
7460
|
-
editButton: /* @__PURE__ */
|
|
7461
|
-
/* @__PURE__ */
|
|
7530
|
+
editButton: /* @__PURE__ */ jsxs28(Tooltip, { children: [
|
|
7531
|
+
/* @__PURE__ */ jsx38(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx38(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx38(
|
|
7462
7532
|
"button",
|
|
7463
7533
|
{
|
|
7464
7534
|
type: "button",
|
|
7465
7535
|
"aria-label": "Edit",
|
|
7466
7536
|
onClick: (e) => e.stopPropagation(),
|
|
7467
7537
|
className: CELL_PENCIL_CLASS,
|
|
7468
|
-
children: /* @__PURE__ */
|
|
7538
|
+
children: /* @__PURE__ */ jsx38(Pencil, { className: "h-3 w-3" })
|
|
7469
7539
|
}
|
|
7470
7540
|
) }) }),
|
|
7471
|
-
/* @__PURE__ */
|
|
7541
|
+
/* @__PURE__ */ jsx38(TooltipContent, { children: "Edit" })
|
|
7472
7542
|
] })
|
|
7473
7543
|
}
|
|
7474
|
-
) : /* @__PURE__ */
|
|
7475
|
-
/* @__PURE__ */
|
|
7544
|
+
) : /* @__PURE__ */ jsxs28(Tooltip, { children: [
|
|
7545
|
+
/* @__PURE__ */ jsx38(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx38(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs28(
|
|
7476
7546
|
"button",
|
|
7477
7547
|
{
|
|
7478
7548
|
type: "button",
|
|
@@ -7483,20 +7553,20 @@ function EditableTableCell({
|
|
|
7483
7553
|
className
|
|
7484
7554
|
),
|
|
7485
7555
|
children: [
|
|
7486
|
-
/* @__PURE__ */
|
|
7487
|
-
editType === "select" ? /* @__PURE__ */
|
|
7556
|
+
/* @__PURE__ */ jsx38("span", { className: "min-w-0 flex-1 overflow-hidden", children: display }),
|
|
7557
|
+
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
7558
|
]
|
|
7489
7559
|
}
|
|
7490
7560
|
) }) }),
|
|
7491
|
-
/* @__PURE__ */
|
|
7561
|
+
/* @__PURE__ */ jsx38(TooltipContent, { children: "Edit value" })
|
|
7492
7562
|
] }),
|
|
7493
|
-
/* @__PURE__ */
|
|
7563
|
+
/* @__PURE__ */ jsx38(
|
|
7494
7564
|
PopoverContent,
|
|
7495
7565
|
{
|
|
7496
7566
|
align: "start",
|
|
7497
7567
|
className: "w-56 p-2",
|
|
7498
7568
|
onClick: (e) => e.stopPropagation(),
|
|
7499
|
-
children: /* @__PURE__ */
|
|
7569
|
+
children: /* @__PURE__ */ jsx38(
|
|
7500
7570
|
TypedEditor,
|
|
7501
7571
|
{
|
|
7502
7572
|
editType,
|
|
@@ -7520,21 +7590,29 @@ function InlineStringEditor({
|
|
|
7520
7590
|
onCommit,
|
|
7521
7591
|
className,
|
|
7522
7592
|
href,
|
|
7523
|
-
usePencil
|
|
7593
|
+
usePencil,
|
|
7594
|
+
editRequest
|
|
7524
7595
|
}) {
|
|
7525
|
-
const [editing, setEditing] =
|
|
7526
|
-
const [draft, setDraft] =
|
|
7596
|
+
const [editing, setEditing] = useState19(false);
|
|
7597
|
+
const [draft, setDraft] = useState19(value);
|
|
7598
|
+
const handledEditRequest = useRef12(void 0);
|
|
7599
|
+
useEffect14(() => {
|
|
7600
|
+
if (editRequest === void 0 || handledEditRequest.current === editRequest) return;
|
|
7601
|
+
handledEditRequest.current = editRequest;
|
|
7602
|
+
setDraft(value);
|
|
7603
|
+
setEditing(true);
|
|
7604
|
+
}, [editRequest, value]);
|
|
7527
7605
|
if (!editing) {
|
|
7528
7606
|
if (usePencil) {
|
|
7529
|
-
return /* @__PURE__ */
|
|
7607
|
+
return /* @__PURE__ */ jsx38(
|
|
7530
7608
|
CellEditShell,
|
|
7531
7609
|
{
|
|
7532
7610
|
...href === void 0 ? {} : { href },
|
|
7533
7611
|
display,
|
|
7534
7612
|
...dirty === void 0 ? {} : { dirty },
|
|
7535
7613
|
...className === void 0 ? {} : { className },
|
|
7536
|
-
editButton: /* @__PURE__ */
|
|
7537
|
-
/* @__PURE__ */
|
|
7614
|
+
editButton: /* @__PURE__ */ jsxs28(Tooltip, { children: [
|
|
7615
|
+
/* @__PURE__ */ jsx38(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx38(
|
|
7538
7616
|
"button",
|
|
7539
7617
|
{
|
|
7540
7618
|
type: "button",
|
|
@@ -7545,16 +7623,16 @@ function InlineStringEditor({
|
|
|
7545
7623
|
setEditing(true);
|
|
7546
7624
|
},
|
|
7547
7625
|
className: CELL_PENCIL_CLASS,
|
|
7548
|
-
children: /* @__PURE__ */
|
|
7626
|
+
children: /* @__PURE__ */ jsx38(Pencil, { className: "h-3 w-3" })
|
|
7549
7627
|
}
|
|
7550
7628
|
) }),
|
|
7551
|
-
/* @__PURE__ */
|
|
7629
|
+
/* @__PURE__ */ jsx38(TooltipContent, { children: "Edit" })
|
|
7552
7630
|
] })
|
|
7553
7631
|
}
|
|
7554
7632
|
);
|
|
7555
7633
|
}
|
|
7556
|
-
return /* @__PURE__ */
|
|
7557
|
-
/* @__PURE__ */
|
|
7634
|
+
return /* @__PURE__ */ jsxs28(Tooltip, { children: [
|
|
7635
|
+
/* @__PURE__ */ jsx38(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx38(
|
|
7558
7636
|
"button",
|
|
7559
7637
|
{
|
|
7560
7638
|
type: "button",
|
|
@@ -7571,10 +7649,10 @@ function InlineStringEditor({
|
|
|
7571
7649
|
children: display
|
|
7572
7650
|
}
|
|
7573
7651
|
) }),
|
|
7574
|
-
/* @__PURE__ */
|
|
7652
|
+
/* @__PURE__ */ jsx38(TooltipContent, { children: "Click to edit" })
|
|
7575
7653
|
] });
|
|
7576
7654
|
}
|
|
7577
|
-
return /* @__PURE__ */
|
|
7655
|
+
return /* @__PURE__ */ jsx38(
|
|
7578
7656
|
Input,
|
|
7579
7657
|
{
|
|
7580
7658
|
autoFocus: true,
|
|
@@ -7610,9 +7688,9 @@ function TypedEditor({
|
|
|
7610
7688
|
}) {
|
|
7611
7689
|
if (editType === "boolean") {
|
|
7612
7690
|
const checked = Boolean(value);
|
|
7613
|
-
return /* @__PURE__ */
|
|
7614
|
-
/* @__PURE__ */
|
|
7615
|
-
/* @__PURE__ */
|
|
7691
|
+
return /* @__PURE__ */ jsxs28("div", { className: "flex items-center justify-between gap-2", children: [
|
|
7692
|
+
/* @__PURE__ */ jsx38("span", { className: "text-xs font-medium", children: "Value" }),
|
|
7693
|
+
/* @__PURE__ */ jsx38(
|
|
7616
7694
|
Checkbox,
|
|
7617
7695
|
{
|
|
7618
7696
|
checked,
|
|
@@ -7622,7 +7700,7 @@ function TypedEditor({
|
|
|
7622
7700
|
] });
|
|
7623
7701
|
}
|
|
7624
7702
|
if (editType === "number") {
|
|
7625
|
-
return /* @__PURE__ */
|
|
7703
|
+
return /* @__PURE__ */ jsx38(
|
|
7626
7704
|
NumberEditor,
|
|
7627
7705
|
{
|
|
7628
7706
|
value: typeof value === "number" ? value : Number(value) || 0,
|
|
@@ -7632,7 +7710,7 @@ function TypedEditor({
|
|
|
7632
7710
|
);
|
|
7633
7711
|
}
|
|
7634
7712
|
if (editType === "tags") {
|
|
7635
|
-
return /* @__PURE__ */
|
|
7713
|
+
return /* @__PURE__ */ jsx38(
|
|
7636
7714
|
TagsEditor,
|
|
7637
7715
|
{
|
|
7638
7716
|
value: Array.isArray(value) ? value.map(String) : [],
|
|
@@ -7643,19 +7721,19 @@ function TypedEditor({
|
|
|
7643
7721
|
);
|
|
7644
7722
|
}
|
|
7645
7723
|
if (editType === "select") {
|
|
7646
|
-
return /* @__PURE__ */
|
|
7724
|
+
return /* @__PURE__ */ jsxs28(
|
|
7647
7725
|
Select,
|
|
7648
7726
|
{
|
|
7649
7727
|
value: stringifyCellValue(value),
|
|
7650
7728
|
onValueChange: (v) => onCommit(v),
|
|
7651
7729
|
children: [
|
|
7652
|
-
/* @__PURE__ */
|
|
7653
|
-
/* @__PURE__ */
|
|
7730
|
+
/* @__PURE__ */ jsx38(SelectTrigger, { className: "h-8 text-xs", children: /* @__PURE__ */ jsx38(SelectValue, {}) }),
|
|
7731
|
+
/* @__PURE__ */ jsx38(SelectContent, { children: editOptions.map((o) => /* @__PURE__ */ jsx38(SelectItem, { value: o.value, children: o.label }, o.value)) })
|
|
7654
7732
|
]
|
|
7655
7733
|
}
|
|
7656
7734
|
);
|
|
7657
7735
|
}
|
|
7658
|
-
return /* @__PURE__ */
|
|
7736
|
+
return /* @__PURE__ */ jsx38(
|
|
7659
7737
|
Input,
|
|
7660
7738
|
{
|
|
7661
7739
|
type: "date",
|
|
@@ -7674,8 +7752,8 @@ function TagsEditor({
|
|
|
7674
7752
|
onCommit,
|
|
7675
7753
|
onCancel
|
|
7676
7754
|
}) {
|
|
7677
|
-
const [tags, setTags] =
|
|
7678
|
-
const [draft, setDraft] =
|
|
7755
|
+
const [tags, setTags] = useState19(value);
|
|
7756
|
+
const [draft, setDraft] = useState19("");
|
|
7679
7757
|
const add = (raw) => {
|
|
7680
7758
|
const next = raw.trim();
|
|
7681
7759
|
if (!next || tags.includes(next)) return;
|
|
@@ -7685,11 +7763,11 @@ function TagsEditor({
|
|
|
7685
7763
|
const matches = suggestions.filter(
|
|
7686
7764
|
(s) => !tags.includes(s.value) && s.value !== "__none__" && (!draft || s.label.toLowerCase().includes(draft.trim().toLowerCase()))
|
|
7687
7765
|
).slice(0, 6);
|
|
7688
|
-
return /* @__PURE__ */
|
|
7689
|
-
/* @__PURE__ */
|
|
7690
|
-
tags.length === 0 && /* @__PURE__ */
|
|
7691
|
-
tags.map((tag) => /* @__PURE__ */
|
|
7692
|
-
/* @__PURE__ */
|
|
7766
|
+
return /* @__PURE__ */ jsxs28("div", { className: "space-y-2", onClick: (e) => e.stopPropagation(), children: [
|
|
7767
|
+
/* @__PURE__ */ jsxs28("div", { className: "flex flex-wrap gap-1", children: [
|
|
7768
|
+
tags.length === 0 && /* @__PURE__ */ jsx38("span", { className: "text-xs text-muted-foreground", children: "No tags" }),
|
|
7769
|
+
tags.map((tag) => /* @__PURE__ */ jsxs28(Tooltip, { children: [
|
|
7770
|
+
/* @__PURE__ */ jsx38(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs28(
|
|
7693
7771
|
"button",
|
|
7694
7772
|
{
|
|
7695
7773
|
type: "button",
|
|
@@ -7698,17 +7776,17 @@ function TagsEditor({
|
|
|
7698
7776
|
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
7777
|
children: [
|
|
7700
7778
|
tag,
|
|
7701
|
-
/* @__PURE__ */
|
|
7779
|
+
/* @__PURE__ */ jsx38(X, { className: "h-2.5 w-2.5" })
|
|
7702
7780
|
]
|
|
7703
7781
|
}
|
|
7704
7782
|
) }),
|
|
7705
|
-
/* @__PURE__ */
|
|
7783
|
+
/* @__PURE__ */ jsxs28(TooltipContent, { children: [
|
|
7706
7784
|
"Remove ",
|
|
7707
7785
|
tag
|
|
7708
7786
|
] })
|
|
7709
7787
|
] }, tag))
|
|
7710
7788
|
] }),
|
|
7711
|
-
/* @__PURE__ */
|
|
7789
|
+
/* @__PURE__ */ jsx38(
|
|
7712
7790
|
Input,
|
|
7713
7791
|
{
|
|
7714
7792
|
autoFocus: true,
|
|
@@ -7729,7 +7807,7 @@ function TagsEditor({
|
|
|
7729
7807
|
className: "h-8 text-xs"
|
|
7730
7808
|
}
|
|
7731
7809
|
),
|
|
7732
|
-
matches.length > 0 && /* @__PURE__ */
|
|
7810
|
+
matches.length > 0 && /* @__PURE__ */ jsx38("div", { className: "flex flex-wrap gap-1", children: matches.map((s) => /* @__PURE__ */ jsxs28(
|
|
7733
7811
|
"button",
|
|
7734
7812
|
{
|
|
7735
7813
|
type: "button",
|
|
@@ -7742,8 +7820,8 @@ function TagsEditor({
|
|
|
7742
7820
|
},
|
|
7743
7821
|
s.value
|
|
7744
7822
|
)) }),
|
|
7745
|
-
/* @__PURE__ */
|
|
7746
|
-
/* @__PURE__ */
|
|
7823
|
+
/* @__PURE__ */ jsxs28("div", { className: "flex justify-end gap-1 pt-1", children: [
|
|
7824
|
+
/* @__PURE__ */ jsx38(
|
|
7747
7825
|
Button,
|
|
7748
7826
|
{
|
|
7749
7827
|
size: "sm",
|
|
@@ -7751,17 +7829,17 @@ function TagsEditor({
|
|
|
7751
7829
|
className: "h-7 px-2",
|
|
7752
7830
|
"aria-label": "Cancel edit",
|
|
7753
7831
|
onClick: onCancel,
|
|
7754
|
-
children: /* @__PURE__ */
|
|
7832
|
+
children: /* @__PURE__ */ jsx38(X, { className: "h-3.5 w-3.5" })
|
|
7755
7833
|
}
|
|
7756
7834
|
),
|
|
7757
|
-
/* @__PURE__ */
|
|
7835
|
+
/* @__PURE__ */ jsx38(
|
|
7758
7836
|
Button,
|
|
7759
7837
|
{
|
|
7760
7838
|
size: "sm",
|
|
7761
7839
|
className: "h-7 px-2",
|
|
7762
7840
|
"aria-label": "Apply tags",
|
|
7763
7841
|
onClick: () => onCommit(tags),
|
|
7764
|
-
children: /* @__PURE__ */
|
|
7842
|
+
children: /* @__PURE__ */ jsx38(Check, { className: "h-3.5 w-3.5" })
|
|
7765
7843
|
}
|
|
7766
7844
|
)
|
|
7767
7845
|
] })
|
|
@@ -7772,9 +7850,9 @@ function NumberEditor({
|
|
|
7772
7850
|
onCommit,
|
|
7773
7851
|
onCancel
|
|
7774
7852
|
}) {
|
|
7775
|
-
const [draft, setDraft] =
|
|
7776
|
-
return /* @__PURE__ */
|
|
7777
|
-
/* @__PURE__ */
|
|
7853
|
+
const [draft, setDraft] = useState19(String(value));
|
|
7854
|
+
return /* @__PURE__ */ jsxs28("div", { className: "flex flex-col gap-2", children: [
|
|
7855
|
+
/* @__PURE__ */ jsx38(
|
|
7778
7856
|
Input,
|
|
7779
7857
|
{
|
|
7780
7858
|
autoFocus: true,
|
|
@@ -7791,8 +7869,8 @@ function NumberEditor({
|
|
|
7791
7869
|
}
|
|
7792
7870
|
}
|
|
7793
7871
|
),
|
|
7794
|
-
/* @__PURE__ */
|
|
7795
|
-
/* @__PURE__ */
|
|
7872
|
+
/* @__PURE__ */ jsxs28("div", { className: "flex justify-end gap-1", children: [
|
|
7873
|
+
/* @__PURE__ */ jsx38(
|
|
7796
7874
|
Button,
|
|
7797
7875
|
{
|
|
7798
7876
|
type: "button",
|
|
@@ -7801,10 +7879,10 @@ function NumberEditor({
|
|
|
7801
7879
|
className: "h-7",
|
|
7802
7880
|
"aria-label": "Cancel edit",
|
|
7803
7881
|
onClick: onCancel,
|
|
7804
|
-
children: /* @__PURE__ */
|
|
7882
|
+
children: /* @__PURE__ */ jsx38(X, { className: "h-3.5 w-3.5" })
|
|
7805
7883
|
}
|
|
7806
7884
|
),
|
|
7807
|
-
/* @__PURE__ */
|
|
7885
|
+
/* @__PURE__ */ jsx38(
|
|
7808
7886
|
Button,
|
|
7809
7887
|
{
|
|
7810
7888
|
type: "button",
|
|
@@ -7815,7 +7893,7 @@ function NumberEditor({
|
|
|
7815
7893
|
const n = Number(draft);
|
|
7816
7894
|
if (Number.isFinite(n)) onCommit(n);
|
|
7817
7895
|
},
|
|
7818
|
-
children: /* @__PURE__ */
|
|
7896
|
+
children: /* @__PURE__ */ jsx38(Check, { className: "h-3.5 w-3.5" })
|
|
7819
7897
|
}
|
|
7820
7898
|
)
|
|
7821
7899
|
] })
|
|
@@ -7823,24 +7901,24 @@ function NumberEditor({
|
|
|
7823
7901
|
}
|
|
7824
7902
|
|
|
7825
7903
|
// src/data-table/ToolbarFacets.tsx
|
|
7826
|
-
import { jsx as
|
|
7904
|
+
import { jsx as jsx39, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
7827
7905
|
function ToolbarFacets({ facets }) {
|
|
7828
7906
|
if (facets.length === 0) return null;
|
|
7829
|
-
return /* @__PURE__ */
|
|
7907
|
+
return /* @__PURE__ */ jsx39("div", { className: "flex flex-wrap items-center gap-2", children: facets.map((facet) => {
|
|
7830
7908
|
if (facet.type === "custom") {
|
|
7831
|
-
return /* @__PURE__ */
|
|
7909
|
+
return /* @__PURE__ */ jsx39("div", { children: facet.render() }, facet.id);
|
|
7832
7910
|
}
|
|
7833
7911
|
const defaultValue = facet.defaultValue ?? facet.options[0]?.value ?? "";
|
|
7834
7912
|
const isNonDefault = facet.value !== defaultValue;
|
|
7835
|
-
return /* @__PURE__ */
|
|
7913
|
+
return /* @__PURE__ */ jsxs29(
|
|
7836
7914
|
"div",
|
|
7837
7915
|
{
|
|
7838
7916
|
className: "flex flex-wrap items-center gap-1.5 max-sm:grid max-sm:w-full max-sm:grid-cols-3",
|
|
7839
7917
|
children: [
|
|
7840
|
-
facet.label ? /* @__PURE__ */
|
|
7918
|
+
facet.label ? /* @__PURE__ */ jsx39("span", { className: "mr-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: facet.label }) : null,
|
|
7841
7919
|
facet.options.map((opt) => {
|
|
7842
7920
|
const active = facet.value === opt.value;
|
|
7843
|
-
return /* @__PURE__ */
|
|
7921
|
+
return /* @__PURE__ */ jsxs29(
|
|
7844
7922
|
Button,
|
|
7845
7923
|
{
|
|
7846
7924
|
type: "button",
|
|
@@ -7854,8 +7932,8 @@ function ToolbarFacets({ facets }) {
|
|
|
7854
7932
|
children: [
|
|
7855
7933
|
opt.icon,
|
|
7856
7934
|
opt.label,
|
|
7857
|
-
active && isNonDefault ? /* @__PURE__ */
|
|
7858
|
-
/* @__PURE__ */
|
|
7935
|
+
active && isNonDefault ? /* @__PURE__ */ jsx39(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ jsxs29(Tooltip, { children: [
|
|
7936
|
+
/* @__PURE__ */ jsx39(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx39(
|
|
7859
7937
|
"span",
|
|
7860
7938
|
{
|
|
7861
7939
|
role: "button",
|
|
@@ -7873,10 +7951,10 @@ function ToolbarFacets({ facets }) {
|
|
|
7873
7951
|
facet.onChange(defaultValue);
|
|
7874
7952
|
}
|
|
7875
7953
|
},
|
|
7876
|
-
children: /* @__PURE__ */
|
|
7954
|
+
children: /* @__PURE__ */ jsx39(X, { className: "h-3 w-3" })
|
|
7877
7955
|
}
|
|
7878
7956
|
) }),
|
|
7879
|
-
/* @__PURE__ */
|
|
7957
|
+
/* @__PURE__ */ jsx39(TooltipContent, { side: "top", children: "Clear this filter" })
|
|
7880
7958
|
] }) }) : null
|
|
7881
7959
|
]
|
|
7882
7960
|
},
|
|
@@ -7902,8 +7980,8 @@ function resetToolbarFacets(facets) {
|
|
|
7902
7980
|
}
|
|
7903
7981
|
|
|
7904
7982
|
// src/data-table/LayeredFilterBuilder.tsx
|
|
7905
|
-
import { useState as
|
|
7906
|
-
import { Fragment as Fragment5, jsx as
|
|
7983
|
+
import { useState as useState20 } from "react";
|
|
7984
|
+
import { Fragment as Fragment5, jsx as jsx40, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
7907
7985
|
function moveRule(rules, from, to) {
|
|
7908
7986
|
if (from === to || to < 0 || to >= rules.length) return [...rules];
|
|
7909
7987
|
const next = [...rules];
|
|
@@ -7919,8 +7997,8 @@ function LayeredFilterBuilder({
|
|
|
7919
7997
|
maxRules = 20,
|
|
7920
7998
|
label = "Advanced filters"
|
|
7921
7999
|
}) {
|
|
7922
|
-
const [open, setOpen] =
|
|
7923
|
-
const [draggedIndex, setDraggedIndex] =
|
|
8000
|
+
const [open, setOpen] = useState20(false);
|
|
8001
|
+
const [draggedIndex, setDraggedIndex] = useState20(null);
|
|
7924
8002
|
if (fields.length === 0) return null;
|
|
7925
8003
|
const updateRule = (index, patch) => {
|
|
7926
8004
|
onChange(
|
|
@@ -7949,8 +8027,8 @@ function LayeredFilterBuilder({
|
|
|
7949
8027
|
const reorder = (from, to) => {
|
|
7950
8028
|
onChange(moveRule(rules, from, to));
|
|
7951
8029
|
};
|
|
7952
|
-
return /* @__PURE__ */
|
|
7953
|
-
/* @__PURE__ */
|
|
8030
|
+
return /* @__PURE__ */ jsxs30("div", { className: "flex min-w-0 flex-wrap items-center gap-1", children: [
|
|
8031
|
+
/* @__PURE__ */ jsxs30(
|
|
7954
8032
|
Popover,
|
|
7955
8033
|
{
|
|
7956
8034
|
open,
|
|
@@ -7962,7 +8040,7 @@ function LayeredFilterBuilder({
|
|
|
7962
8040
|
}
|
|
7963
8041
|
},
|
|
7964
8042
|
children: [
|
|
7965
|
-
/* @__PURE__ */
|
|
8043
|
+
/* @__PURE__ */ jsx40(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs30(
|
|
7966
8044
|
Button,
|
|
7967
8045
|
{
|
|
7968
8046
|
type: "button",
|
|
@@ -7971,25 +8049,25 @@ function LayeredFilterBuilder({
|
|
|
7971
8049
|
className: "h-8 gap-1.5 px-2 text-xs",
|
|
7972
8050
|
"aria-label": label,
|
|
7973
8051
|
children: [
|
|
7974
|
-
/* @__PURE__ */
|
|
7975
|
-
/* @__PURE__ */
|
|
7976
|
-
rules.length > 0 ? /* @__PURE__ */
|
|
8052
|
+
/* @__PURE__ */ jsx40(SlidersHorizontal, { className: "h-3.5 w-3.5" }),
|
|
8053
|
+
/* @__PURE__ */ jsx40("span", { className: "hidden sm:inline", children: rules.length > 0 ? `${rules.length} layers` : "Advanced" }),
|
|
8054
|
+
rules.length > 0 ? /* @__PURE__ */ jsx40("span", { className: "sm:hidden", children: rules.length }) : null
|
|
7977
8055
|
]
|
|
7978
8056
|
}
|
|
7979
8057
|
) }),
|
|
7980
|
-
/* @__PURE__ */
|
|
8058
|
+
/* @__PURE__ */ jsxs30(
|
|
7981
8059
|
PopoverContent,
|
|
7982
8060
|
{
|
|
7983
8061
|
align: "start",
|
|
7984
8062
|
sideOffset: 6,
|
|
7985
8063
|
className: "w-[min(46rem,calc(100vw-1rem))] p-0",
|
|
7986
8064
|
children: [
|
|
7987
|
-
/* @__PURE__ */
|
|
7988
|
-
/* @__PURE__ */
|
|
7989
|
-
/* @__PURE__ */
|
|
7990
|
-
/* @__PURE__ */
|
|
8065
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex items-start justify-between gap-3 border-b border-border px-3 py-2.5", children: [
|
|
8066
|
+
/* @__PURE__ */ jsxs30("div", { children: [
|
|
8067
|
+
/* @__PURE__ */ jsx40("p", { className: "text-sm font-semibold text-foreground", children: "Narrow these results" }),
|
|
8068
|
+
/* @__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
8069
|
] }),
|
|
7992
|
-
rules.length > 0 ? /* @__PURE__ */
|
|
8070
|
+
rules.length > 0 ? /* @__PURE__ */ jsx40(
|
|
7993
8071
|
Button,
|
|
7994
8072
|
{
|
|
7995
8073
|
type: "button",
|
|
@@ -8001,10 +8079,10 @@ function LayeredFilterBuilder({
|
|
|
8001
8079
|
}
|
|
8002
8080
|
) : null
|
|
8003
8081
|
] }),
|
|
8004
|
-
/* @__PURE__ */
|
|
8005
|
-
/* @__PURE__ */
|
|
8006
|
-
/* @__PURE__ */
|
|
8007
|
-
] }) : rules.map((rule, index) => /* @__PURE__ */
|
|
8082
|
+
/* @__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: [
|
|
8083
|
+
/* @__PURE__ */ jsx40("p", { className: "text-sm font-medium text-foreground", children: "Start with one simple layer" }),
|
|
8084
|
+
/* @__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." })
|
|
8085
|
+
] }) : rules.map((rule, index) => /* @__PURE__ */ jsx40(
|
|
8008
8086
|
LayeredRuleRow,
|
|
8009
8087
|
{
|
|
8010
8088
|
index,
|
|
@@ -8024,9 +8102,9 @@ function LayeredFilterBuilder({
|
|
|
8024
8102
|
},
|
|
8025
8103
|
rule.id
|
|
8026
8104
|
)) }),
|
|
8027
|
-
/* @__PURE__ */
|
|
8028
|
-
/* @__PURE__ */
|
|
8029
|
-
/* @__PURE__ */
|
|
8105
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex items-center justify-between gap-2 border-t border-border px-3 py-2", children: [
|
|
8106
|
+
/* @__PURE__ */ jsx40("p", { className: "text-[11px] text-muted-foreground", children: "The regular search still works and is applied before these layers." }),
|
|
8107
|
+
/* @__PURE__ */ jsxs30(
|
|
8030
8108
|
Button,
|
|
8031
8109
|
{
|
|
8032
8110
|
type: "button",
|
|
@@ -8036,7 +8114,7 @@ function LayeredFilterBuilder({
|
|
|
8036
8114
|
disabled: rules.length >= maxRules,
|
|
8037
8115
|
onClick: addRule,
|
|
8038
8116
|
children: [
|
|
8039
|
-
/* @__PURE__ */
|
|
8117
|
+
/* @__PURE__ */ jsx40(Plus, { className: "h-3.5 w-3.5" }),
|
|
8040
8118
|
" Add layer"
|
|
8041
8119
|
]
|
|
8042
8120
|
}
|
|
@@ -8048,7 +8126,7 @@ function LayeredFilterBuilder({
|
|
|
8048
8126
|
]
|
|
8049
8127
|
}
|
|
8050
8128
|
),
|
|
8051
|
-
rules.map((rule, index) => /* @__PURE__ */
|
|
8129
|
+
rules.map((rule, index) => /* @__PURE__ */ jsxs30(
|
|
8052
8130
|
"span",
|
|
8053
8131
|
{
|
|
8054
8132
|
className: cn(
|
|
@@ -8056,7 +8134,7 @@ function LayeredFilterBuilder({
|
|
|
8056
8134
|
isCompleteLayeredFilterRule(rule) ? "border-border bg-muted/50 text-foreground" : "border-dashed border-warning/50 bg-warning/10 text-warning"
|
|
8057
8135
|
),
|
|
8058
8136
|
children: [
|
|
8059
|
-
/* @__PURE__ */
|
|
8137
|
+
/* @__PURE__ */ jsxs30(
|
|
8060
8138
|
"button",
|
|
8061
8139
|
{
|
|
8062
8140
|
type: "button",
|
|
@@ -8064,19 +8142,19 @@ function LayeredFilterBuilder({
|
|
|
8064
8142
|
onClick: () => setOpen(true),
|
|
8065
8143
|
title: isCompleteLayeredFilterRule(rule) ? layeredFilterRuleSummary(rule, fields) : `Layer ${index + 1} needs a value`,
|
|
8066
8144
|
children: [
|
|
8067
|
-
/* @__PURE__ */
|
|
8145
|
+
/* @__PURE__ */ jsx40("span", { className: "mr-1 text-muted-foreground", children: index + 1 }),
|
|
8068
8146
|
isCompleteLayeredFilterRule(rule) ? layeredFilterRuleSummary(rule, fields) : "Choose a value"
|
|
8069
8147
|
]
|
|
8070
8148
|
}
|
|
8071
8149
|
),
|
|
8072
|
-
/* @__PURE__ */
|
|
8150
|
+
/* @__PURE__ */ jsx40(
|
|
8073
8151
|
"button",
|
|
8074
8152
|
{
|
|
8075
8153
|
type: "button",
|
|
8076
8154
|
className: "shrink-0 rounded-full p-0.5 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
8077
8155
|
"aria-label": `Remove filter layer ${index + 1}`,
|
|
8078
8156
|
onClick: () => removeRule(index),
|
|
8079
|
-
children: /* @__PURE__ */
|
|
8157
|
+
children: /* @__PURE__ */ jsx40(X, { className: "h-3 w-3" })
|
|
8080
8158
|
}
|
|
8081
8159
|
)
|
|
8082
8160
|
]
|
|
@@ -8106,7 +8184,7 @@ function LayeredRuleRow({
|
|
|
8106
8184
|
event.preventDefault();
|
|
8107
8185
|
onKeyboardMove(event.key === "ArrowUp" ? -1 : 1);
|
|
8108
8186
|
};
|
|
8109
|
-
return /* @__PURE__ */
|
|
8187
|
+
return /* @__PURE__ */ jsxs30(
|
|
8110
8188
|
"div",
|
|
8111
8189
|
{
|
|
8112
8190
|
className: cn(
|
|
@@ -8119,7 +8197,7 @@ function LayeredRuleRow({
|
|
|
8119
8197
|
onDrop(index);
|
|
8120
8198
|
},
|
|
8121
8199
|
children: [
|
|
8122
|
-
/* @__PURE__ */
|
|
8200
|
+
/* @__PURE__ */ jsx40(
|
|
8123
8201
|
"button",
|
|
8124
8202
|
{
|
|
8125
8203
|
type: "button",
|
|
@@ -8133,10 +8211,10 @@ function LayeredRuleRow({
|
|
|
8133
8211
|
},
|
|
8134
8212
|
onDragEnd,
|
|
8135
8213
|
onKeyDown: handleMoveKey,
|
|
8136
|
-
children: /* @__PURE__ */
|
|
8214
|
+
children: /* @__PURE__ */ jsx40(GripVertical, { className: "h-3.5 w-3.5" })
|
|
8137
8215
|
}
|
|
8138
8216
|
),
|
|
8139
|
-
/* @__PURE__ */
|
|
8217
|
+
/* @__PURE__ */ jsxs30(
|
|
8140
8218
|
Select,
|
|
8141
8219
|
{
|
|
8142
8220
|
value: field.id,
|
|
@@ -8154,16 +8232,16 @@ function LayeredRuleRow({
|
|
|
8154
8232
|
});
|
|
8155
8233
|
},
|
|
8156
8234
|
children: [
|
|
8157
|
-
/* @__PURE__ */
|
|
8235
|
+
/* @__PURE__ */ jsx40(
|
|
8158
8236
|
SelectTrigger,
|
|
8159
8237
|
{
|
|
8160
8238
|
size: "sm",
|
|
8161
8239
|
className: "h-7 w-full text-xs max-sm:col-span-1",
|
|
8162
8240
|
"aria-label": `Filter layer ${index + 1} field`,
|
|
8163
|
-
children: /* @__PURE__ */
|
|
8241
|
+
children: /* @__PURE__ */ jsx40(SelectValue, {})
|
|
8164
8242
|
}
|
|
8165
8243
|
),
|
|
8166
|
-
/* @__PURE__ */
|
|
8244
|
+
/* @__PURE__ */ jsx40(SelectContent, { children: fields.map((candidate) => /* @__PURE__ */ jsx40(
|
|
8167
8245
|
SelectItem,
|
|
8168
8246
|
{
|
|
8169
8247
|
value: candidate.id,
|
|
@@ -8175,7 +8253,7 @@ function LayeredRuleRow({
|
|
|
8175
8253
|
]
|
|
8176
8254
|
}
|
|
8177
8255
|
),
|
|
8178
|
-
/* @__PURE__ */
|
|
8256
|
+
/* @__PURE__ */ jsxs30(
|
|
8179
8257
|
Select,
|
|
8180
8258
|
{
|
|
8181
8259
|
value: rule.operator,
|
|
@@ -8187,35 +8265,35 @@ function LayeredRuleRow({
|
|
|
8187
8265
|
});
|
|
8188
8266
|
},
|
|
8189
8267
|
children: [
|
|
8190
|
-
/* @__PURE__ */
|
|
8268
|
+
/* @__PURE__ */ jsx40(
|
|
8191
8269
|
SelectTrigger,
|
|
8192
8270
|
{
|
|
8193
8271
|
size: "sm",
|
|
8194
8272
|
className: "h-7 w-full text-xs max-sm:col-start-2",
|
|
8195
8273
|
"aria-label": `Filter layer ${index + 1} operator`,
|
|
8196
|
-
children: /* @__PURE__ */
|
|
8274
|
+
children: /* @__PURE__ */ jsx40(SelectValue, {})
|
|
8197
8275
|
}
|
|
8198
8276
|
),
|
|
8199
|
-
/* @__PURE__ */
|
|
8277
|
+
/* @__PURE__ */ jsx40(SelectContent, { children: operators.map((operator) => /* @__PURE__ */ jsx40(SelectItem, { value: operator, className: "text-xs", children: LAYERED_FILTER_OPERATOR_LABELS[operator] }, operator)) })
|
|
8200
8278
|
]
|
|
8201
8279
|
}
|
|
8202
8280
|
),
|
|
8203
|
-
/* @__PURE__ */
|
|
8281
|
+
/* @__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
8282
|
Select,
|
|
8205
8283
|
{
|
|
8206
8284
|
value: rule.value,
|
|
8207
8285
|
onValueChange: (value) => onChange({ value }),
|
|
8208
8286
|
children: [
|
|
8209
|
-
/* @__PURE__ */
|
|
8287
|
+
/* @__PURE__ */ jsx40(
|
|
8210
8288
|
SelectTrigger,
|
|
8211
8289
|
{
|
|
8212
8290
|
size: "sm",
|
|
8213
8291
|
className: "h-7 w-full text-xs",
|
|
8214
8292
|
"aria-label": `Filter layer ${index + 1} value`,
|
|
8215
|
-
children: /* @__PURE__ */
|
|
8293
|
+
children: /* @__PURE__ */ jsx40(SelectValue, {})
|
|
8216
8294
|
}
|
|
8217
8295
|
),
|
|
8218
|
-
/* @__PURE__ */
|
|
8296
|
+
/* @__PURE__ */ jsx40(SelectContent, { children: field.options.map((option) => /* @__PURE__ */ jsx40(
|
|
8219
8297
|
SelectItem,
|
|
8220
8298
|
{
|
|
8221
8299
|
value: option.value,
|
|
@@ -8226,8 +8304,8 @@ function LayeredRuleRow({
|
|
|
8226
8304
|
)) })
|
|
8227
8305
|
]
|
|
8228
8306
|
}
|
|
8229
|
-
) : /* @__PURE__ */
|
|
8230
|
-
/* @__PURE__ */
|
|
8307
|
+
) : /* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-1", children: [
|
|
8308
|
+
/* @__PURE__ */ jsx40(
|
|
8231
8309
|
Input,
|
|
8232
8310
|
{
|
|
8233
8311
|
value: rule.value,
|
|
@@ -8238,9 +8316,9 @@ function LayeredRuleRow({
|
|
|
8238
8316
|
"aria-label": `Filter layer ${index + 1} value`
|
|
8239
8317
|
}
|
|
8240
8318
|
),
|
|
8241
|
-
rule.operator === "between" ? /* @__PURE__ */
|
|
8242
|
-
/* @__PURE__ */
|
|
8243
|
-
/* @__PURE__ */
|
|
8319
|
+
rule.operator === "between" ? /* @__PURE__ */ jsxs30(Fragment5, { children: [
|
|
8320
|
+
/* @__PURE__ */ jsx40("span", { className: "text-[11px] text-muted-foreground", children: "and" }),
|
|
8321
|
+
/* @__PURE__ */ jsx40(
|
|
8244
8322
|
Input,
|
|
8245
8323
|
{
|
|
8246
8324
|
value: rule.valueTo ?? "",
|
|
@@ -8253,7 +8331,7 @@ function LayeredRuleRow({
|
|
|
8253
8331
|
)
|
|
8254
8332
|
] }) : null
|
|
8255
8333
|
] }) }),
|
|
8256
|
-
/* @__PURE__ */
|
|
8334
|
+
/* @__PURE__ */ jsx40(
|
|
8257
8335
|
Button,
|
|
8258
8336
|
{
|
|
8259
8337
|
type: "button",
|
|
@@ -8262,7 +8340,7 @@ function LayeredRuleRow({
|
|
|
8262
8340
|
className: "h-7 w-7 p-0 text-muted-foreground hover:text-destructive max-sm:col-start-3 max-sm:row-start-1",
|
|
8263
8341
|
"aria-label": `Remove filter layer ${index + 1}`,
|
|
8264
8342
|
onClick: onRemove,
|
|
8265
|
-
children: /* @__PURE__ */
|
|
8343
|
+
children: /* @__PURE__ */ jsx40(Trash2, { className: "h-3.5 w-3.5" })
|
|
8266
8344
|
}
|
|
8267
8345
|
)
|
|
8268
8346
|
]
|
|
@@ -8362,7 +8440,7 @@ function safeQueryPage(requestedPage, totalItems, pageSize) {
|
|
|
8362
8440
|
}
|
|
8363
8441
|
|
|
8364
8442
|
// src/data-table/MatrxDataTable.tsx
|
|
8365
|
-
import { Fragment as Fragment7, jsx as
|
|
8443
|
+
import { Fragment as Fragment7, jsx as jsx41, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
8366
8444
|
function TableToolbarAction({
|
|
8367
8445
|
HostAction,
|
|
8368
8446
|
ariaLabel,
|
|
@@ -8373,10 +8451,10 @@ function TableToolbarAction({
|
|
|
8373
8451
|
children
|
|
8374
8452
|
}) {
|
|
8375
8453
|
if (HostAction) {
|
|
8376
|
-
return /* @__PURE__ */
|
|
8454
|
+
return /* @__PURE__ */ jsx41("span", { "data-matrx-table-toolbar-action": true, children: /* @__PURE__ */ jsx41(HostAction, { ariaLabel, tooltip, disabled, busy, onClick, children }) });
|
|
8377
8455
|
}
|
|
8378
|
-
return /* @__PURE__ */
|
|
8379
|
-
/* @__PURE__ */
|
|
8456
|
+
return /* @__PURE__ */ jsxs31(Tooltip, { children: [
|
|
8457
|
+
/* @__PURE__ */ jsx41(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx41("span", { "data-matrx-table-toolbar-action": true, className: "inline-flex", children: /* @__PURE__ */ jsx41(
|
|
8380
8458
|
Button,
|
|
8381
8459
|
{
|
|
8382
8460
|
type: "button",
|
|
@@ -8391,7 +8469,7 @@ function TableToolbarAction({
|
|
|
8391
8469
|
children: isValidElement2(children) ? cloneElement2(children, { className: cn("h-5 w-5", children.props.className) }) : children
|
|
8392
8470
|
}
|
|
8393
8471
|
) }) }),
|
|
8394
|
-
/* @__PURE__ */
|
|
8472
|
+
/* @__PURE__ */ jsx41(TooltipContent, { children: tooltip ?? ariaLabel })
|
|
8395
8473
|
] });
|
|
8396
8474
|
}
|
|
8397
8475
|
function hasSameRowReferences(previous, next) {
|
|
@@ -8404,20 +8482,20 @@ function TableRowCopyControl({
|
|
|
8404
8482
|
sourceId,
|
|
8405
8483
|
defaultColumns
|
|
8406
8484
|
}) {
|
|
8407
|
-
return /* @__PURE__ */
|
|
8408
|
-
|
|
8409
|
-
|
|
8410
|
-
|
|
8411
|
-
|
|
8412
|
-
|
|
8413
|
-
|
|
8414
|
-
|
|
8415
|
-
|
|
8416
|
-
|
|
8417
|
-
|
|
8418
|
-
|
|
8419
|
-
}
|
|
8420
|
-
|
|
8485
|
+
return /* @__PURE__ */ jsx41(CopyButtons, { size, ...tableRowCopyProps(copy, row, sourceId, defaultColumns) });
|
|
8486
|
+
}
|
|
8487
|
+
function tableRowCopyProps(copy, row, sourceId, defaultColumns) {
|
|
8488
|
+
const aiVariants = copy.rowAiVariants?.(row);
|
|
8489
|
+
return {
|
|
8490
|
+
sourceId,
|
|
8491
|
+
label: copy.label,
|
|
8492
|
+
...copy.rowReferences ? { references: copy.rowReferences(row) } : {},
|
|
8493
|
+
...copy.triggerVariant ? { triggerVariant: copy.triggerVariant } : {},
|
|
8494
|
+
human: () => copy.humanRow(row),
|
|
8495
|
+
json: () => copy.agentRow ? copy.agentRow(row) : row,
|
|
8496
|
+
agent: () => defaultColumns ? buildDefaultTableRowAgentInput(copy, row, defaultColumns) : buildRowAgentInput(copy, row),
|
|
8497
|
+
...aiVariants === void 0 ? {} : { aiVariants }
|
|
8498
|
+
};
|
|
8421
8499
|
}
|
|
8422
8500
|
function dragPointerY(event) {
|
|
8423
8501
|
const activator = event.activatorEvent;
|
|
@@ -8428,8 +8506,8 @@ function isStringArray(value) {
|
|
|
8428
8506
|
}
|
|
8429
8507
|
var activeUrlTableIds = /* @__PURE__ */ new Set();
|
|
8430
8508
|
function MatrxDataTable(props) {
|
|
8431
|
-
if (!props.urlState) return /* @__PURE__ */
|
|
8432
|
-
return /* @__PURE__ */
|
|
8509
|
+
if (!props.urlState) return /* @__PURE__ */ jsx41(MatrxDataTableCore, { ...props });
|
|
8510
|
+
return /* @__PURE__ */ jsx41(MatrxDataTableWithUrlState, { ...props, urlState: props.urlState });
|
|
8433
8511
|
}
|
|
8434
8512
|
function MatrxDataTableWithUrlState({
|
|
8435
8513
|
urlState,
|
|
@@ -8447,7 +8525,7 @@ function MatrxDataTableWithUrlState({
|
|
|
8447
8525
|
...urlState.history === void 0 ? {} : { history: urlState.history },
|
|
8448
8526
|
...urlState.textHistory === void 0 ? {} : { textHistory: urlState.textHistory }
|
|
8449
8527
|
});
|
|
8450
|
-
|
|
8528
|
+
useEffect15(() => {
|
|
8451
8529
|
if (activeUrlTableIds.has(urlState.id)) {
|
|
8452
8530
|
throw new Error(
|
|
8453
8531
|
`Duplicate MatrxDataTable urlState.id "${urlState.id}" on one page. Give every table a unique stable id.`
|
|
@@ -8484,7 +8562,7 @@ function MatrxDataTableWithUrlState({
|
|
|
8484
8562
|
props.selection?.onSelectedIdsChange(ids);
|
|
8485
8563
|
}
|
|
8486
8564
|
} : props.selection;
|
|
8487
|
-
return /* @__PURE__ */
|
|
8565
|
+
return /* @__PURE__ */ jsx41(
|
|
8488
8566
|
MatrxDataTableCore,
|
|
8489
8567
|
{
|
|
8490
8568
|
...props,
|
|
@@ -8517,6 +8595,9 @@ function MatrxDataTableWithUrlState({
|
|
|
8517
8595
|
);
|
|
8518
8596
|
}
|
|
8519
8597
|
var COLUMN_REORDER_ACTIVATION_DISTANCE = 6;
|
|
8598
|
+
function TableContextPassthrough({ children }) {
|
|
8599
|
+
return /* @__PURE__ */ jsx41(Fragment7, { children });
|
|
8600
|
+
}
|
|
8520
8601
|
function MatrxDataTableCore({
|
|
8521
8602
|
data: suppliedData,
|
|
8522
8603
|
columns,
|
|
@@ -8543,6 +8624,8 @@ function MatrxDataTableCore({
|
|
|
8543
8624
|
detail,
|
|
8544
8625
|
window: windowConfig,
|
|
8545
8626
|
copy,
|
|
8627
|
+
contextMenu,
|
|
8628
|
+
rowCopyPlacement = "inline",
|
|
8546
8629
|
edit,
|
|
8547
8630
|
hierarchy,
|
|
8548
8631
|
selectedId: controlledSelectedId,
|
|
@@ -8571,21 +8654,22 @@ function MatrxDataTableCore({
|
|
|
8571
8654
|
}) {
|
|
8572
8655
|
const appendQuery = query?.mode === "controlled-append" ? query : null;
|
|
8573
8656
|
const appendQueryKey = appendQuery?.pagination.queryKey ?? null;
|
|
8574
|
-
const committedAppendQueryKey =
|
|
8657
|
+
const committedAppendQueryKey = useRef13(appendQueryKey);
|
|
8575
8658
|
const appendSourceChanged = appendQuery !== null && committedAppendQueryKey.current !== appendQueryKey;
|
|
8576
8659
|
const data = appendQuery ? appendQuery.pagination.rows : suppliedData;
|
|
8577
8660
|
const isLoading = appendQuery ? appendQuery.pagination.loading : suppliedLoading;
|
|
8578
8661
|
const isFetching = appendQuery ? appendQuery.pagination.isFetchingNextPage : suppliedFetching;
|
|
8579
8662
|
const host = useMatrxDataTableHost();
|
|
8663
|
+
const ContextMenuBoundary = host.ContextMenuBoundary ?? TableContextPassthrough;
|
|
8580
8664
|
const resolvedDensity = density ?? host.defaultDensity ?? "normal";
|
|
8581
8665
|
const SavedViews = host.SavedViews;
|
|
8582
8666
|
const Link = host.Link ?? DefaultTableLink;
|
|
8583
8667
|
const SidePanelSurface = host.SidePanelSurface ?? DefaultTableSidePanel;
|
|
8584
8668
|
const { notify: toast, notice } = useTableNotice();
|
|
8585
|
-
const [savedViewError, setSavedViewError] =
|
|
8586
|
-
const [toolbarActionError, setToolbarActionError] =
|
|
8587
|
-
const [toolbarActionPending, setToolbarActionPending] =
|
|
8588
|
-
const toolbarActionPendingRef =
|
|
8669
|
+
const [savedViewError, setSavedViewError] = useState21(null);
|
|
8670
|
+
const [toolbarActionError, setToolbarActionError] = useState21(null);
|
|
8671
|
+
const [toolbarActionPending, setToolbarActionPending] = useState21({ refresh: false, add: false });
|
|
8672
|
+
const toolbarActionPendingRef = useRef13({ refresh: false, add: false });
|
|
8589
8673
|
const CHECKBOX_TAP_AREA = "h-4 w-4 touch-manipulation";
|
|
8590
8674
|
const mobileCardsClass = mobileCardsBreakpoint === "lg" ? "lg:hidden" : "sm:hidden";
|
|
8591
8675
|
const tableWithCardsClass = mobileCardsBreakpoint === "lg" ? "max-lg:hidden" : "max-sm:hidden";
|
|
@@ -8607,8 +8691,8 @@ function MatrxDataTableCore({
|
|
|
8607
8691
|
},
|
|
8608
8692
|
[controlledQuery]
|
|
8609
8693
|
);
|
|
8610
|
-
const [internalSearch, setInternalSearch] =
|
|
8611
|
-
const [draggedRowId, setDraggedRowId] =
|
|
8694
|
+
const [internalSearch, setInternalSearch] = useState21("");
|
|
8695
|
+
const [draggedRowId, setDraggedRowId] = useState21(null);
|
|
8612
8696
|
const hierarchySensors = useSensors(
|
|
8613
8697
|
useSensor(PointerSensor, {
|
|
8614
8698
|
activationConstraint: { distance: COLUMN_REORDER_ACTIVATION_DISTANCE }
|
|
@@ -8624,7 +8708,7 @@ function MatrxDataTableCore({
|
|
|
8624
8708
|
}
|
|
8625
8709
|
toolbar?.onSearchChange?.(v);
|
|
8626
8710
|
};
|
|
8627
|
-
const [internalSearchMatchMode, setInternalSearchMatchMode] =
|
|
8711
|
+
const [internalSearchMatchMode, setInternalSearchMatchMode] = useState21(
|
|
8628
8712
|
toolbar?.searchMatch?.defaultMode ?? "contains"
|
|
8629
8713
|
);
|
|
8630
8714
|
const searchMatchMode = controlledQuery ? controlledQuery.state.searchMatchMode ?? toolbar?.searchMatch?.defaultMode ?? "contains" : internalSearchMatchMode;
|
|
@@ -8635,7 +8719,7 @@ function MatrxDataTableCore({
|
|
|
8635
8719
|
}
|
|
8636
8720
|
setInternalSearchMatchMode(mode);
|
|
8637
8721
|
};
|
|
8638
|
-
const [internalSearchScope, setInternalSearchScope] =
|
|
8722
|
+
const [internalSearchScope, setInternalSearchScope] = useState21("all");
|
|
8639
8723
|
const searchScope = controlledQuery ? controlledQuery.state.searchScope ?? "all" : internalSearchScope;
|
|
8640
8724
|
const setSearchScope = (scope) => {
|
|
8641
8725
|
if (controlledQuery) {
|
|
@@ -8644,7 +8728,7 @@ function MatrxDataTableCore({
|
|
|
8644
8728
|
}
|
|
8645
8729
|
setInternalSearchScope(scope);
|
|
8646
8730
|
};
|
|
8647
|
-
const [internalAnyOf, setInternalAnyOf] =
|
|
8731
|
+
const [internalAnyOf, setInternalAnyOf] = useState21("");
|
|
8648
8732
|
const toolbarAnyOfControlled = toolbar?.anyOf?.value !== void 0;
|
|
8649
8733
|
const anyOfValue = controlledQuery ? controlledQuery.state.anyOf : toolbarAnyOfControlled ? toolbar?.anyOf?.value ?? "" : internalAnyOf;
|
|
8650
8734
|
const setAnyOfValue = (v) => {
|
|
@@ -8655,7 +8739,7 @@ function MatrxDataTableCore({
|
|
|
8655
8739
|
}
|
|
8656
8740
|
toolbar?.anyOf?.onChange?.(v);
|
|
8657
8741
|
};
|
|
8658
|
-
const [internalLayeredFilters, setInternalLayeredFilters] =
|
|
8742
|
+
const [internalLayeredFilters, setInternalLayeredFilters] = useState21([]);
|
|
8659
8743
|
const layeredFilters = controlledQuery ? controlledQuery.state.layeredFilters ?? [] : internalLayeredFilters;
|
|
8660
8744
|
const setLayeredFilters = (next) => {
|
|
8661
8745
|
if (controlledQuery) {
|
|
@@ -8664,7 +8748,7 @@ function MatrxDataTableCore({
|
|
|
8664
8748
|
}
|
|
8665
8749
|
setInternalLayeredFilters(next);
|
|
8666
8750
|
};
|
|
8667
|
-
const [internalColumnFilters, setInternalColumnFilters] =
|
|
8751
|
+
const [internalColumnFilters, setInternalColumnFilters] = useState21({});
|
|
8668
8752
|
const columnFilters = controlledQuery ? controlledQuery.state.columnFilters : internalColumnFilters;
|
|
8669
8753
|
const setColumnFilter = (id, next) => {
|
|
8670
8754
|
const nextFilters = { ...columnFilters, [id]: next };
|
|
@@ -8677,7 +8761,7 @@ function MatrxDataTableCore({
|
|
|
8677
8761
|
}
|
|
8678
8762
|
setInternalColumnFilters(nextFilters);
|
|
8679
8763
|
};
|
|
8680
|
-
const [internalSort, setInternalSort] =
|
|
8764
|
+
const [internalSort, setInternalSort] = useState21(defaultSort);
|
|
8681
8765
|
const sort = controlledQuery ? controlledQuery.state.sort : internalSort;
|
|
8682
8766
|
const setSort = (next) => {
|
|
8683
8767
|
if (controlledQuery) {
|
|
@@ -8686,7 +8770,7 @@ function MatrxDataTableCore({
|
|
|
8686
8770
|
}
|
|
8687
8771
|
setInternalSort(next);
|
|
8688
8772
|
};
|
|
8689
|
-
const [internalPage, setInternalPage] =
|
|
8773
|
+
const [internalPage, setInternalPage] = useState21(1);
|
|
8690
8774
|
const page = controlledQuery ? controlledQuery.state.page : internalPage;
|
|
8691
8775
|
const setPage = (next) => {
|
|
8692
8776
|
if (controlledQuery) {
|
|
@@ -8695,7 +8779,7 @@ function MatrxDataTableCore({
|
|
|
8695
8779
|
}
|
|
8696
8780
|
setInternalPage(next);
|
|
8697
8781
|
};
|
|
8698
|
-
const [internalPageSize, setInternalPageSize] =
|
|
8782
|
+
const [internalPageSize, setInternalPageSize] = useState21(
|
|
8699
8783
|
defaultPageSize === 0 ? Math.max(data.length, 1) : defaultPageSize
|
|
8700
8784
|
);
|
|
8701
8785
|
const pageSize = controlledQuery ? controlledQuery.state.pageSize : internalPageSize;
|
|
@@ -8706,26 +8790,28 @@ function MatrxDataTableCore({
|
|
|
8706
8790
|
}
|
|
8707
8791
|
setInternalPageSize(next);
|
|
8708
8792
|
};
|
|
8709
|
-
const [uncontrolledSelectedId, setUncontrolledSelectedId] =
|
|
8793
|
+
const [uncontrolledSelectedId, setUncontrolledSelectedId] = useState21(null);
|
|
8710
8794
|
const rawSelectedId = controlledSelectedId !== void 0 ? controlledSelectedId : uncontrolledSelectedId;
|
|
8711
8795
|
const selectedId = appendSourceChanged ? null : rawSelectedId;
|
|
8712
8796
|
const setSelectedId = (id) => {
|
|
8713
8797
|
if (controlledSelectedId === void 0) setUncontrolledSelectedId(id);
|
|
8714
8798
|
onSelectedIdChange?.(id);
|
|
8715
8799
|
};
|
|
8716
|
-
const [uncontrolledWindowRowId, setUncontrolledWindowRowId] =
|
|
8800
|
+
const [uncontrolledWindowRowId, setUncontrolledWindowRowId] = useState21(null);
|
|
8717
8801
|
const rawWindowRowId = controlledWindowRowId !== void 0 ? controlledWindowRowId : uncontrolledWindowRowId;
|
|
8718
8802
|
const windowRowId = appendSourceChanged ? null : rawWindowRowId;
|
|
8719
8803
|
const setWindowRowId = (id) => {
|
|
8720
8804
|
if (controlledWindowRowId === void 0) setUncontrolledWindowRowId(id);
|
|
8721
8805
|
onWindowRowIdChange?.(id);
|
|
8722
8806
|
};
|
|
8723
|
-
const [windowRowSnapshot, setWindowRowSnapshot] =
|
|
8807
|
+
const [windowRowSnapshot, setWindowRowSnapshot] = useState21(null);
|
|
8724
8808
|
const editScopeKey = appendQueryKey === null ? "\0local" : `append:${appendQueryKey}`;
|
|
8725
|
-
const [editsByScope, setEditsByScope] =
|
|
8726
|
-
const editRevisionRef =
|
|
8727
|
-
const [savingByScope, setSavingByScope] =
|
|
8728
|
-
const
|
|
8809
|
+
const [editsByScope, setEditsByScope] = useState21({});
|
|
8810
|
+
const editRevisionRef = useRef13({});
|
|
8811
|
+
const [savingByScope, setSavingByScope] = useState21({});
|
|
8812
|
+
const savingScopesRef = useRef13(/* @__PURE__ */ new Set());
|
|
8813
|
+
const [editRequest, setEditRequest] = useState21(null);
|
|
8814
|
+
const [confirmForeignDraftDiscard, setConfirmForeignDraftDiscard] = useState21(false);
|
|
8729
8815
|
const edits = editsByScope[editScopeKey]?.values ?? {};
|
|
8730
8816
|
const saving = (savingByScope[editScopeKey] ?? 0) > 0;
|
|
8731
8817
|
const setEdits = (next) => {
|
|
@@ -8792,7 +8878,7 @@ function MatrxDataTableCore({
|
|
|
8792
8878
|
rows: Object.entries(draft.values).map(([rowId, columns2]) => ({ rowId, columns: columns2 }))
|
|
8793
8879
|
}));
|
|
8794
8880
|
const selection = appendSourceChanged && selectionConfig ? { ...selectionConfig, selectedIds: [] } : selectionConfig;
|
|
8795
|
-
|
|
8881
|
+
useEffect15(() => {
|
|
8796
8882
|
const previous = committedAppendQueryKey.current;
|
|
8797
8883
|
committedAppendQueryKey.current = appendQueryKey;
|
|
8798
8884
|
if (previous === null || appendQueryKey === null || previous === appendQueryKey) {
|
|
@@ -8810,13 +8896,13 @@ function MatrxDataTableCore({
|
|
|
8810
8896
|
onWindowRowIdChange,
|
|
8811
8897
|
selectionConfig
|
|
8812
8898
|
]);
|
|
8813
|
-
const scrollRef =
|
|
8814
|
-
const tableRef =
|
|
8815
|
-
const tableHeaderRef =
|
|
8816
|
-
const cardsScrollRef =
|
|
8817
|
-
const [documentStickyHeader, setDocumentStickyHeader] =
|
|
8818
|
-
const documentStickyHeaderRef =
|
|
8819
|
-
const previousAppendKeyForScrollReset =
|
|
8899
|
+
const scrollRef = useRef13(null);
|
|
8900
|
+
const tableRef = useRef13(null);
|
|
8901
|
+
const tableHeaderRef = useRef13(null);
|
|
8902
|
+
const cardsScrollRef = useRef13(null);
|
|
8903
|
+
const [documentStickyHeader, setDocumentStickyHeader] = useState21(false);
|
|
8904
|
+
const documentStickyHeaderRef = useRef13(false);
|
|
8905
|
+
const previousAppendKeyForScrollReset = useRef13(appendQueryKey);
|
|
8820
8906
|
useLayoutEffect2(() => {
|
|
8821
8907
|
const previous = previousAppendKeyForScrollReset.current;
|
|
8822
8908
|
previousAppendKeyForScrollReset.current = appendQueryKey;
|
|
@@ -8842,12 +8928,12 @@ function MatrxDataTableCore({
|
|
|
8842
8928
|
...appendScrollPolicy?.mode === "scroll" && appendScrollPolicy.thresholdPx !== void 0 ? { thresholdPx: appendScrollPolicy.thresholdPx } : {},
|
|
8843
8929
|
...appendScrollPolicy?.mode === "scroll" && appendScrollPolicy.intentTimeoutMs !== void 0 ? { intentTimeoutMs: appendScrollPolicy.intentTimeoutMs } : {}
|
|
8844
8930
|
});
|
|
8845
|
-
const rootRef =
|
|
8931
|
+
const rootRef = useRef13(null);
|
|
8846
8932
|
useClippedContentGuard(rootRef, {
|
|
8847
8933
|
label: typeof copy === "object" && copy.listLabel ? `Table: ${copy.listLabel}` : "MatrxDataTable"
|
|
8848
8934
|
});
|
|
8849
|
-
const [scrollHintRight, setScrollHintRight] =
|
|
8850
|
-
const [scrollHintLeft, setScrollHintLeft] =
|
|
8935
|
+
const [scrollHintRight, setScrollHintRight] = useState21(false);
|
|
8936
|
+
const [scrollHintLeft, setScrollHintLeft] = useState21(false);
|
|
8851
8937
|
const updateScrollHint = useCallback6(() => {
|
|
8852
8938
|
const el = scrollRef.current;
|
|
8853
8939
|
if (!el) return;
|
|
@@ -8862,7 +8948,7 @@ function MatrxDataTableCore({
|
|
|
8862
8948
|
behavior: "smooth"
|
|
8863
8949
|
});
|
|
8864
8950
|
};
|
|
8865
|
-
|
|
8951
|
+
useEffect15(() => {
|
|
8866
8952
|
updateScrollHint();
|
|
8867
8953
|
window.addEventListener("resize", updateScrollHint);
|
|
8868
8954
|
const el = scrollRef.current;
|
|
@@ -8936,26 +9022,26 @@ function MatrxDataTableCore({
|
|
|
8936
9022
|
window.removeEventListener("resize", requestUpdate);
|
|
8937
9023
|
};
|
|
8938
9024
|
}, [stickyHeader, data, columns]);
|
|
8939
|
-
const [columnOrder, setColumnOrder] =
|
|
8940
|
-
const [hiddenColumnIds, setHiddenColumnIds] =
|
|
9025
|
+
const [columnOrder, setColumnOrder] = useState21(() => columnState?.order ?? columns.map(columnId));
|
|
9026
|
+
const [hiddenColumnIds, setHiddenColumnIds] = useState21(
|
|
8941
9027
|
() => new Set(columnState?.hidden ?? columns.filter((column) => column.hidden).map(columnId))
|
|
8942
9028
|
);
|
|
8943
|
-
const [columnWidths, setColumnWidths] =
|
|
9029
|
+
const [columnWidths, setColumnWidths] = useState21(
|
|
8944
9030
|
() => normalizeColumnWidthsForColumns(columnState?.widths, columns)
|
|
8945
9031
|
);
|
|
8946
|
-
const [fixedTableGeometry, setFixedTableGeometry] =
|
|
8947
|
-
const knownColumnIds =
|
|
8948
|
-
const draggedColumnId =
|
|
8949
|
-
const columnDragActive =
|
|
8950
|
-
const columnDragRaf =
|
|
8951
|
-
const columnDragScrollDirection =
|
|
8952
|
-
const [columnDragPreview, setColumnDragPreview] =
|
|
9032
|
+
const [fixedTableGeometry, setFixedTableGeometry] = useState21(null);
|
|
9033
|
+
const knownColumnIds = useRef13(new Set(columns.map(columnId)));
|
|
9034
|
+
const draggedColumnId = useRef13(null);
|
|
9035
|
+
const columnDragActive = useRef13(false);
|
|
9036
|
+
const columnDragRaf = useRef13(null);
|
|
9037
|
+
const columnDragScrollDirection = useRef13(0);
|
|
9038
|
+
const [columnDragPreview, setColumnDragPreview] = useState21(null);
|
|
8953
9039
|
const stopColumnDragScroll = useCallback6(() => {
|
|
8954
9040
|
if (columnDragRaf.current !== null) cancelAnimationFrame(columnDragRaf.current);
|
|
8955
9041
|
columnDragRaf.current = null;
|
|
8956
9042
|
columnDragScrollDirection.current = 0;
|
|
8957
9043
|
}, []);
|
|
8958
|
-
|
|
9044
|
+
useEffect15(() => () => {
|
|
8959
9045
|
columnDragActive.current = false;
|
|
8960
9046
|
stopColumnDragScroll();
|
|
8961
9047
|
}, [stopColumnDragScroll]);
|
|
@@ -8993,7 +9079,7 @@ function MatrxDataTableCore({
|
|
|
8993
9079
|
setHiddenColumnIds(hidden);
|
|
8994
9080
|
}
|
|
8995
9081
|
}, [columnState]);
|
|
8996
|
-
const [internalColumnManagerOpen, setInternalColumnManagerOpen] =
|
|
9082
|
+
const [internalColumnManagerOpen, setInternalColumnManagerOpen] = useState21(false);
|
|
8997
9083
|
const columnManagerOpen = controlledColumnManager?.open ?? internalColumnManagerOpen;
|
|
8998
9084
|
const setColumnManagerOpen = controlledColumnManager?.onOpenChange ?? setInternalColumnManagerOpen;
|
|
8999
9085
|
const columnIds = useMemo7(() => columns.map(columnId), [columns]);
|
|
@@ -9003,7 +9089,7 @@ function MatrxDataTableCore({
|
|
|
9003
9089
|
() => normalizeColumnWidthsForColumns(columnState?.widths ?? columnWidths, columns),
|
|
9004
9090
|
[columns, columnState?.widths, columnWidths]
|
|
9005
9091
|
);
|
|
9006
|
-
const resizeGestureSnapshotRef =
|
|
9092
|
+
const resizeGestureSnapshotRef = useRef13(null);
|
|
9007
9093
|
const measureVisibleColumnWidths = useCallback6(() => {
|
|
9008
9094
|
const measured = {};
|
|
9009
9095
|
const headers = tableRef.current ? Array.from(tableRef.current.querySelectorAll(
|
|
@@ -9076,7 +9162,7 @@ function MatrxDataTableCore({
|
|
|
9076
9162
|
}
|
|
9077
9163
|
setColumnWidths(normalized);
|
|
9078
9164
|
}, [columnIds, columnState, columns, measureFixedTableGeometry, measureVisibleColumnWidths]);
|
|
9079
|
-
|
|
9165
|
+
useEffect15(() => {
|
|
9080
9166
|
const ids = columns.map(columnId);
|
|
9081
9167
|
if (columnState) return;
|
|
9082
9168
|
const previousIds = knownColumnIds.current;
|
|
@@ -9146,6 +9232,7 @@ function MatrxDataTableCore({
|
|
|
9146
9232
|
[visibleColumns]
|
|
9147
9233
|
);
|
|
9148
9234
|
const tableCopySourceNamespace = useId2();
|
|
9235
|
+
const tableContextMenuInstanceId = useId2();
|
|
9149
9236
|
const tableDndContextId = useId2();
|
|
9150
9237
|
const defaultCopyTitle = toolbar?.title || "Table";
|
|
9151
9238
|
const defaultCopy = useMemo7(() => ({
|
|
@@ -9261,8 +9348,8 @@ function MatrxDataTableCore({
|
|
|
9261
9348
|
intelligentSearchEnabled,
|
|
9262
9349
|
searchScope
|
|
9263
9350
|
]);
|
|
9264
|
-
const lastNotifiedViewRows =
|
|
9265
|
-
|
|
9351
|
+
const lastNotifiedViewRows = useRef13(null);
|
|
9352
|
+
useEffect15(() => {
|
|
9266
9353
|
if (!onViewChange) {
|
|
9267
9354
|
lastNotifiedViewRows.current = null;
|
|
9268
9355
|
return;
|
|
@@ -9271,7 +9358,7 @@ function MatrxDataTableCore({
|
|
|
9271
9358
|
lastNotifiedViewRows.current = processed;
|
|
9272
9359
|
if (changed) onViewChange(processed);
|
|
9273
9360
|
}, [processed, onViewChange]);
|
|
9274
|
-
|
|
9361
|
+
useEffect15(() => {
|
|
9275
9362
|
if (controlledQuery) return;
|
|
9276
9363
|
setInternalPage(1);
|
|
9277
9364
|
}, [
|
|
@@ -9323,7 +9410,7 @@ function MatrxDataTableCore({
|
|
|
9323
9410
|
const start = (safePage - 1) * effectivePageSize;
|
|
9324
9411
|
return processed.slice(start, start + effectivePageSize);
|
|
9325
9412
|
}, [processed, safePage, effectivePageSize, pageSize, remoteQuery, hidePagination, localProgressiveEnabled, progressiveRows.rows]);
|
|
9326
|
-
|
|
9413
|
+
useEffect15(() => {
|
|
9327
9414
|
if (!controlledQuery || controlledQuery.state.page === safePage) return;
|
|
9328
9415
|
emitControlledQueryChange({ page: safePage });
|
|
9329
9416
|
}, [controlledQuery, emitControlledQueryChange, safePage]);
|
|
@@ -9342,7 +9429,23 @@ function MatrxDataTableCore({
|
|
|
9342
9429
|
);
|
|
9343
9430
|
const editEnabled = Boolean(edit?.enabled && edit.onSave);
|
|
9344
9431
|
const showRowCopy = effectiveCopy !== void 0 && effectiveCopy.showRow !== false;
|
|
9432
|
+
const rowCopyInMenu = rowCopyPlacement === "menu" && Boolean(rowActions);
|
|
9433
|
+
const showInlineRowCopy = showRowCopy && !rowCopyInMenu;
|
|
9345
9434
|
const showToolbarCopy = effectiveCopy !== void 0 && effectiveCopy.showToolbar !== false;
|
|
9435
|
+
const renderRowActions = (row, controls) => {
|
|
9436
|
+
const actions = rowActions?.(row, controls);
|
|
9437
|
+
const scopedActions = /* @__PURE__ */ jsx41(MatrxTableRowControlsScope, { value: controls, children: actions });
|
|
9438
|
+
if (!effectiveCopy || !showRowCopy) return scopedActions;
|
|
9439
|
+
return /* @__PURE__ */ jsx41(
|
|
9440
|
+
MatrxTableRowAlchemyProvider,
|
|
9441
|
+
{
|
|
9442
|
+
copy: tableRowCopyProps(effectiveCopy, row, `${tableCopySourceNamespace}:row:${getRowId(row)}`, copy === void 0 ? declaredVisibleCopyColumns : void 0),
|
|
9443
|
+
placement: rowCopyInMenu ? "menu" : "inline",
|
|
9444
|
+
controls,
|
|
9445
|
+
children: scopedActions
|
|
9446
|
+
}
|
|
9447
|
+
);
|
|
9448
|
+
};
|
|
9346
9449
|
const activeFilterCount = countActiveColumnFilters(columnFilters);
|
|
9347
9450
|
const facetActive = (toolbar?.facets ?? []).some((f) => {
|
|
9348
9451
|
if (f.type === "custom") return f.filter?.active ?? false;
|
|
@@ -9417,7 +9520,7 @@ function MatrxDataTableCore({
|
|
|
9417
9520
|
const renderedEmptyState = remoteQuery === null && data.length > 0 && hasActiveFilters ? {
|
|
9418
9521
|
title: "No matching rows",
|
|
9419
9522
|
description: "No rows match the current search or filters.",
|
|
9420
|
-
action: /* @__PURE__ */
|
|
9523
|
+
action: /* @__PURE__ */ jsx41(Button, { type: "button", variant: "outline", size: "sm", onClick: clearAllFilters, children: "Clear filters" }),
|
|
9421
9524
|
icon: void 0
|
|
9422
9525
|
} : emptyState;
|
|
9423
9526
|
const commitCell = (rowId, field, next) => {
|
|
@@ -9456,6 +9559,37 @@ function MatrxDataTableCore({
|
|
|
9456
9559
|
return next;
|
|
9457
9560
|
});
|
|
9458
9561
|
};
|
|
9562
|
+
const beginRowEdit = (row) => {
|
|
9563
|
+
const column = visibleColumns.find(
|
|
9564
|
+
(candidate) => candidate.editable && (candidate.editableIf?.(row) ?? true)
|
|
9565
|
+
);
|
|
9566
|
+
if (!column) return;
|
|
9567
|
+
const field = column.accessorKey ? String(column.accessorKey) : columnId(column);
|
|
9568
|
+
setEditRequest((current) => ({
|
|
9569
|
+
rowId: getRowId(row),
|
|
9570
|
+
field,
|
|
9571
|
+
nonce: (current?.nonce ?? 0) + 1
|
|
9572
|
+
}));
|
|
9573
|
+
};
|
|
9574
|
+
const buildRecordControls = (row) => {
|
|
9575
|
+
const rowId = getRowId(row);
|
|
9576
|
+
const pending = edits[rowId];
|
|
9577
|
+
return {
|
|
9578
|
+
closeDetail: () => setSelectedId(null),
|
|
9579
|
+
openDetail: () => openDetail(row),
|
|
9580
|
+
openWindow: () => openWindow(row),
|
|
9581
|
+
closeWindow,
|
|
9582
|
+
hasPendingEdits: Boolean(pending),
|
|
9583
|
+
discardPendingEdits: () => discardRowEdits(rowId),
|
|
9584
|
+
...pending ? { cancelEdits: () => discardRowEdits(rowId) } : {},
|
|
9585
|
+
...pending && edit?.onSave && !edit.autoSave && !saving ? {
|
|
9586
|
+
saveEdits: () => handleSaveEdits(rowId)
|
|
9587
|
+
} : {},
|
|
9588
|
+
...editEnabled && visibleColumns.some(
|
|
9589
|
+
(column) => column.editable && (column.editableIf?.(row) ?? true)
|
|
9590
|
+
) ? { beginEdit: () => beginRowEdit(row) } : {}
|
|
9591
|
+
};
|
|
9592
|
+
};
|
|
9459
9593
|
const hierarchyRows = hierarchy?.rows ?? data;
|
|
9460
9594
|
const hierarchyGetParentId = hierarchy?.getParentId;
|
|
9461
9595
|
const hierarchyIndex = useMemo7(() => {
|
|
@@ -9627,15 +9761,18 @@ function MatrxDataTableCore({
|
|
|
9627
9761
|
}
|
|
9628
9762
|
setDraggedRowId(null);
|
|
9629
9763
|
};
|
|
9630
|
-
const handleSaveEdits = async () => {
|
|
9764
|
+
const handleSaveEdits = async (rowId) => {
|
|
9631
9765
|
if (!edit?.onSave || changeCount === 0) return;
|
|
9632
9766
|
const scope = editScopeKey;
|
|
9767
|
+
if (savingScopesRef.current.has(scope)) return;
|
|
9633
9768
|
const draft = editsByScope[scope];
|
|
9634
9769
|
if (!draft) return;
|
|
9635
|
-
const values = draft.values;
|
|
9636
|
-
|
|
9770
|
+
const values = rowId ? draft.values[rowId] ? { [rowId]: draft.values[rowId] } : {} : draft.values;
|
|
9771
|
+
if (Object.keys(values).length === 0) return;
|
|
9772
|
+
const revisions = rowId ? draft.revisions[rowId] ? { [rowId]: draft.revisions[rowId] } : {} : draft.revisions;
|
|
9637
9773
|
const rows = appendQueryKey === null ? data : draft.rows;
|
|
9638
9774
|
const save = edit.onSave;
|
|
9775
|
+
savingScopesRef.current.add(scope);
|
|
9639
9776
|
startSaving(scope);
|
|
9640
9777
|
try {
|
|
9641
9778
|
await Promise.resolve().then(() => save(values, rows));
|
|
@@ -9643,16 +9780,16 @@ function MatrxDataTableCore({
|
|
|
9643
9780
|
const currentDraft = current[scope];
|
|
9644
9781
|
if (!currentDraft) return current;
|
|
9645
9782
|
const nextValues = {};
|
|
9646
|
-
for (const [
|
|
9647
|
-
const savedRow = values[
|
|
9648
|
-
const savedRevisions = revisions[
|
|
9649
|
-
const currentRevisions = currentDraft.revisions[
|
|
9783
|
+
for (const [rowId2, rowValues] of Object.entries(currentDraft.values)) {
|
|
9784
|
+
const savedRow = values[rowId2];
|
|
9785
|
+
const savedRevisions = revisions[rowId2];
|
|
9786
|
+
const currentRevisions = currentDraft.revisions[rowId2];
|
|
9650
9787
|
const remaining = Object.fromEntries(
|
|
9651
9788
|
Object.entries(rowValues).filter(
|
|
9652
9789
|
([field]) => !Object.hasOwn(savedRow ?? {}, field) || currentRevisions?.[field] !== savedRevisions?.[field]
|
|
9653
9790
|
)
|
|
9654
9791
|
);
|
|
9655
|
-
if (Object.keys(remaining).length > 0) nextValues[
|
|
9792
|
+
if (Object.keys(remaining).length > 0) nextValues[rowId2] = remaining;
|
|
9656
9793
|
}
|
|
9657
9794
|
return { ...current, [scope]: { ...currentDraft, values: nextValues } };
|
|
9658
9795
|
});
|
|
@@ -9662,6 +9799,7 @@ function MatrxDataTableCore({
|
|
|
9662
9799
|
`Couldn't save: ${e instanceof Error ? e.message : String(e)}`
|
|
9663
9800
|
);
|
|
9664
9801
|
} finally {
|
|
9802
|
+
savingScopesRef.current.delete(scope);
|
|
9665
9803
|
finishSaving(scope);
|
|
9666
9804
|
}
|
|
9667
9805
|
};
|
|
@@ -9669,7 +9807,18 @@ function MatrxDataTableCore({
|
|
|
9669
9807
|
setEdits({});
|
|
9670
9808
|
edit?.onCancel?.();
|
|
9671
9809
|
};
|
|
9672
|
-
|
|
9810
|
+
useEffect15(() => {
|
|
9811
|
+
if (!host.rowContextRegistry || !contextMenu && !host.createDefaultRowContext) return;
|
|
9812
|
+
return host.rowContextRegistry.register(tableContextMenuInstanceId, (rowId) => {
|
|
9813
|
+
const row = data.find((candidate) => getRowId(candidate) === rowId);
|
|
9814
|
+
if (!row) return null;
|
|
9815
|
+
const pending = edits[rowId];
|
|
9816
|
+
const displayRow = applyRowEdits(row, pending);
|
|
9817
|
+
const controls = buildRecordControls(displayRow);
|
|
9818
|
+
return contextMenu?.resolveRowContext(displayRow, controls) ?? host.createDefaultRowContext?.(displayRow, controls) ?? null;
|
|
9819
|
+
});
|
|
9820
|
+
}, [buildRecordControls, contextMenu, data, getRowId, host.createDefaultRowContext, host.rowContextRegistry, tableContextMenuInstanceId]);
|
|
9821
|
+
const showActionsCol = windowEnabled || Boolean(rowActions) || showInlineRowCopy;
|
|
9673
9822
|
const selectedIdSet = useMemo7(
|
|
9674
9823
|
() => new Set(selection?.selectedIds ?? []),
|
|
9675
9824
|
[selection?.selectedIds]
|
|
@@ -9686,7 +9835,7 @@ function MatrxDataTableCore({
|
|
|
9686
9835
|
() => data.filter((row) => selectedIdSet.has(getRowId(row))),
|
|
9687
9836
|
[data, selectedIdSet, getRowId]
|
|
9688
9837
|
);
|
|
9689
|
-
const lastToggledIndex =
|
|
9838
|
+
const lastToggledIndex = useRef13(null);
|
|
9690
9839
|
const setSelectedIds = (next) => selection?.onSelectedIdsChange([...next]);
|
|
9691
9840
|
const toggleRowSelected = (index, shiftKey) => {
|
|
9692
9841
|
if (!selection) return;
|
|
@@ -9739,7 +9888,7 @@ function MatrxDataTableCore({
|
|
|
9739
9888
|
const display = renderCell(applyRowEdits(row, rowEdits), col, index);
|
|
9740
9889
|
const href = col.href?.(row) ?? void 0;
|
|
9741
9890
|
if (editEnabled && col.editable && (col.editableIf?.(row) ?? true)) {
|
|
9742
|
-
return /* @__PURE__ */
|
|
9891
|
+
return /* @__PURE__ */ jsx41(
|
|
9743
9892
|
EditableTableCell,
|
|
9744
9893
|
{
|
|
9745
9894
|
value: rowEdits && field in rowEdits ? rowEdits[field] : getCellValue(row, col),
|
|
@@ -9749,11 +9898,12 @@ function MatrxDataTableCore({
|
|
|
9749
9898
|
dirty: Boolean(rowEdits && field in rowEdits),
|
|
9750
9899
|
onCommit: (next) => commitCell(id, field, next),
|
|
9751
9900
|
...href === void 0 ? {} : { href },
|
|
9752
|
-
...col.editTrigger === void 0 ? {} : { editTrigger: col.editTrigger }
|
|
9901
|
+
...col.editTrigger === void 0 ? {} : { editTrigger: col.editTrigger },
|
|
9902
|
+
...editRequest?.rowId === id && editRequest.field === field ? { editRequest: editRequest.nonce } : {}
|
|
9753
9903
|
}
|
|
9754
9904
|
);
|
|
9755
9905
|
}
|
|
9756
|
-
return href ? /* @__PURE__ */
|
|
9906
|
+
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
9907
|
};
|
|
9758
9908
|
const currentViewSnapshot = useMemo7(
|
|
9759
9909
|
() => ({
|
|
@@ -9859,7 +10009,7 @@ function MatrxDataTableCore({
|
|
|
9859
10009
|
},
|
|
9860
10010
|
[columns, commitColumnState, commitColumnWidths, controlledQuery, intelligentSearchEnabled, intelligentSearchScopes, toolbar]
|
|
9861
10011
|
);
|
|
9862
|
-
return /* @__PURE__ */
|
|
10012
|
+
return /* @__PURE__ */ jsx41(TooltipProvider, { children: /* @__PURE__ */ jsx41(ContextMenuBoundary, { label: tableId ?? "Data table", children: /* @__PURE__ */ jsxs31(
|
|
9863
10013
|
DndContext,
|
|
9864
10014
|
{
|
|
9865
10015
|
id: tableDndContextId,
|
|
@@ -9952,11 +10102,12 @@ function MatrxDataTableCore({
|
|
|
9952
10102
|
commitColumnState(order, effectiveHiddenColumnIds);
|
|
9953
10103
|
},
|
|
9954
10104
|
children: [
|
|
9955
|
-
/* @__PURE__ */
|
|
10105
|
+
/* @__PURE__ */ jsxs31(
|
|
9956
10106
|
"div",
|
|
9957
10107
|
{
|
|
9958
10108
|
ref: rootRef,
|
|
9959
10109
|
"data-matrx-table": true,
|
|
10110
|
+
"data-matrx-table-id": tableContextMenuInstanceId,
|
|
9960
10111
|
"data-matrx-table-implementation": "@ai-matrx/design-system",
|
|
9961
10112
|
"data-matrx-table-density": resolvedDensity,
|
|
9962
10113
|
"data-url-state-table": urlState?.id,
|
|
@@ -9966,14 +10117,14 @@ function MatrxDataTableCore({
|
|
|
9966
10117
|
),
|
|
9967
10118
|
children: [
|
|
9968
10119
|
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__ */
|
|
10120
|
+
savedViewError ? /* @__PURE__ */ jsx41("p", { role: "alert", className: "shrink-0 text-xs text-destructive", children: savedViewError }) : null,
|
|
10121
|
+
toolbarActionError ? /* @__PURE__ */ jsx41("p", { role: "alert", className: "shrink-0 text-xs text-destructive", children: toolbarActionError }) : null,
|
|
10122
|
+
!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
10123
|
TableTitleRow,
|
|
9973
10124
|
{
|
|
9974
|
-
tabs: viewTabs ? /* @__PURE__ */
|
|
10125
|
+
tabs: viewTabs ? /* @__PURE__ */ jsx41(TableViewWorkspace, { snapshot: currentViewSnapshot, onApply: applySavedView, related: relatedTableActions }, tableId ?? "table") : void 0,
|
|
9975
10126
|
...toolbar?.title === void 0 ? {} : { title: toolbar.title },
|
|
9976
|
-
context: tableId && SavedViews ? /* @__PURE__ */
|
|
10127
|
+
context: tableId && SavedViews ? /* @__PURE__ */ jsx41("span", { "data-matrx-table-view-control": true, children: /* @__PURE__ */ jsx41(
|
|
9977
10128
|
SavedViews,
|
|
9978
10129
|
{
|
|
9979
10130
|
tableId,
|
|
@@ -9982,7 +10133,7 @@ function MatrxDataTableCore({
|
|
|
9982
10133
|
onApply: applySavedView
|
|
9983
10134
|
}
|
|
9984
10135
|
) }) : void 0,
|
|
9985
|
-
search: showSearch ? intelligentSearchEnabled ? /* @__PURE__ */
|
|
10136
|
+
search: showSearch ? intelligentSearchEnabled ? /* @__PURE__ */ jsx41(
|
|
9986
10137
|
TableSearch,
|
|
9987
10138
|
{
|
|
9988
10139
|
value: searchValue,
|
|
@@ -9992,7 +10143,7 @@ function MatrxDataTableCore({
|
|
|
9992
10143
|
scopes: intelligentSearchScopes,
|
|
9993
10144
|
...toolbar?.searchPlaceholder === void 0 ? {} : { placeholder: toolbar.searchPlaceholder }
|
|
9994
10145
|
}
|
|
9995
|
-
) : /* @__PURE__ */
|
|
10146
|
+
) : /* @__PURE__ */ jsxs31(
|
|
9996
10147
|
"div",
|
|
9997
10148
|
{
|
|
9998
10149
|
"data-matrx-table-search": true,
|
|
@@ -10001,9 +10152,9 @@ function MatrxDataTableCore({
|
|
|
10001
10152
|
toolbar?.searchMatch ? "sm:max-w-md" : "sm:max-w-xs"
|
|
10002
10153
|
),
|
|
10003
10154
|
children: [
|
|
10004
|
-
/* @__PURE__ */
|
|
10005
|
-
/* @__PURE__ */
|
|
10006
|
-
/* @__PURE__ */
|
|
10155
|
+
/* @__PURE__ */ jsxs31("div", { className: "relative min-w-0 flex-1", children: [
|
|
10156
|
+
/* @__PURE__ */ jsx41(Search, { className: "absolute left-2 top-1/2 h-5 w-5 -translate-y-1/2 text-muted-foreground" }),
|
|
10157
|
+
/* @__PURE__ */ jsx41(
|
|
10007
10158
|
Input,
|
|
10008
10159
|
{
|
|
10009
10160
|
value: searchValue,
|
|
@@ -10016,22 +10167,22 @@ function MatrxDataTableCore({
|
|
|
10016
10167
|
style: { fontSize: "16px" }
|
|
10017
10168
|
}
|
|
10018
10169
|
),
|
|
10019
|
-
searchValue ? /* @__PURE__ */
|
|
10020
|
-
/* @__PURE__ */
|
|
10170
|
+
searchValue ? /* @__PURE__ */ jsxs31(Tooltip, { children: [
|
|
10171
|
+
/* @__PURE__ */ jsx41(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx41(
|
|
10021
10172
|
"button",
|
|
10022
10173
|
{
|
|
10023
10174
|
type: "button",
|
|
10024
10175
|
"aria-label": "Clear search",
|
|
10025
10176
|
className: "absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground hover:text-foreground",
|
|
10026
10177
|
onClick: () => setSearchValue(""),
|
|
10027
|
-
children: /* @__PURE__ */
|
|
10178
|
+
children: /* @__PURE__ */ jsx41(X, { className: "h-5 w-5" })
|
|
10028
10179
|
}
|
|
10029
10180
|
) }),
|
|
10030
|
-
/* @__PURE__ */
|
|
10181
|
+
/* @__PURE__ */ jsx41(TooltipContent, { children: "Clear search" })
|
|
10031
10182
|
] }) : null
|
|
10032
10183
|
] }),
|
|
10033
|
-
toolbar?.searchMatch ? /* @__PURE__ */
|
|
10034
|
-
/* @__PURE__ */
|
|
10184
|
+
toolbar?.searchMatch ? /* @__PURE__ */ jsxs31(Tooltip, { children: [
|
|
10185
|
+
/* @__PURE__ */ jsx41(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs31(
|
|
10035
10186
|
Button,
|
|
10036
10187
|
{
|
|
10037
10188
|
type: "button",
|
|
@@ -10044,18 +10195,18 @@ function MatrxDataTableCore({
|
|
|
10044
10195
|
searchMatchMode === "whole_words" ? "contains" : "whole_words"
|
|
10045
10196
|
),
|
|
10046
10197
|
children: [
|
|
10047
|
-
/* @__PURE__ */
|
|
10198
|
+
/* @__PURE__ */ jsx41(WholeWord, { className: "h-5 w-5" }),
|
|
10048
10199
|
searchMatchMode === "whole_words" ? "Whole words" : "Contains"
|
|
10049
10200
|
]
|
|
10050
10201
|
}
|
|
10051
10202
|
) }),
|
|
10052
|
-
/* @__PURE__ */
|
|
10203
|
+
/* @__PURE__ */ jsx41(TooltipContent, { children: searchMatchMode === "whole_words" ? "Whole words \u2014 click to match text anywhere" : "Contains text \u2014 click to require whole words" })
|
|
10053
10204
|
] }) : null
|
|
10054
10205
|
]
|
|
10055
10206
|
}
|
|
10056
10207
|
) : null,
|
|
10057
10208
|
children: [
|
|
10058
|
-
toolbar?.layeredFilters ? /* @__PURE__ */
|
|
10209
|
+
toolbar?.layeredFilters ? /* @__PURE__ */ jsx41(
|
|
10059
10210
|
LayeredFilterBuilder,
|
|
10060
10211
|
{
|
|
10061
10212
|
fields: toolbar.layeredFilters.fields,
|
|
@@ -10065,9 +10216,9 @@ function MatrxDataTableCore({
|
|
|
10065
10216
|
label: toolbar.layeredFilters.label
|
|
10066
10217
|
}
|
|
10067
10218
|
) : null,
|
|
10068
|
-
toolbar?.anyOf ? /* @__PURE__ */
|
|
10069
|
-
/* @__PURE__ */
|
|
10070
|
-
/* @__PURE__ */
|
|
10219
|
+
toolbar?.anyOf ? /* @__PURE__ */ jsxs31("div", { className: "relative w-full max-w-xs", children: [
|
|
10220
|
+
/* @__PURE__ */ jsx41(Search, { className: "absolute left-2 top-1/2 h-5 w-5 -translate-y-1/2 text-muted-foreground" }),
|
|
10221
|
+
/* @__PURE__ */ jsx41(
|
|
10071
10222
|
Input,
|
|
10072
10223
|
{
|
|
10073
10224
|
value: anyOfValue,
|
|
@@ -10077,22 +10228,22 @@ function MatrxDataTableCore({
|
|
|
10077
10228
|
style: { fontSize: "16px" }
|
|
10078
10229
|
}
|
|
10079
10230
|
),
|
|
10080
|
-
anyOfValue ? /* @__PURE__ */
|
|
10081
|
-
/* @__PURE__ */
|
|
10231
|
+
anyOfValue ? /* @__PURE__ */ jsxs31(Tooltip, { children: [
|
|
10232
|
+
/* @__PURE__ */ jsx41(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx41(
|
|
10082
10233
|
"button",
|
|
10083
10234
|
{
|
|
10084
10235
|
type: "button",
|
|
10085
10236
|
"aria-label": "Clear match-any search",
|
|
10086
10237
|
className: "absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground hover:text-foreground",
|
|
10087
10238
|
onClick: () => setAnyOfValue(""),
|
|
10088
|
-
children: /* @__PURE__ */
|
|
10239
|
+
children: /* @__PURE__ */ jsx41(X, { className: "h-5 w-5" })
|
|
10089
10240
|
}
|
|
10090
10241
|
) }),
|
|
10091
|
-
/* @__PURE__ */
|
|
10242
|
+
/* @__PURE__ */ jsx41(TooltipContent, { children: "Clear match-any search" })
|
|
10092
10243
|
] }) : null
|
|
10093
10244
|
] }) : null,
|
|
10094
|
-
renderedFacets ? /* @__PURE__ */
|
|
10095
|
-
toolbar?.leading ? /* @__PURE__ */
|
|
10245
|
+
renderedFacets ? /* @__PURE__ */ jsx41(ToolbarFacets, { facets: renderedFacets }) : null,
|
|
10246
|
+
toolbar?.leading ? /* @__PURE__ */ jsx41(
|
|
10096
10247
|
"div",
|
|
10097
10248
|
{
|
|
10098
10249
|
"data-matrx-table-toolbar-extras": true,
|
|
@@ -10100,13 +10251,13 @@ function MatrxDataTableCore({
|
|
|
10100
10251
|
children: toolbar.leading
|
|
10101
10252
|
}
|
|
10102
10253
|
) : null,
|
|
10103
|
-
/* @__PURE__ */
|
|
10254
|
+
/* @__PURE__ */ jsxs31(
|
|
10104
10255
|
"div",
|
|
10105
10256
|
{
|
|
10106
10257
|
"data-matrx-table-actions": true,
|
|
10107
10258
|
className: "ml-auto flex min-w-0 flex-wrap items-center gap-0",
|
|
10108
10259
|
children: [
|
|
10109
|
-
sourceTotal !== void 0 ? /* @__PURE__ */
|
|
10260
|
+
sourceTotal !== void 0 ? /* @__PURE__ */ jsxs31(
|
|
10110
10261
|
"span",
|
|
10111
10262
|
{
|
|
10112
10263
|
"data-matrx-table-source-total": true,
|
|
@@ -10123,7 +10274,7 @@ function MatrxDataTableCore({
|
|
|
10123
10274
|
]
|
|
10124
10275
|
}
|
|
10125
10276
|
) : null,
|
|
10126
|
-
/* @__PURE__ */
|
|
10277
|
+
/* @__PURE__ */ jsx41(
|
|
10127
10278
|
TableToolbarAction,
|
|
10128
10279
|
{
|
|
10129
10280
|
HostAction: host.ToolbarAction,
|
|
@@ -10131,10 +10282,10 @@ function MatrxDataTableCore({
|
|
|
10131
10282
|
tooltip: hasActiveFilters ? "Clear search and filters; keep columns and sort" : "No search or filters to clear",
|
|
10132
10283
|
disabled: !hasActiveFilters,
|
|
10133
10284
|
onClick: clearAllFilters,
|
|
10134
|
-
children: /* @__PURE__ */
|
|
10285
|
+
children: /* @__PURE__ */ jsx41(Eraser, {})
|
|
10135
10286
|
}
|
|
10136
10287
|
),
|
|
10137
|
-
showToolbarCopy && effectiveCopy ? /* @__PURE__ */
|
|
10288
|
+
showToolbarCopy && effectiveCopy ? /* @__PURE__ */ jsx41(
|
|
10138
10289
|
CopyButtons,
|
|
10139
10290
|
{
|
|
10140
10291
|
size: "toolbar",
|
|
@@ -10177,17 +10328,17 @@ function MatrxDataTableCore({
|
|
|
10177
10328
|
}
|
|
10178
10329
|
}
|
|
10179
10330
|
) : null,
|
|
10180
|
-
columns.length > 0 ? /* @__PURE__ */
|
|
10331
|
+
columns.length > 0 ? /* @__PURE__ */ jsx41(
|
|
10181
10332
|
TableToolbarAction,
|
|
10182
10333
|
{
|
|
10183
10334
|
HostAction: host.ToolbarAction,
|
|
10184
10335
|
ariaLabel: "Columns",
|
|
10185
10336
|
tooltip: "Show, hide, or reorder columns",
|
|
10186
10337
|
onClick: () => setColumnManagerOpen(true),
|
|
10187
|
-
children: /* @__PURE__ */
|
|
10338
|
+
children: /* @__PURE__ */ jsx41(SlidersHorizontal, {})
|
|
10188
10339
|
}
|
|
10189
10340
|
) : null,
|
|
10190
|
-
toolbar?.refresh ? /* @__PURE__ */
|
|
10341
|
+
toolbar?.refresh ? /* @__PURE__ */ jsx41(
|
|
10191
10342
|
TableToolbarAction,
|
|
10192
10343
|
{
|
|
10193
10344
|
HostAction: host.ToolbarAction,
|
|
@@ -10209,10 +10360,10 @@ function MatrxDataTableCore({
|
|
|
10209
10360
|
setToolbarActionPending((current) => ({ ...current, refresh: false }));
|
|
10210
10361
|
});
|
|
10211
10362
|
},
|
|
10212
|
-
children: /* @__PURE__ */
|
|
10363
|
+
children: /* @__PURE__ */ jsx41(RefreshControlIcon, { spinning: isFetching || toolbarActionPending.refresh })
|
|
10213
10364
|
}
|
|
10214
10365
|
) : null,
|
|
10215
|
-
toolbar?.add ? /* @__PURE__ */
|
|
10366
|
+
toolbar?.add ? /* @__PURE__ */ jsx41(
|
|
10216
10367
|
TableToolbarAction,
|
|
10217
10368
|
{
|
|
10218
10369
|
HostAction: host.ToolbarAction,
|
|
@@ -10234,7 +10385,7 @@ function MatrxDataTableCore({
|
|
|
10234
10385
|
setToolbarActionPending((current) => ({ ...current, add: false }));
|
|
10235
10386
|
});
|
|
10236
10387
|
},
|
|
10237
|
-
children: /* @__PURE__ */
|
|
10388
|
+
children: /* @__PURE__ */ jsx41(Plus, {})
|
|
10238
10389
|
}
|
|
10239
10390
|
) : null,
|
|
10240
10391
|
toolbar?.actions
|
|
@@ -10244,15 +10395,15 @@ function MatrxDataTableCore({
|
|
|
10244
10395
|
]
|
|
10245
10396
|
}
|
|
10246
10397
|
),
|
|
10247
|
-
selection && selectionCount > 0 ? /* @__PURE__ */
|
|
10248
|
-
/* @__PURE__ */
|
|
10398
|
+
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: [
|
|
10399
|
+
/* @__PURE__ */ jsxs31("span", { className: "text-xs font-medium text-foreground", children: [
|
|
10249
10400
|
formatCount3(selectionCount),
|
|
10250
10401
|
" ",
|
|
10251
10402
|
selectionNoun,
|
|
10252
10403
|
selectionCount === 1 ? "" : "s",
|
|
10253
10404
|
" selected"
|
|
10254
10405
|
] }),
|
|
10255
|
-
/* @__PURE__ */
|
|
10406
|
+
/* @__PURE__ */ jsxs31(
|
|
10256
10407
|
Button,
|
|
10257
10408
|
{
|
|
10258
10409
|
type: "button",
|
|
@@ -10264,13 +10415,13 @@ function MatrxDataTableCore({
|
|
|
10264
10415
|
selection.onSelectedIdsChange([]);
|
|
10265
10416
|
},
|
|
10266
10417
|
children: [
|
|
10267
|
-
/* @__PURE__ */
|
|
10418
|
+
/* @__PURE__ */ jsx41(X, { className: "h-3.5 w-3.5" }),
|
|
10268
10419
|
"Clear"
|
|
10269
10420
|
]
|
|
10270
10421
|
}
|
|
10271
10422
|
),
|
|
10272
|
-
/* @__PURE__ */
|
|
10273
|
-
effectiveCopy && selectedRows.length > 0 ? /* @__PURE__ */
|
|
10423
|
+
/* @__PURE__ */ jsxs31("div", { className: "ml-auto flex flex-wrap items-center gap-1.5", children: [
|
|
10424
|
+
effectiveCopy && selectedRows.length > 0 ? /* @__PURE__ */ jsx41(
|
|
10274
10425
|
CopyButtons,
|
|
10275
10426
|
{
|
|
10276
10427
|
size: "icon",
|
|
@@ -10303,9 +10454,9 @@ function MatrxDataTableCore({
|
|
|
10303
10454
|
selection.actions?.(selectedRows, selection.selectedIds)
|
|
10304
10455
|
] })
|
|
10305
10456
|
] }) : null,
|
|
10306
|
-
/* @__PURE__ */
|
|
10307
|
-
/* @__PURE__ */
|
|
10308
|
-
mobileCards ? /* @__PURE__ */
|
|
10457
|
+
/* @__PURE__ */ jsxs31("div", { "data-matrx-table-body-region": true, className: "flex min-h-0 flex-1 flex-col gap-2", children: [
|
|
10458
|
+
/* @__PURE__ */ jsxs31("div", { className: "relative min-h-0 flex-1", children: [
|
|
10459
|
+
mobileCards ? /* @__PURE__ */ jsxs31(
|
|
10309
10460
|
"div",
|
|
10310
10461
|
{
|
|
10311
10462
|
ref: cardsScrollRef,
|
|
@@ -10317,33 +10468,33 @@ function MatrxDataTableCore({
|
|
|
10317
10468
|
mobileCardsClass
|
|
10318
10469
|
),
|
|
10319
10470
|
children: [
|
|
10320
|
-
isFetching && !isLoading && appendQuery === null ? /* @__PURE__ */
|
|
10471
|
+
isFetching && !isLoading && appendQuery === null ? /* @__PURE__ */ jsxs31(
|
|
10321
10472
|
"div",
|
|
10322
10473
|
{
|
|
10323
10474
|
role: "status",
|
|
10324
10475
|
className: "pointer-events-none absolute inset-x-0 top-0 z-20 h-0.5 overflow-hidden bg-primary/15",
|
|
10325
10476
|
children: [
|
|
10326
|
-
/* @__PURE__ */
|
|
10327
|
-
/* @__PURE__ */
|
|
10477
|
+
/* @__PURE__ */ jsx41("div", { className: "h-full w-full animate-pulse bg-primary" }),
|
|
10478
|
+
/* @__PURE__ */ jsx41("span", { className: "sr-only", children: "Refreshing table data" })
|
|
10328
10479
|
]
|
|
10329
10480
|
}
|
|
10330
10481
|
) : null,
|
|
10331
|
-
isLoading ? Array.from({ length: 4 }).map((_, index) => /* @__PURE__ */
|
|
10482
|
+
isLoading ? Array.from({ length: 4 }).map((_, index) => /* @__PURE__ */ jsx41(
|
|
10332
10483
|
Skeleton,
|
|
10333
10484
|
{
|
|
10334
10485
|
className: "h-52 w-full shrink-0 rounded-lg"
|
|
10335
10486
|
},
|
|
10336
10487
|
`mobile-card-sk-${index}`
|
|
10337
|
-
)) : paginated.length === 0 ? /* @__PURE__ */
|
|
10488
|
+
)) : 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
10489
|
renderedEmptyState?.icon,
|
|
10339
|
-
/* @__PURE__ */
|
|
10340
|
-
renderedEmptyState?.description ? /* @__PURE__ */
|
|
10490
|
+
/* @__PURE__ */ jsx41("p", { className: "text-sm font-medium text-foreground", children: renderedEmptyState?.title ?? "No rows" }),
|
|
10491
|
+
renderedEmptyState?.description ? /* @__PURE__ */ jsx41("p", { className: "text-xs text-muted-foreground", children: renderedEmptyState.description }) : null,
|
|
10341
10492
|
renderedEmptyState?.action
|
|
10342
10493
|
] }) }) : paginated.map((row, index) => {
|
|
10343
10494
|
const id = getRowId(row);
|
|
10344
10495
|
const displayRow = applyRowEdits(row, edits[id]);
|
|
10345
10496
|
const selectable = selection?.isRowSelectable?.(row) ?? Boolean(selection);
|
|
10346
|
-
return /* @__PURE__ */
|
|
10497
|
+
return /* @__PURE__ */ jsx41("div", { "data-row-id": id, className: "contents", children: mobileCards(displayRow, index, {
|
|
10347
10498
|
renderCell: (columnKey) => {
|
|
10348
10499
|
const column = columns.find((candidate) => columnId(candidate) === columnKey);
|
|
10349
10500
|
return column ? renderRecordCell(row, column, index) : null;
|
|
@@ -10359,14 +10510,14 @@ function MatrxDataTableCore({
|
|
|
10359
10510
|
else next.delete(id);
|
|
10360
10511
|
setSelectedIds(next);
|
|
10361
10512
|
},
|
|
10362
|
-
actions:
|
|
10513
|
+
actions: showInlineRowCopy || rowActions ? /* @__PURE__ */ jsxs31(
|
|
10363
10514
|
"div",
|
|
10364
10515
|
{
|
|
10365
10516
|
"data-matrx-table-row-actions": true,
|
|
10366
10517
|
className: "inline-flex items-center justify-end gap-0",
|
|
10367
10518
|
onClick: (event) => event.stopPropagation(),
|
|
10368
10519
|
children: [
|
|
10369
|
-
|
|
10520
|
+
showInlineRowCopy && effectiveCopy ? /* @__PURE__ */ jsx41(
|
|
10370
10521
|
TableRowCopyControl,
|
|
10371
10522
|
{
|
|
10372
10523
|
size: "toolbar",
|
|
@@ -10376,20 +10527,13 @@ function MatrxDataTableCore({
|
|
|
10376
10527
|
...copy === void 0 ? { defaultColumns: declaredVisibleCopyColumns } : {}
|
|
10377
10528
|
}
|
|
10378
10529
|
) : null,
|
|
10379
|
-
|
|
10380
|
-
closeDetail: () => setSelectedId(null),
|
|
10381
|
-
openDetail: () => openDetail(displayRow),
|
|
10382
|
-
openWindow: () => openWindow(displayRow),
|
|
10383
|
-
closeWindow,
|
|
10384
|
-
hasPendingEdits: Boolean(edits[id]),
|
|
10385
|
-
discardPendingEdits: () => discardRowEdits(id)
|
|
10386
|
-
})
|
|
10530
|
+
renderRowActions(displayRow, buildRecordControls(displayRow))
|
|
10387
10531
|
]
|
|
10388
10532
|
}
|
|
10389
10533
|
) : null
|
|
10390
10534
|
}) }, id);
|
|
10391
10535
|
}),
|
|
10392
|
-
appendQuery !== null && isFetching && !isLoading ? /* @__PURE__ */
|
|
10536
|
+
appendQuery !== null && isFetching && !isLoading ? /* @__PURE__ */ jsxs31(
|
|
10393
10537
|
"div",
|
|
10394
10538
|
{
|
|
10395
10539
|
"data-matrx-table-append-loading-card": true,
|
|
@@ -10397,7 +10541,7 @@ function MatrxDataTableCore({
|
|
|
10397
10541
|
"aria-live": "polite",
|
|
10398
10542
|
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
10543
|
children: [
|
|
10400
|
-
/* @__PURE__ */
|
|
10544
|
+
/* @__PURE__ */ jsx41(
|
|
10401
10545
|
Loader2,
|
|
10402
10546
|
{
|
|
10403
10547
|
"aria-hidden": "true",
|
|
@@ -10411,7 +10555,7 @@ function MatrxDataTableCore({
|
|
|
10411
10555
|
]
|
|
10412
10556
|
}
|
|
10413
10557
|
) : null,
|
|
10414
|
-
/* @__PURE__ */
|
|
10558
|
+
/* @__PURE__ */ jsxs31(
|
|
10415
10559
|
"div",
|
|
10416
10560
|
{
|
|
10417
10561
|
ref: scrollRef,
|
|
@@ -10425,32 +10569,32 @@ function MatrxDataTableCore({
|
|
|
10425
10569
|
tableClassName
|
|
10426
10570
|
),
|
|
10427
10571
|
children: [
|
|
10428
|
-
hierarchy && draggedRow ? /* @__PURE__ */
|
|
10572
|
+
hierarchy && draggedRow ? /* @__PURE__ */ jsx41(
|
|
10429
10573
|
HierarchyRootDropTarget,
|
|
10430
10574
|
{
|
|
10431
10575
|
label: hierarchy.rootDropLabel ?? "Drop here to move to the top level",
|
|
10432
10576
|
draggedLabel: hierarchy.itemLabel?.(draggedRow) ?? "Moving row"
|
|
10433
10577
|
}
|
|
10434
10578
|
) : null,
|
|
10435
|
-
hierarchy && draggedRowId ? /* @__PURE__ */
|
|
10579
|
+
hierarchy && draggedRowId ? /* @__PURE__ */ jsx41(
|
|
10436
10580
|
HierarchyDragIndicatorLayer,
|
|
10437
10581
|
{
|
|
10438
10582
|
scrollRef,
|
|
10439
10583
|
resolve: resolveHierarchyMove
|
|
10440
10584
|
}
|
|
10441
10585
|
) : null,
|
|
10442
|
-
isFetching && !isLoading && appendQuery === null ? /* @__PURE__ */
|
|
10586
|
+
isFetching && !isLoading && appendQuery === null ? /* @__PURE__ */ jsxs31(
|
|
10443
10587
|
"div",
|
|
10444
10588
|
{
|
|
10445
10589
|
role: "status",
|
|
10446
10590
|
className: "pointer-events-none absolute inset-x-0 top-0 z-20 h-0.5 overflow-hidden bg-primary/15",
|
|
10447
10591
|
children: [
|
|
10448
|
-
/* @__PURE__ */
|
|
10449
|
-
/* @__PURE__ */
|
|
10592
|
+
/* @__PURE__ */ jsx41("div", { className: "h-full w-full animate-pulse bg-primary" }),
|
|
10593
|
+
/* @__PURE__ */ jsx41("span", { className: "sr-only", children: "Refreshing table data" })
|
|
10450
10594
|
]
|
|
10451
10595
|
}
|
|
10452
10596
|
) : null,
|
|
10453
|
-
/* @__PURE__ */
|
|
10597
|
+
/* @__PURE__ */ jsxs31(
|
|
10454
10598
|
"table",
|
|
10455
10599
|
{
|
|
10456
10600
|
ref: tableRef,
|
|
@@ -10468,7 +10612,7 @@ function MatrxDataTableCore({
|
|
|
10468
10612
|
fixedLayoutActive && "sm:table-fixed sm:max-w-none sm:w-[var(--matrx-resized-table-width)]"
|
|
10469
10613
|
),
|
|
10470
10614
|
children: [
|
|
10471
|
-
/* @__PURE__ */
|
|
10615
|
+
/* @__PURE__ */ jsx41(
|
|
10472
10616
|
"thead",
|
|
10473
10617
|
{
|
|
10474
10618
|
ref: tableHeaderRef,
|
|
@@ -10477,14 +10621,14 @@ function MatrxDataTableCore({
|
|
|
10477
10621
|
"z-10 border-b border-border bg-muted/90 shadow-[0_1px_0_0_var(--border)] backdrop-blur-sm",
|
|
10478
10622
|
stickyHeader && (documentStickyHeader ? "relative translate-y-[var(--matrx-document-sticky-offset)]" : "sticky top-0")
|
|
10479
10623
|
),
|
|
10480
|
-
children: /* @__PURE__ */
|
|
10481
|
-
selection ? /* @__PURE__ */
|
|
10624
|
+
children: /* @__PURE__ */ jsxs31("tr", { children: [
|
|
10625
|
+
selection ? /* @__PURE__ */ jsx41(
|
|
10482
10626
|
"th",
|
|
10483
10627
|
{
|
|
10484
10628
|
"data-matrx-table-selection-column": true,
|
|
10485
10629
|
className: "h-9 w-9 px-2 text-left align-middle",
|
|
10486
10630
|
style: fixedUtilityWidth(fixedTableGeometry?.selectionWidth),
|
|
10487
|
-
children: /* @__PURE__ */
|
|
10631
|
+
children: /* @__PURE__ */ jsx41(
|
|
10488
10632
|
"div",
|
|
10489
10633
|
{
|
|
10490
10634
|
"data-matrx-table-selection-target": true,
|
|
@@ -10493,7 +10637,7 @@ function MatrxDataTableCore({
|
|
|
10493
10637
|
event.currentTarget.querySelector('[role="checkbox"]')?.click();
|
|
10494
10638
|
}
|
|
10495
10639
|
},
|
|
10496
|
-
children: /* @__PURE__ */
|
|
10640
|
+
children: /* @__PURE__ */ jsx41(
|
|
10497
10641
|
Checkbox,
|
|
10498
10642
|
{
|
|
10499
10643
|
className: CHECKBOX_TAP_AREA,
|
|
@@ -10515,7 +10659,7 @@ function MatrxDataTableCore({
|
|
|
10515
10659
|
const defaultSortDirection = col.defaultSortDirection ?? "asc";
|
|
10516
10660
|
const isColumnDragShadow = columnDragPreview?.draggedId === id && columnDragPreview.targetId !== null;
|
|
10517
10661
|
const columnResizable = resizableColumns && col.resizable !== false;
|
|
10518
|
-
return /* @__PURE__ */
|
|
10662
|
+
return /* @__PURE__ */ jsxs31(
|
|
10519
10663
|
"th",
|
|
10520
10664
|
{
|
|
10521
10665
|
"data-matrx-table-column-id": id,
|
|
@@ -10545,7 +10689,7 @@ function MatrxDataTableCore({
|
|
|
10545
10689
|
),
|
|
10546
10690
|
style: columnWidthVar(col.width, effectiveColumnWidths[id], id, columnResizable),
|
|
10547
10691
|
children: [
|
|
10548
|
-
/* @__PURE__ */
|
|
10692
|
+
/* @__PURE__ */ jsx41(ColumnHeaderDropZone, { id, enabled: reorderableColumns, children: /* @__PURE__ */ jsx41(
|
|
10549
10693
|
ColumnHeaderCell,
|
|
10550
10694
|
{
|
|
10551
10695
|
label: col.header,
|
|
@@ -10582,7 +10726,7 @@ function MatrxDataTableCore({
|
|
|
10582
10726
|
reorderColumn: reorderableColumns ? { id, label: headerLabel } : void 0
|
|
10583
10727
|
}
|
|
10584
10728
|
) }),
|
|
10585
|
-
columnResizable ? /* @__PURE__ */
|
|
10729
|
+
columnResizable ? /* @__PURE__ */ jsx41(
|
|
10586
10730
|
ColumnResizeHandle,
|
|
10587
10731
|
{
|
|
10588
10732
|
columnId: id,
|
|
@@ -10603,7 +10747,7 @@ function MatrxDataTableCore({
|
|
|
10603
10747
|
id
|
|
10604
10748
|
);
|
|
10605
10749
|
}),
|
|
10606
|
-
showActionsCol && /* @__PURE__ */
|
|
10750
|
+
showActionsCol && /* @__PURE__ */ jsx41(
|
|
10607
10751
|
"th",
|
|
10608
10752
|
{
|
|
10609
10753
|
"data-matrx-table-actions-column": true,
|
|
@@ -10615,10 +10759,10 @@ function MatrxDataTableCore({
|
|
|
10615
10759
|
] })
|
|
10616
10760
|
}
|
|
10617
10761
|
),
|
|
10618
|
-
/* @__PURE__ */
|
|
10619
|
-
isLoading ? Array.from({ length: 6 }).map((_, i) => /* @__PURE__ */
|
|
10620
|
-
selection ? /* @__PURE__ */
|
|
10621
|
-
visibleColumns.map((col) => /* @__PURE__ */
|
|
10762
|
+
/* @__PURE__ */ jsxs31("tbody", { children: [
|
|
10763
|
+
isLoading ? Array.from({ length: 6 }).map((_, i) => /* @__PURE__ */ jsxs31("tr", { className: "border-b border-border/60", children: [
|
|
10764
|
+
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,
|
|
10765
|
+
visibleColumns.map((col) => /* @__PURE__ */ jsx41(
|
|
10622
10766
|
"td",
|
|
10623
10767
|
{
|
|
10624
10768
|
className: cn(
|
|
@@ -10626,20 +10770,20 @@ function MatrxDataTableCore({
|
|
|
10626
10770
|
col.compact ? "px-1" : "px-2",
|
|
10627
10771
|
col.mobileHidden && "max-sm:hidden"
|
|
10628
10772
|
),
|
|
10629
|
-
children: /* @__PURE__ */
|
|
10773
|
+
children: /* @__PURE__ */ jsx41(Skeleton, { className: "h-5 w-full" })
|
|
10630
10774
|
},
|
|
10631
10775
|
columnId(col)
|
|
10632
10776
|
)),
|
|
10633
|
-
showActionsCol && /* @__PURE__ */
|
|
10634
|
-
] }, `sk-${i}`)) : paginated.length === 0 ? /* @__PURE__ */
|
|
10777
|
+
showActionsCol && /* @__PURE__ */ jsx41("td", { className: "text-right align-middle", style: fixedUtilityWidth(fixedTableGeometry?.actionsWidth), children: /* @__PURE__ */ jsx41(Skeleton, { className: "ml-auto h-5 w-10" }) })
|
|
10778
|
+
] }, `sk-${i}`)) : paginated.length === 0 ? /* @__PURE__ */ jsx41("tr", { children: /* @__PURE__ */ jsx41(
|
|
10635
10779
|
"td",
|
|
10636
10780
|
{
|
|
10637
10781
|
colSpan: visibleColumns.length + leadingCols + (showActionsCol ? 1 : 0),
|
|
10638
10782
|
className: "px-0 py-12 text-center",
|
|
10639
|
-
children: /* @__PURE__ */
|
|
10783
|
+
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
10784
|
renderedEmptyState?.icon,
|
|
10641
|
-
/* @__PURE__ */
|
|
10642
|
-
renderedEmptyState?.description ? /* @__PURE__ */
|
|
10785
|
+
/* @__PURE__ */ jsx41("p", { className: "text-sm font-medium text-foreground", children: renderedEmptyState?.title ?? "No rows" }),
|
|
10786
|
+
renderedEmptyState?.description ? /* @__PURE__ */ jsx41("p", { className: "text-xs text-muted-foreground", children: renderedEmptyState.description }) : null,
|
|
10643
10787
|
renderedEmptyState?.action
|
|
10644
10788
|
] })
|
|
10645
10789
|
}
|
|
@@ -10649,7 +10793,7 @@ function MatrxDataTableCore({
|
|
|
10649
10793
|
const rowEdits = edits[id];
|
|
10650
10794
|
const displayRow = applyRowEdits(row, rowEdits);
|
|
10651
10795
|
const isChecked = selectedIdSet.has(id);
|
|
10652
|
-
const rowNode = /* @__PURE__ */
|
|
10796
|
+
const rowNode = /* @__PURE__ */ jsxs31(
|
|
10653
10797
|
"tr",
|
|
10654
10798
|
{
|
|
10655
10799
|
"data-row-id": id,
|
|
@@ -10672,13 +10816,13 @@ function MatrxDataTableCore({
|
|
|
10672
10816
|
zebra && index % 2 === 1 && !isSelected && !isChecked && "sm:bg-muted/20"
|
|
10673
10817
|
),
|
|
10674
10818
|
children: [
|
|
10675
|
-
selection ? /* @__PURE__ */
|
|
10819
|
+
selection ? /* @__PURE__ */ jsx41(
|
|
10676
10820
|
"td",
|
|
10677
10821
|
{
|
|
10678
10822
|
className: "px-2 py-1.5 align-middle lg:py-0.5",
|
|
10679
10823
|
style: fixedUtilityWidth(fixedTableGeometry?.selectionWidth),
|
|
10680
10824
|
onClick: (e) => e.stopPropagation(),
|
|
10681
|
-
children: selection.isRowSelectable?.(row) ?? true ? /* @__PURE__ */
|
|
10825
|
+
children: selection.isRowSelectable?.(row) ?? true ? /* @__PURE__ */ jsx41(
|
|
10682
10826
|
"div",
|
|
10683
10827
|
{
|
|
10684
10828
|
"data-matrx-table-selection-target": true,
|
|
@@ -10687,7 +10831,7 @@ function MatrxDataTableCore({
|
|
|
10687
10831
|
event.currentTarget.querySelector('[role="checkbox"]')?.click();
|
|
10688
10832
|
}
|
|
10689
10833
|
},
|
|
10690
|
-
children: /* @__PURE__ */
|
|
10834
|
+
children: /* @__PURE__ */ jsx41(
|
|
10691
10835
|
Checkbox,
|
|
10692
10836
|
{
|
|
10693
10837
|
className: CHECKBOX_TAP_AREA,
|
|
@@ -10702,7 +10846,7 @@ function MatrxDataTableCore({
|
|
|
10702
10846
|
) : null,
|
|
10703
10847
|
visibleColumns.map((col, colIdx) => {
|
|
10704
10848
|
const isColumnDragShadow = columnDragPreview?.draggedId === columnId(col) && columnDragPreview.targetId !== null;
|
|
10705
|
-
return /* @__PURE__ */
|
|
10849
|
+
return /* @__PURE__ */ jsx41(
|
|
10706
10850
|
"td",
|
|
10707
10851
|
{
|
|
10708
10852
|
"data-matrx-table-column-id": columnId(col),
|
|
@@ -10726,14 +10870,14 @@ function MatrxDataTableCore({
|
|
|
10726
10870
|
columnId(col),
|
|
10727
10871
|
resizableColumns && col.resizable !== false
|
|
10728
10872
|
),
|
|
10729
|
-
children: /* @__PURE__ */
|
|
10873
|
+
children: /* @__PURE__ */ jsxs31(
|
|
10730
10874
|
"div",
|
|
10731
10875
|
{
|
|
10732
10876
|
className: cn(
|
|
10733
10877
|
colIdx === 0 && hierarchy && "flex min-w-0 items-center"
|
|
10734
10878
|
),
|
|
10735
10879
|
children: [
|
|
10736
|
-
colIdx === 0 && hierarchy ? /* @__PURE__ */
|
|
10880
|
+
colIdx === 0 && hierarchy ? /* @__PURE__ */ jsx41(
|
|
10737
10881
|
HierarchyDragHandle,
|
|
10738
10882
|
{
|
|
10739
10883
|
id,
|
|
@@ -10741,7 +10885,7 @@ function MatrxDataTableCore({
|
|
|
10741
10885
|
disabled: !(hierarchy.canReparent?.(row) ?? true)
|
|
10742
10886
|
}
|
|
10743
10887
|
) : null,
|
|
10744
|
-
/* @__PURE__ */
|
|
10888
|
+
/* @__PURE__ */ jsx41(
|
|
10745
10889
|
"div",
|
|
10746
10890
|
{
|
|
10747
10891
|
"data-matrx-cell-content": true,
|
|
@@ -10756,20 +10900,20 @@ function MatrxDataTableCore({
|
|
|
10756
10900
|
columnId(col)
|
|
10757
10901
|
);
|
|
10758
10902
|
}),
|
|
10759
|
-
showActionsCol && /* @__PURE__ */
|
|
10903
|
+
showActionsCol && /* @__PURE__ */ jsx41(
|
|
10760
10904
|
"td",
|
|
10761
10905
|
{
|
|
10762
10906
|
"data-matrx-table-row-action-cell": true,
|
|
10763
10907
|
className: "text-right align-middle",
|
|
10764
10908
|
style: fixedUtilityWidth(fixedTableGeometry?.actionsWidth),
|
|
10765
|
-
children: /* @__PURE__ */
|
|
10909
|
+
children: /* @__PURE__ */ jsxs31(
|
|
10766
10910
|
"div",
|
|
10767
10911
|
{
|
|
10768
10912
|
"data-matrx-table-row-actions": true,
|
|
10769
10913
|
className: "inline-flex items-center justify-end gap-0",
|
|
10770
10914
|
onClick: (e) => e.stopPropagation(),
|
|
10771
10915
|
children: [
|
|
10772
|
-
|
|
10916
|
+
showInlineRowCopy && effectiveCopy ? /* @__PURE__ */ jsx41(
|
|
10773
10917
|
TableRowCopyControl,
|
|
10774
10918
|
{
|
|
10775
10919
|
size: "toolbar",
|
|
@@ -10779,16 +10923,9 @@ function MatrxDataTableCore({
|
|
|
10779
10923
|
...copy === void 0 ? { defaultColumns: declaredVisibleCopyColumns } : {}
|
|
10780
10924
|
}
|
|
10781
10925
|
) : null,
|
|
10782
|
-
|
|
10783
|
-
|
|
10784
|
-
|
|
10785
|
-
openWindow: () => openWindow(displayRow),
|
|
10786
|
-
closeWindow,
|
|
10787
|
-
hasPendingEdits: Boolean(rowEdits),
|
|
10788
|
-
discardPendingEdits: () => discardRowEdits(id)
|
|
10789
|
-
}),
|
|
10790
|
-
windowEnabled ? /* @__PURE__ */ jsxs30(Tooltip, { children: [
|
|
10791
|
-
/* @__PURE__ */ jsx40(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx40(
|
|
10926
|
+
renderRowActions(displayRow, buildRecordControls(displayRow)),
|
|
10927
|
+
windowEnabled ? /* @__PURE__ */ jsxs31(Tooltip, { children: [
|
|
10928
|
+
/* @__PURE__ */ jsx41(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx41(
|
|
10792
10929
|
Button,
|
|
10793
10930
|
{
|
|
10794
10931
|
type: "button",
|
|
@@ -10802,10 +10939,10 @@ function MatrxDataTableCore({
|
|
|
10802
10939
|
if (windowConfig?.openOnRowClick === true) openDetail(row);
|
|
10803
10940
|
else openWindow(row);
|
|
10804
10941
|
},
|
|
10805
|
-
children: opensWindowOnRowClick ? /* @__PURE__ */
|
|
10942
|
+
children: opensWindowOnRowClick ? /* @__PURE__ */ jsx41(PanelRightOpen, { className: "h-5 w-5" }) : /* @__PURE__ */ jsx41(PanelRight, { className: "h-5 w-5" })
|
|
10806
10943
|
}
|
|
10807
10944
|
) }),
|
|
10808
|
-
/* @__PURE__ */
|
|
10945
|
+
/* @__PURE__ */ jsx41(TooltipContent, { children: windowConfig?.openOnRowClick === true ? "Open in side panel" : "Open in window" })
|
|
10809
10946
|
] }) : null
|
|
10810
10947
|
]
|
|
10811
10948
|
}
|
|
@@ -10817,7 +10954,7 @@ function MatrxDataTableCore({
|
|
|
10817
10954
|
id
|
|
10818
10955
|
);
|
|
10819
10956
|
const wrappedRow = rowWrapper ? rowWrapper(row, rowNode) : rowNode;
|
|
10820
|
-
return hierarchy ? /* @__PURE__ */
|
|
10957
|
+
return hierarchy ? /* @__PURE__ */ jsx41(
|
|
10821
10958
|
HierarchyDroppableRow,
|
|
10822
10959
|
{
|
|
10823
10960
|
id,
|
|
@@ -10825,21 +10962,21 @@ function MatrxDataTableCore({
|
|
|
10825
10962
|
children: wrappedRow
|
|
10826
10963
|
},
|
|
10827
10964
|
id
|
|
10828
|
-
) : /* @__PURE__ */
|
|
10965
|
+
) : /* @__PURE__ */ jsx41(Fragment6, { children: wrappedRow }, id);
|
|
10829
10966
|
}),
|
|
10830
|
-
appendQuery !== null && isFetching && !isLoading ? /* @__PURE__ */
|
|
10967
|
+
appendQuery !== null && isFetching && !isLoading ? /* @__PURE__ */ jsx41("tr", { "data-matrx-table-append-loading-row": true, children: /* @__PURE__ */ jsx41(
|
|
10831
10968
|
"td",
|
|
10832
10969
|
{
|
|
10833
10970
|
colSpan: visibleColumns.length + leadingCols + (showActionsCol ? 1 : 0),
|
|
10834
10971
|
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__ */
|
|
10972
|
+
children: /* @__PURE__ */ jsxs31(
|
|
10836
10973
|
"div",
|
|
10837
10974
|
{
|
|
10838
10975
|
role: "status",
|
|
10839
10976
|
"aria-live": "polite",
|
|
10840
10977
|
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
10978
|
children: [
|
|
10842
|
-
/* @__PURE__ */
|
|
10979
|
+
/* @__PURE__ */ jsx41(
|
|
10843
10980
|
Loader2,
|
|
10844
10981
|
{
|
|
10845
10982
|
"aria-hidden": "true",
|
|
@@ -10853,9 +10990,9 @@ function MatrxDataTableCore({
|
|
|
10853
10990
|
}
|
|
10854
10991
|
) }) : null
|
|
10855
10992
|
] }),
|
|
10856
|
-
footerRows.length > 0 ? /* @__PURE__ */
|
|
10857
|
-
selection ? /* @__PURE__ */
|
|
10858
|
-
visibleColumns.map((column) => /* @__PURE__ */
|
|
10993
|
+
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: [
|
|
10994
|
+
selection ? /* @__PURE__ */ jsx41("td", { className: "px-2 py-2" }) : null,
|
|
10995
|
+
visibleColumns.map((column) => /* @__PURE__ */ jsx41(
|
|
10859
10996
|
"td",
|
|
10860
10997
|
{
|
|
10861
10998
|
className: cn(
|
|
@@ -10875,7 +11012,7 @@ function MatrxDataTableCore({
|
|
|
10875
11012
|
},
|
|
10876
11013
|
columnId(column)
|
|
10877
11014
|
)),
|
|
10878
|
-
showActionsCol ? /* @__PURE__ */
|
|
11015
|
+
showActionsCol ? /* @__PURE__ */ jsx41("td", {}) : null
|
|
10879
11016
|
] }, `footer-${index}`)) }) : null
|
|
10880
11017
|
]
|
|
10881
11018
|
}
|
|
@@ -10883,8 +11020,8 @@ function MatrxDataTableCore({
|
|
|
10883
11020
|
]
|
|
10884
11021
|
}
|
|
10885
11022
|
),
|
|
10886
|
-
scrollHintLeft ? /* @__PURE__ */
|
|
10887
|
-
/* @__PURE__ */
|
|
11023
|
+
scrollHintLeft ? /* @__PURE__ */ jsxs31(Tooltip, { children: [
|
|
11024
|
+
/* @__PURE__ */ jsx41(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx41(
|
|
10888
11025
|
Button,
|
|
10889
11026
|
{
|
|
10890
11027
|
type: "button",
|
|
@@ -10895,13 +11032,13 @@ function MatrxDataTableCore({
|
|
|
10895
11032
|
"data-matrx-table-scroll-control": "left",
|
|
10896
11033
|
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
11034
|
onClick: () => scrollTableHorizontally("left"),
|
|
10898
|
-
children: /* @__PURE__ */
|
|
11035
|
+
children: /* @__PURE__ */ jsx41(ChevronLeft, { className: "h-5 w-5" })
|
|
10899
11036
|
}
|
|
10900
11037
|
) }),
|
|
10901
|
-
/* @__PURE__ */
|
|
11038
|
+
/* @__PURE__ */ jsx41(TooltipContent, { children: "More columns to the left" })
|
|
10902
11039
|
] }) : null,
|
|
10903
|
-
scrollHintRight ? /* @__PURE__ */
|
|
10904
|
-
/* @__PURE__ */
|
|
11040
|
+
scrollHintRight ? /* @__PURE__ */ jsxs31(Tooltip, { children: [
|
|
11041
|
+
/* @__PURE__ */ jsx41(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx41(
|
|
10905
11042
|
Button,
|
|
10906
11043
|
{
|
|
10907
11044
|
type: "button",
|
|
@@ -10912,26 +11049,26 @@ function MatrxDataTableCore({
|
|
|
10912
11049
|
"data-matrx-table-scroll-control": "right",
|
|
10913
11050
|
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
11051
|
onClick: () => scrollTableHorizontally("right"),
|
|
10915
|
-
children: /* @__PURE__ */
|
|
11052
|
+
children: /* @__PURE__ */ jsx41(ChevronRight, { className: "h-5 w-5" })
|
|
10916
11053
|
}
|
|
10917
11054
|
) }),
|
|
10918
|
-
/* @__PURE__ */
|
|
11055
|
+
/* @__PURE__ */ jsx41(TooltipContent, { children: "More columns to the right" })
|
|
10919
11056
|
] }) : null
|
|
10920
11057
|
] }),
|
|
10921
|
-
appendQuery ? /* @__PURE__ */
|
|
11058
|
+
appendQuery ? /* @__PURE__ */ jsxs31(
|
|
10922
11059
|
"div",
|
|
10923
11060
|
{
|
|
10924
11061
|
"data-matrx-table-footer": true,
|
|
10925
11062
|
className: "flex min-h-11 shrink-0 flex-wrap items-center gap-0 border-t border-border",
|
|
10926
11063
|
"aria-busy": isLoading || isFetching,
|
|
10927
11064
|
children: [
|
|
10928
|
-
/* @__PURE__ */
|
|
11065
|
+
/* @__PURE__ */ jsxs31(
|
|
10929
11066
|
"div",
|
|
10930
11067
|
{
|
|
10931
11068
|
...isFetching && !isLoading ? {} : { role: "status", "aria-live": "polite" },
|
|
10932
11069
|
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
11070
|
children: [
|
|
10934
|
-
isLoading ? /* @__PURE__ */
|
|
11071
|
+
isLoading ? /* @__PURE__ */ jsx41(
|
|
10935
11072
|
Loader2,
|
|
10936
11073
|
{
|
|
10937
11074
|
"data-matrx-table-append-loader": true,
|
|
@@ -10939,17 +11076,17 @@ function MatrxDataTableCore({
|
|
|
10939
11076
|
className: "h-5 w-5 shrink-0 animate-spin text-primary motion-reduce:animate-none"
|
|
10940
11077
|
}
|
|
10941
11078
|
) : null,
|
|
10942
|
-
/* @__PURE__ */
|
|
10943
|
-
/* @__PURE__ */
|
|
10944
|
-
appendQuery.pagination.sourceUntil ? /* @__PURE__ */
|
|
11079
|
+
/* @__PURE__ */ jsxs31("div", { className: "min-w-0 flex-1", children: [
|
|
11080
|
+
/* @__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)}`}` }),
|
|
11081
|
+
appendQuery.pagination.sourceUntil ? /* @__PURE__ */ jsxs31("p", { children: [
|
|
10945
11082
|
"Source fixed through",
|
|
10946
11083
|
" ",
|
|
10947
11084
|
new Date(appendQuery.pagination.sourceUntil).toLocaleString(),
|
|
10948
11085
|
"."
|
|
10949
11086
|
] }) : 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__ */
|
|
11087
|
+
!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,
|
|
11088
|
+
scrollPagination.error ? /* @__PURE__ */ jsx41("p", { role: "alert", className: "text-destructive", children: scrollPagination.error.message }) : null,
|
|
11089
|
+
appendScrollPolicy?.mode === "suspended" ? /* @__PURE__ */ jsxs31("p", { role: "status", children: [
|
|
10953
11090
|
appendScrollPolicy.reason,
|
|
10954
11091
|
" Load more remains available."
|
|
10955
11092
|
] }) : null
|
|
@@ -10957,26 +11094,26 @@ function MatrxDataTableCore({
|
|
|
10957
11094
|
]
|
|
10958
11095
|
}
|
|
10959
11096
|
),
|
|
10960
|
-
appendQuery.pagination.sourcePageSize ? /* @__PURE__ */
|
|
11097
|
+
appendQuery.pagination.sourcePageSize ? /* @__PURE__ */ jsxs31(
|
|
10961
11098
|
Select,
|
|
10962
11099
|
{
|
|
10963
11100
|
value: String(appendQuery.pagination.sourcePageSize.value),
|
|
10964
11101
|
onValueChange: (value) => appendQuery.pagination.sourcePageSize?.onChange(Number(value)),
|
|
10965
11102
|
children: [
|
|
10966
|
-
/* @__PURE__ */
|
|
11103
|
+
/* @__PURE__ */ jsx41(
|
|
10967
11104
|
SelectTrigger,
|
|
10968
11105
|
{
|
|
10969
11106
|
"aria-label": "Rows per load",
|
|
10970
11107
|
className: "h-11 min-w-20 shrink-0 rounded-md border border-border bg-card px-3 text-sm [&_svg]:size-5",
|
|
10971
11108
|
disabled: isLoading || isFetching || appendQuery.pagination.loadAll?.isLoading,
|
|
10972
|
-
children: /* @__PURE__ */
|
|
11109
|
+
children: /* @__PURE__ */ jsx41(SelectValue, {})
|
|
10973
11110
|
}
|
|
10974
11111
|
),
|
|
10975
|
-
/* @__PURE__ */
|
|
11112
|
+
/* @__PURE__ */ jsx41(SelectContent, { children: appendQuery.pagination.sourcePageSize.options.map((size) => /* @__PURE__ */ jsx41(SelectItem, { value: String(size), children: size }, size)) })
|
|
10976
11113
|
]
|
|
10977
11114
|
}
|
|
10978
11115
|
) : null,
|
|
10979
|
-
appendQuery.pagination.loadAll?.isLoading ? /* @__PURE__ */
|
|
11116
|
+
appendQuery.pagination.loadAll?.isLoading ? /* @__PURE__ */ jsx41(
|
|
10980
11117
|
Button,
|
|
10981
11118
|
{
|
|
10982
11119
|
type: "button",
|
|
@@ -10985,7 +11122,7 @@ function MatrxDataTableCore({
|
|
|
10985
11122
|
onClick: appendQuery.pagination.loadAll.stop,
|
|
10986
11123
|
children: "Stop loading"
|
|
10987
11124
|
}
|
|
10988
|
-
) : scrollPagination.error ? /* @__PURE__ */
|
|
11125
|
+
) : scrollPagination.error ? /* @__PURE__ */ jsx41(
|
|
10989
11126
|
Button,
|
|
10990
11127
|
{
|
|
10991
11128
|
type: "button",
|
|
@@ -10994,8 +11131,8 @@ function MatrxDataTableCore({
|
|
|
10994
11131
|
onClick: appendQuery.pagination.retrySource ?? (appendQuery.pagination.hasNextPage ? appendQuery.pagination.loadNextPage : appendQuery.pagination.refresh),
|
|
10995
11132
|
children: appendQuery.pagination.retrySource ? "Retry source" : appendQuery.pagination.hasNextPage ? "Retry" : "Reload rows"
|
|
10996
11133
|
}
|
|
10997
|
-
) : appendQuery.pagination.hasNextPage || scrollPagination.error ? /* @__PURE__ */
|
|
10998
|
-
/* @__PURE__ */
|
|
11134
|
+
) : appendQuery.pagination.hasNextPage || scrollPagination.error ? /* @__PURE__ */ jsxs31("div", { className: "flex min-w-0 max-w-full flex-wrap gap-0", children: [
|
|
11135
|
+
/* @__PURE__ */ jsx41(
|
|
10999
11136
|
Button,
|
|
11000
11137
|
{
|
|
11001
11138
|
type: "button",
|
|
@@ -11006,7 +11143,7 @@ function MatrxDataTableCore({
|
|
|
11006
11143
|
children: "Load more"
|
|
11007
11144
|
}
|
|
11008
11145
|
),
|
|
11009
|
-
appendQuery.pagination.loadAll ? /* @__PURE__ */
|
|
11146
|
+
appendQuery.pagination.loadAll ? /* @__PURE__ */ jsx41(
|
|
11010
11147
|
Button,
|
|
11011
11148
|
{
|
|
11012
11149
|
type: "button",
|
|
@@ -11017,10 +11154,10 @@ function MatrxDataTableCore({
|
|
|
11017
11154
|
children: "Load all"
|
|
11018
11155
|
}
|
|
11019
11156
|
) : null
|
|
11020
|
-
] }) : !isLoading && appendQuery.pagination.totalItems !== void 0 && data.length === appendQuery.pagination.totalItems ? /* @__PURE__ */
|
|
11157
|
+
] }) : !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
11158
|
]
|
|
11022
11159
|
}
|
|
11023
|
-
) : !hidePagination && totalItems > 0 ? /* @__PURE__ */
|
|
11160
|
+
) : !hidePagination && totalItems > 0 ? /* @__PURE__ */ jsx41("div", { className: "shrink-0", children: /* @__PURE__ */ jsx41(
|
|
11024
11161
|
GenericTablePagination,
|
|
11025
11162
|
{
|
|
11026
11163
|
totalItems,
|
|
@@ -11046,7 +11183,7 @@ function MatrxDataTableCore({
|
|
|
11046
11183
|
}
|
|
11047
11184
|
) }) : null
|
|
11048
11185
|
] }),
|
|
11049
|
-
/* @__PURE__ */
|
|
11186
|
+
/* @__PURE__ */ jsx41(
|
|
11050
11187
|
ColumnManager,
|
|
11051
11188
|
{
|
|
11052
11189
|
open: columnManagerOpen,
|
|
@@ -11057,7 +11194,7 @@ function MatrxDataTableCore({
|
|
|
11057
11194
|
onApply: commitColumnState
|
|
11058
11195
|
}
|
|
11059
11196
|
),
|
|
11060
|
-
detailEnabled && selectedRow ? /* @__PURE__ */
|
|
11197
|
+
detailEnabled && selectedRow ? /* @__PURE__ */ jsx41(
|
|
11061
11198
|
SidePanelSurface,
|
|
11062
11199
|
{
|
|
11063
11200
|
title: resolveStringTitle(
|
|
@@ -11068,8 +11205,8 @@ function MatrxDataTableCore({
|
|
|
11068
11205
|
description: detail?.description?.(selectedRow),
|
|
11069
11206
|
onClose: () => setSelectedId(null),
|
|
11070
11207
|
defaultWidth: detail?.defaultWidth ?? 480,
|
|
11071
|
-
headerActions: /* @__PURE__ */
|
|
11072
|
-
effectiveCopy && showRowCopy ? /* @__PURE__ */
|
|
11208
|
+
headerActions: /* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-1", children: [
|
|
11209
|
+
effectiveCopy && showRowCopy ? /* @__PURE__ */ jsx41(
|
|
11073
11210
|
TableRowCopyControl,
|
|
11074
11211
|
{
|
|
11075
11212
|
size: "icon",
|
|
@@ -11081,8 +11218,8 @@ function MatrxDataTableCore({
|
|
|
11081
11218
|
}
|
|
11082
11219
|
) : null,
|
|
11083
11220
|
detail?.headerActions?.(selectedRow),
|
|
11084
|
-
windowEnabled ? /* @__PURE__ */
|
|
11085
|
-
/* @__PURE__ */
|
|
11221
|
+
windowEnabled ? /* @__PURE__ */ jsxs31(Tooltip, { children: [
|
|
11222
|
+
/* @__PURE__ */ jsx41(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx41(
|
|
11086
11223
|
Button,
|
|
11087
11224
|
{
|
|
11088
11225
|
type: "button",
|
|
@@ -11092,10 +11229,10 @@ function MatrxDataTableCore({
|
|
|
11092
11229
|
className: "h-7 w-7",
|
|
11093
11230
|
"aria-label": "Open in window",
|
|
11094
11231
|
onClick: () => openWindow(selectedRow),
|
|
11095
|
-
children: /* @__PURE__ */
|
|
11232
|
+
children: /* @__PURE__ */ jsx41(PanelRight, { className: "h-5 w-5" })
|
|
11096
11233
|
}
|
|
11097
11234
|
) }),
|
|
11098
|
-
/* @__PURE__ */
|
|
11235
|
+
/* @__PURE__ */ jsx41(TooltipContent, { children: "Open in window" })
|
|
11099
11236
|
] }) : null
|
|
11100
11237
|
] }),
|
|
11101
11238
|
children: detail?.render ? (
|
|
@@ -11106,7 +11243,7 @@ function MatrxDataTableCore({
|
|
|
11106
11243
|
// fixes the whole class at once — a custom body that already
|
|
11107
11244
|
// scrolls (`h-full` + `overflow-y-auto` root) still resolves to
|
|
11108
11245
|
// this container's height, so no second scrollbar appears.
|
|
11109
|
-
/* @__PURE__ */
|
|
11246
|
+
/* @__PURE__ */ jsx41("div", { className: "h-full min-h-0 overflow-y-auto", children: detail.render(selectedRow, {
|
|
11110
11247
|
closeDetail: () => setSelectedId(null),
|
|
11111
11248
|
openDetail: () => openDetail(selectedRow),
|
|
11112
11249
|
openWindow: () => openWindow(selectedRow),
|
|
@@ -11114,7 +11251,7 @@ function MatrxDataTableCore({
|
|
|
11114
11251
|
hasPendingEdits: Boolean(edits[getRowId(selectedRow)]),
|
|
11115
11252
|
discardPendingEdits: () => discardRowEdits(getRowId(selectedRow))
|
|
11116
11253
|
}) })
|
|
11117
|
-
) : /* @__PURE__ */
|
|
11254
|
+
) : /* @__PURE__ */ jsx41(
|
|
11118
11255
|
DataRowInspector,
|
|
11119
11256
|
{
|
|
11120
11257
|
row: selectedRow,
|
|
@@ -11126,7 +11263,7 @@ function MatrxDataTableCore({
|
|
|
11126
11263
|
)
|
|
11127
11264
|
}
|
|
11128
11265
|
) : null,
|
|
11129
|
-
windowRow ? /* @__PURE__ */
|
|
11266
|
+
windowRow ? /* @__PURE__ */ jsx41(
|
|
11130
11267
|
DataRowWindow,
|
|
11131
11268
|
{
|
|
11132
11269
|
isOpen: true,
|
|
@@ -11137,9 +11274,9 @@ function MatrxDataTableCore({
|
|
|
11137
11274
|
height: windowConfig?.height,
|
|
11138
11275
|
windowId: `matrx-data-row-${urlState?.id ?? "local"}-${getRowId(windowRow)}`,
|
|
11139
11276
|
defaultTab: windowConfig?.defaultTab,
|
|
11140
|
-
headerActions: /* @__PURE__ */
|
|
11141
|
-
windowConfig?.openOnRowClick === true && detail?.enabled === true ? /* @__PURE__ */
|
|
11142
|
-
/* @__PURE__ */
|
|
11277
|
+
headerActions: /* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-1", children: [
|
|
11278
|
+
windowConfig?.openOnRowClick === true && detail?.enabled === true ? /* @__PURE__ */ jsxs31(Tooltip, { children: [
|
|
11279
|
+
/* @__PURE__ */ jsx41(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx41(
|
|
11143
11280
|
Button,
|
|
11144
11281
|
{
|
|
11145
11282
|
type: "button",
|
|
@@ -11152,12 +11289,12 @@ function MatrxDataTableCore({
|
|
|
11152
11289
|
closeWindow();
|
|
11153
11290
|
openDetail(windowRow);
|
|
11154
11291
|
},
|
|
11155
|
-
children: /* @__PURE__ */
|
|
11292
|
+
children: /* @__PURE__ */ jsx41(PanelRightOpen, { className: "h-5 w-5" })
|
|
11156
11293
|
}
|
|
11157
11294
|
) }),
|
|
11158
|
-
/* @__PURE__ */
|
|
11295
|
+
/* @__PURE__ */ jsx41(TooltipContent, { children: "Open in side panel" })
|
|
11159
11296
|
] }) : null,
|
|
11160
|
-
effectiveCopy && showRowCopy ? /* @__PURE__ */
|
|
11297
|
+
effectiveCopy && showRowCopy ? /* @__PURE__ */ jsx41(
|
|
11161
11298
|
TableRowCopyControl,
|
|
11162
11299
|
{
|
|
11163
11300
|
size: "icon",
|
|
@@ -11176,7 +11313,7 @@ function MatrxDataTableCore({
|
|
|
11176
11313
|
closeWindow,
|
|
11177
11314
|
hasPendingEdits: Boolean(edits[getRowId(windowRow)]),
|
|
11178
11315
|
discardPendingEdits: () => discardRowEdits(getRowId(windowRow))
|
|
11179
|
-
}) ?? /* @__PURE__ */
|
|
11316
|
+
}) ?? /* @__PURE__ */ jsx41(
|
|
11180
11317
|
DataRowInspector,
|
|
11181
11318
|
{
|
|
11182
11319
|
row: windowRow,
|
|
@@ -11212,15 +11349,15 @@ function MatrxDataTableCore({
|
|
|
11212
11349
|
})
|
|
11213
11350
|
}
|
|
11214
11351
|
) : null,
|
|
11215
|
-
editEnabled ? /* @__PURE__ */
|
|
11216
|
-
foreignDrafts.length > 0 ? /* @__PURE__ */
|
|
11352
|
+
editEnabled ? /* @__PURE__ */ jsxs31(Fragment7, { children: [
|
|
11353
|
+
foreignDrafts.length > 0 ? /* @__PURE__ */ jsxs31(
|
|
11217
11354
|
"div",
|
|
11218
11355
|
{
|
|
11219
11356
|
"data-matrx-foreign-drafts": true,
|
|
11220
11357
|
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
11358
|
children: [
|
|
11222
|
-
/* @__PURE__ */
|
|
11223
|
-
/* @__PURE__ */
|
|
11359
|
+
/* @__PURE__ */ jsx41("span", { children: "Unsaved edits from previous results" }),
|
|
11360
|
+
/* @__PURE__ */ jsx41(
|
|
11224
11361
|
CopyButtons,
|
|
11225
11362
|
{
|
|
11226
11363
|
size: "xs",
|
|
@@ -11229,11 +11366,11 @@ function MatrxDataTableCore({
|
|
|
11229
11366
|
json: () => foreignDraftPayload
|
|
11230
11367
|
}
|
|
11231
11368
|
),
|
|
11232
|
-
/* @__PURE__ */
|
|
11369
|
+
/* @__PURE__ */ jsx41(Button, { type: "button", size: "sm", variant: "ghost", className: "h-7 text-xs text-destructive", onClick: () => setConfirmForeignDraftDiscard(true), children: "Discard drafts" })
|
|
11233
11370
|
]
|
|
11234
11371
|
}
|
|
11235
11372
|
) : null,
|
|
11236
|
-
/* @__PURE__ */
|
|
11373
|
+
/* @__PURE__ */ jsx41(
|
|
11237
11374
|
ConfirmDialog,
|
|
11238
11375
|
{
|
|
11239
11376
|
open: confirmForeignDraftDiscard,
|
|
@@ -11253,7 +11390,7 @@ function MatrxDataTableCore({
|
|
|
11253
11390
|
}
|
|
11254
11391
|
}
|
|
11255
11392
|
),
|
|
11256
|
-
/* @__PURE__ */
|
|
11393
|
+
/* @__PURE__ */ jsx41(
|
|
11257
11394
|
DirtySavePill,
|
|
11258
11395
|
{
|
|
11259
11396
|
changeCount,
|
|
@@ -11266,15 +11403,15 @@ function MatrxDataTableCore({
|
|
|
11266
11403
|
]
|
|
11267
11404
|
}
|
|
11268
11405
|
),
|
|
11269
|
-
/* @__PURE__ */
|
|
11406
|
+
/* @__PURE__ */ jsx41(DragOverlay, { children: draggedRow ? (
|
|
11270
11407
|
// w-max: the overlay inherits the ACTIVE node's size, and the active
|
|
11271
11408
|
// node is the 16px grip handle — without it the label wraps to one
|
|
11272
11409
|
// character per line.
|
|
11273
|
-
/* @__PURE__ */
|
|
11410
|
+
/* @__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
11411
|
) : null })
|
|
11275
11412
|
]
|
|
11276
11413
|
}
|
|
11277
|
-
) });
|
|
11414
|
+
) }) });
|
|
11278
11415
|
}
|
|
11279
11416
|
function HierarchyDragHandle({
|
|
11280
11417
|
id,
|
|
@@ -11285,7 +11422,7 @@ function HierarchyDragHandle({
|
|
|
11285
11422
|
id,
|
|
11286
11423
|
disabled
|
|
11287
11424
|
});
|
|
11288
|
-
return /* @__PURE__ */
|
|
11425
|
+
return /* @__PURE__ */ jsx41(
|
|
11289
11426
|
"button",
|
|
11290
11427
|
{
|
|
11291
11428
|
ref: setNodeRef,
|
|
@@ -11297,7 +11434,7 @@ function HierarchyDragHandle({
|
|
|
11297
11434
|
onClick: (event) => event.stopPropagation(),
|
|
11298
11435
|
...attributes,
|
|
11299
11436
|
...listeners,
|
|
11300
|
-
children: /* @__PURE__ */
|
|
11437
|
+
children: /* @__PURE__ */ jsx41(GripVertical, { className: "h-3.5 w-3.5" })
|
|
11301
11438
|
}
|
|
11302
11439
|
);
|
|
11303
11440
|
}
|
|
@@ -11306,7 +11443,7 @@ function HierarchyRootDropTarget({
|
|
|
11306
11443
|
draggedLabel
|
|
11307
11444
|
}) {
|
|
11308
11445
|
const { isOver, setNodeRef } = useDroppable2({ id: "__root__" });
|
|
11309
|
-
return /* @__PURE__ */
|
|
11446
|
+
return /* @__PURE__ */ jsxs31(
|
|
11310
11447
|
"div",
|
|
11311
11448
|
{
|
|
11312
11449
|
ref: setNodeRef,
|
|
@@ -11316,8 +11453,8 @@ function HierarchyRootDropTarget({
|
|
|
11316
11453
|
isOver && "border-solid bg-primary/20 shadow-md shadow-primary/25"
|
|
11317
11454
|
),
|
|
11318
11455
|
children: [
|
|
11319
|
-
/* @__PURE__ */
|
|
11320
|
-
/* @__PURE__ */
|
|
11456
|
+
/* @__PURE__ */ jsx41("span", { className: "truncate", children: draggedLabel }),
|
|
11457
|
+
/* @__PURE__ */ jsx41("span", { className: "text-primary/75", children: label })
|
|
11321
11458
|
]
|
|
11322
11459
|
}
|
|
11323
11460
|
);
|
|
@@ -11326,7 +11463,7 @@ function HierarchyDragIndicatorLayer({
|
|
|
11326
11463
|
scrollRef,
|
|
11327
11464
|
resolve: resolve2
|
|
11328
11465
|
}) {
|
|
11329
|
-
const [indicator, setIndicator] =
|
|
11466
|
+
const [indicator, setIndicator] = useState21(
|
|
11330
11467
|
null
|
|
11331
11468
|
);
|
|
11332
11469
|
useDndMonitor2({
|
|
@@ -11366,7 +11503,7 @@ function HierarchyDragIndicatorLayer({
|
|
|
11366
11503
|
const { preview: preview2 } = indicator;
|
|
11367
11504
|
const indent = indicator.left + 10 + preview2.depth * 12;
|
|
11368
11505
|
if (preview2.position === "inside") {
|
|
11369
|
-
return /* @__PURE__ */
|
|
11506
|
+
return /* @__PURE__ */ jsx41(
|
|
11370
11507
|
"div",
|
|
11371
11508
|
{
|
|
11372
11509
|
"aria-hidden": "true",
|
|
@@ -11378,7 +11515,7 @@ function HierarchyDragIndicatorLayer({
|
|
|
11378
11515
|
width: Math.max(0, indicator.width - 4),
|
|
11379
11516
|
height: indicator.height
|
|
11380
11517
|
},
|
|
11381
|
-
children: /* @__PURE__ */
|
|
11518
|
+
children: /* @__PURE__ */ jsxs31(
|
|
11382
11519
|
"span",
|
|
11383
11520
|
{
|
|
11384
11521
|
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 +11530,7 @@ function HierarchyDragIndicatorLayer({
|
|
|
11393
11530
|
);
|
|
11394
11531
|
}
|
|
11395
11532
|
const lineTop = preview2.position === "before" ? indicator.top - 1 : indicator.top + indicator.height - 1;
|
|
11396
|
-
return /* @__PURE__ */
|
|
11533
|
+
return /* @__PURE__ */ jsx41(
|
|
11397
11534
|
"div",
|
|
11398
11535
|
{
|
|
11399
11536
|
"aria-hidden": "true",
|
|
@@ -11404,9 +11541,9 @@ function HierarchyDragIndicatorLayer({
|
|
|
11404
11541
|
left: indent,
|
|
11405
11542
|
width: Math.max(0, indicator.left + indicator.width - indent - 8)
|
|
11406
11543
|
},
|
|
11407
|
-
children: /* @__PURE__ */
|
|
11408
|
-
/* @__PURE__ */
|
|
11409
|
-
/* @__PURE__ */
|
|
11544
|
+
children: /* @__PURE__ */ jsxs31("div", { className: "relative h-0.5 rounded-full bg-primary", children: [
|
|
11545
|
+
/* @__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" }),
|
|
11546
|
+
/* @__PURE__ */ jsxs31(
|
|
11410
11547
|
"span",
|
|
11411
11548
|
{
|
|
11412
11549
|
className: cn(
|
|
@@ -11447,7 +11584,7 @@ function ColumnHeaderDropZone({
|
|
|
11447
11584
|
disabled: !enabled,
|
|
11448
11585
|
data: { matrxDragKind: "column-header", columnId: id }
|
|
11449
11586
|
});
|
|
11450
|
-
return /* @__PURE__ */
|
|
11587
|
+
return /* @__PURE__ */ jsx41("div", { ref: setNodeRef, className: "flex min-w-0 items-center", children });
|
|
11451
11588
|
}
|
|
11452
11589
|
function fixedUtilityWidth(width) {
|
|
11453
11590
|
return width === void 0 ? void 0 : { width: `${width}px`, minWidth: `${width}px`, maxWidth: `${width}px` };
|
|
@@ -11472,14 +11609,14 @@ function columnWidthVar(width, resizedWidth, id, resizable) {
|
|
|
11472
11609
|
};
|
|
11473
11610
|
}
|
|
11474
11611
|
function DefaultJsonCell({ value }) {
|
|
11475
|
-
const [open, setOpen] =
|
|
11612
|
+
const [open, setOpen] = useState21(false);
|
|
11476
11613
|
const host = useMatrxDataTableHost();
|
|
11477
11614
|
const Viewer = host.JsonViewer;
|
|
11478
11615
|
const text = JSON.stringify(value, null, 2);
|
|
11479
11616
|
const summary = Array.isArray(value) ? `${value.length} items` : Object.keys(value).slice(0, 3).join(", ") || "Empty object";
|
|
11480
|
-
return /* @__PURE__ */
|
|
11481
|
-
/* @__PURE__ */
|
|
11482
|
-
/* @__PURE__ */
|
|
11617
|
+
return /* @__PURE__ */ jsxs31(Fragment7, { children: [
|
|
11618
|
+
/* @__PURE__ */ jsxs31(Tooltip, { children: [
|
|
11619
|
+
/* @__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
11620
|
event.stopPropagation();
|
|
11484
11621
|
setOpen(true);
|
|
11485
11622
|
}, style: { display: "-webkit-box", WebkitLineClamp: 2, WebkitBoxOrient: "vertical", overflow: "hidden", whiteSpace: "normal", overflowWrap: "anywhere" }, "aria-label": "Open JSON value", children: [
|
|
@@ -11487,9 +11624,9 @@ function DefaultJsonCell({ value }) {
|
|
|
11487
11624
|
" ",
|
|
11488
11625
|
summary
|
|
11489
11626
|
] }) }),
|
|
11490
|
-
/* @__PURE__ */
|
|
11627
|
+
/* @__PURE__ */ jsx41(TooltipContent, { className: "max-w-md max-h-80 overflow-auto whitespace-pre-wrap break-words", children: text })
|
|
11491
11628
|
] }),
|
|
11492
|
-
/* @__PURE__ */
|
|
11629
|
+
/* @__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
11630
|
] });
|
|
11494
11631
|
}
|
|
11495
11632
|
function renderCell(row, col, index) {
|
|
@@ -11500,7 +11637,7 @@ function renderCell(row, col, index) {
|
|
|
11500
11637
|
if (asUuid && typeof raw === "string") {
|
|
11501
11638
|
const forbidden = typeof col.fk?.forbidden === "function" ? col.fk.forbidden(raw, row) : Boolean(col.fk?.forbidden);
|
|
11502
11639
|
const declaredToken = typeof col.fk?.token === "function" ? col.fk.token(row) : col.fk?.token;
|
|
11503
|
-
return /* @__PURE__ */
|
|
11640
|
+
return /* @__PURE__ */ jsx41(
|
|
11504
11641
|
MatrxUuidCell,
|
|
11505
11642
|
{
|
|
11506
11643
|
value: raw,
|
|
@@ -11512,14 +11649,14 @@ function renderCell(row, col, index) {
|
|
|
11512
11649
|
}
|
|
11513
11650
|
);
|
|
11514
11651
|
}
|
|
11515
|
-
if (raw !== null && typeof raw === "object" && !(raw instanceof Date)) return /* @__PURE__ */
|
|
11652
|
+
if (raw !== null && typeof raw === "object" && !(raw instanceof Date)) return /* @__PURE__ */ jsx41(DefaultJsonCell, { value: raw });
|
|
11516
11653
|
if (typeof raw === "boolean") {
|
|
11517
|
-
return /* @__PURE__ */
|
|
11654
|
+
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
11655
|
}
|
|
11519
11656
|
const formatted = formatTableDisplayValue(raw);
|
|
11520
|
-
return /* @__PURE__ */
|
|
11521
|
-
/* @__PURE__ */
|
|
11522
|
-
/* @__PURE__ */
|
|
11657
|
+
return /* @__PURE__ */ jsxs31(Tooltip, { children: [
|
|
11658
|
+
/* @__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 }) }),
|
|
11659
|
+
/* @__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
11660
|
] });
|
|
11524
11661
|
}
|
|
11525
11662
|
function resolveStringTitle(title, fallback) {
|
|
@@ -11529,19 +11666,19 @@ function resolveStringTitle(title, fallback) {
|
|
|
11529
11666
|
}
|
|
11530
11667
|
|
|
11531
11668
|
// src/data-table/SavedViewsControl.tsx
|
|
11532
|
-
import { useId as useId3, useState as
|
|
11669
|
+
import { useId as useId3, useState as useState22 } from "react";
|
|
11533
11670
|
|
|
11534
11671
|
// src/dropdown-menu.tsx
|
|
11535
11672
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
11536
11673
|
import * as React17 from "react";
|
|
11537
|
-
import { jsx as
|
|
11674
|
+
import { jsx as jsx42, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
11538
11675
|
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
11539
11676
|
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
11540
11677
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
11541
11678
|
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
11679
|
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
11680
|
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__ */
|
|
11681
|
+
var DropdownMenuSubTrigger = React17.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs32(
|
|
11545
11682
|
DropdownMenuPrimitive.SubTrigger,
|
|
11546
11683
|
{
|
|
11547
11684
|
ref,
|
|
@@ -11554,12 +11691,12 @@ var DropdownMenuSubTrigger = React17.forwardRef(({ className, inset, children, .
|
|
|
11554
11691
|
...props,
|
|
11555
11692
|
children: [
|
|
11556
11693
|
children,
|
|
11557
|
-
/* @__PURE__ */
|
|
11694
|
+
/* @__PURE__ */ jsx42(RadixChevronRightIcon, { className: "ml-auto h-4 w-4" })
|
|
11558
11695
|
]
|
|
11559
11696
|
}
|
|
11560
11697
|
));
|
|
11561
11698
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
11562
|
-
var DropdownMenuSubContent = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
11699
|
+
var DropdownMenuSubContent = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx42(
|
|
11563
11700
|
DropdownMenuPrimitive.SubContent,
|
|
11564
11701
|
{
|
|
11565
11702
|
ref,
|
|
@@ -11571,7 +11708,7 @@ var DropdownMenuSubContent = React17.forwardRef(({ className, ...props }, ref) =
|
|
|
11571
11708
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
11572
11709
|
var DropdownMenuContent = React17.forwardRef(({ className, sideOffset = 4, container, ...props }, ref) => {
|
|
11573
11710
|
const portalContainer = usePortalContainer(container);
|
|
11574
|
-
return /* @__PURE__ */
|
|
11711
|
+
return /* @__PURE__ */ jsx42(DropdownMenuPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx42(
|
|
11575
11712
|
DropdownMenuPrimitive.Content,
|
|
11576
11713
|
{
|
|
11577
11714
|
ref,
|
|
@@ -11588,7 +11725,7 @@ var DropdownMenuContent = React17.forwardRef(({ className, sideOffset = 4, conta
|
|
|
11588
11725
|
) });
|
|
11589
11726
|
});
|
|
11590
11727
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
11591
|
-
var DropdownMenuItem = React17.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */
|
|
11728
|
+
var DropdownMenuItem = React17.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx42(
|
|
11592
11729
|
DropdownMenuPrimitive.Item,
|
|
11593
11730
|
{
|
|
11594
11731
|
ref,
|
|
@@ -11598,7 +11735,7 @@ var DropdownMenuItem = React17.forwardRef(({ className, inset, ...props }, ref)
|
|
|
11598
11735
|
}
|
|
11599
11736
|
));
|
|
11600
11737
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
11601
|
-
var DropdownMenuCheckboxItem = React17.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
11738
|
+
var DropdownMenuCheckboxItem = React17.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs32(
|
|
11602
11739
|
DropdownMenuPrimitive.CheckboxItem,
|
|
11603
11740
|
{
|
|
11604
11741
|
ref,
|
|
@@ -11606,13 +11743,13 @@ var DropdownMenuCheckboxItem = React17.forwardRef(({ className, children, ...pro
|
|
|
11606
11743
|
className: cn(MENU_INDICATOR_ITEM_CLASS, className),
|
|
11607
11744
|
...props,
|
|
11608
11745
|
children: [
|
|
11609
|
-
/* @__PURE__ */
|
|
11746
|
+
/* @__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
11747
|
children
|
|
11611
11748
|
]
|
|
11612
11749
|
}
|
|
11613
11750
|
));
|
|
11614
11751
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
11615
|
-
var DropdownMenuRadioItem = React17.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
11752
|
+
var DropdownMenuRadioItem = React17.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs32(
|
|
11616
11753
|
DropdownMenuPrimitive.RadioItem,
|
|
11617
11754
|
{
|
|
11618
11755
|
ref,
|
|
@@ -11620,13 +11757,13 @@ var DropdownMenuRadioItem = React17.forwardRef(({ className, children, ...props
|
|
|
11620
11757
|
className: cn(MENU_INDICATOR_ITEM_CLASS, className),
|
|
11621
11758
|
...props,
|
|
11622
11759
|
children: [
|
|
11623
|
-
/* @__PURE__ */
|
|
11760
|
+
/* @__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
11761
|
children
|
|
11625
11762
|
]
|
|
11626
11763
|
}
|
|
11627
11764
|
));
|
|
11628
11765
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
11629
|
-
var DropdownMenuLabel = React17.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */
|
|
11766
|
+
var DropdownMenuLabel = React17.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx42(
|
|
11630
11767
|
DropdownMenuPrimitive.Label,
|
|
11631
11768
|
{
|
|
11632
11769
|
ref,
|
|
@@ -11636,7 +11773,7 @@ var DropdownMenuLabel = React17.forwardRef(({ className, inset, ...props }, ref)
|
|
|
11636
11773
|
}
|
|
11637
11774
|
));
|
|
11638
11775
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
11639
|
-
var DropdownMenuSeparator = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
11776
|
+
var DropdownMenuSeparator = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx42(
|
|
11640
11777
|
DropdownMenuPrimitive.Separator,
|
|
11641
11778
|
{
|
|
11642
11779
|
ref,
|
|
@@ -11649,7 +11786,7 @@ DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
|
11649
11786
|
var DropdownMenuShortcut = ({
|
|
11650
11787
|
className,
|
|
11651
11788
|
...props
|
|
11652
|
-
}) => /* @__PURE__ */
|
|
11789
|
+
}) => /* @__PURE__ */ jsx42(
|
|
11653
11790
|
"span",
|
|
11654
11791
|
{
|
|
11655
11792
|
"data-slot": "dropdown-menu-shortcut",
|
|
@@ -11660,7 +11797,7 @@ var DropdownMenuShortcut = ({
|
|
|
11660
11797
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
11661
11798
|
|
|
11662
11799
|
// src/data-table/SavedViewsControl.tsx
|
|
11663
|
-
import { jsx as
|
|
11800
|
+
import { jsx as jsx43, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
11664
11801
|
function SavedViewsControl({
|
|
11665
11802
|
views,
|
|
11666
11803
|
activeId = null,
|
|
@@ -11673,10 +11810,10 @@ function SavedViewsControl({
|
|
|
11673
11810
|
onReload
|
|
11674
11811
|
}) {
|
|
11675
11812
|
const unsavedChangesId = useId3();
|
|
11676
|
-
const [saveOpen, setSaveOpen] =
|
|
11677
|
-
const [name, setName] =
|
|
11678
|
-
const [saving, setSaving] =
|
|
11679
|
-
const [actionError, setActionError] =
|
|
11813
|
+
const [saveOpen, setSaveOpen] = useState22(false);
|
|
11814
|
+
const [name, setName] = useState22("");
|
|
11815
|
+
const [saving, setSaving] = useState22(false);
|
|
11816
|
+
const [actionError, setActionError] = useState22(null);
|
|
11680
11817
|
const visibleError = actionError ?? error;
|
|
11681
11818
|
const save = async () => {
|
|
11682
11819
|
const next = name.trim();
|
|
@@ -11718,10 +11855,10 @@ function SavedViewsControl({
|
|
|
11718
11855
|
}
|
|
11719
11856
|
};
|
|
11720
11857
|
const activeName = activeId ? views.find((view) => view.id === activeId)?.name : void 0;
|
|
11721
|
-
return /* @__PURE__ */
|
|
11722
|
-
/* @__PURE__ */
|
|
11723
|
-
/* @__PURE__ */
|
|
11724
|
-
/* @__PURE__ */
|
|
11858
|
+
return /* @__PURE__ */ jsxs33("div", { className: "flex min-w-0 flex-wrap items-center gap-1", "data-matrx-table-saved-views": true, children: [
|
|
11859
|
+
/* @__PURE__ */ jsxs33(DropdownMenu, { children: [
|
|
11860
|
+
/* @__PURE__ */ jsxs33(Tooltip, { children: [
|
|
11861
|
+
/* @__PURE__ */ jsx43(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx43(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs33(
|
|
11725
11862
|
Button,
|
|
11726
11863
|
{
|
|
11727
11864
|
type: "button",
|
|
@@ -11732,38 +11869,38 @@ function SavedViewsControl({
|
|
|
11732
11869
|
"aria-describedby": dirty ? unsavedChangesId : void 0,
|
|
11733
11870
|
disabled: saving,
|
|
11734
11871
|
children: [
|
|
11735
|
-
/* @__PURE__ */
|
|
11736
|
-
dirty ? /* @__PURE__ */
|
|
11737
|
-
/* @__PURE__ */
|
|
11872
|
+
/* @__PURE__ */ jsx43("span", { className: "min-w-0 flex-1 truncate", children: loading ? "Loading views\u2026" : activeName ?? "Default view" }),
|
|
11873
|
+
dirty ? /* @__PURE__ */ jsx43("span", { "aria-hidden": "true", className: "size-1.5 shrink-0 rounded-full bg-amber-500" }) : null,
|
|
11874
|
+
/* @__PURE__ */ jsx43(ChevronDown, { className: "size-3.5 shrink-0" })
|
|
11738
11875
|
]
|
|
11739
11876
|
}
|
|
11740
11877
|
) }) }),
|
|
11741
|
-
/* @__PURE__ */
|
|
11878
|
+
/* @__PURE__ */ jsx43(TooltipContent, { children: "Choose or save a table view" })
|
|
11742
11879
|
] }),
|
|
11743
|
-
/* @__PURE__ */
|
|
11744
|
-
/* @__PURE__ */
|
|
11745
|
-
/* @__PURE__ */
|
|
11746
|
-
/* @__PURE__ */
|
|
11747
|
-
views.map((view) => /* @__PURE__ */
|
|
11880
|
+
/* @__PURE__ */ jsxs33(DropdownMenuContent, { align: "end", children: [
|
|
11881
|
+
/* @__PURE__ */ jsx43(DropdownMenuLabel, { children: "Views" }),
|
|
11882
|
+
/* @__PURE__ */ jsxs33(DropdownMenuRadioGroup, { value: activeId ?? "__default__", onValueChange: (value) => onSelect(value === "__default__" ? null : value), children: [
|
|
11883
|
+
/* @__PURE__ */ jsx43(DropdownMenuRadioItem, { value: "__default__", children: "Default view" }),
|
|
11884
|
+
views.map((view) => /* @__PURE__ */ jsx43(DropdownMenuRadioItem, { value: view.id, children: view.name }, view.id))
|
|
11748
11885
|
] }),
|
|
11749
|
-
/* @__PURE__ */
|
|
11750
|
-
/* @__PURE__ */
|
|
11886
|
+
/* @__PURE__ */ jsx43(DropdownMenuSeparator, {}),
|
|
11887
|
+
/* @__PURE__ */ jsx43(DropdownMenuItem, { disabled: saving, onSelect: () => {
|
|
11751
11888
|
setActionError(null);
|
|
11752
11889
|
setSaveOpen(true);
|
|
11753
11890
|
}, children: "Save current view\u2026" }),
|
|
11754
|
-
activeId && onUpdate ? /* @__PURE__ */
|
|
11755
|
-
onReload ? /* @__PURE__ */
|
|
11891
|
+
activeId && onUpdate ? /* @__PURE__ */ jsx43(DropdownMenuItem, { disabled: saving, onSelect: () => void update(), children: "Update current view" }) : null,
|
|
11892
|
+
onReload ? /* @__PURE__ */ jsx43(DropdownMenuItem, { disabled: saving || loading, onSelect: () => void reload(), children: "Reload views" }) : null
|
|
11756
11893
|
] })
|
|
11757
11894
|
] }),
|
|
11758
|
-
dirty ? /* @__PURE__ */
|
|
11759
|
-
visibleError ? /* @__PURE__ */
|
|
11760
|
-
/* @__PURE__ */
|
|
11761
|
-
/* @__PURE__ */
|
|
11762
|
-
visibleError ? /* @__PURE__ */
|
|
11763
|
-
/* @__PURE__ */
|
|
11764
|
-
/* @__PURE__ */
|
|
11765
|
-
/* @__PURE__ */
|
|
11766
|
-
/* @__PURE__ */
|
|
11895
|
+
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,
|
|
11896
|
+
visibleError ? /* @__PURE__ */ jsx43("p", { role: "alert", className: "basis-full break-words text-xs text-destructive", children: visibleError }) : null,
|
|
11897
|
+
/* @__PURE__ */ jsx43(Dialog, { open: saveOpen, onOpenChange: setSaveOpen, children: /* @__PURE__ */ jsxs33(DialogContent, { children: [
|
|
11898
|
+
/* @__PURE__ */ jsx43(DialogHeader, { children: /* @__PURE__ */ jsx43(DialogTitle, { children: "Save current view" }) }),
|
|
11899
|
+
visibleError ? /* @__PURE__ */ jsx43("p", { role: "alert", className: "text-sm text-destructive", children: visibleError }) : null,
|
|
11900
|
+
/* @__PURE__ */ jsx43(Input, { "aria-label": "View name", value: name, onChange: (event) => setName(event.target.value), placeholder: "View name", autoFocus: true }),
|
|
11901
|
+
/* @__PURE__ */ jsxs33(DialogFooter, { children: [
|
|
11902
|
+
/* @__PURE__ */ jsx43(Button, { type: "button", variant: "outline", onClick: () => setSaveOpen(false), children: "Cancel" }),
|
|
11903
|
+
/* @__PURE__ */ jsx43(Button, { type: "button", disabled: !name.trim() || saving, onClick: () => void save(), children: saving ? "Saving\u2026" : "Save view" })
|
|
11767
11904
|
] })
|
|
11768
11905
|
] }) })
|
|
11769
11906
|
] });
|
|
@@ -11810,6 +11947,7 @@ export {
|
|
|
11810
11947
|
GenericTablePagination,
|
|
11811
11948
|
MatrxDataTable,
|
|
11812
11949
|
MatrxDataTableProvider,
|
|
11950
|
+
MatrxTableRowAlchemyProvider,
|
|
11813
11951
|
MatrxUuidCell,
|
|
11814
11952
|
SavedViewsControl,
|
|
11815
11953
|
TableTitleRow,
|
|
@@ -11828,6 +11966,7 @@ export {
|
|
|
11828
11966
|
shortUuid,
|
|
11829
11967
|
tableUrlParamPrefix,
|
|
11830
11968
|
useMatrxDataTableHost,
|
|
11969
|
+
useMatrxTableRowAlchemy,
|
|
11831
11970
|
useScrollPagination,
|
|
11832
11971
|
useTableUrlState
|
|
11833
11972
|
};
|