@ai-matrx/design-system 0.48.1 → 0.48.5
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 +47 -0
- package/dist/data-table/copy-helpers.d.cts +1 -1
- package/dist/data-table/copy-helpers.d.ts +1 -1
- package/dist/data-table/filter-engine.d.cts +1 -1
- package/dist/data-table/filter-engine.d.ts +1 -1
- package/dist/data-table/host.d.cts +1 -1
- package/dist/data-table/host.d.ts +1 -1
- package/dist/data-table/index.cjs +87 -27
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.d.cts +3 -21
- package/dist/data-table/index.d.ts +3 -21
- package/dist/data-table/index.js +184 -124
- package/dist/data-table/index.js.map +1 -1
- package/dist/data-table/infer-filter.d.cts +1 -1
- package/dist/data-table/infer-filter.d.ts +1 -1
- package/dist/data-table/layered-filters.d.cts +1 -1
- package/dist/data-table/layered-filters.d.ts +1 -1
- package/dist/data-table/pagination.cjs +4 -1
- package/dist/data-table/pagination.cjs.map +1 -1
- package/dist/data-table/pagination.js +4 -1
- package/dist/data-table/pagination.js.map +1 -1
- package/dist/data-table/query-control.d.cts +1 -1
- package/dist/data-table/query-control.d.ts +1 -1
- package/dist/data-table/types.cjs.map +1 -1
- package/dist/data-table/types.d.cts +1 -1
- package/dist/data-table/types.d.ts +1 -1
- package/dist/data-table/url-state.d.cts +1 -1
- package/dist/data-table/url-state.d.ts +1 -1
- package/dist/data-table/xlsx.d.cts +1 -1
- package/dist/data-table/xlsx.d.ts +1 -1
- package/dist/index.cjs +43 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -2
- package/dist/index.d.ts +40 -2
- package/dist/index.js +43 -13
- package/dist/index.js.map +1 -1
- package/dist/tap-target.css +4 -1
- package/dist/{types-DuvXeW4i.d.cts → types-Dh3wRc0N.d.cts} +52 -1
- package/dist/{types-oza_vuRW.d.ts → types-hMqC2Fwn.d.ts} +52 -1
- package/package.json +1 -1
package/dist/data-table/index.js
CHANGED
|
@@ -34006,11 +34006,11 @@ import {
|
|
|
34006
34006
|
isValidElement as isValidElement2,
|
|
34007
34007
|
memo,
|
|
34008
34008
|
useCallback as useCallback8,
|
|
34009
|
-
useEffect as
|
|
34009
|
+
useEffect as useEffect18,
|
|
34010
34010
|
useId as useId2,
|
|
34011
34011
|
useLayoutEffect as useLayoutEffect3,
|
|
34012
34012
|
useMemo as useMemo10,
|
|
34013
|
-
useRef as
|
|
34013
|
+
useRef as useRef17,
|
|
34014
34014
|
useState as useState24
|
|
34015
34015
|
} from "react";
|
|
34016
34016
|
import { createPortal as createPortal2 } from "react-dom";
|
|
@@ -34807,17 +34807,22 @@ function ConfirmDialog({
|
|
|
34807
34807
|
|
|
34808
34808
|
// src/input.tsx
|
|
34809
34809
|
import * as React7 from "react";
|
|
34810
|
+
|
|
34811
|
+
// src/field-surface.ts
|
|
34812
|
+
var FIELD_SURFACE_CLASS = "border border-border bg-card";
|
|
34813
|
+
|
|
34814
|
+
// src/input.tsx
|
|
34810
34815
|
import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
34811
34816
|
var getVariantStyles = (variant = "default") => {
|
|
34812
|
-
const baseStyles = `flex h-10 w-full
|
|
34817
|
+
const baseStyles = `flex h-10 w-full ${FIELD_SURFACE_CLASS} text-foreground shadow-input rounded-md px-3 py-2 text-sm file:border-0 file:bg-transparent
|
|
34813
34818
|
file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground
|
|
34814
34819
|
focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-ring
|
|
34815
34820
|
disabled:cursor-not-allowed disabled:opacity-50
|
|
34816
34821
|
dark:shadow-none
|
|
34817
34822
|
transition duration-400
|
|
34818
|
-
[&:-webkit-autofill]:bg-
|
|
34819
|
-
dark:[&:-webkit-autofill]:shadow-[0_0_0_1000px_hsl(var(--
|
|
34820
|
-
[&:-webkit-autofill:hover]:shadow-[0_0_0_1000px_hsl(var(--
|
|
34823
|
+
[&:-webkit-autofill]:bg-card [&:-webkit-autofill]:shadow-[0_0_0_1000px_hsl(var(--card))_inset] [&:-webkit-autofill]:[caret-color:currentColor]
|
|
34824
|
+
dark:[&:-webkit-autofill]:shadow-[0_0_0_1000px_hsl(var(--card))_inset] dark:[&:-webkit-autofill]:[-webkit-text-fill-color:hsl(var(--foreground))]
|
|
34825
|
+
[&:-webkit-autofill:hover]:shadow-[0_0_0_1000px_hsl(var(--card))_inset] [&:-webkit-autofill:focus]:shadow-[0_0_0_1000px_hsl(var(--card))_inset]`;
|
|
34821
34826
|
switch (variant) {
|
|
34822
34827
|
case "destructive":
|
|
34823
34828
|
return `${baseStyles} bg-destructive text-destructive-foreground`;
|
|
@@ -34882,7 +34887,7 @@ var BasicInput = React7.forwardRef(
|
|
|
34882
34887
|
{
|
|
34883
34888
|
type,
|
|
34884
34889
|
className: cn(
|
|
34885
|
-
|
|
34890
|
+
`flex h-9 w-full rounded-md ${FIELD_SURFACE_CLASS} px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,
|
|
34886
34891
|
className
|
|
34887
34892
|
),
|
|
34888
34893
|
ref,
|
|
@@ -34915,7 +34920,7 @@ import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
|
34915
34920
|
var Select = SelectPrimitive.Root;
|
|
34916
34921
|
var SelectValue = SelectPrimitive.Value;
|
|
34917
34922
|
var selectTriggerVariants = cva2(
|
|
34918
|
-
|
|
34923
|
+
`flex w-full items-center justify-between gap-2 whitespace-nowrap rounded-md ${FIELD_SURFACE_CLASS} text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground transition-colors hover:bg-accent hover:border-accent-foreground/20 focus:outline-none focus:ring-1 focus:ring-primary/30 focus:border-primary/40 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:min-w-0 [&>span]:line-clamp-1`,
|
|
34919
34924
|
{
|
|
34920
34925
|
variants: {
|
|
34921
34926
|
size: {
|
|
@@ -36569,14 +36574,30 @@ function GenericTablePagination({
|
|
|
36569
36574
|
}
|
|
36570
36575
|
|
|
36571
36576
|
// src/data-table/TableViewTabs.tsx
|
|
36572
|
-
import { useState as useState8 } from "react";
|
|
36577
|
+
import { useEffect as useEffect5, useRef as useRef6, useState as useState8 } from "react";
|
|
36573
36578
|
import { jsx as jsx24, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
36574
|
-
function TableViewTabs({ tabs, activeId, onSelect, onAdd, onClose, onRename, related }) {
|
|
36579
|
+
function TableViewTabs({ tabs, activeId, onSelect, onAdd, onClose, onRename, related, editingId, onEditCancel, onEditDone }) {
|
|
36575
36580
|
const [renaming, setRenaming] = useState8(null);
|
|
36576
36581
|
const [draft, setDraft] = useState8("");
|
|
36582
|
+
const opened = useRef6(null);
|
|
36583
|
+
useEffect5(() => {
|
|
36584
|
+
if (!editingId || opened.current === editingId) return;
|
|
36585
|
+
const tab = tabs.find((t) => t.id === editingId);
|
|
36586
|
+
if (!tab) return;
|
|
36587
|
+
opened.current = editingId;
|
|
36588
|
+
setDraft(tab.label);
|
|
36589
|
+
setRenaming(editingId);
|
|
36590
|
+
}, [editingId, tabs]);
|
|
36577
36591
|
const commit = () => {
|
|
36578
36592
|
if (renaming && draft.trim()) onRename(renaming, draft.trim());
|
|
36579
36593
|
setRenaming(null);
|
|
36594
|
+
onEditDone?.();
|
|
36595
|
+
};
|
|
36596
|
+
const cancel = () => {
|
|
36597
|
+
const id = renaming;
|
|
36598
|
+
setRenaming(null);
|
|
36599
|
+
if (id) onEditCancel?.(id);
|
|
36600
|
+
onEditDone?.();
|
|
36580
36601
|
};
|
|
36581
36602
|
return /* @__PURE__ */ jsxs16("div", { className: "flex min-w-0 shrink-0 items-center border-b", "data-matrx-table-tabs": true, children: [
|
|
36582
36603
|
/* @__PURE__ */ jsxs16("div", { role: "tablist", "aria-label": "Table views", className: "flex min-w-0 flex-1 items-center overflow-x-auto", children: [
|
|
@@ -36589,9 +36610,11 @@ function TableViewTabs({ tabs, activeId, onSelect, onAdd, onClose, onRename, rel
|
|
|
36589
36610
|
value: draft,
|
|
36590
36611
|
onChange: (e) => setDraft(e.target.value),
|
|
36591
36612
|
onBlur: commit,
|
|
36613
|
+
onFocus: (e) => e.currentTarget.select(),
|
|
36614
|
+
placeholder: "Name this view",
|
|
36592
36615
|
onKeyDown: (e) => {
|
|
36593
36616
|
if (e.key === "Enter") commit();
|
|
36594
|
-
if (e.key === "Escape")
|
|
36617
|
+
if (e.key === "Escape") cancel();
|
|
36595
36618
|
},
|
|
36596
36619
|
className: "h-8 w-32 bg-transparent px-2 text-xs outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
36597
36620
|
}
|
|
@@ -36623,7 +36646,7 @@ function TableViewTabs({ tabs, activeId, onSelect, onAdd, onClose, onRename, rel
|
|
|
36623
36646
|
]
|
|
36624
36647
|
}
|
|
36625
36648
|
),
|
|
36626
|
-
tabs.length > 1 && /* @__PURE__ */ jsxs16(Tooltip, { children: [
|
|
36649
|
+
tabs.length > 1 && tab.id !== "default" && /* @__PURE__ */ jsxs16(Tooltip, { children: [
|
|
36627
36650
|
/* @__PURE__ */ jsx24(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx24("button", { type: "button", "aria-label": `Close ${tab.label}`, onClick: () => onClose(tab.id), className: "flex size-7 items-center justify-center rounded hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring", children: /* @__PURE__ */ jsx24(X, { className: "size-4" }) }) }),
|
|
36628
36651
|
/* @__PURE__ */ jsxs16(TooltipContent, { children: [
|
|
36629
36652
|
"Close ",
|
|
@@ -36633,21 +36656,33 @@ function TableViewTabs({ tabs, activeId, onSelect, onAdd, onClose, onRename, rel
|
|
|
36633
36656
|
] }, tab.id)),
|
|
36634
36657
|
/* @__PURE__ */ jsxs16(Tooltip, { children: [
|
|
36635
36658
|
/* @__PURE__ */ jsx24(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx24("button", { type: "button", "aria-label": "New table tab", onClick: onAdd, className: "flex size-8 shrink-0 items-center justify-center rounded hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring", children: /* @__PURE__ */ jsx24(Plus, { className: "size-4" }) }) }),
|
|
36636
|
-
/* @__PURE__ */ jsx24(TooltipContent, { children: "New
|
|
36659
|
+
/* @__PURE__ */ jsx24(TooltipContent, { children: "New view from the current one \xB7 double-click a tab to rename" })
|
|
36637
36660
|
] })
|
|
36638
36661
|
] }),
|
|
36639
36662
|
related && /* @__PURE__ */ jsx24("div", { className: "flex shrink-0 items-center gap-1 border-l px-2", children: related })
|
|
36640
36663
|
] });
|
|
36641
36664
|
}
|
|
36642
|
-
|
|
36643
|
-
|
|
36665
|
+
var same = (a, b) => JSON.stringify(a) === JSON.stringify(b);
|
|
36666
|
+
function TableViewWorkspace({ snapshot, onApply, related, store }) {
|
|
36667
|
+
const [localViews, setLocalViews] = useState8([]);
|
|
36668
|
+
const [defaultSnapshot, setDefaultSnapshot] = useState8(snapshot);
|
|
36644
36669
|
const [activeId, setActiveId] = useState8("default");
|
|
36670
|
+
const [namingId, setNamingId] = useState8(null);
|
|
36671
|
+
const saved = store ? store.views : localViews;
|
|
36672
|
+
const write = (next) => store ? store.onChange(next) : setLocalViews(next);
|
|
36673
|
+
const tabs = [{ id: "default", label: "Default view", snapshot: defaultSnapshot }, ...saved];
|
|
36674
|
+
const stashed = () => saved.map((tab) => tab.id === activeId && !same(tab.snapshot, snapshot) ? { ...tab, snapshot } : tab);
|
|
36675
|
+
const activeSaved = saved.find((tab) => tab.id === activeId);
|
|
36676
|
+
useEffect5(() => {
|
|
36677
|
+
if (store && activeSaved && !same(activeSaved.snapshot, snapshot)) write(stashed());
|
|
36678
|
+
}, [snapshot]);
|
|
36645
36679
|
const select = (id) => {
|
|
36646
36680
|
if (id === activeId) return;
|
|
36647
36681
|
const target = tabs.find((tab) => tab.id === id);
|
|
36648
36682
|
if (!target) return;
|
|
36649
|
-
if (
|
|
36650
|
-
|
|
36683
|
+
if (!same(target.snapshot, snapshot)) onApply(target.snapshot);
|
|
36684
|
+
if (activeId === "default") setDefaultSnapshot(snapshot);
|
|
36685
|
+
else write(stashed());
|
|
36651
36686
|
setActiveId(id);
|
|
36652
36687
|
};
|
|
36653
36688
|
return /* @__PURE__ */ jsx24(
|
|
@@ -36657,17 +36692,31 @@ function TableViewWorkspace({ snapshot, onApply, related }) {
|
|
|
36657
36692
|
activeId,
|
|
36658
36693
|
onSelect: select,
|
|
36659
36694
|
related,
|
|
36695
|
+
editingId: namingId,
|
|
36696
|
+
onEditDone: () => setNamingId(null),
|
|
36697
|
+
onEditCancel: (id) => {
|
|
36698
|
+
if (id !== namingId) return;
|
|
36699
|
+
write(saved.filter((tab) => tab.id !== id));
|
|
36700
|
+
if (activeId === id) setActiveId("default");
|
|
36701
|
+
},
|
|
36660
36702
|
onAdd: () => {
|
|
36661
36703
|
const id = crypto.randomUUID();
|
|
36662
|
-
|
|
36704
|
+
if (activeId === "default") setDefaultSnapshot(snapshot);
|
|
36705
|
+
write([...stashed(), { id, label: `View ${saved.length + 2}`, snapshot }]);
|
|
36663
36706
|
setActiveId(id);
|
|
36707
|
+
setNamingId(id);
|
|
36664
36708
|
},
|
|
36665
36709
|
onClose: (id) => {
|
|
36666
36710
|
if (tabs.length < 2) return;
|
|
36667
|
-
|
|
36668
|
-
|
|
36711
|
+
const rest = saved.filter((tab) => tab.id !== id);
|
|
36712
|
+
if (id === activeId) {
|
|
36713
|
+
const next = tabs.find((tab) => tab.id !== id);
|
|
36714
|
+
if (!same(next.snapshot, snapshot)) onApply(next.snapshot);
|
|
36715
|
+
setActiveId(next.id);
|
|
36716
|
+
}
|
|
36717
|
+
write(rest);
|
|
36669
36718
|
},
|
|
36670
|
-
onRename: (id, label) =>
|
|
36719
|
+
onRename: (id, label) => write(saved.map((tab) => tab.id === id ? { ...tab, label } : tab))
|
|
36671
36720
|
}
|
|
36672
36721
|
);
|
|
36673
36722
|
}
|
|
@@ -39960,9 +40009,9 @@ function useCopySubsetVariant() {
|
|
|
39960
40009
|
}
|
|
39961
40010
|
|
|
39962
40011
|
// src/data-table/clipping.ts
|
|
39963
|
-
import { useEffect as
|
|
40012
|
+
import { useEffect as useEffect8 } from "react";
|
|
39964
40013
|
function useClippedContentGuard(ref, options) {
|
|
39965
|
-
|
|
40014
|
+
useEffect8(() => {
|
|
39966
40015
|
if (!options.enabled || !ref.current) return;
|
|
39967
40016
|
const node = ref.current;
|
|
39968
40017
|
const check = () => {
|
|
@@ -39976,7 +40025,7 @@ function useClippedContentGuard(ref, options) {
|
|
|
39976
40025
|
}
|
|
39977
40026
|
|
|
39978
40027
|
// src/data-table/url-state.ts
|
|
39979
|
-
import { useCallback as useCallback4, useEffect as
|
|
40028
|
+
import { useCallback as useCallback4, useEffect as useEffect9, useMemo as useMemo6, useRef as useRef10, useState as useState13 } from "react";
|
|
39980
40029
|
import {
|
|
39981
40030
|
commitUrlParams,
|
|
39982
40031
|
useUrlSearchParams
|
|
@@ -40056,9 +40105,9 @@ function useTableUrlState(options) {
|
|
|
40056
40105
|
[defaultPageSize, defaultSortDirection, defaultSortId, key]
|
|
40057
40106
|
);
|
|
40058
40107
|
const state = readState(searchParams);
|
|
40059
|
-
const lastTextWriteAt =
|
|
40108
|
+
const lastTextWriteAt = useRef10(0);
|
|
40060
40109
|
const [debouncedSearch, setDebouncedSearch] = useState13(state.search);
|
|
40061
|
-
|
|
40110
|
+
useEffect9(() => {
|
|
40062
40111
|
if (state.search === debouncedSearch) return;
|
|
40063
40112
|
const timer = window.setTimeout(
|
|
40064
40113
|
() => setDebouncedSearch(state.search),
|
|
@@ -40166,14 +40215,14 @@ import {
|
|
|
40166
40215
|
} from "@ai-matrx/kit/url-state";
|
|
40167
40216
|
|
|
40168
40217
|
// src/data-table/RowAlchemyLauncher.tsx
|
|
40169
|
-
import { useCallback as useCallback5, useEffect as
|
|
40218
|
+
import { useCallback as useCallback5, useEffect as useEffect10, useRef as useRef11, useState as useState14 } from "react";
|
|
40170
40219
|
import { jsx as jsx32, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
40171
40220
|
function MatrxTableRowAlchemyProvider({ copy, placement, controls, children }) {
|
|
40172
|
-
const controller =
|
|
40221
|
+
const controller = useRef11(null);
|
|
40173
40222
|
const { CopyControls } = useMatrxDataTableHost();
|
|
40174
40223
|
const [active, setActive] = useState14(false);
|
|
40175
40224
|
const [fallback, setFallback] = useState14(false);
|
|
40176
|
-
|
|
40225
|
+
useEffect10(() => {
|
|
40177
40226
|
if (placement !== "menu" || active) return;
|
|
40178
40227
|
const timer = window.setTimeout(() => {
|
|
40179
40228
|
if (!active) {
|
|
@@ -40210,9 +40259,9 @@ function MatrxTableRowAlchemyProvider({ copy, placement, controls, children }) {
|
|
|
40210
40259
|
// src/data-table/ColumnHeaderCell.tsx
|
|
40211
40260
|
import {
|
|
40212
40261
|
forwardRef as forwardRef14,
|
|
40213
|
-
useEffect as
|
|
40262
|
+
useEffect as useEffect11,
|
|
40214
40263
|
useMemo as useMemo7,
|
|
40215
|
-
useRef as
|
|
40264
|
+
useRef as useRef12,
|
|
40216
40265
|
useState as useState15
|
|
40217
40266
|
} from "react";
|
|
40218
40267
|
import { useDraggable } from "@dnd-kit/core";
|
|
@@ -40599,15 +40648,15 @@ function ColumnHeaderCell({
|
|
|
40599
40648
|
const [filterOpen, setFilterOpen] = useState15(false);
|
|
40600
40649
|
const [pendingNegation, setPendingNegation] = useState15(false);
|
|
40601
40650
|
const [draftFilter, setDraftFilter] = useState15(filterValue);
|
|
40602
|
-
|
|
40651
|
+
useEffect11(() => {
|
|
40603
40652
|
if (!filterOpen) {
|
|
40604
40653
|
setDraftFilter(filterValue);
|
|
40605
40654
|
setPendingNegation(filterValue?.negated ?? false);
|
|
40606
40655
|
}
|
|
40607
40656
|
}, [filterOpen, filterValue]);
|
|
40608
|
-
const notifyOpen =
|
|
40657
|
+
const notifyOpen = useRef12(onFilterOpen);
|
|
40609
40658
|
notifyOpen.current = onFilterOpen;
|
|
40610
|
-
|
|
40659
|
+
useEffect11(() => {
|
|
40611
40660
|
if (filterOpen) notifyOpen.current?.();
|
|
40612
40661
|
}, [filterOpen]);
|
|
40613
40662
|
const applyFilter = () => {
|
|
@@ -41525,8 +41574,8 @@ function parseOptionalNumber(raw) {
|
|
|
41525
41574
|
// src/data-table/ColumnResizeHandle.tsx
|
|
41526
41575
|
import {
|
|
41527
41576
|
useCallback as useCallback6,
|
|
41528
|
-
useEffect as
|
|
41529
|
-
useRef as
|
|
41577
|
+
useEffect as useEffect12,
|
|
41578
|
+
useRef as useRef13,
|
|
41530
41579
|
useState as useState16
|
|
41531
41580
|
} from "react";
|
|
41532
41581
|
|
|
@@ -41570,11 +41619,11 @@ function ColumnResizeHandle({
|
|
|
41570
41619
|
onResizeCancel,
|
|
41571
41620
|
onResizeCommit
|
|
41572
41621
|
}) {
|
|
41573
|
-
const handleRef =
|
|
41574
|
-
const activeResizeRef =
|
|
41575
|
-
const previewRafRef =
|
|
41576
|
-
const queuedWidthRef =
|
|
41577
|
-
const keyboardWidthRef =
|
|
41622
|
+
const handleRef = useRef13(null);
|
|
41623
|
+
const activeResizeRef = useRef13(null);
|
|
41624
|
+
const previewRafRef = useRef13(null);
|
|
41625
|
+
const queuedWidthRef = useRef13(null);
|
|
41626
|
+
const keyboardWidthRef = useRef13(null);
|
|
41578
41627
|
const [announcedWidth, setAnnouncedWidth] = useState16(null);
|
|
41579
41628
|
const bounds = resolveColumnResizeBounds(minWidth, maxWidth);
|
|
41580
41629
|
const cssVar = columnResizeCssVar(columnId2);
|
|
@@ -41622,7 +41671,7 @@ function ColumnResizeHandle({
|
|
|
41622
41671
|
handleRef.current.releasePointerCapture(active.pointerId);
|
|
41623
41672
|
}
|
|
41624
41673
|
}, [clearQueuedPreview, columnId2, cssVar, onResizeCancel, onResizeCommit, tableRef, writePreview]);
|
|
41625
|
-
|
|
41674
|
+
useEffect12(() => () => clearQueuedPreview(), [clearQueuedPreview]);
|
|
41626
41675
|
const onPointerDown = (event) => {
|
|
41627
41676
|
if (disabled || event.button !== 0 || !event.isPrimary) return;
|
|
41628
41677
|
event.preventDefault();
|
|
@@ -42163,7 +42212,7 @@ function scrollOffsetForIndex(input) {
|
|
|
42163
42212
|
}
|
|
42164
42213
|
|
|
42165
42214
|
// src/data-table/useSpreadsheetGrid.ts
|
|
42166
|
-
import { useCallback as useCallback7, useEffect as
|
|
42215
|
+
import { useCallback as useCallback7, useEffect as useEffect13, useMemo as useMemo8, useRef as useRef14, useState as useState17 } from "react";
|
|
42167
42216
|
|
|
42168
42217
|
// src/data-table/grid-selection.ts
|
|
42169
42218
|
function rangeBounds(range, rowIds, fieldNames) {
|
|
@@ -42890,17 +42939,17 @@ function useSpreadsheetGrid(options) {
|
|
|
42890
42939
|
const [range, setRange] = useState17(null);
|
|
42891
42940
|
const [fillTarget, setFillTarget] = useState17(null);
|
|
42892
42941
|
const [stack, setStack] = useState17(() => createUndoStack(options?.undoDepth ?? 100));
|
|
42893
|
-
const draggingRef =
|
|
42894
|
-
const catcherRef =
|
|
42895
|
-
const composingRef =
|
|
42896
|
-
const optionsRef =
|
|
42942
|
+
const draggingRef = useRef14(null);
|
|
42943
|
+
const catcherRef = useRef14(null);
|
|
42944
|
+
const composingRef = useRef14(false);
|
|
42945
|
+
const optionsRef = useRef14(options);
|
|
42897
42946
|
optionsRef.current = options;
|
|
42898
42947
|
const rowIds = options?.rowIds ?? [];
|
|
42899
42948
|
const columnIds = useMemo8(
|
|
42900
42949
|
() => options ? options.columnIds.filter((id) => id !== "") : [],
|
|
42901
42950
|
[options]
|
|
42902
42951
|
);
|
|
42903
|
-
|
|
42952
|
+
useEffect13(() => {
|
|
42904
42953
|
if (!range) return;
|
|
42905
42954
|
const rowSet = new Set(rowIds);
|
|
42906
42955
|
const colSet = new Set(columnIds);
|
|
@@ -43066,11 +43115,11 @@ function useSpreadsheetGrid(options) {
|
|
|
43066
43115
|
},
|
|
43067
43116
|
[rowIds, columnIds]
|
|
43068
43117
|
);
|
|
43069
|
-
const rowIdsRef =
|
|
43118
|
+
const rowIdsRef = useRef14(rowIds);
|
|
43070
43119
|
rowIdsRef.current = rowIds;
|
|
43071
|
-
const columnIdsRef =
|
|
43120
|
+
const columnIdsRef = useRef14(columnIds);
|
|
43072
43121
|
columnIdsRef.current = columnIds;
|
|
43073
|
-
const rangeRef =
|
|
43122
|
+
const rangeRef = useRef14(range);
|
|
43074
43123
|
rangeRef.current = range;
|
|
43075
43124
|
const focusGrid = useCallback7(() => {
|
|
43076
43125
|
const catcher = catcherRef.current;
|
|
@@ -43423,11 +43472,11 @@ function useSpreadsheetGrid(options) {
|
|
|
43423
43472
|
},
|
|
43424
43473
|
[]
|
|
43425
43474
|
);
|
|
43426
|
-
const fillTargetRef =
|
|
43475
|
+
const fillTargetRef = useRef14(null);
|
|
43427
43476
|
fillTargetRef.current = fillTarget;
|
|
43428
|
-
const boundsRef =
|
|
43477
|
+
const boundsRef = useRef14(null);
|
|
43429
43478
|
boundsRef.current = bounds;
|
|
43430
|
-
|
|
43479
|
+
useEffect13(() => {
|
|
43431
43480
|
if (!options) return;
|
|
43432
43481
|
const commit = () => {
|
|
43433
43482
|
const wasDragging = draggingRef.current;
|
|
@@ -43986,7 +44035,7 @@ function rankTableSearchRows(rows, columns, query, options = {}, extraText) {
|
|
|
43986
44035
|
}
|
|
43987
44036
|
|
|
43988
44037
|
// src/data-table/ColumnManager.tsx
|
|
43989
|
-
import { useEffect as
|
|
44038
|
+
import { useEffect as useEffect14, useMemo as useMemo9, useState as useState19 } from "react";
|
|
43990
44039
|
import { useDndMonitor, useDraggable as useDraggable2, useDroppable } from "@dnd-kit/core";
|
|
43991
44040
|
import { jsx as jsx39, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
43992
44041
|
function ColumnManager({
|
|
@@ -44005,7 +44054,7 @@ function ColumnManager({
|
|
|
44005
44054
|
const [draftHidden, setDraftHidden] = useState19(() => new Set(hidden));
|
|
44006
44055
|
const [draggedColumnId, setDraggedColumnId] = useState19(null);
|
|
44007
44056
|
const [dropTarget, setDropTarget] = useState19(null);
|
|
44008
|
-
|
|
44057
|
+
useEffect14(() => {
|
|
44009
44058
|
if (!open) return;
|
|
44010
44059
|
setDraftOrder(order);
|
|
44011
44060
|
setDraftHidden(new Set(hidden));
|
|
@@ -44548,8 +44597,8 @@ function parseTableViewSnapshot(raw) {
|
|
|
44548
44597
|
|
|
44549
44598
|
// src/data-table/MatrxUuidCell.tsx
|
|
44550
44599
|
import {
|
|
44551
|
-
useEffect as
|
|
44552
|
-
useRef as
|
|
44600
|
+
useEffect as useEffect15,
|
|
44601
|
+
useRef as useRef15,
|
|
44553
44602
|
useState as useState20
|
|
44554
44603
|
} from "react";
|
|
44555
44604
|
import { jsx as jsx40, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
@@ -44594,8 +44643,8 @@ function MatrxUuidCell({
|
|
|
44594
44643
|
const [copied, setCopied] = useState20(false);
|
|
44595
44644
|
const [opening, setOpening] = useState20(false);
|
|
44596
44645
|
const [peekOpen, setPeekOpen] = useState20(false);
|
|
44597
|
-
const timer =
|
|
44598
|
-
|
|
44646
|
+
const timer = useRef15(null);
|
|
44647
|
+
useEffect15(
|
|
44599
44648
|
() => () => {
|
|
44600
44649
|
if (timer.current) clearTimeout(timer.current);
|
|
44601
44650
|
},
|
|
@@ -44890,7 +44939,7 @@ function DataRowInspector({
|
|
|
44890
44939
|
}
|
|
44891
44940
|
|
|
44892
44941
|
// src/data-table/DataRowWindow.tsx
|
|
44893
|
-
import { useEffect as
|
|
44942
|
+
import { useEffect as useEffect16, useState as useState21 } from "react";
|
|
44894
44943
|
import { jsx as jsx42, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
44895
44944
|
function DataRowWindow({
|
|
44896
44945
|
isOpen,
|
|
@@ -44912,7 +44961,7 @@ function DataRowWindow({
|
|
|
44912
44961
|
const hasTabs = hasEdit && children == null;
|
|
44913
44962
|
const initialTab = defaultTab ?? (hasEdit ? "edit" : "view");
|
|
44914
44963
|
const [tab, setTab] = useState21(initialTab);
|
|
44915
|
-
|
|
44964
|
+
useEffect16(() => {
|
|
44916
44965
|
if (!isOpen) return;
|
|
44917
44966
|
setTab(defaultTab ?? (hasEdit ? "edit" : "view"));
|
|
44918
44967
|
}, [isOpen, windowId, hasEdit, defaultTab]);
|
|
@@ -46126,7 +46175,7 @@ function DirtySavePill({
|
|
|
46126
46175
|
}
|
|
46127
46176
|
|
|
46128
46177
|
// src/data-table/EditableTableCell.tsx
|
|
46129
|
-
import { useEffect as
|
|
46178
|
+
import { useEffect as useEffect17, useRef as useRef16, useState as useState22 } from "react";
|
|
46130
46179
|
import { jsx as jsx45, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
46131
46180
|
function CellRefusal({ reason }) {
|
|
46132
46181
|
return /* @__PURE__ */ jsx45(
|
|
@@ -46190,10 +46239,10 @@ function EditableTableCell({
|
|
|
46190
46239
|
}) {
|
|
46191
46240
|
const [open, setOpen] = useState22(false);
|
|
46192
46241
|
const [refusal, setRefusal] = useState22(null);
|
|
46193
|
-
|
|
46242
|
+
useEffect17(() => {
|
|
46194
46243
|
if (editRequest !== void 0) setOpen(true);
|
|
46195
46244
|
}, [editRequest]);
|
|
46196
|
-
|
|
46245
|
+
useEffect17(() => {
|
|
46197
46246
|
if (!open) setRefusal(null);
|
|
46198
46247
|
}, [open]);
|
|
46199
46248
|
const usePencil = Boolean(href) || editTrigger === "pencil";
|
|
@@ -46300,10 +46349,10 @@ function InlineStringEditor({
|
|
|
46300
46349
|
const [editing, setEditing] = useState22(false);
|
|
46301
46350
|
const [draft, setDraft] = useState22(value);
|
|
46302
46351
|
const [refusal, setRefusal] = useState22(null);
|
|
46303
|
-
const handledEditRequest =
|
|
46304
|
-
const seedRef =
|
|
46352
|
+
const handledEditRequest = useRef16(void 0);
|
|
46353
|
+
const seedRef = useRef16(editSeed);
|
|
46305
46354
|
seedRef.current = editSeed;
|
|
46306
|
-
|
|
46355
|
+
useEffect17(() => {
|
|
46307
46356
|
if (editRequest === void 0 || handledEditRequest.current === editRequest) return;
|
|
46308
46357
|
handledEditRequest.current = editRequest;
|
|
46309
46358
|
setDraft(seedRef.current ?? value);
|
|
@@ -46464,7 +46513,7 @@ function DateEditor({
|
|
|
46464
46513
|
onCancel
|
|
46465
46514
|
}) {
|
|
46466
46515
|
const [draft, setDraft] = useState22(value);
|
|
46467
|
-
const done =
|
|
46516
|
+
const done = useRef16(false);
|
|
46468
46517
|
const finish = () => {
|
|
46469
46518
|
if (done.current) return;
|
|
46470
46519
|
done.current = true;
|
|
@@ -47339,7 +47388,7 @@ function MatrxDataTableWithUrlState({
|
|
|
47339
47388
|
...urlState.history === void 0 ? {} : { history: urlState.history },
|
|
47340
47389
|
...urlState.textHistory === void 0 ? {} : { textHistory: urlState.textHistory }
|
|
47341
47390
|
});
|
|
47342
|
-
|
|
47391
|
+
useEffect18(() => {
|
|
47343
47392
|
if (activeUrlTableIds.has(urlState.id)) {
|
|
47344
47393
|
throw new Error(
|
|
47345
47394
|
`Duplicate MatrxDataTable urlState.id "${urlState.id}" on one page. Give every table a unique stable id.`
|
|
@@ -47448,7 +47497,7 @@ var DND_MEASURING = { droppable: { strategy: MeasuringStrategy.Always } };
|
|
|
47448
47497
|
var NO_LAYERED_FILTERS = [];
|
|
47449
47498
|
var NO_GROUPING_VALUE = "__matrx_no_grouping__";
|
|
47450
47499
|
function useRenderEpoch(values) {
|
|
47451
|
-
const held =
|
|
47500
|
+
const held = useRef17(null);
|
|
47452
47501
|
const previous = held.current;
|
|
47453
47502
|
if (previous !== null && previous.values.length === values.length && previous.values.every((value, i) => Object.is(value, values[i]))) {
|
|
47454
47503
|
return previous.epoch;
|
|
@@ -47524,6 +47573,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
47524
47573
|
tableId,
|
|
47525
47574
|
defaultViewSnapshot,
|
|
47526
47575
|
viewTabs = true,
|
|
47576
|
+
viewTabsStore,
|
|
47527
47577
|
relatedTableActions,
|
|
47528
47578
|
columnState,
|
|
47529
47579
|
reorderableColumns = true,
|
|
@@ -47587,7 +47637,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
47587
47637
|
} = coreProps;
|
|
47588
47638
|
const appendQuery = query?.mode === "controlled-append" ? query : null;
|
|
47589
47639
|
const appendQueryKey = appendQuery?.pagination.queryKey ?? null;
|
|
47590
|
-
const committedAppendQueryKey =
|
|
47640
|
+
const committedAppendQueryKey = useRef17(appendQueryKey);
|
|
47591
47641
|
const appendSourceChanged = appendQuery !== null && committedAppendQueryKey.current !== appendQueryKey;
|
|
47592
47642
|
const data = (appendQuery ? appendQuery.pagination.rows : suppliedData) ?? [];
|
|
47593
47643
|
const readView = tableReadView(read, data.length, appendQuery ? appendQuery.pagination.loading : suppliedLoading);
|
|
@@ -47606,7 +47656,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
47606
47656
|
const [savedViewError, setSavedViewError] = useState24(null);
|
|
47607
47657
|
const [toolbarActionError, setToolbarActionError] = useState24(null);
|
|
47608
47658
|
const [toolbarActionPending, setToolbarActionPending] = useState24({ refresh: false, add: false });
|
|
47609
|
-
const toolbarActionPendingRef =
|
|
47659
|
+
const toolbarActionPendingRef = useRef17({ refresh: false, add: false });
|
|
47610
47660
|
const CHECKBOX_TAP_AREA = "h-4 w-4 touch-manipulation";
|
|
47611
47661
|
const mobileCardsClass = mobileCardsBreakpoint === "lg" ? "lg:hidden" : "sm:hidden";
|
|
47612
47662
|
const tableWithCardsClass = mobileCardsBreakpoint === "lg" ? "max-lg:hidden" : "max-sm:hidden";
|
|
@@ -47754,9 +47804,9 @@ function MatrxDataTableCore(coreProps) {
|
|
|
47754
47804
|
const [windowRowSnapshot, setWindowRowSnapshot] = useState24(null);
|
|
47755
47805
|
const editScopeKey = appendQueryKey === null ? "\0local" : `append:${appendQueryKey}`;
|
|
47756
47806
|
const [editsByScope, setEditsByScope] = useState24({});
|
|
47757
|
-
const editRevisionRef =
|
|
47807
|
+
const editRevisionRef = useRef17({});
|
|
47758
47808
|
const [savingByScope, setSavingByScope] = useState24({});
|
|
47759
|
-
const savingScopesRef =
|
|
47809
|
+
const savingScopesRef = useRef17(/* @__PURE__ */ new Set());
|
|
47760
47810
|
const [editRequest, setEditRequest] = useState24(null);
|
|
47761
47811
|
const [confirmForeignDraftDiscard, setConfirmForeignDraftDiscard] = useState24(false);
|
|
47762
47812
|
const edits = editsByScope[editScopeKey]?.values ?? {};
|
|
@@ -47825,7 +47875,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
47825
47875
|
rows: Object.entries(draft.values).map(([rowId, columns2]) => ({ rowId, columns: columns2 }))
|
|
47826
47876
|
}));
|
|
47827
47877
|
const selection = appendSourceChanged && selectionConfig ? { ...selectionConfig, selectedIds: [] } : selectionConfig;
|
|
47828
|
-
|
|
47878
|
+
useEffect18(() => {
|
|
47829
47879
|
const previous = committedAppendQueryKey.current;
|
|
47830
47880
|
committedAppendQueryKey.current = appendQueryKey;
|
|
47831
47881
|
if (previous === null || appendQueryKey === null || previous === appendQueryKey) {
|
|
@@ -47843,13 +47893,13 @@ function MatrxDataTableCore(coreProps) {
|
|
|
47843
47893
|
onWindowRowIdChange,
|
|
47844
47894
|
selectionConfig
|
|
47845
47895
|
]);
|
|
47846
|
-
const scrollRef =
|
|
47847
|
-
const tableRef =
|
|
47848
|
-
const tableHeaderRef =
|
|
47849
|
-
const cardsScrollRef =
|
|
47896
|
+
const scrollRef = useRef17(null);
|
|
47897
|
+
const tableRef = useRef17(null);
|
|
47898
|
+
const tableHeaderRef = useRef17(null);
|
|
47899
|
+
const cardsScrollRef = useRef17(null);
|
|
47850
47900
|
const [documentStickyHeader, setDocumentStickyHeader] = useState24(false);
|
|
47851
|
-
const documentStickyHeaderRef =
|
|
47852
|
-
const previousAppendKeyForScrollReset =
|
|
47901
|
+
const documentStickyHeaderRef = useRef17(false);
|
|
47902
|
+
const previousAppendKeyForScrollReset = useRef17(appendQueryKey);
|
|
47853
47903
|
useLayoutEffect3(() => {
|
|
47854
47904
|
const previous = previousAppendKeyForScrollReset.current;
|
|
47855
47905
|
previousAppendKeyForScrollReset.current = appendQueryKey;
|
|
@@ -47875,7 +47925,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
47875
47925
|
...appendScrollPolicy?.mode === "scroll" && appendScrollPolicy.thresholdPx !== void 0 ? { thresholdPx: appendScrollPolicy.thresholdPx } : {},
|
|
47876
47926
|
...appendScrollPolicy?.mode === "scroll" && appendScrollPolicy.intentTimeoutMs !== void 0 ? { intentTimeoutMs: appendScrollPolicy.intentTimeoutMs } : {}
|
|
47877
47927
|
});
|
|
47878
|
-
const rootRef =
|
|
47928
|
+
const rootRef = useRef17(null);
|
|
47879
47929
|
useClippedContentGuard(rootRef, {
|
|
47880
47930
|
label: typeof copy === "object" && copy.listLabel ? `Table: ${copy.listLabel}` : "MatrxDataTable"
|
|
47881
47931
|
});
|
|
@@ -47895,7 +47945,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
47895
47945
|
behavior: "smooth"
|
|
47896
47946
|
});
|
|
47897
47947
|
};
|
|
47898
|
-
|
|
47948
|
+
useEffect18(() => {
|
|
47899
47949
|
updateScrollHint();
|
|
47900
47950
|
window.addEventListener("resize", updateScrollHint);
|
|
47901
47951
|
const el = scrollRef.current;
|
|
@@ -47977,18 +48027,18 @@ function MatrxDataTableCore(coreProps) {
|
|
|
47977
48027
|
() => normalizeColumnWidthsForColumns(columnState?.widths, columns)
|
|
47978
48028
|
);
|
|
47979
48029
|
const [fixedTableGeometry, setFixedTableGeometry] = useState24(null);
|
|
47980
|
-
const knownColumnIds =
|
|
47981
|
-
const draggedColumnId =
|
|
47982
|
-
const columnDragActive =
|
|
47983
|
-
const columnDragRaf =
|
|
47984
|
-
const columnDragScrollDirection =
|
|
48030
|
+
const knownColumnIds = useRef17(new Set(columns.map(columnId)));
|
|
48031
|
+
const draggedColumnId = useRef17(null);
|
|
48032
|
+
const columnDragActive = useRef17(false);
|
|
48033
|
+
const columnDragRaf = useRef17(null);
|
|
48034
|
+
const columnDragScrollDirection = useRef17(0);
|
|
47985
48035
|
const [columnDragPreview, setColumnDragPreview] = useState24(null);
|
|
47986
48036
|
const stopColumnDragScroll = useCallback8(() => {
|
|
47987
48037
|
if (columnDragRaf.current !== null) cancelAnimationFrame(columnDragRaf.current);
|
|
47988
48038
|
columnDragRaf.current = null;
|
|
47989
48039
|
columnDragScrollDirection.current = 0;
|
|
47990
48040
|
}, []);
|
|
47991
|
-
|
|
48041
|
+
useEffect18(() => () => {
|
|
47992
48042
|
columnDragActive.current = false;
|
|
47993
48043
|
stopColumnDragScroll();
|
|
47994
48044
|
}, [stopColumnDragScroll]);
|
|
@@ -48036,7 +48086,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
48036
48086
|
() => normalizeColumnWidthsForColumns(columnState?.widths ?? columnWidths, columns),
|
|
48037
48087
|
[columns, columnState?.widths, columnWidths]
|
|
48038
48088
|
);
|
|
48039
|
-
const resizeGestureSnapshotRef =
|
|
48089
|
+
const resizeGestureSnapshotRef = useRef17(null);
|
|
48040
48090
|
const measureVisibleColumnWidths = useCallback8(() => {
|
|
48041
48091
|
const measured = {};
|
|
48042
48092
|
const headers = tableRef.current ? Array.from(tableRef.current.querySelectorAll(
|
|
@@ -48114,7 +48164,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
48114
48164
|
}
|
|
48115
48165
|
setColumnWidths(normalized);
|
|
48116
48166
|
}, [columnIds, columnState, columns, measureFixedTableGeometry, measureVisibleColumnWidths]);
|
|
48117
|
-
|
|
48167
|
+
useEffect18(() => {
|
|
48118
48168
|
const ids = columns.map(columnId);
|
|
48119
48169
|
if (columnState) return;
|
|
48120
48170
|
const previousIds = knownColumnIds.current;
|
|
@@ -48248,7 +48298,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
48248
48298
|
const effectiveCopy = copy === false ? void 0 : copy ?? defaultCopy;
|
|
48249
48299
|
const effectiveCopyColumns = copy === void 0 ? declaredVisibleCopyColumns : visibleColumns;
|
|
48250
48300
|
const copySubsetVariant2 = useCopySubsetVariant();
|
|
48251
|
-
const chromeLatest =
|
|
48301
|
+
const chromeLatest = useRef17({
|
|
48252
48302
|
processed: [],
|
|
48253
48303
|
data: [],
|
|
48254
48304
|
toggleAllOnPage: () => void 0,
|
|
@@ -48353,8 +48403,8 @@ function MatrxDataTableCore(coreProps) {
|
|
|
48353
48403
|
intelligentSearchEnabled,
|
|
48354
48404
|
searchScope
|
|
48355
48405
|
]);
|
|
48356
|
-
const lastNotifiedViewRows =
|
|
48357
|
-
|
|
48406
|
+
const lastNotifiedViewRows = useRef17(null);
|
|
48407
|
+
useEffect18(() => {
|
|
48358
48408
|
if (!onViewChange) {
|
|
48359
48409
|
lastNotifiedViewRows.current = null;
|
|
48360
48410
|
return;
|
|
@@ -48363,7 +48413,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
48363
48413
|
lastNotifiedViewRows.current = processed;
|
|
48364
48414
|
if (changed) onViewChange(processed);
|
|
48365
48415
|
}, [processed, onViewChange]);
|
|
48366
|
-
|
|
48416
|
+
useEffect18(() => {
|
|
48367
48417
|
if (controlledQuery) return;
|
|
48368
48418
|
setInternalPage(1);
|
|
48369
48419
|
}, [
|
|
@@ -48473,7 +48523,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
48473
48523
|
const columnVirtualizeActive = virtualizeConfig !== null && virtualizeConfig.enabled !== false && virtualizeConfig.columns === true && visibleColumns.length - frozenRunLength > 30 && !hierarchy && mobileCards === void 0;
|
|
48474
48524
|
const [rowWindow, setRowWindow] = useState24(null);
|
|
48475
48525
|
const [columnWindow, setColumnWindow] = useState24(null);
|
|
48476
|
-
const windowInputs =
|
|
48526
|
+
const windowInputs = useRef17({
|
|
48477
48527
|
virtualizeActive: false,
|
|
48478
48528
|
bodyEntryCount: 0,
|
|
48479
48529
|
virtualRowHeight: 40,
|
|
@@ -48545,7 +48595,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
48545
48595
|
frozenRunLength
|
|
48546
48596
|
]);
|
|
48547
48597
|
const metricsWanted = virtualizeActive || columnVirtualizeActive;
|
|
48548
|
-
|
|
48598
|
+
useEffect18(() => {
|
|
48549
48599
|
recomputeWindows();
|
|
48550
48600
|
}, [
|
|
48551
48601
|
recomputeWindows,
|
|
@@ -48557,7 +48607,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
48557
48607
|
columnWindowWidth,
|
|
48558
48608
|
frozenRunLength
|
|
48559
48609
|
]);
|
|
48560
|
-
|
|
48610
|
+
useEffect18(() => {
|
|
48561
48611
|
if (!metricsWanted) return;
|
|
48562
48612
|
const el = scrollRef.current;
|
|
48563
48613
|
if (!el) return;
|
|
@@ -48623,7 +48673,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
48623
48673
|
windowed.push({ kind: "spacer", height: effectiveRowWindow.padEnd, place: "end" });
|
|
48624
48674
|
return windowed;
|
|
48625
48675
|
}, [groupedRenderRows, collapsedGroups, paginated, effectiveRowWindow]);
|
|
48626
|
-
const getRowIdRef =
|
|
48676
|
+
const getRowIdRef = useRef17(getRowId);
|
|
48627
48677
|
getRowIdRef.current = getRowId;
|
|
48628
48678
|
const spreadsheetRowIds = useMemo10(
|
|
48629
48679
|
() => paginated.map((row) => getRowIdRef.current(row)),
|
|
@@ -48644,7 +48694,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
48644
48694
|
return map;
|
|
48645
48695
|
}, [visibleColumns]);
|
|
48646
48696
|
const spreadsheetEnabled = Boolean(spreadsheet && spreadsheet.enabled !== false);
|
|
48647
|
-
const openRowRef =
|
|
48697
|
+
const openRowRef = useRef17(() => void 0);
|
|
48648
48698
|
const sheet = useSpreadsheetGrid(
|
|
48649
48699
|
spreadsheetEnabled && spreadsheet ? {
|
|
48650
48700
|
rowIds: spreadsheetRowIds,
|
|
@@ -48685,12 +48735,12 @@ function MatrxDataTableCore(coreProps) {
|
|
|
48685
48735
|
} : null
|
|
48686
48736
|
);
|
|
48687
48737
|
if (spreadsheet?.controllerRef) spreadsheet.controllerRef.current = spreadsheetEnabled ? sheet.controller : null;
|
|
48688
|
-
const sheetRef =
|
|
48738
|
+
const sheetRef = useRef17(sheet);
|
|
48689
48739
|
sheetRef.current = sheet;
|
|
48690
|
-
const onSheetSelectionRef =
|
|
48740
|
+
const onSheetSelectionRef = useRef17(spreadsheet?.onSelectionChange);
|
|
48691
48741
|
onSheetSelectionRef.current = spreadsheet?.onSelectionChange;
|
|
48692
48742
|
const sheetSelectionKey = sheet.range ? `${sheet.range.anchor.rowId}\0${sheet.range.anchor.fieldName}\0${sheet.range.focus.rowId}\0${sheet.range.focus.fieldName}\0${sheet.bounds ? `${sheet.bounds.r0}:${sheet.bounds.r1}:${sheet.bounds.c0}:${sheet.bounds.c1}` : ""}` : "";
|
|
48693
|
-
|
|
48743
|
+
useEffect18(() => {
|
|
48694
48744
|
const tell = onSheetSelectionRef.current;
|
|
48695
48745
|
if (!tell) return;
|
|
48696
48746
|
const current = sheetRef.current;
|
|
@@ -48707,7 +48757,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
48707
48757
|
tsv: current.selectionTsv()
|
|
48708
48758
|
});
|
|
48709
48759
|
}, [sheetSelectionKey]);
|
|
48710
|
-
const searchValueRef =
|
|
48760
|
+
const searchValueRef = useRef17(searchValue);
|
|
48711
48761
|
searchValueRef.current = searchValue;
|
|
48712
48762
|
const facetsEnabled = Boolean(facets && facets.enabled !== false);
|
|
48713
48763
|
const [facetState, setFacetState] = useState24({});
|
|
@@ -48719,9 +48769,9 @@ function MatrxDataTableCore(coreProps) {
|
|
|
48719
48769
|
},
|
|
48720
48770
|
[facets, visibleColumns]
|
|
48721
48771
|
);
|
|
48722
|
-
const facetInputsRef =
|
|
48772
|
+
const facetInputsRef = useRef17({ data, facets, facetReadCell });
|
|
48723
48773
|
facetInputsRef.current = { data, facets, facetReadCell };
|
|
48724
|
-
const facetRequestRef =
|
|
48774
|
+
const facetRequestRef = useRef17(/* @__PURE__ */ new Map());
|
|
48725
48775
|
const requestFacets = useCallback8((colId) => {
|
|
48726
48776
|
const { data: rows, facets: config, facetReadCell: readCell } = facetInputsRef.current;
|
|
48727
48777
|
if (!config || config.enabled === false) return;
|
|
@@ -48781,12 +48831,12 @@ function MatrxDataTableCore(coreProps) {
|
|
|
48781
48831
|
}));
|
|
48782
48832
|
});
|
|
48783
48833
|
}, []);
|
|
48784
|
-
|
|
48834
|
+
useEffect18(() => {
|
|
48785
48835
|
if (!facetsEnabled) return;
|
|
48786
48836
|
setFacetState({});
|
|
48787
48837
|
facetRequestRef.current = /* @__PURE__ */ new Map();
|
|
48788
48838
|
}, [facetsEnabled, data, searchValue]);
|
|
48789
|
-
|
|
48839
|
+
useEffect18(() => {
|
|
48790
48840
|
if (!controlledQuery || controlledQuery.state.page === safePage) return;
|
|
48791
48841
|
emitControlledQueryChange({ page: safePage });
|
|
48792
48842
|
}, [controlledQuery, emitControlledQueryChange, safePage]);
|
|
@@ -49042,7 +49092,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
49042
49092
|
}));
|
|
49043
49093
|
return true;
|
|
49044
49094
|
};
|
|
49045
|
-
const requestCellEditRef =
|
|
49095
|
+
const requestCellEditRef = useRef17(requestCellEdit);
|
|
49046
49096
|
requestCellEditRef.current = requestCellEdit;
|
|
49047
49097
|
const buildRecordControls = (row) => {
|
|
49048
49098
|
const rowId = getRowId(row);
|
|
@@ -49388,16 +49438,16 @@ function MatrxDataTableCore(coreProps) {
|
|
|
49388
49438
|
return [];
|
|
49389
49439
|
}
|
|
49390
49440
|
};
|
|
49391
|
-
const menuSectionsForRef =
|
|
49441
|
+
const menuSectionsForRef = useRef17(menuSectionsFor);
|
|
49392
49442
|
menuSectionsForRef.current = menuSectionsFor;
|
|
49393
49443
|
const hasMenuSections = Boolean(contextMenu?.sections);
|
|
49394
49444
|
const boundarySections = useCallback8(
|
|
49395
49445
|
(target) => menuSectionsForRef.current(target),
|
|
49396
49446
|
[]
|
|
49397
49447
|
);
|
|
49398
|
-
const resolveMenuLevelRef =
|
|
49448
|
+
const resolveMenuLevelRef = useRef17(resolveMenuLevel);
|
|
49399
49449
|
resolveMenuLevelRef.current = resolveMenuLevel;
|
|
49400
|
-
|
|
49450
|
+
useEffect18(() => {
|
|
49401
49451
|
if (!host.rowContextRegistry) return;
|
|
49402
49452
|
return host.rowContextRegistry.register(
|
|
49403
49453
|
tableContextMenuInstanceId,
|
|
@@ -49427,7 +49477,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
49427
49477
|
return true;
|
|
49428
49478
|
});
|
|
49429
49479
|
}, [data, getSelectionId, selectedIdSet]);
|
|
49430
|
-
const lastToggledIndex =
|
|
49480
|
+
const lastToggledIndex = useRef17(null);
|
|
49431
49481
|
const setSelectedIds = (next) => selection?.onSelectedIdsChange([...next]);
|
|
49432
49482
|
const toggleRowSelected = (index, shiftKey) => {
|
|
49433
49483
|
if (!selection) return;
|
|
@@ -49468,7 +49518,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
49468
49518
|
}
|
|
49469
49519
|
} : facet
|
|
49470
49520
|
) : toolbar?.facets;
|
|
49471
|
-
const rowLatest =
|
|
49521
|
+
const rowLatest = useRef17(null);
|
|
49472
49522
|
const renderRecordCell = (row, col, index) => {
|
|
49473
49523
|
const id = getRowId(row);
|
|
49474
49524
|
const field = col.accessorKey ? String(col.accessorKey) : columnId(col);
|
|
@@ -50074,7 +50124,16 @@ function MatrxDataTableCore(coreProps) {
|
|
|
50074
50124
|
"td",
|
|
50075
50125
|
{
|
|
50076
50126
|
"data-matrx-table-row-action-cell": true,
|
|
50077
|
-
className:
|
|
50127
|
+
className: cn(
|
|
50128
|
+
"text-right align-middle",
|
|
50129
|
+
// PINNED RIGHT from sm: up (page-pass 2026-09-27): a table wider than its
|
|
50130
|
+
// container scrolled the row's own actions off the right edge at 1280px.
|
|
50131
|
+
// The row's opaque frozen background keeps scrolled cells from showing
|
|
50132
|
+
// through; the hairline says the column floats.
|
|
50133
|
+
"sm:sticky sm:right-0 sm:z-20 sm:shadow-[inset_1px_0_0_var(--color-border)]",
|
|
50134
|
+
frozenRowBackgroundClass,
|
|
50135
|
+
canHoverFrozenCell && "sm:group-hover/matrx-row:bg-[color-mix(in_oklab,var(--color-muted)_50%,var(--color-card))]"
|
|
50136
|
+
),
|
|
50078
50137
|
style: fixedUtilityWidth(fixedTableGeometry?.actionsWidth),
|
|
50079
50138
|
children: /* @__PURE__ */ jsxs37(
|
|
50080
50139
|
"div",
|
|
@@ -50270,7 +50329,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
50270
50329
|
TableTitleRow,
|
|
50271
50330
|
{
|
|
50272
50331
|
...toolbar?.singleRow ? { singleRow: true } : {},
|
|
50273
|
-
tabs: viewTabs ? /* @__PURE__ */ jsx48(TableViewWorkspace, { snapshot: currentViewSnapshot, onApply: applyLatestSavedView, related: relatedTableActions }, tableId ?? "table") : void 0,
|
|
50332
|
+
tabs: viewTabs ? /* @__PURE__ */ jsx48(TableViewWorkspace, { snapshot: currentViewSnapshot, onApply: applyLatestSavedView, related: relatedTableActions, ...viewTabsStore ? { store: viewTabsStore } : {} }, tableId ?? "table") : void 0,
|
|
50274
50333
|
...toolbar?.title === void 0 ? {} : { title: toolbar.title },
|
|
50275
50334
|
...toolbar?.titleCount === void 0 ? {} : { count: toolbar.titleCount },
|
|
50276
50335
|
context: tableId && SavedViews ? /* @__PURE__ */ jsx48("span", { "data-matrx-table-view-control": true, children: /* @__PURE__ */ jsx48(
|
|
@@ -50430,17 +50489,16 @@ function MatrxDataTableCore(coreProps) {
|
|
|
50430
50489
|
/* @__PURE__ */ jsx48(TooltipContent, { className: "max-w-xs", children: coverageResult.notice })
|
|
50431
50490
|
] }) : null,
|
|
50432
50491
|
renderToolbarControls(/* @__PURE__ */ jsxs37(Fragment10, { children: [
|
|
50433
|
-
/* @__PURE__ */ jsx48(
|
|
50492
|
+
hasActiveFilters ? /* @__PURE__ */ jsx48(
|
|
50434
50493
|
TableToolbarAction,
|
|
50435
50494
|
{
|
|
50436
50495
|
HostAction: host.ToolbarAction,
|
|
50437
50496
|
ariaLabel: "Clear all filters",
|
|
50438
|
-
tooltip:
|
|
50439
|
-
disabled: !hasActiveFilters,
|
|
50497
|
+
tooltip: "Clear search and filters; keep columns and sort",
|
|
50440
50498
|
onClick: clearAllFilters,
|
|
50441
50499
|
children: /* @__PURE__ */ jsx48(Eraser, {})
|
|
50442
50500
|
}
|
|
50443
|
-
),
|
|
50501
|
+
) : null,
|
|
50444
50502
|
showToolbarCopy && effectiveCopy ? /* @__PURE__ */ jsx48(ToolbarListedLabel, { label: "Copy or export", children: /* @__PURE__ */ jsx48(
|
|
50445
50503
|
CopyButtons,
|
|
50446
50504
|
{
|
|
@@ -50515,7 +50573,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
50515
50573
|
]
|
|
50516
50574
|
}
|
|
50517
50575
|
) : null,
|
|
50518
|
-
columns.length > 0 ? /* @__PURE__ */ jsx48(
|
|
50576
|
+
columns.length > 0 && toolbar?.columns !== false ? /* @__PURE__ */ jsx48(
|
|
50519
50577
|
TableToolbarAction,
|
|
50520
50578
|
{
|
|
50521
50579
|
HostAction: host.ToolbarAction,
|
|
@@ -50607,7 +50665,9 @@ function MatrxDataTableCore(coreProps) {
|
|
|
50607
50665
|
"aria-busy": isLoading || isFetching,
|
|
50608
50666
|
...appendQuery === null ? {} : { style: { containerType: "inline-size" } },
|
|
50609
50667
|
className: cn(
|
|
50610
|
-
|
|
50668
|
+
// No frame around the cards: each card carries its own border, and a bordered
|
|
50669
|
+
// panel of bordered cards is box-in-box (page-pass 2026-09-27).
|
|
50670
|
+
"relative flex h-full min-h-0 flex-col gap-2 overflow-y-auto",
|
|
50611
50671
|
mobileCardsClass
|
|
50612
50672
|
),
|
|
50613
50673
|
children: [
|
|
@@ -50962,7 +51022,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
50962
51022
|
"th",
|
|
50963
51023
|
{
|
|
50964
51024
|
"data-matrx-table-actions-column": true,
|
|
50965
|
-
className: "h-9 w-px whitespace-nowrap px-2 text-right align-middle text-xs font-semibold uppercase tracking-wide text-muted-foreground",
|
|
51025
|
+
className: "h-9 w-px whitespace-nowrap px-2 text-right align-middle text-xs font-semibold uppercase tracking-wide text-muted-foreground sm:sticky sm:right-0 sm:z-30 sm:bg-muted sm:shadow-[inset_1px_0_0_var(--color-border)]",
|
|
50966
51026
|
style: fixedUtilityWidth(fixedTableGeometry?.actionsWidth),
|
|
50967
51027
|
children: /* @__PURE__ */ jsx48("span", { "data-matrx-table-actions-label": true, className: "inline-block whitespace-nowrap", children: "Actions" })
|
|
50968
51028
|
}
|