@ai-matrx/design-system 0.18.3 → 0.18.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +22 -0
- package/dist/content-transfer.cjs +8 -2
- package/dist/content-transfer.cjs.map +1 -1
- package/dist/content-transfer.d.cts +2 -0
- package/dist/content-transfer.d.ts +2 -0
- package/dist/content-transfer.js +8 -2
- 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 +8 -2
- package/dist/data-table/data-row-inspector.cjs.map +1 -1
- package/dist/data-table/data-row-inspector.js +8 -2
- package/dist/data-table/data-row-inspector.js.map +1 -1
- package/dist/data-table/data-row-window.cjs +8 -2
- package/dist/data-table/data-row-window.cjs.map +1 -1
- package/dist/data-table/data-row-window.js +8 -2
- 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/index.cjs +1041 -930
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.d.cts +23 -3
- package/dist/data-table/index.d.ts +23 -3
- package/dist/data-table/index.js +1041 -930
- 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 +2 -2
- package/dist/data-table/pagination.cjs.map +1 -1
- package/dist/data-table/pagination.js +2 -2
- package/dist/data-table/pagination.js.map +1 -1
- package/dist/data-table/query-control.d.cts +1 -1
- package/dist/data-table/query-control.d.ts +1 -1
- package/dist/data-table/types.cjs.map +1 -1
- package/dist/data-table/types.d.cts +1 -1
- package/dist/data-table/types.d.ts +1 -1
- package/dist/data-table/url-state.d.cts +1 -1
- package/dist/data-table/url-state.d.ts +1 -1
- package/dist/data-table/xlsx.d.cts +1 -1
- package/dist/data-table/xlsx.d.ts +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/{types-CD4xGL5Z.d.cts → types-Bx9SfdJM.d.cts} +2 -0
- package/dist/{types-BhSkeZQ_.d.ts → types-DyByb6tW.d.ts} +2 -0
- package/package.json +1 -1
|
@@ -440,6 +440,7 @@ __export(data_table_exports, {
|
|
|
440
440
|
MatrxDataTable: () => MatrxDataTable,
|
|
441
441
|
MatrxDataTableProvider: () => MatrxDataTableProvider,
|
|
442
442
|
MatrxUuidCell: () => MatrxUuidCell,
|
|
443
|
+
TableTitleRow: () => TableTitleRow,
|
|
443
444
|
buildRowAgentInput: () => buildRowAgentInput,
|
|
444
445
|
buildViewAgentInput: () => buildViewAgentInput,
|
|
445
446
|
buildViewHuman: () => buildViewHuman,
|
|
@@ -1131,7 +1132,7 @@ var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
|
1131
1132
|
var Select = SelectPrimitive.Root;
|
|
1132
1133
|
var SelectValue = SelectPrimitive.Value;
|
|
1133
1134
|
var selectTriggerVariants = (0, import_class_variance_authority2.cva)(
|
|
1134
|
-
"flex w-full items-center justify-between whitespace-nowrap rounded-md border border-border bg-card text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground transition-colors hover:bg-accent hover:border-accent-foreground/20 focus:outline-none focus:ring-1 focus:ring-primary/30 focus:border-primary/40 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
1135
|
+
"flex w-full items-center justify-between gap-2 whitespace-nowrap rounded-md border border-border bg-card text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground transition-colors hover:bg-accent hover:border-accent-foreground/20 focus:outline-none focus:ring-1 focus:ring-primary/30 focus:border-primary/40 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:min-w-0 [&>span]:line-clamp-1",
|
|
1135
1136
|
{
|
|
1136
1137
|
variants: {
|
|
1137
1138
|
size: {
|
|
@@ -1153,7 +1154,7 @@ var SelectTrigger = React6.forwardRef(({ className, children, hideArrow = false,
|
|
|
1153
1154
|
...props,
|
|
1154
1155
|
children: [
|
|
1155
1156
|
children,
|
|
1156
|
-
!hideArrow && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(RadixChevronDownIcon, { className: "h-4 w-4 opacity-50" }) })
|
|
1157
|
+
!hideArrow && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(RadixChevronDownIcon, { className: "h-4 w-4 shrink-0 opacity-50" }) })
|
|
1157
1158
|
]
|
|
1158
1159
|
}
|
|
1159
1160
|
));
|
|
@@ -1284,6 +1285,86 @@ function Skeleton({ className, animated = true, ...props }) {
|
|
|
1284
1285
|
);
|
|
1285
1286
|
}
|
|
1286
1287
|
|
|
1288
|
+
// src/data-table/TableTitleRow.tsx
|
|
1289
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1290
|
+
function TableTitleRow({
|
|
1291
|
+
title,
|
|
1292
|
+
headingLevel = 2,
|
|
1293
|
+
context,
|
|
1294
|
+
count,
|
|
1295
|
+
search,
|
|
1296
|
+
actions,
|
|
1297
|
+
children,
|
|
1298
|
+
className
|
|
1299
|
+
}) {
|
|
1300
|
+
const Heading = headingLevel === 1 ? "h1" : "h2";
|
|
1301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1302
|
+
"div",
|
|
1303
|
+
{
|
|
1304
|
+
"data-matrx-table-toolbar": true,
|
|
1305
|
+
className: cn(
|
|
1306
|
+
"flex min-w-0 shrink-0 flex-wrap items-center gap-2",
|
|
1307
|
+
className
|
|
1308
|
+
),
|
|
1309
|
+
children: [
|
|
1310
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Heading, { className: "min-w-0 break-words text-sm font-semibold", children: title }) : null,
|
|
1311
|
+
context,
|
|
1312
|
+
count ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1313
|
+
"span",
|
|
1314
|
+
{
|
|
1315
|
+
className: "shrink-0 rounded-md bg-muted px-2 py-0.5 text-xs tabular-nums",
|
|
1316
|
+
"aria-label": `${count.value.toLocaleString()} ${count.label}`,
|
|
1317
|
+
children: count.value.toLocaleString()
|
|
1318
|
+
}
|
|
1319
|
+
) : null,
|
|
1320
|
+
search ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1321
|
+
"div",
|
|
1322
|
+
{
|
|
1323
|
+
"data-matrx-table-title-search": true,
|
|
1324
|
+
className: "order-last w-full min-w-0 sm:order-none sm:w-auto sm:max-w-md sm:flex-1",
|
|
1325
|
+
children: search
|
|
1326
|
+
}
|
|
1327
|
+
) : null,
|
|
1328
|
+
children,
|
|
1329
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1330
|
+
"div",
|
|
1331
|
+
{
|
|
1332
|
+
"data-matrx-table-actions": true,
|
|
1333
|
+
className: "ml-auto flex min-w-0 flex-wrap items-center gap-2",
|
|
1334
|
+
children: actions
|
|
1335
|
+
}
|
|
1336
|
+
) : null
|
|
1337
|
+
]
|
|
1338
|
+
}
|
|
1339
|
+
);
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
// src/tooltip.tsx
|
|
1343
|
+
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
|
|
1344
|
+
var React7 = __toESM(require("react"), 1);
|
|
1345
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1346
|
+
var TooltipProvider = TooltipPrimitive.Provider;
|
|
1347
|
+
var Tooltip = TooltipPrimitive.Root;
|
|
1348
|
+
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
1349
|
+
var TooltipContent = React7.forwardRef(({ className, sideOffset = 4, container, animated = true, ...props }, ref) => {
|
|
1350
|
+
const resolved = usePortalContainer(container);
|
|
1351
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TooltipPrimitive.Portal, { container: resolved ?? null, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1352
|
+
TooltipPrimitive.Content,
|
|
1353
|
+
{
|
|
1354
|
+
ref,
|
|
1355
|
+
"data-slot": "tooltip-content",
|
|
1356
|
+
sideOffset,
|
|
1357
|
+
className: cn(
|
|
1358
|
+
"z-[10001] overflow-hidden rounded-md border border-border bg-popover px-3 py-1.5 text-xs text-popover-foreground shadow-md",
|
|
1359
|
+
animated && MOTION_POPPER,
|
|
1360
|
+
className
|
|
1361
|
+
),
|
|
1362
|
+
...props
|
|
1363
|
+
}
|
|
1364
|
+
) });
|
|
1365
|
+
});
|
|
1366
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
1367
|
+
|
|
1287
1368
|
// src/data-table/useScrollPagination.ts
|
|
1288
1369
|
var import_react = require("react");
|
|
1289
1370
|
var DEFAULT_THRESHOLD_PX = 96;
|
|
@@ -1495,31 +1576,31 @@ function useScrollPagination({
|
|
|
1495
1576
|
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
1496
1577
|
var VisuallyHidden = __toESM(require("@radix-ui/react-visually-hidden"), 1);
|
|
1497
1578
|
var import_react_tree2 = require("@ai-matrx/kit/react-tree");
|
|
1498
|
-
var
|
|
1579
|
+
var React10 = __toESM(require("react"), 1);
|
|
1499
1580
|
|
|
1500
1581
|
// src/radix-dialog-modal-context.tsx
|
|
1501
|
-
var
|
|
1502
|
-
var
|
|
1582
|
+
var React8 = __toESM(require("react"), 1);
|
|
1583
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1503
1584
|
var CONTEXT_SLOT2 = /* @__PURE__ */ Symbol.for("ai-matrx.design-system.dialog-modal-context");
|
|
1504
1585
|
var contextRegistry2 = globalThis;
|
|
1505
|
-
var RadixDialogModalContext = contextRegistry2[CONTEXT_SLOT2] ??=
|
|
1586
|
+
var RadixDialogModalContext = contextRegistry2[CONTEXT_SLOT2] ??= React8.createContext(true);
|
|
1506
1587
|
function RadixDialogModalProvider({
|
|
1507
1588
|
children,
|
|
1508
1589
|
modal
|
|
1509
1590
|
}) {
|
|
1510
|
-
return /* @__PURE__ */ (0,
|
|
1591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(RadixDialogModalContext.Provider, { value: modal, children });
|
|
1511
1592
|
}
|
|
1512
1593
|
function useRadixDialogModal() {
|
|
1513
|
-
return
|
|
1594
|
+
return React8.useContext(RadixDialogModalContext);
|
|
1514
1595
|
}
|
|
1515
1596
|
|
|
1516
1597
|
// src/use-is-mobile.ts
|
|
1517
|
-
var
|
|
1598
|
+
var React9 = __toESM(require("react"), 1);
|
|
1518
1599
|
var MOBILE_BREAKPOINT = 768;
|
|
1519
1600
|
function useIsMobile() {
|
|
1520
|
-
const [isMobile, setIsMobile] =
|
|
1521
|
-
const [hasMounted, setHasMounted] =
|
|
1522
|
-
|
|
1601
|
+
const [isMobile, setIsMobile] = React9.useState(false);
|
|
1602
|
+
const [hasMounted, setHasMounted] = React9.useState(false);
|
|
1603
|
+
React9.useEffect(() => {
|
|
1523
1604
|
setHasMounted(true);
|
|
1524
1605
|
const onChange = () => {
|
|
1525
1606
|
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
@@ -1539,13 +1620,13 @@ function useIsMobile() {
|
|
|
1539
1620
|
}
|
|
1540
1621
|
|
|
1541
1622
|
// src/dialog.tsx
|
|
1542
|
-
var
|
|
1623
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1543
1624
|
var Dialog = ({
|
|
1544
1625
|
children,
|
|
1545
1626
|
...props
|
|
1546
1627
|
}) => {
|
|
1547
1628
|
const modal = props.modal ?? true;
|
|
1548
|
-
return /* @__PURE__ */ (0,
|
|
1629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(RadixDialogModalProvider, { modal, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DialogPrimitive.Root, { ...props, modal, children }) });
|
|
1549
1630
|
};
|
|
1550
1631
|
Dialog.displayName = "Dialog";
|
|
1551
1632
|
var DialogPortal = ({
|
|
@@ -1553,13 +1634,13 @@ var DialogPortal = ({
|
|
|
1553
1634
|
...props
|
|
1554
1635
|
}) => {
|
|
1555
1636
|
const resolved = usePortalContainer(container);
|
|
1556
|
-
return /* @__PURE__ */ (0,
|
|
1637
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DialogPrimitive.Portal, { container: resolved ?? null, ...props });
|
|
1557
1638
|
};
|
|
1558
1639
|
DialogPortal.displayName = "DialogPortal";
|
|
1559
1640
|
var CONTEXT_SLOT3 = /* @__PURE__ */ Symbol.for("ai-matrx.design-system.dialog-container-context");
|
|
1560
1641
|
var contextRegistry3 = globalThis;
|
|
1561
|
-
var DialogContainerContext = contextRegistry3[CONTEXT_SLOT3] ??=
|
|
1562
|
-
var DialogOverlay =
|
|
1642
|
+
var DialogContainerContext = contextRegistry3[CONTEXT_SLOT3] ??= React10.createContext(null);
|
|
1643
|
+
var DialogOverlay = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1563
1644
|
DialogPrimitive.Overlay,
|
|
1564
1645
|
{
|
|
1565
1646
|
ref,
|
|
@@ -1575,9 +1656,9 @@ var DialogOverlay = React9.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
1575
1656
|
}
|
|
1576
1657
|
));
|
|
1577
1658
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
1578
|
-
var DialogContentPrimitive =
|
|
1659
|
+
var DialogContentPrimitive = React10.forwardRef((props, ref) => {
|
|
1579
1660
|
const isModal = useRadixDialogModal();
|
|
1580
|
-
return /* @__PURE__ */ (0,
|
|
1661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1581
1662
|
DialogPrimitive.Content,
|
|
1582
1663
|
{
|
|
1583
1664
|
...props,
|
|
@@ -1590,7 +1671,7 @@ DialogContentPrimitive.displayName = "DialogContentPrimitive";
|
|
|
1590
1671
|
var DIALOG_DESKTOP_CLASSES = "matrx-dialog-card fixed inset-0 z-[10000] m-auto grid h-fit min-w-0 w-full max-w-lg gap-4 max-h-[85dvh] overflow-y-auto overscroll-contain [--dialog-pad:1.5rem] overflow-x-clip border bg-background p-6 shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full sm:rounded-lg";
|
|
1591
1672
|
var DIALOG_MOBILE_SHEET_CLASSES = "matrx-mobile-sheet matrx-dialog-card fixed inset-x-0 bottom-0 left-0 right-0 top-auto z-[10000] flex min-w-0 flex-col w-full max-w-full max-h-[90dvh] gap-4 [--dialog-pad:1rem] overflow-x-clip border-t bg-background p-4 pb-safe shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full rounded-t-2xl rounded-b-none overflow-y-auto overscroll-contain";
|
|
1592
1673
|
var DIALOG_MOBILE_SHEET_OVERRIDE = "inset-x-0 bottom-0 left-0 right-0 top-auto translate-none w-full max-w-full max-h-[90dvh] rounded-b-none rounded-t-2xl overflow-y-auto";
|
|
1593
|
-
var DialogContent =
|
|
1674
|
+
var DialogContent = React10.forwardRef(
|
|
1594
1675
|
({
|
|
1595
1676
|
className,
|
|
1596
1677
|
children,
|
|
@@ -1604,10 +1685,10 @@ var DialogContent = React9.forwardRef(
|
|
|
1604
1685
|
const isModal = useRadixDialogModal();
|
|
1605
1686
|
const injectedContainer = usePortalContainer(container);
|
|
1606
1687
|
const asSheet = mobileSheet && isMobile;
|
|
1607
|
-
const [containerEl, setContainerEl] =
|
|
1688
|
+
const [containerEl, setContainerEl] = React10.useState(
|
|
1608
1689
|
null
|
|
1609
1690
|
);
|
|
1610
|
-
const mergedRef =
|
|
1691
|
+
const mergedRef = React10.useCallback(
|
|
1611
1692
|
(node) => {
|
|
1612
1693
|
setContainerEl(node);
|
|
1613
1694
|
if (typeof ref === "function") ref(node);
|
|
@@ -1618,9 +1699,9 @@ var DialogContent = React9.forwardRef(
|
|
|
1618
1699
|
);
|
|
1619
1700
|
const hasTitle = (0, import_react_tree2.treeContainsComponent)(children, DialogTitle) || (0, import_react_tree2.treeContainsComponent)(children, DialogPrimitive.Title);
|
|
1620
1701
|
const hasDescription = (0, import_react_tree2.treeContainsComponent)(children, DialogDescription) || (0, import_react_tree2.treeContainsComponent)(children, DialogPrimitive.Description);
|
|
1621
|
-
return /* @__PURE__ */ (0,
|
|
1622
|
-
isModal ? /* @__PURE__ */ (0,
|
|
1623
|
-
/* @__PURE__ */ (0,
|
|
1702
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(DialogPortal, { container, children: [
|
|
1703
|
+
isModal ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DialogOverlay, {}) : null,
|
|
1704
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1624
1705
|
DialogContentPrimitive,
|
|
1625
1706
|
{
|
|
1626
1707
|
ref: mergedRef,
|
|
@@ -1639,23 +1720,23 @@ var DialogContent = React9.forwardRef(
|
|
|
1639
1720
|
...hasDescription ? {} : { "aria-describedby": void 0 },
|
|
1640
1721
|
...props,
|
|
1641
1722
|
children: [
|
|
1642
|
-
hasTitle ? null : /* @__PURE__ */ (0,
|
|
1643
|
-
/* @__PURE__ */ (0,
|
|
1723
|
+
hasTitle ? null : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(VisuallyHidden.Root, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DialogPrimitive.Title, { children: "Dialog" }) }),
|
|
1724
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DialogContainerContext.Provider, { value: containerEl, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1644
1725
|
PortalContainerProvider,
|
|
1645
1726
|
{
|
|
1646
1727
|
container: containerEl ?? injectedContainer ?? null,
|
|
1647
1728
|
children
|
|
1648
1729
|
}
|
|
1649
1730
|
) }),
|
|
1650
|
-
showCloseButton ? /* @__PURE__ */ (0,
|
|
1731
|
+
showCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1651
1732
|
DialogPrimitive.Close,
|
|
1652
1733
|
{
|
|
1653
1734
|
"data-slot": "dialog-close",
|
|
1654
1735
|
"aria-label": "Close",
|
|
1655
1736
|
className: "absolute right-2 top-4 flex h-11 w-11 items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground sm:right-4 lg:h-10 lg:w-10",
|
|
1656
1737
|
children: [
|
|
1657
|
-
/* @__PURE__ */ (0,
|
|
1658
|
-
/* @__PURE__ */ (0,
|
|
1738
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(XIcon, { className: "h-4 w-4" }),
|
|
1739
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "sr-only", children: "Close" })
|
|
1659
1740
|
]
|
|
1660
1741
|
}
|
|
1661
1742
|
) : null
|
|
@@ -1669,7 +1750,7 @@ DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
|
1669
1750
|
var DialogHeader = ({
|
|
1670
1751
|
className,
|
|
1671
1752
|
...props
|
|
1672
|
-
}) => /* @__PURE__ */ (0,
|
|
1753
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1673
1754
|
"div",
|
|
1674
1755
|
{
|
|
1675
1756
|
"data-slot": "dialog-header",
|
|
@@ -1686,7 +1767,7 @@ DialogHeader.displayName = "DialogHeader";
|
|
|
1686
1767
|
var DialogFooter = ({
|
|
1687
1768
|
className,
|
|
1688
1769
|
...props
|
|
1689
|
-
}) => /* @__PURE__ */ (0,
|
|
1770
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1690
1771
|
"div",
|
|
1691
1772
|
{
|
|
1692
1773
|
"data-slot": "dialog-footer",
|
|
@@ -1718,7 +1799,7 @@ var DialogFooter = ({
|
|
|
1718
1799
|
}
|
|
1719
1800
|
);
|
|
1720
1801
|
DialogFooter.displayName = "DialogFooter";
|
|
1721
|
-
var DialogTitle =
|
|
1802
|
+
var DialogTitle = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1722
1803
|
DialogPrimitive.Title,
|
|
1723
1804
|
{
|
|
1724
1805
|
ref,
|
|
@@ -1728,7 +1809,7 @@ var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
1728
1809
|
}
|
|
1729
1810
|
));
|
|
1730
1811
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
1731
|
-
var DialogDescription =
|
|
1812
|
+
var DialogDescription = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1732
1813
|
DialogPrimitive.Description,
|
|
1733
1814
|
{
|
|
1734
1815
|
ref,
|
|
@@ -1743,11 +1824,11 @@ DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
|
1743
1824
|
var SheetPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
1744
1825
|
var import_react_tree3 = require("@ai-matrx/kit/react-tree");
|
|
1745
1826
|
var import_class_variance_authority3 = require("class-variance-authority");
|
|
1746
|
-
var
|
|
1747
|
-
var
|
|
1748
|
-
var SheetContentBase =
|
|
1827
|
+
var React11 = __toESM(require("react"), 1);
|
|
1828
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1829
|
+
var SheetContentBase = React11.forwardRef(({ ...props }, ref) => {
|
|
1749
1830
|
const isModal = useRadixDialogModal();
|
|
1750
|
-
return /* @__PURE__ */ (0,
|
|
1831
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1751
1832
|
SheetPrimitive.Content,
|
|
1752
1833
|
{
|
|
1753
1834
|
...props,
|
|
@@ -1757,13 +1838,13 @@ var SheetContentBase = React10.forwardRef(({ ...props }, ref) => {
|
|
|
1757
1838
|
);
|
|
1758
1839
|
});
|
|
1759
1840
|
SheetContentBase.displayName = "SheetContentBase";
|
|
1760
|
-
var Sheet =
|
|
1841
|
+
var Sheet = React11.forwardRef(({ children, ...props }, _ref) => {
|
|
1761
1842
|
const modal = props.modal ?? true;
|
|
1762
|
-
return /* @__PURE__ */ (0,
|
|
1843
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(RadixDialogModalProvider, { modal, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SheetPrimitive.Root, { ...props, modal, children }) });
|
|
1763
1844
|
});
|
|
1764
1845
|
Sheet.displayName = "Sheet";
|
|
1765
1846
|
var SheetPortal = SheetPrimitive.Portal;
|
|
1766
|
-
var SheetOverlay =
|
|
1847
|
+
var SheetOverlay = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1767
1848
|
SheetPrimitive.Overlay,
|
|
1768
1849
|
{
|
|
1769
1850
|
className: cn(
|
|
@@ -1800,7 +1881,7 @@ var sheetVariants = (0, import_class_variance_authority3.cva)(
|
|
|
1800
1881
|
}
|
|
1801
1882
|
}
|
|
1802
1883
|
);
|
|
1803
|
-
var SheetDescription =
|
|
1884
|
+
var SheetDescription = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1804
1885
|
SheetPrimitive.Description,
|
|
1805
1886
|
{
|
|
1806
1887
|
ref,
|
|
@@ -1809,7 +1890,7 @@ var SheetDescription = React10.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
1809
1890
|
}
|
|
1810
1891
|
));
|
|
1811
1892
|
SheetDescription.displayName = SheetPrimitive.Description.displayName;
|
|
1812
|
-
var SheetContent =
|
|
1893
|
+
var SheetContent = React11.forwardRef(
|
|
1813
1894
|
({
|
|
1814
1895
|
side = "right",
|
|
1815
1896
|
className,
|
|
@@ -1821,9 +1902,9 @@ var SheetContent = React10.forwardRef(
|
|
|
1821
1902
|
...props
|
|
1822
1903
|
}, ref) => {
|
|
1823
1904
|
const hasDescription = (0, import_react_tree3.treeContainsComponent)(children, SheetDescription) || (0, import_react_tree3.treeContainsComponent)(children, SheetPrimitive.Description);
|
|
1824
|
-
return /* @__PURE__ */ (0,
|
|
1825
|
-
!hideOverlay && /* @__PURE__ */ (0,
|
|
1826
|
-
/* @__PURE__ */ (0,
|
|
1905
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(SheetPortal, { children: [
|
|
1906
|
+
!hideOverlay && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SheetOverlay, { className: overlayClassName }),
|
|
1907
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1827
1908
|
SheetContentBase,
|
|
1828
1909
|
{
|
|
1829
1910
|
ref,
|
|
@@ -1835,9 +1916,9 @@ var SheetContent = React10.forwardRef(
|
|
|
1835
1916
|
...hasDescription ? {} : { "aria-describedby": void 0 },
|
|
1836
1917
|
...props,
|
|
1837
1918
|
children: [
|
|
1838
|
-
!hideCloseButton && /* @__PURE__ */ (0,
|
|
1839
|
-
/* @__PURE__ */ (0,
|
|
1840
|
-
/* @__PURE__ */ (0,
|
|
1919
|
+
!hideCloseButton && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
|
|
1920
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Cross2Icon, { className: "h-4 w-4" }),
|
|
1921
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "sr-only", children: "Close" })
|
|
1841
1922
|
] }),
|
|
1842
1923
|
children
|
|
1843
1924
|
]
|
|
@@ -1850,7 +1931,7 @@ SheetContent.displayName = SheetPrimitive.Content.displayName;
|
|
|
1850
1931
|
var SheetHeader = ({
|
|
1851
1932
|
className,
|
|
1852
1933
|
...props
|
|
1853
|
-
}) => /* @__PURE__ */ (0,
|
|
1934
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1854
1935
|
"div",
|
|
1855
1936
|
{
|
|
1856
1937
|
className: cn(
|
|
@@ -1864,7 +1945,7 @@ SheetHeader.displayName = "SheetHeader";
|
|
|
1864
1945
|
var SheetFooter = ({
|
|
1865
1946
|
className,
|
|
1866
1947
|
...props
|
|
1867
|
-
}) => /* @__PURE__ */ (0,
|
|
1948
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1868
1949
|
"div",
|
|
1869
1950
|
{
|
|
1870
1951
|
"data-slot": "sheet-footer",
|
|
@@ -1876,7 +1957,7 @@ var SheetFooter = ({
|
|
|
1876
1957
|
}
|
|
1877
1958
|
);
|
|
1878
1959
|
SheetFooter.displayName = "SheetFooter";
|
|
1879
|
-
var SheetTitle =
|
|
1960
|
+
var SheetTitle = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1880
1961
|
SheetPrimitive.Title,
|
|
1881
1962
|
{
|
|
1882
1963
|
ref,
|
|
@@ -1887,33 +1968,33 @@ var SheetTitle = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
1887
1968
|
SheetTitle.displayName = SheetPrimitive.Title.displayName;
|
|
1888
1969
|
|
|
1889
1970
|
// src/data-table/default-host.tsx
|
|
1890
|
-
var
|
|
1971
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1891
1972
|
function DefaultTableLink(props) {
|
|
1892
|
-
return /* @__PURE__ */ (0,
|
|
1973
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("a", { ...props });
|
|
1893
1974
|
}
|
|
1894
1975
|
function DefaultTableSidePanel({ title, titleNode, description, defaultWidth = 480, onClose, headerActions, children }) {
|
|
1895
|
-
return /* @__PURE__ */ (0,
|
|
1976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Sheet, { open: true, onOpenChange: (open) => {
|
|
1896
1977
|
if (!open) onClose();
|
|
1897
|
-
}, children: /* @__PURE__ */ (0,
|
|
1898
|
-
/* @__PURE__ */ (0,
|
|
1899
|
-
/* @__PURE__ */ (0,
|
|
1900
|
-
description ? /* @__PURE__ */ (0,
|
|
1978
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(SheetContent, { side: "right", className: "flex h-full flex-col", style: { width: `min(${defaultWidth}px, 100vw)` }, children: [
|
|
1979
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(SheetHeader, { children: [
|
|
1980
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SheetTitle, { children: titleNode ?? title }),
|
|
1981
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SheetDescription, { children: description }) : null,
|
|
1901
1982
|
headerActions
|
|
1902
1983
|
] }),
|
|
1903
|
-
/* @__PURE__ */ (0,
|
|
1984
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "min-h-0 flex-1 overflow-auto", children })
|
|
1904
1985
|
] }) });
|
|
1905
1986
|
}
|
|
1906
1987
|
function DefaultTableWindow({ title, onClose, width = 720, height = 560, actionsRight, sidebar, children }) {
|
|
1907
|
-
return /* @__PURE__ */ (0,
|
|
1988
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Dialog, { open: true, onOpenChange: (open) => {
|
|
1908
1989
|
if (!open) onClose();
|
|
1909
|
-
}, children: /* @__PURE__ */ (0,
|
|
1910
|
-
/* @__PURE__ */ (0,
|
|
1911
|
-
/* @__PURE__ */ (0,
|
|
1990
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(DialogContent, { className: "flex flex-col overflow-hidden", style: { width: `min(${width}px, calc(100vw - 2rem))`, height: `min(${height}px, 85dvh)` }, children: [
|
|
1991
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(DialogHeader, { children: [
|
|
1992
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DialogTitle, { children: title }),
|
|
1912
1993
|
actionsRight
|
|
1913
1994
|
] }),
|
|
1914
|
-
/* @__PURE__ */ (0,
|
|
1915
|
-
sidebar ? /* @__PURE__ */ (0,
|
|
1916
|
-
/* @__PURE__ */ (0,
|
|
1995
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex min-h-0 flex-1", children: [
|
|
1996
|
+
sidebar ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("aside", { className: "shrink-0 border-r pr-2", children: sidebar }) : null,
|
|
1997
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "min-h-0 min-w-0 flex-1 overflow-auto", children })
|
|
1917
1998
|
] })
|
|
1918
1999
|
] }) });
|
|
1919
2000
|
}
|
|
@@ -1923,19 +2004,19 @@ var import_react3 = require("react");
|
|
|
1923
2004
|
|
|
1924
2005
|
// src/data-table/host.tsx
|
|
1925
2006
|
var import_react2 = require("react");
|
|
1926
|
-
var
|
|
2007
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1927
2008
|
var HOST_SLOT = /* @__PURE__ */ Symbol.for("ai-matrx.design-system.table-host-context");
|
|
1928
2009
|
var hostRegistry = globalThis;
|
|
1929
2010
|
var HostContext = hostRegistry[HOST_SLOT] ??= (0, import_react2.createContext)({});
|
|
1930
2011
|
function MatrxDataTableProvider({ value, children }) {
|
|
1931
|
-
return /* @__PURE__ */ (0,
|
|
2012
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(HostContext.Provider, { value, children });
|
|
1932
2013
|
}
|
|
1933
2014
|
function useMatrxDataTableHost() {
|
|
1934
2015
|
return (0, import_react2.useContext)(HostContext);
|
|
1935
2016
|
}
|
|
1936
2017
|
|
|
1937
2018
|
// src/data-table/useTableNotice.tsx
|
|
1938
|
-
var
|
|
2019
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1939
2020
|
function useTableNotice() {
|
|
1940
2021
|
const host = useMatrxDataTableHost();
|
|
1941
2022
|
const [message, setMessage] = (0, import_react3.useState)(null);
|
|
@@ -1949,15 +2030,15 @@ function useTableNotice() {
|
|
|
1949
2030
|
else setMessage({ text, error: true });
|
|
1950
2031
|
}
|
|
1951
2032
|
};
|
|
1952
|
-
const notice = message ? /* @__PURE__ */ (0,
|
|
2033
|
+
const notice = message ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { role: message.error ? "alert" : "status", className: message.error ? "text-xs text-destructive" : "text-xs text-muted-foreground", children: [
|
|
1953
2034
|
message.text,
|
|
1954
|
-
/* @__PURE__ */ (0,
|
|
2035
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { type: "button", "aria-label": "Dismiss notification", className: "ml-2 underline", onClick: () => setMessage(null), children: "Dismiss" })
|
|
1955
2036
|
] }) : null;
|
|
1956
2037
|
return { notify, notice };
|
|
1957
2038
|
}
|
|
1958
2039
|
|
|
1959
2040
|
// src/data-table/pagination.tsx
|
|
1960
|
-
var
|
|
2041
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1961
2042
|
function GenericTablePagination({
|
|
1962
2043
|
totalItems,
|
|
1963
2044
|
itemsPerPage,
|
|
@@ -2016,8 +2097,8 @@ function GenericTablePagination({
|
|
|
2016
2097
|
className,
|
|
2017
2098
|
containerClassName
|
|
2018
2099
|
);
|
|
2019
|
-
return /* @__PURE__ */ (0,
|
|
2020
|
-
showItemsPerPageSelect && /* @__PURE__ */ (0,
|
|
2100
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { "data-matrx-table-footer": true, className: containerClass, children: [
|
|
2101
|
+
showItemsPerPageSelect && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2021
2102
|
"div",
|
|
2022
2103
|
{
|
|
2023
2104
|
className: cn(
|
|
@@ -2025,13 +2106,13 @@ function GenericTablePagination({
|
|
|
2025
2106
|
!compact && "sm:p-1",
|
|
2026
2107
|
selectContainerClassName
|
|
2027
2108
|
),
|
|
2028
|
-
children: /* @__PURE__ */ (0,
|
|
2109
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2029
2110
|
Select,
|
|
2030
2111
|
{
|
|
2031
2112
|
value: itemsPerPage.toString(),
|
|
2032
2113
|
onValueChange: (value) => onItemsPerPageChange(parseInt(value)),
|
|
2033
2114
|
children: [
|
|
2034
|
-
/* @__PURE__ */ (0,
|
|
2115
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2035
2116
|
SelectTrigger,
|
|
2036
2117
|
{
|
|
2037
2118
|
"aria-label": "Rows per page",
|
|
@@ -2039,31 +2120,31 @@ function GenericTablePagination({
|
|
|
2039
2120
|
"focus:ring-0",
|
|
2040
2121
|
compact ? "relative isolate h-11 w-14 border-0 bg-transparent px-2 text-xs before:absolute before:inset-x-1 before:inset-y-1.5 before:z-0 before:rounded-md before:border before:border-border before:bg-card before:content-[''] hover:before:bg-accent [&>*]:relative [&>*]:z-10 lg:h-7 lg:min-h-7 lg:w-16 lg:border lg:border-input lg:bg-background lg:px-2 lg:before:hidden" : "h-8 w-[3.75rem] text-xs sm:w-36 sm:text-sm"
|
|
2041
2122
|
),
|
|
2042
|
-
children: /* @__PURE__ */ (0,
|
|
2123
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SelectValue, { placeholder: itemsPerPage.toString() })
|
|
2043
2124
|
}
|
|
2044
2125
|
),
|
|
2045
|
-
/* @__PURE__ */ (0,
|
|
2046
|
-
availablePageSizes.map((size) => /* @__PURE__ */ (0,
|
|
2047
|
-
showAllOption ? /* @__PURE__ */ (0,
|
|
2126
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(SelectContent, { children: [
|
|
2127
|
+
availablePageSizes.map((size) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SelectItem, { value: size.toString(), children: size }, size)),
|
|
2128
|
+
showAllOption ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SelectItem, { value: allValue.toString(), children: allOptionLabel }) : null
|
|
2048
2129
|
] })
|
|
2049
2130
|
]
|
|
2050
2131
|
}
|
|
2051
2132
|
)
|
|
2052
2133
|
}
|
|
2053
2134
|
),
|
|
2054
|
-
/* @__PURE__ */ (0,
|
|
2135
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2055
2136
|
"div",
|
|
2056
2137
|
{
|
|
2057
2138
|
className: cn("flex min-w-0 justify-center", infoContainerClassName),
|
|
2058
|
-
children: showPageInfo && !hideEntriesInfo && /* @__PURE__ */ (0,
|
|
2059
|
-
/* @__PURE__ */ (0,
|
|
2139
|
+
children: showPageInfo && !hideEntriesInfo && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
2140
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "truncate text-[10px] tabular-nums text-muted-foreground sm:hidden", children: [
|
|
2060
2141
|
startItem,
|
|
2061
2142
|
"-",
|
|
2062
2143
|
endItem,
|
|
2063
2144
|
" / ",
|
|
2064
2145
|
totalItems
|
|
2065
2146
|
] }),
|
|
2066
|
-
/* @__PURE__ */ (0,
|
|
2147
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2067
2148
|
"span",
|
|
2068
2149
|
{
|
|
2069
2150
|
className: `hidden whitespace-nowrap ${compact ? "text-xs" : "text-sm"} text-muted-foreground sm:inline`,
|
|
@@ -2073,7 +2154,7 @@ function GenericTablePagination({
|
|
|
2073
2154
|
] })
|
|
2074
2155
|
}
|
|
2075
2156
|
),
|
|
2076
|
-
showPageControls && /* @__PURE__ */ (0,
|
|
2157
|
+
showPageControls && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2077
2158
|
"div",
|
|
2078
2159
|
{
|
|
2079
2160
|
className: cn(
|
|
@@ -2082,7 +2163,7 @@ function GenericTablePagination({
|
|
|
2082
2163
|
controlsContainerClassName
|
|
2083
2164
|
),
|
|
2084
2165
|
children: [
|
|
2085
|
-
/* @__PURE__ */ (0,
|
|
2166
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2086
2167
|
Button,
|
|
2087
2168
|
{
|
|
2088
2169
|
variant: "outline",
|
|
@@ -2096,10 +2177,10 @@ function GenericTablePagination({
|
|
|
2096
2177
|
compact ? compactButtonClass : "h-8 w-8 p-0",
|
|
2097
2178
|
navButtonClassName
|
|
2098
2179
|
),
|
|
2099
|
-
children: /* @__PURE__ */ (0,
|
|
2180
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ChevronsLeft, { className: compact ? "h-3.5 w-3.5" : "h-4 w-4" })
|
|
2100
2181
|
}
|
|
2101
2182
|
),
|
|
2102
|
-
/* @__PURE__ */ (0,
|
|
2183
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2103
2184
|
Button,
|
|
2104
2185
|
{
|
|
2105
2186
|
variant: "outline",
|
|
@@ -2112,10 +2193,10 @@ function GenericTablePagination({
|
|
|
2112
2193
|
compact ? compactButtonClass : "h-8 w-8 p-0",
|
|
2113
2194
|
navButtonClassName
|
|
2114
2195
|
),
|
|
2115
|
-
children: /* @__PURE__ */ (0,
|
|
2196
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ChevronLeft, { className: compact ? "h-3.5 w-3.5" : "h-4 w-4" })
|
|
2116
2197
|
}
|
|
2117
2198
|
),
|
|
2118
|
-
getPageNumbers(3).map((page) => /* @__PURE__ */ (0,
|
|
2199
|
+
getPageNumbers(3).map((page) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2119
2200
|
Button,
|
|
2120
2201
|
{
|
|
2121
2202
|
variant: currentPage === page ? "default" : "outline",
|
|
@@ -2130,11 +2211,11 @@ function GenericTablePagination({
|
|
|
2130
2211
|
compact && page === currentPage && compactActiveButtonClass,
|
|
2131
2212
|
page === currentPage ? pageActiveButtonClassName : pageButtonClassName
|
|
2132
2213
|
),
|
|
2133
|
-
children: /* @__PURE__ */ (0,
|
|
2214
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "relative z-10", children: page })
|
|
2134
2215
|
},
|
|
2135
2216
|
`mobile-${page}`
|
|
2136
2217
|
)),
|
|
2137
|
-
getPageNumbers().map((page) => /* @__PURE__ */ (0,
|
|
2218
|
+
getPageNumbers().map((page) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2138
2219
|
Button,
|
|
2139
2220
|
{
|
|
2140
2221
|
variant: currentPage === page ? "default" : "outline",
|
|
@@ -2148,11 +2229,11 @@ function GenericTablePagination({
|
|
|
2148
2229
|
compact && page === currentPage && compactActiveButtonClass,
|
|
2149
2230
|
currentPage === page ? pageActiveButtonClassName : pageButtonClassName
|
|
2150
2231
|
),
|
|
2151
|
-
children: /* @__PURE__ */ (0,
|
|
2232
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "relative z-10", children: page })
|
|
2152
2233
|
},
|
|
2153
2234
|
`desktop-${page}`
|
|
2154
2235
|
)),
|
|
2155
|
-
/* @__PURE__ */ (0,
|
|
2236
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2156
2237
|
Button,
|
|
2157
2238
|
{
|
|
2158
2239
|
variant: "outline",
|
|
@@ -2165,10 +2246,10 @@ function GenericTablePagination({
|
|
|
2165
2246
|
compact ? compactButtonClass : "h-8 w-8 p-0",
|
|
2166
2247
|
navButtonClassName
|
|
2167
2248
|
),
|
|
2168
|
-
children: /* @__PURE__ */ (0,
|
|
2249
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ChevronRight, { className: compact ? "h-3.5 w-3.5" : "h-4 w-4" })
|
|
2169
2250
|
}
|
|
2170
2251
|
),
|
|
2171
|
-
/* @__PURE__ */ (0,
|
|
2252
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2172
2253
|
Button,
|
|
2173
2254
|
{
|
|
2174
2255
|
variant: "outline",
|
|
@@ -2182,7 +2263,7 @@ function GenericTablePagination({
|
|
|
2182
2263
|
compact ? compactButtonClass : "h-8 w-8 p-0",
|
|
2183
2264
|
navButtonClassName
|
|
2184
2265
|
),
|
|
2185
|
-
children: /* @__PURE__ */ (0,
|
|
2266
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ChevronsRight, { className: compact ? "h-3.5 w-3.5" : "h-4 w-4" })
|
|
2186
2267
|
}
|
|
2187
2268
|
)
|
|
2188
2269
|
]
|
|
@@ -2192,23 +2273,23 @@ function GenericTablePagination({
|
|
|
2192
2273
|
}
|
|
2193
2274
|
|
|
2194
2275
|
// src/content-transfer/matrx-copy.tsx
|
|
2195
|
-
var
|
|
2276
|
+
var React14 = __toESM(require("react"), 1);
|
|
2196
2277
|
var import_content_transfer2 = require("@ai-matrx/kit/content-transfer");
|
|
2197
2278
|
|
|
2198
2279
|
// src/content-transfer/index.tsx
|
|
2199
|
-
var
|
|
2280
|
+
var React13 = __toESM(require("react"), 1);
|
|
2200
2281
|
var import_content_transfer = require("@ai-matrx/kit/content-transfer");
|
|
2201
2282
|
|
|
2202
2283
|
// src/dropdown-menu.tsx
|
|
2203
2284
|
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"), 1);
|
|
2204
|
-
var
|
|
2205
|
-
var
|
|
2285
|
+
var React12 = __toESM(require("react"), 1);
|
|
2286
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2206
2287
|
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
2207
2288
|
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
2208
2289
|
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";
|
|
2209
2290
|
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";
|
|
2210
2291
|
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";
|
|
2211
|
-
var DropdownMenuSubTrigger =
|
|
2292
|
+
var DropdownMenuSubTrigger = React12.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
2212
2293
|
DropdownMenuPrimitive.SubTrigger,
|
|
2213
2294
|
{
|
|
2214
2295
|
ref,
|
|
@@ -2221,12 +2302,12 @@ var DropdownMenuSubTrigger = React11.forwardRef(({ className, inset, children, .
|
|
|
2221
2302
|
...props,
|
|
2222
2303
|
children: [
|
|
2223
2304
|
children,
|
|
2224
|
-
/* @__PURE__ */ (0,
|
|
2305
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(RadixChevronRightIcon, { className: "ml-auto h-4 w-4" })
|
|
2225
2306
|
]
|
|
2226
2307
|
}
|
|
2227
2308
|
));
|
|
2228
2309
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
2229
|
-
var DropdownMenuSubContent =
|
|
2310
|
+
var DropdownMenuSubContent = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2230
2311
|
DropdownMenuPrimitive.SubContent,
|
|
2231
2312
|
{
|
|
2232
2313
|
ref,
|
|
@@ -2236,9 +2317,9 @@ var DropdownMenuSubContent = React11.forwardRef(({ className, ...props }, ref) =
|
|
|
2236
2317
|
}
|
|
2237
2318
|
));
|
|
2238
2319
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
2239
|
-
var DropdownMenuContent =
|
|
2320
|
+
var DropdownMenuContent = React12.forwardRef(({ className, sideOffset = 4, container, ...props }, ref) => {
|
|
2240
2321
|
const portalContainer = usePortalContainer(container);
|
|
2241
|
-
return /* @__PURE__ */ (0,
|
|
2322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DropdownMenuPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2242
2323
|
DropdownMenuPrimitive.Content,
|
|
2243
2324
|
{
|
|
2244
2325
|
ref,
|
|
@@ -2255,7 +2336,7 @@ var DropdownMenuContent = React11.forwardRef(({ className, sideOffset = 4, conta
|
|
|
2255
2336
|
) });
|
|
2256
2337
|
});
|
|
2257
2338
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
2258
|
-
var DropdownMenuItem =
|
|
2339
|
+
var DropdownMenuItem = React12.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2259
2340
|
DropdownMenuPrimitive.Item,
|
|
2260
2341
|
{
|
|
2261
2342
|
ref,
|
|
@@ -2265,7 +2346,7 @@ var DropdownMenuItem = React11.forwardRef(({ className, inset, ...props }, ref)
|
|
|
2265
2346
|
}
|
|
2266
2347
|
));
|
|
2267
2348
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
2268
|
-
var DropdownMenuCheckboxItem =
|
|
2349
|
+
var DropdownMenuCheckboxItem = React12.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
2269
2350
|
DropdownMenuPrimitive.CheckboxItem,
|
|
2270
2351
|
{
|
|
2271
2352
|
ref,
|
|
@@ -2273,13 +2354,13 @@ var DropdownMenuCheckboxItem = React11.forwardRef(({ className, children, ...pro
|
|
|
2273
2354
|
className: cn(MENU_INDICATOR_ITEM_CLASS, className),
|
|
2274
2355
|
...props,
|
|
2275
2356
|
children: [
|
|
2276
|
-
/* @__PURE__ */ (0,
|
|
2357
|
+
/* @__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" }) }) }),
|
|
2277
2358
|
children
|
|
2278
2359
|
]
|
|
2279
2360
|
}
|
|
2280
2361
|
));
|
|
2281
2362
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
2282
|
-
var DropdownMenuRadioItem =
|
|
2363
|
+
var DropdownMenuRadioItem = React12.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
2283
2364
|
DropdownMenuPrimitive.RadioItem,
|
|
2284
2365
|
{
|
|
2285
2366
|
ref,
|
|
@@ -2287,13 +2368,13 @@ var DropdownMenuRadioItem = React11.forwardRef(({ className, children, ...props
|
|
|
2287
2368
|
className: cn(MENU_INDICATOR_ITEM_CLASS, className),
|
|
2288
2369
|
...props,
|
|
2289
2370
|
children: [
|
|
2290
|
-
/* @__PURE__ */ (0,
|
|
2371
|
+
/* @__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" }) }) }),
|
|
2291
2372
|
children
|
|
2292
2373
|
]
|
|
2293
2374
|
}
|
|
2294
2375
|
));
|
|
2295
2376
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
2296
|
-
var DropdownMenuLabel =
|
|
2377
|
+
var DropdownMenuLabel = React12.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2297
2378
|
DropdownMenuPrimitive.Label,
|
|
2298
2379
|
{
|
|
2299
2380
|
ref,
|
|
@@ -2303,7 +2384,7 @@ var DropdownMenuLabel = React11.forwardRef(({ className, inset, ...props }, ref)
|
|
|
2303
2384
|
}
|
|
2304
2385
|
));
|
|
2305
2386
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
2306
|
-
var DropdownMenuSeparator =
|
|
2387
|
+
var DropdownMenuSeparator = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2307
2388
|
DropdownMenuPrimitive.Separator,
|
|
2308
2389
|
{
|
|
2309
2390
|
ref,
|
|
@@ -2316,7 +2397,7 @@ DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
|
2316
2397
|
var DropdownMenuShortcut = ({
|
|
2317
2398
|
className,
|
|
2318
2399
|
...props
|
|
2319
|
-
}) => /* @__PURE__ */ (0,
|
|
2400
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2320
2401
|
"span",
|
|
2321
2402
|
{
|
|
2322
2403
|
"data-slot": "dropdown-menu-shortcut",
|
|
@@ -2327,23 +2408,23 @@ var DropdownMenuShortcut = ({
|
|
|
2327
2408
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
2328
2409
|
|
|
2329
2410
|
// src/content-transfer/index.tsx
|
|
2330
|
-
var
|
|
2411
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2331
2412
|
function AlchemyGlyph(props) {
|
|
2332
|
-
return /* @__PURE__ */ (0,
|
|
2333
|
-
/* @__PURE__ */ (0,
|
|
2334
|
-
/* @__PURE__ */ (0,
|
|
2335
|
-
/* @__PURE__ */ (0,
|
|
2413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...props, children: [
|
|
2414
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M4.5 5.5h8v11h-8z" }),
|
|
2415
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M8.5 9.5h8v9h-8z" }),
|
|
2416
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "m18.5 3 .65 1.85L21 5.5l-1.85.65L18.5 8l-.65-1.85L16 5.5l1.85-.65z" })
|
|
2336
2417
|
] });
|
|
2337
2418
|
}
|
|
2338
|
-
var CapabilityContext =
|
|
2339
|
-
var useContentTransferCapabilities = () =>
|
|
2340
|
-
var SurfaceContext =
|
|
2419
|
+
var CapabilityContext = React13.createContext({});
|
|
2420
|
+
var useContentTransferCapabilities = () => React13.useContext(CapabilityContext);
|
|
2421
|
+
var SurfaceContext = React13.createContext(null);
|
|
2341
2422
|
function MenuPresentation({ label, hint, icon: Icon3 }) {
|
|
2342
|
-
return /* @__PURE__ */ (0,
|
|
2343
|
-
Icon3 ? /* @__PURE__ */ (0,
|
|
2344
|
-
/* @__PURE__ */ (0,
|
|
2423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
2424
|
+
Icon3 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Icon3, { className: "matrx-alchemy-menu-icon" }) : null,
|
|
2425
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { children: [
|
|
2345
2426
|
label,
|
|
2346
|
-
hint ? /* @__PURE__ */ (0,
|
|
2427
|
+
hint ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("small", { className: "matrx-alchemy-menu-hint", children: hint }) : null
|
|
2347
2428
|
] })
|
|
2348
2429
|
] });
|
|
2349
2430
|
}
|
|
@@ -2383,10 +2464,10 @@ function snapshotContent(snapshot) {
|
|
|
2383
2464
|
return JSON.stringify({ sourceId, label, payload, coverage, unsavedChanges, omissions, sections, limits });
|
|
2384
2465
|
}
|
|
2385
2466
|
function useFence() {
|
|
2386
|
-
const mounted =
|
|
2387
|
-
const nextId =
|
|
2388
|
-
const active =
|
|
2389
|
-
|
|
2467
|
+
const mounted = React13.useRef(true);
|
|
2468
|
+
const nextId = React13.useRef(0);
|
|
2469
|
+
const active = React13.useRef(/* @__PURE__ */ new Set());
|
|
2470
|
+
React13.useEffect(() => {
|
|
2390
2471
|
mounted.current = true;
|
|
2391
2472
|
return () => {
|
|
2392
2473
|
mounted.current = false;
|
|
@@ -2395,14 +2476,14 @@ function useFence() {
|
|
|
2395
2476
|
active.current.clear();
|
|
2396
2477
|
};
|
|
2397
2478
|
}, []);
|
|
2398
|
-
const begin =
|
|
2479
|
+
const begin = React13.useCallback(() => {
|
|
2399
2480
|
const controller = new AbortController();
|
|
2400
2481
|
active.current.add(controller);
|
|
2401
2482
|
return { controller, id: ++nextId.current };
|
|
2402
2483
|
}, []);
|
|
2403
|
-
const finish =
|
|
2404
|
-
const valid =
|
|
2405
|
-
const abortAll =
|
|
2484
|
+
const finish = React13.useCallback((controller) => active.current.delete(controller), []);
|
|
2485
|
+
const valid = React13.useCallback((id, controller) => mounted.current && !controller.signal.aborted && nextId.current === id, []);
|
|
2486
|
+
const abortAll = React13.useCallback(() => {
|
|
2406
2487
|
nextId.current += 1;
|
|
2407
2488
|
active.current.forEach((c) => c.abort());
|
|
2408
2489
|
active.current.clear();
|
|
@@ -2431,43 +2512,43 @@ async function buildArtifact(draft, format, label) {
|
|
|
2431
2512
|
return (0, import_content_transfer.serialize)(draft, format, { spreadsheetSafe: format === "csv" || format === "tsv", filename: `${filenameFor(label)}.${extension}` });
|
|
2432
2513
|
}
|
|
2433
2514
|
function ContentTransferMenu(props) {
|
|
2434
|
-
const inherited =
|
|
2515
|
+
const inherited = React13.useContext(CapabilityContext);
|
|
2435
2516
|
const identityKey = props.capabilities?.identityKey ?? inherited.identityKey;
|
|
2436
|
-
return /* @__PURE__ */ (0,
|
|
2517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ContentTransferMenuSession, { ...props }, identityKey ?? "anonymous");
|
|
2437
2518
|
}
|
|
2438
2519
|
function ContentTransferMenuSession({ source, surface, label, projection, sections, preferences, table, formatSources, variants = EMPTY_VARIANTS, actions = [], capabilities: local, disabled, enabled = true, className, stopPropagation = true, hide = [], controllerRef }) {
|
|
2439
|
-
const triggerRef =
|
|
2440
|
-
const inherited =
|
|
2441
|
-
const nearestSurface =
|
|
2520
|
+
const triggerRef = React13.useRef(null);
|
|
2521
|
+
const inherited = React13.useContext(CapabilityContext);
|
|
2522
|
+
const nearestSurface = React13.useContext(SurfaceContext);
|
|
2442
2523
|
const fence = useFence();
|
|
2443
|
-
const [menuCapture, setMenuCapture] =
|
|
2444
|
-
const [menuStatus, setMenuStatus] =
|
|
2445
|
-
const [workspaces, setWorkspaces] =
|
|
2446
|
-
const [workspaceKey, setWorkspaceKey] =
|
|
2447
|
-
const [workspaceOpen, setWorkspaceOpen] =
|
|
2448
|
-
const workspaceCaptures =
|
|
2449
|
-
const externalWorkspaceKeys =
|
|
2450
|
-
const [notice, setNotice] =
|
|
2451
|
-
const scopes =
|
|
2524
|
+
const [menuCapture, setMenuCapture] = React13.useState(null);
|
|
2525
|
+
const [menuStatus, setMenuStatus] = React13.useState("idle");
|
|
2526
|
+
const [workspaces, setWorkspaces] = React13.useState({});
|
|
2527
|
+
const [workspaceKey, setWorkspaceKey] = React13.useState(null);
|
|
2528
|
+
const [workspaceOpen, setWorkspaceOpen] = React13.useState(false);
|
|
2529
|
+
const workspaceCaptures = React13.useRef(/* @__PURE__ */ new Map());
|
|
2530
|
+
const externalWorkspaceKeys = React13.useRef(/* @__PURE__ */ new Set());
|
|
2531
|
+
const [notice, setNotice] = React13.useState(null);
|
|
2532
|
+
const scopes = React13.useMemo(() => table?.availableScopes ?? ["target"], [table]);
|
|
2452
2533
|
const initialScope = table?.initialScope ?? "target";
|
|
2453
2534
|
if (!scopes.includes(initialScope)) throw new Error("Alchemy initialScope must be included in availableScopes.");
|
|
2454
2535
|
const primary = surface ?? source ?? nearestSurface;
|
|
2455
2536
|
const sourceLabel = label ?? (surface?.surfaceName ?? (source && "label" in source ? source.label : nearestSurface?.surfaceName) ?? "content");
|
|
2456
2537
|
const primaryWorkspaceKey = `primary:${materialIdentity(primary)}`;
|
|
2457
2538
|
const nearestWorkspaceKey = source && !surface && nearestSurface ? `surface:${materialIdentity(nearestSurface)}` : null;
|
|
2458
|
-
const variantWorkspaceKeys =
|
|
2539
|
+
const variantWorkspaceKeys = React13.useMemo(() => new Map(variants.map((variant) => [variant.id, `variant:${variant.id}:${materialIdentity(variant.source)}`])), [variants]);
|
|
2459
2540
|
const transport = local?.transport ?? inherited.transport ?? (0, import_content_transfer.createBrowserTransport)();
|
|
2460
2541
|
const ai = local?.ai ?? inherited.ai;
|
|
2461
|
-
const providerPreferences =
|
|
2462
|
-
const adapters =
|
|
2463
|
-
const registeredActions =
|
|
2464
|
-
|
|
2465
|
-
const report =
|
|
2542
|
+
const providerPreferences = React13.useMemo(() => (0, import_content_transfer.resolveTransferPreferences)(inherited.preferences, local?.preferences), [inherited.preferences, local?.preferences]);
|
|
2543
|
+
const adapters = React13.useMemo(() => (0, import_content_transfer.resolveTransferRegistry)(BUILT_INS, inherited.formats ?? [], local?.formats ?? []).filter((x) => "build" in x), [inherited.formats, local?.formats]);
|
|
2544
|
+
const registeredActions = React13.useMemo(() => (0, import_content_transfer.resolveTransferRegistry)(inherited.actions ?? [], local?.actions ?? [], actions), [actions, inherited.actions, local?.actions]);
|
|
2545
|
+
React13.useMemo(() => (0, import_content_transfer.resolveTransferRegistry)(variants), [variants]);
|
|
2546
|
+
const report = React13.useCallback((result) => {
|
|
2466
2547
|
inherited.onOutcome?.(result);
|
|
2467
2548
|
local?.onOutcome?.(result);
|
|
2468
2549
|
setNotice(outcomeMessage(result));
|
|
2469
2550
|
}, [inherited, local]);
|
|
2470
|
-
|
|
2551
|
+
React13.useEffect(() => {
|
|
2471
2552
|
const valid = /* @__PURE__ */ new Set([primaryWorkspaceKey, ...nearestWorkspaceKey ? [nearestWorkspaceKey] : [], ...variantWorkspaceKeys.values(), ...externalWorkspaceKeys.current]);
|
|
2472
2553
|
setWorkspaces((current) => Object.fromEntries(Object.entries(current).filter(([key]) => valid.has(key))));
|
|
2473
2554
|
for (const key of workspaceCaptures.current.keys()) if (!valid.has(key)) workspaceCaptures.current.delete(key);
|
|
@@ -2476,7 +2557,7 @@ function ContentTransferMenuSession({ source, surface, label, projection, sectio
|
|
|
2476
2557
|
setWorkspaceOpen(false);
|
|
2477
2558
|
}
|
|
2478
2559
|
}, [nearestWorkspaceKey, primaryWorkspaceKey, variantWorkspaceKeys, workspaceKey]);
|
|
2479
|
-
const captureOne =
|
|
2560
|
+
const captureOne = React13.useCallback(async (material, scope, signal, applyMenuProjection = false, collectPages = true) => {
|
|
2480
2561
|
if (!material) throw new Error("Alchemy needs a source or a mounted transfer surface.");
|
|
2481
2562
|
let sourceMaterial;
|
|
2482
2563
|
if ("instanceId" in material) {
|
|
@@ -2510,14 +2591,14 @@ function ContentTransferMenuSession({ source, surface, label, projection, sectio
|
|
|
2510
2591
|
if (result.snapshot.payload.kind !== "rows") throw new Error("All-matching export requires tabular content.");
|
|
2511
2592
|
return { snapshot: (0, import_content_transfer.projectSnapshot)({ ...result.snapshot, payload: { kind: "rows", rows: collected.rows, columns: result.snapshot.payload.columns }, coverage: collected.coverage, omissions: [...collected.omissions] }, { rules: [] }), allMatching: result.allMatching, ...collected.error ? { collectionError: collected.error.message } : {} };
|
|
2512
2593
|
}, [preferences, projection, providerPreferences, sections, sourceLabel]);
|
|
2513
|
-
const capturePrimary =
|
|
2594
|
+
const capturePrimary = React13.useCallback((scope, signal) => captureOne(primary, scope, signal, true), [captureOne, primary]);
|
|
2514
2595
|
workspaceCaptures.current.set(primaryWorkspaceKey, capturePrimary);
|
|
2515
2596
|
if (nearestWorkspaceKey && nearestSurface) workspaceCaptures.current.set(nearestWorkspaceKey, (scope, signal) => captureOne(nearestSurface, scope, signal, true));
|
|
2516
2597
|
for (const variant of variants) {
|
|
2517
2598
|
const key = variantWorkspaceKeys.get(variant.id);
|
|
2518
2599
|
workspaceCaptures.current.set(key, (scope, signal) => captureOne(variant.source, scope, signal, true));
|
|
2519
2600
|
}
|
|
2520
|
-
const preflight =
|
|
2601
|
+
const preflight = React13.useCallback(async () => {
|
|
2521
2602
|
const { controller, id } = fence.begin();
|
|
2522
2603
|
setMenuCapture(null);
|
|
2523
2604
|
setMenuStatus("loading");
|
|
@@ -2536,7 +2617,7 @@ function ContentTransferMenuSession({ source, surface, label, projection, sectio
|
|
|
2536
2617
|
fence.finish(controller);
|
|
2537
2618
|
}
|
|
2538
2619
|
}, [captureOne, fence, initialScope, primary]);
|
|
2539
|
-
const transfer =
|
|
2620
|
+
const transfer = React13.useCallback(async (format, download, alternate) => {
|
|
2540
2621
|
const { controller, id } = fence.begin();
|
|
2541
2622
|
try {
|
|
2542
2623
|
const explicit = alternate?.source ?? (typeof format === "string" && format !== "xlsx" ? formatSources?.[format] : void 0);
|
|
@@ -2561,7 +2642,7 @@ function ContentTransferMenuSession({ source, surface, label, projection, sectio
|
|
|
2561
2642
|
fence.finish(controller);
|
|
2562
2643
|
}
|
|
2563
2644
|
}, [captureOne, capturePrimary, fence, formatSources, initialScope, preferences, providerPreferences, report, transport]);
|
|
2564
|
-
const openWorkspace =
|
|
2645
|
+
const openWorkspace = React13.useCallback(
|
|
2565
2646
|
async (key = primaryWorkspaceKey, variant) => {
|
|
2566
2647
|
const variantMaterial = variant && "kind" in variant.source ? {
|
|
2567
2648
|
id: `variant:${key}`,
|
|
@@ -2672,7 +2753,7 @@ function ContentTransferMenuSession({ source, surface, label, projection, sectio
|
|
|
2672
2753
|
workspaces
|
|
2673
2754
|
]
|
|
2674
2755
|
);
|
|
2675
|
-
|
|
2756
|
+
React13.useImperativeHandle(controllerRef, () => ({
|
|
2676
2757
|
focusTrigger: () => triggerRef.current?.focus(),
|
|
2677
2758
|
prepare: async (requestedSource, options) => {
|
|
2678
2759
|
const requestedLabel = options?.label ?? ("label" in requestedSource ? requestedSource.label : "content");
|
|
@@ -2681,7 +2762,7 @@ function ContentTransferMenuSession({ source, surface, label, projection, sectio
|
|
|
2681
2762
|
await openWorkspace(requestedKey, { source: requestedSource, label: requestedLabel });
|
|
2682
2763
|
}
|
|
2683
2764
|
}), [openWorkspace]);
|
|
2684
|
-
const runAction =
|
|
2765
|
+
const runAction = React13.useCallback(async (action) => {
|
|
2685
2766
|
const { controller, id } = fence.begin();
|
|
2686
2767
|
try {
|
|
2687
2768
|
const actionSource = action.source;
|
|
@@ -2699,52 +2780,52 @@ function ContentTransferMenuSession({ source, surface, label, projection, sectio
|
|
|
2699
2780
|
}, [captureOne, capturePrimary, fence, initialScope, preferences, providerPreferences, report]);
|
|
2700
2781
|
if (!enabled) return null;
|
|
2701
2782
|
const payload = menuCapture?.snapshot.payload ?? (source && "kind" in source ? source : void 0);
|
|
2702
|
-
const quickVariants = (section) => variants.filter((v) => v.copyLabel && (v.section ?? "ai") === section).map((v) => /* @__PURE__ */ (0,
|
|
2783
|
+
const quickVariants = (section) => variants.filter((v) => v.copyLabel && (v.section ?? "ai") === section).map((v) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuItem, { "aria-label": v.ariaLabel, onSelect: () => void transfer("markdown", false, v), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(MenuPresentation, { ...v, label: v.copyLabel }) }, `copy:${v.id}`));
|
|
2703
2784
|
const visibleCopies = COPIES.filter((f) => Boolean(formatSources?.[f]) || !["csv", "tsv"].includes(f) || payload?.kind === "rows");
|
|
2704
2785
|
const visibleDownloads = DOWNLOADS.filter((f) => f !== "xlsx" && Boolean(formatSources?.[f]) || !["csv", "tsv", "xlsx"].includes(f) || payload?.kind === "rows");
|
|
2705
2786
|
const visibleAdapters = menuCapture ? adapters.filter((a) => a.supports(menuCapture.snapshot.payload)) : [];
|
|
2706
2787
|
const visibleActions = menuCapture ? registeredActions.filter((a) => a.supports(menuCapture.snapshot)) : [];
|
|
2707
|
-
return /* @__PURE__ */ (0,
|
|
2708
|
-
/* @__PURE__ */ (0,
|
|
2788
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: cn("matrx-alchemy", className), onClick: stopPropagation ? (event) => event.stopPropagation() : void 0, children: [
|
|
2789
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DropdownMenu, { onOpenChange: (open) => {
|
|
2709
2790
|
if (open) void preflight();
|
|
2710
2791
|
}, children: [
|
|
2711
|
-
/* @__PURE__ */ (0,
|
|
2712
|
-
/* @__PURE__ */ (0,
|
|
2713
|
-
menuStatus === "loading" ? /* @__PURE__ */ (0,
|
|
2714
|
-
!hide.includes("copy") ? /* @__PURE__ */ (0,
|
|
2715
|
-
/* @__PURE__ */ (0,
|
|
2792
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuTrigger, { 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, {}) }) }),
|
|
2793
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DropdownMenuContent, { align: "end", className: "matrx-alchemy-menu", children: [
|
|
2794
|
+
menuStatus === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuItem, { disabled: true, children: "Inspecting content\u2026" }) : menuStatus !== "idle" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuItem, { disabled: true, children: menuStatus }) : null,
|
|
2795
|
+
!hide.includes("copy") ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
2796
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuLabel, { children: "Copy" }),
|
|
2716
2797
|
quickVariants("copy"),
|
|
2717
|
-
visibleCopies.map((format) => /* @__PURE__ */ (0,
|
|
2718
|
-
visibleAdapters.map((adapter) => /* @__PURE__ */ (0,
|
|
2798
|
+
visibleCopies.map((format) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuItem, { onSelect: () => void transfer(format, false), children: format === "plain" ? "Copy" : `Copy ${LABEL[format]}` }, format)),
|
|
2799
|
+
visibleAdapters.map((adapter) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DropdownMenuItem, { onSelect: () => void transfer(adapter, false), children: [
|
|
2719
2800
|
"Copy ",
|
|
2720
2801
|
adapter.label
|
|
2721
2802
|
] }, adapter.id))
|
|
2722
2803
|
] }) : null,
|
|
2723
|
-
!hide.includes("prepare") ? /* @__PURE__ */ (0,
|
|
2724
|
-
/* @__PURE__ */ (0,
|
|
2804
|
+
!hide.includes("prepare") ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
2805
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuSeparator, {}),
|
|
2725
2806
|
quickVariants("ai"),
|
|
2726
|
-
/* @__PURE__ */ (0,
|
|
2727
|
-
nearestWorkspaceKey && nearestSurface ? /* @__PURE__ */ (0,
|
|
2728
|
-
variants.map((variant) => /* @__PURE__ */ (0,
|
|
2807
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuItem, { onSelect: () => void openWorkspace(), children: "Prepare for AI\u2026" }),
|
|
2808
|
+
nearestWorkspaceKey && nearestSurface ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuItem, { onSelect: () => void openWorkspace(nearestWorkspaceKey, { source: nearestSurface, label: nearestSurface.surfaceName }), children: "Prepare this surface\u2026" }) : null,
|
|
2809
|
+
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))
|
|
2729
2810
|
] }) : null,
|
|
2730
|
-
!hide.includes("download") ? /* @__PURE__ */ (0,
|
|
2731
|
-
/* @__PURE__ */ (0,
|
|
2732
|
-
/* @__PURE__ */ (0,
|
|
2733
|
-
visibleDownloads.map((format) => /* @__PURE__ */ (0,
|
|
2811
|
+
!hide.includes("download") ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
2812
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuSeparator, {}),
|
|
2813
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuLabel, { children: "Download" }),
|
|
2814
|
+
visibleDownloads.map((format) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DropdownMenuItem, { onSelect: () => void transfer(format, true), children: [
|
|
2734
2815
|
"Download ",
|
|
2735
2816
|
LABEL[format]
|
|
2736
2817
|
] }, format)),
|
|
2737
|
-
visibleAdapters.map((adapter) => /* @__PURE__ */ (0,
|
|
2818
|
+
visibleAdapters.map((adapter) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DropdownMenuItem, { onSelect: () => void transfer(adapter, true), children: [
|
|
2738
2819
|
"Download ",
|
|
2739
2820
|
adapter.label
|
|
2740
2821
|
] }, `download:${adapter.id}`))
|
|
2741
2822
|
] }) : null,
|
|
2742
|
-
visibleActions.length ? /* @__PURE__ */ (0,
|
|
2743
|
-
visibleActions.map((action) => /* @__PURE__ */ (0,
|
|
2823
|
+
visibleActions.length ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuSeparator, {}) : null,
|
|
2824
|
+
visibleActions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuItem, { "aria-label": action.ariaLabel, onSelect: () => void runAction(action), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(MenuPresentation, { ...action, label: action.label }) }, action.id))
|
|
2744
2825
|
] })
|
|
2745
2826
|
] }),
|
|
2746
|
-
notice ? /* @__PURE__ */ (0,
|
|
2747
|
-
Object.values(workspaces).map((saved) => /* @__PURE__ */ (0,
|
|
2827
|
+
notice ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "matrx-alchemy-notice", role: "status", children: notice }) : null,
|
|
2828
|
+
Object.values(workspaces).map((saved) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(PreparationWorkspace, { restoreFocus: () => triggerRef.current?.focus(), open: workspaceOpen && workspaceKey === saved.key, state: saved, scopes, onClose: () => setWorkspaceOpen(false), onChange: (next) => setWorkspaces((current) => ({ ...current, [saved.key]: next })), transport, adapters, captureScope: workspaceCaptures.current.get(saved.key) ?? capturePrimary, ...ai ? { ai } : {}, onOutcome: report }, saved.key))
|
|
2748
2829
|
] });
|
|
2749
2830
|
}
|
|
2750
2831
|
function initialControls(state) {
|
|
@@ -2798,28 +2879,28 @@ function preview(draft, format) {
|
|
|
2798
2879
|
}
|
|
2799
2880
|
function PreparationWorkspace({ restoreFocus, open, state, scopes, onClose, onChange, transport, ai, adapters, onOutcome, captureScope }) {
|
|
2800
2881
|
const fence = useFence();
|
|
2801
|
-
const latest =
|
|
2882
|
+
const latest = React13.useRef(state);
|
|
2802
2883
|
latest.current = state;
|
|
2803
|
-
const aiSession =
|
|
2884
|
+
const aiSession = React13.useRef(void 0);
|
|
2804
2885
|
if (!aiSession.current && ai) aiSession.current = ai.fork?.() ?? ai;
|
|
2805
|
-
const [controls, setControls] =
|
|
2806
|
-
const [controlsHistory, setControlsHistory] =
|
|
2807
|
-
const [pendingControls, setPendingControls] =
|
|
2886
|
+
const [controls, setControls] = React13.useState(() => initialControls(state));
|
|
2887
|
+
const [controlsHistory, setControlsHistory] = React13.useState([]);
|
|
2888
|
+
const [pendingControls, setPendingControls] = React13.useState(null);
|
|
2808
2889
|
const requestedFormat = state.preferences.initialFormat;
|
|
2809
|
-
const [format, setFormat] =
|
|
2810
|
-
const [buffer, setBuffer] =
|
|
2811
|
-
const [bufferError, setBufferError] =
|
|
2812
|
-
const [formatError, setFormatError] =
|
|
2813
|
-
const [preparedArtifact, setPreparedArtifact] =
|
|
2814
|
-
const [instruction, setInstruction] =
|
|
2815
|
-
const [busy, setBusy] =
|
|
2816
|
-
const [aiFailed, setAiFailed] =
|
|
2817
|
-
|
|
2890
|
+
const [format, setFormat] = React13.useState(() => isBuiltInFormat(requestedFormat) ? supportsBuiltIn(requestedFormat, state.draft.payload) ? requestedFormat : "plain" : adapters.some((adapter) => adapter.id === requestedFormat && adapter.supports(state.draft.payload)) ? requestedFormat : "plain");
|
|
2891
|
+
const [buffer, setBuffer] = React13.useState(() => isBuiltInFormat(format) ? preview(state.draft, format) : "Preparing format preview\u2026");
|
|
2892
|
+
const [bufferError, setBufferError] = React13.useState(null);
|
|
2893
|
+
const [formatError, setFormatError] = React13.useState(null);
|
|
2894
|
+
const [preparedArtifact, setPreparedArtifact] = React13.useState(null);
|
|
2895
|
+
const [instruction, setInstruction] = React13.useState("");
|
|
2896
|
+
const [busy, setBusy] = React13.useState(null);
|
|
2897
|
+
const [aiFailed, setAiFailed] = React13.useState(false);
|
|
2898
|
+
React13.useEffect(() => {
|
|
2818
2899
|
setAiFailed(false);
|
|
2819
2900
|
}, [state.snapshot.id, state.draft.revision]);
|
|
2820
|
-
const activeAi =
|
|
2821
|
-
const activeCapture =
|
|
2822
|
-
|
|
2901
|
+
const activeAi = React13.useRef(null);
|
|
2902
|
+
const activeCapture = React13.useRef(null);
|
|
2903
|
+
React13.useEffect(() => {
|
|
2823
2904
|
if (bufferError) return;
|
|
2824
2905
|
const adapter = adapters.find((candidate) => candidate.id === format);
|
|
2825
2906
|
const controller = new AbortController();
|
|
@@ -2839,7 +2920,7 @@ function PreparationWorkspace({ restoreFocus, open, state, scopes, onClose, onCh
|
|
|
2839
2920
|
});
|
|
2840
2921
|
return () => controller.abort();
|
|
2841
2922
|
}, [adapters, bufferError, format, state.draft, state.snapshot.id]);
|
|
2842
|
-
const close =
|
|
2923
|
+
const close = React13.useCallback(() => {
|
|
2843
2924
|
activeAi.current?.abort();
|
|
2844
2925
|
activeCapture.current?.abort();
|
|
2845
2926
|
activeAi.current = null;
|
|
@@ -2968,8 +3049,8 @@ function PreparationWorkspace({ restoreFocus, open, state, scopes, onClose, onCh
|
|
|
2968
3049
|
if (fence.valid(id, controller)) setBusy(null);
|
|
2969
3050
|
}
|
|
2970
3051
|
};
|
|
2971
|
-
const [deliveryNotice, setDeliveryNotice] =
|
|
2972
|
-
|
|
3052
|
+
const [deliveryNotice, setDeliveryNotice] = React13.useState(null);
|
|
3053
|
+
React13.useEffect(() => {
|
|
2973
3054
|
setDeliveryNotice(null);
|
|
2974
3055
|
}, [state.draft.revision]);
|
|
2975
3056
|
const reportDelivery = (outcome) => {
|
|
@@ -3001,40 +3082,40 @@ function PreparationWorkspace({ restoreFocus, open, state, scopes, onClose, onCh
|
|
|
3001
3082
|
const workspaceAdapters = adapters.filter((adapter) => adapter.supports(state.draft.payload));
|
|
3002
3083
|
const displayedOmissions = preparedArtifact?.omissions ?? state.draft.omissions;
|
|
3003
3084
|
const limitText = Object.entries(state.preferences.limits).filter(([, value]) => value != null).map(([key, value]) => `${key.replace(/^max/, "max ")} ${Number(value).toLocaleString()}`).join(" \xB7 ");
|
|
3004
|
-
return /* @__PURE__ */ (0,
|
|
3085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Dialog, { open, onOpenChange: (next) => {
|
|
3005
3086
|
if (!next) close();
|
|
3006
|
-
}, children: /* @__PURE__ */ (0,
|
|
3087
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DialogContent, { onCloseAutoFocus: (event) => {
|
|
3007
3088
|
event.preventDefault();
|
|
3008
3089
|
restoreFocus();
|
|
3009
3090
|
}, className: "matrx-alchemy-workspace max-w-5xl", "aria-busy": busy !== null, children: [
|
|
3010
|
-
/* @__PURE__ */ (0,
|
|
3011
|
-
/* @__PURE__ */ (0,
|
|
3091
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DialogHeader, { children: [
|
|
3092
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DialogTitle, { children: [
|
|
3012
3093
|
"Prepare ",
|
|
3013
3094
|
state.snapshot.label
|
|
3014
3095
|
] }),
|
|
3015
|
-
/* @__PURE__ */ (0,
|
|
3096
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DialogDescription, { children: [
|
|
3016
3097
|
"Captured ",
|
|
3017
3098
|
state.snapshot.unsavedChanges ? "from your unsaved draft" : "as an immutable snapshot",
|
|
3018
3099
|
". Your source is never edited."
|
|
3019
3100
|
] })
|
|
3020
3101
|
] }),
|
|
3021
|
-
/* @__PURE__ */ (0,
|
|
3022
|
-
/* @__PURE__ */ (0,
|
|
3023
|
-
/* @__PURE__ */ (0,
|
|
3024
|
-
scopes.length > 1 ? /* @__PURE__ */ (0,
|
|
3102
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "matrx-alchemy-workspace-grid", children: [
|
|
3103
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("section", { className: "matrx-alchemy-main", children: [
|
|
3104
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "matrx-alchemy-toolbar", children: [
|
|
3105
|
+
scopes.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { children: [
|
|
3025
3106
|
"Scope",
|
|
3026
|
-
/* @__PURE__ */ (0,
|
|
3107
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("select", { "aria-label": "Transfer scope", value: state.scope, disabled: busy !== null, onChange: (e) => void requestCapture(e.target.value), children: scopes.map((scope) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("option", { value: scope, children: SCOPE_LABEL[scope] }, scope)) })
|
|
3027
3108
|
] }) : null,
|
|
3028
|
-
/* @__PURE__ */ (0,
|
|
3109
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { children: [
|
|
3029
3110
|
"Detail",
|
|
3030
|
-
/* @__PURE__ */ (0,
|
|
3031
|
-
/* @__PURE__ */ (0,
|
|
3032
|
-
/* @__PURE__ */ (0,
|
|
3033
|
-
/* @__PURE__ */ (0,
|
|
3034
|
-
/* @__PURE__ */ (0,
|
|
3111
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("select", { "aria-label": "Detail preset", value: controls.preset, onChange: (e) => changeControls({ ...controls, preset: e.target.value }), children: [
|
|
3112
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("option", { value: "full", children: "Full" }),
|
|
3113
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("option", { value: "compact", children: "Compact" }),
|
|
3114
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("option", { value: "brief", children: "Brief" }),
|
|
3115
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("option", { value: "custom", children: "Custom" })
|
|
3035
3116
|
] })
|
|
3036
3117
|
] }),
|
|
3037
|
-
/* @__PURE__ */ (0,
|
|
3118
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Button, { type: "button", size: "sm", variant: "outline", disabled: !state.draft.history?.length && !controlsHistory.length || busy !== null, onClick: () => {
|
|
3038
3119
|
setBufferError(null);
|
|
3039
3120
|
if (controlsHistory.length) {
|
|
3040
3121
|
const next = controlsHistory[controlsHistory.length - 1];
|
|
@@ -3043,7 +3124,7 @@ function PreparationWorkspace({ restoreFocus, open, state, scopes, onClose, onCh
|
|
|
3043
3124
|
onChange({ ...state, draft: rebuild(state, next), error: void 0 });
|
|
3044
3125
|
} else onChange({ ...state, draft: (0, import_content_transfer.undoDraft)(state.draft), error: void 0 });
|
|
3045
3126
|
}, children: "Undo" }),
|
|
3046
|
-
/* @__PURE__ */ (0,
|
|
3127
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Button, { type: "button", size: "sm", variant: "outline", disabled: busy !== null, onClick: () => {
|
|
3047
3128
|
const next = initialControls(state);
|
|
3048
3129
|
setControls(next);
|
|
3049
3130
|
setControlsHistory([]);
|
|
@@ -3051,43 +3132,43 @@ function PreparationWorkspace({ restoreFocus, open, state, scopes, onClose, onCh
|
|
|
3051
3132
|
setBufferError(null);
|
|
3052
3133
|
onChange({ ...state, draft: rebuild(state, next), error: void 0 });
|
|
3053
3134
|
}, children: "Reset" }),
|
|
3054
|
-
/* @__PURE__ */ (0,
|
|
3135
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Button, { type: "button", size: "sm", variant: "outline", disabled: busy !== null, onClick: () => void requestCapture(state.scope), children: "Refresh source" })
|
|
3055
3136
|
] }),
|
|
3056
|
-
controls.preset === "custom" && (state.draft.payload.kind === "json" || state.draft.payload.kind === "registered") ? /* @__PURE__ */ (0,
|
|
3057
|
-
/* @__PURE__ */ (0,
|
|
3058
|
-
[["maxDepth", "Maximum depth"], ["maxStringChars", "Maximum string characters"], ["maxArrayItems", "Maximum array items"]].map(([key, text]) => /* @__PURE__ */ (0,
|
|
3137
|
+
controls.preset === "custom" && (state.draft.payload.kind === "json" || state.draft.payload.kind === "registered") ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("fieldset", { className: "matrx-alchemy-options", children: [
|
|
3138
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("legend", { children: "JSON limits" }),
|
|
3139
|
+
[["maxDepth", "Maximum depth"], ["maxStringChars", "Maximum string characters"], ["maxArrayItems", "Maximum array items"]].map(([key, text]) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { children: [
|
|
3059
3140
|
text,
|
|
3060
|
-
/* @__PURE__ */ (0,
|
|
3141
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("input", { type: "number", min: "0", value: controls[key] ?? "", onChange: (e) => changeControls({ ...controls, [key]: Number.isNaN(e.target.valueAsNumber) ? null : e.target.valueAsNumber }) })
|
|
3061
3142
|
] }, key))
|
|
3062
3143
|
] }) : null,
|
|
3063
|
-
rows ? /* @__PURE__ */ (0,
|
|
3064
|
-
state.snapshot.sections.length ? /* @__PURE__ */ (0,
|
|
3065
|
-
/* @__PURE__ */ (0,
|
|
3066
|
-
state.snapshot.sections.map((section) => /* @__PURE__ */ (0,
|
|
3067
|
-
/* @__PURE__ */ (0,
|
|
3144
|
+
rows ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(RowControls, { rows, controls, change: changeControls }) : null,
|
|
3145
|
+
state.snapshot.sections.length ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("fieldset", { className: "matrx-alchemy-options", children: [
|
|
3146
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("legend", { children: "Sections" }),
|
|
3147
|
+
state.snapshot.sections.map((section) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { children: [
|
|
3148
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("input", { type: "checkbox", checked: controls.sections.includes(section.id), onChange: (e) => changeControls({ ...controls, sections: e.target.checked ? [...controls.sections, section.id] : controls.sections.filter((id) => id !== section.id) }) }),
|
|
3068
3149
|
" ",
|
|
3069
3150
|
section.label
|
|
3070
3151
|
] }, section.id))
|
|
3071
3152
|
] }) : null,
|
|
3072
|
-
/* @__PURE__ */ (0,
|
|
3073
|
-
/* @__PURE__ */ (0,
|
|
3153
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "matrx-alchemy-coverage", children: [
|
|
3154
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { children: [
|
|
3074
3155
|
state.snapshot.coverage.included.toLocaleString(),
|
|
3075
3156
|
" included",
|
|
3076
3157
|
state.snapshot.coverage.total == null ? "" : ` of ${state.snapshot.coverage.total.toLocaleString()}`,
|
|
3077
3158
|
" \xB7 ",
|
|
3078
3159
|
state.snapshot.coverage.status
|
|
3079
3160
|
] }),
|
|
3080
|
-
state.snapshot.coverage.reason ? /* @__PURE__ */ (0,
|
|
3081
|
-
limitText ? /* @__PURE__ */ (0,
|
|
3161
|
+
state.snapshot.coverage.reason ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: state.snapshot.coverage.reason }) : null,
|
|
3162
|
+
limitText ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { children: [
|
|
3082
3163
|
"Limits: ",
|
|
3083
3164
|
limitText
|
|
3084
3165
|
] }) : null,
|
|
3085
|
-
displayedOmissions.length ? /* @__PURE__ */ (0,
|
|
3086
|
-
/* @__PURE__ */ (0,
|
|
3166
|
+
displayedOmissions.length ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("details", { children: [
|
|
3167
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("summary", { children: [
|
|
3087
3168
|
displayedOmissions.length,
|
|
3088
3169
|
" omissions or adjustments"
|
|
3089
3170
|
] }),
|
|
3090
|
-
/* @__PURE__ */ (0,
|
|
3171
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("ul", { children: displayedOmissions.map((o, i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("li", { children: [
|
|
3091
3172
|
o.path || "/",
|
|
3092
3173
|
": ",
|
|
3093
3174
|
o.reason,
|
|
@@ -3095,115 +3176,115 @@ function PreparationWorkspace({ restoreFocus, open, state, scopes, onClose, onCh
|
|
|
3095
3176
|
] }, `${o.path}-${o.reason}-${i}`)) })
|
|
3096
3177
|
] }) : null
|
|
3097
3178
|
] }),
|
|
3098
|
-
/* @__PURE__ */ (0,
|
|
3179
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { className: "matrx-alchemy-preview-label", children: [
|
|
3099
3180
|
"Output format",
|
|
3100
|
-
/* @__PURE__ */ (0,
|
|
3101
|
-
formats.map((f) => /* @__PURE__ */ (0,
|
|
3102
|
-
state.draft.payload.kind === "rows" ? /* @__PURE__ */ (0,
|
|
3103
|
-
workspaceAdapters.map((adapter) => /* @__PURE__ */ (0,
|
|
3181
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("select", { "aria-label": "Output format", value: format, onChange: (e) => setFormat(e.target.value), children: [
|
|
3182
|
+
formats.map((f) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("option", { value: f, children: LABEL[f] }, f)),
|
|
3183
|
+
state.draft.payload.kind === "rows" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("option", { value: "xlsx", children: "Excel workbook" }) : null,
|
|
3184
|
+
workspaceAdapters.map((adapter) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("option", { value: adapter.id, children: adapter.label }, adapter.id))
|
|
3104
3185
|
] })
|
|
3105
3186
|
] }),
|
|
3106
|
-
/* @__PURE__ */ (0,
|
|
3107
|
-
bufferError ? /* @__PURE__ */ (0,
|
|
3108
|
-
formatError ? /* @__PURE__ */ (0,
|
|
3109
|
-
bufferError ? /* @__PURE__ */ (0,
|
|
3187
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("textarea", { className: "matrx-alchemy-preview", "aria-label": "Prepared output", "aria-invalid": bufferError ? true : void 0, "aria-describedby": bufferError ? "alchemy-buffer-error" : void 0, value: buffer, onChange: (e) => editBuffer(e.target.value) }),
|
|
3188
|
+
bufferError ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { id: "alchemy-buffer-error", role: "alert", className: "matrx-alchemy-error", children: bufferError }) : null,
|
|
3189
|
+
formatError ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { role: "alert", className: "matrx-alchemy-error", children: formatError }) : null,
|
|
3190
|
+
bufferError ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Button, { type: "button", variant: "outline", disabled: busy !== null, onClick: () => {
|
|
3110
3191
|
const fallback = (0, import_content_transfer.editDraft)(state.draft, { kind: "text", text: buffer });
|
|
3111
3192
|
setBufferError(null);
|
|
3112
3193
|
onChange({ ...state, draft: fallback, error: void 0 });
|
|
3113
3194
|
setFormat("plain");
|
|
3114
3195
|
}, children: "Use invalid JSON as plain text" }) : null
|
|
3115
3196
|
] }),
|
|
3116
|
-
ai || busy === "capture" || state.error ? /* @__PURE__ */ (0,
|
|
3117
|
-
ai ? /* @__PURE__ */ (0,
|
|
3118
|
-
/* @__PURE__ */ (0,
|
|
3197
|
+
ai || busy === "capture" || state.error ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("aside", { children: [
|
|
3198
|
+
ai ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
3199
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { children: [
|
|
3119
3200
|
"AI instruction",
|
|
3120
|
-
/* @__PURE__ */ (0,
|
|
3201
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("textarea", { value: instruction, onChange: (e) => setInstruction(e.target.value), placeholder: "Tell AI how to prepare this content" })
|
|
3121
3202
|
] }),
|
|
3122
|
-
/* @__PURE__ */ (0,
|
|
3123
|
-
busy === "ai" ? /* @__PURE__ */ (0,
|
|
3203
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Button, { type: "button", variant: "outline", disabled: !aiSession.current || !instruction.trim() || busy !== null || !aiSession.current.supports(state.snapshot), onClick: () => void runAi(false), children: "Generate preview" }),
|
|
3204
|
+
busy === "ai" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Button, { type: "button", variant: "outline", onClick: () => void cancelAi(), children: aiSession.current?.cancel ? "Cancel AI" : "Stop waiting" }) : null
|
|
3124
3205
|
] }) : null,
|
|
3125
|
-
busy === "capture" ? /* @__PURE__ */ (0,
|
|
3206
|
+
busy === "capture" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Button, { type: "button", variant: "outline", onClick: () => {
|
|
3126
3207
|
activeCapture.current?.abort();
|
|
3127
3208
|
activeCapture.current = null;
|
|
3128
3209
|
setBusy(null);
|
|
3129
3210
|
}, children: "Stop loading rows" }) : null,
|
|
3130
|
-
ai && aiFailed && aiSession.current?.recover && busy !== "ai" ? /* @__PURE__ */ (0,
|
|
3131
|
-
ai ? /* @__PURE__ */ (0,
|
|
3132
|
-
state.error ? /* @__PURE__ */ (0,
|
|
3211
|
+
ai && aiFailed && aiSession.current?.recover && busy !== "ai" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Button, { type: "button", variant: "outline", onClick: () => void runAi(true), children: aiFailed ? "Retry or rejoin AI run" : "Rejoin AI run" }) : null,
|
|
3212
|
+
ai ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "matrx-alchemy-meta", children: "AI creates a preview. It never copies automatically. Closing detaches this view without cancelling server work." }) : null,
|
|
3213
|
+
state.error ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { role: "alert", className: "matrx-alchemy-error", children: state.error }) : null
|
|
3133
3214
|
] }) : null
|
|
3134
3215
|
] }),
|
|
3135
|
-
pendingControls ? /* @__PURE__ */ (0,
|
|
3136
|
-
/* @__PURE__ */ (0,
|
|
3137
|
-
/* @__PURE__ */ (0,
|
|
3138
|
-
/* @__PURE__ */ (0,
|
|
3216
|
+
pendingControls ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "matrx-alchemy-decision", role: "alert", children: [
|
|
3217
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { children: "This control would replace your manual edit." }),
|
|
3218
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Button, { type: "button", variant: "outline", onClick: () => setPendingControls(null), children: "Keep edited draft" }),
|
|
3219
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Button, { type: "button", onClick: applyPendingControls, children: "Rebuild from source" })
|
|
3139
3220
|
] }) : null,
|
|
3140
|
-
state.sourceStale ? /* @__PURE__ */ (0,
|
|
3141
|
-
state.pending ? /* @__PURE__ */ (0,
|
|
3142
|
-
/* @__PURE__ */ (0,
|
|
3143
|
-
/* @__PURE__ */ (0,
|
|
3144
|
-
/* @__PURE__ */ (0,
|
|
3221
|
+
state.sourceStale ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { role: "alert", className: "matrx-alchemy-decision", children: "The source changed since this draft. Use Refresh source to review the latest data." }) : null,
|
|
3222
|
+
state.pending ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "matrx-alchemy-decision", role: "alert", children: [
|
|
3223
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { children: "A fresh source snapshot is ready." }),
|
|
3224
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Button, { type: "button", variant: "outline", onClick: () => resolveCapture("keep"), children: "Keep current snapshot and draft" }),
|
|
3225
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Button, { type: "button", onClick: () => resolveCapture("regenerate"), children: "Regenerate from fresh source" })
|
|
3145
3226
|
] }) : null,
|
|
3146
|
-
deliveryNotice ? /* @__PURE__ */ (0,
|
|
3147
|
-
/* @__PURE__ */ (0,
|
|
3148
|
-
/* @__PURE__ */ (0,
|
|
3227
|
+
deliveryNotice ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { role: "status", className: "matrx-alchemy-meta", children: deliveryNotice }) : null,
|
|
3228
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DialogFooter, { children: [
|
|
3229
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "matrx-alchemy-meta", children: [
|
|
3149
3230
|
buffer.length.toLocaleString(),
|
|
3150
3231
|
" characters \xB7 ~",
|
|
3151
3232
|
estimateTokens(buffer).toLocaleString(),
|
|
3152
3233
|
" tokens"
|
|
3153
3234
|
] }),
|
|
3154
|
-
/* @__PURE__ */ (0,
|
|
3155
|
-
/* @__PURE__ */ (0,
|
|
3156
|
-
/* @__PURE__ */ (0,
|
|
3235
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Button, { type: "button", variant: "outline", onClick: close, children: "Close" }),
|
|
3236
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Button, { type: "button", variant: "outline", disabled: busy !== null || Boolean(bufferError || formatError) || !preparedArtifact, onClick: () => void deliver(true), children: "Download prepared output" }),
|
|
3237
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Button, { type: "button", disabled: busy !== null || Boolean(bufferError || formatError) || !preparedArtifact, onClick: () => void deliver(false), children: "Copy prepared output" })
|
|
3157
3238
|
] })
|
|
3158
3239
|
] }) });
|
|
3159
3240
|
}
|
|
3160
3241
|
function RowControls({ rows, controls, change }) {
|
|
3161
|
-
return /* @__PURE__ */ (0,
|
|
3162
|
-
/* @__PURE__ */ (0,
|
|
3163
|
-
/* @__PURE__ */ (0,
|
|
3242
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
3243
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "matrx-alchemy-toolbar", children: [
|
|
3244
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { children: [
|
|
3164
3245
|
"Search",
|
|
3165
|
-
/* @__PURE__ */ (0,
|
|
3246
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("input", { value: controls.search, onChange: (e) => change({ ...controls, search: e.target.value }) })
|
|
3166
3247
|
] }),
|
|
3167
|
-
/* @__PURE__ */ (0,
|
|
3248
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { children: [
|
|
3168
3249
|
"Sort",
|
|
3169
|
-
/* @__PURE__ */ (0,
|
|
3170
|
-
/* @__PURE__ */ (0,
|
|
3171
|
-
rows.columns.map((column) => /* @__PURE__ */ (0,
|
|
3250
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("select", { value: controls.sort, onChange: (e) => change({ ...controls, sort: e.target.value }), children: [
|
|
3251
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("option", { value: "", children: "None" }),
|
|
3252
|
+
rows.columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("option", { value: column.id, children: column.label }, column.id))
|
|
3172
3253
|
] })
|
|
3173
3254
|
] }),
|
|
3174
|
-
/* @__PURE__ */ (0,
|
|
3255
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { children: [
|
|
3175
3256
|
"Direction",
|
|
3176
|
-
/* @__PURE__ */ (0,
|
|
3177
|
-
/* @__PURE__ */ (0,
|
|
3178
|
-
/* @__PURE__ */ (0,
|
|
3257
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("select", { value: controls.direction, disabled: !controls.sort, onChange: (e) => change({ ...controls, direction: e.target.value }), children: [
|
|
3258
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("option", { value: "asc", children: "Ascending" }),
|
|
3259
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("option", { value: "desc", children: "Descending" })
|
|
3179
3260
|
] })
|
|
3180
3261
|
] }),
|
|
3181
|
-
/* @__PURE__ */ (0,
|
|
3262
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { children: [
|
|
3182
3263
|
"Top rows",
|
|
3183
|
-
/* @__PURE__ */ (0,
|
|
3264
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("input", { type: "number", min: "0", value: controls.top ?? "", onChange: (e) => change({ ...controls, top: Number.isNaN(e.target.valueAsNumber) ? null : e.target.valueAsNumber }) })
|
|
3184
3265
|
] })
|
|
3185
3266
|
] }),
|
|
3186
|
-
/* @__PURE__ */ (0,
|
|
3187
|
-
/* @__PURE__ */ (0,
|
|
3188
|
-
rows.columns.map((column) => /* @__PURE__ */ (0,
|
|
3189
|
-
/* @__PURE__ */ (0,
|
|
3190
|
-
/* @__PURE__ */ (0,
|
|
3267
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("fieldset", { className: "matrx-alchemy-options", children: [
|
|
3268
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("legend", { children: "Columns and filters" }),
|
|
3269
|
+
rows.columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "matrx-alchemy-column", children: [
|
|
3270
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { children: [
|
|
3271
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("input", { type: "checkbox", checked: controls.visibleColumns.includes(column.id), onChange: (e) => change({ ...controls, visibleColumns: e.target.checked ? [...controls.visibleColumns, column.id] : controls.visibleColumns.filter((id) => id !== column.id) }) }),
|
|
3191
3272
|
" ",
|
|
3192
3273
|
column.label
|
|
3193
3274
|
] }),
|
|
3194
|
-
/* @__PURE__ */ (0,
|
|
3275
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("input", { "aria-label": `Filter ${column.label}`, placeholder: "Filter", value: controls.filters[column.id] ?? "", onChange: (e) => change({ ...controls, filters: { ...controls.filters, [column.id]: e.target.value } }) })
|
|
3195
3276
|
] }, column.id))
|
|
3196
3277
|
] }),
|
|
3197
|
-
/* @__PURE__ */ (0,
|
|
3198
|
-
/* @__PURE__ */ (0,
|
|
3199
|
-
/* @__PURE__ */ (0,
|
|
3200
|
-
/* @__PURE__ */ (0,
|
|
3278
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("fieldset", { className: "matrx-alchemy-options", children: [
|
|
3279
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("legend", { children: "Rows" }),
|
|
3280
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { children: [
|
|
3281
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("input", { type: "checkbox", checked: controls.selectedOnly, onChange: (e) => change({ ...controls, selectedOnly: e.target.checked }) }),
|
|
3201
3282
|
" Only selected rows"
|
|
3202
3283
|
] }),
|
|
3203
|
-
/* @__PURE__ */ (0,
|
|
3284
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "matrx-alchemy-row-list", children: rows.rows.map((row, index) => {
|
|
3204
3285
|
const summary = rows.columns.filter((column) => column.visible).slice(0, 2).map((column) => String((0, import_content_transfer.readTransferCell)(row, column) ?? "")).filter(Boolean).join(" \xB7 ");
|
|
3205
|
-
return /* @__PURE__ */ (0,
|
|
3206
|
-
/* @__PURE__ */ (0,
|
|
3286
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { children: [
|
|
3287
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("input", { type: "checkbox", checked: controls.selectedIndices.includes(index), onChange: (e) => change({ ...controls, selectedIndices: e.target.checked ? [...controls.selectedIndices, index] : controls.selectedIndices.filter((value) => value !== index) }) }),
|
|
3207
3288
|
" Row ",
|
|
3208
3289
|
index + 1,
|
|
3209
3290
|
summary ? ` \u2014 ${summary}` : ""
|
|
@@ -3214,7 +3295,7 @@ function RowControls({ rows, controls, change }) {
|
|
|
3214
3295
|
}
|
|
3215
3296
|
|
|
3216
3297
|
// src/content-transfer/matrx-copy.tsx
|
|
3217
|
-
var
|
|
3298
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
3218
3299
|
var resolve = (value) => typeof value === "function" ? value() : value;
|
|
3219
3300
|
var asPayload = (value) => ({
|
|
3220
3301
|
kind: "markdown",
|
|
@@ -3244,6 +3325,7 @@ var actionDone = (message) => ({
|
|
|
3244
3325
|
mimeTypes: [],
|
|
3245
3326
|
message
|
|
3246
3327
|
});
|
|
3328
|
+
var isSafeFilename = (filename) => filename === filename.trim() && filename.length > 0 && !/^\.+$/.test(filename) && !/[\\/\x00-\x1F\x7F]/.test(filename);
|
|
3247
3329
|
var sourceFor = (id, label, build) => ({
|
|
3248
3330
|
id,
|
|
3249
3331
|
label,
|
|
@@ -3256,7 +3338,7 @@ var sourceFor = (id, label, build) => ({
|
|
|
3256
3338
|
});
|
|
3257
3339
|
function MatrxCopyMenu(props) {
|
|
3258
3340
|
const inherited = useContentTransferCapabilities();
|
|
3259
|
-
return /* @__PURE__ */ (0,
|
|
3341
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3260
3342
|
MatrxCopyMenuSession,
|
|
3261
3343
|
{
|
|
3262
3344
|
...props
|
|
@@ -3268,12 +3350,12 @@ function MatrxCopyMenu(props) {
|
|
|
3268
3350
|
);
|
|
3269
3351
|
}
|
|
3270
3352
|
function MatrxCopyMenuSession(props) {
|
|
3271
|
-
const instance =
|
|
3272
|
-
const controller =
|
|
3353
|
+
const instance = React14.useId();
|
|
3354
|
+
const controller = React14.useRef(null);
|
|
3273
3355
|
const capabilities = useContentTransferCapabilities();
|
|
3274
3356
|
const transport = capabilities.transport ?? (0, import_content_transfer2.createBrowserTransport)();
|
|
3275
|
-
const [modal, setModal] =
|
|
3276
|
-
const [configuration, setConfiguration] =
|
|
3357
|
+
const [modal, setModal] = React14.useState(null);
|
|
3358
|
+
const [configuration, setConfiguration] = React14.useState(null);
|
|
3277
3359
|
const copyVisible = !props.hide?.includes("copy");
|
|
3278
3360
|
const aiVisible = !props.hide?.includes("ai");
|
|
3279
3361
|
const exportVisible = !props.hide?.includes("export");
|
|
@@ -3392,7 +3474,8 @@ function MatrxCopyMenuSession(props) {
|
|
|
3392
3474
|
value: {
|
|
3393
3475
|
bytes: Array.from(bytes),
|
|
3394
3476
|
mime: file.mime,
|
|
3395
|
-
extension: file.extension
|
|
3477
|
+
extension: file.extension,
|
|
3478
|
+
...file.filename !== void 0 ? { filename: file.filename } : {}
|
|
3396
3479
|
}
|
|
3397
3480
|
};
|
|
3398
3481
|
},
|
|
@@ -3409,12 +3492,16 @@ function MatrxCopyMenuSession(props) {
|
|
|
3409
3492
|
(byte) => typeof byte !== "number" || !Number.isInteger(byte) || byte < 0 || byte > 255
|
|
3410
3493
|
))
|
|
3411
3494
|
throw new Error(`${item.label} did not capture a valid file.`);
|
|
3495
|
+
if (value.filename !== void 0 && (typeof value.filename !== "string" || !isSafeFilename(value.filename)))
|
|
3496
|
+
throw new Error(
|
|
3497
|
+
`${item.label} has an unsafe filename. Use a nonempty basename without leading or trailing whitespace, dots only, path separators, or control characters.`
|
|
3498
|
+
);
|
|
3412
3499
|
if (draft.omissions.some((omission) => omission.reason !== "duplicate"))
|
|
3413
3500
|
throw new Error(
|
|
3414
3501
|
"This custom file exceeds the configured export limits or contains excluded content. Use a standard format or revise the source options."
|
|
3415
3502
|
);
|
|
3416
3503
|
const bytes = new Uint8Array(value.bytes);
|
|
3417
|
-
const filename = `${props.label.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "export"}.${value.extension.replace(/[^a-zA-Z0-9.-]/g, "") || "bin"}`;
|
|
3504
|
+
const filename = typeof value.filename === "string" ? value.filename : `${props.label.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "export"}.${value.extension.replace(/[^a-zA-Z0-9.-]/g, "") || "bin"}`;
|
|
3418
3505
|
return transport.download(
|
|
3419
3506
|
(0, import_content_transfer2.sealTransferArtifact)({
|
|
3420
3507
|
snapshotId: snapshot.id,
|
|
@@ -3443,8 +3530,8 @@ function MatrxCopyMenuSession(props) {
|
|
|
3443
3530
|
const source = (props.primarySource === "table" ? table : void 0) ?? json ?? table ?? structuredAgent ?? human ?? builderVariants[0]?.source;
|
|
3444
3531
|
if (!source && !actions.length) return null;
|
|
3445
3532
|
const target = source ?? make("actions", () => ({ kind: "text", text: props.label }));
|
|
3446
|
-
return /* @__PURE__ */ (0,
|
|
3447
|
-
/* @__PURE__ */ (0,
|
|
3533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
3534
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3448
3535
|
ContentTransferMenu,
|
|
3449
3536
|
{
|
|
3450
3537
|
source: target,
|
|
@@ -3477,7 +3564,7 @@ function MatrxCopyMenuSession(props) {
|
|
|
3477
3564
|
if (!open) setModal(null);
|
|
3478
3565
|
}
|
|
3479
3566
|
}),
|
|
3480
|
-
configuration ? /* @__PURE__ */ (0,
|
|
3567
|
+
configuration ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3481
3568
|
SourceConfiguration,
|
|
3482
3569
|
{
|
|
3483
3570
|
restoreFocus: () => controller.current?.focusTrigger(),
|
|
@@ -3504,14 +3591,14 @@ function SourceConfiguration({
|
|
|
3504
3591
|
onPrepare
|
|
3505
3592
|
}) {
|
|
3506
3593
|
const custom = configuration.custom;
|
|
3507
|
-
const handingOff =
|
|
3594
|
+
const handingOff = React14.useRef(false);
|
|
3508
3595
|
const groomer = configuration.groomer;
|
|
3509
|
-
const [values, setValues] =
|
|
3596
|
+
const [values, setValues] = React14.useState(
|
|
3510
3597
|
() => Object.fromEntries(
|
|
3511
3598
|
custom?.options.map((option) => [option.key, option.default]) ?? []
|
|
3512
3599
|
)
|
|
3513
3600
|
);
|
|
3514
|
-
const [sections, setSections] =
|
|
3601
|
+
const [sections, setSections] = React14.useState(
|
|
3515
3602
|
() => Object.fromEntries(
|
|
3516
3603
|
groomer?.sections.map((section) => [
|
|
3517
3604
|
section.id,
|
|
@@ -3519,8 +3606,8 @@ function SourceConfiguration({
|
|
|
3519
3606
|
]) ?? []
|
|
3520
3607
|
)
|
|
3521
3608
|
);
|
|
3522
|
-
const [error, setError] =
|
|
3523
|
-
const [busy, setBusy] =
|
|
3609
|
+
const [error, setError] = React14.useState(null);
|
|
3610
|
+
const [busy, setBusy] = React14.useState(false);
|
|
3524
3611
|
const title = custom?.dialogTitle ?? groomer?.label ?? "Customize source";
|
|
3525
3612
|
let prepared = null;
|
|
3526
3613
|
let buildError = null;
|
|
@@ -3557,14 +3644,14 @@ function SourceConfiguration({
|
|
|
3557
3644
|
} catch (cause) {
|
|
3558
3645
|
buildError = cause instanceof Error ? cause.message : "Could not prepare this source.";
|
|
3559
3646
|
}
|
|
3560
|
-
return /* @__PURE__ */ (0,
|
|
3647
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3561
3648
|
Dialog,
|
|
3562
3649
|
{
|
|
3563
3650
|
open: true,
|
|
3564
3651
|
onOpenChange: (open) => {
|
|
3565
3652
|
if (!open && !busy) onClose();
|
|
3566
3653
|
},
|
|
3567
|
-
children: /* @__PURE__ */ (0,
|
|
3654
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
3568
3655
|
DialogContent,
|
|
3569
3656
|
{
|
|
3570
3657
|
onCloseAutoFocus: (event) => {
|
|
@@ -3573,22 +3660,22 @@ function SourceConfiguration({
|
|
|
3573
3660
|
},
|
|
3574
3661
|
className: "matrx-alchemy-workspace",
|
|
3575
3662
|
children: [
|
|
3576
|
-
/* @__PURE__ */ (0,
|
|
3577
|
-
/* @__PURE__ */ (0,
|
|
3578
|
-
/* @__PURE__ */ (0,
|
|
3663
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(DialogHeader, { children: [
|
|
3664
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DialogTitle, { children: title }),
|
|
3665
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DialogDescription, { children: custom?.dialogDescription ?? "Choose the source detail, then prepare, edit, summarize, copy or export it in Alchemy." })
|
|
3579
3666
|
] }),
|
|
3580
|
-
/* @__PURE__ */ (0,
|
|
3581
|
-
custom?.options.map((option) => /* @__PURE__ */ (0,
|
|
3667
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "matrx-alchemy-main matrx-alchemy-toolbar", children: [
|
|
3668
|
+
custom?.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { children: [
|
|
3582
3669
|
option.label,
|
|
3583
|
-
"hint" in option && option.hint ? /* @__PURE__ */ (0,
|
|
3584
|
-
option.kind === "toggle" ? /* @__PURE__ */ (0,
|
|
3670
|
+
"hint" in option && option.hint ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("small", { children: option.hint }) : null,
|
|
3671
|
+
option.kind === "toggle" ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3585
3672
|
"input",
|
|
3586
3673
|
{
|
|
3587
3674
|
type: "checkbox",
|
|
3588
3675
|
checked: Boolean(values[option.key]),
|
|
3589
3676
|
onChange: (event) => setValues({ ...values, [option.key]: event.target.checked })
|
|
3590
3677
|
}
|
|
3591
|
-
) : option.kind === "preset" ? /* @__PURE__ */ (0,
|
|
3678
|
+
) : option.kind === "preset" ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3592
3679
|
"select",
|
|
3593
3680
|
{
|
|
3594
3681
|
value: Number(values[option.key]),
|
|
@@ -3596,10 +3683,10 @@ function SourceConfiguration({
|
|
|
3596
3683
|
...values,
|
|
3597
3684
|
[option.key]: Number(event.target.value)
|
|
3598
3685
|
}),
|
|
3599
|
-
children: option.options.map((choice) => /* @__PURE__ */ (0,
|
|
3686
|
+
children: option.options.map((choice) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: choice.value, children: choice.label }, choice.value))
|
|
3600
3687
|
}
|
|
3601
|
-
) : option.kind === "slider" ? /* @__PURE__ */ (0,
|
|
3602
|
-
/* @__PURE__ */ (0,
|
|
3688
|
+
) : option.kind === "slider" ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
3689
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3603
3690
|
"input",
|
|
3604
3691
|
{
|
|
3605
3692
|
type: "range",
|
|
@@ -3613,9 +3700,9 @@ function SourceConfiguration({
|
|
|
3613
3700
|
})
|
|
3614
3701
|
}
|
|
3615
3702
|
),
|
|
3616
|
-
/* @__PURE__ */ (0,
|
|
3617
|
-
] }) : /* @__PURE__ */ (0,
|
|
3618
|
-
/* @__PURE__ */ (0,
|
|
3703
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: option.formatValue(Number(values[option.key])) })
|
|
3704
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
3705
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3619
3706
|
"input",
|
|
3620
3707
|
{
|
|
3621
3708
|
type: "number",
|
|
@@ -3628,7 +3715,7 @@ function SourceConfiguration({
|
|
|
3628
3715
|
})
|
|
3629
3716
|
}
|
|
3630
3717
|
),
|
|
3631
|
-
option.presets?.map((preset) => /* @__PURE__ */ (0,
|
|
3718
|
+
option.presets?.map((preset) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3632
3719
|
Button,
|
|
3633
3720
|
{
|
|
3634
3721
|
type: "button",
|
|
@@ -3640,8 +3727,8 @@ function SourceConfiguration({
|
|
|
3640
3727
|
))
|
|
3641
3728
|
] })
|
|
3642
3729
|
] }, option.key)),
|
|
3643
|
-
groomer ? /* @__PURE__ */ (0,
|
|
3644
|
-
/* @__PURE__ */ (0,
|
|
3730
|
+
groomer ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
3731
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { children: ["full", "compact", "brief"].map((level) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3645
3732
|
Button,
|
|
3646
3733
|
{
|
|
3647
3734
|
type: "button",
|
|
@@ -3658,9 +3745,9 @@ function SourceConfiguration({
|
|
|
3658
3745
|
},
|
|
3659
3746
|
level
|
|
3660
3747
|
)) }),
|
|
3661
|
-
groomer.sections.map((section) => /* @__PURE__ */ (0,
|
|
3748
|
+
groomer.sections.map((section) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { children: [
|
|
3662
3749
|
section.title,
|
|
3663
|
-
/* @__PURE__ */ (0,
|
|
3750
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
3664
3751
|
"select",
|
|
3665
3752
|
{
|
|
3666
3753
|
value: sections[section.id],
|
|
@@ -3669,25 +3756,25 @@ function SourceConfiguration({
|
|
|
3669
3756
|
[section.id]: event.target.value
|
|
3670
3757
|
}),
|
|
3671
3758
|
children: [
|
|
3672
|
-
["full", "compact", "brief"].map((level) => /* @__PURE__ */ (0,
|
|
3673
|
-
section.cuttable ? /* @__PURE__ */ (0,
|
|
3759
|
+
["full", "compact", "brief"].map((level) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: level, children: section.levelLabels?.[level] ?? level }, level)),
|
|
3760
|
+
section.cuttable ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "off", children: "Exclude" }) : null
|
|
3674
3761
|
]
|
|
3675
3762
|
}
|
|
3676
3763
|
),
|
|
3677
|
-
section.description ? /* @__PURE__ */ (0,
|
|
3764
|
+
section.description ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: section.description }) : null
|
|
3678
3765
|
] }, section.id))
|
|
3679
3766
|
] }) : null
|
|
3680
3767
|
] }),
|
|
3681
|
-
/* @__PURE__ */ (0,
|
|
3768
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("p", { children: [
|
|
3682
3769
|
text.length.toLocaleString(),
|
|
3683
3770
|
" characters \xB7 approximately",
|
|
3684
3771
|
" ",
|
|
3685
3772
|
Math.ceil(text.length / 4).toLocaleString(),
|
|
3686
3773
|
" tokens"
|
|
3687
3774
|
] }),
|
|
3688
|
-
error || buildError ? /* @__PURE__ */ (0,
|
|
3689
|
-
/* @__PURE__ */ (0,
|
|
3690
|
-
/* @__PURE__ */ (0,
|
|
3775
|
+
error || buildError ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { role: "alert", children: error ?? buildError }) : null,
|
|
3776
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(DialogFooter, { children: [
|
|
3777
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3691
3778
|
Button,
|
|
3692
3779
|
{
|
|
3693
3780
|
type: "button",
|
|
@@ -3697,7 +3784,7 @@ function SourceConfiguration({
|
|
|
3697
3784
|
children: "Cancel"
|
|
3698
3785
|
}
|
|
3699
3786
|
),
|
|
3700
|
-
/* @__PURE__ */ (0,
|
|
3787
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3701
3788
|
Button,
|
|
3702
3789
|
{
|
|
3703
3790
|
type: "button",
|
|
@@ -3757,12 +3844,12 @@ ${JSON.stringify(value.data, null, 2)}
|
|
|
3757
3844
|
}
|
|
3758
3845
|
|
|
3759
3846
|
// src/data-table/copy.tsx
|
|
3760
|
-
var
|
|
3847
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
3761
3848
|
function CopyButtons(props) {
|
|
3762
3849
|
const { CopyControls } = useMatrxDataTableHost();
|
|
3763
3850
|
const copyProps = props.export?.sheetRows ? { ...props, primarySource: "table" } : props;
|
|
3764
|
-
if (CopyControls) return /* @__PURE__ */ (0,
|
|
3765
|
-
return /* @__PURE__ */ (0,
|
|
3851
|
+
if (CopyControls) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CopyControls, { ...copyProps });
|
|
3852
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(MatrxCopyMenu, { ...copyProps });
|
|
3766
3853
|
}
|
|
3767
3854
|
function jsonExportItem(build, label) {
|
|
3768
3855
|
return { id: "json", label, build: () => ({ content: JSON.stringify(build(), null, 2), extension: "json", mime: "application/json" }) };
|
|
@@ -3866,7 +3953,7 @@ function buildViewHuman(config, visible, columns) {
|
|
|
3866
3953
|
}
|
|
3867
3954
|
|
|
3868
3955
|
// src/data-table/CopySubset.tsx
|
|
3869
|
-
var
|
|
3956
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
3870
3957
|
function CopySubsetDialog({ source, onClose }) {
|
|
3871
3958
|
const [rows] = (0, import_react4.useState)(() => [...source.rows]);
|
|
3872
3959
|
const [hidden, setHidden] = (0, import_react4.useState)(() => new Set(source.columns.filter((c) => c.hidden).map((c) => c.id)));
|
|
@@ -3887,14 +3974,14 @@ function CopySubsetDialog({ source, onClose }) {
|
|
|
3887
3974
|
} catch (raw) {
|
|
3888
3975
|
buildError = raw instanceof Error ? raw.message : String(raw);
|
|
3889
3976
|
}
|
|
3890
|
-
return /* @__PURE__ */ (0,
|
|
3977
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Dialog, { open: true, onOpenChange: (open) => {
|
|
3891
3978
|
if (!open) onClose();
|
|
3892
|
-
}, children: /* @__PURE__ */ (0,
|
|
3893
|
-
/* @__PURE__ */ (0,
|
|
3894
|
-
/* @__PURE__ */ (0,
|
|
3895
|
-
/* @__PURE__ */ (0,
|
|
3896
|
-
source.columns.map((column) => /* @__PURE__ */ (0,
|
|
3897
|
-
/* @__PURE__ */ (0,
|
|
3979
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogContent, { className: "flex h-[80dvh] max-w-5xl flex-col overflow-hidden", children: [
|
|
3980
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogTitle, { children: "Filter & sort before copying" }) }),
|
|
3981
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("fieldset", { className: "max-h-24 shrink-0 overflow-auto text-xs", children: [
|
|
3982
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("legend", { children: "Visible columns" }),
|
|
3983
|
+
source.columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { className: "mr-3 inline-flex items-center gap-1", children: [
|
|
3984
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("input", { type: "checkbox", checked: !hidden.has(column.id), onChange: () => setHidden((current) => {
|
|
3898
3985
|
const next = new Set(current);
|
|
3899
3986
|
next.has(column.id) ? next.delete(column.id) : next.add(column.id);
|
|
3900
3987
|
return next;
|
|
@@ -3902,20 +3989,20 @@ function CopySubsetDialog({ source, onClose }) {
|
|
|
3902
3989
|
column.header
|
|
3903
3990
|
] }, column.id))
|
|
3904
3991
|
] }),
|
|
3905
|
-
columns.length ? /* @__PURE__ */ (0,
|
|
3906
|
-
buildError ? /* @__PURE__ */ (0,
|
|
3992
|
+
columns.length ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(MatrxDataTable, { data: rows, columns, getRowId: source.getRowId, query: { mode: "controlled-local", state: query, onStateChange: setQuery }, selection: { selectedIds, onSelectedIdsChange: setSelectedIds }, detail: { enabled: false }, window: { enabled: false }, toolbar: { searchMatch: {} } }) }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { children: "Show at least one column to copy." }),
|
|
3993
|
+
buildError ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { role: "alert", className: "text-destructive", children: buildError }) : null,
|
|
3907
3994
|
notice,
|
|
3908
|
-
/* @__PURE__ */ (0,
|
|
3909
|
-
/* @__PURE__ */ (0,
|
|
3995
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogFooter, { children: [
|
|
3996
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { className: "flex items-center gap-2 text-sm", children: [
|
|
3910
3997
|
"Format",
|
|
3911
|
-
/* @__PURE__ */ (0,
|
|
3912
|
-
/* @__PURE__ */ (0,
|
|
3913
|
-
/* @__PURE__ */ (0,
|
|
3914
|
-
/* @__PURE__ */ (0,
|
|
3915
|
-
/* @__PURE__ */ (0,
|
|
3998
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("select", { "aria-label": "Copy format", value: format, onChange: (event) => setFormat(event.target.value), children: [
|
|
3999
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "ai", children: "For AI" }),
|
|
4000
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "markdown", children: "Markdown" }),
|
|
4001
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "csv", children: "CSV" }),
|
|
4002
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "json", children: "JSON" })
|
|
3916
4003
|
] })
|
|
3917
4004
|
] }),
|
|
3918
|
-
/* @__PURE__ */ (0,
|
|
4005
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { role: "status", className: "text-xs", children: [
|
|
3919
4006
|
shaped.length,
|
|
3920
4007
|
" of ",
|
|
3921
4008
|
rows.length,
|
|
@@ -3925,13 +4012,13 @@ function CopySubsetDialog({ source, onClose }) {
|
|
|
3925
4012
|
text.length.toLocaleString(),
|
|
3926
4013
|
" characters"
|
|
3927
4014
|
] }),
|
|
3928
|
-
/* @__PURE__ */ (0,
|
|
3929
|
-
/* @__PURE__ */ (0,
|
|
4015
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Button, { type: "button", variant: "outline", onClick: onClose, children: "Close" }),
|
|
4016
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Button, { type: "button", disabled: buildError !== null || !columns.length || !shaped.length, onClick: () => void clipboard.copyText(text, `${source.label} copied`), children: "Copy subset" })
|
|
3930
4017
|
] })
|
|
3931
4018
|
] }) });
|
|
3932
4019
|
}
|
|
3933
4020
|
function useCopySubsetVariant() {
|
|
3934
|
-
return (getSource) => ({ id: "copy-subset", label: "Filter & sort before copying\u2026", section: "ai", modal: ({ open, onOpenChange }) => open ? /* @__PURE__ */ (0,
|
|
4021
|
+
return (getSource) => ({ id: "copy-subset", label: "Filter & sort before copying\u2026", section: "ai", modal: ({ open, onOpenChange }) => open ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(CopySubsetDialog, { source: getSource(), onClose: () => onOpenChange(false) }) : null });
|
|
3935
4022
|
}
|
|
3936
4023
|
|
|
3937
4024
|
// src/data-table/clipping.ts
|
|
@@ -4133,11 +4220,11 @@ var import_core = require("@dnd-kit/core");
|
|
|
4133
4220
|
|
|
4134
4221
|
// src/popover.tsx
|
|
4135
4222
|
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"), 1);
|
|
4136
|
-
var
|
|
4137
|
-
var
|
|
4223
|
+
var React15 = __toESM(require("react"), 1);
|
|
4224
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
4138
4225
|
var Popover = PopoverPrimitive.Root;
|
|
4139
4226
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
4140
|
-
var PopoverContent =
|
|
4227
|
+
var PopoverContent = React15.forwardRef(
|
|
4141
4228
|
({
|
|
4142
4229
|
className,
|
|
4143
4230
|
align = "center",
|
|
@@ -4147,7 +4234,7 @@ var PopoverContent = React14.forwardRef(
|
|
|
4147
4234
|
...props
|
|
4148
4235
|
}, ref) => {
|
|
4149
4236
|
const portalContainer = usePortalContainer(container);
|
|
4150
|
-
return /* @__PURE__ */ (0,
|
|
4237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(PopoverPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4151
4238
|
PopoverPrimitive.Content,
|
|
4152
4239
|
{
|
|
4153
4240
|
ref,
|
|
@@ -4174,9 +4261,9 @@ PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
|
4174
4261
|
// src/command.tsx
|
|
4175
4262
|
var DialogPrimitive2 = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
4176
4263
|
var import_cmdk = require("cmdk");
|
|
4177
|
-
var
|
|
4178
|
-
var
|
|
4179
|
-
var Command =
|
|
4264
|
+
var React16 = __toESM(require("react"), 1);
|
|
4265
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
4266
|
+
var Command = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4180
4267
|
import_cmdk.Command,
|
|
4181
4268
|
{
|
|
4182
4269
|
ref,
|
|
@@ -4191,12 +4278,12 @@ Command.displayName = import_cmdk.Command.displayName;
|
|
|
4191
4278
|
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`;
|
|
4192
4279
|
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";
|
|
4193
4280
|
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";
|
|
4194
|
-
var CommandDialogContent =
|
|
4281
|
+
var CommandDialogContent = React16.forwardRef(({ className, children, container, ...props }, ref) => {
|
|
4195
4282
|
const isMobile = useIsMobile();
|
|
4196
4283
|
const isModal = useRadixDialogModal();
|
|
4197
4284
|
const portalContainer = usePortalContainer(container);
|
|
4198
|
-
return /* @__PURE__ */ (0,
|
|
4199
|
-
isModal ? /* @__PURE__ */ (0,
|
|
4285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(DialogPrimitive2.Portal, { container: portalContainer, children: [
|
|
4286
|
+
isModal ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4200
4287
|
DialogPrimitive2.Overlay,
|
|
4201
4288
|
{
|
|
4202
4289
|
className: cn(
|
|
@@ -4205,7 +4292,7 @@ var CommandDialogContent = React15.forwardRef(({ className, children, container,
|
|
|
4205
4292
|
)
|
|
4206
4293
|
}
|
|
4207
4294
|
) : null,
|
|
4208
|
-
/* @__PURE__ */ (0,
|
|
4295
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
4209
4296
|
DialogPrimitive2.Content,
|
|
4210
4297
|
{
|
|
4211
4298
|
ref,
|
|
@@ -4221,9 +4308,9 @@ var CommandDialogContent = React15.forwardRef(({ className, children, container,
|
|
|
4221
4308
|
...props,
|
|
4222
4309
|
children: [
|
|
4223
4310
|
children,
|
|
4224
|
-
/* @__PURE__ */ (0,
|
|
4225
|
-
/* @__PURE__ */ (0,
|
|
4226
|
-
/* @__PURE__ */ (0,
|
|
4311
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.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: [
|
|
4312
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(XIcon, { className: "h-4 w-4" }),
|
|
4313
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "sr-only", children: "Close" })
|
|
4227
4314
|
] })
|
|
4228
4315
|
]
|
|
4229
4316
|
}
|
|
@@ -4231,9 +4318,9 @@ var CommandDialogContent = React15.forwardRef(({ className, children, container,
|
|
|
4231
4318
|
] });
|
|
4232
4319
|
});
|
|
4233
4320
|
CommandDialogContent.displayName = "CommandDialogContent";
|
|
4234
|
-
var CommandInput =
|
|
4235
|
-
/* @__PURE__ */ (0,
|
|
4236
|
-
/* @__PURE__ */ (0,
|
|
4321
|
+
var CommandInput = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
|
4322
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(MagnifyingGlassIcon, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
4323
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4237
4324
|
import_cmdk.Command.Input,
|
|
4238
4325
|
{
|
|
4239
4326
|
ref,
|
|
@@ -4246,7 +4333,7 @@ var CommandInput = React15.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
4246
4333
|
)
|
|
4247
4334
|
] }));
|
|
4248
4335
|
CommandInput.displayName = import_cmdk.Command.Input.displayName;
|
|
4249
|
-
var CommandList =
|
|
4336
|
+
var CommandList = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4250
4337
|
import_cmdk.Command.List,
|
|
4251
4338
|
{
|
|
4252
4339
|
ref,
|
|
@@ -4255,7 +4342,7 @@ var CommandList = React15.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
4255
4342
|
}
|
|
4256
4343
|
));
|
|
4257
4344
|
CommandList.displayName = import_cmdk.Command.List.displayName;
|
|
4258
|
-
var CommandEmpty =
|
|
4345
|
+
var CommandEmpty = React16.forwardRef((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4259
4346
|
import_cmdk.Command.Empty,
|
|
4260
4347
|
{
|
|
4261
4348
|
ref,
|
|
@@ -4264,7 +4351,7 @@ var CommandEmpty = React15.forwardRef((props, ref) => /* @__PURE__ */ (0, import
|
|
|
4264
4351
|
}
|
|
4265
4352
|
));
|
|
4266
4353
|
CommandEmpty.displayName = import_cmdk.Command.Empty.displayName;
|
|
4267
|
-
var CommandGroup =
|
|
4354
|
+
var CommandGroup = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4268
4355
|
import_cmdk.Command.Group,
|
|
4269
4356
|
{
|
|
4270
4357
|
ref,
|
|
@@ -4276,7 +4363,7 @@ var CommandGroup = React15.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
4276
4363
|
}
|
|
4277
4364
|
));
|
|
4278
4365
|
CommandGroup.displayName = import_cmdk.Command.Group.displayName;
|
|
4279
|
-
var CommandSeparator =
|
|
4366
|
+
var CommandSeparator = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4280
4367
|
import_cmdk.Command.Separator,
|
|
4281
4368
|
{
|
|
4282
4369
|
ref,
|
|
@@ -4285,7 +4372,7 @@ var CommandSeparator = React15.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
4285
4372
|
}
|
|
4286
4373
|
));
|
|
4287
4374
|
CommandSeparator.displayName = import_cmdk.Command.Separator.displayName;
|
|
4288
|
-
var CommandItem =
|
|
4375
|
+
var CommandItem = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4289
4376
|
import_cmdk.Command.Item,
|
|
4290
4377
|
{
|
|
4291
4378
|
ref,
|
|
@@ -4301,7 +4388,7 @@ var CommandShortcut = ({
|
|
|
4301
4388
|
className,
|
|
4302
4389
|
...props
|
|
4303
4390
|
}) => {
|
|
4304
|
-
return /* @__PURE__ */ (0,
|
|
4391
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4305
4392
|
"span",
|
|
4306
4393
|
{
|
|
4307
4394
|
className: cn(
|
|
@@ -4316,7 +4403,7 @@ CommandShortcut.displayName = "CommandShortcut";
|
|
|
4316
4403
|
|
|
4317
4404
|
// src/data-table/ColumnHeaderCell.tsx
|
|
4318
4405
|
init_filter_engine();
|
|
4319
|
-
var
|
|
4406
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
4320
4407
|
function ColumnHeaderCell({
|
|
4321
4408
|
label,
|
|
4322
4409
|
labelText,
|
|
@@ -4386,7 +4473,7 @@ function ColumnHeaderCell({
|
|
|
4386
4473
|
else onFilterChange(next);
|
|
4387
4474
|
};
|
|
4388
4475
|
const menuLabel = labelText ? `Sort or filter ${labelText}` : "Sort or filter column";
|
|
4389
|
-
const menuContent = /* @__PURE__ */ (0,
|
|
4476
|
+
const menuContent = /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
4390
4477
|
PopoverContent,
|
|
4391
4478
|
{
|
|
4392
4479
|
align: "start",
|
|
@@ -4403,9 +4490,9 @@ function ColumnHeaderCell({
|
|
|
4403
4490
|
input.focus();
|
|
4404
4491
|
},
|
|
4405
4492
|
children: [
|
|
4406
|
-
sortable ? /* @__PURE__ */ (0,
|
|
4407
|
-
/* @__PURE__ */ (0,
|
|
4408
|
-
/* @__PURE__ */ (0,
|
|
4493
|
+
sortable ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
|
|
4494
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col gap-0.5 pb-2", children: [
|
|
4495
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
4409
4496
|
Button,
|
|
4410
4497
|
{
|
|
4411
4498
|
variant: isSorted && sortDirection === "asc" ? "secondary" : "ghost",
|
|
@@ -4413,12 +4500,12 @@ function ColumnHeaderCell({
|
|
|
4413
4500
|
className: "h-8 justify-start gap-2 px-2 text-xs font-normal",
|
|
4414
4501
|
onClick: onSortAsc,
|
|
4415
4502
|
children: [
|
|
4416
|
-
/* @__PURE__ */ (0,
|
|
4503
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ArrowUp, { className: "h-3.5 w-3.5" }),
|
|
4417
4504
|
"Sort ascending"
|
|
4418
4505
|
]
|
|
4419
4506
|
}
|
|
4420
4507
|
),
|
|
4421
|
-
/* @__PURE__ */ (0,
|
|
4508
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
4422
4509
|
Button,
|
|
4423
4510
|
{
|
|
4424
4511
|
variant: isSorted && sortDirection === "desc" ? "secondary" : "ghost",
|
|
@@ -4426,12 +4513,12 @@ function ColumnHeaderCell({
|
|
|
4426
4513
|
className: "h-8 justify-start gap-2 px-2 text-xs font-normal",
|
|
4427
4514
|
onClick: onSortDesc,
|
|
4428
4515
|
children: [
|
|
4429
|
-
/* @__PURE__ */ (0,
|
|
4516
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ArrowDown, { className: "h-3.5 w-3.5" }),
|
|
4430
4517
|
"Sort descending"
|
|
4431
4518
|
]
|
|
4432
4519
|
}
|
|
4433
4520
|
),
|
|
4434
|
-
isSorted ? /* @__PURE__ */ (0,
|
|
4521
|
+
isSorted ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
4435
4522
|
Button,
|
|
4436
4523
|
{
|
|
4437
4524
|
variant: "ghost",
|
|
@@ -4439,15 +4526,15 @@ function ColumnHeaderCell({
|
|
|
4439
4526
|
className: "h-8 justify-start gap-2 px-2 text-xs font-normal text-muted-foreground",
|
|
4440
4527
|
onClick: onClearSort,
|
|
4441
4528
|
children: [
|
|
4442
|
-
/* @__PURE__ */ (0,
|
|
4529
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ListX, { className: "h-3.5 w-3.5" }),
|
|
4443
4530
|
"Clear sort"
|
|
4444
4531
|
]
|
|
4445
4532
|
}
|
|
4446
4533
|
) : null
|
|
4447
4534
|
] }),
|
|
4448
|
-
filterKind ? /* @__PURE__ */ (0,
|
|
4535
|
+
filterKind ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "mb-2 h-px bg-border" }) : null
|
|
4449
4536
|
] }) : null,
|
|
4450
|
-
filterKind ? /* @__PURE__ */ (0,
|
|
4537
|
+
filterKind ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4451
4538
|
FilterBody,
|
|
4452
4539
|
{
|
|
4453
4540
|
kind: filterKind,
|
|
@@ -4462,10 +4549,10 @@ function ColumnHeaderCell({
|
|
|
4462
4549
|
allowNullModes
|
|
4463
4550
|
}
|
|
4464
4551
|
) : null,
|
|
4465
|
-
filterKind && visibleFilter && allowNegation ? /* @__PURE__ */ (0,
|
|
4466
|
-
/* @__PURE__ */ (0,
|
|
4467
|
-
/* @__PURE__ */ (0,
|
|
4468
|
-
/* @__PURE__ */ (0,
|
|
4552
|
+
filterKind && visibleFilter && allowNegation ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "mt-2 border-t border-border pt-2", children: [
|
|
4553
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "mb-1 text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: "Match mode" }),
|
|
4554
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "grid grid-cols-2 gap-1 rounded-md border p-0.5", children: [
|
|
4555
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4469
4556
|
"button",
|
|
4470
4557
|
{
|
|
4471
4558
|
type: "button",
|
|
@@ -4478,7 +4565,7 @@ function ColumnHeaderCell({
|
|
|
4478
4565
|
children: "Include"
|
|
4479
4566
|
}
|
|
4480
4567
|
),
|
|
4481
|
-
/* @__PURE__ */ (0,
|
|
4568
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4482
4569
|
"button",
|
|
4483
4570
|
{
|
|
4484
4571
|
type: "button",
|
|
@@ -4493,11 +4580,11 @@ function ColumnHeaderCell({
|
|
|
4493
4580
|
)
|
|
4494
4581
|
] })
|
|
4495
4582
|
] }) : null,
|
|
4496
|
-
filterKind && deferredFilter ? /* @__PURE__ */ (0,
|
|
4497
|
-
filterFooterHint ? /* @__PURE__ */ (0,
|
|
4498
|
-
/* @__PURE__ */ (0,
|
|
4499
|
-
filterShowCancel ? /* @__PURE__ */ (0,
|
|
4500
|
-
/* @__PURE__ */ (0,
|
|
4583
|
+
filterKind && deferredFilter ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "mt-2 border-t border-border pt-2", children: [
|
|
4584
|
+
filterFooterHint ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "mb-2 text-xs text-muted-foreground", children: filterFooterHint }) : null,
|
|
4585
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex justify-end gap-2", children: [
|
|
4586
|
+
filterShowCancel ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button, { type: "button", variant: "ghost", size: "sm", onClick: cancelFilter, children: "Cancel" }) : null,
|
|
4587
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button, { type: "button", size: "sm", onClick: applyFilter, children: filterApplyLabel ?? "Apply" })
|
|
4501
4588
|
] })
|
|
4502
4589
|
] }) : null
|
|
4503
4590
|
]
|
|
@@ -4506,9 +4593,9 @@ function ColumnHeaderCell({
|
|
|
4506
4593
|
if (compact) {
|
|
4507
4594
|
if (!sortable && !filterKind) {
|
|
4508
4595
|
if (!reorderEnabled) {
|
|
4509
|
-
return /* @__PURE__ */ (0,
|
|
4596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: cn("flex items-center justify-center", className), children: label });
|
|
4510
4597
|
}
|
|
4511
|
-
return /* @__PURE__ */ (0,
|
|
4598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: cn("flex items-center justify-center", className), children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4512
4599
|
"button",
|
|
4513
4600
|
{
|
|
4514
4601
|
type: "button",
|
|
@@ -4521,7 +4608,7 @@ function ColumnHeaderCell({
|
|
|
4521
4608
|
}
|
|
4522
4609
|
) });
|
|
4523
4610
|
}
|
|
4524
|
-
return /* @__PURE__ */ (0,
|
|
4611
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4525
4612
|
"div",
|
|
4526
4613
|
{
|
|
4527
4614
|
className: cn(
|
|
@@ -4529,8 +4616,8 @@ function ColumnHeaderCell({
|
|
|
4529
4616
|
align === "right" ? "justify-end" : "justify-center",
|
|
4530
4617
|
className
|
|
4531
4618
|
),
|
|
4532
|
-
children: /* @__PURE__ */ (0,
|
|
4533
|
-
/* @__PURE__ */ (0,
|
|
4619
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Popover, { open: filterOpen, onOpenChange: setFilterOpen, children: [
|
|
4620
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
4534
4621
|
"button",
|
|
4535
4622
|
{
|
|
4536
4623
|
type: "button",
|
|
@@ -4547,8 +4634,8 @@ function ColumnHeaderCell({
|
|
|
4547
4634
|
),
|
|
4548
4635
|
children: [
|
|
4549
4636
|
label,
|
|
4550
|
-
isSorted ? sortDirection === "asc" ? /* @__PURE__ */ (0,
|
|
4551
|
-
filterActive ? /* @__PURE__ */ (0,
|
|
4637
|
+
isSorted ? sortDirection === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ArrowUp, { className: "absolute -top-1 right-0 h-2 w-2 text-primary" }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ArrowDown, { className: "absolute -top-1 right-0 h-2 w-2 text-primary" }) : null,
|
|
4638
|
+
filterActive ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4552
4639
|
"span",
|
|
4553
4640
|
{
|
|
4554
4641
|
"aria-hidden": true,
|
|
@@ -4563,7 +4650,7 @@ function ColumnHeaderCell({
|
|
|
4563
4650
|
}
|
|
4564
4651
|
);
|
|
4565
4652
|
}
|
|
4566
|
-
return /* @__PURE__ */ (0,
|
|
4653
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
4567
4654
|
"div",
|
|
4568
4655
|
{
|
|
4569
4656
|
className: cn(
|
|
@@ -4573,7 +4660,7 @@ function ColumnHeaderCell({
|
|
|
4573
4660
|
className
|
|
4574
4661
|
),
|
|
4575
4662
|
children: [
|
|
4576
|
-
sortable ? /* @__PURE__ */ (0,
|
|
4663
|
+
sortable ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
4577
4664
|
"button",
|
|
4578
4665
|
{
|
|
4579
4666
|
type: "button",
|
|
@@ -4585,11 +4672,11 @@ function ColumnHeaderCell({
|
|
|
4585
4672
|
isSorted ? "text-foreground" : "text-muted-foreground hover:text-foreground"
|
|
4586
4673
|
),
|
|
4587
4674
|
children: [
|
|
4588
|
-
/* @__PURE__ */ (0,
|
|
4589
|
-
isSorted ? sortDirection === "asc" ? /* @__PURE__ */ (0,
|
|
4675
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "truncate", children: label }),
|
|
4676
|
+
isSorted ? sortDirection === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ArrowUp, { className: "h-3 w-3 shrink-0 text-primary" }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ArrowDown, { className: "h-3 w-3 shrink-0 text-primary" }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ArrowUpDown, { className: "h-3 w-3 shrink-0 opacity-40" })
|
|
4590
4677
|
]
|
|
4591
4678
|
}
|
|
4592
|
-
) : reorderEnabled ? /* @__PURE__ */ (0,
|
|
4679
|
+
) : reorderEnabled ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4593
4680
|
"button",
|
|
4594
4681
|
{
|
|
4595
4682
|
type: "button",
|
|
@@ -4600,10 +4687,10 @@ function ColumnHeaderCell({
|
|
|
4600
4687
|
),
|
|
4601
4688
|
children: label
|
|
4602
4689
|
}
|
|
4603
|
-
) : /* @__PURE__ */ (0,
|
|
4604
|
-
filterKind ? /* @__PURE__ */ (0,
|
|
4605
|
-
/* @__PURE__ */ (0,
|
|
4606
|
-
/* @__PURE__ */ (0,
|
|
4690
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "truncate text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: label }),
|
|
4691
|
+
filterKind ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "inline-flex items-center", children: [
|
|
4692
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Popover, { open: filterOpen, onOpenChange: setFilterOpen, children: [
|
|
4693
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4607
4694
|
"button",
|
|
4608
4695
|
{
|
|
4609
4696
|
type: "button",
|
|
@@ -4614,7 +4701,7 @@ function ColumnHeaderCell({
|
|
|
4614
4701
|
"rounded p-0.5 transition-colors",
|
|
4615
4702
|
filterActive ? "text-primary hover:text-primary/80" : "text-muted-foreground/40 hover:text-muted-foreground"
|
|
4616
4703
|
),
|
|
4617
|
-
children: /* @__PURE__ */ (0,
|
|
4704
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4618
4705
|
ListFilter,
|
|
4619
4706
|
{
|
|
4620
4707
|
className: cn("h-3 w-3", filterActive && "fill-primary/20")
|
|
@@ -4624,7 +4711,7 @@ function ColumnHeaderCell({
|
|
|
4624
4711
|
) }),
|
|
4625
4712
|
menuContent
|
|
4626
4713
|
] }),
|
|
4627
|
-
filterActive ? /* @__PURE__ */ (0,
|
|
4714
|
+
filterActive ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4628
4715
|
"button",
|
|
4629
4716
|
{
|
|
4630
4717
|
type: "button",
|
|
@@ -4635,7 +4722,7 @@ function ColumnHeaderCell({
|
|
|
4635
4722
|
onFilterChange(void 0);
|
|
4636
4723
|
},
|
|
4637
4724
|
className: "rounded p-0.5 text-primary hover:bg-muted hover:text-foreground",
|
|
4638
|
-
children: /* @__PURE__ */ (0,
|
|
4725
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(X, { className: "h-3 w-3" })
|
|
4639
4726
|
}
|
|
4640
4727
|
) : null
|
|
4641
4728
|
] }) : null
|
|
@@ -4661,14 +4748,14 @@ function FilterBody({
|
|
|
4661
4748
|
onChange({ kind: "text", value: "", mode: next });
|
|
4662
4749
|
}
|
|
4663
4750
|
};
|
|
4664
|
-
return /* @__PURE__ */ (0,
|
|
4665
|
-
/* @__PURE__ */ (0,
|
|
4666
|
-
/* @__PURE__ */ (0,
|
|
4751
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "space-y-1.5 px-1", children: [
|
|
4752
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: "Filter" }),
|
|
4753
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex gap-1", children: [
|
|
4667
4754
|
["contains", "Contains"],
|
|
4668
4755
|
["empty", "(empty)"],
|
|
4669
4756
|
["not_empty", "(not empty)"],
|
|
4670
4757
|
...allowNullModes ? [["null", "(null)"], ["not_null", "(not null)"]] : []
|
|
4671
|
-
].map(([m, label]) => /* @__PURE__ */ (0,
|
|
4758
|
+
].map(([m, label]) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4672
4759
|
"button",
|
|
4673
4760
|
{
|
|
4674
4761
|
type: "button",
|
|
@@ -4682,8 +4769,8 @@ function FilterBody({
|
|
|
4682
4769
|
},
|
|
4683
4770
|
m
|
|
4684
4771
|
)) }),
|
|
4685
|
-
mode === "contains" && /* @__PURE__ */ (0,
|
|
4686
|
-
/* @__PURE__ */ (0,
|
|
4772
|
+
mode === "contains" && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "relative", children: [
|
|
4773
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4687
4774
|
Input,
|
|
4688
4775
|
{
|
|
4689
4776
|
"data-matrx-filter-autofocus": true,
|
|
@@ -4696,14 +4783,14 @@ function FilterBody({
|
|
|
4696
4783
|
style: { fontSize: "16px" }
|
|
4697
4784
|
}
|
|
4698
4785
|
),
|
|
4699
|
-
text ? /* @__PURE__ */ (0,
|
|
4786
|
+
text ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4700
4787
|
"button",
|
|
4701
4788
|
{
|
|
4702
4789
|
type: "button",
|
|
4703
4790
|
"aria-label": "Clear filter text",
|
|
4704
4791
|
className: "absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground hover:text-foreground",
|
|
4705
4792
|
onClick: () => onChange(void 0),
|
|
4706
|
-
children: /* @__PURE__ */ (0,
|
|
4793
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(X, { className: "h-3.5 w-3.5" })
|
|
4707
4794
|
}
|
|
4708
4795
|
) : null
|
|
4709
4796
|
] })
|
|
@@ -4711,7 +4798,7 @@ function FilterBody({
|
|
|
4711
4798
|
}
|
|
4712
4799
|
if (kind === "select") {
|
|
4713
4800
|
const selected = value?.kind === "select" ? value.values ?? (value.value && value.value !== "__all__" ? [value.value] : []) : [];
|
|
4714
|
-
return /* @__PURE__ */ (0,
|
|
4801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4715
4802
|
SearchableSelectFilter,
|
|
4716
4803
|
{
|
|
4717
4804
|
selected,
|
|
@@ -4723,9 +4810,9 @@ function FilterBody({
|
|
|
4723
4810
|
}
|
|
4724
4811
|
if (kind === "boolean") {
|
|
4725
4812
|
const current = value?.kind === "boolean" ? value.value : "__all__";
|
|
4726
|
-
return /* @__PURE__ */ (0,
|
|
4727
|
-
/* @__PURE__ */ (0,
|
|
4728
|
-
/* @__PURE__ */ (0,
|
|
4813
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "space-y-1.5 px-1", children: [
|
|
4814
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: "Filter" }),
|
|
4815
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
4729
4816
|
Select,
|
|
4730
4817
|
{
|
|
4731
4818
|
value: current === "__all__" ? "__all__" : current ? "true" : "false",
|
|
@@ -4734,18 +4821,18 @@ function FilterBody({
|
|
|
4734
4821
|
else onChange({ kind: "boolean", value: v === "true" });
|
|
4735
4822
|
},
|
|
4736
4823
|
children: [
|
|
4737
|
-
/* @__PURE__ */ (0,
|
|
4738
|
-
/* @__PURE__ */ (0,
|
|
4739
|
-
/* @__PURE__ */ (0,
|
|
4740
|
-
/* @__PURE__ */ (0,
|
|
4741
|
-
/* @__PURE__ */ (0,
|
|
4824
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SelectTrigger, { className: "h-8 text-xs", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SelectValue, {}) }),
|
|
4825
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(SelectContent, { children: [
|
|
4826
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SelectItem, { value: "__all__", children: "All" }),
|
|
4827
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SelectItem, { value: "true", children: "Yes" }),
|
|
4828
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SelectItem, { value: "false", children: "No" })
|
|
4742
4829
|
] })
|
|
4743
4830
|
]
|
|
4744
4831
|
}
|
|
4745
4832
|
)
|
|
4746
4833
|
] });
|
|
4747
4834
|
}
|
|
4748
|
-
return /* @__PURE__ */ (0,
|
|
4835
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(NumberFilterBody, { value, onChange });
|
|
4749
4836
|
}
|
|
4750
4837
|
function SearchableSelectFilter({
|
|
4751
4838
|
selected,
|
|
@@ -4773,13 +4860,13 @@ function SearchableSelectFilter({
|
|
|
4773
4860
|
next.length === 0 ? void 0 : { kind: "select", value: next[0] ?? "", values: next }
|
|
4774
4861
|
);
|
|
4775
4862
|
};
|
|
4776
|
-
return /* @__PURE__ */ (0,
|
|
4777
|
-
/* @__PURE__ */ (0,
|
|
4778
|
-
/* @__PURE__ */ (0,
|
|
4863
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "space-y-1 px-0", children: [
|
|
4864
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center justify-between px-1 pb-1", children: [
|
|
4865
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("p", { className: "text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: [
|
|
4779
4866
|
"Filter",
|
|
4780
4867
|
selected.length > 1 ? ` (any of ${selected.length})` : ""
|
|
4781
4868
|
] }),
|
|
4782
|
-
selected.length > 0 ? /* @__PURE__ */ (0,
|
|
4869
|
+
selected.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4783
4870
|
"button",
|
|
4784
4871
|
{
|
|
4785
4872
|
type: "button",
|
|
@@ -4789,8 +4876,8 @@ function SearchableSelectFilter({
|
|
|
4789
4876
|
}
|
|
4790
4877
|
) : null
|
|
4791
4878
|
] }),
|
|
4792
|
-
/* @__PURE__ */ (0,
|
|
4793
|
-
/* @__PURE__ */ (0,
|
|
4879
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Command, { className: "rounded-md border border-border", shouldFilter: false, children: [
|
|
4880
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4794
4881
|
CommandInput,
|
|
4795
4882
|
{
|
|
4796
4883
|
"data-matrx-filter-autofocus": true,
|
|
@@ -4800,10 +4887,10 @@ function SearchableSelectFilter({
|
|
|
4800
4887
|
className: "h-8 text-sm"
|
|
4801
4888
|
}
|
|
4802
4889
|
),
|
|
4803
|
-
/* @__PURE__ */ (0,
|
|
4804
|
-
/* @__PURE__ */ (0,
|
|
4805
|
-
/* @__PURE__ */ (0,
|
|
4806
|
-
/* @__PURE__ */ (0,
|
|
4890
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(CommandList, { className: "max-h-48", children: [
|
|
4891
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CommandEmpty, { className: "py-3 text-xs text-muted-foreground", children: "No matches" }),
|
|
4892
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(CommandGroup, { children: [
|
|
4893
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4807
4894
|
CommandItem,
|
|
4808
4895
|
{
|
|
4809
4896
|
value: "__all__",
|
|
@@ -4814,7 +4901,7 @@ function SearchableSelectFilter({
|
|
|
4814
4901
|
),
|
|
4815
4902
|
filtered.map((o) => {
|
|
4816
4903
|
const active = selected.includes(o.value);
|
|
4817
|
-
return /* @__PURE__ */ (0,
|
|
4904
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
4818
4905
|
CommandItem,
|
|
4819
4906
|
{
|
|
4820
4907
|
value: o.value,
|
|
@@ -4824,7 +4911,7 @@ function SearchableSelectFilter({
|
|
|
4824
4911
|
active && "bg-accent text-accent-foreground"
|
|
4825
4912
|
),
|
|
4826
4913
|
children: [
|
|
4827
|
-
/* @__PURE__ */ (0,
|
|
4914
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4828
4915
|
"span",
|
|
4829
4916
|
{
|
|
4830
4917
|
className: cn(
|
|
@@ -4832,7 +4919,7 @@ function SearchableSelectFilter({
|
|
|
4832
4919
|
single ? "rounded-full" : "rounded-sm",
|
|
4833
4920
|
active ? "border-primary bg-primary text-primary-foreground" : "border-muted-foreground/40"
|
|
4834
4921
|
),
|
|
4835
|
-
children: active && /* @__PURE__ */ (0,
|
|
4922
|
+
children: active && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Check, { className: "h-2.5 w-2.5" })
|
|
4836
4923
|
}
|
|
4837
4924
|
),
|
|
4838
4925
|
o.label
|
|
@@ -4863,10 +4950,10 @@ function NumberFilterBody({
|
|
|
4863
4950
|
}
|
|
4864
4951
|
onChange({ kind: "number", min: nextMin, max: nextMax });
|
|
4865
4952
|
};
|
|
4866
|
-
return /* @__PURE__ */ (0,
|
|
4867
|
-
/* @__PURE__ */ (0,
|
|
4868
|
-
/* @__PURE__ */ (0,
|
|
4869
|
-
(min !== void 0 || max !== void 0) && /* @__PURE__ */ (0,
|
|
4953
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "space-y-1.5 px-1", children: [
|
|
4954
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
4955
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: "Range" }),
|
|
4956
|
+
(min !== void 0 || max !== void 0) && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4870
4957
|
"button",
|
|
4871
4958
|
{
|
|
4872
4959
|
type: "button",
|
|
@@ -4880,8 +4967,8 @@ function NumberFilterBody({
|
|
|
4880
4967
|
}
|
|
4881
4968
|
)
|
|
4882
4969
|
] }),
|
|
4883
|
-
/* @__PURE__ */ (0,
|
|
4884
|
-
/* @__PURE__ */ (0,
|
|
4970
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center gap-1.5", children: [
|
|
4971
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4885
4972
|
Input,
|
|
4886
4973
|
{
|
|
4887
4974
|
"data-matrx-filter-autofocus": true,
|
|
@@ -4896,8 +4983,8 @@ function NumberFilterBody({
|
|
|
4896
4983
|
style: { fontSize: "16px" }
|
|
4897
4984
|
}
|
|
4898
4985
|
),
|
|
4899
|
-
/* @__PURE__ */ (0,
|
|
4900
|
-
/* @__PURE__ */ (0,
|
|
4986
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-xs text-muted-foreground", children: "\u2013" }),
|
|
4987
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4901
4988
|
Input,
|
|
4902
4989
|
{
|
|
4903
4990
|
value: maxText,
|
|
@@ -4924,7 +5011,7 @@ function parseOptionalNumber(raw) {
|
|
|
4924
5011
|
var import_react8 = require("react");
|
|
4925
5012
|
var import_core2 = require("@dnd-kit/core");
|
|
4926
5013
|
init_filter_engine();
|
|
4927
|
-
var
|
|
5014
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
4928
5015
|
function ColumnManager({
|
|
4929
5016
|
open,
|
|
4930
5017
|
onOpenChange,
|
|
@@ -4998,18 +5085,18 @@ function ColumnManager({
|
|
|
4998
5085
|
if (target) moveTo(dragged, String(target));
|
|
4999
5086
|
}
|
|
5000
5087
|
});
|
|
5001
|
-
return /* @__PURE__ */ (0,
|
|
5002
|
-
/* @__PURE__ */ (0,
|
|
5003
|
-
/* @__PURE__ */ (0,
|
|
5004
|
-
/* @__PURE__ */ (0,
|
|
5088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Dialog, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(DialogContent, { className: "max-w-md", children: [
|
|
5089
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(DialogHeader, { children: [
|
|
5090
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(DialogTitle, { children: "Columns" }),
|
|
5091
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(DialogDescription, { children: "Choose the columns to show and set their order." })
|
|
5005
5092
|
] }),
|
|
5006
|
-
/* @__PURE__ */ (0,
|
|
5093
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "max-h-[55dvh] divide-y overflow-y-auto rounded-md border", children: draftOrder.map((id, index) => {
|
|
5007
5094
|
const column = byId.get(id);
|
|
5008
5095
|
if (!column) return null;
|
|
5009
5096
|
const label = typeof column.header === "string" ? column.header : id;
|
|
5010
5097
|
const hideable = column.hideable !== false;
|
|
5011
5098
|
const visible = !draftHidden.has(id);
|
|
5012
|
-
return /* @__PURE__ */ (0,
|
|
5099
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
5013
5100
|
ColumnManagerDropTarget,
|
|
5014
5101
|
{
|
|
5015
5102
|
id,
|
|
@@ -5019,8 +5106,8 @@ function ColumnManager({
|
|
|
5019
5106
|
dropTarget === id && draggedColumnId !== id && "border-t-2 border-primary"
|
|
5020
5107
|
),
|
|
5021
5108
|
children: [
|
|
5022
|
-
/* @__PURE__ */ (0,
|
|
5023
|
-
/* @__PURE__ */ (0,
|
|
5109
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ColumnManagerDragHandle, { id, label }),
|
|
5110
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5024
5111
|
Checkbox,
|
|
5025
5112
|
{
|
|
5026
5113
|
checked: visible,
|
|
@@ -5037,8 +5124,8 @@ function ColumnManager({
|
|
|
5037
5124
|
}
|
|
5038
5125
|
}
|
|
5039
5126
|
),
|
|
5040
|
-
/* @__PURE__ */ (0,
|
|
5041
|
-
/* @__PURE__ */ (0,
|
|
5127
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "min-w-0 flex-1 truncate text-sm", children: label }),
|
|
5128
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5042
5129
|
Button,
|
|
5043
5130
|
{
|
|
5044
5131
|
type: "button",
|
|
@@ -5048,10 +5135,10 @@ function ColumnManager({
|
|
|
5048
5135
|
"aria-label": `Move ${label} earlier`,
|
|
5049
5136
|
disabled: index === 0,
|
|
5050
5137
|
onClick: () => move(id, -1),
|
|
5051
|
-
children: /* @__PURE__ */ (0,
|
|
5138
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ArrowUp, { className: "h-4 w-4" })
|
|
5052
5139
|
}
|
|
5053
5140
|
),
|
|
5054
|
-
/* @__PURE__ */ (0,
|
|
5141
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5055
5142
|
Button,
|
|
5056
5143
|
{
|
|
5057
5144
|
type: "button",
|
|
@@ -5061,7 +5148,7 @@ function ColumnManager({
|
|
|
5061
5148
|
"aria-label": `Move ${label} later`,
|
|
5062
5149
|
disabled: index === draftOrder.length - 1,
|
|
5063
5150
|
onClick: () => move(id, 1),
|
|
5064
|
-
children: /* @__PURE__ */ (0,
|
|
5151
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ArrowDown, { className: "h-4 w-4" })
|
|
5065
5152
|
}
|
|
5066
5153
|
)
|
|
5067
5154
|
]
|
|
@@ -5069,9 +5156,9 @@ function ColumnManager({
|
|
|
5069
5156
|
id
|
|
5070
5157
|
);
|
|
5071
5158
|
}) }),
|
|
5072
|
-
/* @__PURE__ */ (0,
|
|
5073
|
-
/* @__PURE__ */ (0,
|
|
5074
|
-
/* @__PURE__ */ (0,
|
|
5159
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(DialogFooter, { children: [
|
|
5160
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Button, { type: "button", variant: "outline", onClick: () => onOpenChange(false), children: "Cancel" }),
|
|
5161
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5075
5162
|
Button,
|
|
5076
5163
|
{
|
|
5077
5164
|
type: "button",
|
|
@@ -5094,14 +5181,14 @@ function ColumnManagerDropTarget({
|
|
|
5094
5181
|
id: `matrx-column-manager:${id}`,
|
|
5095
5182
|
data: { matrxDragKind: "column-manager", columnId: id }
|
|
5096
5183
|
});
|
|
5097
|
-
return /* @__PURE__ */ (0,
|
|
5184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { ref: setNodeRef, "data-matrx-column-manager-drop-target": id, className, children });
|
|
5098
5185
|
}
|
|
5099
5186
|
function ColumnManagerDragHandle({ id, label }) {
|
|
5100
5187
|
const { attributes, listeners, setNodeRef } = (0, import_core2.useDraggable)({
|
|
5101
5188
|
id: `matrx-column-manager:${id}`,
|
|
5102
5189
|
data: { matrxDragKind: "column-manager", columnId: id }
|
|
5103
5190
|
});
|
|
5104
|
-
return /* @__PURE__ */ (0,
|
|
5191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5105
5192
|
"button",
|
|
5106
5193
|
{
|
|
5107
5194
|
ref: setNodeRef,
|
|
@@ -5111,42 +5198,14 @@ function ColumnManagerDragHandle({ id, label }) {
|
|
|
5111
5198
|
title: `Drag to reorder ${label}`,
|
|
5112
5199
|
...attributes,
|
|
5113
5200
|
...listeners,
|
|
5114
|
-
children: /* @__PURE__ */ (0,
|
|
5201
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(GripVertical, { className: "h-4 w-4" })
|
|
5115
5202
|
}
|
|
5116
5203
|
);
|
|
5117
5204
|
}
|
|
5118
5205
|
|
|
5119
5206
|
// src/data-table/MatrxUuidCell.tsx
|
|
5120
5207
|
var import_react9 = require("react");
|
|
5121
|
-
|
|
5122
|
-
// src/tooltip.tsx
|
|
5123
|
-
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
|
|
5124
|
-
var React16 = __toESM(require("react"), 1);
|
|
5125
|
-
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
5126
|
-
var TooltipProvider = TooltipPrimitive.Provider;
|
|
5127
|
-
var Tooltip = TooltipPrimitive.Root;
|
|
5128
|
-
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
5129
|
-
var TooltipContent = React16.forwardRef(({ className, sideOffset = 4, container, animated = true, ...props }, ref) => {
|
|
5130
|
-
const resolved = usePortalContainer(container);
|
|
5131
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TooltipPrimitive.Portal, { container: resolved ?? null, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
5132
|
-
TooltipPrimitive.Content,
|
|
5133
|
-
{
|
|
5134
|
-
ref,
|
|
5135
|
-
"data-slot": "tooltip-content",
|
|
5136
|
-
sideOffset,
|
|
5137
|
-
className: cn(
|
|
5138
|
-
"z-[10001] overflow-hidden rounded-md border border-border bg-popover px-3 py-1.5 text-xs text-popover-foreground shadow-md",
|
|
5139
|
-
animated && MOTION_POPPER,
|
|
5140
|
-
className
|
|
5141
|
-
),
|
|
5142
|
-
...props
|
|
5143
|
-
}
|
|
5144
|
-
) });
|
|
5145
|
-
});
|
|
5146
|
-
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
5147
|
-
|
|
5148
|
-
// src/data-table/MatrxUuidCell.tsx
|
|
5149
|
-
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
5208
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
5150
5209
|
var SHORT_LEN = 8;
|
|
5151
5210
|
function shortUuid(id, len = SHORT_LEN) {
|
|
5152
5211
|
return id.slice(0, len);
|
|
@@ -5196,7 +5255,7 @@ function MatrxUuidCell({
|
|
|
5196
5255
|
[]
|
|
5197
5256
|
);
|
|
5198
5257
|
if (!value) {
|
|
5199
|
-
return /* @__PURE__ */ (0,
|
|
5258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-muted-foreground/40", children: "\u2014" });
|
|
5200
5259
|
}
|
|
5201
5260
|
const doors = token ? resolveEntityDoors?.(token, value, href) ?? null : null;
|
|
5202
5261
|
const resolvedHref = doors?.href ?? href ?? null;
|
|
@@ -5239,13 +5298,13 @@ function MatrxUuidCell({
|
|
|
5239
5298
|
};
|
|
5240
5299
|
const idNode = (() => {
|
|
5241
5300
|
if (forbidden) {
|
|
5242
|
-
return /* @__PURE__ */ (0,
|
|
5243
|
-
/* @__PURE__ */ (0,
|
|
5244
|
-
/* @__PURE__ */ (0,
|
|
5301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { className: "inline-flex min-w-0 items-center gap-1 font-mono text-xs text-muted-foreground/70 tabular-nums", children: [
|
|
5302
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "min-w-0 truncate", children: display }),
|
|
5303
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ShieldOff, { className: "h-3 w-3 shrink-0 opacity-60", "aria-hidden": true })
|
|
5245
5304
|
] });
|
|
5246
5305
|
}
|
|
5247
5306
|
if (onOpen) {
|
|
5248
|
-
return /* @__PURE__ */ (0,
|
|
5307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
5249
5308
|
"button",
|
|
5250
5309
|
{
|
|
5251
5310
|
type: "button",
|
|
@@ -5254,14 +5313,14 @@ function MatrxUuidCell({
|
|
|
5254
5313
|
disabled: opening,
|
|
5255
5314
|
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",
|
|
5256
5315
|
children: [
|
|
5257
|
-
/* @__PURE__ */ (0,
|
|
5258
|
-
/* @__PURE__ */ (0,
|
|
5316
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "min-w-0 truncate tabular-nums", children: display }),
|
|
5317
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(PanelRight, { className: "h-3 w-3 shrink-0 opacity-50" })
|
|
5259
5318
|
]
|
|
5260
5319
|
}
|
|
5261
5320
|
);
|
|
5262
5321
|
}
|
|
5263
5322
|
if (resolvedHref) {
|
|
5264
|
-
return /* @__PURE__ */ (0,
|
|
5323
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
5265
5324
|
"a",
|
|
5266
5325
|
{
|
|
5267
5326
|
href: resolvedHref,
|
|
@@ -5271,15 +5330,15 @@ function MatrxUuidCell({
|
|
|
5271
5330
|
onClick: stop,
|
|
5272
5331
|
className: "inline-flex min-w-0 items-center gap-1 font-mono text-xs text-sky-600 hover:underline dark:text-sky-400",
|
|
5273
5332
|
children: [
|
|
5274
|
-
/* @__PURE__ */ (0,
|
|
5275
|
-
/* @__PURE__ */ (0,
|
|
5333
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "min-w-0 truncate tabular-nums", children: display }),
|
|
5334
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ExternalLink, { className: "h-3 w-3 shrink-0 opacity-50" })
|
|
5276
5335
|
]
|
|
5277
5336
|
}
|
|
5278
5337
|
);
|
|
5279
5338
|
}
|
|
5280
|
-
return /* @__PURE__ */ (0,
|
|
5339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "min-w-0 truncate font-mono text-xs text-muted-foreground tabular-nums select-all", children: display });
|
|
5281
5340
|
})();
|
|
5282
|
-
return /* @__PURE__ */ (0,
|
|
5341
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
5283
5342
|
"span",
|
|
5284
5343
|
{
|
|
5285
5344
|
"data-matrx-cell-control": true,
|
|
@@ -5289,11 +5348,11 @@ function MatrxUuidCell({
|
|
|
5289
5348
|
),
|
|
5290
5349
|
onClick: stop,
|
|
5291
5350
|
children: [
|
|
5292
|
-
/* @__PURE__ */ (0,
|
|
5293
|
-
/* @__PURE__ */ (0,
|
|
5294
|
-
/* @__PURE__ */ (0,
|
|
5351
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Tooltip, { children: [
|
|
5352
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "inline-flex min-w-0 max-w-full items-center", children: idNode }) }),
|
|
5353
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TooltipContent, { side: "top", className: "max-w-sm break-all font-mono", children: forbidden ? `No access \xB7 ${tip}` : tip })
|
|
5295
5354
|
] }) }),
|
|
5296
|
-
/* @__PURE__ */ (0,
|
|
5355
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5297
5356
|
"button",
|
|
5298
5357
|
{
|
|
5299
5358
|
type: "button",
|
|
@@ -5304,10 +5363,10 @@ function MatrxUuidCell({
|
|
|
5304
5363
|
"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground focus:outline-none",
|
|
5305
5364
|
copied && "text-primary"
|
|
5306
5365
|
),
|
|
5307
|
-
children: copied ? /* @__PURE__ */ (0,
|
|
5366
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Check, { className: "h-3 w-3" }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Copy, { className: "h-3 w-3" })
|
|
5308
5367
|
}
|
|
5309
5368
|
),
|
|
5310
|
-
canPeek ? /* @__PURE__ */ (0,
|
|
5369
|
+
canPeek ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5311
5370
|
"button",
|
|
5312
5371
|
{
|
|
5313
5372
|
type: "button",
|
|
@@ -5318,10 +5377,10 @@ function MatrxUuidCell({
|
|
|
5318
5377
|
"aria-label": `Quick look at ${label ?? "record"}`,
|
|
5319
5378
|
title: `Quick look at ${label ?? "record"}`,
|
|
5320
5379
|
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",
|
|
5321
|
-
children: /* @__PURE__ */ (0,
|
|
5380
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Lightbulb, { className: "h-3 w-3" })
|
|
5322
5381
|
}
|
|
5323
5382
|
) : null,
|
|
5324
|
-
onOpen && resolvedHref && !forbidden ? /* @__PURE__ */ (0,
|
|
5383
|
+
onOpen && resolvedHref && !forbidden ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5325
5384
|
"a",
|
|
5326
5385
|
{
|
|
5327
5386
|
href: resolvedHref,
|
|
@@ -5331,12 +5390,12 @@ function MatrxUuidCell({
|
|
|
5331
5390
|
"aria-label": `Open ${label ?? "record"} in a new tab`,
|
|
5332
5391
|
title: `Open ${label ?? "record"} in a new tab`,
|
|
5333
5392
|
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",
|
|
5334
|
-
children: /* @__PURE__ */ (0,
|
|
5393
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ExternalLink, { className: "h-3 w-3" })
|
|
5335
5394
|
}
|
|
5336
5395
|
) : null,
|
|
5337
5396
|
trailing,
|
|
5338
5397
|
notice,
|
|
5339
|
-
canPeek && peekOpen && ResourcePeek ? /* @__PURE__ */ (0,
|
|
5398
|
+
canPeek && peekOpen && ResourcePeek ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5340
5399
|
ResourcePeek,
|
|
5341
5400
|
{
|
|
5342
5401
|
kind: doors?.peekKind ?? token ?? "record",
|
|
@@ -5359,7 +5418,7 @@ function tokenFromColumnName(name) {
|
|
|
5359
5418
|
}
|
|
5360
5419
|
|
|
5361
5420
|
// src/data-table/DataRowInspector.tsx
|
|
5362
|
-
var
|
|
5421
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
5363
5422
|
var noFieldToken = () => null;
|
|
5364
5423
|
function formatValue(value) {
|
|
5365
5424
|
if (value == null) return "\u2014";
|
|
@@ -5388,7 +5447,7 @@ function DataRowInspector({
|
|
|
5388
5447
|
tokenForField = noFieldToken
|
|
5389
5448
|
}) {
|
|
5390
5449
|
const entries = isPlainObject(row) ? Object.entries(row) : [["value", row]];
|
|
5391
|
-
const fieldButtons = (key, value) => fieldCopy ? /* @__PURE__ */ (0,
|
|
5450
|
+
const fieldButtons = (key, value) => fieldCopy ? /* @__PURE__ */ (0, import_jsx_runtime30.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_runtime30.jsx)(
|
|
5392
5451
|
CopyButtons,
|
|
5393
5452
|
{
|
|
5394
5453
|
size: "xs",
|
|
@@ -5403,21 +5462,21 @@ function DataRowInspector({
|
|
|
5403
5462
|
})
|
|
5404
5463
|
}
|
|
5405
5464
|
) }) : null;
|
|
5406
|
-
return /* @__PURE__ */ (0,
|
|
5465
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
5407
5466
|
"div",
|
|
5408
5467
|
{
|
|
5409
5468
|
className: cn("flex h-full min-h-0 flex-col overflow-hidden", className),
|
|
5410
5469
|
children: [
|
|
5411
|
-
title ? /* @__PURE__ */ (0,
|
|
5412
|
-
/* @__PURE__ */ (0,
|
|
5470
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "shrink-0 border-b border-border px-3 py-2 text-sm font-medium", children: title }) : null,
|
|
5471
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "min-h-0 flex-1 overflow-auto p-3", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("dl", { className: "space-y-2", children: entries.map(([key, value]) => {
|
|
5413
5472
|
if (isUuidValue(value)) {
|
|
5414
|
-
return /* @__PURE__ */ (0,
|
|
5473
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
5415
5474
|
"div",
|
|
5416
5475
|
{
|
|
5417
5476
|
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",
|
|
5418
5477
|
children: [
|
|
5419
|
-
/* @__PURE__ */ (0,
|
|
5420
|
-
/* @__PURE__ */ (0,
|
|
5478
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("dt", { className: "truncate text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: key }),
|
|
5479
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("dd", { className: "min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5421
5480
|
MatrxUuidCell,
|
|
5422
5481
|
{
|
|
5423
5482
|
value,
|
|
@@ -5432,13 +5491,13 @@ function DataRowInspector({
|
|
|
5432
5491
|
}
|
|
5433
5492
|
const formatted = formatValue(value);
|
|
5434
5493
|
const multiline = formatted.includes("\n") || formatted.length > 80;
|
|
5435
|
-
return /* @__PURE__ */ (0,
|
|
5494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
5436
5495
|
"div",
|
|
5437
5496
|
{
|
|
5438
5497
|
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",
|
|
5439
5498
|
children: [
|
|
5440
|
-
/* @__PURE__ */ (0,
|
|
5441
|
-
/* @__PURE__ */ (0,
|
|
5499
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("dt", { className: "truncate text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: key }),
|
|
5500
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5442
5501
|
"dd",
|
|
5443
5502
|
{
|
|
5444
5503
|
className: cn(
|
|
@@ -5461,7 +5520,7 @@ function DataRowInspector({
|
|
|
5461
5520
|
|
|
5462
5521
|
// src/data-table/DataRowWindow.tsx
|
|
5463
5522
|
var import_react10 = require("react");
|
|
5464
|
-
var
|
|
5523
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
5465
5524
|
function DataRowWindow({
|
|
5466
5525
|
isOpen,
|
|
5467
5526
|
onClose,
|
|
@@ -5487,9 +5546,9 @@ function DataRowWindow({
|
|
|
5487
5546
|
setTab(defaultTab ?? (hasEdit ? "edit" : "view"));
|
|
5488
5547
|
}, [isOpen, windowId, hasEdit, defaultTab]);
|
|
5489
5548
|
if (!isOpen) return null;
|
|
5490
|
-
const viewBody = viewContent ?? /* @__PURE__ */ (0,
|
|
5491
|
-
const body = children ?? /* @__PURE__ */ (0,
|
|
5492
|
-
return /* @__PURE__ */ (0,
|
|
5549
|
+
const viewBody = viewContent ?? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DataRowInspector, { row });
|
|
5550
|
+
const body = children ?? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex h-full min-h-0 flex-1 flex-col overflow-hidden", children: hasTabs ? tab === "edit" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "min-h-0 flex-1 overflow-y-auto", children: editContent }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "min-h-0 flex-1 overflow-y-auto", children: viewBody }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "min-h-0 flex-1 overflow-y-auto", children: viewBody }) });
|
|
5551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
5493
5552
|
WindowPanel,
|
|
5494
5553
|
{
|
|
5495
5554
|
id: windowId,
|
|
@@ -5503,26 +5562,26 @@ function DataRowWindow({
|
|
|
5503
5562
|
bodyClassName: "flex min-h-0 flex-1 flex-col overflow-hidden p-0",
|
|
5504
5563
|
sidebarDefaultSize: 140,
|
|
5505
5564
|
sidebarMinSize: 110,
|
|
5506
|
-
sidebar: hasTabs ? /* @__PURE__ */ (0,
|
|
5565
|
+
sidebar: hasTabs ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
5507
5566
|
"nav",
|
|
5508
5567
|
{
|
|
5509
5568
|
"aria-label": "Row window tabs",
|
|
5510
5569
|
className: "flex h-full flex-col gap-0.5 overflow-y-auto p-1.5",
|
|
5511
5570
|
children: [
|
|
5512
|
-
/* @__PURE__ */ (0,
|
|
5571
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
5513
5572
|
TabButton,
|
|
5514
5573
|
{
|
|
5515
5574
|
active: tab === "view",
|
|
5516
|
-
icon: /* @__PURE__ */ (0,
|
|
5575
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Eye, { className: "h-4 w-4 shrink-0" }),
|
|
5517
5576
|
label: "View",
|
|
5518
5577
|
onClick: () => setTab("view")
|
|
5519
5578
|
}
|
|
5520
5579
|
),
|
|
5521
|
-
/* @__PURE__ */ (0,
|
|
5580
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
5522
5581
|
TabButton,
|
|
5523
5582
|
{
|
|
5524
5583
|
active: tab === "edit",
|
|
5525
|
-
icon: /* @__PURE__ */ (0,
|
|
5584
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Pencil, { className: "h-4 w-4 shrink-0" }),
|
|
5526
5585
|
label: "Edit",
|
|
5527
5586
|
onClick: () => setTab("edit")
|
|
5528
5587
|
}
|
|
@@ -5540,7 +5599,7 @@ function TabButton({
|
|
|
5540
5599
|
label,
|
|
5541
5600
|
onClick
|
|
5542
5601
|
}) {
|
|
5543
|
-
return /* @__PURE__ */ (0,
|
|
5602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
5544
5603
|
"button",
|
|
5545
5604
|
{
|
|
5546
5605
|
type: "button",
|
|
@@ -5553,14 +5612,14 @@ function TabButton({
|
|
|
5553
5612
|
),
|
|
5554
5613
|
children: [
|
|
5555
5614
|
icon,
|
|
5556
|
-
/* @__PURE__ */ (0,
|
|
5615
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "min-w-0 flex-1 truncate", children: label })
|
|
5557
5616
|
]
|
|
5558
5617
|
}
|
|
5559
5618
|
);
|
|
5560
5619
|
}
|
|
5561
5620
|
|
|
5562
5621
|
// src/data-table/DirtySavePill.tsx
|
|
5563
|
-
var
|
|
5622
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
5564
5623
|
function DirtySavePill({
|
|
5565
5624
|
changeCount,
|
|
5566
5625
|
saving,
|
|
@@ -5569,20 +5628,20 @@ function DirtySavePill({
|
|
|
5569
5628
|
className
|
|
5570
5629
|
}) {
|
|
5571
5630
|
if (changeCount <= 0) return null;
|
|
5572
|
-
return /* @__PURE__ */ (0,
|
|
5631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5573
5632
|
"div",
|
|
5574
5633
|
{
|
|
5575
5634
|
className: cn(
|
|
5576
5635
|
"pointer-events-none fixed inset-x-0 bottom-6 z-50 flex justify-center pb-safe",
|
|
5577
5636
|
className
|
|
5578
5637
|
),
|
|
5579
|
-
children: /* @__PURE__ */ (0,
|
|
5580
|
-
/* @__PURE__ */ (0,
|
|
5638
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.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: [
|
|
5639
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "px-1 text-xs font-medium text-muted-foreground", children: [
|
|
5581
5640
|
changeCount,
|
|
5582
5641
|
" unsaved change",
|
|
5583
5642
|
changeCount === 1 ? "" : "s"
|
|
5584
5643
|
] }),
|
|
5585
|
-
/* @__PURE__ */ (0,
|
|
5644
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
5586
5645
|
Button,
|
|
5587
5646
|
{
|
|
5588
5647
|
type: "button",
|
|
@@ -5592,12 +5651,12 @@ function DirtySavePill({
|
|
|
5592
5651
|
disabled: saving,
|
|
5593
5652
|
onClick: onCancel,
|
|
5594
5653
|
children: [
|
|
5595
|
-
/* @__PURE__ */ (0,
|
|
5654
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(X, { className: "h-3.5 w-3.5" }),
|
|
5596
5655
|
"Cancel"
|
|
5597
5656
|
]
|
|
5598
5657
|
}
|
|
5599
5658
|
),
|
|
5600
|
-
/* @__PURE__ */ (0,
|
|
5659
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
5601
5660
|
Button,
|
|
5602
5661
|
{
|
|
5603
5662
|
type: "button",
|
|
@@ -5606,7 +5665,7 @@ function DirtySavePill({
|
|
|
5606
5665
|
disabled: saving,
|
|
5607
5666
|
onClick: onSave,
|
|
5608
5667
|
children: [
|
|
5609
|
-
saving ? /* @__PURE__ */ (0,
|
|
5668
|
+
saving ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Loader2, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Save, { className: "h-3.5 w-3.5" }),
|
|
5610
5669
|
"Save"
|
|
5611
5670
|
]
|
|
5612
5671
|
}
|
|
@@ -5619,7 +5678,7 @@ function DirtySavePill({
|
|
|
5619
5678
|
// src/data-table/EditableTableCell.tsx
|
|
5620
5679
|
var import_react11 = require("react");
|
|
5621
5680
|
init_filter_engine();
|
|
5622
|
-
var
|
|
5681
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
5623
5682
|
function CellEditShell({
|
|
5624
5683
|
href,
|
|
5625
5684
|
display,
|
|
@@ -5628,8 +5687,8 @@ function CellEditShell({
|
|
|
5628
5687
|
editButton
|
|
5629
5688
|
}) {
|
|
5630
5689
|
const { Link: HostLink } = useMatrxDataTableHost();
|
|
5631
|
-
const Link = HostLink ?? ((props) => /* @__PURE__ */ (0,
|
|
5632
|
-
return /* @__PURE__ */ (0,
|
|
5690
|
+
const Link = HostLink ?? ((props) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("a", { ...props }));
|
|
5691
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
5633
5692
|
"span",
|
|
5634
5693
|
{
|
|
5635
5694
|
className: cn(
|
|
@@ -5641,7 +5700,7 @@ function CellEditShell({
|
|
|
5641
5700
|
className
|
|
5642
5701
|
),
|
|
5643
5702
|
children: [
|
|
5644
|
-
href ? /* @__PURE__ */ (0,
|
|
5703
|
+
href ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
5645
5704
|
Link,
|
|
5646
5705
|
{
|
|
5647
5706
|
href,
|
|
@@ -5649,7 +5708,7 @@ function CellEditShell({
|
|
|
5649
5708
|
className: "min-w-0 flex-1 overflow-hidden truncate rounded outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
5650
5709
|
children: display
|
|
5651
5710
|
}
|
|
5652
|
-
) : /* @__PURE__ */ (0,
|
|
5711
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "block min-w-0 flex-1 overflow-hidden", children: display }),
|
|
5653
5712
|
editButton
|
|
5654
5713
|
]
|
|
5655
5714
|
}
|
|
@@ -5670,7 +5729,7 @@ function EditableTableCell({
|
|
|
5670
5729
|
const [open, setOpen] = (0, import_react11.useState)(false);
|
|
5671
5730
|
const usePencil = Boolean(href) || editTrigger === "pencil";
|
|
5672
5731
|
if (editType === "string") {
|
|
5673
|
-
return /* @__PURE__ */ (0,
|
|
5732
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
5674
5733
|
InlineStringEditor,
|
|
5675
5734
|
{
|
|
5676
5735
|
value: stringifyCellValue(value),
|
|
@@ -5683,15 +5742,15 @@ function EditableTableCell({
|
|
|
5683
5742
|
}
|
|
5684
5743
|
);
|
|
5685
5744
|
}
|
|
5686
|
-
return /* @__PURE__ */ (0,
|
|
5687
|
-
usePencil ? /* @__PURE__ */ (0,
|
|
5745
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Popover, { open, onOpenChange: setOpen, children: [
|
|
5746
|
+
usePencil ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
5688
5747
|
CellEditShell,
|
|
5689
5748
|
{
|
|
5690
5749
|
...href === void 0 ? {} : { href },
|
|
5691
5750
|
display,
|
|
5692
5751
|
...dirty === void 0 ? {} : { dirty },
|
|
5693
5752
|
...className === void 0 ? {} : { className },
|
|
5694
|
-
editButton: /* @__PURE__ */ (0,
|
|
5753
|
+
editButton: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
5695
5754
|
"button",
|
|
5696
5755
|
{
|
|
5697
5756
|
type: "button",
|
|
@@ -5699,11 +5758,11 @@ function EditableTableCell({
|
|
|
5699
5758
|
title: "Edit",
|
|
5700
5759
|
onClick: (e) => e.stopPropagation(),
|
|
5701
5760
|
className: CELL_PENCIL_CLASS,
|
|
5702
|
-
children: /* @__PURE__ */ (0,
|
|
5761
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Pencil, { className: "h-3 w-3" })
|
|
5703
5762
|
}
|
|
5704
5763
|
) })
|
|
5705
5764
|
}
|
|
5706
|
-
) : /* @__PURE__ */ (0,
|
|
5765
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
5707
5766
|
"button",
|
|
5708
5767
|
{
|
|
5709
5768
|
type: "button",
|
|
@@ -5715,18 +5774,18 @@ function EditableTableCell({
|
|
|
5715
5774
|
),
|
|
5716
5775
|
title: "Edit",
|
|
5717
5776
|
children: [
|
|
5718
|
-
/* @__PURE__ */ (0,
|
|
5719
|
-
editType === "select" ? /* @__PURE__ */ (0,
|
|
5777
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "min-w-0 flex-1 overflow-hidden", children: display }),
|
|
5778
|
+
editType === "select" ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ChevronDown, { className: "h-3 w-3 shrink-0 text-muted-foreground/70 transition-colors group-hover/cell-select:text-foreground" }) : null
|
|
5720
5779
|
]
|
|
5721
5780
|
}
|
|
5722
5781
|
) }),
|
|
5723
|
-
/* @__PURE__ */ (0,
|
|
5782
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
5724
5783
|
PopoverContent,
|
|
5725
5784
|
{
|
|
5726
5785
|
align: "start",
|
|
5727
5786
|
className: "w-56 p-2",
|
|
5728
5787
|
onClick: (e) => e.stopPropagation(),
|
|
5729
|
-
children: /* @__PURE__ */ (0,
|
|
5788
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
5730
5789
|
TypedEditor,
|
|
5731
5790
|
{
|
|
5732
5791
|
editType,
|
|
@@ -5756,14 +5815,14 @@ function InlineStringEditor({
|
|
|
5756
5815
|
const [draft, setDraft] = (0, import_react11.useState)(value);
|
|
5757
5816
|
if (!editing) {
|
|
5758
5817
|
if (usePencil) {
|
|
5759
|
-
return /* @__PURE__ */ (0,
|
|
5818
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
5760
5819
|
CellEditShell,
|
|
5761
5820
|
{
|
|
5762
5821
|
...href === void 0 ? {} : { href },
|
|
5763
5822
|
display,
|
|
5764
5823
|
...dirty === void 0 ? {} : { dirty },
|
|
5765
5824
|
...className === void 0 ? {} : { className },
|
|
5766
|
-
editButton: /* @__PURE__ */ (0,
|
|
5825
|
+
editButton: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
5767
5826
|
"button",
|
|
5768
5827
|
{
|
|
5769
5828
|
type: "button",
|
|
@@ -5775,13 +5834,13 @@ function InlineStringEditor({
|
|
|
5775
5834
|
setEditing(true);
|
|
5776
5835
|
},
|
|
5777
5836
|
className: CELL_PENCIL_CLASS,
|
|
5778
|
-
children: /* @__PURE__ */ (0,
|
|
5837
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Pencil, { className: "h-3 w-3" })
|
|
5779
5838
|
}
|
|
5780
5839
|
)
|
|
5781
5840
|
}
|
|
5782
5841
|
);
|
|
5783
5842
|
}
|
|
5784
|
-
return /* @__PURE__ */ (0,
|
|
5843
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
5785
5844
|
"button",
|
|
5786
5845
|
{
|
|
5787
5846
|
type: "button",
|
|
@@ -5800,7 +5859,7 @@ function InlineStringEditor({
|
|
|
5800
5859
|
}
|
|
5801
5860
|
);
|
|
5802
5861
|
}
|
|
5803
|
-
return /* @__PURE__ */ (0,
|
|
5862
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
5804
5863
|
Input,
|
|
5805
5864
|
{
|
|
5806
5865
|
autoFocus: true,
|
|
@@ -5836,9 +5895,9 @@ function TypedEditor({
|
|
|
5836
5895
|
}) {
|
|
5837
5896
|
if (editType === "boolean") {
|
|
5838
5897
|
const checked = Boolean(value);
|
|
5839
|
-
return /* @__PURE__ */ (0,
|
|
5840
|
-
/* @__PURE__ */ (0,
|
|
5841
|
-
/* @__PURE__ */ (0,
|
|
5898
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
5899
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-xs font-medium", children: "Value" }),
|
|
5900
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
5842
5901
|
Checkbox,
|
|
5843
5902
|
{
|
|
5844
5903
|
checked,
|
|
@@ -5848,7 +5907,7 @@ function TypedEditor({
|
|
|
5848
5907
|
] });
|
|
5849
5908
|
}
|
|
5850
5909
|
if (editType === "number") {
|
|
5851
|
-
return /* @__PURE__ */ (0,
|
|
5910
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
5852
5911
|
NumberEditor,
|
|
5853
5912
|
{
|
|
5854
5913
|
value: typeof value === "number" ? value : Number(value) || 0,
|
|
@@ -5858,7 +5917,7 @@ function TypedEditor({
|
|
|
5858
5917
|
);
|
|
5859
5918
|
}
|
|
5860
5919
|
if (editType === "tags") {
|
|
5861
|
-
return /* @__PURE__ */ (0,
|
|
5920
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
5862
5921
|
TagsEditor,
|
|
5863
5922
|
{
|
|
5864
5923
|
value: Array.isArray(value) ? value.map(String) : [],
|
|
@@ -5869,19 +5928,19 @@ function TypedEditor({
|
|
|
5869
5928
|
);
|
|
5870
5929
|
}
|
|
5871
5930
|
if (editType === "select") {
|
|
5872
|
-
return /* @__PURE__ */ (0,
|
|
5931
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
5873
5932
|
Select,
|
|
5874
5933
|
{
|
|
5875
5934
|
value: stringifyCellValue(value),
|
|
5876
5935
|
onValueChange: (v) => onCommit(v),
|
|
5877
5936
|
children: [
|
|
5878
|
-
/* @__PURE__ */ (0,
|
|
5879
|
-
/* @__PURE__ */ (0,
|
|
5937
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(SelectTrigger, { className: "h-8 text-xs", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(SelectValue, {}) }),
|
|
5938
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(SelectContent, { children: editOptions.map((o) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(SelectItem, { value: o.value, children: o.label }, o.value)) })
|
|
5880
5939
|
]
|
|
5881
5940
|
}
|
|
5882
5941
|
);
|
|
5883
5942
|
}
|
|
5884
|
-
return /* @__PURE__ */ (0,
|
|
5943
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
5885
5944
|
Input,
|
|
5886
5945
|
{
|
|
5887
5946
|
type: "date",
|
|
@@ -5911,10 +5970,10 @@ function TagsEditor({
|
|
|
5911
5970
|
const matches = suggestions.filter(
|
|
5912
5971
|
(s) => !tags.includes(s.value) && s.value !== "__none__" && (!draft || s.label.toLowerCase().includes(draft.trim().toLowerCase()))
|
|
5913
5972
|
).slice(0, 6);
|
|
5914
|
-
return /* @__PURE__ */ (0,
|
|
5915
|
-
/* @__PURE__ */ (0,
|
|
5916
|
-
tags.length === 0 && /* @__PURE__ */ (0,
|
|
5917
|
-
tags.map((tag) => /* @__PURE__ */ (0,
|
|
5973
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "space-y-2", onClick: (e) => e.stopPropagation(), children: [
|
|
5974
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-wrap gap-1", children: [
|
|
5975
|
+
tags.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-xs text-muted-foreground", children: "No tags" }),
|
|
5976
|
+
tags.map((tag) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
5918
5977
|
"button",
|
|
5919
5978
|
{
|
|
5920
5979
|
type: "button",
|
|
@@ -5923,13 +5982,13 @@ function TagsEditor({
|
|
|
5923
5982
|
title: `Remove ${tag}`,
|
|
5924
5983
|
children: [
|
|
5925
5984
|
tag,
|
|
5926
|
-
/* @__PURE__ */ (0,
|
|
5985
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(X, { className: "h-2.5 w-2.5" })
|
|
5927
5986
|
]
|
|
5928
5987
|
},
|
|
5929
5988
|
tag
|
|
5930
5989
|
))
|
|
5931
5990
|
] }),
|
|
5932
|
-
/* @__PURE__ */ (0,
|
|
5991
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
5933
5992
|
Input,
|
|
5934
5993
|
{
|
|
5935
5994
|
autoFocus: true,
|
|
@@ -5950,7 +6009,7 @@ function TagsEditor({
|
|
|
5950
6009
|
className: "h-8 text-xs"
|
|
5951
6010
|
}
|
|
5952
6011
|
),
|
|
5953
|
-
matches.length > 0 && /* @__PURE__ */ (0,
|
|
6012
|
+
matches.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex flex-wrap gap-1", children: matches.map((s) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
5954
6013
|
"button",
|
|
5955
6014
|
{
|
|
5956
6015
|
type: "button",
|
|
@@ -5963,8 +6022,8 @@ function TagsEditor({
|
|
|
5963
6022
|
},
|
|
5964
6023
|
s.value
|
|
5965
6024
|
)) }),
|
|
5966
|
-
/* @__PURE__ */ (0,
|
|
5967
|
-
/* @__PURE__ */ (0,
|
|
6025
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex justify-end gap-1 pt-1", children: [
|
|
6026
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
5968
6027
|
Button,
|
|
5969
6028
|
{
|
|
5970
6029
|
size: "sm",
|
|
@@ -5972,17 +6031,17 @@ function TagsEditor({
|
|
|
5972
6031
|
className: "h-7 px-2",
|
|
5973
6032
|
"aria-label": "Cancel edit",
|
|
5974
6033
|
onClick: onCancel,
|
|
5975
|
-
children: /* @__PURE__ */ (0,
|
|
6034
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(X, { className: "h-3.5 w-3.5" })
|
|
5976
6035
|
}
|
|
5977
6036
|
),
|
|
5978
|
-
/* @__PURE__ */ (0,
|
|
6037
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
5979
6038
|
Button,
|
|
5980
6039
|
{
|
|
5981
6040
|
size: "sm",
|
|
5982
6041
|
className: "h-7 px-2",
|
|
5983
6042
|
"aria-label": "Apply tags",
|
|
5984
6043
|
onClick: () => onCommit(tags),
|
|
5985
|
-
children: /* @__PURE__ */ (0,
|
|
6044
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Check, { className: "h-3.5 w-3.5" })
|
|
5986
6045
|
}
|
|
5987
6046
|
)
|
|
5988
6047
|
] })
|
|
@@ -5994,8 +6053,8 @@ function NumberEditor({
|
|
|
5994
6053
|
onCancel
|
|
5995
6054
|
}) {
|
|
5996
6055
|
const [draft, setDraft] = (0, import_react11.useState)(String(value));
|
|
5997
|
-
return /* @__PURE__ */ (0,
|
|
5998
|
-
/* @__PURE__ */ (0,
|
|
6056
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
6057
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
5999
6058
|
Input,
|
|
6000
6059
|
{
|
|
6001
6060
|
autoFocus: true,
|
|
@@ -6012,8 +6071,8 @@ function NumberEditor({
|
|
|
6012
6071
|
}
|
|
6013
6072
|
}
|
|
6014
6073
|
),
|
|
6015
|
-
/* @__PURE__ */ (0,
|
|
6016
|
-
/* @__PURE__ */ (0,
|
|
6074
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex justify-end gap-1", children: [
|
|
6075
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
6017
6076
|
Button,
|
|
6018
6077
|
{
|
|
6019
6078
|
type: "button",
|
|
@@ -6022,10 +6081,10 @@ function NumberEditor({
|
|
|
6022
6081
|
className: "h-7",
|
|
6023
6082
|
"aria-label": "Cancel edit",
|
|
6024
6083
|
onClick: onCancel,
|
|
6025
|
-
children: /* @__PURE__ */ (0,
|
|
6084
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(X, { className: "h-3.5 w-3.5" })
|
|
6026
6085
|
}
|
|
6027
6086
|
),
|
|
6028
|
-
/* @__PURE__ */ (0,
|
|
6087
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
6029
6088
|
Button,
|
|
6030
6089
|
{
|
|
6031
6090
|
type: "button",
|
|
@@ -6036,7 +6095,7 @@ function NumberEditor({
|
|
|
6036
6095
|
const n = Number(draft);
|
|
6037
6096
|
if (Number.isFinite(n)) onCommit(n);
|
|
6038
6097
|
},
|
|
6039
|
-
children: /* @__PURE__ */ (0,
|
|
6098
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Check, { className: "h-3.5 w-3.5" })
|
|
6040
6099
|
}
|
|
6041
6100
|
)
|
|
6042
6101
|
] })
|
|
@@ -6044,24 +6103,24 @@ function NumberEditor({
|
|
|
6044
6103
|
}
|
|
6045
6104
|
|
|
6046
6105
|
// src/data-table/ToolbarFacets.tsx
|
|
6047
|
-
var
|
|
6106
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
6048
6107
|
function ToolbarFacets({ facets }) {
|
|
6049
6108
|
if (facets.length === 0) return null;
|
|
6050
|
-
return /* @__PURE__ */ (0,
|
|
6109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "flex flex-wrap items-center gap-2", children: facets.map((facet) => {
|
|
6051
6110
|
if (facet.type === "custom") {
|
|
6052
|
-
return /* @__PURE__ */ (0,
|
|
6111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { children: facet.render() }, facet.id);
|
|
6053
6112
|
}
|
|
6054
6113
|
const defaultValue = facet.defaultValue ?? facet.options[0]?.value ?? "";
|
|
6055
6114
|
const isNonDefault = facet.value !== defaultValue;
|
|
6056
|
-
return /* @__PURE__ */ (0,
|
|
6115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
6057
6116
|
"div",
|
|
6058
6117
|
{
|
|
6059
6118
|
className: "flex flex-wrap items-center gap-1.5 max-sm:grid max-sm:w-full max-sm:grid-cols-3",
|
|
6060
6119
|
children: [
|
|
6061
|
-
facet.label ? /* @__PURE__ */ (0,
|
|
6120
|
+
facet.label ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "mr-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: facet.label }) : null,
|
|
6062
6121
|
facet.options.map((opt) => {
|
|
6063
6122
|
const active = facet.value === opt.value;
|
|
6064
|
-
return /* @__PURE__ */ (0,
|
|
6123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
6065
6124
|
Button,
|
|
6066
6125
|
{
|
|
6067
6126
|
type: "button",
|
|
@@ -6075,7 +6134,7 @@ function ToolbarFacets({ facets }) {
|
|
|
6075
6134
|
children: [
|
|
6076
6135
|
opt.icon,
|
|
6077
6136
|
opt.label,
|
|
6078
|
-
active && isNonDefault ? /* @__PURE__ */ (0,
|
|
6137
|
+
active && isNonDefault ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
6079
6138
|
"span",
|
|
6080
6139
|
{
|
|
6081
6140
|
role: "button",
|
|
@@ -6094,7 +6153,7 @@ function ToolbarFacets({ facets }) {
|
|
|
6094
6153
|
facet.onChange(defaultValue);
|
|
6095
6154
|
}
|
|
6096
6155
|
},
|
|
6097
|
-
children: /* @__PURE__ */ (0,
|
|
6156
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(X, { className: "h-3 w-3" })
|
|
6098
6157
|
}
|
|
6099
6158
|
) : null
|
|
6100
6159
|
]
|
|
@@ -6120,7 +6179,7 @@ function resetToolbarFacets(facets) {
|
|
|
6120
6179
|
// src/data-table/LayeredFilterBuilder.tsx
|
|
6121
6180
|
var import_react12 = require("react");
|
|
6122
6181
|
init_layered_filters();
|
|
6123
|
-
var
|
|
6182
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
6124
6183
|
function moveRule(rules, from, to) {
|
|
6125
6184
|
if (from === to || to < 0 || to >= rules.length) return [...rules];
|
|
6126
6185
|
const next = [...rules];
|
|
@@ -6166,8 +6225,8 @@ function LayeredFilterBuilder({
|
|
|
6166
6225
|
const reorder = (from, to) => {
|
|
6167
6226
|
onChange(moveRule(rules, from, to));
|
|
6168
6227
|
};
|
|
6169
|
-
return /* @__PURE__ */ (0,
|
|
6170
|
-
/* @__PURE__ */ (0,
|
|
6228
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex min-w-0 flex-wrap items-center gap-1", children: [
|
|
6229
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
6171
6230
|
Popover,
|
|
6172
6231
|
{
|
|
6173
6232
|
open,
|
|
@@ -6179,7 +6238,7 @@ function LayeredFilterBuilder({
|
|
|
6179
6238
|
}
|
|
6180
6239
|
},
|
|
6181
6240
|
children: [
|
|
6182
|
-
/* @__PURE__ */ (0,
|
|
6241
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
6183
6242
|
Button,
|
|
6184
6243
|
{
|
|
6185
6244
|
type: "button",
|
|
@@ -6188,25 +6247,25 @@ function LayeredFilterBuilder({
|
|
|
6188
6247
|
className: "h-8 gap-1.5 px-2 text-xs",
|
|
6189
6248
|
"aria-label": label,
|
|
6190
6249
|
children: [
|
|
6191
|
-
/* @__PURE__ */ (0,
|
|
6192
|
-
/* @__PURE__ */ (0,
|
|
6193
|
-
rules.length > 0 ? /* @__PURE__ */ (0,
|
|
6250
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SlidersHorizontal, { className: "h-3.5 w-3.5" }),
|
|
6251
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "hidden sm:inline", children: rules.length > 0 ? `${rules.length} layers` : "Advanced" }),
|
|
6252
|
+
rules.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "sm:hidden", children: rules.length }) : null
|
|
6194
6253
|
]
|
|
6195
6254
|
}
|
|
6196
6255
|
) }),
|
|
6197
|
-
/* @__PURE__ */ (0,
|
|
6256
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
6198
6257
|
PopoverContent,
|
|
6199
6258
|
{
|
|
6200
6259
|
align: "start",
|
|
6201
6260
|
sideOffset: 6,
|
|
6202
6261
|
className: "w-[min(46rem,calc(100vw-1rem))] p-0",
|
|
6203
6262
|
children: [
|
|
6204
|
-
/* @__PURE__ */ (0,
|
|
6205
|
-
/* @__PURE__ */ (0,
|
|
6206
|
-
/* @__PURE__ */ (0,
|
|
6207
|
-
/* @__PURE__ */ (0,
|
|
6263
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-start justify-between gap-3 border-b border-border px-3 py-2.5", children: [
|
|
6264
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { children: [
|
|
6265
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-sm font-semibold text-foreground", children: "Narrow these results" }),
|
|
6266
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.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." })
|
|
6208
6267
|
] }),
|
|
6209
|
-
rules.length > 0 ? /* @__PURE__ */ (0,
|
|
6268
|
+
rules.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6210
6269
|
Button,
|
|
6211
6270
|
{
|
|
6212
6271
|
type: "button",
|
|
@@ -6218,10 +6277,10 @@ function LayeredFilterBuilder({
|
|
|
6218
6277
|
}
|
|
6219
6278
|
) : null
|
|
6220
6279
|
] }),
|
|
6221
|
-
/* @__PURE__ */ (0,
|
|
6222
|
-
/* @__PURE__ */ (0,
|
|
6223
|
-
/* @__PURE__ */ (0,
|
|
6224
|
-
] }) : rules.map((rule, index) => /* @__PURE__ */ (0,
|
|
6280
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.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_runtime35.jsxs)("div", { className: "rounded-md border border-dashed border-border px-3 py-5 text-center", children: [
|
|
6281
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-sm font-medium text-foreground", children: "Start with one simple layer" }),
|
|
6282
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.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." })
|
|
6283
|
+
] }) : rules.map((rule, index) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6225
6284
|
LayeredRuleRow,
|
|
6226
6285
|
{
|
|
6227
6286
|
index,
|
|
@@ -6241,9 +6300,9 @@ function LayeredFilterBuilder({
|
|
|
6241
6300
|
},
|
|
6242
6301
|
rule.id
|
|
6243
6302
|
)) }),
|
|
6244
|
-
/* @__PURE__ */ (0,
|
|
6245
|
-
/* @__PURE__ */ (0,
|
|
6246
|
-
/* @__PURE__ */ (0,
|
|
6303
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center justify-between gap-2 border-t border-border px-3 py-2", children: [
|
|
6304
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-[11px] text-muted-foreground", children: "The regular search still works and is applied before these layers." }),
|
|
6305
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
6247
6306
|
Button,
|
|
6248
6307
|
{
|
|
6249
6308
|
type: "button",
|
|
@@ -6253,7 +6312,7 @@ function LayeredFilterBuilder({
|
|
|
6253
6312
|
disabled: rules.length >= maxRules,
|
|
6254
6313
|
onClick: addRule,
|
|
6255
6314
|
children: [
|
|
6256
|
-
/* @__PURE__ */ (0,
|
|
6315
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Plus, { className: "h-3.5 w-3.5" }),
|
|
6257
6316
|
" Add layer"
|
|
6258
6317
|
]
|
|
6259
6318
|
}
|
|
@@ -6265,7 +6324,7 @@ function LayeredFilterBuilder({
|
|
|
6265
6324
|
]
|
|
6266
6325
|
}
|
|
6267
6326
|
),
|
|
6268
|
-
rules.map((rule, index) => /* @__PURE__ */ (0,
|
|
6327
|
+
rules.map((rule, index) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
6269
6328
|
"span",
|
|
6270
6329
|
{
|
|
6271
6330
|
className: cn(
|
|
@@ -6273,7 +6332,7 @@ function LayeredFilterBuilder({
|
|
|
6273
6332
|
isCompleteLayeredFilterRule(rule) ? "border-border bg-muted/50 text-foreground" : "border-dashed border-warning/50 bg-warning/10 text-warning"
|
|
6274
6333
|
),
|
|
6275
6334
|
children: [
|
|
6276
|
-
/* @__PURE__ */ (0,
|
|
6335
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
6277
6336
|
"button",
|
|
6278
6337
|
{
|
|
6279
6338
|
type: "button",
|
|
@@ -6281,19 +6340,19 @@ function LayeredFilterBuilder({
|
|
|
6281
6340
|
onClick: () => setOpen(true),
|
|
6282
6341
|
title: isCompleteLayeredFilterRule(rule) ? layeredFilterRuleSummary(rule, fields) : `Layer ${index + 1} needs a value`,
|
|
6283
6342
|
children: [
|
|
6284
|
-
/* @__PURE__ */ (0,
|
|
6343
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "mr-1 text-muted-foreground", children: index + 1 }),
|
|
6285
6344
|
isCompleteLayeredFilterRule(rule) ? layeredFilterRuleSummary(rule, fields) : "Choose a value"
|
|
6286
6345
|
]
|
|
6287
6346
|
}
|
|
6288
6347
|
),
|
|
6289
|
-
/* @__PURE__ */ (0,
|
|
6348
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6290
6349
|
"button",
|
|
6291
6350
|
{
|
|
6292
6351
|
type: "button",
|
|
6293
6352
|
className: "shrink-0 rounded-full p-0.5 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
6294
6353
|
"aria-label": `Remove filter layer ${index + 1}`,
|
|
6295
6354
|
onClick: () => removeRule(index),
|
|
6296
|
-
children: /* @__PURE__ */ (0,
|
|
6355
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(X, { className: "h-3 w-3" })
|
|
6297
6356
|
}
|
|
6298
6357
|
)
|
|
6299
6358
|
]
|
|
@@ -6323,7 +6382,7 @@ function LayeredRuleRow({
|
|
|
6323
6382
|
event.preventDefault();
|
|
6324
6383
|
onKeyboardMove(event.key === "ArrowUp" ? -1 : 1);
|
|
6325
6384
|
};
|
|
6326
|
-
return /* @__PURE__ */ (0,
|
|
6385
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
6327
6386
|
"div",
|
|
6328
6387
|
{
|
|
6329
6388
|
className: cn(
|
|
@@ -6336,7 +6395,7 @@ function LayeredRuleRow({
|
|
|
6336
6395
|
onDrop(index);
|
|
6337
6396
|
},
|
|
6338
6397
|
children: [
|
|
6339
|
-
/* @__PURE__ */ (0,
|
|
6398
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6340
6399
|
"button",
|
|
6341
6400
|
{
|
|
6342
6401
|
type: "button",
|
|
@@ -6350,10 +6409,10 @@ function LayeredRuleRow({
|
|
|
6350
6409
|
},
|
|
6351
6410
|
onDragEnd,
|
|
6352
6411
|
onKeyDown: handleMoveKey,
|
|
6353
|
-
children: /* @__PURE__ */ (0,
|
|
6412
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(GripVertical, { className: "h-3.5 w-3.5" })
|
|
6354
6413
|
}
|
|
6355
6414
|
),
|
|
6356
|
-
/* @__PURE__ */ (0,
|
|
6415
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
6357
6416
|
Select,
|
|
6358
6417
|
{
|
|
6359
6418
|
value: field.id,
|
|
@@ -6371,16 +6430,16 @@ function LayeredRuleRow({
|
|
|
6371
6430
|
});
|
|
6372
6431
|
},
|
|
6373
6432
|
children: [
|
|
6374
|
-
/* @__PURE__ */ (0,
|
|
6433
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6375
6434
|
SelectTrigger,
|
|
6376
6435
|
{
|
|
6377
6436
|
size: "sm",
|
|
6378
6437
|
className: "h-7 w-full text-xs max-sm:col-span-1",
|
|
6379
6438
|
"aria-label": `Filter layer ${index + 1} field`,
|
|
6380
|
-
children: /* @__PURE__ */ (0,
|
|
6439
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SelectValue, {})
|
|
6381
6440
|
}
|
|
6382
6441
|
),
|
|
6383
|
-
/* @__PURE__ */ (0,
|
|
6442
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SelectContent, { children: fields.map((candidate) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6384
6443
|
SelectItem,
|
|
6385
6444
|
{
|
|
6386
6445
|
value: candidate.id,
|
|
@@ -6392,7 +6451,7 @@ function LayeredRuleRow({
|
|
|
6392
6451
|
]
|
|
6393
6452
|
}
|
|
6394
6453
|
),
|
|
6395
|
-
/* @__PURE__ */ (0,
|
|
6454
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
6396
6455
|
Select,
|
|
6397
6456
|
{
|
|
6398
6457
|
value: rule.operator,
|
|
@@ -6404,35 +6463,35 @@ function LayeredRuleRow({
|
|
|
6404
6463
|
});
|
|
6405
6464
|
},
|
|
6406
6465
|
children: [
|
|
6407
|
-
/* @__PURE__ */ (0,
|
|
6466
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6408
6467
|
SelectTrigger,
|
|
6409
6468
|
{
|
|
6410
6469
|
size: "sm",
|
|
6411
6470
|
className: "h-7 w-full text-xs max-sm:col-start-2",
|
|
6412
6471
|
"aria-label": `Filter layer ${index + 1} operator`,
|
|
6413
|
-
children: /* @__PURE__ */ (0,
|
|
6472
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SelectValue, {})
|
|
6414
6473
|
}
|
|
6415
6474
|
),
|
|
6416
|
-
/* @__PURE__ */ (0,
|
|
6475
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SelectContent, { children: operators.map((operator) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SelectItem, { value: operator, className: "text-xs", children: LAYERED_FILTER_OPERATOR_LABELS[operator] }, operator)) })
|
|
6417
6476
|
]
|
|
6418
6477
|
}
|
|
6419
6478
|
),
|
|
6420
|
-
/* @__PURE__ */ (0,
|
|
6479
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "min-w-0 max-sm:col-span-3 max-sm:col-start-1", children: !needsValue ? /* @__PURE__ */ (0, import_jsx_runtime35.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_runtime35.jsxs)(
|
|
6421
6480
|
Select,
|
|
6422
6481
|
{
|
|
6423
6482
|
value: rule.value,
|
|
6424
6483
|
onValueChange: (value) => onChange({ value }),
|
|
6425
6484
|
children: [
|
|
6426
|
-
/* @__PURE__ */ (0,
|
|
6485
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6427
6486
|
SelectTrigger,
|
|
6428
6487
|
{
|
|
6429
6488
|
size: "sm",
|
|
6430
6489
|
className: "h-7 w-full text-xs",
|
|
6431
6490
|
"aria-label": `Filter layer ${index + 1} value`,
|
|
6432
|
-
children: /* @__PURE__ */ (0,
|
|
6491
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SelectValue, {})
|
|
6433
6492
|
}
|
|
6434
6493
|
),
|
|
6435
|
-
/* @__PURE__ */ (0,
|
|
6494
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SelectContent, { children: field.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6436
6495
|
SelectItem,
|
|
6437
6496
|
{
|
|
6438
6497
|
value: option.value,
|
|
@@ -6443,8 +6502,8 @@ function LayeredRuleRow({
|
|
|
6443
6502
|
)) })
|
|
6444
6503
|
]
|
|
6445
6504
|
}
|
|
6446
|
-
) : /* @__PURE__ */ (0,
|
|
6447
|
-
/* @__PURE__ */ (0,
|
|
6505
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
6506
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6448
6507
|
Input,
|
|
6449
6508
|
{
|
|
6450
6509
|
value: rule.value,
|
|
@@ -6455,9 +6514,9 @@ function LayeredRuleRow({
|
|
|
6455
6514
|
"aria-label": `Filter layer ${index + 1} value`
|
|
6456
6515
|
}
|
|
6457
6516
|
),
|
|
6458
|
-
rule.operator === "between" ? /* @__PURE__ */ (0,
|
|
6459
|
-
/* @__PURE__ */ (0,
|
|
6460
|
-
/* @__PURE__ */ (0,
|
|
6517
|
+
rule.operator === "between" ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
6518
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-[11px] text-muted-foreground", children: "and" }),
|
|
6519
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6461
6520
|
Input,
|
|
6462
6521
|
{
|
|
6463
6522
|
value: rule.valueTo ?? "",
|
|
@@ -6470,7 +6529,7 @@ function LayeredRuleRow({
|
|
|
6470
6529
|
)
|
|
6471
6530
|
] }) : null
|
|
6472
6531
|
] }) }),
|
|
6473
|
-
/* @__PURE__ */ (0,
|
|
6532
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6474
6533
|
Button,
|
|
6475
6534
|
{
|
|
6476
6535
|
type: "button",
|
|
@@ -6479,7 +6538,7 @@ function LayeredRuleRow({
|
|
|
6479
6538
|
className: "h-7 w-7 p-0 text-muted-foreground hover:text-destructive max-sm:col-start-3 max-sm:row-start-1",
|
|
6480
6539
|
"aria-label": `Remove filter layer ${index + 1}`,
|
|
6481
6540
|
onClick: onRemove,
|
|
6482
|
-
children: /* @__PURE__ */ (0,
|
|
6541
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Trash2, { className: "h-3.5 w-3.5" })
|
|
6483
6542
|
}
|
|
6484
6543
|
)
|
|
6485
6544
|
]
|
|
@@ -6583,7 +6642,7 @@ function safeQueryPage(requestedPage, totalItems, pageSize) {
|
|
|
6583
6642
|
}
|
|
6584
6643
|
|
|
6585
6644
|
// src/data-table/MatrxDataTable.tsx
|
|
6586
|
-
var
|
|
6645
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
6587
6646
|
function hasSameRowReferences(previous, next) {
|
|
6588
6647
|
return previous.length === next.length && previous.every((row, index) => row === next[index]);
|
|
6589
6648
|
}
|
|
@@ -6611,7 +6670,7 @@ function TableRowCopyControl({
|
|
|
6611
6670
|
size,
|
|
6612
6671
|
sourceId
|
|
6613
6672
|
}) {
|
|
6614
|
-
return /* @__PURE__ */ (0,
|
|
6673
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6615
6674
|
CopyButtons,
|
|
6616
6675
|
{
|
|
6617
6676
|
size,
|
|
@@ -6633,8 +6692,8 @@ function isStringArray(value) {
|
|
|
6633
6692
|
}
|
|
6634
6693
|
var activeUrlTableIds = /* @__PURE__ */ new Set();
|
|
6635
6694
|
function MatrxDataTable(props) {
|
|
6636
|
-
if (!props.urlState) return /* @__PURE__ */ (0,
|
|
6637
|
-
return /* @__PURE__ */ (0,
|
|
6695
|
+
if (!props.urlState) return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(MatrxDataTableCore, { ...props });
|
|
6696
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(MatrxDataTableWithUrlState, { ...props, urlState: props.urlState });
|
|
6638
6697
|
}
|
|
6639
6698
|
function MatrxDataTableWithUrlState({
|
|
6640
6699
|
urlState,
|
|
@@ -6689,7 +6748,7 @@ function MatrxDataTableWithUrlState({
|
|
|
6689
6748
|
props.selection?.onSelectedIdsChange(ids);
|
|
6690
6749
|
}
|
|
6691
6750
|
} : props.selection;
|
|
6692
|
-
return /* @__PURE__ */ (0,
|
|
6751
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6693
6752
|
MatrxDataTableCore,
|
|
6694
6753
|
{
|
|
6695
6754
|
...props,
|
|
@@ -7636,7 +7695,7 @@ function MatrxDataTableCore({
|
|
|
7636
7695
|
}
|
|
7637
7696
|
} : facet
|
|
7638
7697
|
) : toolbar?.facets;
|
|
7639
|
-
return /* @__PURE__ */ (0,
|
|
7698
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
7640
7699
|
import_core3.DndContext,
|
|
7641
7700
|
{
|
|
7642
7701
|
sensors: hierarchySensors,
|
|
@@ -7709,7 +7768,7 @@ function MatrxDataTableCore({
|
|
|
7709
7768
|
commitColumnState(order, effectiveHiddenColumnIds);
|
|
7710
7769
|
},
|
|
7711
7770
|
children: [
|
|
7712
|
-
/* @__PURE__ */ (0,
|
|
7771
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
7713
7772
|
"div",
|
|
7714
7773
|
{
|
|
7715
7774
|
ref: rootRef,
|
|
@@ -7727,70 +7786,72 @@ function MatrxDataTableCore({
|
|
|
7727
7786
|
),
|
|
7728
7787
|
children: [
|
|
7729
7788
|
notice,
|
|
7730
|
-
!hideToolbar && (showSearch || toolbar?.anyOf || toolbar?.layeredFilters || toolbar?.facets && toolbar.facets.length > 0 || toolbar?.leading || toolbar?.actions || hasActiveFilters || showToolbarCopy || columns.length > 0) && /* @__PURE__ */ (0,
|
|
7731
|
-
|
|
7789
|
+
!hideToolbar && (toolbar?.title || showSearch || toolbar?.anyOf || toolbar?.layeredFilters || toolbar?.facets && toolbar.facets.length > 0 || toolbar?.leading || toolbar?.actions || hasActiveFilters || showToolbarCopy || columns.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
7790
|
+
TableTitleRow,
|
|
7732
7791
|
{
|
|
7733
|
-
|
|
7734
|
-
|
|
7735
|
-
|
|
7736
|
-
|
|
7737
|
-
"
|
|
7738
|
-
|
|
7739
|
-
"
|
|
7740
|
-
|
|
7741
|
-
|
|
7742
|
-
|
|
7743
|
-
),
|
|
7744
|
-
|
|
7745
|
-
/* @__PURE__ */ (0,
|
|
7746
|
-
|
|
7747
|
-
|
|
7748
|
-
|
|
7749
|
-
|
|
7750
|
-
|
|
7751
|
-
|
|
7752
|
-
|
|
7753
|
-
|
|
7754
|
-
|
|
7755
|
-
|
|
7756
|
-
|
|
7757
|
-
|
|
7758
|
-
|
|
7759
|
-
),
|
|
7760
|
-
searchValue ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
7792
|
+
...toolbar?.title === void 0 ? {} : { title: toolbar.title },
|
|
7793
|
+
search: showSearch ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
7794
|
+
"div",
|
|
7795
|
+
{
|
|
7796
|
+
"data-matrx-table-search": true,
|
|
7797
|
+
className: cn(
|
|
7798
|
+
"flex min-w-0 flex-1 sm:w-full sm:flex-none",
|
|
7799
|
+
toolbar?.searchMatch ? "sm:max-w-md" : "sm:max-w-xs"
|
|
7800
|
+
),
|
|
7801
|
+
children: [
|
|
7802
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "relative min-w-0 flex-1", children: [
|
|
7803
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Search, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
|
|
7804
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
7805
|
+
Input,
|
|
7806
|
+
{
|
|
7807
|
+
value: searchValue,
|
|
7808
|
+
onChange: (e) => setSearchValue(e.target.value),
|
|
7809
|
+
placeholder: toolbar?.searchPlaceholder ?? "Search\u2026",
|
|
7810
|
+
className: cn(
|
|
7811
|
+
"h-8 pl-7 pr-7 text-sm",
|
|
7812
|
+
toolbar?.searchMatch && "rounded-r-none"
|
|
7813
|
+
),
|
|
7814
|
+
style: { fontSize: "16px" }
|
|
7815
|
+
}
|
|
7816
|
+
),
|
|
7817
|
+
searchValue ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Tooltip, { children: [
|
|
7818
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
7761
7819
|
"button",
|
|
7762
7820
|
{
|
|
7763
7821
|
type: "button",
|
|
7764
7822
|
"aria-label": "Clear search",
|
|
7765
7823
|
className: "absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground hover:text-foreground",
|
|
7766
7824
|
onClick: () => setSearchValue(""),
|
|
7767
|
-
children: /* @__PURE__ */ (0,
|
|
7825
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(X, { className: "h-3.5 w-3.5" })
|
|
7768
7826
|
}
|
|
7769
|
-
)
|
|
7770
|
-
|
|
7771
|
-
|
|
7772
|
-
|
|
7773
|
-
|
|
7774
|
-
|
|
7775
|
-
|
|
7776
|
-
|
|
7777
|
-
|
|
7778
|
-
|
|
7779
|
-
|
|
7780
|
-
|
|
7781
|
-
|
|
7782
|
-
|
|
7783
|
-
|
|
7784
|
-
|
|
7785
|
-
|
|
7786
|
-
|
|
7787
|
-
|
|
7788
|
-
|
|
7789
|
-
|
|
7790
|
-
|
|
7791
|
-
|
|
7792
|
-
|
|
7793
|
-
|
|
7827
|
+
) }),
|
|
7828
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TooltipContent, { children: "Clear search" })
|
|
7829
|
+
] }) : null
|
|
7830
|
+
] }),
|
|
7831
|
+
toolbar?.searchMatch ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
7832
|
+
Button,
|
|
7833
|
+
{
|
|
7834
|
+
type: "button",
|
|
7835
|
+
variant: searchMatchMode === "whole_words" ? "secondary" : "outline",
|
|
7836
|
+
size: "sm",
|
|
7837
|
+
className: "h-8 shrink-0 gap-1 rounded-l-none border-l-0 px-2 text-xs",
|
|
7838
|
+
"aria-pressed": searchMatchMode === "whole_words",
|
|
7839
|
+
"aria-label": `Search match: ${searchMatchMode === "whole_words" ? "whole words" : "contains text"}`,
|
|
7840
|
+
title: searchMatchMode === "whole_words" ? "Whole words \u2014 click to match text anywhere" : "Contains text \u2014 click to require whole words",
|
|
7841
|
+
onClick: () => setSearchMatchMode(
|
|
7842
|
+
searchMatchMode === "whole_words" ? "contains" : "whole_words"
|
|
7843
|
+
),
|
|
7844
|
+
children: [
|
|
7845
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(WholeWord, { className: "h-3.5 w-3.5" }),
|
|
7846
|
+
searchMatchMode === "whole_words" ? "Whole words" : "Contains"
|
|
7847
|
+
]
|
|
7848
|
+
}
|
|
7849
|
+
) : null
|
|
7850
|
+
]
|
|
7851
|
+
}
|
|
7852
|
+
) : null,
|
|
7853
|
+
children: [
|
|
7854
|
+
toolbar?.layeredFilters ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
7794
7855
|
LayeredFilterBuilder,
|
|
7795
7856
|
{
|
|
7796
7857
|
fields: toolbar.layeredFilters.fields,
|
|
@@ -7800,9 +7861,9 @@ function MatrxDataTableCore({
|
|
|
7800
7861
|
label: toolbar.layeredFilters.label
|
|
7801
7862
|
}
|
|
7802
7863
|
) : null,
|
|
7803
|
-
toolbar?.anyOf ? /* @__PURE__ */ (0,
|
|
7804
|
-
/* @__PURE__ */ (0,
|
|
7805
|
-
/* @__PURE__ */ (0,
|
|
7864
|
+
toolbar?.anyOf ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "relative w-full max-w-xs", children: [
|
|
7865
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Search, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
|
|
7866
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
7806
7867
|
Input,
|
|
7807
7868
|
{
|
|
7808
7869
|
value: anyOfValue,
|
|
@@ -7812,57 +7873,64 @@ function MatrxDataTableCore({
|
|
|
7812
7873
|
style: { fontSize: "16px" }
|
|
7813
7874
|
}
|
|
7814
7875
|
),
|
|
7815
|
-
anyOfValue ? /* @__PURE__ */ (0,
|
|
7816
|
-
|
|
7817
|
-
|
|
7818
|
-
|
|
7819
|
-
|
|
7820
|
-
|
|
7821
|
-
|
|
7822
|
-
|
|
7823
|
-
|
|
7824
|
-
|
|
7876
|
+
anyOfValue ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Tooltip, { children: [
|
|
7877
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
7878
|
+
"button",
|
|
7879
|
+
{
|
|
7880
|
+
type: "button",
|
|
7881
|
+
"aria-label": "Clear match-any search",
|
|
7882
|
+
className: "absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground hover:text-foreground",
|
|
7883
|
+
onClick: () => setAnyOfValue(""),
|
|
7884
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(X, { className: "h-3.5 w-3.5" })
|
|
7885
|
+
}
|
|
7886
|
+
) }),
|
|
7887
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TooltipContent, { children: "Clear match-any search" })
|
|
7888
|
+
] }) : null
|
|
7825
7889
|
] }) : null,
|
|
7826
|
-
renderedFacets ? /* @__PURE__ */ (0,
|
|
7890
|
+
renderedFacets ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ToolbarFacets, { facets: renderedFacets }) : null,
|
|
7827
7891
|
toolbar?.leading,
|
|
7828
|
-
/* @__PURE__ */ (0,
|
|
7892
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
7829
7893
|
"div",
|
|
7830
7894
|
{
|
|
7831
7895
|
"data-matrx-table-actions": true,
|
|
7832
|
-
className: "ml-auto flex
|
|
7896
|
+
className: "ml-auto flex min-w-0 flex-wrap items-center gap-2",
|
|
7833
7897
|
children: [
|
|
7834
|
-
sourceTotal !== void 0 ? /* @__PURE__ */ (0,
|
|
7898
|
+
sourceTotal !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
7835
7899
|
"span",
|
|
7836
7900
|
{
|
|
7837
7901
|
"data-matrx-table-source-total": true,
|
|
7838
7902
|
className: "text-xs tabular-nums text-muted-foreground",
|
|
7839
7903
|
children: [
|
|
7840
7904
|
data.length.toLocaleString(),
|
|
7841
|
-
" loaded of
|
|
7905
|
+
" loaded of",
|
|
7906
|
+
" ",
|
|
7842
7907
|
Math.max(0, sourceTotal).toLocaleString(),
|
|
7843
|
-
" \xB7
|
|
7908
|
+
" \xB7",
|
|
7909
|
+
" ",
|
|
7844
7910
|
processed.length.toLocaleString(),
|
|
7845
7911
|
" matched"
|
|
7846
7912
|
]
|
|
7847
7913
|
}
|
|
7848
7914
|
) : null,
|
|
7849
|
-
hasActiveFilters ? /* @__PURE__ */ (0,
|
|
7850
|
-
|
|
7851
|
-
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
|
|
7857
|
-
|
|
7858
|
-
|
|
7859
|
-
|
|
7860
|
-
|
|
7861
|
-
|
|
7862
|
-
|
|
7863
|
-
|
|
7864
|
-
|
|
7865
|
-
|
|
7915
|
+
hasActiveFilters ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Tooltip, { children: [
|
|
7916
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
7917
|
+
Button,
|
|
7918
|
+
{
|
|
7919
|
+
type: "button",
|
|
7920
|
+
variant: "ghost",
|
|
7921
|
+
size: "sm",
|
|
7922
|
+
className: "h-7 gap-1 px-2 text-xs text-muted-foreground",
|
|
7923
|
+
onClick: clearAllFilters,
|
|
7924
|
+
"aria-label": "Clear all filters",
|
|
7925
|
+
children: [
|
|
7926
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Eraser, { className: "h-3.5 w-3.5" }),
|
|
7927
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "max-sm:sr-only", children: "Clear all" })
|
|
7928
|
+
]
|
|
7929
|
+
}
|
|
7930
|
+
) }),
|
|
7931
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TooltipContent, { children: "Clear search and filters; keep columns and sort" })
|
|
7932
|
+
] }) : null,
|
|
7933
|
+
showToolbarCopy && copy ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
7866
7934
|
CopyButtons,
|
|
7867
7935
|
{
|
|
7868
7936
|
size: "icon",
|
|
@@ -7893,10 +7961,7 @@ function MatrxDataTableCore({
|
|
|
7893
7961
|
id: "csv",
|
|
7894
7962
|
label: "CSV (current view)",
|
|
7895
7963
|
build: () => ({
|
|
7896
|
-
content: rowsToCsvFromColumns(
|
|
7897
|
-
processed,
|
|
7898
|
-
visibleColumns
|
|
7899
|
-
),
|
|
7964
|
+
content: rowsToCsvFromColumns(processed, visibleColumns),
|
|
7900
7965
|
extension: "csv",
|
|
7901
7966
|
mime: "text/csv"
|
|
7902
7967
|
})
|
|
@@ -7918,41 +7983,43 @@ function MatrxDataTableCore({
|
|
|
7918
7983
|
}
|
|
7919
7984
|
}
|
|
7920
7985
|
) : null,
|
|
7921
|
-
columns.length > 0 ? /* @__PURE__ */ (0,
|
|
7922
|
-
|
|
7923
|
-
|
|
7924
|
-
|
|
7925
|
-
|
|
7926
|
-
|
|
7927
|
-
|
|
7928
|
-
|
|
7929
|
-
|
|
7930
|
-
|
|
7931
|
-
|
|
7932
|
-
|
|
7933
|
-
|
|
7934
|
-
|
|
7935
|
-
|
|
7936
|
-
|
|
7937
|
-
|
|
7938
|
-
|
|
7939
|
-
|
|
7986
|
+
columns.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Tooltip, { children: [
|
|
7987
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
7988
|
+
Button,
|
|
7989
|
+
{
|
|
7990
|
+
type: "button",
|
|
7991
|
+
variant: "ghost",
|
|
7992
|
+
size: "icon",
|
|
7993
|
+
"aria-label": "Columns",
|
|
7994
|
+
className: "h-8 w-8",
|
|
7995
|
+
onClick: () => setColumnManagerOpen(true),
|
|
7996
|
+
children: [
|
|
7997
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(SlidersHorizontal, { className: "h-4 w-4" }),
|
|
7998
|
+
effectiveHiddenColumnIds.size > 0 ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "sr-only", children: [
|
|
7999
|
+
effectiveHiddenColumnIds.size,
|
|
8000
|
+
" hidden"
|
|
8001
|
+
] }) : null
|
|
8002
|
+
]
|
|
8003
|
+
}
|
|
8004
|
+
) }),
|
|
8005
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TooltipContent, { children: "Show, hide, or reorder columns" })
|
|
8006
|
+
] }) : null,
|
|
7940
8007
|
toolbar?.actions
|
|
7941
8008
|
]
|
|
7942
8009
|
}
|
|
7943
8010
|
)
|
|
7944
8011
|
]
|
|
7945
8012
|
}
|
|
7946
|
-
),
|
|
7947
|
-
selection && selectionCount > 0 ? /* @__PURE__ */ (0,
|
|
7948
|
-
/* @__PURE__ */ (0,
|
|
8013
|
+
) }),
|
|
8014
|
+
selection && selectionCount > 0 ? /* @__PURE__ */ (0, import_jsx_runtime36.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: [
|
|
8015
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "text-xs font-medium text-foreground", children: [
|
|
7949
8016
|
selectionCount.toLocaleString(),
|
|
7950
8017
|
" ",
|
|
7951
8018
|
selectionNoun,
|
|
7952
8019
|
selectionCount === 1 ? "" : "s",
|
|
7953
8020
|
" selected"
|
|
7954
8021
|
] }),
|
|
7955
|
-
/* @__PURE__ */ (0,
|
|
8022
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
7956
8023
|
Button,
|
|
7957
8024
|
{
|
|
7958
8025
|
type: "button",
|
|
@@ -7964,13 +8031,13 @@ function MatrxDataTableCore({
|
|
|
7964
8031
|
selection.onSelectedIdsChange([]);
|
|
7965
8032
|
},
|
|
7966
8033
|
children: [
|
|
7967
|
-
/* @__PURE__ */ (0,
|
|
8034
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(X, { className: "h-3.5 w-3.5" }),
|
|
7968
8035
|
"Clear"
|
|
7969
8036
|
]
|
|
7970
8037
|
}
|
|
7971
8038
|
),
|
|
7972
|
-
/* @__PURE__ */ (0,
|
|
7973
|
-
copy && selectedRows.length > 0 ? /* @__PURE__ */ (0,
|
|
8039
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "ml-auto flex flex-wrap items-center gap-1.5", children: [
|
|
8040
|
+
copy && selectedRows.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
7974
8041
|
CopyButtons,
|
|
7975
8042
|
{
|
|
7976
8043
|
size: "icon",
|
|
@@ -8026,9 +8093,9 @@ function MatrxDataTableCore({
|
|
|
8026
8093
|
selection.actions?.(selectedRows, selection.selectedIds)
|
|
8027
8094
|
] })
|
|
8028
8095
|
] }) : null,
|
|
8029
|
-
/* @__PURE__ */ (0,
|
|
8030
|
-
/* @__PURE__ */ (0,
|
|
8031
|
-
mobileCards ? /* @__PURE__ */ (0,
|
|
8096
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex min-h-0 flex-1 flex-col", children: [
|
|
8097
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "relative min-h-0 flex-1", children: [
|
|
8098
|
+
mobileCards ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
8032
8099
|
"div",
|
|
8033
8100
|
{
|
|
8034
8101
|
ref: cardsScrollRef,
|
|
@@ -8040,33 +8107,33 @@ function MatrxDataTableCore({
|
|
|
8040
8107
|
mobileCardsClass
|
|
8041
8108
|
),
|
|
8042
8109
|
children: [
|
|
8043
|
-
isFetching && !isLoading && appendQuery === null ? /* @__PURE__ */ (0,
|
|
8110
|
+
isFetching && !isLoading && appendQuery === null ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
8044
8111
|
"div",
|
|
8045
8112
|
{
|
|
8046
8113
|
role: "status",
|
|
8047
8114
|
className: "h-0.5 shrink-0 overflow-hidden rounded-full bg-primary/15",
|
|
8048
8115
|
children: [
|
|
8049
|
-
/* @__PURE__ */ (0,
|
|
8050
|
-
/* @__PURE__ */ (0,
|
|
8116
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "h-full w-full animate-pulse bg-primary" }),
|
|
8117
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "sr-only", children: "Refreshing table data" })
|
|
8051
8118
|
]
|
|
8052
8119
|
}
|
|
8053
8120
|
) : null,
|
|
8054
|
-
isLoading ? Array.from({ length: 4 }).map((_, index) => /* @__PURE__ */ (0,
|
|
8121
|
+
isLoading ? Array.from({ length: 4 }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8055
8122
|
Skeleton,
|
|
8056
8123
|
{
|
|
8057
8124
|
className: "h-52 w-full shrink-0 rounded-lg"
|
|
8058
8125
|
},
|
|
8059
8126
|
`mobile-card-sk-${index}`
|
|
8060
|
-
)) : paginated.length === 0 ? /* @__PURE__ */ (0,
|
|
8127
|
+
)) : paginated.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "flex min-h-48 flex-1 items-center justify-center px-4 py-12 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex max-w-sm flex-col items-center gap-2", children: [
|
|
8061
8128
|
emptyState?.icon,
|
|
8062
|
-
/* @__PURE__ */ (0,
|
|
8063
|
-
emptyState?.description ? /* @__PURE__ */ (0,
|
|
8129
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-sm font-medium text-foreground", children: emptyState?.title ?? "No rows" }),
|
|
8130
|
+
emptyState?.description ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-xs text-muted-foreground", children: emptyState.description }) : null,
|
|
8064
8131
|
emptyState?.action
|
|
8065
8132
|
] }) }) : paginated.map((row, index) => {
|
|
8066
8133
|
const id = getRowId(row);
|
|
8067
8134
|
const displayRow = applyRowEdits(row, edits[id]);
|
|
8068
8135
|
const selectable = selection?.isRowSelectable?.(row) ?? Boolean(selection);
|
|
8069
|
-
return /* @__PURE__ */ (0,
|
|
8136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react13.Fragment, { children: mobileCards(displayRow, index, {
|
|
8070
8137
|
selected: selectedIdSet.has(id),
|
|
8071
8138
|
selectable,
|
|
8072
8139
|
onSelectedChange: (nextSelected) => {
|
|
@@ -8078,13 +8145,13 @@ function MatrxDataTableCore({
|
|
|
8078
8145
|
else next.delete(id);
|
|
8079
8146
|
setSelectedIds(next);
|
|
8080
8147
|
},
|
|
8081
|
-
actions: showRowCopy || rowActions ? /* @__PURE__ */ (0,
|
|
8148
|
+
actions: showRowCopy || rowActions ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
8082
8149
|
"div",
|
|
8083
8150
|
{
|
|
8084
8151
|
className: "inline-flex items-center gap-1",
|
|
8085
8152
|
onClick: (event) => event.stopPropagation(),
|
|
8086
8153
|
children: [
|
|
8087
|
-
showRowCopy && copy ? /* @__PURE__ */ (0,
|
|
8154
|
+
showRowCopy && copy ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8088
8155
|
TableRowCopyControl,
|
|
8089
8156
|
{
|
|
8090
8157
|
size: "xs",
|
|
@@ -8106,7 +8173,7 @@ function MatrxDataTableCore({
|
|
|
8106
8173
|
) : null
|
|
8107
8174
|
}) }, id);
|
|
8108
8175
|
}),
|
|
8109
|
-
appendQuery !== null && isFetching && !isLoading ? /* @__PURE__ */ (0,
|
|
8176
|
+
appendQuery !== null && isFetching && !isLoading ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
8110
8177
|
"div",
|
|
8111
8178
|
{
|
|
8112
8179
|
"data-matrx-table-append-loading-card": true,
|
|
@@ -8114,7 +8181,7 @@ function MatrxDataTableCore({
|
|
|
8114
8181
|
"aria-live": "polite",
|
|
8115
8182
|
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",
|
|
8116
8183
|
children: [
|
|
8117
|
-
/* @__PURE__ */ (0,
|
|
8184
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8118
8185
|
Loader2,
|
|
8119
8186
|
{
|
|
8120
8187
|
"aria-hidden": "true",
|
|
@@ -8128,7 +8195,7 @@ function MatrxDataTableCore({
|
|
|
8128
8195
|
]
|
|
8129
8196
|
}
|
|
8130
8197
|
) : null,
|
|
8131
|
-
/* @__PURE__ */ (0,
|
|
8198
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
8132
8199
|
"div",
|
|
8133
8200
|
{
|
|
8134
8201
|
ref: scrollRef,
|
|
@@ -8143,34 +8210,34 @@ function MatrxDataTableCore({
|
|
|
8143
8210
|
tableClassName
|
|
8144
8211
|
),
|
|
8145
8212
|
children: [
|
|
8146
|
-
hierarchy && draggedRow ? /* @__PURE__ */ (0,
|
|
8213
|
+
hierarchy && draggedRow ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8147
8214
|
HierarchyRootDropTarget,
|
|
8148
8215
|
{
|
|
8149
8216
|
label: hierarchy.rootDropLabel ?? "Drop here to move to the top level",
|
|
8150
8217
|
draggedLabel: hierarchy.itemLabel?.(draggedRow) ?? "Moving row"
|
|
8151
8218
|
}
|
|
8152
8219
|
) : null,
|
|
8153
|
-
hierarchy && draggedRowId ? /* @__PURE__ */ (0,
|
|
8220
|
+
hierarchy && draggedRowId ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8154
8221
|
HierarchyDragIndicatorLayer,
|
|
8155
8222
|
{
|
|
8156
8223
|
scrollRef,
|
|
8157
8224
|
resolve: resolveHierarchyMove
|
|
8158
8225
|
}
|
|
8159
8226
|
) : null,
|
|
8160
|
-
isFetching && !isLoading && appendQuery === null ? /* @__PURE__ */ (0,
|
|
8227
|
+
isFetching && !isLoading && appendQuery === null ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
8161
8228
|
"div",
|
|
8162
8229
|
{
|
|
8163
8230
|
role: "status",
|
|
8164
8231
|
className: "sticky left-0 top-0 z-20 h-0.5 w-full overflow-hidden bg-primary/15",
|
|
8165
8232
|
children: [
|
|
8166
|
-
/* @__PURE__ */ (0,
|
|
8167
|
-
/* @__PURE__ */ (0,
|
|
8233
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "h-full w-full animate-pulse bg-primary" }),
|
|
8234
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "sr-only", children: "Refreshing table data" })
|
|
8168
8235
|
]
|
|
8169
8236
|
}
|
|
8170
8237
|
) : null,
|
|
8171
|
-
/* @__PURE__ */ (0,
|
|
8172
|
-
/* @__PURE__ */ (0,
|
|
8173
|
-
selection ? /* @__PURE__ */ (0,
|
|
8238
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.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: [
|
|
8239
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.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_runtime36.jsxs)("tr", { children: [
|
|
8240
|
+
selection ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("th", { className: "h-9 w-9 px-2 text-left align-middle", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8174
8241
|
Checkbox,
|
|
8175
8242
|
{
|
|
8176
8243
|
className: CHECKBOX_TAP_AREA,
|
|
@@ -8186,7 +8253,7 @@ function MatrxDataTableCore({
|
|
|
8186
8253
|
const isSorted = sort?.id === id;
|
|
8187
8254
|
const headerLabel = col.label ?? (typeof col.header === "string" ? col.header : id);
|
|
8188
8255
|
const defaultSortDirection = col.defaultSortDirection ?? "asc";
|
|
8189
|
-
return /* @__PURE__ */ (0,
|
|
8256
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8190
8257
|
"th",
|
|
8191
8258
|
{
|
|
8192
8259
|
"aria-sort": isSorted ? sort?.direction === "asc" ? "ascending" : "descending" : void 0,
|
|
@@ -8213,7 +8280,7 @@ function MatrxDataTableCore({
|
|
|
8213
8280
|
col.align === "right" && "text-right"
|
|
8214
8281
|
),
|
|
8215
8282
|
style: columnWidthVar(col.width),
|
|
8216
|
-
children: /* @__PURE__ */ (0,
|
|
8283
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ColumnHeaderDropZone, { id, enabled: reorderableColumns, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8217
8284
|
ColumnHeaderCell,
|
|
8218
8285
|
{
|
|
8219
8286
|
label: col.header,
|
|
@@ -8254,12 +8321,12 @@ function MatrxDataTableCore({
|
|
|
8254
8321
|
id
|
|
8255
8322
|
);
|
|
8256
8323
|
}),
|
|
8257
|
-
showActionsCol && /* @__PURE__ */ (0,
|
|
8324
|
+
showActionsCol && /* @__PURE__ */ (0, import_jsx_runtime36.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" })
|
|
8258
8325
|
] }) }),
|
|
8259
|
-
/* @__PURE__ */ (0,
|
|
8260
|
-
isLoading ? Array.from({ length: 6 }).map((_, i) => /* @__PURE__ */ (0,
|
|
8261
|
-
selection ? /* @__PURE__ */ (0,
|
|
8262
|
-
visibleColumns.map((col) => /* @__PURE__ */ (0,
|
|
8326
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("tbody", { children: [
|
|
8327
|
+
isLoading ? Array.from({ length: 6 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("tr", { className: "border-b border-border/60", children: [
|
|
8328
|
+
selection ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("td", { className: "px-2 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Skeleton, { className: "h-3.5 w-3.5" }) }) : null,
|
|
8329
|
+
visibleColumns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8263
8330
|
"td",
|
|
8264
8331
|
{
|
|
8265
8332
|
className: cn(
|
|
@@ -8267,20 +8334,20 @@ function MatrxDataTableCore({
|
|
|
8267
8334
|
col.compact ? "px-1" : "px-2",
|
|
8268
8335
|
col.mobileHidden && "max-sm:hidden"
|
|
8269
8336
|
),
|
|
8270
|
-
children: /* @__PURE__ */ (0,
|
|
8337
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Skeleton, { className: "h-5 w-full" })
|
|
8271
8338
|
},
|
|
8272
8339
|
columnId(col)
|
|
8273
8340
|
)),
|
|
8274
|
-
showActionsCol && /* @__PURE__ */ (0,
|
|
8275
|
-
] }, `sk-${i}`)) : paginated.length === 0 ? /* @__PURE__ */ (0,
|
|
8341
|
+
showActionsCol && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("td", { className: "px-2 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Skeleton, { className: "ml-auto h-5 w-10" }) })
|
|
8342
|
+
] }, `sk-${i}`)) : paginated.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8276
8343
|
"td",
|
|
8277
8344
|
{
|
|
8278
8345
|
colSpan: visibleColumns.length + leadingCols + (showActionsCol ? 1 : 0),
|
|
8279
8346
|
className: "px-4 py-12 text-center",
|
|
8280
|
-
children: /* @__PURE__ */ (0,
|
|
8347
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "mx-auto flex max-w-sm flex-col items-center gap-2", children: [
|
|
8281
8348
|
emptyState?.icon,
|
|
8282
|
-
/* @__PURE__ */ (0,
|
|
8283
|
-
emptyState?.description ? /* @__PURE__ */ (0,
|
|
8349
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-sm font-medium text-foreground", children: emptyState?.title ?? "No rows" }),
|
|
8350
|
+
emptyState?.description ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-xs text-muted-foreground", children: emptyState.description }) : null,
|
|
8284
8351
|
emptyState?.action
|
|
8285
8352
|
] })
|
|
8286
8353
|
}
|
|
@@ -8290,7 +8357,7 @@ function MatrxDataTableCore({
|
|
|
8290
8357
|
const rowEdits = edits[id];
|
|
8291
8358
|
const displayRow = applyRowEdits(row, rowEdits);
|
|
8292
8359
|
const isChecked = selectedIdSet.has(id);
|
|
8293
|
-
const rowNode = /* @__PURE__ */ (0,
|
|
8360
|
+
const rowNode = /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
8294
8361
|
"tr",
|
|
8295
8362
|
{
|
|
8296
8363
|
"data-row-id": id,
|
|
@@ -8313,12 +8380,12 @@ function MatrxDataTableCore({
|
|
|
8313
8380
|
zebra && index % 2 === 1 && !isSelected && !isChecked && "sm:bg-muted/20"
|
|
8314
8381
|
),
|
|
8315
8382
|
children: [
|
|
8316
|
-
selection ? /* @__PURE__ */ (0,
|
|
8383
|
+
selection ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8317
8384
|
"td",
|
|
8318
8385
|
{
|
|
8319
8386
|
className: "px-2 py-1.5 align-middle lg:py-0.5",
|
|
8320
8387
|
onClick: (e) => e.stopPropagation(),
|
|
8321
|
-
children: selection.isRowSelectable?.(row) ?? true ? /* @__PURE__ */ (0,
|
|
8388
|
+
children: selection.isRowSelectable?.(row) ?? true ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8322
8389
|
Checkbox,
|
|
8323
8390
|
{
|
|
8324
8391
|
className: CHECKBOX_TAP_AREA,
|
|
@@ -8339,7 +8406,7 @@ function MatrxDataTableCore({
|
|
|
8339
8406
|
rowEdits && field in rowEdits
|
|
8340
8407
|
);
|
|
8341
8408
|
const cellHref = col.href?.(row) ?? void 0;
|
|
8342
|
-
return /* @__PURE__ */ (0,
|
|
8409
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8343
8410
|
"td",
|
|
8344
8411
|
{
|
|
8345
8412
|
className: cn(
|
|
@@ -8355,14 +8422,14 @@ function MatrxDataTableCore({
|
|
|
8355
8422
|
col.align === "right" && "text-right"
|
|
8356
8423
|
),
|
|
8357
8424
|
style: columnWidthVar(col.width),
|
|
8358
|
-
children: /* @__PURE__ */ (0,
|
|
8425
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
8359
8426
|
"div",
|
|
8360
8427
|
{
|
|
8361
8428
|
className: cn(
|
|
8362
8429
|
colIdx === 0 && hierarchy && "flex min-w-0 items-center"
|
|
8363
8430
|
),
|
|
8364
8431
|
children: [
|
|
8365
|
-
colIdx === 0 && hierarchy ? /* @__PURE__ */ (0,
|
|
8432
|
+
colIdx === 0 && hierarchy ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8366
8433
|
HierarchyDragHandle,
|
|
8367
8434
|
{
|
|
8368
8435
|
id,
|
|
@@ -8370,12 +8437,12 @@ function MatrxDataTableCore({
|
|
|
8370
8437
|
disabled: !(hierarchy.canReparent?.(row) ?? true)
|
|
8371
8438
|
}
|
|
8372
8439
|
) : null,
|
|
8373
|
-
/* @__PURE__ */ (0,
|
|
8440
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8374
8441
|
"div",
|
|
8375
8442
|
{
|
|
8376
8443
|
"data-matrx-cell-content": true,
|
|
8377
8444
|
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]",
|
|
8378
|
-
children: editable && col.editable ? /* @__PURE__ */ (0,
|
|
8445
|
+
children: editable && col.editable ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8379
8446
|
EditableTableCell,
|
|
8380
8447
|
{
|
|
8381
8448
|
value: rowEdits && field in rowEdits ? rowEdits[field] : getCellValue(row, col),
|
|
@@ -8387,7 +8454,7 @@ function MatrxDataTableCore({
|
|
|
8387
8454
|
...cellHref === void 0 ? {} : { href: cellHref },
|
|
8388
8455
|
...col.editTrigger === void 0 ? {} : { editTrigger: col.editTrigger }
|
|
8389
8456
|
}
|
|
8390
|
-
) : cellHref ? /* @__PURE__ */ (0,
|
|
8457
|
+
) : cellHref ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8391
8458
|
Link,
|
|
8392
8459
|
{
|
|
8393
8460
|
href: cellHref,
|
|
@@ -8405,13 +8472,13 @@ function MatrxDataTableCore({
|
|
|
8405
8472
|
columnId(col)
|
|
8406
8473
|
);
|
|
8407
8474
|
}),
|
|
8408
|
-
showActionsCol && /* @__PURE__ */ (0,
|
|
8475
|
+
showActionsCol && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("td", { className: "px-2 py-1.5 text-right align-middle lg:py-0.5", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
8409
8476
|
"div",
|
|
8410
8477
|
{
|
|
8411
8478
|
className: "inline-flex items-center justify-end gap-0.5",
|
|
8412
8479
|
onClick: (e) => e.stopPropagation(),
|
|
8413
8480
|
children: [
|
|
8414
|
-
showRowCopy && copy ? /* @__PURE__ */ (0,
|
|
8481
|
+
showRowCopy && copy ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8415
8482
|
TableRowCopyControl,
|
|
8416
8483
|
{
|
|
8417
8484
|
size: "xs",
|
|
@@ -8428,7 +8495,7 @@ function MatrxDataTableCore({
|
|
|
8428
8495
|
hasPendingEdits: Boolean(rowEdits),
|
|
8429
8496
|
discardPendingEdits: () => discardRowEdits(id)
|
|
8430
8497
|
}),
|
|
8431
|
-
windowEnabled ? /* @__PURE__ */ (0,
|
|
8498
|
+
windowEnabled ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8432
8499
|
Button,
|
|
8433
8500
|
{
|
|
8434
8501
|
type: "button",
|
|
@@ -8445,7 +8512,7 @@ function MatrxDataTableCore({
|
|
|
8445
8512
|
openWindow(row);
|
|
8446
8513
|
}
|
|
8447
8514
|
},
|
|
8448
|
-
children: opensWindowOnRowClick ? /* @__PURE__ */ (0,
|
|
8515
|
+
children: opensWindowOnRowClick ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(PanelRightOpen, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(PanelRight, { className: "h-3.5 w-3.5" })
|
|
8449
8516
|
}
|
|
8450
8517
|
) : null
|
|
8451
8518
|
]
|
|
@@ -8456,7 +8523,7 @@ function MatrxDataTableCore({
|
|
|
8456
8523
|
id
|
|
8457
8524
|
);
|
|
8458
8525
|
const wrappedRow = rowWrapper ? rowWrapper(row, rowNode) : rowNode;
|
|
8459
|
-
return hierarchy ? /* @__PURE__ */ (0,
|
|
8526
|
+
return hierarchy ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8460
8527
|
HierarchyDroppableRow,
|
|
8461
8528
|
{
|
|
8462
8529
|
id,
|
|
@@ -8464,21 +8531,21 @@ function MatrxDataTableCore({
|
|
|
8464
8531
|
children: wrappedRow
|
|
8465
8532
|
},
|
|
8466
8533
|
id
|
|
8467
|
-
) : /* @__PURE__ */ (0,
|
|
8534
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react13.Fragment, { children: wrappedRow }, id);
|
|
8468
8535
|
}),
|
|
8469
|
-
appendQuery !== null && isFetching && !isLoading ? /* @__PURE__ */ (0,
|
|
8536
|
+
appendQuery !== null && isFetching && !isLoading ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("tr", { "data-matrx-table-append-loading-row": true, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8470
8537
|
"td",
|
|
8471
8538
|
{
|
|
8472
8539
|
colSpan: visibleColumns.length + leadingCols + (showActionsCol ? 1 : 0),
|
|
8473
8540
|
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",
|
|
8474
|
-
children: /* @__PURE__ */ (0,
|
|
8541
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
8475
8542
|
"div",
|
|
8476
8543
|
{
|
|
8477
8544
|
role: "status",
|
|
8478
8545
|
"aria-live": "polite",
|
|
8479
8546
|
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",
|
|
8480
8547
|
children: [
|
|
8481
|
-
/* @__PURE__ */ (0,
|
|
8548
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8482
8549
|
Loader2,
|
|
8483
8550
|
{
|
|
8484
8551
|
"aria-hidden": "true",
|
|
@@ -8492,9 +8559,9 @@ function MatrxDataTableCore({
|
|
|
8492
8559
|
}
|
|
8493
8560
|
) }) : null
|
|
8494
8561
|
] }),
|
|
8495
|
-
footerRows.length > 0 ? /* @__PURE__ */ (0,
|
|
8496
|
-
selection ? /* @__PURE__ */ (0,
|
|
8497
|
-
visibleColumns.map((column) => /* @__PURE__ */ (0,
|
|
8562
|
+
footerRows.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("tfoot", { className: "border-t-2 border-border bg-muted/50 font-semibold", children: footerRows.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("tr", { children: [
|
|
8563
|
+
selection ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("td", { className: "px-2 py-2" }) : null,
|
|
8564
|
+
visibleColumns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8498
8565
|
"td",
|
|
8499
8566
|
{
|
|
8500
8567
|
className: cn(
|
|
@@ -8509,13 +8576,13 @@ function MatrxDataTableCore({
|
|
|
8509
8576
|
},
|
|
8510
8577
|
columnId(column)
|
|
8511
8578
|
)),
|
|
8512
|
-
showActionsCol ? /* @__PURE__ */ (0,
|
|
8579
|
+
showActionsCol ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("td", { className: "px-2 py-2" }) : null
|
|
8513
8580
|
] }, `footer-${index}`)) }) : null
|
|
8514
8581
|
] })
|
|
8515
8582
|
]
|
|
8516
8583
|
}
|
|
8517
8584
|
),
|
|
8518
|
-
scrollHintLeft ? /* @__PURE__ */ (0,
|
|
8585
|
+
scrollHintLeft ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8519
8586
|
Button,
|
|
8520
8587
|
{
|
|
8521
8588
|
type: "button",
|
|
@@ -8526,10 +8593,10 @@ function MatrxDataTableCore({
|
|
|
8526
8593
|
"data-matrx-table-scroll-control": "left",
|
|
8527
8594
|
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",
|
|
8528
8595
|
onClick: () => scrollTableHorizontally("left"),
|
|
8529
|
-
children: /* @__PURE__ */ (0,
|
|
8596
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ChevronLeft, { className: "h-5 w-5" })
|
|
8530
8597
|
}
|
|
8531
8598
|
) : null,
|
|
8532
|
-
scrollHintRight ? /* @__PURE__ */ (0,
|
|
8599
|
+
scrollHintRight ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8533
8600
|
Button,
|
|
8534
8601
|
{
|
|
8535
8602
|
type: "button",
|
|
@@ -8540,24 +8607,24 @@ function MatrxDataTableCore({
|
|
|
8540
8607
|
"data-matrx-table-scroll-control": "right",
|
|
8541
8608
|
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",
|
|
8542
8609
|
onClick: () => scrollTableHorizontally("right"),
|
|
8543
|
-
children: /* @__PURE__ */ (0,
|
|
8610
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ChevronRight, { className: "h-5 w-5" })
|
|
8544
8611
|
}
|
|
8545
8612
|
) : null
|
|
8546
8613
|
] }),
|
|
8547
|
-
appendQuery ? /* @__PURE__ */ (0,
|
|
8614
|
+
appendQuery ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
8548
8615
|
"div",
|
|
8549
8616
|
{
|
|
8550
8617
|
"data-matrx-table-footer": true,
|
|
8551
|
-
className: "flex min-h-16 shrink-0 items-center justify-between gap-3 border-t border-border px-3 py-2",
|
|
8618
|
+
className: "flex min-h-16 shrink-0 flex-wrap items-center justify-between gap-3 border-t border-border px-3 py-2",
|
|
8552
8619
|
"aria-busy": isLoading || isFetching,
|
|
8553
8620
|
children: [
|
|
8554
|
-
/* @__PURE__ */ (0,
|
|
8621
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
8555
8622
|
"div",
|
|
8556
8623
|
{
|
|
8557
8624
|
...isFetching && !isLoading ? {} : { role: "status", "aria-live": "polite" },
|
|
8558
|
-
className: "flex min-w-0 flex-
|
|
8625
|
+
className: "flex w-full min-w-0 flex-none items-center gap-2 text-xs text-muted-foreground sm:w-auto sm:flex-1",
|
|
8559
8626
|
children: [
|
|
8560
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
8627
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8561
8628
|
Loader2,
|
|
8562
8629
|
{
|
|
8563
8630
|
"data-matrx-table-append-loader": true,
|
|
@@ -8565,24 +8632,48 @@ function MatrxDataTableCore({
|
|
|
8565
8632
|
className: "h-5 w-5 shrink-0 animate-spin text-primary motion-reduce:animate-none"
|
|
8566
8633
|
}
|
|
8567
8634
|
) : null,
|
|
8568
|
-
/* @__PURE__ */ (0,
|
|
8569
|
-
/* @__PURE__ */ (0,
|
|
8570
|
-
appendQuery.pagination.sourceUntil ? /* @__PURE__ */ (0,
|
|
8571
|
-
"Source fixed through
|
|
8635
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "min-w-0", children: [
|
|
8636
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.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()}`}` }),
|
|
8637
|
+
appendQuery.pagination.sourceUntil ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("p", { children: [
|
|
8638
|
+
"Source fixed through",
|
|
8639
|
+
" ",
|
|
8572
8640
|
new Date(appendQuery.pagination.sourceUntil).toLocaleString(),
|
|
8573
8641
|
"."
|
|
8574
8642
|
] }) : null,
|
|
8575
|
-
!isLoading && !isFetching && !appendQuery.pagination.loadAll?.isLoading && !scrollPagination.error && !appendQuery.pagination.hasNextPage && appendQuery.pagination.totalItems !== void 0 && data.length === appendQuery.pagination.totalItems ? /* @__PURE__ */ (0,
|
|
8576
|
-
scrollPagination.error ? /* @__PURE__ */ (0,
|
|
8643
|
+
!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_runtime36.jsx)("p", { children: "All source rows are loaded." }) : appendUsesLocalProcessing ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { children: "Local search and filters cover loaded rows." }) : null,
|
|
8644
|
+
scrollPagination.error ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { role: "alert", className: "break-words text-destructive", children: scrollPagination.error.message }) : null
|
|
8577
8645
|
] })
|
|
8578
8646
|
]
|
|
8579
8647
|
}
|
|
8580
8648
|
),
|
|
8581
|
-
appendQuery.pagination.sourcePageSize ? /* @__PURE__ */ (0,
|
|
8582
|
-
|
|
8583
|
-
|
|
8584
|
-
|
|
8585
|
-
|
|
8649
|
+
appendQuery.pagination.sourcePageSize ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
8650
|
+
Select,
|
|
8651
|
+
{
|
|
8652
|
+
value: String(appendQuery.pagination.sourcePageSize.value),
|
|
8653
|
+
onValueChange: (value) => appendQuery.pagination.sourcePageSize?.onChange(Number(value)),
|
|
8654
|
+
children: [
|
|
8655
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8656
|
+
SelectTrigger,
|
|
8657
|
+
{
|
|
8658
|
+
"aria-label": "Rows per load",
|
|
8659
|
+
className: "h-8 w-20 shrink-0 text-xs sm:w-24",
|
|
8660
|
+
disabled: isLoading || isFetching || appendQuery.pagination.loadAll?.isLoading,
|
|
8661
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(SelectValue, {})
|
|
8662
|
+
}
|
|
8663
|
+
),
|
|
8664
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(SelectContent, { children: appendQuery.pagination.sourcePageSize.options.map((size) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(SelectItem, { value: String(size), children: size }, size)) })
|
|
8665
|
+
]
|
|
8666
|
+
}
|
|
8667
|
+
) : null,
|
|
8668
|
+
appendQuery.pagination.loadAll?.isLoading ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8669
|
+
Button,
|
|
8670
|
+
{
|
|
8671
|
+
type: "button",
|
|
8672
|
+
variant: "outline",
|
|
8673
|
+
onClick: appendQuery.pagination.loadAll.stop,
|
|
8674
|
+
children: "Stop loading"
|
|
8675
|
+
}
|
|
8676
|
+
) : scrollPagination.error ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8586
8677
|
Button,
|
|
8587
8678
|
{
|
|
8588
8679
|
type: "button",
|
|
@@ -8590,13 +8681,33 @@ function MatrxDataTableCore({
|
|
|
8590
8681
|
onClick: appendQuery.pagination.retrySource ?? (appendQuery.pagination.hasNextPage ? appendQuery.pagination.loadNextPage : appendQuery.pagination.refresh),
|
|
8591
8682
|
children: appendQuery.pagination.retrySource ? "Retry source" : appendQuery.pagination.hasNextPage ? "Retry" : "Reload rows"
|
|
8592
8683
|
}
|
|
8593
|
-
) : appendQuery.pagination.hasNextPage || scrollPagination.error ? /* @__PURE__ */ (0,
|
|
8594
|
-
/* @__PURE__ */ (0,
|
|
8595
|
-
|
|
8596
|
-
|
|
8684
|
+
) : appendQuery.pagination.hasNextPage || scrollPagination.error ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex flex-wrap gap-1", children: [
|
|
8685
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8686
|
+
Button,
|
|
8687
|
+
{
|
|
8688
|
+
type: "button",
|
|
8689
|
+
size: "sm",
|
|
8690
|
+
variant: "outline",
|
|
8691
|
+
disabled: isLoading || isFetching,
|
|
8692
|
+
onClick: () => void scrollPagination.requestNextPage(),
|
|
8693
|
+
children: "Load more"
|
|
8694
|
+
}
|
|
8695
|
+
),
|
|
8696
|
+
appendQuery.pagination.loadAll ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8697
|
+
Button,
|
|
8698
|
+
{
|
|
8699
|
+
type: "button",
|
|
8700
|
+
size: "sm",
|
|
8701
|
+
variant: "ghost",
|
|
8702
|
+
disabled: isLoading || isFetching,
|
|
8703
|
+
onClick: appendQuery.pagination.loadAll.request,
|
|
8704
|
+
children: "Load all"
|
|
8705
|
+
}
|
|
8706
|
+
) : null
|
|
8707
|
+
] }) : !isLoading && appendQuery.pagination.totalItems !== void 0 && data.length === appendQuery.pagination.totalItems ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "text-xs text-muted-foreground", children: "All rows loaded" }) : null
|
|
8597
8708
|
]
|
|
8598
8709
|
}
|
|
8599
|
-
) : !hidePagination && totalItems > 0 ? /* @__PURE__ */ (0,
|
|
8710
|
+
) : !hidePagination && totalItems > 0 ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8600
8711
|
GenericTablePagination,
|
|
8601
8712
|
{
|
|
8602
8713
|
totalItems,
|
|
@@ -8616,7 +8727,7 @@ function MatrxDataTableCore({
|
|
|
8616
8727
|
}
|
|
8617
8728
|
) }) : null
|
|
8618
8729
|
] }),
|
|
8619
|
-
/* @__PURE__ */ (0,
|
|
8730
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8620
8731
|
ColumnManager,
|
|
8621
8732
|
{
|
|
8622
8733
|
open: columnManagerOpen,
|
|
@@ -8627,7 +8738,7 @@ function MatrxDataTableCore({
|
|
|
8627
8738
|
onApply: commitColumnState
|
|
8628
8739
|
}
|
|
8629
8740
|
),
|
|
8630
|
-
detailEnabled && selectedRow ? /* @__PURE__ */ (0,
|
|
8741
|
+
detailEnabled && selectedRow ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8631
8742
|
SidePanelSurface,
|
|
8632
8743
|
{
|
|
8633
8744
|
title: resolveStringTitle(
|
|
@@ -8638,8 +8749,8 @@ function MatrxDataTableCore({
|
|
|
8638
8749
|
description: detail?.description?.(selectedRow),
|
|
8639
8750
|
onClose: () => setSelectedId(null),
|
|
8640
8751
|
defaultWidth: detail?.defaultWidth ?? 480,
|
|
8641
|
-
headerActions: /* @__PURE__ */ (0,
|
|
8642
|
-
copy && showRowCopy ? /* @__PURE__ */ (0,
|
|
8752
|
+
headerActions: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
8753
|
+
copy && showRowCopy ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8643
8754
|
TableRowCopyControl,
|
|
8644
8755
|
{
|
|
8645
8756
|
size: "icon",
|
|
@@ -8649,7 +8760,7 @@ function MatrxDataTableCore({
|
|
|
8649
8760
|
}
|
|
8650
8761
|
) : null,
|
|
8651
8762
|
detail?.headerActions?.(selectedRow),
|
|
8652
|
-
windowEnabled ? /* @__PURE__ */ (0,
|
|
8763
|
+
windowEnabled ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8653
8764
|
Button,
|
|
8654
8765
|
{
|
|
8655
8766
|
type: "button",
|
|
@@ -8659,7 +8770,7 @@ function MatrxDataTableCore({
|
|
|
8659
8770
|
"aria-label": "Open in window",
|
|
8660
8771
|
title: "Open in window",
|
|
8661
8772
|
onClick: () => openWindow(selectedRow),
|
|
8662
|
-
children: /* @__PURE__ */ (0,
|
|
8773
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(PanelRight, { className: "h-3.5 w-3.5" })
|
|
8663
8774
|
}
|
|
8664
8775
|
) : null
|
|
8665
8776
|
] }),
|
|
@@ -8671,7 +8782,7 @@ function MatrxDataTableCore({
|
|
|
8671
8782
|
// fixes the whole class at once — a custom body that already
|
|
8672
8783
|
// scrolls (`h-full` + `overflow-y-auto` root) still resolves to
|
|
8673
8784
|
// this container's height, so no second scrollbar appears.
|
|
8674
|
-
/* @__PURE__ */ (0,
|
|
8785
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "h-full min-h-0 overflow-y-auto", children: detail.render(selectedRow, {
|
|
8675
8786
|
closeDetail: () => setSelectedId(null),
|
|
8676
8787
|
openDetail: () => openDetail(selectedRow),
|
|
8677
8788
|
openWindow: () => openWindow(selectedRow),
|
|
@@ -8679,7 +8790,7 @@ function MatrxDataTableCore({
|
|
|
8679
8790
|
hasPendingEdits: Boolean(edits[getRowId(selectedRow)]),
|
|
8680
8791
|
discardPendingEdits: () => discardRowEdits(getRowId(selectedRow))
|
|
8681
8792
|
}) })
|
|
8682
|
-
) : /* @__PURE__ */ (0,
|
|
8793
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8683
8794
|
DataRowInspector,
|
|
8684
8795
|
{
|
|
8685
8796
|
row: selectedRow,
|
|
@@ -8691,7 +8802,7 @@ function MatrxDataTableCore({
|
|
|
8691
8802
|
)
|
|
8692
8803
|
}
|
|
8693
8804
|
) : null,
|
|
8694
|
-
windowRow ? /* @__PURE__ */ (0,
|
|
8805
|
+
windowRow ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8695
8806
|
DataRowWindow,
|
|
8696
8807
|
{
|
|
8697
8808
|
isOpen: true,
|
|
@@ -8702,8 +8813,8 @@ function MatrxDataTableCore({
|
|
|
8702
8813
|
height: windowConfig?.height,
|
|
8703
8814
|
windowId: `matrx-data-row-${urlState?.id ?? "local"}-${getRowId(windowRow)}`,
|
|
8704
8815
|
defaultTab: windowConfig?.defaultTab,
|
|
8705
|
-
headerActions: /* @__PURE__ */ (0,
|
|
8706
|
-
opensWindowOnRowClick && detailEnabled ? /* @__PURE__ */ (0,
|
|
8816
|
+
headerActions: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
8817
|
+
opensWindowOnRowClick && detailEnabled ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8707
8818
|
Button,
|
|
8708
8819
|
{
|
|
8709
8820
|
type: "button",
|
|
@@ -8716,10 +8827,10 @@ function MatrxDataTableCore({
|
|
|
8716
8827
|
closeWindow();
|
|
8717
8828
|
openDetail(windowRow);
|
|
8718
8829
|
},
|
|
8719
|
-
children: /* @__PURE__ */ (0,
|
|
8830
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(PanelRightOpen, { className: "h-3.5 w-3.5" })
|
|
8720
8831
|
}
|
|
8721
8832
|
) : null,
|
|
8722
|
-
copy ? /* @__PURE__ */ (0,
|
|
8833
|
+
copy ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8723
8834
|
TableRowCopyControl,
|
|
8724
8835
|
{
|
|
8725
8836
|
size: "icon",
|
|
@@ -8736,7 +8847,7 @@ function MatrxDataTableCore({
|
|
|
8736
8847
|
closeWindow,
|
|
8737
8848
|
hasPendingEdits: Boolean(edits[getRowId(windowRow)]),
|
|
8738
8849
|
discardPendingEdits: () => discardRowEdits(getRowId(windowRow))
|
|
8739
|
-
}) ?? (copy ? /* @__PURE__ */ (0,
|
|
8850
|
+
}) ?? (copy ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8740
8851
|
DataRowInspector,
|
|
8741
8852
|
{
|
|
8742
8853
|
row: windowRow,
|
|
@@ -8771,15 +8882,15 @@ function MatrxDataTableCore({
|
|
|
8771
8882
|
})
|
|
8772
8883
|
}
|
|
8773
8884
|
) : null,
|
|
8774
|
-
editEnabled ? /* @__PURE__ */ (0,
|
|
8775
|
-
foreignDrafts.length > 0 ? /* @__PURE__ */ (0,
|
|
8885
|
+
editEnabled ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
8886
|
+
foreignDrafts.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
8776
8887
|
"div",
|
|
8777
8888
|
{
|
|
8778
8889
|
"data-matrx-foreign-drafts": true,
|
|
8779
8890
|
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",
|
|
8780
8891
|
children: [
|
|
8781
|
-
/* @__PURE__ */ (0,
|
|
8782
|
-
/* @__PURE__ */ (0,
|
|
8892
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { children: "Unsaved edits from previous results" }),
|
|
8893
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8783
8894
|
CopyButtons,
|
|
8784
8895
|
{
|
|
8785
8896
|
size: "xs",
|
|
@@ -8788,11 +8899,11 @@ function MatrxDataTableCore({
|
|
|
8788
8899
|
json: () => foreignDraftPayload
|
|
8789
8900
|
}
|
|
8790
8901
|
),
|
|
8791
|
-
/* @__PURE__ */ (0,
|
|
8902
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Button, { type: "button", size: "sm", variant: "ghost", className: "h-7 text-xs text-destructive", onClick: () => setConfirmForeignDraftDiscard(true), children: "Discard drafts" })
|
|
8792
8903
|
]
|
|
8793
8904
|
}
|
|
8794
8905
|
) : null,
|
|
8795
|
-
/* @__PURE__ */ (0,
|
|
8906
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8796
8907
|
ConfirmDialog,
|
|
8797
8908
|
{
|
|
8798
8909
|
open: confirmForeignDraftDiscard,
|
|
@@ -8812,7 +8923,7 @@ function MatrxDataTableCore({
|
|
|
8812
8923
|
}
|
|
8813
8924
|
}
|
|
8814
8925
|
),
|
|
8815
|
-
/* @__PURE__ */ (0,
|
|
8926
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8816
8927
|
DirtySavePill,
|
|
8817
8928
|
{
|
|
8818
8929
|
changeCount,
|
|
@@ -8825,11 +8936,11 @@ function MatrxDataTableCore({
|
|
|
8825
8936
|
]
|
|
8826
8937
|
}
|
|
8827
8938
|
),
|
|
8828
|
-
/* @__PURE__ */ (0,
|
|
8939
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_core3.DragOverlay, { children: draggedRow ? (
|
|
8829
8940
|
// w-max: the overlay inherits the ACTIVE node's size, and the active
|
|
8830
8941
|
// node is the 16px grip handle — without it the label wraps to one
|
|
8831
8942
|
// character per line.
|
|
8832
|
-
/* @__PURE__ */ (0,
|
|
8943
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.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" })
|
|
8833
8944
|
) : null })
|
|
8834
8945
|
]
|
|
8835
8946
|
}
|
|
@@ -8844,7 +8955,7 @@ function HierarchyDragHandle({
|
|
|
8844
8955
|
id,
|
|
8845
8956
|
disabled
|
|
8846
8957
|
});
|
|
8847
|
-
return /* @__PURE__ */ (0,
|
|
8958
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8848
8959
|
"button",
|
|
8849
8960
|
{
|
|
8850
8961
|
ref: setNodeRef,
|
|
@@ -8856,7 +8967,7 @@ function HierarchyDragHandle({
|
|
|
8856
8967
|
onClick: (event) => event.stopPropagation(),
|
|
8857
8968
|
...attributes,
|
|
8858
8969
|
...listeners,
|
|
8859
|
-
children: /* @__PURE__ */ (0,
|
|
8970
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(GripVertical, { className: "h-3.5 w-3.5" })
|
|
8860
8971
|
}
|
|
8861
8972
|
);
|
|
8862
8973
|
}
|
|
@@ -8865,7 +8976,7 @@ function HierarchyRootDropTarget({
|
|
|
8865
8976
|
draggedLabel
|
|
8866
8977
|
}) {
|
|
8867
8978
|
const { isOver, setNodeRef } = (0, import_core3.useDroppable)({ id: "__root__" });
|
|
8868
|
-
return /* @__PURE__ */ (0,
|
|
8979
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
8869
8980
|
"div",
|
|
8870
8981
|
{
|
|
8871
8982
|
ref: setNodeRef,
|
|
@@ -8875,8 +8986,8 @@ function HierarchyRootDropTarget({
|
|
|
8875
8986
|
isOver && "border-solid bg-primary/20 shadow-md shadow-primary/25"
|
|
8876
8987
|
),
|
|
8877
8988
|
children: [
|
|
8878
|
-
/* @__PURE__ */ (0,
|
|
8879
|
-
/* @__PURE__ */ (0,
|
|
8989
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "truncate", children: draggedLabel }),
|
|
8990
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "text-primary/75", children: label })
|
|
8880
8991
|
]
|
|
8881
8992
|
}
|
|
8882
8993
|
);
|
|
@@ -8925,7 +9036,7 @@ function HierarchyDragIndicatorLayer({
|
|
|
8925
9036
|
const { preview: preview2 } = indicator;
|
|
8926
9037
|
const indent = indicator.left + 10 + preview2.depth * 12;
|
|
8927
9038
|
if (preview2.position === "inside") {
|
|
8928
|
-
return /* @__PURE__ */ (0,
|
|
9039
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8929
9040
|
"div",
|
|
8930
9041
|
{
|
|
8931
9042
|
"aria-hidden": "true",
|
|
@@ -8937,7 +9048,7 @@ function HierarchyDragIndicatorLayer({
|
|
|
8937
9048
|
width: Math.max(0, indicator.width - 4),
|
|
8938
9049
|
height: indicator.height
|
|
8939
9050
|
},
|
|
8940
|
-
children: /* @__PURE__ */ (0,
|
|
9051
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
8941
9052
|
"span",
|
|
8942
9053
|
{
|
|
8943
9054
|
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",
|
|
@@ -8952,7 +9063,7 @@ function HierarchyDragIndicatorLayer({
|
|
|
8952
9063
|
);
|
|
8953
9064
|
}
|
|
8954
9065
|
const lineTop = preview2.position === "before" ? indicator.top - 1 : indicator.top + indicator.height - 1;
|
|
8955
|
-
return /* @__PURE__ */ (0,
|
|
9066
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8956
9067
|
"div",
|
|
8957
9068
|
{
|
|
8958
9069
|
"aria-hidden": "true",
|
|
@@ -8963,9 +9074,9 @@ function HierarchyDragIndicatorLayer({
|
|
|
8963
9074
|
left: indent,
|
|
8964
9075
|
width: Math.max(0, indicator.left + indicator.width - indent - 8)
|
|
8965
9076
|
},
|
|
8966
|
-
children: /* @__PURE__ */ (0,
|
|
8967
|
-
/* @__PURE__ */ (0,
|
|
8968
|
-
/* @__PURE__ */ (0,
|
|
9077
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "relative h-0.5 rounded-full bg-primary", children: [
|
|
9078
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.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" }),
|
|
9079
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
8969
9080
|
"span",
|
|
8970
9081
|
{
|
|
8971
9082
|
className: cn(
|
|
@@ -9006,7 +9117,7 @@ function ColumnHeaderDropZone({
|
|
|
9006
9117
|
disabled: !enabled,
|
|
9007
9118
|
data: { matrxDragKind: "column-header", columnId: id }
|
|
9008
9119
|
});
|
|
9009
|
-
return /* @__PURE__ */ (0,
|
|
9120
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { ref: setNodeRef, className: "flex min-w-0 items-center", children });
|
|
9010
9121
|
}
|
|
9011
9122
|
function columnWidthVar(width) {
|
|
9012
9123
|
if (width === void 0) return void 0;
|
|
@@ -9022,7 +9133,7 @@ function renderCell(row, col, index) {
|
|
|
9022
9133
|
if (asUuid && typeof raw === "string") {
|
|
9023
9134
|
const forbidden = typeof col.fk?.forbidden === "function" ? col.fk.forbidden(raw, row) : Boolean(col.fk?.forbidden);
|
|
9024
9135
|
const declaredToken = typeof col.fk?.token === "function" ? col.fk.token(row) : col.fk?.token;
|
|
9025
|
-
return /* @__PURE__ */ (0,
|
|
9136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
9026
9137
|
MatrxUuidCell,
|
|
9027
9138
|
{
|
|
9028
9139
|
value: raw,
|
|
@@ -9034,7 +9145,7 @@ function renderCell(row, col, index) {
|
|
|
9034
9145
|
}
|
|
9035
9146
|
);
|
|
9036
9147
|
}
|
|
9037
|
-
return /* @__PURE__ */ (0,
|
|
9148
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "text-sm text-foreground", children: stringifyCellValue(raw) || "\u2014" });
|
|
9038
9149
|
}
|
|
9039
9150
|
function defaultRowTitle(row, columns) {
|
|
9040
9151
|
for (const col of columns) {
|