@ai-matrx/design-system 0.18.9 → 0.18.10
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 +11 -0
- package/dist/content-transfer.cjs +163 -202
- package/dist/content-transfer.cjs.map +1 -1
- package/dist/content-transfer.css +43 -30
- package/dist/content-transfer.d.cts +4 -0
- package/dist/content-transfer.d.ts +4 -0
- package/dist/content-transfer.js +225 -264
- package/dist/content-transfer.js.map +1 -1
- package/dist/data-table/copy-helpers.d.cts +1 -1
- package/dist/data-table/copy-helpers.d.ts +1 -1
- package/dist/data-table/data-row-inspector.cjs +163 -202
- package/dist/data-table/data-row-inspector.cjs.map +1 -1
- package/dist/data-table/data-row-inspector.js +245 -284
- package/dist/data-table/data-row-inspector.js.map +1 -1
- package/dist/data-table/data-row-window.cjs +163 -202
- package/dist/data-table/data-row-window.cjs.map +1 -1
- package/dist/data-table/data-row-window.js +245 -284
- package/dist/data-table/data-row-window.js.map +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.cjs.map +1 -1
- package/dist/data-table/host.d.cts +2 -0
- package/dist/data-table/host.d.ts +2 -0
- package/dist/data-table/host.js.map +1 -1
- package/dist/data-table/index.cjs +1192 -732
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.d.cts +24 -3
- package/dist/data-table/index.d.ts +24 -3
- package/dist/data-table/index.js +1264 -804
- 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 +5 -5
- package/dist/data-table/pagination.cjs.map +1 -1
- package/dist/data-table/pagination.js +5 -5
- 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/uuid-cell.cjs.map +1 -1
- package/dist/data-table/uuid-cell.js.map +1 -1
- package/dist/data-table/xlsx.d.cts +1 -1
- package/dist/data-table/xlsx.d.ts +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/styles.css +4 -0
- package/dist/tokens.css +2 -0
- package/dist/{types-cH8oLqUx.d.ts → types-C2xN6W_q.d.ts} +46 -3
- package/dist/{types-0CNCWvdK.d.cts → types-D_tpuk6m.d.cts} +46 -3
- package/package.json +1 -1
|
@@ -37,6 +37,7 @@ __export(data_table_exports, {
|
|
|
37
37
|
MatrxDataTable: () => MatrxDataTable,
|
|
38
38
|
MatrxDataTableProvider: () => MatrxDataTableProvider,
|
|
39
39
|
MatrxUuidCell: () => MatrxUuidCell,
|
|
40
|
+
SavedViewsControl: () => SavedViewsControl,
|
|
40
41
|
TableTitleRow: () => TableTitleRow,
|
|
41
42
|
buildRowAgentInput: () => buildRowAgentInput,
|
|
42
43
|
buildViewAgentInput: () => buildViewAgentInput,
|
|
@@ -44,6 +45,7 @@ __export(data_table_exports, {
|
|
|
44
45
|
collectSelectOptions: () => collectSelectOptions,
|
|
45
46
|
downloadTableAsXlsx: () => downloadTableAsXlsx,
|
|
46
47
|
filterKindLabel: () => filterKindLabel,
|
|
48
|
+
parseTableViewSnapshot: () => parseTableViewSnapshot,
|
|
47
49
|
resolveFilterKind: () => resolveFilterKind,
|
|
48
50
|
rowsToCsvFromColumns: () => rowsToCsvFromColumns,
|
|
49
51
|
rowsToMarkdownTable: () => rowsToMarkdownTable,
|
|
@@ -797,7 +799,7 @@ var SelectContent = React6.forwardRef(
|
|
|
797
799
|
{
|
|
798
800
|
ref,
|
|
799
801
|
className: cn(
|
|
800
|
-
"relative z-[10001] max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",
|
|
802
|
+
"relative z-[10001] max-h-96 min-w-[8rem] max-w-[calc(100vw-2rem)] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",
|
|
801
803
|
animated && MOTION_POPPER,
|
|
802
804
|
// The resting gap from the trigger. It is the `translate` property
|
|
803
805
|
// (POPPER_OFFSET), never Tailwind translate utilities: those compose
|
|
@@ -815,7 +817,7 @@ var SelectContent = React6.forwardRef(
|
|
|
815
817
|
SelectPrimitive.Viewport,
|
|
816
818
|
{
|
|
817
819
|
className: cn(
|
|
818
|
-
"
|
|
820
|
+
"max-w-full overflow-y-auto p-0.5",
|
|
819
821
|
position === "popper" && "w-full min-w-[var(--radix-select-trigger-width)] max-h-[var(--radix-select-content-available-height)]"
|
|
820
822
|
),
|
|
821
823
|
children
|
|
@@ -842,15 +844,15 @@ var SelectItem = React6.forwardRef(({ className, children, description, ...props
|
|
|
842
844
|
{
|
|
843
845
|
ref,
|
|
844
846
|
className: cn(
|
|
845
|
-
"relative flex w-full cursor-default select-none rounded-sm py-1 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
847
|
+
"relative flex w-full min-w-0 cursor-default select-none rounded-sm py-1 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
846
848
|
description ? "flex-col items-start gap-0.5 py-1.5" : "items-center",
|
|
847
849
|
className
|
|
848
850
|
),
|
|
849
851
|
...props,
|
|
850
852
|
children: [
|
|
851
853
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CheckIcon, { className: "h-4 w-4" }) }) }),
|
|
852
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SelectPrimitive.ItemText, { children }),
|
|
853
|
-
description ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "block text-xs leading-snug text-muted-foreground", children: description }) : null
|
|
854
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "min-w-0 whitespace-normal break-words [overflow-wrap:anywhere]", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SelectPrimitive.ItemText, { children }) }),
|
|
855
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "block min-w-0 break-words text-xs leading-snug text-muted-foreground [overflow-wrap:anywhere]", children: description }) : null
|
|
854
856
|
]
|
|
855
857
|
}
|
|
856
858
|
));
|
|
@@ -900,7 +902,7 @@ function TableTitleRow({
|
|
|
900
902
|
{
|
|
901
903
|
"data-matrx-table-toolbar": true,
|
|
902
904
|
className: cn(
|
|
903
|
-
"flex min-w-0 shrink-0 flex-wrap items-center gap-2",
|
|
905
|
+
"flex min-w-0 shrink-0 flex-wrap items-center gap-2 border-t border-border pt-2",
|
|
904
906
|
className
|
|
905
907
|
),
|
|
906
908
|
children: [
|
|
@@ -1907,132 +1909,45 @@ var import_content_transfer2 = require("@ai-matrx/kit/content-transfer");
|
|
|
1907
1909
|
var React13 = __toESM(require("react"), 1);
|
|
1908
1910
|
var import_content_transfer = require("@ai-matrx/kit/content-transfer");
|
|
1909
1911
|
|
|
1910
|
-
// src/
|
|
1911
|
-
var
|
|
1912
|
+
// src/popover.tsx
|
|
1913
|
+
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"), 1);
|
|
1912
1914
|
var React12 = __toESM(require("react"), 1);
|
|
1913
1915
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1914
|
-
var
|
|
1915
|
-
var
|
|
1916
|
-
var
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
"data-slot": "dropdown-menu-sub-trigger",
|
|
1924
|
-
className: cn(
|
|
1925
|
-
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
|
|
1926
|
-
inset && "pl-8",
|
|
1927
|
-
className
|
|
1928
|
-
),
|
|
1929
|
-
...props,
|
|
1930
|
-
children: [
|
|
1931
|
-
children,
|
|
1932
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(RadixChevronRightIcon, { className: "ml-auto h-4 w-4" })
|
|
1933
|
-
]
|
|
1934
|
-
}
|
|
1935
|
-
));
|
|
1936
|
-
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
1937
|
-
var DropdownMenuSubContent = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1938
|
-
DropdownMenuPrimitive.SubContent,
|
|
1939
|
-
{
|
|
1940
|
-
ref,
|
|
1941
|
-
"data-slot": "dropdown-menu-sub-content",
|
|
1942
|
-
className: cn(MENU_SURFACE_CLASS, "shadow-lg", MOTION_POPPER, className),
|
|
1943
|
-
...props
|
|
1944
|
-
}
|
|
1945
|
-
));
|
|
1946
|
-
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
1947
|
-
var DropdownMenuContent = React12.forwardRef(({ className, sideOffset = 4, container, ...props }, ref) => {
|
|
1948
|
-
const portalContainer = usePortalContainer(container);
|
|
1949
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DropdownMenuPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1950
|
-
DropdownMenuPrimitive.Content,
|
|
1951
|
-
{
|
|
1952
|
-
ref,
|
|
1953
|
-
"data-slot": "dropdown-menu-content",
|
|
1954
|
-
sideOffset,
|
|
1955
|
-
className: cn(
|
|
1956
|
-
MENU_SURFACE_CLASS,
|
|
1957
|
-
"shadow-md",
|
|
1958
|
-
MOTION_POPPER,
|
|
1959
|
-
className
|
|
1960
|
-
),
|
|
1961
|
-
...props
|
|
1962
|
-
}
|
|
1963
|
-
) });
|
|
1964
|
-
});
|
|
1965
|
-
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
1966
|
-
var DropdownMenuItem = React12.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1967
|
-
DropdownMenuPrimitive.Item,
|
|
1968
|
-
{
|
|
1969
|
-
ref,
|
|
1970
|
-
"data-slot": "dropdown-menu-item",
|
|
1971
|
-
className: cn(MENU_ITEM_CLASS, inset && "pl-8", className),
|
|
1972
|
-
...props
|
|
1973
|
-
}
|
|
1974
|
-
));
|
|
1975
|
-
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
1976
|
-
var DropdownMenuCheckboxItem = React12.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1977
|
-
DropdownMenuPrimitive.CheckboxItem,
|
|
1978
|
-
{
|
|
1979
|
-
ref,
|
|
1980
|
-
"data-slot": "dropdown-menu-checkbox-item",
|
|
1981
|
-
className: cn(MENU_INDICATOR_ITEM_CLASS, className),
|
|
1982
|
-
...props,
|
|
1983
|
-
children: [
|
|
1984
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CheckIcon, { className: "h-4 w-4" }) }) }),
|
|
1985
|
-
children
|
|
1986
|
-
]
|
|
1987
|
-
}
|
|
1988
|
-
));
|
|
1989
|
-
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
1990
|
-
var DropdownMenuRadioItem = React12.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1991
|
-
DropdownMenuPrimitive.RadioItem,
|
|
1992
|
-
{
|
|
1993
|
-
ref,
|
|
1994
|
-
"data-slot": "dropdown-menu-radio-item",
|
|
1995
|
-
className: cn(MENU_INDICATOR_ITEM_CLASS, className),
|
|
1996
|
-
...props,
|
|
1997
|
-
children: [
|
|
1998
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DotFilledIcon, { className: "h-4 w-4 fill-current" }) }) }),
|
|
1999
|
-
children
|
|
2000
|
-
]
|
|
2001
|
-
}
|
|
2002
|
-
));
|
|
2003
|
-
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
2004
|
-
var DropdownMenuLabel = React12.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2005
|
-
DropdownMenuPrimitive.Label,
|
|
2006
|
-
{
|
|
2007
|
-
ref,
|
|
2008
|
-
"data-slot": "dropdown-menu-label",
|
|
2009
|
-
className: cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className),
|
|
2010
|
-
...props
|
|
2011
|
-
}
|
|
2012
|
-
));
|
|
2013
|
-
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
2014
|
-
var DropdownMenuSeparator = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2015
|
-
DropdownMenuPrimitive.Separator,
|
|
2016
|
-
{
|
|
2017
|
-
ref,
|
|
2018
|
-
"data-slot": "dropdown-menu-separator",
|
|
2019
|
-
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
2020
|
-
...props
|
|
2021
|
-
}
|
|
2022
|
-
));
|
|
2023
|
-
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
2024
|
-
var DropdownMenuShortcut = ({
|
|
2025
|
-
className,
|
|
2026
|
-
...props
|
|
2027
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2028
|
-
"span",
|
|
2029
|
-
{
|
|
2030
|
-
"data-slot": "dropdown-menu-shortcut",
|
|
2031
|
-
className: cn("ml-auto text-xs tracking-widest opacity-60", className),
|
|
1916
|
+
var Popover = PopoverPrimitive.Root;
|
|
1917
|
+
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
1918
|
+
var PopoverContent = React12.forwardRef(
|
|
1919
|
+
({
|
|
1920
|
+
className,
|
|
1921
|
+
align = "center",
|
|
1922
|
+
sideOffset = 4,
|
|
1923
|
+
container,
|
|
1924
|
+
animated = true,
|
|
2032
1925
|
...props
|
|
1926
|
+
}, ref) => {
|
|
1927
|
+
const portalContainer = usePortalContainer(container);
|
|
1928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(PopoverPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1929
|
+
PopoverPrimitive.Content,
|
|
1930
|
+
{
|
|
1931
|
+
ref,
|
|
1932
|
+
align,
|
|
1933
|
+
sideOffset,
|
|
1934
|
+
className: cn(
|
|
1935
|
+
// Cap to the viewport space Radix measured and scroll — a popover taller
|
|
1936
|
+
// than the screen must never trap the user with unreachable content.
|
|
1937
|
+
// z must EQUAL the dialog layer (z-[10000]), never exceed it: with equal
|
|
1938
|
+
// z, DOM portal order decides, so a dialog opened FROM a popover stacks
|
|
1939
|
+
// above it, and a popover opened from a dialog still stacks above the
|
|
1940
|
+
// dialog. z-[10001] buried dialogs behind fullscreen popovers.
|
|
1941
|
+
"z-[10000] w-72 max-h-[var(--radix-popover-content-available-height)] overflow-y-auto overscroll-contain rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none",
|
|
1942
|
+
animated && MOTION_POPPER,
|
|
1943
|
+
className
|
|
1944
|
+
),
|
|
1945
|
+
...props
|
|
1946
|
+
}
|
|
1947
|
+
) });
|
|
2033
1948
|
}
|
|
2034
1949
|
);
|
|
2035
|
-
|
|
1950
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
2036
1951
|
|
|
2037
1952
|
// src/content-transfer/index.tsx
|
|
2038
1953
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
@@ -2055,6 +1970,53 @@ function MenuPresentation({ label, hint, icon: Icon3 }) {
|
|
|
2055
1970
|
] })
|
|
2056
1971
|
] });
|
|
2057
1972
|
}
|
|
1973
|
+
function PaletteGlyph({ format, ai = false, file = false }) {
|
|
1974
|
+
if (ai) return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("svg", { className: "matrx-alchemy-palette-glyph", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
1975
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M12 5a3 3 0 1 0-5.997.125A4 4 0 0 0 3.5 10.9a4 4 0 0 0 .556 6.588A4 4 0 0 0 12 19" }),
|
|
1976
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.503 5.775 4 4 0 0 1-.556 6.588A4 4 0 0 1 12 19" }),
|
|
1977
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M12 5v14M8 9h1M15 9h1M8 15h1M15 15h1" })
|
|
1978
|
+
] });
|
|
1979
|
+
if (file) return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("svg", { className: "matrx-alchemy-palette-glyph", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
1980
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M6 3h8l4 4v14H6z" }),
|
|
1981
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M14 3v5h5M9 13h6M9 17h6" })
|
|
1982
|
+
] });
|
|
1983
|
+
const path2 = format === "json" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
1984
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M9 4C7 4 7 7 5 7v3c2 0 2 1 2 2s0 2-2 2v3c2 0 2 3 4 3" }),
|
|
1985
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M15 4c2 0 2 3 4 3v3c-2 0-2 1-2 2s0 2 2 2v3c-2 0-2 3-4 3" })
|
|
1986
|
+
] }) : format === "compact-json" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
1987
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "m14 10 7-7" }),
|
|
1988
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M20 10h-6V4" }),
|
|
1989
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "m3 21 7-7" }),
|
|
1990
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M4 14h6v6" })
|
|
1991
|
+
] }) : format === "csv" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
1992
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("rect", { x: "4", y: "4", width: "16", height: "16", rx: "1" }),
|
|
1993
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M4 10h16M10 4v16" })
|
|
1994
|
+
] }) : format === "tsv" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
1995
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
1996
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M14 2v6h6M8 13h2M14 13h2M8 17h2M14 17h2" })
|
|
1997
|
+
] }) : format === "xlsx" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
1998
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
1999
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M14 2v6h6M8 13h8M8 17h8M12 11v8" })
|
|
2000
|
+
] }) : format === "markdown" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
2001
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5z" }),
|
|
2002
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M14 2v6h6M10 13l-2 2 2 2M14 17l2-2-2-2" })
|
|
2003
|
+
] }) : format === "html" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_jsx_runtime21.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M15 6h6M3 6h7M3 12h18M3 18h12" }) }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_jsx_runtime21.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M4 7V4h16v3M9 20h6M12 4v16" }) });
|
|
2004
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("svg", { className: "matrx-alchemy-palette-glyph", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: path2 });
|
|
2005
|
+
}
|
|
2006
|
+
function PaletteRows({ title, items, onRun, extra, ai = false }) {
|
|
2007
|
+
if (!items.length && !extra) return null;
|
|
2008
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("section", { className: "matrx-alchemy-palette-section", children: [
|
|
2009
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h3", { children: title }),
|
|
2010
|
+
items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("button", { type: "button", className: cn("matrx-alchemy-palette-row", ai && "matrx-alchemy-palette-row-ai"), "aria-label": item.ariaLabel, onClick: () => onRun?.(item), children: [
|
|
2011
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(item.icon, { className: "matrx-alchemy-menu-icon" }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(PaletteGlyph, { ai }),
|
|
2012
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { children: [
|
|
2013
|
+
item.copyLabel ?? item.label,
|
|
2014
|
+
item.hint ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("small", { className: "matrx-alchemy-menu-hint", children: item.hint }) : null
|
|
2015
|
+
] })
|
|
2016
|
+
] }, item.id)),
|
|
2017
|
+
extra
|
|
2018
|
+
] });
|
|
2019
|
+
}
|
|
2058
2020
|
var LABEL = { plain: "Plain text", markdown: "Markdown", html: "Formatted", json: "JSON", "compact-json": "Compact JSON", csv: "CSV", tsv: "Google Sheets", xlsx: "Excel workbook" };
|
|
2059
2021
|
var BUILT_INS = Object.freeze(Object.keys(LABEL).map((id) => ({ id })));
|
|
2060
2022
|
var COPIES = ["plain", "markdown", "html", "json", "compact-json", "csv", "tsv"];
|
|
@@ -2143,7 +2105,7 @@ function ContentTransferMenu(props) {
|
|
|
2143
2105
|
const identityKey = props.capabilities?.identityKey ?? inherited.identityKey;
|
|
2144
2106
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ContentTransferMenuSession, { ...props }, identityKey ?? "anonymous");
|
|
2145
2107
|
}
|
|
2146
|
-
function ContentTransferMenuSession({ source, surface, label, projection, sections, preferences, table, formatSources, variants = EMPTY_VARIANTS, actions = [], capabilities: local, disabled, enabled = true, className, stopPropagation = true, hide = [], controllerRef }) {
|
|
2108
|
+
function ContentTransferMenuSession({ source, surface, label, projection, sections, preferences, table, formatSources, sourceFormats = true, variants = EMPTY_VARIANTS, actions = [], capabilities: local, disabled, enabled = true, className, stopPropagation = true, hide = [], controllerRef }) {
|
|
2147
2109
|
const triggerRef = React13.useRef(null);
|
|
2148
2110
|
const inherited = React13.useContext(CapabilityContext);
|
|
2149
2111
|
const nearestSurface = React13.useContext(SurfaceContext);
|
|
@@ -2156,6 +2118,8 @@ function ContentTransferMenuSession({ source, surface, label, projection, sectio
|
|
|
2156
2118
|
const workspaceCaptures = React13.useRef(/* @__PURE__ */ new Map());
|
|
2157
2119
|
const externalWorkspaceKeys = React13.useRef(/* @__PURE__ */ new Set());
|
|
2158
2120
|
const [notice, setNotice] = React13.useState(null);
|
|
2121
|
+
const [paletteOpen, setPaletteOpen] = React13.useState(false);
|
|
2122
|
+
const [mode, setMode] = React13.useState("copy");
|
|
2159
2123
|
const scopes = React13.useMemo(() => table?.availableScopes ?? ["target"], [table]);
|
|
2160
2124
|
const initialScope = table?.initialScope ?? "target";
|
|
2161
2125
|
if (!scopes.includes(initialScope)) throw new Error("Alchemy initialScope must be included in availableScopes.");
|
|
@@ -2407,48 +2371,87 @@ function ContentTransferMenuSession({ source, surface, label, projection, sectio
|
|
|
2407
2371
|
}, [captureOne, capturePrimary, fence, initialScope, preferences, providerPreferences, report]);
|
|
2408
2372
|
if (!enabled) return null;
|
|
2409
2373
|
const payload = menuCapture?.snapshot.payload ?? (source && "kind" in source ? source : void 0);
|
|
2410
|
-
const quickVariants = (section) => variants.filter((v) => v.copyLabel && (v.section ?? "ai") === section)
|
|
2411
|
-
const visibleCopies = COPIES.filter((f) => Boolean(formatSources?.[f]) || !["csv", "tsv"].includes(f) || payload?.kind === "rows");
|
|
2412
|
-
const visibleDownloads = DOWNLOADS.filter((f) => f !== "xlsx" && Boolean(formatSources?.[f]) || !["csv", "tsv", "xlsx"].includes(f) || payload?.kind === "rows");
|
|
2413
|
-
const visibleAdapters = menuCapture ? adapters.filter((a) => a.supports(menuCapture.snapshot.payload)) : [];
|
|
2374
|
+
const quickVariants = (section) => variants.filter((v) => v.copyLabel && (v.section ?? "ai") === section);
|
|
2375
|
+
const visibleCopies = sourceFormats ? COPIES.filter((f) => Boolean(formatSources?.[f]) || !["csv", "tsv"].includes(f) || payload?.kind === "rows") : [];
|
|
2376
|
+
const visibleDownloads = sourceFormats ? DOWNLOADS.filter((f) => f !== "xlsx" && Boolean(formatSources?.[f]) || !["csv", "tsv", "xlsx"].includes(f) || payload?.kind === "rows") : [];
|
|
2377
|
+
const visibleAdapters = sourceFormats && menuCapture ? adapters.filter((a) => a.supports(menuCapture.snapshot.payload)) : [];
|
|
2414
2378
|
const visibleActions = menuCapture ? registeredActions.filter((a) => a.supports(menuCapture.snapshot)) : [];
|
|
2379
|
+
const downloadActions = visibleActions.filter((action) => action.placement === "download");
|
|
2380
|
+
const ordinaryActions = visibleActions.filter((action) => action.placement !== "download");
|
|
2381
|
+
const copyAvailable = !hide.includes("copy") && visibleCopies.length + visibleAdapters.length + quickVariants("copy").length > 0;
|
|
2382
|
+
const downloadAvailable = !hide.includes("download") && visibleDownloads.length + visibleAdapters.length + downloadActions.length > 0;
|
|
2383
|
+
const prepareAvailable = !hide.includes("prepare") && (quickVariants("ai").length > 0 || Boolean(primary) || Boolean(nearestWorkspaceKey) || variants.length > 0);
|
|
2384
|
+
const resolvedMode = mode === "copy" && !copyAvailable ? "download" : mode === "download" && !downloadAvailable ? "copy" : mode;
|
|
2385
|
+
const closePalette = () => setPaletteOpen(false);
|
|
2386
|
+
const tile = (id, label2, onClick, options = {}) => {
|
|
2387
|
+
const presentation = options.action;
|
|
2388
|
+
const Icon3 = presentation?.icon;
|
|
2389
|
+
const fallbackLabel = options.file && !/^download\b/i.test(label2) ? `Download ${label2}` : label2;
|
|
2390
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("button", { type: "button", className: "matrx-alchemy-palette-tile", "aria-label": presentation?.ariaLabel ?? (presentation ? fallbackLabel : options.ariaLabel ?? `${resolvedMode === "copy" ? "Copy" : "Download"} ${label2}`), onClick: () => {
|
|
2391
|
+
closePalette();
|
|
2392
|
+
onClick();
|
|
2393
|
+
}, children: [
|
|
2394
|
+
Icon3 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Icon3, { className: "matrx-alchemy-menu-icon" }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(PaletteGlyph, { ...!options.custom ? { format: id } : {}, ...options.ai ? { ai: true } : {}, ...options.file ? { file: true } : {} }),
|
|
2395
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { children: [
|
|
2396
|
+
label2,
|
|
2397
|
+
presentation?.hint ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("small", { className: "matrx-alchemy-menu-hint", children: presentation.hint }) : null
|
|
2398
|
+
] })
|
|
2399
|
+
] }, id);
|
|
2400
|
+
};
|
|
2415
2401
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: cn("matrx-alchemy", className), onClick: stopPropagation ? (event) => event.stopPropagation() : void 0, children: [
|
|
2416
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2417
|
-
|
|
2402
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Popover, { open: paletteOpen, onOpenChange: (open) => {
|
|
2403
|
+
setPaletteOpen(open);
|
|
2404
|
+
if (open) {
|
|
2405
|
+
setMode("copy");
|
|
2406
|
+
void preflight();
|
|
2407
|
+
}
|
|
2418
2408
|
}, children: [
|
|
2419
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2420
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2424
|
-
quickVariants("copy"),
|
|
2425
|
-
visibleCopies.map((format) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuItem, { onSelect: () => void transfer(format, false), children: format === "plain" ? "Copy" : `Copy ${LABEL[format]}` }, format)),
|
|
2426
|
-
visibleAdapters.map((adapter) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DropdownMenuItem, { onSelect: () => void transfer(adapter, false), children: [
|
|
2427
|
-
"Copy ",
|
|
2428
|
-
adapter.label
|
|
2429
|
-
] }, adapter.id))
|
|
2430
|
-
] }) : null,
|
|
2431
|
-
!hide.includes("prepare") ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
2432
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuSeparator, {}),
|
|
2433
|
-
quickVariants("ai"),
|
|
2434
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuItem, { onSelect: () => void openWorkspace(), children: "Prepare for AI\u2026" }),
|
|
2435
|
-
nearestWorkspaceKey && nearestSurface ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuItem, { onSelect: () => void openWorkspace(nearestWorkspaceKey, { source: nearestSurface, label: nearestSurface.surfaceName }), children: "Prepare this surface\u2026" }) : null,
|
|
2436
|
-
variants.map((variant) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuItem, { onSelect: () => void openWorkspace(variantWorkspaceKeys.get(variant.id), variant), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(MenuPresentation, { ...variant, label: `Prepare ${variant.label}\u2026` }) }, variant.id))
|
|
2409
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { ref: triggerRef, type: "button", className: "matrx-alchemy-trigger", disabled, "aria-label": `Copy, transform or export ${sourceLabel}`, title: "Alchemy \u2014 copy, transform, export", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(AlchemyGlyph, {}) }) }),
|
|
2410
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(PopoverContent, { align: "end", className: "matrx-alchemy-menu matrx-alchemy-palette", "aria-label": "Alchemy output options", onCloseAutoFocus: () => triggerRef.current?.focus(), children: [
|
|
2411
|
+
copyAvailable && downloadAvailable ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "matrx-alchemy-mode", "aria-label": "Output action", children: [
|
|
2412
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { type: "button", "aria-label": "Copy mode", "aria-pressed": resolvedMode === "copy", onClick: () => setMode("copy"), children: "Copy" }),
|
|
2413
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { type: "button", "aria-label": "Download mode", "aria-pressed": resolvedMode === "download", onClick: () => setMode("download"), children: "Download" })
|
|
2437
2414
|
] }) : null,
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
] }, `download:${adapter.id}`))
|
|
2415
|
+
menuStatus === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "matrx-alchemy-palette-status", children: "Inspecting content\u2026" }) : menuStatus !== "idle" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "matrx-alchemy-error", children: menuStatus }) : null,
|
|
2416
|
+
resolvedMode === "copy" && copyAvailable ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
2417
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "matrx-alchemy-palette-grid", children: [
|
|
2418
|
+
visibleCopies.map((format) => tile(format, { plain: "Text", markdown: "Markdown", html: "Formatted", json: "JSON", "compact-json": "Compact", csv: "CSV", tsv: "Sheets" }[format], () => void transfer(format, false), { ariaLabel: `Copy ${LABEL[format]}` })),
|
|
2419
|
+
visibleAdapters.map((adapter) => tile(adapter.id, adapter.label, () => void transfer(adapter, false), { custom: true }))
|
|
2420
|
+
] }),
|
|
2421
|
+
quickVariants("copy").length ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(PaletteRows, { title: "Quick copy", items: quickVariants("copy"), onRun: (variant) => {
|
|
2422
|
+
closePalette();
|
|
2423
|
+
void transfer("markdown", false, variant);
|
|
2424
|
+
} }) : null
|
|
2449
2425
|
] }) : null,
|
|
2450
|
-
|
|
2451
|
-
|
|
2426
|
+
resolvedMode === "download" && downloadAvailable ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_jsx_runtime21.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "matrx-alchemy-palette-grid", children: [
|
|
2427
|
+
visibleDownloads.map((format) => tile(format, { plain: "Text", markdown: "Markdown", html: "Formatted", json: "JSON", "compact-json": "Compact", csv: "CSV", tsv: "Sheets", xlsx: "Excel" }[format], () => void transfer(format, true), { ariaLabel: `Download ${LABEL[format]}` })),
|
|
2428
|
+
visibleAdapters.map((adapter) => tile(adapter.id, adapter.label, () => void transfer(adapter, true), { custom: true })),
|
|
2429
|
+
downloadActions.map((action) => tile(action.id, action.label, () => void runAction(action), { custom: true, action, file: true }))
|
|
2430
|
+
] }) }) : null,
|
|
2431
|
+
prepareAvailable ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(PaletteRows, { title: "Prepare", ai: true, items: quickVariants("ai"), onRun: (variant) => {
|
|
2432
|
+
closePalette();
|
|
2433
|
+
void transfer("markdown", false, variant);
|
|
2434
|
+
}, extra: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("button", { type: "button", className: "matrx-alchemy-palette-row", onClick: () => {
|
|
2435
|
+
closePalette();
|
|
2436
|
+
void openWorkspace();
|
|
2437
|
+
}, children: [
|
|
2438
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(PaletteGlyph, { ai: true }),
|
|
2439
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: "Prepare for AI\u2026" })
|
|
2440
|
+
] }) }) : null,
|
|
2441
|
+
prepareAvailable && (nearestWorkspaceKey || variants.length) ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(PaletteRows, { title: "Context", items: [], extra: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
2442
|
+
nearestWorkspaceKey && nearestSurface ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { type: "button", className: "matrx-alchemy-palette-row", onClick: () => {
|
|
2443
|
+
closePalette();
|
|
2444
|
+
void openWorkspace(nearestWorkspaceKey, { source: nearestSurface, label: nearestSurface.surfaceName });
|
|
2445
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: "Prepare this surface\u2026" }) }) : null,
|
|
2446
|
+
variants.map((variant) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { type: "button", className: "matrx-alchemy-palette-row", "aria-label": variant.ariaLabel, onClick: () => {
|
|
2447
|
+
closePalette();
|
|
2448
|
+
void openWorkspace(variantWorkspaceKeys.get(variant.id), variant);
|
|
2449
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(MenuPresentation, { ...variant, label: `Prepare ${variant.label}\u2026` }) }, variant.id))
|
|
2450
|
+
] }) }) : null,
|
|
2451
|
+
ordinaryActions.length ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(PaletteRows, { title: "Actions", items: [], extra: ordinaryActions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { type: "button", className: "matrx-alchemy-palette-row", "aria-label": action.ariaLabel, onClick: () => {
|
|
2452
|
+
closePalette();
|
|
2453
|
+
void runAction(action);
|
|
2454
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(MenuPresentation, { ...action, label: action.label }) }, action.id)) }) : null
|
|
2452
2455
|
] })
|
|
2453
2456
|
] }),
|
|
2454
2457
|
notice ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "matrx-alchemy-notice", role: "status", children: notice }) : null,
|
|
@@ -3093,6 +3096,7 @@ function MatrxCopyMenuSession(props) {
|
|
|
3093
3096
|
label: item.label,
|
|
3094
3097
|
supports: () => true,
|
|
3095
3098
|
...item.build && !item.onSelect ? {
|
|
3099
|
+
placement: "download",
|
|
3096
3100
|
source: make(
|
|
3097
3101
|
`export:${item.id}`,
|
|
3098
3102
|
async () => {
|
|
@@ -3173,10 +3177,11 @@ function MatrxCopyMenuSession(props) {
|
|
|
3173
3177
|
label: props.label,
|
|
3174
3178
|
variants,
|
|
3175
3179
|
actions,
|
|
3180
|
+
sourceFormats: Boolean(source),
|
|
3176
3181
|
hide: [
|
|
3177
3182
|
...!copyVisible || !source ? ["copy"] : [],
|
|
3178
3183
|
...!aiVisible || !source ? ["prepare"] : [],
|
|
3179
|
-
...!exportVisible
|
|
3184
|
+
...!exportVisible ? ["download"] : []
|
|
3180
3185
|
],
|
|
3181
3186
|
formatSources: {
|
|
3182
3187
|
...human ? { plain: human, markdown: humanMarkdown, html: humanMarkdown } : {},
|
|
@@ -4236,52 +4241,12 @@ var import_url_state3 = require("@ai-matrx/kit/url-state");
|
|
|
4236
4241
|
var import_react7 = require("react");
|
|
4237
4242
|
var import_core = require("@dnd-kit/core");
|
|
4238
4243
|
|
|
4239
|
-
// src/popover.tsx
|
|
4240
|
-
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"), 1);
|
|
4241
|
-
var React15 = __toESM(require("react"), 1);
|
|
4242
|
-
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
4243
|
-
var Popover = PopoverPrimitive.Root;
|
|
4244
|
-
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
4245
|
-
var PopoverContent = React15.forwardRef(
|
|
4246
|
-
({
|
|
4247
|
-
className,
|
|
4248
|
-
align = "center",
|
|
4249
|
-
sideOffset = 4,
|
|
4250
|
-
container,
|
|
4251
|
-
animated = true,
|
|
4252
|
-
...props
|
|
4253
|
-
}, ref) => {
|
|
4254
|
-
const portalContainer = usePortalContainer(container);
|
|
4255
|
-
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(PopoverPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4256
|
-
PopoverPrimitive.Content,
|
|
4257
|
-
{
|
|
4258
|
-
ref,
|
|
4259
|
-
align,
|
|
4260
|
-
sideOffset,
|
|
4261
|
-
className: cn(
|
|
4262
|
-
// Cap to the viewport space Radix measured and scroll — a popover taller
|
|
4263
|
-
// than the screen must never trap the user with unreachable content.
|
|
4264
|
-
// z must EQUAL the dialog layer (z-[10000]), never exceed it: with equal
|
|
4265
|
-
// z, DOM portal order decides, so a dialog opened FROM a popover stacks
|
|
4266
|
-
// above it, and a popover opened from a dialog still stacks above the
|
|
4267
|
-
// dialog. z-[10001] buried dialogs behind fullscreen popovers.
|
|
4268
|
-
"z-[10000] w-72 max-h-[var(--radix-popover-content-available-height)] overflow-y-auto overscroll-contain rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none",
|
|
4269
|
-
animated && MOTION_POPPER,
|
|
4270
|
-
className
|
|
4271
|
-
),
|
|
4272
|
-
...props
|
|
4273
|
-
}
|
|
4274
|
-
) });
|
|
4275
|
-
}
|
|
4276
|
-
);
|
|
4277
|
-
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
4278
|
-
|
|
4279
4244
|
// src/command.tsx
|
|
4280
4245
|
var DialogPrimitive2 = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
4281
4246
|
var import_cmdk = require("cmdk");
|
|
4282
|
-
var
|
|
4283
|
-
var
|
|
4284
|
-
var Command =
|
|
4247
|
+
var React15 = __toESM(require("react"), 1);
|
|
4248
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
4249
|
+
var Command = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4285
4250
|
import_cmdk.Command,
|
|
4286
4251
|
{
|
|
4287
4252
|
ref,
|
|
@@ -4296,12 +4261,12 @@ Command.displayName = import_cmdk.Command.displayName;
|
|
|
4296
4261
|
var DIALOG_DESKTOP_CLASSES2 = `fixed left-[50%] top-[50%] z-[10000] grid min-w-0 w-full max-w-lg ${CENTERED_DIALOG} gap-4 overflow-x-clip border bg-background p-6 shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full sm:rounded-lg`;
|
|
4297
4262
|
var DIALOG_MOBILE_SHEET_CLASSES2 = "fixed inset-x-0 bottom-0 left-0 right-0 top-auto z-[10000] flex min-w-0 flex-col w-full max-w-full max-h-[90dvh] translate-x-0 translate-y-0 gap-4 overflow-x-clip border-t bg-background p-4 pb-safe shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full rounded-t-2xl rounded-b-none overflow-y-auto overscroll-contain";
|
|
4298
4263
|
var DIALOG_MOBILE_SHEET_OVERRIDE2 = "inset-x-0 bottom-0 left-0 right-0 top-auto translate-x-0 translate-y-0 w-full max-w-full max-h-[90dvh] rounded-b-none rounded-t-2xl overflow-y-auto";
|
|
4299
|
-
var CommandDialogContent =
|
|
4264
|
+
var CommandDialogContent = React15.forwardRef(({ className, children, container, ...props }, ref) => {
|
|
4300
4265
|
const isMobile = useIsMobile();
|
|
4301
4266
|
const isModal = useRadixDialogModal();
|
|
4302
4267
|
const portalContainer = usePortalContainer(container);
|
|
4303
|
-
return /* @__PURE__ */ (0,
|
|
4304
|
-
isModal ? /* @__PURE__ */ (0,
|
|
4268
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(DialogPrimitive2.Portal, { container: portalContainer, children: [
|
|
4269
|
+
isModal ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4305
4270
|
DialogPrimitive2.Overlay,
|
|
4306
4271
|
{
|
|
4307
4272
|
className: cn(
|
|
@@ -4310,7 +4275,7 @@ var CommandDialogContent = React16.forwardRef(({ className, children, container,
|
|
|
4310
4275
|
)
|
|
4311
4276
|
}
|
|
4312
4277
|
) : null,
|
|
4313
|
-
/* @__PURE__ */ (0,
|
|
4278
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
4314
4279
|
DialogPrimitive2.Content,
|
|
4315
4280
|
{
|
|
4316
4281
|
ref,
|
|
@@ -4326,9 +4291,9 @@ var CommandDialogContent = React16.forwardRef(({ className, children, container,
|
|
|
4326
4291
|
...props,
|
|
4327
4292
|
children: [
|
|
4328
4293
|
children,
|
|
4329
|
-
/* @__PURE__ */ (0,
|
|
4330
|
-
/* @__PURE__ */ (0,
|
|
4331
|
-
/* @__PURE__ */ (0,
|
|
4294
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(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: [
|
|
4295
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(XIcon, { className: "h-4 w-4" }),
|
|
4296
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "sr-only", children: "Close" })
|
|
4332
4297
|
] })
|
|
4333
4298
|
]
|
|
4334
4299
|
}
|
|
@@ -4336,9 +4301,9 @@ var CommandDialogContent = React16.forwardRef(({ className, children, container,
|
|
|
4336
4301
|
] });
|
|
4337
4302
|
});
|
|
4338
4303
|
CommandDialogContent.displayName = "CommandDialogContent";
|
|
4339
|
-
var CommandInput =
|
|
4340
|
-
/* @__PURE__ */ (0,
|
|
4341
|
-
/* @__PURE__ */ (0,
|
|
4304
|
+
var CommandInput = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
|
4305
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(MagnifyingGlassIcon, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
4306
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4342
4307
|
import_cmdk.Command.Input,
|
|
4343
4308
|
{
|
|
4344
4309
|
ref,
|
|
@@ -4351,7 +4316,7 @@ var CommandInput = React16.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
4351
4316
|
)
|
|
4352
4317
|
] }));
|
|
4353
4318
|
CommandInput.displayName = import_cmdk.Command.Input.displayName;
|
|
4354
|
-
var CommandList =
|
|
4319
|
+
var CommandList = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4355
4320
|
import_cmdk.Command.List,
|
|
4356
4321
|
{
|
|
4357
4322
|
ref,
|
|
@@ -4360,7 +4325,7 @@ var CommandList = React16.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
4360
4325
|
}
|
|
4361
4326
|
));
|
|
4362
4327
|
CommandList.displayName = import_cmdk.Command.List.displayName;
|
|
4363
|
-
var CommandEmpty =
|
|
4328
|
+
var CommandEmpty = React15.forwardRef((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4364
4329
|
import_cmdk.Command.Empty,
|
|
4365
4330
|
{
|
|
4366
4331
|
ref,
|
|
@@ -4369,7 +4334,7 @@ var CommandEmpty = React16.forwardRef((props, ref) => /* @__PURE__ */ (0, import
|
|
|
4369
4334
|
}
|
|
4370
4335
|
));
|
|
4371
4336
|
CommandEmpty.displayName = import_cmdk.Command.Empty.displayName;
|
|
4372
|
-
var CommandGroup =
|
|
4337
|
+
var CommandGroup = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4373
4338
|
import_cmdk.Command.Group,
|
|
4374
4339
|
{
|
|
4375
4340
|
ref,
|
|
@@ -4381,7 +4346,7 @@ var CommandGroup = React16.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
4381
4346
|
}
|
|
4382
4347
|
));
|
|
4383
4348
|
CommandGroup.displayName = import_cmdk.Command.Group.displayName;
|
|
4384
|
-
var CommandSeparator =
|
|
4349
|
+
var CommandSeparator = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4385
4350
|
import_cmdk.Command.Separator,
|
|
4386
4351
|
{
|
|
4387
4352
|
ref,
|
|
@@ -4390,7 +4355,7 @@ var CommandSeparator = React16.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
4390
4355
|
}
|
|
4391
4356
|
));
|
|
4392
4357
|
CommandSeparator.displayName = import_cmdk.Command.Separator.displayName;
|
|
4393
|
-
var CommandItem =
|
|
4358
|
+
var CommandItem = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4394
4359
|
import_cmdk.Command.Item,
|
|
4395
4360
|
{
|
|
4396
4361
|
ref,
|
|
@@ -4406,7 +4371,7 @@ var CommandShortcut = ({
|
|
|
4406
4371
|
className,
|
|
4407
4372
|
...props
|
|
4408
4373
|
}) => {
|
|
4409
|
-
return /* @__PURE__ */ (0,
|
|
4374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4410
4375
|
"span",
|
|
4411
4376
|
{
|
|
4412
4377
|
className: cn(
|
|
@@ -4420,10 +4385,10 @@ var CommandShortcut = ({
|
|
|
4420
4385
|
CommandShortcut.displayName = "CommandShortcut";
|
|
4421
4386
|
|
|
4422
4387
|
// src/data-table/ColumnHeaderCell.tsx
|
|
4423
|
-
var
|
|
4388
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
4424
4389
|
var HeaderButton = (0, import_react7.forwardRef)(({ dragDescription, "aria-describedby": tooltipDescription, ...props }, ref) => {
|
|
4425
4390
|
const descriptions = [tooltipDescription, dragDescription].filter((value) => Boolean(value)).join(" ");
|
|
4426
|
-
return /* @__PURE__ */ (0,
|
|
4391
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4427
4392
|
"button",
|
|
4428
4393
|
{
|
|
4429
4394
|
ref,
|
|
@@ -4503,7 +4468,7 @@ function ColumnHeaderCell({
|
|
|
4503
4468
|
else onFilterChange(next);
|
|
4504
4469
|
};
|
|
4505
4470
|
const menuLabel = labelText ? `Sort or filter ${labelText}` : "Sort or filter column";
|
|
4506
|
-
const menuContent = /* @__PURE__ */ (0,
|
|
4471
|
+
const menuContent = /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
4507
4472
|
PopoverContent,
|
|
4508
4473
|
{
|
|
4509
4474
|
align: "start",
|
|
@@ -4520,9 +4485,9 @@ function ColumnHeaderCell({
|
|
|
4520
4485
|
input.focus();
|
|
4521
4486
|
},
|
|
4522
4487
|
children: [
|
|
4523
|
-
sortable ? /* @__PURE__ */ (0,
|
|
4524
|
-
/* @__PURE__ */ (0,
|
|
4525
|
-
/* @__PURE__ */ (0,
|
|
4488
|
+
sortable ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
4489
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-col gap-0.5 pb-2", children: [
|
|
4490
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
4526
4491
|
Button,
|
|
4527
4492
|
{
|
|
4528
4493
|
variant: isSorted && sortDirection === "asc" ? "secondary" : "ghost",
|
|
@@ -4530,12 +4495,12 @@ function ColumnHeaderCell({
|
|
|
4530
4495
|
className: "h-8 justify-start gap-2 px-2 text-xs font-normal",
|
|
4531
4496
|
onClick: onSortAsc,
|
|
4532
4497
|
children: [
|
|
4533
|
-
/* @__PURE__ */ (0,
|
|
4498
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ArrowUp, { className: "h-3.5 w-3.5" }),
|
|
4534
4499
|
"Sort ascending"
|
|
4535
4500
|
]
|
|
4536
4501
|
}
|
|
4537
4502
|
),
|
|
4538
|
-
/* @__PURE__ */ (0,
|
|
4503
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
4539
4504
|
Button,
|
|
4540
4505
|
{
|
|
4541
4506
|
variant: isSorted && sortDirection === "desc" ? "secondary" : "ghost",
|
|
@@ -4543,12 +4508,12 @@ function ColumnHeaderCell({
|
|
|
4543
4508
|
className: "h-8 justify-start gap-2 px-2 text-xs font-normal",
|
|
4544
4509
|
onClick: onSortDesc,
|
|
4545
4510
|
children: [
|
|
4546
|
-
/* @__PURE__ */ (0,
|
|
4511
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ArrowDown, { className: "h-3.5 w-3.5" }),
|
|
4547
4512
|
"Sort descending"
|
|
4548
4513
|
]
|
|
4549
4514
|
}
|
|
4550
4515
|
),
|
|
4551
|
-
isSorted ? /* @__PURE__ */ (0,
|
|
4516
|
+
isSorted ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
4552
4517
|
Button,
|
|
4553
4518
|
{
|
|
4554
4519
|
variant: "ghost",
|
|
@@ -4556,15 +4521,15 @@ function ColumnHeaderCell({
|
|
|
4556
4521
|
className: "h-8 justify-start gap-2 px-2 text-xs font-normal text-muted-foreground",
|
|
4557
4522
|
onClick: onClearSort,
|
|
4558
4523
|
children: [
|
|
4559
|
-
/* @__PURE__ */ (0,
|
|
4524
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ListX, { className: "h-3.5 w-3.5" }),
|
|
4560
4525
|
"Clear sort"
|
|
4561
4526
|
]
|
|
4562
4527
|
}
|
|
4563
4528
|
) : null
|
|
4564
4529
|
] }),
|
|
4565
|
-
filterKind ? /* @__PURE__ */ (0,
|
|
4530
|
+
filterKind ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "mb-2 h-px bg-border" }) : null
|
|
4566
4531
|
] }) : null,
|
|
4567
|
-
filterKind ? /* @__PURE__ */ (0,
|
|
4532
|
+
filterKind ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4568
4533
|
FilterBody,
|
|
4569
4534
|
{
|
|
4570
4535
|
kind: filterKind,
|
|
@@ -4579,10 +4544,10 @@ function ColumnHeaderCell({
|
|
|
4579
4544
|
allowNullModes
|
|
4580
4545
|
}
|
|
4581
4546
|
) : null,
|
|
4582
|
-
filterKind && visibleFilter && allowNegation ? /* @__PURE__ */ (0,
|
|
4583
|
-
/* @__PURE__ */ (0,
|
|
4584
|
-
/* @__PURE__ */ (0,
|
|
4585
|
-
/* @__PURE__ */ (0,
|
|
4547
|
+
filterKind && visibleFilter && allowNegation ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "mt-2 border-t border-border pt-2", children: [
|
|
4548
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "mb-1 text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: "Match mode" }),
|
|
4549
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "grid grid-cols-2 gap-1 rounded-md border p-0.5", children: [
|
|
4550
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4586
4551
|
"button",
|
|
4587
4552
|
{
|
|
4588
4553
|
type: "button",
|
|
@@ -4595,7 +4560,7 @@ function ColumnHeaderCell({
|
|
|
4595
4560
|
children: "Include"
|
|
4596
4561
|
}
|
|
4597
4562
|
),
|
|
4598
|
-
/* @__PURE__ */ (0,
|
|
4563
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4599
4564
|
"button",
|
|
4600
4565
|
{
|
|
4601
4566
|
type: "button",
|
|
@@ -4610,11 +4575,11 @@ function ColumnHeaderCell({
|
|
|
4610
4575
|
)
|
|
4611
4576
|
] })
|
|
4612
4577
|
] }) : null,
|
|
4613
|
-
filterKind && deferredFilter ? /* @__PURE__ */ (0,
|
|
4614
|
-
filterFooterHint ? /* @__PURE__ */ (0,
|
|
4615
|
-
/* @__PURE__ */ (0,
|
|
4616
|
-
filterShowCancel ? /* @__PURE__ */ (0,
|
|
4617
|
-
/* @__PURE__ */ (0,
|
|
4578
|
+
filterKind && deferredFilter ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "mt-2 border-t border-border pt-2", children: [
|
|
4579
|
+
filterFooterHint ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "mb-2 text-xs text-muted-foreground", children: filterFooterHint }) : null,
|
|
4580
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex justify-end gap-2", children: [
|
|
4581
|
+
filterShowCancel ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Button, { type: "button", variant: "ghost", size: "sm", onClick: cancelFilter, children: "Cancel" }) : null,
|
|
4582
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Button, { type: "button", size: "sm", onClick: applyFilter, children: filterApplyLabel ?? "Apply" })
|
|
4618
4583
|
] })
|
|
4619
4584
|
] }) : null
|
|
4620
4585
|
]
|
|
@@ -4623,10 +4588,10 @@ function ColumnHeaderCell({
|
|
|
4623
4588
|
if (compact) {
|
|
4624
4589
|
if (!sortable && !filterKind) {
|
|
4625
4590
|
if (!reorderEnabled) {
|
|
4626
|
-
return /* @__PURE__ */ (0,
|
|
4591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: cn("flex items-center justify-center", className), children: label });
|
|
4627
4592
|
}
|
|
4628
|
-
return /* @__PURE__ */ (0,
|
|
4629
|
-
/* @__PURE__ */ (0,
|
|
4593
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: cn("flex items-center justify-center", className), children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Tooltip, { children: [
|
|
4594
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4630
4595
|
HeaderButton,
|
|
4631
4596
|
{
|
|
4632
4597
|
type: "button",
|
|
@@ -4638,14 +4603,14 @@ function ColumnHeaderCell({
|
|
|
4638
4603
|
children: label
|
|
4639
4604
|
}
|
|
4640
4605
|
) }),
|
|
4641
|
-
/* @__PURE__ */ (0,
|
|
4606
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(TooltipContent, { children: [
|
|
4642
4607
|
"Drag to reorder ",
|
|
4643
4608
|
reorderLabel,
|
|
4644
4609
|
"."
|
|
4645
4610
|
] })
|
|
4646
4611
|
] }) });
|
|
4647
4612
|
}
|
|
4648
|
-
return /* @__PURE__ */ (0,
|
|
4613
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4649
4614
|
"div",
|
|
4650
4615
|
{
|
|
4651
4616
|
className: cn(
|
|
@@ -4653,9 +4618,9 @@ function ColumnHeaderCell({
|
|
|
4653
4618
|
align === "right" ? "justify-end" : "justify-center",
|
|
4654
4619
|
className
|
|
4655
4620
|
),
|
|
4656
|
-
children: /* @__PURE__ */ (0,
|
|
4657
|
-
/* @__PURE__ */ (0,
|
|
4658
|
-
/* @__PURE__ */ (0,
|
|
4621
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Popover, { open: filterOpen, onOpenChange: setFilterOpen, children: [
|
|
4622
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Tooltip, { children: [
|
|
4623
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
4659
4624
|
HeaderButton,
|
|
4660
4625
|
{
|
|
4661
4626
|
type: "button",
|
|
@@ -4671,8 +4636,8 @@ function ColumnHeaderCell({
|
|
|
4671
4636
|
),
|
|
4672
4637
|
children: [
|
|
4673
4638
|
label,
|
|
4674
|
-
isSorted ? sortDirection === "asc" ? /* @__PURE__ */ (0,
|
|
4675
|
-
filterActive ? /* @__PURE__ */ (0,
|
|
4639
|
+
isSorted ? sortDirection === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ArrowUp, { className: "absolute -top-1 right-0 h-2 w-2 text-primary" }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ArrowDown, { className: "absolute -top-1 right-0 h-2 w-2 text-primary" }) : null,
|
|
4640
|
+
filterActive ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4676
4641
|
"span",
|
|
4677
4642
|
{
|
|
4678
4643
|
"aria-hidden": true,
|
|
@@ -4682,14 +4647,14 @@ function ColumnHeaderCell({
|
|
|
4682
4647
|
]
|
|
4683
4648
|
}
|
|
4684
4649
|
) }) }),
|
|
4685
|
-
/* @__PURE__ */ (0,
|
|
4650
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipContent, { children: menuLabel })
|
|
4686
4651
|
] }),
|
|
4687
4652
|
menuContent
|
|
4688
4653
|
] })
|
|
4689
4654
|
}
|
|
4690
4655
|
);
|
|
4691
4656
|
}
|
|
4692
|
-
return /* @__PURE__ */ (0,
|
|
4657
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
4693
4658
|
"div",
|
|
4694
4659
|
{
|
|
4695
4660
|
className: cn(
|
|
@@ -4699,8 +4664,8 @@ function ColumnHeaderCell({
|
|
|
4699
4664
|
className
|
|
4700
4665
|
),
|
|
4701
4666
|
children: [
|
|
4702
|
-
sortable ? /* @__PURE__ */ (0,
|
|
4703
|
-
/* @__PURE__ */ (0,
|
|
4667
|
+
sortable ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Tooltip, { children: [
|
|
4668
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
4704
4669
|
HeaderButton,
|
|
4705
4670
|
{
|
|
4706
4671
|
type: "button",
|
|
@@ -4712,14 +4677,14 @@ function ColumnHeaderCell({
|
|
|
4712
4677
|
isSorted ? "text-foreground" : "text-muted-foreground hover:text-foreground"
|
|
4713
4678
|
),
|
|
4714
4679
|
children: [
|
|
4715
|
-
/* @__PURE__ */ (0,
|
|
4716
|
-
isSorted ? sortDirection === "asc" ? /* @__PURE__ */ (0,
|
|
4680
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "truncate", children: label }),
|
|
4681
|
+
isSorted ? sortDirection === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ArrowUp, { className: "h-3 w-3 shrink-0 text-primary" }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ArrowDown, { className: "h-3 w-3 shrink-0 text-primary" }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ArrowUpDown, { className: "h-3 w-3 shrink-0 opacity-40" })
|
|
4717
4682
|
]
|
|
4718
4683
|
}
|
|
4719
4684
|
) }),
|
|
4720
|
-
/* @__PURE__ */ (0,
|
|
4721
|
-
] }) : reorderEnabled ? /* @__PURE__ */ (0,
|
|
4722
|
-
/* @__PURE__ */ (0,
|
|
4685
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipContent, { children: reorderEnabled ? `Drag to reorder ${reorderLabel}.` : labelText ?? "Sort column" })
|
|
4686
|
+
] }) : reorderEnabled ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Tooltip, { children: [
|
|
4687
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4723
4688
|
HeaderButton,
|
|
4724
4689
|
{
|
|
4725
4690
|
type: "button",
|
|
@@ -4731,16 +4696,16 @@ function ColumnHeaderCell({
|
|
|
4731
4696
|
children: label
|
|
4732
4697
|
}
|
|
4733
4698
|
) }),
|
|
4734
|
-
/* @__PURE__ */ (0,
|
|
4699
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(TooltipContent, { children: [
|
|
4735
4700
|
"Drag to reorder ",
|
|
4736
4701
|
reorderLabel,
|
|
4737
4702
|
"."
|
|
4738
4703
|
] })
|
|
4739
|
-
] }) : /* @__PURE__ */ (0,
|
|
4740
|
-
filterKind ? /* @__PURE__ */ (0,
|
|
4741
|
-
/* @__PURE__ */ (0,
|
|
4742
|
-
/* @__PURE__ */ (0,
|
|
4743
|
-
/* @__PURE__ */ (0,
|
|
4704
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "truncate text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: label }),
|
|
4705
|
+
filterKind ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "inline-flex items-center", children: [
|
|
4706
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Popover, { open: filterOpen, onOpenChange: setFilterOpen, children: [
|
|
4707
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Tooltip, { children: [
|
|
4708
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4744
4709
|
"button",
|
|
4745
4710
|
{
|
|
4746
4711
|
type: "button",
|
|
@@ -4750,7 +4715,7 @@ function ColumnHeaderCell({
|
|
|
4750
4715
|
"rounded p-0.5 transition-colors",
|
|
4751
4716
|
filterActive ? "text-primary hover:text-primary/80" : "text-muted-foreground/40 hover:text-muted-foreground"
|
|
4752
4717
|
),
|
|
4753
|
-
children: /* @__PURE__ */ (0,
|
|
4718
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4754
4719
|
ListFilter,
|
|
4755
4720
|
{
|
|
4756
4721
|
className: cn("h-3 w-3", filterActive && "fill-primary/20")
|
|
@@ -4758,12 +4723,12 @@ function ColumnHeaderCell({
|
|
|
4758
4723
|
)
|
|
4759
4724
|
}
|
|
4760
4725
|
) }) }),
|
|
4761
|
-
/* @__PURE__ */ (0,
|
|
4726
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipContent, { children: menuLabel })
|
|
4762
4727
|
] }),
|
|
4763
4728
|
menuContent
|
|
4764
4729
|
] }),
|
|
4765
|
-
filterActive ? /* @__PURE__ */ (0,
|
|
4766
|
-
/* @__PURE__ */ (0,
|
|
4730
|
+
filterActive ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Tooltip, { children: [
|
|
4731
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4767
4732
|
"button",
|
|
4768
4733
|
{
|
|
4769
4734
|
type: "button",
|
|
@@ -4773,10 +4738,10 @@ function ColumnHeaderCell({
|
|
|
4773
4738
|
onFilterChange(void 0);
|
|
4774
4739
|
},
|
|
4775
4740
|
className: "rounded p-0.5 text-primary hover:bg-muted hover:text-foreground",
|
|
4776
|
-
children: /* @__PURE__ */ (0,
|
|
4741
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(X, { className: "h-3 w-3" })
|
|
4777
4742
|
}
|
|
4778
4743
|
) }),
|
|
4779
|
-
/* @__PURE__ */ (0,
|
|
4744
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipContent, { children: labelText ? `Clear ${labelText} filter` : "Clear this filter" })
|
|
4780
4745
|
] }) : null
|
|
4781
4746
|
] }) : null
|
|
4782
4747
|
]
|
|
@@ -4801,14 +4766,14 @@ function FilterBody({
|
|
|
4801
4766
|
onChange({ kind: "text", value: "", mode: next });
|
|
4802
4767
|
}
|
|
4803
4768
|
};
|
|
4804
|
-
return /* @__PURE__ */ (0,
|
|
4805
|
-
/* @__PURE__ */ (0,
|
|
4806
|
-
/* @__PURE__ */ (0,
|
|
4769
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "space-y-1.5 px-1", children: [
|
|
4770
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: "Filter" }),
|
|
4771
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "flex gap-1", children: [
|
|
4807
4772
|
["contains", "Contains"],
|
|
4808
4773
|
["empty", "(empty)"],
|
|
4809
4774
|
["not_empty", "(not empty)"],
|
|
4810
4775
|
...allowNullModes ? [["null", "(null)"], ["not_null", "(not null)"]] : []
|
|
4811
|
-
].map(([m, label]) => /* @__PURE__ */ (0,
|
|
4776
|
+
].map(([m, label]) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4812
4777
|
"button",
|
|
4813
4778
|
{
|
|
4814
4779
|
type: "button",
|
|
@@ -4822,8 +4787,8 @@ function FilterBody({
|
|
|
4822
4787
|
},
|
|
4823
4788
|
m
|
|
4824
4789
|
)) }),
|
|
4825
|
-
mode === "contains" && /* @__PURE__ */ (0,
|
|
4826
|
-
/* @__PURE__ */ (0,
|
|
4790
|
+
mode === "contains" && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "relative", children: [
|
|
4791
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4827
4792
|
Input,
|
|
4828
4793
|
{
|
|
4829
4794
|
"data-matrx-filter-autofocus": true,
|
|
@@ -4836,14 +4801,14 @@ function FilterBody({
|
|
|
4836
4801
|
style: { fontSize: "16px" }
|
|
4837
4802
|
}
|
|
4838
4803
|
),
|
|
4839
|
-
text ? /* @__PURE__ */ (0,
|
|
4804
|
+
text ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4840
4805
|
"button",
|
|
4841
4806
|
{
|
|
4842
4807
|
type: "button",
|
|
4843
4808
|
"aria-label": "Clear filter text",
|
|
4844
4809
|
className: "absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground hover:text-foreground",
|
|
4845
4810
|
onClick: () => onChange(void 0),
|
|
4846
|
-
children: /* @__PURE__ */ (0,
|
|
4811
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(X, { className: "h-3.5 w-3.5" })
|
|
4847
4812
|
}
|
|
4848
4813
|
) : null
|
|
4849
4814
|
] })
|
|
@@ -4851,7 +4816,7 @@ function FilterBody({
|
|
|
4851
4816
|
}
|
|
4852
4817
|
if (kind === "select") {
|
|
4853
4818
|
const selected = value?.kind === "select" ? value.values ?? (value.value && value.value !== "__all__" ? [value.value] : []) : [];
|
|
4854
|
-
return /* @__PURE__ */ (0,
|
|
4819
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4855
4820
|
SearchableSelectFilter,
|
|
4856
4821
|
{
|
|
4857
4822
|
selected,
|
|
@@ -4863,9 +4828,9 @@ function FilterBody({
|
|
|
4863
4828
|
}
|
|
4864
4829
|
if (kind === "boolean") {
|
|
4865
4830
|
const current = value?.kind === "boolean" ? value.value : "__all__";
|
|
4866
|
-
return /* @__PURE__ */ (0,
|
|
4867
|
-
/* @__PURE__ */ (0,
|
|
4868
|
-
/* @__PURE__ */ (0,
|
|
4831
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "space-y-1.5 px-1", children: [
|
|
4832
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: "Filter" }),
|
|
4833
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
4869
4834
|
Select,
|
|
4870
4835
|
{
|
|
4871
4836
|
value: current === "__all__" ? "__all__" : current ? "true" : "false",
|
|
@@ -4874,18 +4839,18 @@ function FilterBody({
|
|
|
4874
4839
|
else onChange({ kind: "boolean", value: v === "true" });
|
|
4875
4840
|
},
|
|
4876
4841
|
children: [
|
|
4877
|
-
/* @__PURE__ */ (0,
|
|
4878
|
-
/* @__PURE__ */ (0,
|
|
4879
|
-
/* @__PURE__ */ (0,
|
|
4880
|
-
/* @__PURE__ */ (0,
|
|
4881
|
-
/* @__PURE__ */ (0,
|
|
4842
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SelectTrigger, { className: "h-8 text-xs", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SelectValue, {}) }),
|
|
4843
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(SelectContent, { children: [
|
|
4844
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SelectItem, { value: "__all__", children: "All" }),
|
|
4845
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SelectItem, { value: "true", children: "Yes" }),
|
|
4846
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SelectItem, { value: "false", children: "No" })
|
|
4882
4847
|
] })
|
|
4883
4848
|
]
|
|
4884
4849
|
}
|
|
4885
4850
|
)
|
|
4886
4851
|
] });
|
|
4887
4852
|
}
|
|
4888
|
-
return /* @__PURE__ */ (0,
|
|
4853
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(NumberFilterBody, { value, onChange });
|
|
4889
4854
|
}
|
|
4890
4855
|
function SearchableSelectFilter({
|
|
4891
4856
|
selected,
|
|
@@ -4913,13 +4878,13 @@ function SearchableSelectFilter({
|
|
|
4913
4878
|
next.length === 0 ? void 0 : { kind: "select", value: next[0] ?? "", values: next }
|
|
4914
4879
|
);
|
|
4915
4880
|
};
|
|
4916
|
-
return /* @__PURE__ */ (0,
|
|
4917
|
-
/* @__PURE__ */ (0,
|
|
4918
|
-
/* @__PURE__ */ (0,
|
|
4881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "space-y-1 px-0", children: [
|
|
4882
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center justify-between px-1 pb-1", children: [
|
|
4883
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("p", { className: "text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: [
|
|
4919
4884
|
"Filter",
|
|
4920
4885
|
selected.length > 1 ? ` (any of ${selected.length})` : ""
|
|
4921
4886
|
] }),
|
|
4922
|
-
selected.length > 0 ? /* @__PURE__ */ (0,
|
|
4887
|
+
selected.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4923
4888
|
"button",
|
|
4924
4889
|
{
|
|
4925
4890
|
type: "button",
|
|
@@ -4929,8 +4894,8 @@ function SearchableSelectFilter({
|
|
|
4929
4894
|
}
|
|
4930
4895
|
) : null
|
|
4931
4896
|
] }),
|
|
4932
|
-
/* @__PURE__ */ (0,
|
|
4933
|
-
/* @__PURE__ */ (0,
|
|
4897
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Command, { className: "rounded-md border border-border", shouldFilter: false, children: [
|
|
4898
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4934
4899
|
CommandInput,
|
|
4935
4900
|
{
|
|
4936
4901
|
"data-matrx-filter-autofocus": true,
|
|
@@ -4940,10 +4905,10 @@ function SearchableSelectFilter({
|
|
|
4940
4905
|
className: "h-8 text-sm"
|
|
4941
4906
|
}
|
|
4942
4907
|
),
|
|
4943
|
-
/* @__PURE__ */ (0,
|
|
4944
|
-
/* @__PURE__ */ (0,
|
|
4945
|
-
/* @__PURE__ */ (0,
|
|
4946
|
-
/* @__PURE__ */ (0,
|
|
4908
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(CommandList, { className: "max-h-48", children: [
|
|
4909
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CommandEmpty, { className: "py-3 text-xs text-muted-foreground", children: "No matches" }),
|
|
4910
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(CommandGroup, { children: [
|
|
4911
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4947
4912
|
CommandItem,
|
|
4948
4913
|
{
|
|
4949
4914
|
value: "__all__",
|
|
@@ -4954,7 +4919,7 @@ function SearchableSelectFilter({
|
|
|
4954
4919
|
),
|
|
4955
4920
|
filtered.map((o) => {
|
|
4956
4921
|
const active = selected.includes(o.value);
|
|
4957
|
-
return /* @__PURE__ */ (0,
|
|
4922
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
4958
4923
|
CommandItem,
|
|
4959
4924
|
{
|
|
4960
4925
|
value: o.value,
|
|
@@ -4964,7 +4929,7 @@ function SearchableSelectFilter({
|
|
|
4964
4929
|
active && "bg-accent text-accent-foreground"
|
|
4965
4930
|
),
|
|
4966
4931
|
children: [
|
|
4967
|
-
/* @__PURE__ */ (0,
|
|
4932
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4968
4933
|
"span",
|
|
4969
4934
|
{
|
|
4970
4935
|
className: cn(
|
|
@@ -4972,7 +4937,7 @@ function SearchableSelectFilter({
|
|
|
4972
4937
|
single ? "rounded-full" : "rounded-sm",
|
|
4973
4938
|
active ? "border-primary bg-primary text-primary-foreground" : "border-muted-foreground/40"
|
|
4974
4939
|
),
|
|
4975
|
-
children: active && /* @__PURE__ */ (0,
|
|
4940
|
+
children: active && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Check, { className: "h-2.5 w-2.5" })
|
|
4976
4941
|
}
|
|
4977
4942
|
),
|
|
4978
4943
|
o.label
|
|
@@ -5003,10 +4968,10 @@ function NumberFilterBody({
|
|
|
5003
4968
|
}
|
|
5004
4969
|
onChange({ kind: "number", min: nextMin, max: nextMax });
|
|
5005
4970
|
};
|
|
5006
|
-
return /* @__PURE__ */ (0,
|
|
5007
|
-
/* @__PURE__ */ (0,
|
|
5008
|
-
/* @__PURE__ */ (0,
|
|
5009
|
-
(min !== void 0 || max !== void 0) && /* @__PURE__ */ (0,
|
|
4971
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "space-y-1.5 px-1", children: [
|
|
4972
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
4973
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: "Range" }),
|
|
4974
|
+
(min !== void 0 || max !== void 0) && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
5010
4975
|
"button",
|
|
5011
4976
|
{
|
|
5012
4977
|
type: "button",
|
|
@@ -5020,8 +4985,8 @@ function NumberFilterBody({
|
|
|
5020
4985
|
}
|
|
5021
4986
|
)
|
|
5022
4987
|
] }),
|
|
5023
|
-
/* @__PURE__ */ (0,
|
|
5024
|
-
/* @__PURE__ */ (0,
|
|
4988
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center gap-1.5", children: [
|
|
4989
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
5025
4990
|
Input,
|
|
5026
4991
|
{
|
|
5027
4992
|
"data-matrx-filter-autofocus": true,
|
|
@@ -5036,8 +5001,8 @@ function NumberFilterBody({
|
|
|
5036
5001
|
style: { fontSize: "16px" }
|
|
5037
5002
|
}
|
|
5038
5003
|
),
|
|
5039
|
-
/* @__PURE__ */ (0,
|
|
5040
|
-
/* @__PURE__ */ (0,
|
|
5004
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "text-xs text-muted-foreground", children: "\u2013" }),
|
|
5005
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
5041
5006
|
Input,
|
|
5042
5007
|
{
|
|
5043
5008
|
value: maxText,
|
|
@@ -5060,10 +5025,23 @@ function parseOptionalNumber(raw) {
|
|
|
5060
5025
|
return Number.isFinite(n) ? n : void 0;
|
|
5061
5026
|
}
|
|
5062
5027
|
|
|
5028
|
+
// src/data-table/column-drag-preview.ts
|
|
5029
|
+
function projectColumnDragOrder(orderedIds, preview2) {
|
|
5030
|
+
const order = [...orderedIds];
|
|
5031
|
+
if (!preview2?.targetId || preview2.draggedId === preview2.targetId) return order;
|
|
5032
|
+
const draggedIndex = order.indexOf(preview2.draggedId);
|
|
5033
|
+
const targetIndex = order.indexOf(preview2.targetId);
|
|
5034
|
+
if (draggedIndex < 0 || targetIndex < 0) return order;
|
|
5035
|
+
order.splice(draggedIndex, 1);
|
|
5036
|
+
const insertion = order.indexOf(preview2.targetId) + (preview2.after ? 1 : 0);
|
|
5037
|
+
order.splice(insertion, 0, preview2.draggedId);
|
|
5038
|
+
return order;
|
|
5039
|
+
}
|
|
5040
|
+
|
|
5063
5041
|
// src/data-table/ColumnManager.tsx
|
|
5064
5042
|
var import_react8 = require("react");
|
|
5065
5043
|
var import_core2 = require("@dnd-kit/core");
|
|
5066
|
-
var
|
|
5044
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
5067
5045
|
function ColumnManager({
|
|
5068
5046
|
open,
|
|
5069
5047
|
onOpenChange,
|
|
@@ -5137,18 +5115,18 @@ function ColumnManager({
|
|
|
5137
5115
|
if (target) moveTo(dragged, String(target));
|
|
5138
5116
|
}
|
|
5139
5117
|
});
|
|
5140
|
-
return /* @__PURE__ */ (0,
|
|
5141
|
-
/* @__PURE__ */ (0,
|
|
5142
|
-
/* @__PURE__ */ (0,
|
|
5143
|
-
/* @__PURE__ */ (0,
|
|
5118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Dialog, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(DialogContent, { className: "max-w-md", children: [
|
|
5119
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(DialogHeader, { children: [
|
|
5120
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(DialogTitle, { children: "Columns" }),
|
|
5121
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(DialogDescription, { children: "Choose the columns to show and set their order." })
|
|
5144
5122
|
] }),
|
|
5145
|
-
/* @__PURE__ */ (0,
|
|
5123
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "max-h-[55dvh] divide-y overflow-y-auto rounded-md border", children: draftOrder.map((id, index) => {
|
|
5146
5124
|
const column = byId.get(id);
|
|
5147
5125
|
if (!column) return null;
|
|
5148
5126
|
const label = typeof column.header === "string" ? column.header : id;
|
|
5149
5127
|
const hideable = column.hideable !== false;
|
|
5150
5128
|
const visible = !draftHidden.has(id);
|
|
5151
|
-
return /* @__PURE__ */ (0,
|
|
5129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
5152
5130
|
ColumnManagerDropTarget,
|
|
5153
5131
|
{
|
|
5154
5132
|
id,
|
|
@@ -5158,8 +5136,8 @@ function ColumnManager({
|
|
|
5158
5136
|
dropTarget === id && draggedColumnId !== id && "border-t-2 border-primary"
|
|
5159
5137
|
),
|
|
5160
5138
|
children: [
|
|
5161
|
-
/* @__PURE__ */ (0,
|
|
5162
|
-
/* @__PURE__ */ (0,
|
|
5139
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ColumnManagerDragHandle, { id, label }),
|
|
5140
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
5163
5141
|
Checkbox,
|
|
5164
5142
|
{
|
|
5165
5143
|
checked: visible,
|
|
@@ -5176,8 +5154,8 @@ function ColumnManager({
|
|
|
5176
5154
|
}
|
|
5177
5155
|
}
|
|
5178
5156
|
),
|
|
5179
|
-
/* @__PURE__ */ (0,
|
|
5180
|
-
/* @__PURE__ */ (0,
|
|
5157
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "min-w-0 flex-1 truncate text-sm", children: label }),
|
|
5158
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
5181
5159
|
Button,
|
|
5182
5160
|
{
|
|
5183
5161
|
type: "button",
|
|
@@ -5187,10 +5165,10 @@ function ColumnManager({
|
|
|
5187
5165
|
"aria-label": `Move ${label} earlier`,
|
|
5188
5166
|
disabled: index === 0,
|
|
5189
5167
|
onClick: () => move(id, -1),
|
|
5190
|
-
children: /* @__PURE__ */ (0,
|
|
5168
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ArrowUp, { className: "h-4 w-4" })
|
|
5191
5169
|
}
|
|
5192
5170
|
),
|
|
5193
|
-
/* @__PURE__ */ (0,
|
|
5171
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
5194
5172
|
Button,
|
|
5195
5173
|
{
|
|
5196
5174
|
type: "button",
|
|
@@ -5200,7 +5178,7 @@ function ColumnManager({
|
|
|
5200
5178
|
"aria-label": `Move ${label} later`,
|
|
5201
5179
|
disabled: index === draftOrder.length - 1,
|
|
5202
5180
|
onClick: () => move(id, 1),
|
|
5203
|
-
children: /* @__PURE__ */ (0,
|
|
5181
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ArrowDown, { className: "h-4 w-4" })
|
|
5204
5182
|
}
|
|
5205
5183
|
)
|
|
5206
5184
|
]
|
|
@@ -5208,9 +5186,9 @@ function ColumnManager({
|
|
|
5208
5186
|
id
|
|
5209
5187
|
);
|
|
5210
5188
|
}) }),
|
|
5211
|
-
/* @__PURE__ */ (0,
|
|
5212
|
-
/* @__PURE__ */ (0,
|
|
5213
|
-
/* @__PURE__ */ (0,
|
|
5189
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(DialogFooter, { children: [
|
|
5190
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button, { type: "button", variant: "outline", onClick: () => onOpenChange(false), children: "Cancel" }),
|
|
5191
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
5214
5192
|
Button,
|
|
5215
5193
|
{
|
|
5216
5194
|
type: "button",
|
|
@@ -5233,14 +5211,14 @@ function ColumnManagerDropTarget({
|
|
|
5233
5211
|
id: `matrx-column-manager:${id}`,
|
|
5234
5212
|
data: { matrxDragKind: "column-manager", columnId: id }
|
|
5235
5213
|
});
|
|
5236
|
-
return /* @__PURE__ */ (0,
|
|
5214
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { ref: setNodeRef, "data-matrx-column-manager-drop-target": id, className, children });
|
|
5237
5215
|
}
|
|
5238
5216
|
function ColumnManagerDragHandle({ id, label }) {
|
|
5239
5217
|
const { attributes, listeners, setNodeRef } = (0, import_core2.useDraggable)({
|
|
5240
5218
|
id: `matrx-column-manager:${id}`,
|
|
5241
5219
|
data: { matrxDragKind: "column-manager", columnId: id }
|
|
5242
5220
|
});
|
|
5243
|
-
return /* @__PURE__ */ (0,
|
|
5221
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
5244
5222
|
"button",
|
|
5245
5223
|
{
|
|
5246
5224
|
ref: setNodeRef,
|
|
@@ -5250,14 +5228,65 @@ function ColumnManagerDragHandle({ id, label }) {
|
|
|
5250
5228
|
title: `Drag to reorder ${label}`,
|
|
5251
5229
|
...attributes,
|
|
5252
5230
|
...listeners,
|
|
5253
|
-
children: /* @__PURE__ */ (0,
|
|
5231
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(GripVertical, { className: "h-4 w-4" })
|
|
5254
5232
|
}
|
|
5255
5233
|
);
|
|
5256
5234
|
}
|
|
5257
5235
|
|
|
5236
|
+
// src/data-table/saved-view-snapshot.ts
|
|
5237
|
+
var import_zod2 = require("zod");
|
|
5238
|
+
var filterSchema = import_zod2.z.union([
|
|
5239
|
+
import_zod2.z.object({ kind: import_zod2.z.literal("text"), value: import_zod2.z.string(), mode: import_zod2.z.enum(["contains", "empty", "not_empty", "null", "not_null"]).optional(), negated: import_zod2.z.boolean().optional() }),
|
|
5240
|
+
import_zod2.z.object({ kind: import_zod2.z.literal("select"), value: import_zod2.z.string(), values: import_zod2.z.array(import_zod2.z.string()).optional(), negated: import_zod2.z.boolean().optional() }),
|
|
5241
|
+
import_zod2.z.object({ kind: import_zod2.z.literal("boolean"), value: import_zod2.z.boolean(), negated: import_zod2.z.boolean().optional() }),
|
|
5242
|
+
import_zod2.z.object({ kind: import_zod2.z.literal("number"), min: import_zod2.z.number().optional(), max: import_zod2.z.number().optional(), negated: import_zod2.z.boolean().optional() })
|
|
5243
|
+
]);
|
|
5244
|
+
var layeredRuleSchema = import_zod2.z.object({ id: import_zod2.z.string().min(1), field: import_zod2.z.string().min(1), operator: import_zod2.z.enum(LAYERED_FILTER_OPERATORS), value: import_zod2.z.string(), valueTo: import_zod2.z.string().optional() });
|
|
5245
|
+
var snapshotSchema = import_zod2.z.object({
|
|
5246
|
+
__kind: import_zod2.z.literal("matrx-table-view"),
|
|
5247
|
+
version: import_zod2.z.literal(1),
|
|
5248
|
+
query: import_zod2.z.object({ pageSize: import_zod2.z.number().int().positive(), search: import_zod2.z.string(), searchMatchMode: import_zod2.z.enum(["contains", "whole_words"]).optional(), anyOf: import_zod2.z.string(), layeredFilters: import_zod2.z.array(layeredRuleSchema).optional(), columnFilters: import_zod2.z.record(import_zod2.z.string(), filterSchema.optional()), sort: import_zod2.z.object({ id: import_zod2.z.string().min(1), direction: import_zod2.z.enum(["asc", "desc"]) }).nullable() }),
|
|
5249
|
+
columns: import_zod2.z.object({
|
|
5250
|
+
order: import_zod2.z.array(import_zod2.z.string().min(1)).refine((order) => new Set(order).size === order.length, {
|
|
5251
|
+
message: "Column order must not contain duplicate IDs"
|
|
5252
|
+
}),
|
|
5253
|
+
hidden: import_zod2.z.array(import_zod2.z.string().min(1))
|
|
5254
|
+
})
|
|
5255
|
+
});
|
|
5256
|
+
function normalizeFilters(raw) {
|
|
5257
|
+
const filters = {};
|
|
5258
|
+
for (const [id, value] of Object.entries(raw)) {
|
|
5259
|
+
if (value === void 0) continue;
|
|
5260
|
+
if (value.kind === "text") filters[id] = { kind: "text", value: value.value, ...value.mode === void 0 ? {} : { mode: value.mode }, ...value.negated === void 0 ? {} : { negated: value.negated } };
|
|
5261
|
+
else if (value.kind === "select") filters[id] = { kind: "select", value: value.value, ...value.values === void 0 ? {} : { values: value.values }, ...value.negated === void 0 ? {} : { negated: value.negated } };
|
|
5262
|
+
else if (value.kind === "boolean") filters[id] = { kind: "boolean", value: value.value, ...value.negated === void 0 ? {} : { negated: value.negated } };
|
|
5263
|
+
else filters[id] = { kind: "number", ...value.min === void 0 ? {} : { min: value.min }, ...value.max === void 0 ? {} : { max: value.max }, ...value.negated === void 0 ? {} : { negated: value.negated } };
|
|
5264
|
+
}
|
|
5265
|
+
return filters;
|
|
5266
|
+
}
|
|
5267
|
+
function parseTableViewSnapshot(raw) {
|
|
5268
|
+
const parsed = snapshotSchema.safeParse(raw);
|
|
5269
|
+
if (!parsed.success) return null;
|
|
5270
|
+
const { query, columns } = parsed.data;
|
|
5271
|
+
return {
|
|
5272
|
+
__kind: "matrx-table-view",
|
|
5273
|
+
version: 1,
|
|
5274
|
+
query: {
|
|
5275
|
+
pageSize: query.pageSize,
|
|
5276
|
+
search: query.search,
|
|
5277
|
+
...query.searchMatchMode === void 0 ? {} : { searchMatchMode: query.searchMatchMode },
|
|
5278
|
+
anyOf: query.anyOf,
|
|
5279
|
+
...query.layeredFilters === void 0 ? {} : { layeredFilters: query.layeredFilters },
|
|
5280
|
+
columnFilters: normalizeFilters(query.columnFilters),
|
|
5281
|
+
sort: query.sort
|
|
5282
|
+
},
|
|
5283
|
+
columns: { order: columns.order, hidden: columns.hidden }
|
|
5284
|
+
};
|
|
5285
|
+
}
|
|
5286
|
+
|
|
5258
5287
|
// src/data-table/MatrxUuidCell.tsx
|
|
5259
5288
|
var import_react9 = require("react");
|
|
5260
|
-
var
|
|
5289
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
5261
5290
|
var SHORT_LEN = 8;
|
|
5262
5291
|
function shortUuid(id, len = SHORT_LEN) {
|
|
5263
5292
|
return id.slice(0, len);
|
|
@@ -5307,7 +5336,7 @@ function MatrxUuidCell({
|
|
|
5307
5336
|
[]
|
|
5308
5337
|
);
|
|
5309
5338
|
if (!value) {
|
|
5310
|
-
return /* @__PURE__ */ (0,
|
|
5339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-muted-foreground/40", children: "\u2014" });
|
|
5311
5340
|
}
|
|
5312
5341
|
const doors = token ? resolveEntityDoors?.(token, value, href) ?? null : null;
|
|
5313
5342
|
const resolvedHref = doors?.href ?? href ?? null;
|
|
@@ -5350,13 +5379,13 @@ function MatrxUuidCell({
|
|
|
5350
5379
|
};
|
|
5351
5380
|
const idNode = (() => {
|
|
5352
5381
|
if (forbidden) {
|
|
5353
|
-
return /* @__PURE__ */ (0,
|
|
5354
|
-
/* @__PURE__ */ (0,
|
|
5355
|
-
/* @__PURE__ */ (0,
|
|
5382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "inline-flex min-w-0 items-center gap-1 font-mono text-xs text-muted-foreground/70 tabular-nums", children: [
|
|
5383
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "min-w-0 truncate", children: display }),
|
|
5384
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ShieldOff, { className: "h-3 w-3 shrink-0 opacity-60", "aria-hidden": true })
|
|
5356
5385
|
] });
|
|
5357
5386
|
}
|
|
5358
5387
|
if (onOpen) {
|
|
5359
|
-
return /* @__PURE__ */ (0,
|
|
5388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
5360
5389
|
"button",
|
|
5361
5390
|
{
|
|
5362
5391
|
type: "button",
|
|
@@ -5365,14 +5394,14 @@ function MatrxUuidCell({
|
|
|
5365
5394
|
disabled: opening,
|
|
5366
5395
|
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",
|
|
5367
5396
|
children: [
|
|
5368
|
-
/* @__PURE__ */ (0,
|
|
5369
|
-
/* @__PURE__ */ (0,
|
|
5397
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "min-w-0 truncate tabular-nums", children: display }),
|
|
5398
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(PanelRight, { className: "h-3 w-3 shrink-0 opacity-50" })
|
|
5370
5399
|
]
|
|
5371
5400
|
}
|
|
5372
5401
|
);
|
|
5373
5402
|
}
|
|
5374
5403
|
if (resolvedHref) {
|
|
5375
|
-
return /* @__PURE__ */ (0,
|
|
5404
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
5376
5405
|
"a",
|
|
5377
5406
|
{
|
|
5378
5407
|
href: resolvedHref,
|
|
@@ -5382,15 +5411,15 @@ function MatrxUuidCell({
|
|
|
5382
5411
|
onClick: stop,
|
|
5383
5412
|
className: "inline-flex min-w-0 items-center gap-1 font-mono text-xs text-sky-600 hover:underline dark:text-sky-400",
|
|
5384
5413
|
children: [
|
|
5385
|
-
/* @__PURE__ */ (0,
|
|
5386
|
-
/* @__PURE__ */ (0,
|
|
5414
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "min-w-0 truncate tabular-nums", children: display }),
|
|
5415
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ExternalLink, { className: "h-3 w-3 shrink-0 opacity-50" })
|
|
5387
5416
|
]
|
|
5388
5417
|
}
|
|
5389
5418
|
);
|
|
5390
5419
|
}
|
|
5391
|
-
return /* @__PURE__ */ (0,
|
|
5420
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "min-w-0 truncate font-mono text-xs text-muted-foreground tabular-nums select-all", children: display });
|
|
5392
5421
|
})();
|
|
5393
|
-
return /* @__PURE__ */ (0,
|
|
5422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
5394
5423
|
"span",
|
|
5395
5424
|
{
|
|
5396
5425
|
"data-matrx-cell-control": true,
|
|
@@ -5400,12 +5429,12 @@ function MatrxUuidCell({
|
|
|
5400
5429
|
),
|
|
5401
5430
|
onClick: stop,
|
|
5402
5431
|
children: [
|
|
5403
|
-
/* @__PURE__ */ (0,
|
|
5404
|
-
/* @__PURE__ */ (0,
|
|
5405
|
-
/* @__PURE__ */ (0,
|
|
5432
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Tooltip, { children: [
|
|
5433
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "inline-flex min-w-0 max-w-full items-center", children: idNode }) }),
|
|
5434
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TooltipContent, { side: "top", className: "max-w-sm break-all font-mono", children: forbidden ? `No access \xB7 ${tip}` : tip })
|
|
5406
5435
|
] }),
|
|
5407
|
-
/* @__PURE__ */ (0,
|
|
5408
|
-
/* @__PURE__ */ (0,
|
|
5436
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Tooltip, { children: [
|
|
5437
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5409
5438
|
"button",
|
|
5410
5439
|
{
|
|
5411
5440
|
type: "button",
|
|
@@ -5415,13 +5444,13 @@ function MatrxUuidCell({
|
|
|
5415
5444
|
"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground focus:outline-none",
|
|
5416
5445
|
copied && "text-primary"
|
|
5417
5446
|
),
|
|
5418
|
-
children: copied ? /* @__PURE__ */ (0,
|
|
5447
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Check, { className: "h-3 w-3" }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Copy, { className: "h-3 w-3" })
|
|
5419
5448
|
}
|
|
5420
5449
|
) }),
|
|
5421
|
-
/* @__PURE__ */ (0,
|
|
5450
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TooltipContent, { side: "top", children: copied ? "Copied" : `Copy ${label ?? "id"}: ${value}` })
|
|
5422
5451
|
] }),
|
|
5423
|
-
canPeek ? /* @__PURE__ */ (0,
|
|
5424
|
-
/* @__PURE__ */ (0,
|
|
5452
|
+
canPeek ? /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Tooltip, { children: [
|
|
5453
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5425
5454
|
"button",
|
|
5426
5455
|
{
|
|
5427
5456
|
type: "button",
|
|
@@ -5431,16 +5460,16 @@ function MatrxUuidCell({
|
|
|
5431
5460
|
},
|
|
5432
5461
|
"aria-label": `Quick look at ${label ?? "record"}`,
|
|
5433
5462
|
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",
|
|
5434
|
-
children: /* @__PURE__ */ (0,
|
|
5463
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Lightbulb, { className: "h-3 w-3" })
|
|
5435
5464
|
}
|
|
5436
5465
|
) }),
|
|
5437
|
-
/* @__PURE__ */ (0,
|
|
5466
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(TooltipContent, { side: "top", children: [
|
|
5438
5467
|
"Quick look at ",
|
|
5439
5468
|
label ?? "record"
|
|
5440
5469
|
] })
|
|
5441
5470
|
] }) : null,
|
|
5442
|
-
onOpen && resolvedHref && !forbidden ? /* @__PURE__ */ (0,
|
|
5443
|
-
/* @__PURE__ */ (0,
|
|
5471
|
+
onOpen && resolvedHref && !forbidden ? /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Tooltip, { children: [
|
|
5472
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5444
5473
|
"a",
|
|
5445
5474
|
{
|
|
5446
5475
|
href: resolvedHref,
|
|
@@ -5449,10 +5478,10 @@ function MatrxUuidCell({
|
|
|
5449
5478
|
onClick: stop,
|
|
5450
5479
|
"aria-label": `Open ${label ?? "record"} in a new tab`,
|
|
5451
5480
|
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",
|
|
5452
|
-
children: /* @__PURE__ */ (0,
|
|
5481
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ExternalLink, { className: "h-3 w-3" })
|
|
5453
5482
|
}
|
|
5454
5483
|
) }),
|
|
5455
|
-
/* @__PURE__ */ (0,
|
|
5484
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(TooltipContent, { side: "top", children: [
|
|
5456
5485
|
"Open ",
|
|
5457
5486
|
label ?? "record",
|
|
5458
5487
|
" in a new tab"
|
|
@@ -5460,7 +5489,7 @@ function MatrxUuidCell({
|
|
|
5460
5489
|
] }) : null,
|
|
5461
5490
|
trailing,
|
|
5462
5491
|
notice,
|
|
5463
|
-
canPeek && peekOpen && ResourcePeek ? /* @__PURE__ */ (0,
|
|
5492
|
+
canPeek && peekOpen && ResourcePeek ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5464
5493
|
ResourcePeek,
|
|
5465
5494
|
{
|
|
5466
5495
|
kind: doors?.peekKind ?? token ?? "record",
|
|
@@ -5483,7 +5512,7 @@ function tokenFromColumnName(name) {
|
|
|
5483
5512
|
}
|
|
5484
5513
|
|
|
5485
5514
|
// src/data-table/DataRowInspector.tsx
|
|
5486
|
-
var
|
|
5515
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
5487
5516
|
var noFieldToken = () => null;
|
|
5488
5517
|
function formatValue(value) {
|
|
5489
5518
|
if (value == null) return "\u2014";
|
|
@@ -5512,7 +5541,7 @@ function DataRowInspector({
|
|
|
5512
5541
|
tokenForField = noFieldToken
|
|
5513
5542
|
}) {
|
|
5514
5543
|
const entries = isPlainObject(row) ? Object.entries(row) : [["value", row]];
|
|
5515
|
-
const fieldButtons = (key, value) => fieldCopy ? /* @__PURE__ */ (0,
|
|
5544
|
+
const fieldButtons = (key, value) => fieldCopy ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "absolute right-1 top-1 opacity-0 transition-opacity focus-within:opacity-100 group-hover/field:opacity-100", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5516
5545
|
CopyButtons,
|
|
5517
5546
|
{
|
|
5518
5547
|
size: "xs",
|
|
@@ -5527,21 +5556,21 @@ function DataRowInspector({
|
|
|
5527
5556
|
})
|
|
5528
5557
|
}
|
|
5529
5558
|
) }) : null;
|
|
5530
|
-
return /* @__PURE__ */ (0,
|
|
5559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
5531
5560
|
"div",
|
|
5532
5561
|
{
|
|
5533
5562
|
className: cn("flex h-full min-h-0 flex-col overflow-hidden", className),
|
|
5534
5563
|
children: [
|
|
5535
|
-
title ? /* @__PURE__ */ (0,
|
|
5536
|
-
/* @__PURE__ */ (0,
|
|
5564
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "shrink-0 border-b border-border px-3 py-2 text-sm font-medium", children: title }) : null,
|
|
5565
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "min-h-0 flex-1 overflow-auto p-3", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("dl", { className: "space-y-2", children: entries.map(([key, value]) => {
|
|
5537
5566
|
if (isUuidValue(value)) {
|
|
5538
|
-
return /* @__PURE__ */ (0,
|
|
5567
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
5539
5568
|
"div",
|
|
5540
5569
|
{
|
|
5541
5570
|
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",
|
|
5542
5571
|
children: [
|
|
5543
|
-
/* @__PURE__ */ (0,
|
|
5544
|
-
/* @__PURE__ */ (0,
|
|
5572
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("dt", { className: "truncate text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: key }),
|
|
5573
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("dd", { className: "min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5545
5574
|
MatrxUuidCell,
|
|
5546
5575
|
{
|
|
5547
5576
|
value,
|
|
@@ -5556,13 +5585,13 @@ function DataRowInspector({
|
|
|
5556
5585
|
}
|
|
5557
5586
|
const formatted = formatValue(value);
|
|
5558
5587
|
const multiline = formatted.includes("\n") || formatted.length > 80;
|
|
5559
|
-
return /* @__PURE__ */ (0,
|
|
5588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
5560
5589
|
"div",
|
|
5561
5590
|
{
|
|
5562
5591
|
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",
|
|
5563
5592
|
children: [
|
|
5564
|
-
/* @__PURE__ */ (0,
|
|
5565
|
-
/* @__PURE__ */ (0,
|
|
5593
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("dt", { className: "truncate text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: key }),
|
|
5594
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5566
5595
|
"dd",
|
|
5567
5596
|
{
|
|
5568
5597
|
className: cn(
|
|
@@ -5585,7 +5614,7 @@ function DataRowInspector({
|
|
|
5585
5614
|
|
|
5586
5615
|
// src/data-table/DataRowWindow.tsx
|
|
5587
5616
|
var import_react10 = require("react");
|
|
5588
|
-
var
|
|
5617
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
5589
5618
|
function DataRowWindow({
|
|
5590
5619
|
isOpen,
|
|
5591
5620
|
onClose,
|
|
@@ -5611,9 +5640,9 @@ function DataRowWindow({
|
|
|
5611
5640
|
setTab(defaultTab ?? (hasEdit ? "edit" : "view"));
|
|
5612
5641
|
}, [isOpen, windowId, hasEdit, defaultTab]);
|
|
5613
5642
|
if (!isOpen) return null;
|
|
5614
|
-
const viewBody = viewContent ?? /* @__PURE__ */ (0,
|
|
5615
|
-
const body = children ?? /* @__PURE__ */ (0,
|
|
5616
|
-
return /* @__PURE__ */ (0,
|
|
5643
|
+
const viewBody = viewContent ?? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DataRowInspector, { row });
|
|
5644
|
+
const body = children ?? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex h-full min-h-0 flex-1 flex-col overflow-hidden", children: hasTabs ? tab === "edit" ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "min-h-0 flex-1 overflow-y-auto", children: editContent }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "min-h-0 flex-1 overflow-y-auto", children: viewBody }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "min-h-0 flex-1 overflow-y-auto", children: viewBody }) });
|
|
5645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5617
5646
|
WindowPanel,
|
|
5618
5647
|
{
|
|
5619
5648
|
id: windowId,
|
|
@@ -5627,26 +5656,26 @@ function DataRowWindow({
|
|
|
5627
5656
|
bodyClassName: "flex min-h-0 flex-1 flex-col overflow-hidden p-0",
|
|
5628
5657
|
sidebarDefaultSize: 140,
|
|
5629
5658
|
sidebarMinSize: 110,
|
|
5630
|
-
sidebar: hasTabs ? /* @__PURE__ */ (0,
|
|
5659
|
+
sidebar: hasTabs ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
5631
5660
|
"nav",
|
|
5632
5661
|
{
|
|
5633
5662
|
"aria-label": "Row window tabs",
|
|
5634
5663
|
className: "flex h-full flex-col gap-0.5 overflow-y-auto p-1.5",
|
|
5635
5664
|
children: [
|
|
5636
|
-
/* @__PURE__ */ (0,
|
|
5665
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5637
5666
|
TabButton,
|
|
5638
5667
|
{
|
|
5639
5668
|
active: tab === "view",
|
|
5640
|
-
icon: /* @__PURE__ */ (0,
|
|
5669
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Eye, { className: "h-4 w-4 shrink-0" }),
|
|
5641
5670
|
label: "View",
|
|
5642
5671
|
onClick: () => setTab("view")
|
|
5643
5672
|
}
|
|
5644
5673
|
),
|
|
5645
|
-
/* @__PURE__ */ (0,
|
|
5674
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5646
5675
|
TabButton,
|
|
5647
5676
|
{
|
|
5648
5677
|
active: tab === "edit",
|
|
5649
|
-
icon: /* @__PURE__ */ (0,
|
|
5678
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Pencil, { className: "h-4 w-4 shrink-0" }),
|
|
5650
5679
|
label: "Edit",
|
|
5651
5680
|
onClick: () => setTab("edit")
|
|
5652
5681
|
}
|
|
@@ -5664,7 +5693,7 @@ function TabButton({
|
|
|
5664
5693
|
label,
|
|
5665
5694
|
onClick
|
|
5666
5695
|
}) {
|
|
5667
|
-
return /* @__PURE__ */ (0,
|
|
5696
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
5668
5697
|
"button",
|
|
5669
5698
|
{
|
|
5670
5699
|
type: "button",
|
|
@@ -5677,14 +5706,14 @@ function TabButton({
|
|
|
5677
5706
|
),
|
|
5678
5707
|
children: [
|
|
5679
5708
|
icon,
|
|
5680
|
-
/* @__PURE__ */ (0,
|
|
5709
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "min-w-0 flex-1 truncate", children: label })
|
|
5681
5710
|
]
|
|
5682
5711
|
}
|
|
5683
5712
|
);
|
|
5684
5713
|
}
|
|
5685
5714
|
|
|
5686
5715
|
// src/data-table/DirtySavePill.tsx
|
|
5687
|
-
var
|
|
5716
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
5688
5717
|
function DirtySavePill({
|
|
5689
5718
|
changeCount,
|
|
5690
5719
|
saving,
|
|
@@ -5693,20 +5722,20 @@ function DirtySavePill({
|
|
|
5693
5722
|
className
|
|
5694
5723
|
}) {
|
|
5695
5724
|
if (changeCount <= 0) return null;
|
|
5696
|
-
return /* @__PURE__ */ (0,
|
|
5725
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
5697
5726
|
"div",
|
|
5698
5727
|
{
|
|
5699
5728
|
className: cn(
|
|
5700
5729
|
"pointer-events-none fixed inset-x-0 bottom-6 z-50 flex justify-center pb-safe",
|
|
5701
5730
|
className
|
|
5702
5731
|
),
|
|
5703
|
-
children: /* @__PURE__ */ (0,
|
|
5704
|
-
/* @__PURE__ */ (0,
|
|
5732
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("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: [
|
|
5733
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { className: "px-1 text-xs font-medium text-muted-foreground", children: [
|
|
5705
5734
|
changeCount,
|
|
5706
5735
|
" unsaved change",
|
|
5707
5736
|
changeCount === 1 ? "" : "s"
|
|
5708
5737
|
] }),
|
|
5709
|
-
/* @__PURE__ */ (0,
|
|
5738
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
5710
5739
|
Button,
|
|
5711
5740
|
{
|
|
5712
5741
|
type: "button",
|
|
@@ -5716,12 +5745,12 @@ function DirtySavePill({
|
|
|
5716
5745
|
disabled: saving,
|
|
5717
5746
|
onClick: onCancel,
|
|
5718
5747
|
children: [
|
|
5719
|
-
/* @__PURE__ */ (0,
|
|
5748
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(X, { className: "h-3.5 w-3.5" }),
|
|
5720
5749
|
"Cancel"
|
|
5721
5750
|
]
|
|
5722
5751
|
}
|
|
5723
5752
|
),
|
|
5724
|
-
/* @__PURE__ */ (0,
|
|
5753
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
5725
5754
|
Button,
|
|
5726
5755
|
{
|
|
5727
5756
|
type: "button",
|
|
@@ -5730,7 +5759,7 @@ function DirtySavePill({
|
|
|
5730
5759
|
disabled: saving,
|
|
5731
5760
|
onClick: onSave,
|
|
5732
5761
|
children: [
|
|
5733
|
-
saving ? /* @__PURE__ */ (0,
|
|
5762
|
+
saving ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Loader2, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Save, { className: "h-3.5 w-3.5" }),
|
|
5734
5763
|
"Save"
|
|
5735
5764
|
]
|
|
5736
5765
|
}
|
|
@@ -5742,7 +5771,7 @@ function DirtySavePill({
|
|
|
5742
5771
|
|
|
5743
5772
|
// src/data-table/EditableTableCell.tsx
|
|
5744
5773
|
var import_react11 = require("react");
|
|
5745
|
-
var
|
|
5774
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
5746
5775
|
function CellEditShell({
|
|
5747
5776
|
href,
|
|
5748
5777
|
display,
|
|
@@ -5751,8 +5780,8 @@ function CellEditShell({
|
|
|
5751
5780
|
editButton
|
|
5752
5781
|
}) {
|
|
5753
5782
|
const { Link: HostLink } = useMatrxDataTableHost();
|
|
5754
|
-
const Link = HostLink ?? ((props) => /* @__PURE__ */ (0,
|
|
5755
|
-
return /* @__PURE__ */ (0,
|
|
5783
|
+
const Link = HostLink ?? ((props) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("a", { ...props }));
|
|
5784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
5756
5785
|
"span",
|
|
5757
5786
|
{
|
|
5758
5787
|
className: cn(
|
|
@@ -5764,7 +5793,7 @@ function CellEditShell({
|
|
|
5764
5793
|
className
|
|
5765
5794
|
),
|
|
5766
5795
|
children: [
|
|
5767
|
-
href ? /* @__PURE__ */ (0,
|
|
5796
|
+
href ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5768
5797
|
Link,
|
|
5769
5798
|
{
|
|
5770
5799
|
href,
|
|
@@ -5772,13 +5801,13 @@ function CellEditShell({
|
|
|
5772
5801
|
className: "min-w-0 flex-1 overflow-hidden truncate rounded outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
5773
5802
|
children: display
|
|
5774
5803
|
}
|
|
5775
|
-
) : /* @__PURE__ */ (0,
|
|
5804
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "block min-w-0 flex-1 overflow-hidden", children: display }),
|
|
5776
5805
|
editButton
|
|
5777
5806
|
]
|
|
5778
5807
|
}
|
|
5779
5808
|
);
|
|
5780
5809
|
}
|
|
5781
|
-
var CELL_PENCIL_CLASS = "shrink-0 rounded p-0.5 text-muted-foreground opacity-
|
|
5810
|
+
var CELL_PENCIL_CLASS = "shrink-0 rounded p-0.5 text-muted-foreground opacity-100 transition-opacity hover:bg-muted/60 focus-visible:opacity-100 lg:opacity-0 group-hover/cell-link:opacity-100";
|
|
5782
5811
|
function EditableTableCell({
|
|
5783
5812
|
value,
|
|
5784
5813
|
editType,
|
|
@@ -5793,7 +5822,7 @@ function EditableTableCell({
|
|
|
5793
5822
|
const [open, setOpen] = (0, import_react11.useState)(false);
|
|
5794
5823
|
const usePencil = Boolean(href) || editTrigger === "pencil";
|
|
5795
5824
|
if (editType === "string") {
|
|
5796
|
-
return /* @__PURE__ */ (0,
|
|
5825
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5797
5826
|
InlineStringEditor,
|
|
5798
5827
|
{
|
|
5799
5828
|
value: stringifyCellValue(value),
|
|
@@ -5806,30 +5835,30 @@ function EditableTableCell({
|
|
|
5806
5835
|
}
|
|
5807
5836
|
);
|
|
5808
5837
|
}
|
|
5809
|
-
return /* @__PURE__ */ (0,
|
|
5810
|
-
usePencil ? /* @__PURE__ */ (0,
|
|
5838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Popover, { open, onOpenChange: setOpen, children: [
|
|
5839
|
+
usePencil ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5811
5840
|
CellEditShell,
|
|
5812
5841
|
{
|
|
5813
5842
|
...href === void 0 ? {} : { href },
|
|
5814
5843
|
display,
|
|
5815
5844
|
...dirty === void 0 ? {} : { dirty },
|
|
5816
5845
|
...className === void 0 ? {} : { className },
|
|
5817
|
-
editButton: /* @__PURE__ */ (0,
|
|
5818
|
-
/* @__PURE__ */ (0,
|
|
5846
|
+
editButton: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Tooltip, { children: [
|
|
5847
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5819
5848
|
"button",
|
|
5820
5849
|
{
|
|
5821
5850
|
type: "button",
|
|
5822
5851
|
"aria-label": "Edit",
|
|
5823
5852
|
onClick: (e) => e.stopPropagation(),
|
|
5824
5853
|
className: CELL_PENCIL_CLASS,
|
|
5825
|
-
children: /* @__PURE__ */ (0,
|
|
5854
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Pencil, { className: "h-3 w-3" })
|
|
5826
5855
|
}
|
|
5827
5856
|
) }) }),
|
|
5828
|
-
/* @__PURE__ */ (0,
|
|
5857
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TooltipContent, { children: "Edit" })
|
|
5829
5858
|
] })
|
|
5830
5859
|
}
|
|
5831
|
-
) : /* @__PURE__ */ (0,
|
|
5832
|
-
/* @__PURE__ */ (0,
|
|
5860
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Tooltip, { children: [
|
|
5861
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
5833
5862
|
"button",
|
|
5834
5863
|
{
|
|
5835
5864
|
type: "button",
|
|
@@ -5840,20 +5869,20 @@ function EditableTableCell({
|
|
|
5840
5869
|
className
|
|
5841
5870
|
),
|
|
5842
5871
|
children: [
|
|
5843
|
-
/* @__PURE__ */ (0,
|
|
5844
|
-
editType === "select" ? /* @__PURE__ */ (0,
|
|
5872
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "min-w-0 flex-1 overflow-hidden", children: display }),
|
|
5873
|
+
editType === "select" ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ChevronDown, { className: "h-3 w-3 shrink-0 text-muted-foreground/70 transition-colors group-hover/cell-select:text-foreground" }) : null
|
|
5845
5874
|
]
|
|
5846
5875
|
}
|
|
5847
5876
|
) }) }),
|
|
5848
|
-
/* @__PURE__ */ (0,
|
|
5877
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TooltipContent, { children: "Edit value" })
|
|
5849
5878
|
] }),
|
|
5850
|
-
/* @__PURE__ */ (0,
|
|
5879
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5851
5880
|
PopoverContent,
|
|
5852
5881
|
{
|
|
5853
5882
|
align: "start",
|
|
5854
5883
|
className: "w-56 p-2",
|
|
5855
5884
|
onClick: (e) => e.stopPropagation(),
|
|
5856
|
-
children: /* @__PURE__ */ (0,
|
|
5885
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5857
5886
|
TypedEditor,
|
|
5858
5887
|
{
|
|
5859
5888
|
editType,
|
|
@@ -5883,15 +5912,15 @@ function InlineStringEditor({
|
|
|
5883
5912
|
const [draft, setDraft] = (0, import_react11.useState)(value);
|
|
5884
5913
|
if (!editing) {
|
|
5885
5914
|
if (usePencil) {
|
|
5886
|
-
return /* @__PURE__ */ (0,
|
|
5915
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5887
5916
|
CellEditShell,
|
|
5888
5917
|
{
|
|
5889
5918
|
...href === void 0 ? {} : { href },
|
|
5890
5919
|
display,
|
|
5891
5920
|
...dirty === void 0 ? {} : { dirty },
|
|
5892
5921
|
...className === void 0 ? {} : { className },
|
|
5893
|
-
editButton: /* @__PURE__ */ (0,
|
|
5894
|
-
/* @__PURE__ */ (0,
|
|
5922
|
+
editButton: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Tooltip, { children: [
|
|
5923
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5895
5924
|
"button",
|
|
5896
5925
|
{
|
|
5897
5926
|
type: "button",
|
|
@@ -5902,16 +5931,16 @@ function InlineStringEditor({
|
|
|
5902
5931
|
setEditing(true);
|
|
5903
5932
|
},
|
|
5904
5933
|
className: CELL_PENCIL_CLASS,
|
|
5905
|
-
children: /* @__PURE__ */ (0,
|
|
5934
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Pencil, { className: "h-3 w-3" })
|
|
5906
5935
|
}
|
|
5907
5936
|
) }),
|
|
5908
|
-
/* @__PURE__ */ (0,
|
|
5937
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TooltipContent, { children: "Edit" })
|
|
5909
5938
|
] })
|
|
5910
5939
|
}
|
|
5911
5940
|
);
|
|
5912
5941
|
}
|
|
5913
|
-
return /* @__PURE__ */ (0,
|
|
5914
|
-
/* @__PURE__ */ (0,
|
|
5942
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Tooltip, { children: [
|
|
5943
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5915
5944
|
"button",
|
|
5916
5945
|
{
|
|
5917
5946
|
type: "button",
|
|
@@ -5928,10 +5957,10 @@ function InlineStringEditor({
|
|
|
5928
5957
|
children: display
|
|
5929
5958
|
}
|
|
5930
5959
|
) }),
|
|
5931
|
-
/* @__PURE__ */ (0,
|
|
5960
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TooltipContent, { children: "Click to edit" })
|
|
5932
5961
|
] });
|
|
5933
5962
|
}
|
|
5934
|
-
return /* @__PURE__ */ (0,
|
|
5963
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5935
5964
|
Input,
|
|
5936
5965
|
{
|
|
5937
5966
|
autoFocus: true,
|
|
@@ -5967,9 +5996,9 @@ function TypedEditor({
|
|
|
5967
5996
|
}) {
|
|
5968
5997
|
if (editType === "boolean") {
|
|
5969
5998
|
const checked = Boolean(value);
|
|
5970
|
-
return /* @__PURE__ */ (0,
|
|
5971
|
-
/* @__PURE__ */ (0,
|
|
5972
|
-
/* @__PURE__ */ (0,
|
|
5999
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
6000
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-xs font-medium", children: "Value" }),
|
|
6001
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5973
6002
|
Checkbox,
|
|
5974
6003
|
{
|
|
5975
6004
|
checked,
|
|
@@ -5979,7 +6008,7 @@ function TypedEditor({
|
|
|
5979
6008
|
] });
|
|
5980
6009
|
}
|
|
5981
6010
|
if (editType === "number") {
|
|
5982
|
-
return /* @__PURE__ */ (0,
|
|
6011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5983
6012
|
NumberEditor,
|
|
5984
6013
|
{
|
|
5985
6014
|
value: typeof value === "number" ? value : Number(value) || 0,
|
|
@@ -5989,7 +6018,7 @@ function TypedEditor({
|
|
|
5989
6018
|
);
|
|
5990
6019
|
}
|
|
5991
6020
|
if (editType === "tags") {
|
|
5992
|
-
return /* @__PURE__ */ (0,
|
|
6021
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5993
6022
|
TagsEditor,
|
|
5994
6023
|
{
|
|
5995
6024
|
value: Array.isArray(value) ? value.map(String) : [],
|
|
@@ -6000,19 +6029,19 @@ function TypedEditor({
|
|
|
6000
6029
|
);
|
|
6001
6030
|
}
|
|
6002
6031
|
if (editType === "select") {
|
|
6003
|
-
return /* @__PURE__ */ (0,
|
|
6032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
6004
6033
|
Select,
|
|
6005
6034
|
{
|
|
6006
6035
|
value: stringifyCellValue(value),
|
|
6007
6036
|
onValueChange: (v) => onCommit(v),
|
|
6008
6037
|
children: [
|
|
6009
|
-
/* @__PURE__ */ (0,
|
|
6010
|
-
/* @__PURE__ */ (0,
|
|
6038
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(SelectTrigger, { className: "h-8 text-xs", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(SelectValue, {}) }),
|
|
6039
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(SelectContent, { children: editOptions.map((o) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(SelectItem, { value: o.value, children: o.label }, o.value)) })
|
|
6011
6040
|
]
|
|
6012
6041
|
}
|
|
6013
6042
|
);
|
|
6014
6043
|
}
|
|
6015
|
-
return /* @__PURE__ */ (0,
|
|
6044
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
6016
6045
|
Input,
|
|
6017
6046
|
{
|
|
6018
6047
|
type: "date",
|
|
@@ -6042,11 +6071,11 @@ function TagsEditor({
|
|
|
6042
6071
|
const matches = suggestions.filter(
|
|
6043
6072
|
(s) => !tags.includes(s.value) && s.value !== "__none__" && (!draft || s.label.toLowerCase().includes(draft.trim().toLowerCase()))
|
|
6044
6073
|
).slice(0, 6);
|
|
6045
|
-
return /* @__PURE__ */ (0,
|
|
6046
|
-
/* @__PURE__ */ (0,
|
|
6047
|
-
tags.length === 0 && /* @__PURE__ */ (0,
|
|
6048
|
-
tags.map((tag) => /* @__PURE__ */ (0,
|
|
6049
|
-
/* @__PURE__ */ (0,
|
|
6074
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "space-y-2", onClick: (e) => e.stopPropagation(), children: [
|
|
6075
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex flex-wrap gap-1", children: [
|
|
6076
|
+
tags.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-xs text-muted-foreground", children: "No tags" }),
|
|
6077
|
+
tags.map((tag) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Tooltip, { children: [
|
|
6078
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
6050
6079
|
"button",
|
|
6051
6080
|
{
|
|
6052
6081
|
type: "button",
|
|
@@ -6055,17 +6084,17 @@ function TagsEditor({
|
|
|
6055
6084
|
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",
|
|
6056
6085
|
children: [
|
|
6057
6086
|
tag,
|
|
6058
|
-
/* @__PURE__ */ (0,
|
|
6087
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(X, { className: "h-2.5 w-2.5" })
|
|
6059
6088
|
]
|
|
6060
6089
|
}
|
|
6061
6090
|
) }),
|
|
6062
|
-
/* @__PURE__ */ (0,
|
|
6091
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(TooltipContent, { children: [
|
|
6063
6092
|
"Remove ",
|
|
6064
6093
|
tag
|
|
6065
6094
|
] })
|
|
6066
6095
|
] }, tag))
|
|
6067
6096
|
] }),
|
|
6068
|
-
/* @__PURE__ */ (0,
|
|
6097
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
6069
6098
|
Input,
|
|
6070
6099
|
{
|
|
6071
6100
|
autoFocus: true,
|
|
@@ -6086,7 +6115,7 @@ function TagsEditor({
|
|
|
6086
6115
|
className: "h-8 text-xs"
|
|
6087
6116
|
}
|
|
6088
6117
|
),
|
|
6089
|
-
matches.length > 0 && /* @__PURE__ */ (0,
|
|
6118
|
+
matches.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "flex flex-wrap gap-1", children: matches.map((s) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
6090
6119
|
"button",
|
|
6091
6120
|
{
|
|
6092
6121
|
type: "button",
|
|
@@ -6099,8 +6128,8 @@ function TagsEditor({
|
|
|
6099
6128
|
},
|
|
6100
6129
|
s.value
|
|
6101
6130
|
)) }),
|
|
6102
|
-
/* @__PURE__ */ (0,
|
|
6103
|
-
/* @__PURE__ */ (0,
|
|
6131
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex justify-end gap-1 pt-1", children: [
|
|
6132
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
6104
6133
|
Button,
|
|
6105
6134
|
{
|
|
6106
6135
|
size: "sm",
|
|
@@ -6108,17 +6137,17 @@ function TagsEditor({
|
|
|
6108
6137
|
className: "h-7 px-2",
|
|
6109
6138
|
"aria-label": "Cancel edit",
|
|
6110
6139
|
onClick: onCancel,
|
|
6111
|
-
children: /* @__PURE__ */ (0,
|
|
6140
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(X, { className: "h-3.5 w-3.5" })
|
|
6112
6141
|
}
|
|
6113
6142
|
),
|
|
6114
|
-
/* @__PURE__ */ (0,
|
|
6143
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
6115
6144
|
Button,
|
|
6116
6145
|
{
|
|
6117
6146
|
size: "sm",
|
|
6118
6147
|
className: "h-7 px-2",
|
|
6119
6148
|
"aria-label": "Apply tags",
|
|
6120
6149
|
onClick: () => onCommit(tags),
|
|
6121
|
-
children: /* @__PURE__ */ (0,
|
|
6150
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Check, { className: "h-3.5 w-3.5" })
|
|
6122
6151
|
}
|
|
6123
6152
|
)
|
|
6124
6153
|
] })
|
|
@@ -6130,8 +6159,8 @@ function NumberEditor({
|
|
|
6130
6159
|
onCancel
|
|
6131
6160
|
}) {
|
|
6132
6161
|
const [draft, setDraft] = (0, import_react11.useState)(String(value));
|
|
6133
|
-
return /* @__PURE__ */ (0,
|
|
6134
|
-
/* @__PURE__ */ (0,
|
|
6162
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
6163
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
6135
6164
|
Input,
|
|
6136
6165
|
{
|
|
6137
6166
|
autoFocus: true,
|
|
@@ -6148,8 +6177,8 @@ function NumberEditor({
|
|
|
6148
6177
|
}
|
|
6149
6178
|
}
|
|
6150
6179
|
),
|
|
6151
|
-
/* @__PURE__ */ (0,
|
|
6152
|
-
/* @__PURE__ */ (0,
|
|
6180
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex justify-end gap-1", children: [
|
|
6181
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
6153
6182
|
Button,
|
|
6154
6183
|
{
|
|
6155
6184
|
type: "button",
|
|
@@ -6158,10 +6187,10 @@ function NumberEditor({
|
|
|
6158
6187
|
className: "h-7",
|
|
6159
6188
|
"aria-label": "Cancel edit",
|
|
6160
6189
|
onClick: onCancel,
|
|
6161
|
-
children: /* @__PURE__ */ (0,
|
|
6190
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(X, { className: "h-3.5 w-3.5" })
|
|
6162
6191
|
}
|
|
6163
6192
|
),
|
|
6164
|
-
/* @__PURE__ */ (0,
|
|
6193
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
6165
6194
|
Button,
|
|
6166
6195
|
{
|
|
6167
6196
|
type: "button",
|
|
@@ -6172,7 +6201,7 @@ function NumberEditor({
|
|
|
6172
6201
|
const n = Number(draft);
|
|
6173
6202
|
if (Number.isFinite(n)) onCommit(n);
|
|
6174
6203
|
},
|
|
6175
|
-
children: /* @__PURE__ */ (0,
|
|
6204
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Check, { className: "h-3.5 w-3.5" })
|
|
6176
6205
|
}
|
|
6177
6206
|
)
|
|
6178
6207
|
] })
|
|
@@ -6180,24 +6209,24 @@ function NumberEditor({
|
|
|
6180
6209
|
}
|
|
6181
6210
|
|
|
6182
6211
|
// src/data-table/ToolbarFacets.tsx
|
|
6183
|
-
var
|
|
6212
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
6184
6213
|
function ToolbarFacets({ facets }) {
|
|
6185
6214
|
if (facets.length === 0) return null;
|
|
6186
|
-
return /* @__PURE__ */ (0,
|
|
6215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex flex-wrap items-center gap-2", children: facets.map((facet) => {
|
|
6187
6216
|
if (facet.type === "custom") {
|
|
6188
|
-
return /* @__PURE__ */ (0,
|
|
6217
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { children: facet.render() }, facet.id);
|
|
6189
6218
|
}
|
|
6190
6219
|
const defaultValue = facet.defaultValue ?? facet.options[0]?.value ?? "";
|
|
6191
6220
|
const isNonDefault = facet.value !== defaultValue;
|
|
6192
|
-
return /* @__PURE__ */ (0,
|
|
6221
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
6193
6222
|
"div",
|
|
6194
6223
|
{
|
|
6195
6224
|
className: "flex flex-wrap items-center gap-1.5 max-sm:grid max-sm:w-full max-sm:grid-cols-3",
|
|
6196
6225
|
children: [
|
|
6197
|
-
facet.label ? /* @__PURE__ */ (0,
|
|
6226
|
+
facet.label ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "mr-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: facet.label }) : null,
|
|
6198
6227
|
facet.options.map((opt) => {
|
|
6199
6228
|
const active = facet.value === opt.value;
|
|
6200
|
-
return /* @__PURE__ */ (0,
|
|
6229
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
6201
6230
|
Button,
|
|
6202
6231
|
{
|
|
6203
6232
|
type: "button",
|
|
@@ -6211,8 +6240,8 @@ function ToolbarFacets({ facets }) {
|
|
|
6211
6240
|
children: [
|
|
6212
6241
|
opt.icon,
|
|
6213
6242
|
opt.label,
|
|
6214
|
-
active && isNonDefault ? /* @__PURE__ */ (0,
|
|
6215
|
-
/* @__PURE__ */ (0,
|
|
6243
|
+
active && isNonDefault ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Tooltip, { children: [
|
|
6244
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
6216
6245
|
"span",
|
|
6217
6246
|
{
|
|
6218
6247
|
role: "button",
|
|
@@ -6230,10 +6259,10 @@ function ToolbarFacets({ facets }) {
|
|
|
6230
6259
|
facet.onChange(defaultValue);
|
|
6231
6260
|
}
|
|
6232
6261
|
},
|
|
6233
|
-
children: /* @__PURE__ */ (0,
|
|
6262
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(X, { className: "h-3 w-3" })
|
|
6234
6263
|
}
|
|
6235
6264
|
) }),
|
|
6236
|
-
/* @__PURE__ */ (0,
|
|
6265
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TooltipContent, { side: "top", children: "Clear this filter" })
|
|
6237
6266
|
] }) }) : null
|
|
6238
6267
|
]
|
|
6239
6268
|
},
|
|
@@ -6257,7 +6286,7 @@ function resetToolbarFacets(facets) {
|
|
|
6257
6286
|
|
|
6258
6287
|
// src/data-table/LayeredFilterBuilder.tsx
|
|
6259
6288
|
var import_react12 = require("react");
|
|
6260
|
-
var
|
|
6289
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
6261
6290
|
function moveRule(rules, from, to) {
|
|
6262
6291
|
if (from === to || to < 0 || to >= rules.length) return [...rules];
|
|
6263
6292
|
const next = [...rules];
|
|
@@ -6303,8 +6332,8 @@ function LayeredFilterBuilder({
|
|
|
6303
6332
|
const reorder = (from, to) => {
|
|
6304
6333
|
onChange(moveRule(rules, from, to));
|
|
6305
6334
|
};
|
|
6306
|
-
return /* @__PURE__ */ (0,
|
|
6307
|
-
/* @__PURE__ */ (0,
|
|
6335
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex min-w-0 flex-wrap items-center gap-1", children: [
|
|
6336
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
6308
6337
|
Popover,
|
|
6309
6338
|
{
|
|
6310
6339
|
open,
|
|
@@ -6316,7 +6345,7 @@ function LayeredFilterBuilder({
|
|
|
6316
6345
|
}
|
|
6317
6346
|
},
|
|
6318
6347
|
children: [
|
|
6319
|
-
/* @__PURE__ */ (0,
|
|
6348
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
6320
6349
|
Button,
|
|
6321
6350
|
{
|
|
6322
6351
|
type: "button",
|
|
@@ -6325,25 +6354,25 @@ function LayeredFilterBuilder({
|
|
|
6325
6354
|
className: "h-8 gap-1.5 px-2 text-xs",
|
|
6326
6355
|
"aria-label": label,
|
|
6327
6356
|
children: [
|
|
6328
|
-
/* @__PURE__ */ (0,
|
|
6329
|
-
/* @__PURE__ */ (0,
|
|
6330
|
-
rules.length > 0 ? /* @__PURE__ */ (0,
|
|
6357
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SlidersHorizontal, { className: "h-3.5 w-3.5" }),
|
|
6358
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "hidden sm:inline", children: rules.length > 0 ? `${rules.length} layers` : "Advanced" }),
|
|
6359
|
+
rules.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "sm:hidden", children: rules.length }) : null
|
|
6331
6360
|
]
|
|
6332
6361
|
}
|
|
6333
6362
|
) }),
|
|
6334
|
-
/* @__PURE__ */ (0,
|
|
6363
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
6335
6364
|
PopoverContent,
|
|
6336
6365
|
{
|
|
6337
6366
|
align: "start",
|
|
6338
6367
|
sideOffset: 6,
|
|
6339
6368
|
className: "w-[min(46rem,calc(100vw-1rem))] p-0",
|
|
6340
6369
|
children: [
|
|
6341
|
-
/* @__PURE__ */ (0,
|
|
6342
|
-
/* @__PURE__ */ (0,
|
|
6343
|
-
/* @__PURE__ */ (0,
|
|
6344
|
-
/* @__PURE__ */ (0,
|
|
6370
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-start justify-between gap-3 border-b border-border px-3 py-2.5", children: [
|
|
6371
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { children: [
|
|
6372
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-sm font-semibold text-foreground", children: "Narrow these results" }),
|
|
6373
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("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." })
|
|
6345
6374
|
] }),
|
|
6346
|
-
rules.length > 0 ? /* @__PURE__ */ (0,
|
|
6375
|
+
rules.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
6347
6376
|
Button,
|
|
6348
6377
|
{
|
|
6349
6378
|
type: "button",
|
|
@@ -6355,10 +6384,10 @@ function LayeredFilterBuilder({
|
|
|
6355
6384
|
}
|
|
6356
6385
|
) : null
|
|
6357
6386
|
] }),
|
|
6358
|
-
/* @__PURE__ */ (0,
|
|
6359
|
-
/* @__PURE__ */ (0,
|
|
6360
|
-
/* @__PURE__ */ (0,
|
|
6361
|
-
] }) : rules.map((rule, index) => /* @__PURE__ */ (0,
|
|
6387
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "max-h-[min(28rem,65dvh)] space-y-1.5 overflow-y-auto p-2.5 scrollbar-thin", children: rules.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "rounded-md border border-dashed border-border px-3 py-5 text-center", children: [
|
|
6388
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-sm font-medium text-foreground", children: "Start with one simple layer" }),
|
|
6389
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "mt-1 text-xs text-muted-foreground", children: "For example: Keyword contains ITAD, then Keyword doesn't have the word \u201Cwhat\u201D." })
|
|
6390
|
+
] }) : rules.map((rule, index) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
6362
6391
|
LayeredRuleRow,
|
|
6363
6392
|
{
|
|
6364
6393
|
index,
|
|
@@ -6378,9 +6407,9 @@ function LayeredFilterBuilder({
|
|
|
6378
6407
|
},
|
|
6379
6408
|
rule.id
|
|
6380
6409
|
)) }),
|
|
6381
|
-
/* @__PURE__ */ (0,
|
|
6382
|
-
/* @__PURE__ */ (0,
|
|
6383
|
-
/* @__PURE__ */ (0,
|
|
6410
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center justify-between gap-2 border-t border-border px-3 py-2", children: [
|
|
6411
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-[11px] text-muted-foreground", children: "The regular search still works and is applied before these layers." }),
|
|
6412
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
6384
6413
|
Button,
|
|
6385
6414
|
{
|
|
6386
6415
|
type: "button",
|
|
@@ -6390,7 +6419,7 @@ function LayeredFilterBuilder({
|
|
|
6390
6419
|
disabled: rules.length >= maxRules,
|
|
6391
6420
|
onClick: addRule,
|
|
6392
6421
|
children: [
|
|
6393
|
-
/* @__PURE__ */ (0,
|
|
6422
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Plus, { className: "h-3.5 w-3.5" }),
|
|
6394
6423
|
" Add layer"
|
|
6395
6424
|
]
|
|
6396
6425
|
}
|
|
@@ -6402,7 +6431,7 @@ function LayeredFilterBuilder({
|
|
|
6402
6431
|
]
|
|
6403
6432
|
}
|
|
6404
6433
|
),
|
|
6405
|
-
rules.map((rule, index) => /* @__PURE__ */ (0,
|
|
6434
|
+
rules.map((rule, index) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
6406
6435
|
"span",
|
|
6407
6436
|
{
|
|
6408
6437
|
className: cn(
|
|
@@ -6410,7 +6439,7 @@ function LayeredFilterBuilder({
|
|
|
6410
6439
|
isCompleteLayeredFilterRule(rule) ? "border-border bg-muted/50 text-foreground" : "border-dashed border-warning/50 bg-warning/10 text-warning"
|
|
6411
6440
|
),
|
|
6412
6441
|
children: [
|
|
6413
|
-
/* @__PURE__ */ (0,
|
|
6442
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
6414
6443
|
"button",
|
|
6415
6444
|
{
|
|
6416
6445
|
type: "button",
|
|
@@ -6418,19 +6447,19 @@ function LayeredFilterBuilder({
|
|
|
6418
6447
|
onClick: () => setOpen(true),
|
|
6419
6448
|
title: isCompleteLayeredFilterRule(rule) ? layeredFilterRuleSummary(rule, fields) : `Layer ${index + 1} needs a value`,
|
|
6420
6449
|
children: [
|
|
6421
|
-
/* @__PURE__ */ (0,
|
|
6450
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "mr-1 text-muted-foreground", children: index + 1 }),
|
|
6422
6451
|
isCompleteLayeredFilterRule(rule) ? layeredFilterRuleSummary(rule, fields) : "Choose a value"
|
|
6423
6452
|
]
|
|
6424
6453
|
}
|
|
6425
6454
|
),
|
|
6426
|
-
/* @__PURE__ */ (0,
|
|
6455
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
6427
6456
|
"button",
|
|
6428
6457
|
{
|
|
6429
6458
|
type: "button",
|
|
6430
6459
|
className: "shrink-0 rounded-full p-0.5 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
6431
6460
|
"aria-label": `Remove filter layer ${index + 1}`,
|
|
6432
6461
|
onClick: () => removeRule(index),
|
|
6433
|
-
children: /* @__PURE__ */ (0,
|
|
6462
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(X, { className: "h-3 w-3" })
|
|
6434
6463
|
}
|
|
6435
6464
|
)
|
|
6436
6465
|
]
|
|
@@ -6460,7 +6489,7 @@ function LayeredRuleRow({
|
|
|
6460
6489
|
event.preventDefault();
|
|
6461
6490
|
onKeyboardMove(event.key === "ArrowUp" ? -1 : 1);
|
|
6462
6491
|
};
|
|
6463
|
-
return /* @__PURE__ */ (0,
|
|
6492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
6464
6493
|
"div",
|
|
6465
6494
|
{
|
|
6466
6495
|
className: cn(
|
|
@@ -6473,7 +6502,7 @@ function LayeredRuleRow({
|
|
|
6473
6502
|
onDrop(index);
|
|
6474
6503
|
},
|
|
6475
6504
|
children: [
|
|
6476
|
-
/* @__PURE__ */ (0,
|
|
6505
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
6477
6506
|
"button",
|
|
6478
6507
|
{
|
|
6479
6508
|
type: "button",
|
|
@@ -6487,10 +6516,10 @@ function LayeredRuleRow({
|
|
|
6487
6516
|
},
|
|
6488
6517
|
onDragEnd,
|
|
6489
6518
|
onKeyDown: handleMoveKey,
|
|
6490
|
-
children: /* @__PURE__ */ (0,
|
|
6519
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GripVertical, { className: "h-3.5 w-3.5" })
|
|
6491
6520
|
}
|
|
6492
6521
|
),
|
|
6493
|
-
/* @__PURE__ */ (0,
|
|
6522
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
6494
6523
|
Select,
|
|
6495
6524
|
{
|
|
6496
6525
|
value: field.id,
|
|
@@ -6508,16 +6537,16 @@ function LayeredRuleRow({
|
|
|
6508
6537
|
});
|
|
6509
6538
|
},
|
|
6510
6539
|
children: [
|
|
6511
|
-
/* @__PURE__ */ (0,
|
|
6540
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
6512
6541
|
SelectTrigger,
|
|
6513
6542
|
{
|
|
6514
6543
|
size: "sm",
|
|
6515
6544
|
className: "h-7 w-full text-xs max-sm:col-span-1",
|
|
6516
6545
|
"aria-label": `Filter layer ${index + 1} field`,
|
|
6517
|
-
children: /* @__PURE__ */ (0,
|
|
6546
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SelectValue, {})
|
|
6518
6547
|
}
|
|
6519
6548
|
),
|
|
6520
|
-
/* @__PURE__ */ (0,
|
|
6549
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SelectContent, { children: fields.map((candidate) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
6521
6550
|
SelectItem,
|
|
6522
6551
|
{
|
|
6523
6552
|
value: candidate.id,
|
|
@@ -6529,7 +6558,7 @@ function LayeredRuleRow({
|
|
|
6529
6558
|
]
|
|
6530
6559
|
}
|
|
6531
6560
|
),
|
|
6532
|
-
/* @__PURE__ */ (0,
|
|
6561
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
6533
6562
|
Select,
|
|
6534
6563
|
{
|
|
6535
6564
|
value: rule.operator,
|
|
@@ -6541,35 +6570,35 @@ function LayeredRuleRow({
|
|
|
6541
6570
|
});
|
|
6542
6571
|
},
|
|
6543
6572
|
children: [
|
|
6544
|
-
/* @__PURE__ */ (0,
|
|
6573
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
6545
6574
|
SelectTrigger,
|
|
6546
6575
|
{
|
|
6547
6576
|
size: "sm",
|
|
6548
6577
|
className: "h-7 w-full text-xs max-sm:col-start-2",
|
|
6549
6578
|
"aria-label": `Filter layer ${index + 1} operator`,
|
|
6550
|
-
children: /* @__PURE__ */ (0,
|
|
6579
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SelectValue, {})
|
|
6551
6580
|
}
|
|
6552
6581
|
),
|
|
6553
|
-
/* @__PURE__ */ (0,
|
|
6582
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SelectContent, { children: operators.map((operator) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SelectItem, { value: operator, className: "text-xs", children: LAYERED_FILTER_OPERATOR_LABELS[operator] }, operator)) })
|
|
6554
6583
|
]
|
|
6555
6584
|
}
|
|
6556
6585
|
),
|
|
6557
|
-
/* @__PURE__ */ (0,
|
|
6586
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "min-w-0 max-sm:col-span-3 max-sm:col-start-1", children: !needsValue ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "flex h-7 items-center px-2 text-xs text-muted-foreground", children: "No value needed" }) : field.kind === "select" ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
6558
6587
|
Select,
|
|
6559
6588
|
{
|
|
6560
6589
|
value: rule.value,
|
|
6561
6590
|
onValueChange: (value) => onChange({ value }),
|
|
6562
6591
|
children: [
|
|
6563
|
-
/* @__PURE__ */ (0,
|
|
6592
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
6564
6593
|
SelectTrigger,
|
|
6565
6594
|
{
|
|
6566
6595
|
size: "sm",
|
|
6567
6596
|
className: "h-7 w-full text-xs",
|
|
6568
6597
|
"aria-label": `Filter layer ${index + 1} value`,
|
|
6569
|
-
children: /* @__PURE__ */ (0,
|
|
6598
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SelectValue, {})
|
|
6570
6599
|
}
|
|
6571
6600
|
),
|
|
6572
|
-
/* @__PURE__ */ (0,
|
|
6601
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SelectContent, { children: field.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
6573
6602
|
SelectItem,
|
|
6574
6603
|
{
|
|
6575
6604
|
value: option.value,
|
|
@@ -6580,8 +6609,8 @@ function LayeredRuleRow({
|
|
|
6580
6609
|
)) })
|
|
6581
6610
|
]
|
|
6582
6611
|
}
|
|
6583
|
-
) : /* @__PURE__ */ (0,
|
|
6584
|
-
/* @__PURE__ */ (0,
|
|
6612
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
6613
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
6585
6614
|
Input,
|
|
6586
6615
|
{
|
|
6587
6616
|
value: rule.value,
|
|
@@ -6592,9 +6621,9 @@ function LayeredRuleRow({
|
|
|
6592
6621
|
"aria-label": `Filter layer ${index + 1} value`
|
|
6593
6622
|
}
|
|
6594
6623
|
),
|
|
6595
|
-
rule.operator === "between" ? /* @__PURE__ */ (0,
|
|
6596
|
-
/* @__PURE__ */ (0,
|
|
6597
|
-
/* @__PURE__ */ (0,
|
|
6624
|
+
rule.operator === "between" ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
6625
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-[11px] text-muted-foreground", children: "and" }),
|
|
6626
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
6598
6627
|
Input,
|
|
6599
6628
|
{
|
|
6600
6629
|
value: rule.valueTo ?? "",
|
|
@@ -6607,7 +6636,7 @@ function LayeredRuleRow({
|
|
|
6607
6636
|
)
|
|
6608
6637
|
] }) : null
|
|
6609
6638
|
] }) }),
|
|
6610
|
-
/* @__PURE__ */ (0,
|
|
6639
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
6611
6640
|
Button,
|
|
6612
6641
|
{
|
|
6613
6642
|
type: "button",
|
|
@@ -6616,7 +6645,7 @@ function LayeredRuleRow({
|
|
|
6616
6645
|
className: "h-7 w-7 p-0 text-muted-foreground hover:text-destructive max-sm:col-start-3 max-sm:row-start-1",
|
|
6617
6646
|
"aria-label": `Remove filter layer ${index + 1}`,
|
|
6618
6647
|
onClick: onRemove,
|
|
6619
|
-
children: /* @__PURE__ */ (0,
|
|
6648
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Trash2, { className: "h-3.5 w-3.5" })
|
|
6620
6649
|
}
|
|
6621
6650
|
)
|
|
6622
6651
|
]
|
|
@@ -6715,7 +6744,7 @@ function safeQueryPage(requestedPage, totalItems, pageSize) {
|
|
|
6715
6744
|
}
|
|
6716
6745
|
|
|
6717
6746
|
// src/data-table/MatrxDataTable.tsx
|
|
6718
|
-
var
|
|
6747
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
6719
6748
|
function hasSameRowReferences(previous, next) {
|
|
6720
6749
|
return previous.length === next.length && previous.every((row, index) => row === next[index]);
|
|
6721
6750
|
}
|
|
@@ -6726,7 +6755,7 @@ function TableRowCopyControl({
|
|
|
6726
6755
|
sourceId,
|
|
6727
6756
|
defaultColumns
|
|
6728
6757
|
}) {
|
|
6729
|
-
return /* @__PURE__ */ (0,
|
|
6758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6730
6759
|
CopyButtons,
|
|
6731
6760
|
{
|
|
6732
6761
|
size,
|
|
@@ -6748,8 +6777,8 @@ function isStringArray(value) {
|
|
|
6748
6777
|
}
|
|
6749
6778
|
var activeUrlTableIds = /* @__PURE__ */ new Set();
|
|
6750
6779
|
function MatrxDataTable(props) {
|
|
6751
|
-
if (!props.urlState) return /* @__PURE__ */ (0,
|
|
6752
|
-
return /* @__PURE__ */ (0,
|
|
6780
|
+
if (!props.urlState) return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(MatrxDataTableCore, { ...props });
|
|
6781
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(MatrxDataTableWithUrlState, { ...props, urlState: props.urlState });
|
|
6753
6782
|
}
|
|
6754
6783
|
function MatrxDataTableWithUrlState({
|
|
6755
6784
|
urlState,
|
|
@@ -6804,7 +6833,7 @@ function MatrxDataTableWithUrlState({
|
|
|
6804
6833
|
props.selection?.onSelectedIdsChange(ids);
|
|
6805
6834
|
}
|
|
6806
6835
|
} : props.selection;
|
|
6807
|
-
return /* @__PURE__ */ (0,
|
|
6836
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6808
6837
|
MatrxDataTableCore,
|
|
6809
6838
|
{
|
|
6810
6839
|
...props,
|
|
@@ -6840,8 +6869,10 @@ var COLUMN_REORDER_ACTIVATION_DISTANCE = 6;
|
|
|
6840
6869
|
function MatrxDataTableCore({
|
|
6841
6870
|
data: suppliedData,
|
|
6842
6871
|
columns,
|
|
6872
|
+
tableId,
|
|
6873
|
+
defaultViewSnapshot,
|
|
6843
6874
|
columnState,
|
|
6844
|
-
reorderableColumns =
|
|
6875
|
+
reorderableColumns = true,
|
|
6845
6876
|
columnManager: controlledColumnManager,
|
|
6846
6877
|
getRowId,
|
|
6847
6878
|
searchText,
|
|
@@ -6889,9 +6920,14 @@ function MatrxDataTableCore({
|
|
|
6889
6920
|
const isLoading = appendQuery ? appendQuery.pagination.loading : suppliedLoading;
|
|
6890
6921
|
const isFetching = appendQuery ? appendQuery.pagination.isFetchingNextPage : suppliedFetching;
|
|
6891
6922
|
const host = useMatrxDataTableHost();
|
|
6923
|
+
const SavedViews = host.SavedViews;
|
|
6892
6924
|
const Link = host.Link ?? DefaultTableLink;
|
|
6893
6925
|
const SidePanelSurface = host.SidePanelSurface ?? DefaultTableSidePanel;
|
|
6894
6926
|
const { notify: toast, notice } = useTableNotice();
|
|
6927
|
+
const [savedViewError, setSavedViewError] = (0, import_react13.useState)(null);
|
|
6928
|
+
const [toolbarActionError, setToolbarActionError] = (0, import_react13.useState)(null);
|
|
6929
|
+
const [toolbarActionPending, setToolbarActionPending] = (0, import_react13.useState)({ refresh: false, add: false });
|
|
6930
|
+
const toolbarActionPendingRef = (0, import_react13.useRef)({ refresh: false, add: false });
|
|
6895
6931
|
const CHECKBOX_TAP_AREA = "relative max-lg:before:absolute max-lg:before:left-1/2 max-lg:before:top-1/2 max-lg:before:h-11 max-lg:before:w-11 max-lg:before:-translate-x-1/2 max-lg:before:-translate-y-1/2 max-lg:before:content-['']";
|
|
6896
6932
|
const mobileCardsClass = mobileCardsBreakpoint === "lg" ? "lg:hidden" : "sm:hidden";
|
|
6897
6933
|
const tableWithCardsClass = mobileCardsBreakpoint === "lg" ? "max-lg:hidden" : "max-sm:hidden";
|
|
@@ -7162,11 +7198,12 @@ function MatrxDataTableCore({
|
|
|
7162
7198
|
const [hiddenColumnIds, setHiddenColumnIds] = (0, import_react13.useState)(
|
|
7163
7199
|
() => new Set(columnState?.hidden ?? columns.filter((column) => column.hidden).map(columnId))
|
|
7164
7200
|
);
|
|
7201
|
+
const knownColumnIds = (0, import_react13.useRef)(new Set(columns.map(columnId)));
|
|
7165
7202
|
const draggedColumnId = (0, import_react13.useRef)(null);
|
|
7166
7203
|
const columnDragActive = (0, import_react13.useRef)(false);
|
|
7167
7204
|
const columnDragRaf = (0, import_react13.useRef)(null);
|
|
7168
7205
|
const columnDragScrollDirection = (0, import_react13.useRef)(0);
|
|
7169
|
-
const [
|
|
7206
|
+
const [columnDragPreview, setColumnDragPreview] = (0, import_react13.useState)(null);
|
|
7170
7207
|
const stopColumnDragScroll = (0, import_react13.useCallback)(() => {
|
|
7171
7208
|
if (columnDragRaf.current !== null) cancelAnimationFrame(columnDragRaf.current);
|
|
7172
7209
|
columnDragRaf.current = null;
|
|
@@ -7219,6 +7256,7 @@ function MatrxDataTableCore({
|
|
|
7219
7256
|
(0, import_react13.useEffect)(() => {
|
|
7220
7257
|
const ids = columns.map(columnId);
|
|
7221
7258
|
if (columnState) return;
|
|
7259
|
+
const previousIds = knownColumnIds.current;
|
|
7222
7260
|
setColumnOrder((current) => [
|
|
7223
7261
|
...current.filter((id) => ids.includes(id)),
|
|
7224
7262
|
...ids.filter((id) => !current.includes(id))
|
|
@@ -7226,17 +7264,23 @@ function MatrxDataTableCore({
|
|
|
7226
7264
|
setHiddenColumnIds((current) => {
|
|
7227
7265
|
const next = new Set([...current].filter((id) => ids.includes(id)));
|
|
7228
7266
|
for (const column of columns) {
|
|
7229
|
-
|
|
7267
|
+
const id = columnId(column);
|
|
7268
|
+
if (column.hidden && !previousIds.has(id)) next.add(id);
|
|
7230
7269
|
}
|
|
7231
7270
|
return next;
|
|
7232
7271
|
});
|
|
7272
|
+
knownColumnIds.current = new Set(ids);
|
|
7233
7273
|
}, [columns, columnState]);
|
|
7274
|
+
const previewColumnOrder = (0, import_react13.useMemo)(
|
|
7275
|
+
() => projectColumnDragOrder(effectiveColumnOrder, columnDragPreview),
|
|
7276
|
+
[columnDragPreview, effectiveColumnOrder]
|
|
7277
|
+
);
|
|
7234
7278
|
const visibleColumns = (0, import_react13.useMemo)(() => {
|
|
7235
7279
|
const byId = new Map(columns.map((column) => [columnId(column), column]));
|
|
7236
|
-
return
|
|
7280
|
+
return previewColumnOrder.map((id) => byId.get(id)).filter(
|
|
7237
7281
|
(column) => column !== void 0 && !effectiveHiddenColumnIds.has(columnId(column))
|
|
7238
7282
|
);
|
|
7239
|
-
}, [columns,
|
|
7283
|
+
}, [columns, effectiveHiddenColumnIds, previewColumnOrder]);
|
|
7240
7284
|
const declaredVisibleCopyColumns = (0, import_react13.useMemo)(
|
|
7241
7285
|
() => visibleColumns.filter((column) => column.accessorFn !== void 0 || column.accessorKey !== void 0),
|
|
7242
7286
|
[visibleColumns]
|
|
@@ -7773,7 +7817,121 @@ function MatrxDataTableCore({
|
|
|
7773
7817
|
}
|
|
7774
7818
|
} : facet
|
|
7775
7819
|
) : toolbar?.facets;
|
|
7776
|
-
|
|
7820
|
+
const renderRecordCell = (row, col, index) => {
|
|
7821
|
+
const id = getRowId(row);
|
|
7822
|
+
const field = col.accessorKey ? String(col.accessorKey) : columnId(col);
|
|
7823
|
+
const rowEdits = edits[id];
|
|
7824
|
+
const display = renderCell(applyRowEdits(row, rowEdits), col, index);
|
|
7825
|
+
const href = col.href?.(row) ?? void 0;
|
|
7826
|
+
if (editEnabled && col.editable && (col.editableIf?.(row) ?? true)) {
|
|
7827
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
7828
|
+
EditableTableCell,
|
|
7829
|
+
{
|
|
7830
|
+
value: rowEdits && field in rowEdits ? rowEdits[field] : getCellValue(row, col),
|
|
7831
|
+
editType: col.editable,
|
|
7832
|
+
...col.editOptions === void 0 ? {} : { editOptions: col.editOptions },
|
|
7833
|
+
display,
|
|
7834
|
+
dirty: Boolean(rowEdits && field in rowEdits),
|
|
7835
|
+
onCommit: (next) => commitCell(id, field, next),
|
|
7836
|
+
...href === void 0 ? {} : { href },
|
|
7837
|
+
...col.editTrigger === void 0 ? {} : { editTrigger: col.editTrigger }
|
|
7838
|
+
}
|
|
7839
|
+
);
|
|
7840
|
+
}
|
|
7841
|
+
return href ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(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;
|
|
7842
|
+
};
|
|
7843
|
+
const currentViewSnapshot = (0, import_react13.useMemo)(
|
|
7844
|
+
() => ({
|
|
7845
|
+
__kind: "matrx-table-view",
|
|
7846
|
+
version: 1,
|
|
7847
|
+
query: {
|
|
7848
|
+
pageSize,
|
|
7849
|
+
search: searchValue,
|
|
7850
|
+
...searchMatchMode === "contains" ? {} : { searchMatchMode },
|
|
7851
|
+
anyOf: anyOfValue,
|
|
7852
|
+
...layeredFilters.length ? { layeredFilters } : {},
|
|
7853
|
+
columnFilters,
|
|
7854
|
+
sort
|
|
7855
|
+
},
|
|
7856
|
+
columns: {
|
|
7857
|
+
order: effectiveColumnOrder,
|
|
7858
|
+
hidden: [...effectiveHiddenColumnIds]
|
|
7859
|
+
}
|
|
7860
|
+
}),
|
|
7861
|
+
[
|
|
7862
|
+
anyOfValue,
|
|
7863
|
+
columnFilters,
|
|
7864
|
+
effectiveColumnOrder,
|
|
7865
|
+
effectiveHiddenColumnIds,
|
|
7866
|
+
layeredFilters,
|
|
7867
|
+
pageSize,
|
|
7868
|
+
searchMatchMode,
|
|
7869
|
+
searchValue,
|
|
7870
|
+
sort
|
|
7871
|
+
]
|
|
7872
|
+
);
|
|
7873
|
+
const declaredDefaultViewSnapshot = (0, import_react13.useMemo)(
|
|
7874
|
+
() => defaultViewSnapshot ?? {
|
|
7875
|
+
__kind: "matrx-table-view",
|
|
7876
|
+
version: 1,
|
|
7877
|
+
query: {
|
|
7878
|
+
pageSize: defaultPageSize,
|
|
7879
|
+
search: "",
|
|
7880
|
+
anyOf: "",
|
|
7881
|
+
layeredFilters: [],
|
|
7882
|
+
columnFilters: {},
|
|
7883
|
+
sort: defaultSort
|
|
7884
|
+
},
|
|
7885
|
+
columns: {
|
|
7886
|
+
order: columns.map(columnId),
|
|
7887
|
+
hidden: columns.filter((column) => column.hidden).map(columnId)
|
|
7888
|
+
}
|
|
7889
|
+
},
|
|
7890
|
+
[columns, defaultPageSize, defaultSort, defaultViewSnapshot]
|
|
7891
|
+
);
|
|
7892
|
+
const applySavedView = (0, import_react13.useCallback)(
|
|
7893
|
+
(rawSnapshot) => {
|
|
7894
|
+
const snapshot = parseTableViewSnapshot(rawSnapshot);
|
|
7895
|
+
if (!snapshot) {
|
|
7896
|
+
const message = "This saved view has an unsupported format. The current table was left unchanged.";
|
|
7897
|
+
setSavedViewError(message);
|
|
7898
|
+
throw new Error(message);
|
|
7899
|
+
}
|
|
7900
|
+
const knownColumns = new Set(columns.map(columnId));
|
|
7901
|
+
const unknown = [
|
|
7902
|
+
...snapshot.columns.order,
|
|
7903
|
+
...snapshot.columns.hidden,
|
|
7904
|
+
...Object.keys(snapshot.query.columnFilters),
|
|
7905
|
+
...snapshot.query.sort ? [snapshot.query.sort.id] : [],
|
|
7906
|
+
...snapshot.query.layeredFilters?.map((rule) => rule.field) ?? []
|
|
7907
|
+
].filter((id, index, values) => !knownColumns.has(id) && values.indexOf(id) === index);
|
|
7908
|
+
if (unknown.length > 0) {
|
|
7909
|
+
const message = `This saved view refers to unavailable columns: ${unknown.join(", ")}. The current table was left unchanged.`;
|
|
7910
|
+
setSavedViewError(message);
|
|
7911
|
+
throw new Error(message);
|
|
7912
|
+
}
|
|
7913
|
+
setSavedViewError(null);
|
|
7914
|
+
const nextQuery = { ...snapshot.query, page: 1 };
|
|
7915
|
+
const nextOrder = [...snapshot.columns.order, ...columns.map(columnId).filter((id) => !snapshot.columns.order.includes(id))];
|
|
7916
|
+
if (controlledQuery) {
|
|
7917
|
+
controlledQuery.onStateChange(nextQuery);
|
|
7918
|
+
toolbar?.onSearchChange?.(nextQuery.search);
|
|
7919
|
+
toolbar?.anyOf?.onChange?.(nextQuery.anyOf);
|
|
7920
|
+
} else {
|
|
7921
|
+
setSearchValue(nextQuery.search);
|
|
7922
|
+
setInternalSearchMatchMode(nextQuery.searchMatchMode ?? "contains");
|
|
7923
|
+
setAnyOfValue(nextQuery.anyOf);
|
|
7924
|
+
setInternalLayeredFilters(nextQuery.layeredFilters ?? []);
|
|
7925
|
+
setInternalColumnFilters(nextQuery.columnFilters);
|
|
7926
|
+
setInternalSort(nextQuery.sort);
|
|
7927
|
+
setInternalPageSize(nextQuery.pageSize);
|
|
7928
|
+
setInternalPage(1);
|
|
7929
|
+
}
|
|
7930
|
+
commitColumnState(nextOrder, new Set(snapshot.columns.hidden));
|
|
7931
|
+
},
|
|
7932
|
+
[columns, commitColumnState, controlledQuery, toolbar]
|
|
7933
|
+
);
|
|
7934
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
7777
7935
|
import_core3.DndContext,
|
|
7778
7936
|
{
|
|
7779
7937
|
id: tableDndContextId,
|
|
@@ -7788,8 +7946,10 @@ function MatrxDataTableCore({
|
|
|
7788
7946
|
onDragStart: (event) => {
|
|
7789
7947
|
const kind = event.active.data.current?.matrxDragKind;
|
|
7790
7948
|
if (kind === "column-header") {
|
|
7791
|
-
|
|
7949
|
+
const draggedId = String(event.active.data.current?.columnId);
|
|
7950
|
+
draggedColumnId.current = draggedId;
|
|
7792
7951
|
columnDragActive.current = true;
|
|
7952
|
+
setColumnDragPreview({ draggedId, targetId: null, after: false });
|
|
7793
7953
|
return;
|
|
7794
7954
|
}
|
|
7795
7955
|
if (kind === "column-manager") return;
|
|
@@ -7802,13 +7962,18 @@ function MatrxDataTableCore({
|
|
|
7802
7962
|
const activeRect = event.active.rect.current.translated;
|
|
7803
7963
|
const overRect = event.over?.rect;
|
|
7804
7964
|
if (!overId || !activeRect || !overRect) {
|
|
7805
|
-
|
|
7965
|
+
setColumnDragPreview(
|
|
7966
|
+
(current) => current?.targetId === null ? current : current ? { ...current, targetId: null } : current
|
|
7967
|
+
);
|
|
7806
7968
|
columnDragScrollDirection.current = 0;
|
|
7807
7969
|
stopColumnDragScroll();
|
|
7808
7970
|
return;
|
|
7809
7971
|
}
|
|
7810
7972
|
const after = activeRect.left + activeRect.width / 2 >= overRect.left + overRect.width / 2;
|
|
7811
|
-
|
|
7973
|
+
setColumnDragPreview((current) => {
|
|
7974
|
+
if (!current) return current;
|
|
7975
|
+
return current.targetId === overId && current.after === after ? current : { ...current, targetId: String(overId), after };
|
|
7976
|
+
});
|
|
7812
7977
|
const scroll = scrollRef.current;
|
|
7813
7978
|
if (!scroll) return;
|
|
7814
7979
|
const bounds = scroll.getBoundingClientRect();
|
|
@@ -7820,7 +7985,7 @@ function MatrxDataTableCore({
|
|
|
7820
7985
|
onDragCancel: () => {
|
|
7821
7986
|
columnDragActive.current = false;
|
|
7822
7987
|
draggedColumnId.current = null;
|
|
7823
|
-
|
|
7988
|
+
setColumnDragPreview(null);
|
|
7824
7989
|
stopColumnDragScroll();
|
|
7825
7990
|
setDraggedRowId(null);
|
|
7826
7991
|
},
|
|
@@ -7838,8 +8003,15 @@ function MatrxDataTableCore({
|
|
|
7838
8003
|
const overRect = event.over?.rect;
|
|
7839
8004
|
columnDragActive.current = false;
|
|
7840
8005
|
draggedColumnId.current = null;
|
|
7841
|
-
|
|
8006
|
+
setColumnDragPreview(null);
|
|
7842
8007
|
stopColumnDragScroll();
|
|
8008
|
+
if (columnDragPreview?.draggedId === from && columnDragPreview.targetId !== null && columnDragPreview.targetId !== from) {
|
|
8009
|
+
commitColumnState(
|
|
8010
|
+
projectColumnDragOrder(effectiveColumnOrder, columnDragPreview),
|
|
8011
|
+
effectiveHiddenColumnIds
|
|
8012
|
+
);
|
|
8013
|
+
return;
|
|
8014
|
+
}
|
|
7843
8015
|
if (!target || from === target || !activeRect || !overRect) return;
|
|
7844
8016
|
const order = [...effectiveColumnOrder];
|
|
7845
8017
|
const fromIndex = order.indexOf(from);
|
|
@@ -7852,10 +8024,11 @@ function MatrxDataTableCore({
|
|
|
7852
8024
|
commitColumnState(order, effectiveHiddenColumnIds);
|
|
7853
8025
|
},
|
|
7854
8026
|
children: [
|
|
7855
|
-
/* @__PURE__ */ (0,
|
|
8027
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
7856
8028
|
"div",
|
|
7857
8029
|
{
|
|
7858
8030
|
ref: rootRef,
|
|
8031
|
+
"data-matrx-table": true,
|
|
7859
8032
|
"data-url-state-table": urlState?.id,
|
|
7860
8033
|
className: cn(
|
|
7861
8034
|
// The touch-target floor deliberately SKIPS checkboxes, radios and
|
|
@@ -7870,11 +8043,22 @@ function MatrxDataTableCore({
|
|
|
7870
8043
|
),
|
|
7871
8044
|
children: [
|
|
7872
8045
|
notice,
|
|
7873
|
-
|
|
8046
|
+
savedViewError ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { role: "alert", className: "shrink-0 text-xs text-destructive", children: savedViewError }) : null,
|
|
8047
|
+
toolbarActionError ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { role: "alert", className: "shrink-0 text-xs text-destructive", children: toolbarActionError }) : null,
|
|
8048
|
+
!hideToolbar && (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__ */ (0, import_jsx_runtime35.jsxs)(
|
|
7874
8049
|
TableTitleRow,
|
|
7875
8050
|
{
|
|
7876
8051
|
...toolbar?.title === void 0 ? {} : { title: toolbar.title },
|
|
7877
|
-
|
|
8052
|
+
context: tableId && SavedViews ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8053
|
+
SavedViews,
|
|
8054
|
+
{
|
|
8055
|
+
tableId,
|
|
8056
|
+
snapshot: currentViewSnapshot,
|
|
8057
|
+
defaultSnapshot: declaredDefaultViewSnapshot,
|
|
8058
|
+
onApply: applySavedView
|
|
8059
|
+
}
|
|
8060
|
+
) : void 0,
|
|
8061
|
+
search: showSearch ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
7878
8062
|
"div",
|
|
7879
8063
|
{
|
|
7880
8064
|
"data-matrx-table-search": true,
|
|
@@ -7883,9 +8067,9 @@ function MatrxDataTableCore({
|
|
|
7883
8067
|
toolbar?.searchMatch ? "sm:max-w-md" : "sm:max-w-xs"
|
|
7884
8068
|
),
|
|
7885
8069
|
children: [
|
|
7886
|
-
/* @__PURE__ */ (0,
|
|
7887
|
-
/* @__PURE__ */ (0,
|
|
7888
|
-
/* @__PURE__ */ (0,
|
|
8070
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "relative min-w-0 flex-1", children: [
|
|
8071
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Search, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
|
|
8072
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
7889
8073
|
Input,
|
|
7890
8074
|
{
|
|
7891
8075
|
value: searchValue,
|
|
@@ -7898,22 +8082,22 @@ function MatrxDataTableCore({
|
|
|
7898
8082
|
style: { fontSize: "16px" }
|
|
7899
8083
|
}
|
|
7900
8084
|
),
|
|
7901
|
-
searchValue ? /* @__PURE__ */ (0,
|
|
7902
|
-
/* @__PURE__ */ (0,
|
|
8085
|
+
searchValue ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Tooltip, { children: [
|
|
8086
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
7903
8087
|
"button",
|
|
7904
8088
|
{
|
|
7905
8089
|
type: "button",
|
|
7906
8090
|
"aria-label": "Clear search",
|
|
7907
8091
|
className: "absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground hover:text-foreground",
|
|
7908
8092
|
onClick: () => setSearchValue(""),
|
|
7909
|
-
children: /* @__PURE__ */ (0,
|
|
8093
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(X, { className: "h-3.5 w-3.5" })
|
|
7910
8094
|
}
|
|
7911
8095
|
) }),
|
|
7912
|
-
/* @__PURE__ */ (0,
|
|
8096
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TooltipContent, { children: "Clear search" })
|
|
7913
8097
|
] }) : null
|
|
7914
8098
|
] }),
|
|
7915
|
-
toolbar?.searchMatch ? /* @__PURE__ */ (0,
|
|
7916
|
-
/* @__PURE__ */ (0,
|
|
8099
|
+
toolbar?.searchMatch ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Tooltip, { children: [
|
|
8100
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
7917
8101
|
Button,
|
|
7918
8102
|
{
|
|
7919
8103
|
type: "button",
|
|
@@ -7926,18 +8110,18 @@ function MatrxDataTableCore({
|
|
|
7926
8110
|
searchMatchMode === "whole_words" ? "contains" : "whole_words"
|
|
7927
8111
|
),
|
|
7928
8112
|
children: [
|
|
7929
|
-
/* @__PURE__ */ (0,
|
|
8113
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(WholeWord, { className: "h-3.5 w-3.5" }),
|
|
7930
8114
|
searchMatchMode === "whole_words" ? "Whole words" : "Contains"
|
|
7931
8115
|
]
|
|
7932
8116
|
}
|
|
7933
8117
|
) }),
|
|
7934
|
-
/* @__PURE__ */ (0,
|
|
8118
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TooltipContent, { children: searchMatchMode === "whole_words" ? "Whole words \u2014 click to match text anywhere" : "Contains text \u2014 click to require whole words" })
|
|
7935
8119
|
] }) : null
|
|
7936
8120
|
]
|
|
7937
8121
|
}
|
|
7938
8122
|
) : null,
|
|
7939
8123
|
children: [
|
|
7940
|
-
toolbar?.layeredFilters ? /* @__PURE__ */ (0,
|
|
8124
|
+
toolbar?.layeredFilters ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
7941
8125
|
LayeredFilterBuilder,
|
|
7942
8126
|
{
|
|
7943
8127
|
fields: toolbar.layeredFilters.fields,
|
|
@@ -7947,9 +8131,9 @@ function MatrxDataTableCore({
|
|
|
7947
8131
|
label: toolbar.layeredFilters.label
|
|
7948
8132
|
}
|
|
7949
8133
|
) : null,
|
|
7950
|
-
toolbar?.anyOf ? /* @__PURE__ */ (0,
|
|
7951
|
-
/* @__PURE__ */ (0,
|
|
7952
|
-
/* @__PURE__ */ (0,
|
|
8134
|
+
toolbar?.anyOf ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "relative w-full max-w-xs", children: [
|
|
8135
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Search, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
|
|
8136
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
7953
8137
|
Input,
|
|
7954
8138
|
{
|
|
7955
8139
|
value: anyOfValue,
|
|
@@ -7959,29 +8143,29 @@ function MatrxDataTableCore({
|
|
|
7959
8143
|
style: { fontSize: "16px" }
|
|
7960
8144
|
}
|
|
7961
8145
|
),
|
|
7962
|
-
anyOfValue ? /* @__PURE__ */ (0,
|
|
7963
|
-
/* @__PURE__ */ (0,
|
|
8146
|
+
anyOfValue ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Tooltip, { children: [
|
|
8147
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
7964
8148
|
"button",
|
|
7965
8149
|
{
|
|
7966
8150
|
type: "button",
|
|
7967
8151
|
"aria-label": "Clear match-any search",
|
|
7968
8152
|
className: "absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground hover:text-foreground",
|
|
7969
8153
|
onClick: () => setAnyOfValue(""),
|
|
7970
|
-
children: /* @__PURE__ */ (0,
|
|
8154
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(X, { className: "h-3.5 w-3.5" })
|
|
7971
8155
|
}
|
|
7972
8156
|
) }),
|
|
7973
|
-
/* @__PURE__ */ (0,
|
|
8157
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TooltipContent, { children: "Clear match-any search" })
|
|
7974
8158
|
] }) : null
|
|
7975
8159
|
] }) : null,
|
|
7976
|
-
renderedFacets ? /* @__PURE__ */ (0,
|
|
8160
|
+
renderedFacets ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ToolbarFacets, { facets: renderedFacets }) : null,
|
|
7977
8161
|
toolbar?.leading,
|
|
7978
|
-
/* @__PURE__ */ (0,
|
|
8162
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
7979
8163
|
"div",
|
|
7980
8164
|
{
|
|
7981
8165
|
"data-matrx-table-actions": true,
|
|
7982
8166
|
className: "ml-auto flex min-w-0 flex-wrap items-center gap-2",
|
|
7983
8167
|
children: [
|
|
7984
|
-
sourceTotal !== void 0 ? /* @__PURE__ */ (0,
|
|
8168
|
+
sourceTotal !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
7985
8169
|
"span",
|
|
7986
8170
|
{
|
|
7987
8171
|
"data-matrx-table-source-total": true,
|
|
@@ -7998,8 +8182,8 @@ function MatrxDataTableCore({
|
|
|
7998
8182
|
]
|
|
7999
8183
|
}
|
|
8000
8184
|
) : null,
|
|
8001
|
-
|
|
8002
|
-
/* @__PURE__ */ (0,
|
|
8185
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Tooltip, { children: [
|
|
8186
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "inline-flex", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
8003
8187
|
Button,
|
|
8004
8188
|
{
|
|
8005
8189
|
type: "button",
|
|
@@ -8007,16 +8191,17 @@ function MatrxDataTableCore({
|
|
|
8007
8191
|
size: "sm",
|
|
8008
8192
|
className: "h-7 gap-1 px-2 text-xs text-muted-foreground",
|
|
8009
8193
|
onClick: clearAllFilters,
|
|
8194
|
+
disabled: !hasActiveFilters,
|
|
8010
8195
|
"aria-label": "Clear all filters",
|
|
8011
8196
|
children: [
|
|
8012
|
-
/* @__PURE__ */ (0,
|
|
8013
|
-
/* @__PURE__ */ (0,
|
|
8197
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Eraser, { className: "h-3.5 w-3.5" }),
|
|
8198
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "max-sm:sr-only", children: "Clear all" })
|
|
8014
8199
|
]
|
|
8015
8200
|
}
|
|
8016
|
-
) }),
|
|
8017
|
-
/* @__PURE__ */ (0,
|
|
8018
|
-
] })
|
|
8019
|
-
showToolbarCopy && effectiveCopy ? /* @__PURE__ */ (0,
|
|
8201
|
+
) }) }),
|
|
8202
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TooltipContent, { children: hasActiveFilters ? "Clear search and filters; keep columns and sort" : "No search or filters to clear" })
|
|
8203
|
+
] }),
|
|
8204
|
+
showToolbarCopy && effectiveCopy ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8020
8205
|
CopyButtons,
|
|
8021
8206
|
{
|
|
8022
8207
|
size: "icon",
|
|
@@ -8056,8 +8241,8 @@ function MatrxDataTableCore({
|
|
|
8056
8241
|
}
|
|
8057
8242
|
}
|
|
8058
8243
|
) : null,
|
|
8059
|
-
columns.length > 0 ? /* @__PURE__ */ (0,
|
|
8060
|
-
/* @__PURE__ */ (0,
|
|
8244
|
+
columns.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Tooltip, { children: [
|
|
8245
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
8061
8246
|
Button,
|
|
8062
8247
|
{
|
|
8063
8248
|
type: "button",
|
|
@@ -8067,15 +8252,80 @@ function MatrxDataTableCore({
|
|
|
8067
8252
|
className: "h-8 w-8",
|
|
8068
8253
|
onClick: () => setColumnManagerOpen(true),
|
|
8069
8254
|
children: [
|
|
8070
|
-
/* @__PURE__ */ (0,
|
|
8071
|
-
effectiveHiddenColumnIds.size > 0 ? /* @__PURE__ */ (0,
|
|
8255
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SlidersHorizontal, { className: "h-4 w-4" }),
|
|
8256
|
+
effectiveHiddenColumnIds.size > 0 ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "sr-only", children: [
|
|
8072
8257
|
effectiveHiddenColumnIds.size,
|
|
8073
8258
|
" hidden"
|
|
8074
8259
|
] }) : null
|
|
8075
8260
|
]
|
|
8076
8261
|
}
|
|
8077
8262
|
) }),
|
|
8078
|
-
/* @__PURE__ */ (0,
|
|
8263
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TooltipContent, { children: "Show, hide, or reorder columns" })
|
|
8264
|
+
] }) : null,
|
|
8265
|
+
toolbar?.refresh ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Tooltip, { children: [
|
|
8266
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "inline-flex", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8267
|
+
Button,
|
|
8268
|
+
{
|
|
8269
|
+
type: "button",
|
|
8270
|
+
variant: "ghost",
|
|
8271
|
+
size: "icon",
|
|
8272
|
+
className: "h-8 w-8",
|
|
8273
|
+
"aria-label": toolbar.refresh.label ?? "Refresh",
|
|
8274
|
+
disabled: isFetching || toolbarActionPending.refresh,
|
|
8275
|
+
onClick: () => {
|
|
8276
|
+
if (toolbarActionPendingRef.current.refresh) return;
|
|
8277
|
+
toolbarActionPendingRef.current.refresh = true;
|
|
8278
|
+
setToolbarActionPending((current) => ({ ...current, refresh: true }));
|
|
8279
|
+
setToolbarActionError(null);
|
|
8280
|
+
void Promise.resolve().then(() => toolbar.refresh?.onRefresh()).catch((cause) => {
|
|
8281
|
+
const message = cause instanceof Error ? cause.message : String(cause);
|
|
8282
|
+
setToolbarActionError(`Refresh failed: ${message}`);
|
|
8283
|
+
toast.error(`Refresh failed: ${message}`);
|
|
8284
|
+
}).finally(() => {
|
|
8285
|
+
toolbarActionPendingRef.current.refresh = false;
|
|
8286
|
+
setToolbarActionPending((current) => ({ ...current, refresh: false }));
|
|
8287
|
+
});
|
|
8288
|
+
},
|
|
8289
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8290
|
+
Loader2,
|
|
8291
|
+
{
|
|
8292
|
+
className: cn(
|
|
8293
|
+
"h-4 w-4",
|
|
8294
|
+
(isFetching || toolbarActionPending.refresh) && "animate-spin"
|
|
8295
|
+
)
|
|
8296
|
+
}
|
|
8297
|
+
)
|
|
8298
|
+
}
|
|
8299
|
+
) }) }),
|
|
8300
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TooltipContent, { children: isFetching ? "Refreshing table data" : toolbar.refresh.label ?? "Refresh" })
|
|
8301
|
+
] }) : null,
|
|
8302
|
+
toolbar?.add ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Tooltip, { children: [
|
|
8303
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "inline-flex", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8304
|
+
Button,
|
|
8305
|
+
{
|
|
8306
|
+
type: "button",
|
|
8307
|
+
size: "icon",
|
|
8308
|
+
className: "h-8 w-8",
|
|
8309
|
+
"aria-label": "Add",
|
|
8310
|
+
disabled: toolbar.add.disabled || toolbarActionPending.add,
|
|
8311
|
+
onClick: () => {
|
|
8312
|
+
if (toolbarActionPendingRef.current.add) return;
|
|
8313
|
+
toolbarActionPendingRef.current.add = true;
|
|
8314
|
+
setToolbarActionPending((current) => ({ ...current, add: true }));
|
|
8315
|
+
setToolbarActionError(null);
|
|
8316
|
+
void Promise.resolve().then(() => toolbar.add?.onAdd()).catch((cause) => {
|
|
8317
|
+
const message = cause instanceof Error ? cause.message : String(cause);
|
|
8318
|
+
setToolbarActionError(`Add failed: ${message}`);
|
|
8319
|
+
toast.error(`Add failed: ${message}`);
|
|
8320
|
+
}).finally(() => {
|
|
8321
|
+
toolbarActionPendingRef.current.add = false;
|
|
8322
|
+
setToolbarActionPending((current) => ({ ...current, add: false }));
|
|
8323
|
+
});
|
|
8324
|
+
},
|
|
8325
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Plus, { className: "h-4 w-4" })
|
|
8326
|
+
}
|
|
8327
|
+
) }) }),
|
|
8328
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TooltipContent, { children: toolbar.add.disabled ? toolbar.add.disabledReason ?? "Add unavailable" : "Add" })
|
|
8079
8329
|
] }) : null,
|
|
8080
8330
|
toolbar?.actions
|
|
8081
8331
|
]
|
|
@@ -8084,15 +8334,15 @@ function MatrxDataTableCore({
|
|
|
8084
8334
|
]
|
|
8085
8335
|
}
|
|
8086
8336
|
),
|
|
8087
|
-
selection && selectionCount > 0 ? /* @__PURE__ */ (0,
|
|
8088
|
-
/* @__PURE__ */ (0,
|
|
8337
|
+
selection && selectionCount > 0 ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("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: [
|
|
8338
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "text-xs font-medium text-foreground", children: [
|
|
8089
8339
|
selectionCount.toLocaleString(),
|
|
8090
8340
|
" ",
|
|
8091
8341
|
selectionNoun,
|
|
8092
8342
|
selectionCount === 1 ? "" : "s",
|
|
8093
8343
|
" selected"
|
|
8094
8344
|
] }),
|
|
8095
|
-
/* @__PURE__ */ (0,
|
|
8345
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
8096
8346
|
Button,
|
|
8097
8347
|
{
|
|
8098
8348
|
type: "button",
|
|
@@ -8104,13 +8354,13 @@ function MatrxDataTableCore({
|
|
|
8104
8354
|
selection.onSelectedIdsChange([]);
|
|
8105
8355
|
},
|
|
8106
8356
|
children: [
|
|
8107
|
-
/* @__PURE__ */ (0,
|
|
8357
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(X, { className: "h-3.5 w-3.5" }),
|
|
8108
8358
|
"Clear"
|
|
8109
8359
|
]
|
|
8110
8360
|
}
|
|
8111
8361
|
),
|
|
8112
|
-
/* @__PURE__ */ (0,
|
|
8113
|
-
effectiveCopy && selectedRows.length > 0 ? /* @__PURE__ */ (0,
|
|
8362
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "ml-auto flex flex-wrap items-center gap-1.5", children: [
|
|
8363
|
+
effectiveCopy && selectedRows.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8114
8364
|
CopyButtons,
|
|
8115
8365
|
{
|
|
8116
8366
|
size: "icon",
|
|
@@ -8140,9 +8390,9 @@ function MatrxDataTableCore({
|
|
|
8140
8390
|
selection.actions?.(selectedRows, selection.selectedIds)
|
|
8141
8391
|
] })
|
|
8142
8392
|
] }) : null,
|
|
8143
|
-
/* @__PURE__ */ (0,
|
|
8144
|
-
/* @__PURE__ */ (0,
|
|
8145
|
-
mobileCards ? /* @__PURE__ */ (0,
|
|
8393
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex min-h-0 flex-1 flex-col", children: [
|
|
8394
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "relative min-h-0 flex-1", children: [
|
|
8395
|
+
mobileCards ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
8146
8396
|
"div",
|
|
8147
8397
|
{
|
|
8148
8398
|
ref: cardsScrollRef,
|
|
@@ -8154,33 +8404,37 @@ function MatrxDataTableCore({
|
|
|
8154
8404
|
mobileCardsClass
|
|
8155
8405
|
),
|
|
8156
8406
|
children: [
|
|
8157
|
-
isFetching && !isLoading && appendQuery === null ? /* @__PURE__ */ (0,
|
|
8407
|
+
isFetching && !isLoading && appendQuery === null ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
8158
8408
|
"div",
|
|
8159
8409
|
{
|
|
8160
8410
|
role: "status",
|
|
8161
8411
|
className: "h-0.5 shrink-0 overflow-hidden rounded-full bg-primary/15",
|
|
8162
8412
|
children: [
|
|
8163
|
-
/* @__PURE__ */ (0,
|
|
8164
|
-
/* @__PURE__ */ (0,
|
|
8413
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "h-full w-full animate-pulse bg-primary" }),
|
|
8414
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "sr-only", children: "Refreshing table data" })
|
|
8165
8415
|
]
|
|
8166
8416
|
}
|
|
8167
8417
|
) : null,
|
|
8168
|
-
isLoading ? Array.from({ length: 4 }).map((_, index) => /* @__PURE__ */ (0,
|
|
8418
|
+
isLoading ? Array.from({ length: 4 }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8169
8419
|
Skeleton,
|
|
8170
8420
|
{
|
|
8171
8421
|
className: "h-52 w-full shrink-0 rounded-lg"
|
|
8172
8422
|
},
|
|
8173
8423
|
`mobile-card-sk-${index}`
|
|
8174
|
-
)) : paginated.length === 0 ? /* @__PURE__ */ (0,
|
|
8424
|
+
)) : paginated.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex min-h-48 flex-1 items-center justify-center px-4 py-12 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex max-w-sm flex-col items-center gap-2", children: [
|
|
8175
8425
|
emptyState?.icon,
|
|
8176
|
-
/* @__PURE__ */ (0,
|
|
8177
|
-
emptyState?.description ? /* @__PURE__ */ (0,
|
|
8426
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-sm font-medium text-foreground", children: emptyState?.title ?? "No rows" }),
|
|
8427
|
+
emptyState?.description ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-xs text-muted-foreground", children: emptyState.description }) : null,
|
|
8178
8428
|
emptyState?.action
|
|
8179
8429
|
] }) }) : paginated.map((row, index) => {
|
|
8180
8430
|
const id = getRowId(row);
|
|
8181
8431
|
const displayRow = applyRowEdits(row, edits[id]);
|
|
8182
8432
|
const selectable = selection?.isRowSelectable?.(row) ?? Boolean(selection);
|
|
8183
|
-
return /* @__PURE__ */ (0,
|
|
8433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react13.Fragment, { children: mobileCards(displayRow, index, {
|
|
8434
|
+
renderCell: (columnKey) => {
|
|
8435
|
+
const column = columns.find((candidate) => columnId(candidate) === columnKey);
|
|
8436
|
+
return column ? renderRecordCell(row, column, index) : null;
|
|
8437
|
+
},
|
|
8184
8438
|
selected: selectedIdSet.has(id),
|
|
8185
8439
|
selectable,
|
|
8186
8440
|
onSelectedChange: (nextSelected) => {
|
|
@@ -8192,13 +8446,13 @@ function MatrxDataTableCore({
|
|
|
8192
8446
|
else next.delete(id);
|
|
8193
8447
|
setSelectedIds(next);
|
|
8194
8448
|
},
|
|
8195
|
-
actions: showRowCopy || rowActions ? /* @__PURE__ */ (0,
|
|
8449
|
+
actions: showRowCopy || rowActions ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
8196
8450
|
"div",
|
|
8197
8451
|
{
|
|
8198
8452
|
className: "inline-flex items-center gap-1",
|
|
8199
8453
|
onClick: (event) => event.stopPropagation(),
|
|
8200
8454
|
children: [
|
|
8201
|
-
showRowCopy && effectiveCopy ? /* @__PURE__ */ (0,
|
|
8455
|
+
showRowCopy && effectiveCopy ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8202
8456
|
TableRowCopyControl,
|
|
8203
8457
|
{
|
|
8204
8458
|
size: "xs",
|
|
@@ -8221,7 +8475,7 @@ function MatrxDataTableCore({
|
|
|
8221
8475
|
) : null
|
|
8222
8476
|
}) }, id);
|
|
8223
8477
|
}),
|
|
8224
|
-
appendQuery !== null && isFetching && !isLoading ? /* @__PURE__ */ (0,
|
|
8478
|
+
appendQuery !== null && isFetching && !isLoading ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
8225
8479
|
"div",
|
|
8226
8480
|
{
|
|
8227
8481
|
"data-matrx-table-append-loading-card": true,
|
|
@@ -8229,7 +8483,7 @@ function MatrxDataTableCore({
|
|
|
8229
8483
|
"aria-live": "polite",
|
|
8230
8484
|
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",
|
|
8231
8485
|
children: [
|
|
8232
|
-
/* @__PURE__ */ (0,
|
|
8486
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8233
8487
|
Loader2,
|
|
8234
8488
|
{
|
|
8235
8489
|
"aria-hidden": "true",
|
|
@@ -8243,7 +8497,7 @@ function MatrxDataTableCore({
|
|
|
8243
8497
|
]
|
|
8244
8498
|
}
|
|
8245
8499
|
) : null,
|
|
8246
|
-
/* @__PURE__ */ (0,
|
|
8500
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
8247
8501
|
"div",
|
|
8248
8502
|
{
|
|
8249
8503
|
ref: scrollRef,
|
|
@@ -8257,34 +8511,34 @@ function MatrxDataTableCore({
|
|
|
8257
8511
|
tableClassName
|
|
8258
8512
|
),
|
|
8259
8513
|
children: [
|
|
8260
|
-
hierarchy && draggedRow ? /* @__PURE__ */ (0,
|
|
8514
|
+
hierarchy && draggedRow ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8261
8515
|
HierarchyRootDropTarget,
|
|
8262
8516
|
{
|
|
8263
8517
|
label: hierarchy.rootDropLabel ?? "Drop here to move to the top level",
|
|
8264
8518
|
draggedLabel: hierarchy.itemLabel?.(draggedRow) ?? "Moving row"
|
|
8265
8519
|
}
|
|
8266
8520
|
) : null,
|
|
8267
|
-
hierarchy && draggedRowId ? /* @__PURE__ */ (0,
|
|
8521
|
+
hierarchy && draggedRowId ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8268
8522
|
HierarchyDragIndicatorLayer,
|
|
8269
8523
|
{
|
|
8270
8524
|
scrollRef,
|
|
8271
8525
|
resolve: resolveHierarchyMove
|
|
8272
8526
|
}
|
|
8273
8527
|
) : null,
|
|
8274
|
-
isFetching && !isLoading && appendQuery === null ? /* @__PURE__ */ (0,
|
|
8528
|
+
isFetching && !isLoading && appendQuery === null ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
8275
8529
|
"div",
|
|
8276
8530
|
{
|
|
8277
8531
|
role: "status",
|
|
8278
8532
|
className: "sticky left-0 top-0 z-20 h-0.5 w-full overflow-hidden bg-primary/15",
|
|
8279
8533
|
children: [
|
|
8280
|
-
/* @__PURE__ */ (0,
|
|
8281
|
-
/* @__PURE__ */ (0,
|
|
8534
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "h-full w-full animate-pulse bg-primary" }),
|
|
8535
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "sr-only", children: "Refreshing table data" })
|
|
8282
8536
|
]
|
|
8283
8537
|
}
|
|
8284
8538
|
) : null,
|
|
8285
|
-
/* @__PURE__ */ (0,
|
|
8286
|
-
/* @__PURE__ */ (0,
|
|
8287
|
-
selection ? /* @__PURE__ */ (0,
|
|
8539
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("table", { className: "table w-max min-w-full max-w-none caption-bottom overflow-visible text-sm sm:w-full sm:min-w-0 sm:max-w-full", children: [
|
|
8540
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("thead", { className: "sticky top-0 z-10 border-b border-border bg-muted/90 shadow-[0_1px_0_0_var(--border)] backdrop-blur-sm", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("tr", { children: [
|
|
8541
|
+
selection ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("th", { className: "h-9 w-9 px-2 text-left align-middle", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8288
8542
|
Checkbox,
|
|
8289
8543
|
{
|
|
8290
8544
|
className: CHECKBOX_TAP_AREA,
|
|
@@ -8300,9 +8554,11 @@ function MatrxDataTableCore({
|
|
|
8300
8554
|
const isSorted = sort?.id === id;
|
|
8301
8555
|
const headerLabel = col.label ?? (typeof col.header === "string" ? col.header : id);
|
|
8302
8556
|
const defaultSortDirection = col.defaultSortDirection ?? "asc";
|
|
8303
|
-
|
|
8557
|
+
const isColumnDragShadow = columnDragPreview?.draggedId === id && columnDragPreview.targetId !== null;
|
|
8558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8304
8559
|
"th",
|
|
8305
8560
|
{
|
|
8561
|
+
"data-matrx-column-drag-shadow": isColumnDragShadow ? "true" : void 0,
|
|
8306
8562
|
"aria-sort": isSorted ? sort?.direction === "asc" ? "ascending" : "descending" : void 0,
|
|
8307
8563
|
className: cn(
|
|
8308
8564
|
"h-9 text-left align-middle max-sm:whitespace-nowrap",
|
|
@@ -8322,12 +8578,12 @@ function MatrxDataTableCore({
|
|
|
8322
8578
|
// horizontal-scroll surface.
|
|
8323
8579
|
col.width !== void 0 && "sm:w-[var(--matrx-col-w)] sm:min-w-[var(--matrx-col-w)]",
|
|
8324
8580
|
col.headerClassName,
|
|
8325
|
-
|
|
8581
|
+
isColumnDragShadow && "bg-primary/10 shadow-[inset_2px_0_0_var(--primary),inset_-2px_0_0_var(--primary)]",
|
|
8326
8582
|
col.align === "center" && "text-center",
|
|
8327
8583
|
col.align === "right" && "text-right"
|
|
8328
8584
|
),
|
|
8329
8585
|
style: columnWidthVar(col.width),
|
|
8330
|
-
children: /* @__PURE__ */ (0,
|
|
8586
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ColumnHeaderDropZone, { id, enabled: reorderableColumns, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8331
8587
|
ColumnHeaderCell,
|
|
8332
8588
|
{
|
|
8333
8589
|
label: col.header,
|
|
@@ -8368,12 +8624,12 @@ function MatrxDataTableCore({
|
|
|
8368
8624
|
id
|
|
8369
8625
|
);
|
|
8370
8626
|
}),
|
|
8371
|
-
showActionsCol && /* @__PURE__ */ (0,
|
|
8627
|
+
showActionsCol && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("th", { className: "h-9 w-28 px-2 text-right align-middle text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: "Actions" })
|
|
8372
8628
|
] }) }),
|
|
8373
|
-
/* @__PURE__ */ (0,
|
|
8374
|
-
isLoading ? Array.from({ length: 6 }).map((_, i) => /* @__PURE__ */ (0,
|
|
8375
|
-
selection ? /* @__PURE__ */ (0,
|
|
8376
|
-
visibleColumns.map((col) => /* @__PURE__ */ (0,
|
|
8629
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("tbody", { children: [
|
|
8630
|
+
isLoading ? Array.from({ length: 6 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("tr", { className: "border-b border-border/60", children: [
|
|
8631
|
+
selection ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("td", { className: "px-2 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Skeleton, { className: "h-3.5 w-3.5" }) }) : null,
|
|
8632
|
+
visibleColumns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8377
8633
|
"td",
|
|
8378
8634
|
{
|
|
8379
8635
|
className: cn(
|
|
@@ -8381,20 +8637,20 @@ function MatrxDataTableCore({
|
|
|
8381
8637
|
col.compact ? "px-1" : "px-2",
|
|
8382
8638
|
col.mobileHidden && "max-sm:hidden"
|
|
8383
8639
|
),
|
|
8384
|
-
children: /* @__PURE__ */ (0,
|
|
8640
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Skeleton, { className: "h-5 w-full" })
|
|
8385
8641
|
},
|
|
8386
8642
|
columnId(col)
|
|
8387
8643
|
)),
|
|
8388
|
-
showActionsCol && /* @__PURE__ */ (0,
|
|
8389
|
-
] }, `sk-${i}`)) : paginated.length === 0 ? /* @__PURE__ */ (0,
|
|
8644
|
+
showActionsCol && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("td", { className: "px-2 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Skeleton, { className: "ml-auto h-5 w-10" }) })
|
|
8645
|
+
] }, `sk-${i}`)) : paginated.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8390
8646
|
"td",
|
|
8391
8647
|
{
|
|
8392
8648
|
colSpan: visibleColumns.length + leadingCols + (showActionsCol ? 1 : 0),
|
|
8393
8649
|
className: "px-4 py-12 text-center",
|
|
8394
|
-
children: /* @__PURE__ */ (0,
|
|
8650
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "mx-auto flex max-w-sm flex-col items-center gap-2", children: [
|
|
8395
8651
|
emptyState?.icon,
|
|
8396
|
-
/* @__PURE__ */ (0,
|
|
8397
|
-
emptyState?.description ? /* @__PURE__ */ (0,
|
|
8652
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-sm font-medium text-foreground", children: emptyState?.title ?? "No rows" }),
|
|
8653
|
+
emptyState?.description ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-xs text-muted-foreground", children: emptyState.description }) : null,
|
|
8398
8654
|
emptyState?.action
|
|
8399
8655
|
] })
|
|
8400
8656
|
}
|
|
@@ -8404,7 +8660,7 @@ function MatrxDataTableCore({
|
|
|
8404
8660
|
const rowEdits = edits[id];
|
|
8405
8661
|
const displayRow = applyRowEdits(row, rowEdits);
|
|
8406
8662
|
const isChecked = selectedIdSet.has(id);
|
|
8407
|
-
const rowNode = /* @__PURE__ */ (0,
|
|
8663
|
+
const rowNode = /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
8408
8664
|
"tr",
|
|
8409
8665
|
{
|
|
8410
8666
|
"data-row-id": id,
|
|
@@ -8427,12 +8683,12 @@ function MatrxDataTableCore({
|
|
|
8427
8683
|
zebra && index % 2 === 1 && !isSelected && !isChecked && "sm:bg-muted/20"
|
|
8428
8684
|
),
|
|
8429
8685
|
children: [
|
|
8430
|
-
selection ? /* @__PURE__ */ (0,
|
|
8686
|
+
selection ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8431
8687
|
"td",
|
|
8432
8688
|
{
|
|
8433
8689
|
className: "px-2 py-1.5 align-middle lg:py-0.5",
|
|
8434
8690
|
onClick: (e) => e.stopPropagation(),
|
|
8435
|
-
children: selection.isRowSelectable?.(row) ?? true ? /* @__PURE__ */ (0,
|
|
8691
|
+
children: selection.isRowSelectable?.(row) ?? true ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8436
8692
|
Checkbox,
|
|
8437
8693
|
{
|
|
8438
8694
|
className: CHECKBOX_TAP_AREA,
|
|
@@ -8444,18 +8700,11 @@ function MatrxDataTableCore({
|
|
|
8444
8700
|
}
|
|
8445
8701
|
) : null,
|
|
8446
8702
|
visibleColumns.map((col, colIdx) => {
|
|
8447
|
-
const
|
|
8448
|
-
|
|
8449
|
-
const editable = Boolean(
|
|
8450
|
-
editEnabled && col.editable && (col.editableIf?.(row) ?? true)
|
|
8451
|
-
);
|
|
8452
|
-
const dirty = Boolean(
|
|
8453
|
-
rowEdits && field in rowEdits
|
|
8454
|
-
);
|
|
8455
|
-
const cellHref = col.href?.(row) ?? void 0;
|
|
8456
|
-
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8703
|
+
const isColumnDragShadow = columnDragPreview?.draggedId === columnId(col) && columnDragPreview.targetId !== null;
|
|
8704
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8457
8705
|
"td",
|
|
8458
8706
|
{
|
|
8707
|
+
"data-matrx-column-drag-shadow": isColumnDragShadow ? "true" : void 0,
|
|
8459
8708
|
className: cn(
|
|
8460
8709
|
"py-1.5 align-middle lg:py-0.5",
|
|
8461
8710
|
col.compact ? "px-1" : "px-2",
|
|
@@ -8465,18 +8714,19 @@ function MatrxDataTableCore({
|
|
|
8465
8714
|
col.mobileHidden && "max-sm:hidden",
|
|
8466
8715
|
col.width !== void 0 && "sm:w-[var(--matrx-col-w)] sm:min-w-[var(--matrx-col-w)] sm:max-w-[var(--matrx-col-w)]",
|
|
8467
8716
|
col.className,
|
|
8717
|
+
isColumnDragShadow && "bg-primary/10 shadow-[inset_2px_0_0_var(--primary),inset_-2px_0_0_var(--primary)]",
|
|
8468
8718
|
col.align === "center" && "text-center",
|
|
8469
8719
|
col.align === "right" && "text-right"
|
|
8470
8720
|
),
|
|
8471
8721
|
style: columnWidthVar(col.width),
|
|
8472
|
-
children: /* @__PURE__ */ (0,
|
|
8722
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
8473
8723
|
"div",
|
|
8474
8724
|
{
|
|
8475
8725
|
className: cn(
|
|
8476
8726
|
colIdx === 0 && hierarchy && "flex min-w-0 items-center"
|
|
8477
8727
|
),
|
|
8478
8728
|
children: [
|
|
8479
|
-
colIdx === 0 && hierarchy ? /* @__PURE__ */ (0,
|
|
8729
|
+
colIdx === 0 && hierarchy ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8480
8730
|
HierarchyDragHandle,
|
|
8481
8731
|
{
|
|
8482
8732
|
id,
|
|
@@ -8484,32 +8734,12 @@ function MatrxDataTableCore({
|
|
|
8484
8734
|
disabled: !(hierarchy.canReparent?.(row) ?? true)
|
|
8485
8735
|
}
|
|
8486
8736
|
) : null,
|
|
8487
|
-
/* @__PURE__ */ (0,
|
|
8737
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8488
8738
|
"div",
|
|
8489
8739
|
{
|
|
8490
8740
|
"data-matrx-cell-content": true,
|
|
8491
8741
|
className: "min-w-0 max-w-full flex-1 whitespace-normal break-words [overflow-wrap:anywhere] sm:[&_*]:min-w-0 sm:[&_*]:max-w-full sm:[&_*]:whitespace-normal sm:[&_*]:[overflow-wrap:anywhere] sm:[&_[data-matrx-cell-control]]:w-max sm:[&_[data-matrx-cell-control]]:min-w-max sm:[&_[data-matrx-cell-control]]:max-w-none sm:[&_[data-matrx-cell-control]]:whitespace-nowrap sm:[&_[data-matrx-cell-control]]:[overflow-wrap:normal] sm:[&_[data-matrx-cell-control]_*]:whitespace-nowrap sm:[&_[data-matrx-cell-control]_*]:[overflow-wrap:normal]",
|
|
8492
|
-
children:
|
|
8493
|
-
EditableTableCell,
|
|
8494
|
-
{
|
|
8495
|
-
value: rowEdits && field in rowEdits ? rowEdits[field] : getCellValue(row, col),
|
|
8496
|
-
editType: col.editable,
|
|
8497
|
-
...col.editOptions === void 0 ? {} : { editOptions: col.editOptions },
|
|
8498
|
-
display,
|
|
8499
|
-
dirty,
|
|
8500
|
-
onCommit: (next) => commitCell(id, field, next),
|
|
8501
|
-
...cellHref === void 0 ? {} : { href: cellHref },
|
|
8502
|
-
...col.editTrigger === void 0 ? {} : { editTrigger: col.editTrigger }
|
|
8503
|
-
}
|
|
8504
|
-
) : cellHref ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8505
|
-
Link,
|
|
8506
|
-
{
|
|
8507
|
-
href: cellHref,
|
|
8508
|
-
onClick: (e) => e.stopPropagation(),
|
|
8509
|
-
className: "block w-full min-w-0 rounded outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
8510
|
-
children: display
|
|
8511
|
-
}
|
|
8512
|
-
) : display
|
|
8742
|
+
children: renderRecordCell(row, col, index)
|
|
8513
8743
|
}
|
|
8514
8744
|
)
|
|
8515
8745
|
]
|
|
@@ -8519,13 +8749,13 @@ function MatrxDataTableCore({
|
|
|
8519
8749
|
columnId(col)
|
|
8520
8750
|
);
|
|
8521
8751
|
}),
|
|
8522
|
-
showActionsCol && /* @__PURE__ */ (0,
|
|
8752
|
+
showActionsCol && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("td", { className: "px-2 py-1.5 text-right align-middle lg:py-0.5", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
8523
8753
|
"div",
|
|
8524
8754
|
{
|
|
8525
8755
|
className: "inline-flex items-center justify-end gap-0.5",
|
|
8526
8756
|
onClick: (e) => e.stopPropagation(),
|
|
8527
8757
|
children: [
|
|
8528
|
-
showRowCopy && effectiveCopy ? /* @__PURE__ */ (0,
|
|
8758
|
+
showRowCopy && effectiveCopy ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8529
8759
|
TableRowCopyControl,
|
|
8530
8760
|
{
|
|
8531
8761
|
size: "xs",
|
|
@@ -8543,8 +8773,8 @@ function MatrxDataTableCore({
|
|
|
8543
8773
|
hasPendingEdits: Boolean(rowEdits),
|
|
8544
8774
|
discardPendingEdits: () => discardRowEdits(id)
|
|
8545
8775
|
}),
|
|
8546
|
-
windowEnabled ? /* @__PURE__ */ (0,
|
|
8547
|
-
/* @__PURE__ */ (0,
|
|
8776
|
+
windowEnabled ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Tooltip, { children: [
|
|
8777
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8548
8778
|
Button,
|
|
8549
8779
|
{
|
|
8550
8780
|
type: "button",
|
|
@@ -8560,10 +8790,10 @@ function MatrxDataTableCore({
|
|
|
8560
8790
|
openWindow(row);
|
|
8561
8791
|
}
|
|
8562
8792
|
},
|
|
8563
|
-
children: opensWindowOnRowClick ? /* @__PURE__ */ (0,
|
|
8793
|
+
children: opensWindowOnRowClick ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(PanelRightOpen, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(PanelRight, { className: "h-3.5 w-3.5" })
|
|
8564
8794
|
}
|
|
8565
8795
|
) }),
|
|
8566
|
-
/* @__PURE__ */ (0,
|
|
8796
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TooltipContent, { children: opensWindowOnRowClick ? "Open in side panel" : "Open in window" })
|
|
8567
8797
|
] }) : null
|
|
8568
8798
|
]
|
|
8569
8799
|
}
|
|
@@ -8573,7 +8803,7 @@ function MatrxDataTableCore({
|
|
|
8573
8803
|
id
|
|
8574
8804
|
);
|
|
8575
8805
|
const wrappedRow = rowWrapper ? rowWrapper(row, rowNode) : rowNode;
|
|
8576
|
-
return hierarchy ? /* @__PURE__ */ (0,
|
|
8806
|
+
return hierarchy ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8577
8807
|
HierarchyDroppableRow,
|
|
8578
8808
|
{
|
|
8579
8809
|
id,
|
|
@@ -8581,21 +8811,21 @@ function MatrxDataTableCore({
|
|
|
8581
8811
|
children: wrappedRow
|
|
8582
8812
|
},
|
|
8583
8813
|
id
|
|
8584
|
-
) : /* @__PURE__ */ (0,
|
|
8814
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react13.Fragment, { children: wrappedRow }, id);
|
|
8585
8815
|
}),
|
|
8586
|
-
appendQuery !== null && isFetching && !isLoading ? /* @__PURE__ */ (0,
|
|
8816
|
+
appendQuery !== null && isFetching && !isLoading ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("tr", { "data-matrx-table-append-loading-row": true, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8587
8817
|
"td",
|
|
8588
8818
|
{
|
|
8589
8819
|
colSpan: visibleColumns.length + leadingCols + (showActionsCol ? 1 : 0),
|
|
8590
8820
|
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",
|
|
8591
|
-
children: /* @__PURE__ */ (0,
|
|
8821
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
8592
8822
|
"div",
|
|
8593
8823
|
{
|
|
8594
8824
|
role: "status",
|
|
8595
8825
|
"aria-live": "polite",
|
|
8596
8826
|
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",
|
|
8597
8827
|
children: [
|
|
8598
|
-
/* @__PURE__ */ (0,
|
|
8828
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8599
8829
|
Loader2,
|
|
8600
8830
|
{
|
|
8601
8831
|
"aria-hidden": "true",
|
|
@@ -8609,9 +8839,9 @@ function MatrxDataTableCore({
|
|
|
8609
8839
|
}
|
|
8610
8840
|
) }) : null
|
|
8611
8841
|
] }),
|
|
8612
|
-
footerRows.length > 0 ? /* @__PURE__ */ (0,
|
|
8613
|
-
selection ? /* @__PURE__ */ (0,
|
|
8614
|
-
visibleColumns.map((column) => /* @__PURE__ */ (0,
|
|
8842
|
+
footerRows.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("tfoot", { className: "border-t-2 border-border bg-muted/50 font-semibold", children: footerRows.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("tr", { children: [
|
|
8843
|
+
selection ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("td", { className: "px-2 py-2" }) : null,
|
|
8844
|
+
visibleColumns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8615
8845
|
"td",
|
|
8616
8846
|
{
|
|
8617
8847
|
className: cn(
|
|
@@ -8626,14 +8856,14 @@ function MatrxDataTableCore({
|
|
|
8626
8856
|
},
|
|
8627
8857
|
columnId(column)
|
|
8628
8858
|
)),
|
|
8629
|
-
showActionsCol ? /* @__PURE__ */ (0,
|
|
8859
|
+
showActionsCol ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("td", { className: "px-2 py-2" }) : null
|
|
8630
8860
|
] }, `footer-${index}`)) }) : null
|
|
8631
8861
|
] })
|
|
8632
8862
|
]
|
|
8633
8863
|
}
|
|
8634
8864
|
),
|
|
8635
|
-
scrollHintLeft ? /* @__PURE__ */ (0,
|
|
8636
|
-
/* @__PURE__ */ (0,
|
|
8865
|
+
scrollHintLeft ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Tooltip, { children: [
|
|
8866
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8637
8867
|
Button,
|
|
8638
8868
|
{
|
|
8639
8869
|
type: "button",
|
|
@@ -8643,13 +8873,13 @@ function MatrxDataTableCore({
|
|
|
8643
8873
|
"data-matrx-table-scroll-control": "left",
|
|
8644
8874
|
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",
|
|
8645
8875
|
onClick: () => scrollTableHorizontally("left"),
|
|
8646
|
-
children: /* @__PURE__ */ (0,
|
|
8876
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ChevronLeft, { className: "h-5 w-5" })
|
|
8647
8877
|
}
|
|
8648
8878
|
) }),
|
|
8649
|
-
/* @__PURE__ */ (0,
|
|
8879
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TooltipContent, { children: "More columns to the left" })
|
|
8650
8880
|
] }) : null,
|
|
8651
|
-
scrollHintRight ? /* @__PURE__ */ (0,
|
|
8652
|
-
/* @__PURE__ */ (0,
|
|
8881
|
+
scrollHintRight ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Tooltip, { children: [
|
|
8882
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8653
8883
|
Button,
|
|
8654
8884
|
{
|
|
8655
8885
|
type: "button",
|
|
@@ -8659,26 +8889,26 @@ function MatrxDataTableCore({
|
|
|
8659
8889
|
"data-matrx-table-scroll-control": "right",
|
|
8660
8890
|
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",
|
|
8661
8891
|
onClick: () => scrollTableHorizontally("right"),
|
|
8662
|
-
children: /* @__PURE__ */ (0,
|
|
8892
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ChevronRight, { className: "h-5 w-5" })
|
|
8663
8893
|
}
|
|
8664
8894
|
) }),
|
|
8665
|
-
/* @__PURE__ */ (0,
|
|
8895
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TooltipContent, { children: "More columns to the right" })
|
|
8666
8896
|
] }) : null
|
|
8667
8897
|
] }),
|
|
8668
|
-
appendQuery ? /* @__PURE__ */ (0,
|
|
8898
|
+
appendQuery ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
8669
8899
|
"div",
|
|
8670
8900
|
{
|
|
8671
8901
|
"data-matrx-table-footer": true,
|
|
8672
8902
|
className: "flex min-h-16 shrink-0 flex-wrap items-center justify-between gap-3 border-t border-border px-3 py-2",
|
|
8673
8903
|
"aria-busy": isLoading || isFetching,
|
|
8674
8904
|
children: [
|
|
8675
|
-
/* @__PURE__ */ (0,
|
|
8905
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
8676
8906
|
"div",
|
|
8677
8907
|
{
|
|
8678
8908
|
...isFetching && !isLoading ? {} : { role: "status", "aria-live": "polite" },
|
|
8679
8909
|
className: "flex w-full min-w-0 flex-none items-center gap-2 text-xs text-muted-foreground sm:w-auto sm:flex-1",
|
|
8680
8910
|
children: [
|
|
8681
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
8911
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8682
8912
|
Loader2,
|
|
8683
8913
|
{
|
|
8684
8914
|
"data-matrx-table-append-loader": true,
|
|
@@ -8686,40 +8916,40 @@ function MatrxDataTableCore({
|
|
|
8686
8916
|
className: "h-5 w-5 shrink-0 animate-spin text-primary motion-reduce:animate-none"
|
|
8687
8917
|
}
|
|
8688
8918
|
) : null,
|
|
8689
|
-
/* @__PURE__ */ (0,
|
|
8690
|
-
/* @__PURE__ */ (0,
|
|
8691
|
-
appendQuery.pagination.sourceUntil ? /* @__PURE__ */ (0,
|
|
8919
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "min-w-0", children: [
|
|
8920
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "break-words font-medium text-foreground", children: isLoading ? "Loading rows\u2026" : `${data.length.toLocaleString()} loaded${appendQuery.pagination.totalItems === void 0 ? "" : ` of ${appendQuery.pagination.totalItems.toLocaleString()}`}` }),
|
|
8921
|
+
appendQuery.pagination.sourceUntil ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("p", { children: [
|
|
8692
8922
|
"Source fixed through",
|
|
8693
8923
|
" ",
|
|
8694
8924
|
new Date(appendQuery.pagination.sourceUntil).toLocaleString(),
|
|
8695
8925
|
"."
|
|
8696
8926
|
] }) : null,
|
|
8697
|
-
!isLoading && !isFetching && !appendQuery.pagination.loadAll?.isLoading && !scrollPagination.error && !appendQuery.pagination.hasNextPage && appendQuery.pagination.totalItems !== void 0 && data.length === appendQuery.pagination.totalItems ? /* @__PURE__ */ (0,
|
|
8698
|
-
scrollPagination.error ? /* @__PURE__ */ (0,
|
|
8927
|
+
!isLoading && !isFetching && !appendQuery.pagination.loadAll?.isLoading && !scrollPagination.error && !appendQuery.pagination.hasNextPage && appendQuery.pagination.totalItems !== void 0 && data.length === appendQuery.pagination.totalItems ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { children: "All source rows are loaded." }) : appendUsesLocalProcessing ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { children: "Local search and filters cover loaded rows." }) : null,
|
|
8928
|
+
scrollPagination.error ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { role: "alert", className: "break-words text-destructive", children: scrollPagination.error.message }) : null
|
|
8699
8929
|
] })
|
|
8700
8930
|
]
|
|
8701
8931
|
}
|
|
8702
8932
|
),
|
|
8703
|
-
appendQuery.pagination.sourcePageSize ? /* @__PURE__ */ (0,
|
|
8933
|
+
appendQuery.pagination.sourcePageSize ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
8704
8934
|
Select,
|
|
8705
8935
|
{
|
|
8706
8936
|
value: String(appendQuery.pagination.sourcePageSize.value),
|
|
8707
8937
|
onValueChange: (value) => appendQuery.pagination.sourcePageSize?.onChange(Number(value)),
|
|
8708
8938
|
children: [
|
|
8709
|
-
/* @__PURE__ */ (0,
|
|
8939
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8710
8940
|
SelectTrigger,
|
|
8711
8941
|
{
|
|
8712
8942
|
"aria-label": "Rows per load",
|
|
8713
8943
|
className: "h-8 w-20 shrink-0 text-xs sm:w-24",
|
|
8714
8944
|
disabled: isLoading || isFetching || appendQuery.pagination.loadAll?.isLoading,
|
|
8715
|
-
children: /* @__PURE__ */ (0,
|
|
8945
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SelectValue, {})
|
|
8716
8946
|
}
|
|
8717
8947
|
),
|
|
8718
|
-
/* @__PURE__ */ (0,
|
|
8948
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SelectContent, { children: appendQuery.pagination.sourcePageSize.options.map((size) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SelectItem, { value: String(size), children: size }, size)) })
|
|
8719
8949
|
]
|
|
8720
8950
|
}
|
|
8721
8951
|
) : null,
|
|
8722
|
-
appendQuery.pagination.loadAll?.isLoading ? /* @__PURE__ */ (0,
|
|
8952
|
+
appendQuery.pagination.loadAll?.isLoading ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8723
8953
|
Button,
|
|
8724
8954
|
{
|
|
8725
8955
|
type: "button",
|
|
@@ -8727,7 +8957,7 @@ function MatrxDataTableCore({
|
|
|
8727
8957
|
onClick: appendQuery.pagination.loadAll.stop,
|
|
8728
8958
|
children: "Stop loading"
|
|
8729
8959
|
}
|
|
8730
|
-
) : scrollPagination.error ? /* @__PURE__ */ (0,
|
|
8960
|
+
) : scrollPagination.error ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8731
8961
|
Button,
|
|
8732
8962
|
{
|
|
8733
8963
|
type: "button",
|
|
@@ -8735,8 +8965,8 @@ function MatrxDataTableCore({
|
|
|
8735
8965
|
onClick: appendQuery.pagination.retrySource ?? (appendQuery.pagination.hasNextPage ? appendQuery.pagination.loadNextPage : appendQuery.pagination.refresh),
|
|
8736
8966
|
children: appendQuery.pagination.retrySource ? "Retry source" : appendQuery.pagination.hasNextPage ? "Retry" : "Reload rows"
|
|
8737
8967
|
}
|
|
8738
|
-
) : appendQuery.pagination.hasNextPage || scrollPagination.error ? /* @__PURE__ */ (0,
|
|
8739
|
-
/* @__PURE__ */ (0,
|
|
8968
|
+
) : appendQuery.pagination.hasNextPage || scrollPagination.error ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex flex-wrap gap-1", children: [
|
|
8969
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8740
8970
|
Button,
|
|
8741
8971
|
{
|
|
8742
8972
|
type: "button",
|
|
@@ -8747,7 +8977,7 @@ function MatrxDataTableCore({
|
|
|
8747
8977
|
children: "Load more"
|
|
8748
8978
|
}
|
|
8749
8979
|
),
|
|
8750
|
-
appendQuery.pagination.loadAll ? /* @__PURE__ */ (0,
|
|
8980
|
+
appendQuery.pagination.loadAll ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8751
8981
|
Button,
|
|
8752
8982
|
{
|
|
8753
8983
|
type: "button",
|
|
@@ -8758,10 +8988,10 @@ function MatrxDataTableCore({
|
|
|
8758
8988
|
children: "Load all"
|
|
8759
8989
|
}
|
|
8760
8990
|
) : null
|
|
8761
|
-
] }) : !isLoading && appendQuery.pagination.totalItems !== void 0 && data.length === appendQuery.pagination.totalItems ? /* @__PURE__ */ (0,
|
|
8991
|
+
] }) : !isLoading && appendQuery.pagination.totalItems !== void 0 && data.length === appendQuery.pagination.totalItems ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-xs text-muted-foreground", children: "All rows loaded" }) : null
|
|
8762
8992
|
]
|
|
8763
8993
|
}
|
|
8764
|
-
) : !hidePagination && totalItems > 0 ? /* @__PURE__ */ (0,
|
|
8994
|
+
) : !hidePagination && totalItems > 0 ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8765
8995
|
GenericTablePagination,
|
|
8766
8996
|
{
|
|
8767
8997
|
totalItems,
|
|
@@ -8781,7 +9011,7 @@ function MatrxDataTableCore({
|
|
|
8781
9011
|
}
|
|
8782
9012
|
) }) : null
|
|
8783
9013
|
] }),
|
|
8784
|
-
/* @__PURE__ */ (0,
|
|
9014
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8785
9015
|
ColumnManager,
|
|
8786
9016
|
{
|
|
8787
9017
|
open: columnManagerOpen,
|
|
@@ -8792,7 +9022,7 @@ function MatrxDataTableCore({
|
|
|
8792
9022
|
onApply: commitColumnState
|
|
8793
9023
|
}
|
|
8794
9024
|
),
|
|
8795
|
-
detailEnabled && selectedRow ? /* @__PURE__ */ (0,
|
|
9025
|
+
detailEnabled && selectedRow ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8796
9026
|
SidePanelSurface,
|
|
8797
9027
|
{
|
|
8798
9028
|
title: resolveStringTitle(
|
|
@@ -8803,8 +9033,8 @@ function MatrxDataTableCore({
|
|
|
8803
9033
|
description: detail?.description?.(selectedRow),
|
|
8804
9034
|
onClose: () => setSelectedId(null),
|
|
8805
9035
|
defaultWidth: detail?.defaultWidth ?? 480,
|
|
8806
|
-
headerActions: /* @__PURE__ */ (0,
|
|
8807
|
-
effectiveCopy && showRowCopy ? /* @__PURE__ */ (0,
|
|
9036
|
+
headerActions: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
9037
|
+
effectiveCopy && showRowCopy ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8808
9038
|
TableRowCopyControl,
|
|
8809
9039
|
{
|
|
8810
9040
|
size: "icon",
|
|
@@ -8815,8 +9045,8 @@ function MatrxDataTableCore({
|
|
|
8815
9045
|
}
|
|
8816
9046
|
) : null,
|
|
8817
9047
|
detail?.headerActions?.(selectedRow),
|
|
8818
|
-
windowEnabled ? /* @__PURE__ */ (0,
|
|
8819
|
-
/* @__PURE__ */ (0,
|
|
9048
|
+
windowEnabled ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Tooltip, { children: [
|
|
9049
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8820
9050
|
Button,
|
|
8821
9051
|
{
|
|
8822
9052
|
type: "button",
|
|
@@ -8825,10 +9055,10 @@ function MatrxDataTableCore({
|
|
|
8825
9055
|
className: "h-7 w-7",
|
|
8826
9056
|
"aria-label": "Open in window",
|
|
8827
9057
|
onClick: () => openWindow(selectedRow),
|
|
8828
|
-
children: /* @__PURE__ */ (0,
|
|
9058
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(PanelRight, { className: "h-3.5 w-3.5" })
|
|
8829
9059
|
}
|
|
8830
9060
|
) }),
|
|
8831
|
-
/* @__PURE__ */ (0,
|
|
9061
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TooltipContent, { children: "Open in window" })
|
|
8832
9062
|
] }) : null
|
|
8833
9063
|
] }),
|
|
8834
9064
|
children: detail?.render ? (
|
|
@@ -8839,7 +9069,7 @@ function MatrxDataTableCore({
|
|
|
8839
9069
|
// fixes the whole class at once — a custom body that already
|
|
8840
9070
|
// scrolls (`h-full` + `overflow-y-auto` root) still resolves to
|
|
8841
9071
|
// this container's height, so no second scrollbar appears.
|
|
8842
|
-
/* @__PURE__ */ (0,
|
|
9072
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "h-full min-h-0 overflow-y-auto", children: detail.render(selectedRow, {
|
|
8843
9073
|
closeDetail: () => setSelectedId(null),
|
|
8844
9074
|
openDetail: () => openDetail(selectedRow),
|
|
8845
9075
|
openWindow: () => openWindow(selectedRow),
|
|
@@ -8847,7 +9077,7 @@ function MatrxDataTableCore({
|
|
|
8847
9077
|
hasPendingEdits: Boolean(edits[getRowId(selectedRow)]),
|
|
8848
9078
|
discardPendingEdits: () => discardRowEdits(getRowId(selectedRow))
|
|
8849
9079
|
}) })
|
|
8850
|
-
) : /* @__PURE__ */ (0,
|
|
9080
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8851
9081
|
DataRowInspector,
|
|
8852
9082
|
{
|
|
8853
9083
|
row: selectedRow,
|
|
@@ -8859,7 +9089,7 @@ function MatrxDataTableCore({
|
|
|
8859
9089
|
)
|
|
8860
9090
|
}
|
|
8861
9091
|
) : null,
|
|
8862
|
-
windowRow ? /* @__PURE__ */ (0,
|
|
9092
|
+
windowRow ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8863
9093
|
DataRowWindow,
|
|
8864
9094
|
{
|
|
8865
9095
|
isOpen: true,
|
|
@@ -8870,9 +9100,9 @@ function MatrxDataTableCore({
|
|
|
8870
9100
|
height: windowConfig?.height,
|
|
8871
9101
|
windowId: `matrx-data-row-${urlState?.id ?? "local"}-${getRowId(windowRow)}`,
|
|
8872
9102
|
defaultTab: windowConfig?.defaultTab,
|
|
8873
|
-
headerActions: /* @__PURE__ */ (0,
|
|
8874
|
-
opensWindowOnRowClick && detailEnabled ? /* @__PURE__ */ (0,
|
|
8875
|
-
/* @__PURE__ */ (0,
|
|
9103
|
+
headerActions: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
9104
|
+
opensWindowOnRowClick && detailEnabled ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Tooltip, { children: [
|
|
9105
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8876
9106
|
Button,
|
|
8877
9107
|
{
|
|
8878
9108
|
type: "button",
|
|
@@ -8884,12 +9114,12 @@ function MatrxDataTableCore({
|
|
|
8884
9114
|
closeWindow();
|
|
8885
9115
|
openDetail(windowRow);
|
|
8886
9116
|
},
|
|
8887
|
-
children: /* @__PURE__ */ (0,
|
|
9117
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(PanelRightOpen, { className: "h-3.5 w-3.5" })
|
|
8888
9118
|
}
|
|
8889
9119
|
) }),
|
|
8890
|
-
/* @__PURE__ */ (0,
|
|
9120
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TooltipContent, { children: "Open in side panel" })
|
|
8891
9121
|
] }) : null,
|
|
8892
|
-
effectiveCopy && showRowCopy ? /* @__PURE__ */ (0,
|
|
9122
|
+
effectiveCopy && showRowCopy ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8893
9123
|
TableRowCopyControl,
|
|
8894
9124
|
{
|
|
8895
9125
|
size: "icon",
|
|
@@ -8907,7 +9137,7 @@ function MatrxDataTableCore({
|
|
|
8907
9137
|
closeWindow,
|
|
8908
9138
|
hasPendingEdits: Boolean(edits[getRowId(windowRow)]),
|
|
8909
9139
|
discardPendingEdits: () => discardRowEdits(getRowId(windowRow))
|
|
8910
|
-
}) ?? /* @__PURE__ */ (0,
|
|
9140
|
+
}) ?? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8911
9141
|
DataRowInspector,
|
|
8912
9142
|
{
|
|
8913
9143
|
row: windowRow,
|
|
@@ -8943,15 +9173,15 @@ function MatrxDataTableCore({
|
|
|
8943
9173
|
})
|
|
8944
9174
|
}
|
|
8945
9175
|
) : null,
|
|
8946
|
-
editEnabled ? /* @__PURE__ */ (0,
|
|
8947
|
-
foreignDrafts.length > 0 ? /* @__PURE__ */ (0,
|
|
9176
|
+
editEnabled ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
9177
|
+
foreignDrafts.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
8948
9178
|
"div",
|
|
8949
9179
|
{
|
|
8950
9180
|
"data-matrx-foreign-drafts": true,
|
|
8951
9181
|
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",
|
|
8952
9182
|
children: [
|
|
8953
|
-
/* @__PURE__ */ (0,
|
|
8954
|
-
/* @__PURE__ */ (0,
|
|
9183
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: "Unsaved edits from previous results" }),
|
|
9184
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8955
9185
|
CopyButtons,
|
|
8956
9186
|
{
|
|
8957
9187
|
size: "xs",
|
|
@@ -8960,11 +9190,11 @@ function MatrxDataTableCore({
|
|
|
8960
9190
|
json: () => foreignDraftPayload
|
|
8961
9191
|
}
|
|
8962
9192
|
),
|
|
8963
|
-
/* @__PURE__ */ (0,
|
|
9193
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Button, { type: "button", size: "sm", variant: "ghost", className: "h-7 text-xs text-destructive", onClick: () => setConfirmForeignDraftDiscard(true), children: "Discard drafts" })
|
|
8964
9194
|
]
|
|
8965
9195
|
}
|
|
8966
9196
|
) : null,
|
|
8967
|
-
/* @__PURE__ */ (0,
|
|
9197
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8968
9198
|
ConfirmDialog,
|
|
8969
9199
|
{
|
|
8970
9200
|
open: confirmForeignDraftDiscard,
|
|
@@ -8984,7 +9214,7 @@ function MatrxDataTableCore({
|
|
|
8984
9214
|
}
|
|
8985
9215
|
}
|
|
8986
9216
|
),
|
|
8987
|
-
/* @__PURE__ */ (0,
|
|
9217
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
8988
9218
|
DirtySavePill,
|
|
8989
9219
|
{
|
|
8990
9220
|
changeCount,
|
|
@@ -8997,11 +9227,11 @@ function MatrxDataTableCore({
|
|
|
8997
9227
|
]
|
|
8998
9228
|
}
|
|
8999
9229
|
),
|
|
9000
|
-
/* @__PURE__ */ (0,
|
|
9230
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_core3.DragOverlay, { children: draggedRow ? (
|
|
9001
9231
|
// w-max: the overlay inherits the ACTIVE node's size, and the active
|
|
9002
9232
|
// node is the 16px grip handle — without it the label wraps to one
|
|
9003
9233
|
// character per line.
|
|
9004
|
-
/* @__PURE__ */ (0,
|
|
9234
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("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" })
|
|
9005
9235
|
) : null })
|
|
9006
9236
|
]
|
|
9007
9237
|
}
|
|
@@ -9016,7 +9246,7 @@ function HierarchyDragHandle({
|
|
|
9016
9246
|
id,
|
|
9017
9247
|
disabled
|
|
9018
9248
|
});
|
|
9019
|
-
return /* @__PURE__ */ (0,
|
|
9249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
9020
9250
|
"button",
|
|
9021
9251
|
{
|
|
9022
9252
|
ref: setNodeRef,
|
|
@@ -9028,7 +9258,7 @@ function HierarchyDragHandle({
|
|
|
9028
9258
|
onClick: (event) => event.stopPropagation(),
|
|
9029
9259
|
...attributes,
|
|
9030
9260
|
...listeners,
|
|
9031
|
-
children: /* @__PURE__ */ (0,
|
|
9261
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(GripVertical, { className: "h-3.5 w-3.5" })
|
|
9032
9262
|
}
|
|
9033
9263
|
);
|
|
9034
9264
|
}
|
|
@@ -9037,7 +9267,7 @@ function HierarchyRootDropTarget({
|
|
|
9037
9267
|
draggedLabel
|
|
9038
9268
|
}) {
|
|
9039
9269
|
const { isOver, setNodeRef } = (0, import_core3.useDroppable)({ id: "__root__" });
|
|
9040
|
-
return /* @__PURE__ */ (0,
|
|
9270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
9041
9271
|
"div",
|
|
9042
9272
|
{
|
|
9043
9273
|
ref: setNodeRef,
|
|
@@ -9047,8 +9277,8 @@ function HierarchyRootDropTarget({
|
|
|
9047
9277
|
isOver && "border-solid bg-primary/20 shadow-md shadow-primary/25"
|
|
9048
9278
|
),
|
|
9049
9279
|
children: [
|
|
9050
|
-
/* @__PURE__ */ (0,
|
|
9051
|
-
/* @__PURE__ */ (0,
|
|
9280
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "truncate", children: draggedLabel }),
|
|
9281
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-primary/75", children: label })
|
|
9052
9282
|
]
|
|
9053
9283
|
}
|
|
9054
9284
|
);
|
|
@@ -9097,7 +9327,7 @@ function HierarchyDragIndicatorLayer({
|
|
|
9097
9327
|
const { preview: preview2 } = indicator;
|
|
9098
9328
|
const indent = indicator.left + 10 + preview2.depth * 12;
|
|
9099
9329
|
if (preview2.position === "inside") {
|
|
9100
|
-
return /* @__PURE__ */ (0,
|
|
9330
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
9101
9331
|
"div",
|
|
9102
9332
|
{
|
|
9103
9333
|
"aria-hidden": "true",
|
|
@@ -9109,7 +9339,7 @@ function HierarchyDragIndicatorLayer({
|
|
|
9109
9339
|
width: Math.max(0, indicator.width - 4),
|
|
9110
9340
|
height: indicator.height
|
|
9111
9341
|
},
|
|
9112
|
-
children: /* @__PURE__ */ (0,
|
|
9342
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
9113
9343
|
"span",
|
|
9114
9344
|
{
|
|
9115
9345
|
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",
|
|
@@ -9124,7 +9354,7 @@ function HierarchyDragIndicatorLayer({
|
|
|
9124
9354
|
);
|
|
9125
9355
|
}
|
|
9126
9356
|
const lineTop = preview2.position === "before" ? indicator.top - 1 : indicator.top + indicator.height - 1;
|
|
9127
|
-
return /* @__PURE__ */ (0,
|
|
9357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
9128
9358
|
"div",
|
|
9129
9359
|
{
|
|
9130
9360
|
"aria-hidden": "true",
|
|
@@ -9135,9 +9365,9 @@ function HierarchyDragIndicatorLayer({
|
|
|
9135
9365
|
left: indent,
|
|
9136
9366
|
width: Math.max(0, indicator.left + indicator.width - indent - 8)
|
|
9137
9367
|
},
|
|
9138
|
-
children: /* @__PURE__ */ (0,
|
|
9139
|
-
/* @__PURE__ */ (0,
|
|
9140
|
-
/* @__PURE__ */ (0,
|
|
9368
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "relative h-0.5 rounded-full bg-primary", children: [
|
|
9369
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "absolute -left-1 top-1/2 h-2 w-2 -translate-y-1/2 rounded-full border-2 border-primary bg-card" }),
|
|
9370
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
9141
9371
|
"span",
|
|
9142
9372
|
{
|
|
9143
9373
|
className: cn(
|
|
@@ -9178,7 +9408,7 @@ function ColumnHeaderDropZone({
|
|
|
9178
9408
|
disabled: !enabled,
|
|
9179
9409
|
data: { matrxDragKind: "column-header", columnId: id }
|
|
9180
9410
|
});
|
|
9181
|
-
return /* @__PURE__ */ (0,
|
|
9411
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { ref: setNodeRef, className: "flex min-w-0 items-center", children });
|
|
9182
9412
|
}
|
|
9183
9413
|
function columnWidthVar(width) {
|
|
9184
9414
|
if (width === void 0) return void 0;
|
|
@@ -9194,7 +9424,7 @@ function renderCell(row, col, index) {
|
|
|
9194
9424
|
if (asUuid && typeof raw === "string") {
|
|
9195
9425
|
const forbidden = typeof col.fk?.forbidden === "function" ? col.fk.forbidden(raw, row) : Boolean(col.fk?.forbidden);
|
|
9196
9426
|
const declaredToken = typeof col.fk?.token === "function" ? col.fk.token(row) : col.fk?.token;
|
|
9197
|
-
return /* @__PURE__ */ (0,
|
|
9427
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
9198
9428
|
MatrxUuidCell,
|
|
9199
9429
|
{
|
|
9200
9430
|
value: raw,
|
|
@@ -9206,7 +9436,7 @@ function renderCell(row, col, index) {
|
|
|
9206
9436
|
}
|
|
9207
9437
|
);
|
|
9208
9438
|
}
|
|
9209
|
-
return /* @__PURE__ */ (0,
|
|
9439
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-sm text-foreground", children: stringifyCellValue(raw) || "\u2014" });
|
|
9210
9440
|
}
|
|
9211
9441
|
function defaultRowTitle(row, columns) {
|
|
9212
9442
|
for (const col of columns) {
|
|
@@ -9221,6 +9451,236 @@ function resolveStringTitle(title, fallback) {
|
|
|
9221
9451
|
return fallback;
|
|
9222
9452
|
}
|
|
9223
9453
|
|
|
9454
|
+
// src/data-table/SavedViewsControl.tsx
|
|
9455
|
+
var import_react14 = require("react");
|
|
9456
|
+
|
|
9457
|
+
// src/dropdown-menu.tsx
|
|
9458
|
+
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"), 1);
|
|
9459
|
+
var React16 = __toESM(require("react"), 1);
|
|
9460
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
9461
|
+
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
9462
|
+
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
9463
|
+
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
9464
|
+
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";
|
|
9465
|
+
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";
|
|
9466
|
+
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";
|
|
9467
|
+
var DropdownMenuSubTrigger = React16.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
9468
|
+
DropdownMenuPrimitive.SubTrigger,
|
|
9469
|
+
{
|
|
9470
|
+
ref,
|
|
9471
|
+
"data-slot": "dropdown-menu-sub-trigger",
|
|
9472
|
+
className: cn(
|
|
9473
|
+
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
|
|
9474
|
+
inset && "pl-8",
|
|
9475
|
+
className
|
|
9476
|
+
),
|
|
9477
|
+
...props,
|
|
9478
|
+
children: [
|
|
9479
|
+
children,
|
|
9480
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(RadixChevronRightIcon, { className: "ml-auto h-4 w-4" })
|
|
9481
|
+
]
|
|
9482
|
+
}
|
|
9483
|
+
));
|
|
9484
|
+
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
9485
|
+
var DropdownMenuSubContent = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9486
|
+
DropdownMenuPrimitive.SubContent,
|
|
9487
|
+
{
|
|
9488
|
+
ref,
|
|
9489
|
+
"data-slot": "dropdown-menu-sub-content",
|
|
9490
|
+
className: cn(MENU_SURFACE_CLASS, "shadow-lg", MOTION_POPPER, className),
|
|
9491
|
+
...props
|
|
9492
|
+
}
|
|
9493
|
+
));
|
|
9494
|
+
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
9495
|
+
var DropdownMenuContent = React16.forwardRef(({ className, sideOffset = 4, container, ...props }, ref) => {
|
|
9496
|
+
const portalContainer = usePortalContainer(container);
|
|
9497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(DropdownMenuPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9498
|
+
DropdownMenuPrimitive.Content,
|
|
9499
|
+
{
|
|
9500
|
+
ref,
|
|
9501
|
+
"data-slot": "dropdown-menu-content",
|
|
9502
|
+
sideOffset,
|
|
9503
|
+
className: cn(
|
|
9504
|
+
MENU_SURFACE_CLASS,
|
|
9505
|
+
"shadow-md",
|
|
9506
|
+
MOTION_POPPER,
|
|
9507
|
+
className
|
|
9508
|
+
),
|
|
9509
|
+
...props
|
|
9510
|
+
}
|
|
9511
|
+
) });
|
|
9512
|
+
});
|
|
9513
|
+
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
9514
|
+
var DropdownMenuItem = React16.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9515
|
+
DropdownMenuPrimitive.Item,
|
|
9516
|
+
{
|
|
9517
|
+
ref,
|
|
9518
|
+
"data-slot": "dropdown-menu-item",
|
|
9519
|
+
className: cn(MENU_ITEM_CLASS, inset && "pl-8", className),
|
|
9520
|
+
...props
|
|
9521
|
+
}
|
|
9522
|
+
));
|
|
9523
|
+
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
9524
|
+
var DropdownMenuCheckboxItem = React16.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
9525
|
+
DropdownMenuPrimitive.CheckboxItem,
|
|
9526
|
+
{
|
|
9527
|
+
ref,
|
|
9528
|
+
"data-slot": "dropdown-menu-checkbox-item",
|
|
9529
|
+
className: cn(MENU_INDICATOR_ITEM_CLASS, className),
|
|
9530
|
+
...props,
|
|
9531
|
+
children: [
|
|
9532
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CheckIcon, { className: "h-4 w-4" }) }) }),
|
|
9533
|
+
children
|
|
9534
|
+
]
|
|
9535
|
+
}
|
|
9536
|
+
));
|
|
9537
|
+
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
9538
|
+
var DropdownMenuRadioItem = React16.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
9539
|
+
DropdownMenuPrimitive.RadioItem,
|
|
9540
|
+
{
|
|
9541
|
+
ref,
|
|
9542
|
+
"data-slot": "dropdown-menu-radio-item",
|
|
9543
|
+
className: cn(MENU_INDICATOR_ITEM_CLASS, className),
|
|
9544
|
+
...props,
|
|
9545
|
+
children: [
|
|
9546
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(DotFilledIcon, { className: "h-4 w-4 fill-current" }) }) }),
|
|
9547
|
+
children
|
|
9548
|
+
]
|
|
9549
|
+
}
|
|
9550
|
+
));
|
|
9551
|
+
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
9552
|
+
var DropdownMenuLabel = React16.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9553
|
+
DropdownMenuPrimitive.Label,
|
|
9554
|
+
{
|
|
9555
|
+
ref,
|
|
9556
|
+
"data-slot": "dropdown-menu-label",
|
|
9557
|
+
className: cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className),
|
|
9558
|
+
...props
|
|
9559
|
+
}
|
|
9560
|
+
));
|
|
9561
|
+
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
9562
|
+
var DropdownMenuSeparator = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9563
|
+
DropdownMenuPrimitive.Separator,
|
|
9564
|
+
{
|
|
9565
|
+
ref,
|
|
9566
|
+
"data-slot": "dropdown-menu-separator",
|
|
9567
|
+
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
9568
|
+
...props
|
|
9569
|
+
}
|
|
9570
|
+
));
|
|
9571
|
+
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
9572
|
+
var DropdownMenuShortcut = ({
|
|
9573
|
+
className,
|
|
9574
|
+
...props
|
|
9575
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9576
|
+
"span",
|
|
9577
|
+
{
|
|
9578
|
+
"data-slot": "dropdown-menu-shortcut",
|
|
9579
|
+
className: cn("ml-auto text-xs tracking-widest opacity-60", className),
|
|
9580
|
+
...props
|
|
9581
|
+
}
|
|
9582
|
+
);
|
|
9583
|
+
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
9584
|
+
|
|
9585
|
+
// src/data-table/SavedViewsControl.tsx
|
|
9586
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
9587
|
+
function SavedViewsControl({
|
|
9588
|
+
views,
|
|
9589
|
+
activeId = null,
|
|
9590
|
+
loading = false,
|
|
9591
|
+
error,
|
|
9592
|
+
dirty = false,
|
|
9593
|
+
onSelect,
|
|
9594
|
+
onSaveNew,
|
|
9595
|
+
onUpdate,
|
|
9596
|
+
onReload
|
|
9597
|
+
}) {
|
|
9598
|
+
const [saveOpen, setSaveOpen] = (0, import_react14.useState)(false);
|
|
9599
|
+
const [name, setName] = (0, import_react14.useState)("");
|
|
9600
|
+
const [saving, setSaving] = (0, import_react14.useState)(false);
|
|
9601
|
+
const [actionError, setActionError] = (0, import_react14.useState)(null);
|
|
9602
|
+
const visibleError = actionError ?? error;
|
|
9603
|
+
const save = async () => {
|
|
9604
|
+
const next = name.trim();
|
|
9605
|
+
if (!next) return;
|
|
9606
|
+
setSaving(true);
|
|
9607
|
+
setActionError(null);
|
|
9608
|
+
try {
|
|
9609
|
+
await onSaveNew(next);
|
|
9610
|
+
setName("");
|
|
9611
|
+
setSaveOpen(false);
|
|
9612
|
+
} catch (cause) {
|
|
9613
|
+
setActionError(cause instanceof Error ? cause.message : String(cause));
|
|
9614
|
+
} finally {
|
|
9615
|
+
setSaving(false);
|
|
9616
|
+
}
|
|
9617
|
+
};
|
|
9618
|
+
const update = async () => {
|
|
9619
|
+
if (!onUpdate) return;
|
|
9620
|
+
setSaving(true);
|
|
9621
|
+
setActionError(null);
|
|
9622
|
+
try {
|
|
9623
|
+
await onUpdate();
|
|
9624
|
+
} catch (cause) {
|
|
9625
|
+
setActionError(cause instanceof Error ? cause.message : String(cause));
|
|
9626
|
+
} finally {
|
|
9627
|
+
setSaving(false);
|
|
9628
|
+
}
|
|
9629
|
+
};
|
|
9630
|
+
const reload = async () => {
|
|
9631
|
+
if (!onReload) return;
|
|
9632
|
+
setSaving(true);
|
|
9633
|
+
setActionError(null);
|
|
9634
|
+
try {
|
|
9635
|
+
await onReload();
|
|
9636
|
+
} catch (cause) {
|
|
9637
|
+
setActionError(cause instanceof Error ? cause.message : String(cause));
|
|
9638
|
+
} finally {
|
|
9639
|
+
setSaving(false);
|
|
9640
|
+
}
|
|
9641
|
+
};
|
|
9642
|
+
const activeName = activeId ? views.find((view) => view.id === activeId)?.name : void 0;
|
|
9643
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex items-center gap-1", "data-matrx-table-saved-views": true, children: [
|
|
9644
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(DropdownMenu, { children: [
|
|
9645
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Tooltip, { children: [
|
|
9646
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Button, { type: "button", variant: "outline", size: "sm", className: "h-8 max-w-40 truncate text-xs", "aria-label": "Saved views", disabled: saving, children: loading ? "Loading views\u2026" : `${activeName ?? "Default view"}${dirty ? " \u2022" : ""}` }) }) }),
|
|
9647
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TooltipContent, { children: "Choose or save a table view" })
|
|
9648
|
+
] }),
|
|
9649
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(DropdownMenuContent, { align: "end", children: [
|
|
9650
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DropdownMenuLabel, { children: "Views" }),
|
|
9651
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(DropdownMenuRadioGroup, { value: activeId ?? "__default__", onValueChange: (value) => onSelect(value === "__default__" ? null : value), children: [
|
|
9652
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DropdownMenuRadioItem, { value: "__default__", children: "Default view" }),
|
|
9653
|
+
views.map((view) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DropdownMenuRadioItem, { value: view.id, children: view.name }, view.id))
|
|
9654
|
+
] }),
|
|
9655
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DropdownMenuSeparator, {}),
|
|
9656
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DropdownMenuItem, { disabled: saving, onSelect: () => {
|
|
9657
|
+
setActionError(null);
|
|
9658
|
+
setSaveOpen(true);
|
|
9659
|
+
}, children: "Save current view\u2026" }),
|
|
9660
|
+
activeId && onUpdate ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DropdownMenuItem, { disabled: saving, onSelect: () => void update(), children: "Update current view" }) : null,
|
|
9661
|
+
onReload ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DropdownMenuItem, { disabled: saving || loading, onSelect: () => void reload(), children: "Reload views" }) : null
|
|
9662
|
+
] })
|
|
9663
|
+
] }),
|
|
9664
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Tooltip, { children: [
|
|
9665
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Button, { type: "button", variant: "ghost", size: "icon", className: "h-8 w-8", "aria-label": "Save current view", disabled: saving, onClick: () => {
|
|
9666
|
+
setActionError(null);
|
|
9667
|
+
setSaveOpen(true);
|
|
9668
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Save, { className: "h-4 w-4" }) }) }),
|
|
9669
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TooltipContent, { children: "Save current view" })
|
|
9670
|
+
] }),
|
|
9671
|
+
visibleError ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { role: "alert", className: "basis-full text-xs text-destructive", children: visibleError }) : null,
|
|
9672
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Dialog, { open: saveOpen, onOpenChange: setSaveOpen, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(DialogContent, { children: [
|
|
9673
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DialogTitle, { children: "Save current view" }) }),
|
|
9674
|
+
visibleError ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { role: "alert", className: "text-sm text-destructive", children: visibleError }) : null,
|
|
9675
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Input, { "aria-label": "View name", value: name, onChange: (event) => setName(event.target.value), placeholder: "View name", autoFocus: true }),
|
|
9676
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(DialogFooter, { children: [
|
|
9677
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Button, { type: "button", variant: "outline", onClick: () => setSaveOpen(false), children: "Cancel" }),
|
|
9678
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Button, { type: "button", disabled: !name.trim() || saving, onClick: () => void save(), children: saving ? "Saving\u2026" : "Save view" })
|
|
9679
|
+
] })
|
|
9680
|
+
] }) })
|
|
9681
|
+
] });
|
|
9682
|
+
}
|
|
9683
|
+
|
|
9224
9684
|
// src/data-table/tableXlsx.ts
|
|
9225
9685
|
var XLSX = __toESM(require("xlsx"), 1);
|
|
9226
9686
|
function downloadTableAsXlsx({
|