@ai-matrx/design-system 0.86.361 → 0.86.363
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 +13 -0
- package/dist/carousel.js +5 -5
- package/dist/{chunk-ZU2ZODDD.js → chunk-2QFA6CK4.js} +4 -4
- package/dist/{chunk-UCEKAKHP.js → chunk-3YTF4MH2.js} +2 -2
- package/dist/{chunk-T57DLONB.js → chunk-AKSKVT2M.js} +17 -9
- package/dist/chunk-AKSKVT2M.js.map +1 -0
- package/dist/{chunk-LU75R6YX.js → chunk-KOUHF4JC.js} +2 -2
- package/dist/{chunk-HISATFYI.js → chunk-LS3C7IUV.js} +2 -2
- package/dist/{chunk-QK7GPIEA.js → chunk-QJ6SQNXD.js} +4 -4
- package/dist/{chunk-TSETPQWU.js → chunk-RO5CRIOL.js} +2 -2
- package/dist/{chunk-WHERV3VC.js → chunk-SOCDBDFS.js} +4 -4
- package/dist/{chunk-C5HYUXR2.js → chunk-UGUVTE77.js} +2 -2
- package/dist/{chunk-FF524V6P.js → chunk-VOLSYNJY.js} +3 -3
- package/dist/{chunk-WOA6WHV2.js → chunk-WLKHQGX5.js} +2 -2
- package/dist/{chunk-42GFQMLA.js → chunk-WUI5OFCH.js} +2 -2
- package/dist/clipboard-fallback-dialog.js +2 -2
- package/dist/controls.cjs +16 -8
- package/dist/controls.cjs.map +1 -1
- package/dist/controls.js +5 -5
- package/dist/data-table/data-row-inspector.js +5 -5
- package/dist/data-table/data-row-window.js +6 -6
- package/dist/data-table/index.cjs +859 -772
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.js +542 -461
- package/dist/data-table/index.js.map +1 -1
- package/dist/data-table/pagination.cjs +16 -8
- package/dist/data-table/pagination.cjs.map +1 -1
- package/dist/data-table/pagination.js +3 -3
- package/dist/data-table/uuid-cell.js +3 -3
- package/dist/desktop.cjs +16 -8
- package/dist/desktop.cjs.map +1 -1
- package/dist/desktop.js +5 -5
- package/dist/index.cjs +386 -317
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +34 -2
- package/dist/index.d.ts +34 -2
- package/dist/index.js +242 -193
- package/dist/index.js.map +1 -1
- package/dist/intro-stage.cjs +24 -3
- package/dist/intro-stage.cjs.map +1 -1
- package/dist/intro-stage.d.cts +9 -3
- package/dist/intro-stage.d.ts +9 -3
- package/dist/intro-stage.js +24 -3
- package/dist/intro-stage.js.map +1 -1
- package/dist/item.cjs +16 -8
- package/dist/item.cjs.map +1 -1
- package/dist/item.js +4 -4
- package/dist/lite-table.js +2 -2
- package/dist/menu-look.cjs +16 -8
- package/dist/menu-look.cjs.map +1 -1
- package/dist/menu-look.js +2 -2
- package/dist/record-list.cjs +16 -8
- package/dist/record-list.cjs.map +1 -1
- package/dist/record-list.js +4 -4
- package/dist/settings.js +3 -3
- package/dist/styles.css +31 -0
- package/dist/thumbnail-grid.cjs +27 -1
- package/dist/thumbnail-grid.cjs.map +1 -1
- package/dist/thumbnail-grid.d.cts +16 -2
- package/dist/thumbnail-grid.d.ts +16 -2
- package/dist/thumbnail-grid.js +27 -1
- package/dist/thumbnail-grid.js.map +1 -1
- package/dist/writing-field.cjs +3 -2
- package/dist/writing-field.cjs.map +1 -1
- package/dist/writing-field.js +6 -5
- package/dist/writing-field.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-T57DLONB.js.map +0 -1
- /package/dist/{chunk-ZU2ZODDD.js.map → chunk-2QFA6CK4.js.map} +0 -0
- /package/dist/{chunk-UCEKAKHP.js.map → chunk-3YTF4MH2.js.map} +0 -0
- /package/dist/{chunk-LU75R6YX.js.map → chunk-KOUHF4JC.js.map} +0 -0
- /package/dist/{chunk-HISATFYI.js.map → chunk-LS3C7IUV.js.map} +0 -0
- /package/dist/{chunk-QK7GPIEA.js.map → chunk-QJ6SQNXD.js.map} +0 -0
- /package/dist/{chunk-TSETPQWU.js.map → chunk-RO5CRIOL.js.map} +0 -0
- /package/dist/{chunk-WHERV3VC.js.map → chunk-SOCDBDFS.js.map} +0 -0
- /package/dist/{chunk-C5HYUXR2.js.map → chunk-UGUVTE77.js.map} +0 -0
- /package/dist/{chunk-FF524V6P.js.map → chunk-VOLSYNJY.js.map} +0 -0
- /package/dist/{chunk-WOA6WHV2.js.map → chunk-WLKHQGX5.js.map} +0 -0
- /package/dist/{chunk-42GFQMLA.js.map → chunk-WUI5OFCH.js.map} +0 -0
|
@@ -1118,14 +1118,18 @@ var DropdownMenuSubTrigger = React6.forwardRef(({ className, inset, children, ..
|
|
|
1118
1118
|
}
|
|
1119
1119
|
));
|
|
1120
1120
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
1121
|
-
var DropdownMenuSubContent = React6.forwardRef(({
|
|
1121
|
+
var DropdownMenuSubContent = React6.forwardRef(({ container, ...props }, ref) => {
|
|
1122
1122
|
const portalContainer = usePortalContainer(container);
|
|
1123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DropdownMenuPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(OpenDropdownMenuSubContent, { ref, ...props }) });
|
|
1124
|
+
});
|
|
1125
|
+
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
1126
|
+
var OpenDropdownMenuSubContent = React6.forwardRef(({ className, surface = "default", sideOffset = 2, alignOffset = -4, collisionPadding, onFocusOutside, children, ...props }, ref) => {
|
|
1123
1127
|
const [bottomClearance] = React6.useState(sharedBottomClearance);
|
|
1124
1128
|
const padding = menuCollisionPadding(collisionPadding ?? 8, 0, bottomClearance);
|
|
1125
1129
|
const nested = useNestedSubmenuPlacement(ref, padding);
|
|
1126
1130
|
const keep = useSubmenuSurvivesParentPanelFocus(nested.ref, onFocusOutside);
|
|
1127
1131
|
const edges = useMenuScrollEdges(keep.ref);
|
|
1128
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1132
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1129
1133
|
DropdownMenuPrimitive.SubContent,
|
|
1130
1134
|
{
|
|
1131
1135
|
ref: edges.ref,
|
|
@@ -1139,9 +1143,9 @@ var DropdownMenuSubContent = React6.forwardRef(({ className, container, surface
|
|
|
1139
1143
|
...props,
|
|
1140
1144
|
children: nested.wrap(edges.wrap(children))
|
|
1141
1145
|
}
|
|
1142
|
-
)
|
|
1146
|
+
);
|
|
1143
1147
|
});
|
|
1144
|
-
|
|
1148
|
+
OpenDropdownMenuSubContent.displayName = "OpenDropdownMenuSubContent";
|
|
1145
1149
|
function menuCollisionPadding(caller, top, bottom, fallback = 0) {
|
|
1146
1150
|
const side = (key) => typeof caller === "number" ? caller : caller?.[key] ?? fallback;
|
|
1147
1151
|
return { top: Math.max(side("top"), top), right: side("right"), bottom: Math.max(side("bottom"), bottom), left: side("left") };
|
|
@@ -1170,12 +1174,16 @@ function measureClearance(height) {
|
|
|
1170
1174
|
probe2.remove();
|
|
1171
1175
|
return Number.isFinite(px2) ? Math.ceil(px2) : 0;
|
|
1172
1176
|
}
|
|
1173
|
-
var DropdownMenuContent = React6.forwardRef(({
|
|
1177
|
+
var DropdownMenuContent = React6.forwardRef(({ container, ...props }, ref) => {
|
|
1174
1178
|
const portalContainer = usePortalContainer(container);
|
|
1179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DropdownMenuPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(OpenDropdownMenuContent, { ref, ...props }) });
|
|
1180
|
+
});
|
|
1181
|
+
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
1182
|
+
var OpenDropdownMenuContent = React6.forwardRef(({ className, sideOffset = 4, surface = "default", children, onCloseAutoFocus, collisionPadding, ...props }, ref) => {
|
|
1175
1183
|
const [topClearance] = React6.useState(sharedTopClearance);
|
|
1176
1184
|
const [bottomClearance] = React6.useState(sharedBottomClearance);
|
|
1177
1185
|
const edges = useMenuScrollEdges(ref);
|
|
1178
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1186
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1179
1187
|
DropdownMenuPrimitive.Content,
|
|
1180
1188
|
{
|
|
1181
1189
|
ref: edges.ref,
|
|
@@ -1195,9 +1203,9 @@ var DropdownMenuContent = React6.forwardRef(({ className, sideOffset = 4, contai
|
|
|
1195
1203
|
onCloseAutoFocus: keepMovedFocus(onCloseAutoFocus),
|
|
1196
1204
|
children: edges.wrap(children)
|
|
1197
1205
|
}
|
|
1198
|
-
)
|
|
1206
|
+
);
|
|
1199
1207
|
});
|
|
1200
|
-
|
|
1208
|
+
OpenDropdownMenuContent.displayName = "OpenDropdownMenuContent";
|
|
1201
1209
|
var DropdownMenuItem = React6.forwardRef(({ className, inset, tone, size, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1202
1210
|
DropdownMenuPrimitive.Item,
|
|
1203
1211
|
{
|
|
@@ -3832,7 +3840,7 @@ function DragCursorMonitor({
|
|
|
3832
3840
|
}
|
|
3833
3841
|
|
|
3834
3842
|
// src/data-table/MatrxDataTable.tsx
|
|
3835
|
-
var
|
|
3843
|
+
var import_react47 = require("react");
|
|
3836
3844
|
var import_react_dom2 = require("react-dom");
|
|
3837
3845
|
var import_text_case2 = require("@ai-matrx/kit/text-case");
|
|
3838
3846
|
|
|
@@ -20358,8 +20366,85 @@ var MAC_ROW_HEIGHT_BY_DENSITY = {
|
|
|
20358
20366
|
spacious: MAC_TABLE_SIZE.rowLarge
|
|
20359
20367
|
};
|
|
20360
20368
|
|
|
20361
|
-
// src/data-table/
|
|
20369
|
+
// src/data-table/MultilineRowMarker.tsx
|
|
20370
|
+
var import_react46 = require("react");
|
|
20371
|
+
|
|
20372
|
+
// src/data-table/multiline-rows.ts
|
|
20373
|
+
var import_react45 = require("react");
|
|
20374
|
+
var MULTI = "multi";
|
|
20375
|
+
function cellTextIsMultiline(cell) {
|
|
20376
|
+
const lineHeight = Number.parseFloat(getComputedStyle(cell).lineHeight);
|
|
20377
|
+
const minStep = Number.isFinite(lineHeight) ? lineHeight * 0.75 : 10;
|
|
20378
|
+
const walker = cell.ownerDocument.createTreeWalker(cell, NodeFilter.SHOW_TEXT);
|
|
20379
|
+
const range = cell.ownerDocument.createRange();
|
|
20380
|
+
if (typeof range.getClientRects !== "function") return false;
|
|
20381
|
+
let firstTop = null;
|
|
20382
|
+
for (let node = walker.nextNode(); node; node = walker.nextNode()) {
|
|
20383
|
+
if (!node.textContent?.trim()) continue;
|
|
20384
|
+
range.selectNodeContents(node);
|
|
20385
|
+
for (const rect of Array.from(range.getClientRects())) {
|
|
20386
|
+
if (rect.width === 0 || rect.height === 0) continue;
|
|
20387
|
+
if (firstTop === null) firstTop = rect.top;
|
|
20388
|
+
else if (Math.abs(rect.top - firstTop) >= minStep) return true;
|
|
20389
|
+
}
|
|
20390
|
+
}
|
|
20391
|
+
return false;
|
|
20392
|
+
}
|
|
20393
|
+
function markRows(root) {
|
|
20394
|
+
for (const row of Array.from(root.querySelectorAll("tbody > tr[data-row-id]"))) {
|
|
20395
|
+
let multi = false;
|
|
20396
|
+
for (const cell of Array.from(row.querySelectorAll("[data-matrx-cell-content]"))) {
|
|
20397
|
+
if (cellTextIsMultiline(cell)) {
|
|
20398
|
+
multi = true;
|
|
20399
|
+
break;
|
|
20400
|
+
}
|
|
20401
|
+
}
|
|
20402
|
+
if (multi) {
|
|
20403
|
+
if (row.getAttribute("data-matrx-row-lines") !== MULTI) row.setAttribute("data-matrx-row-lines", MULTI);
|
|
20404
|
+
} else if (row.hasAttribute("data-matrx-row-lines")) {
|
|
20405
|
+
row.removeAttribute("data-matrx-row-lines");
|
|
20406
|
+
}
|
|
20407
|
+
}
|
|
20408
|
+
}
|
|
20409
|
+
function useMultilineRowMarker(anchorRef) {
|
|
20410
|
+
(0, import_react45.useEffect)(() => {
|
|
20411
|
+
const root = anchorRef.current?.closest("[data-matrx-table]");
|
|
20412
|
+
if (!root || typeof ResizeObserver === "undefined" || typeof MutationObserver === "undefined") return;
|
|
20413
|
+
let pending = false;
|
|
20414
|
+
const run = () => {
|
|
20415
|
+
pending = false;
|
|
20416
|
+
if (root.isConnected) markRows(root);
|
|
20417
|
+
};
|
|
20418
|
+
const schedule = () => {
|
|
20419
|
+
if (pending) return;
|
|
20420
|
+
pending = true;
|
|
20421
|
+
setTimeout(run, 0);
|
|
20422
|
+
};
|
|
20423
|
+
schedule();
|
|
20424
|
+
const mutations = new MutationObserver(schedule);
|
|
20425
|
+
mutations.observe(root, { childList: true, subtree: true, characterData: true });
|
|
20426
|
+
const sizes = new ResizeObserver(schedule);
|
|
20427
|
+
sizes.observe(root);
|
|
20428
|
+
document.addEventListener("visibilitychange", schedule);
|
|
20429
|
+
return () => {
|
|
20430
|
+
pending = true;
|
|
20431
|
+
mutations.disconnect();
|
|
20432
|
+
sizes.disconnect();
|
|
20433
|
+
document.removeEventListener("visibilitychange", schedule);
|
|
20434
|
+
};
|
|
20435
|
+
}, [anchorRef]);
|
|
20436
|
+
}
|
|
20437
|
+
|
|
20438
|
+
// src/data-table/MultilineRowMarker.tsx
|
|
20362
20439
|
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
20440
|
+
function MultilineRowMarker() {
|
|
20441
|
+
const anchorRef = (0, import_react46.useRef)(null);
|
|
20442
|
+
useMultilineRowMarker(anchorRef);
|
|
20443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { ref: anchorRef, hidden: true, "aria-hidden": true, "data-matrx-multiline-row-marker": "" });
|
|
20444
|
+
}
|
|
20445
|
+
|
|
20446
|
+
// src/data-table/MatrxDataTable.tsx
|
|
20447
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
20363
20448
|
var EMPTY_TABLE_ROWS = [];
|
|
20364
20449
|
function TableToolbarAction({
|
|
20365
20450
|
HostAction,
|
|
@@ -20372,7 +20457,7 @@ function TableToolbarAction({
|
|
|
20372
20457
|
}) {
|
|
20373
20458
|
const listed = useToolbarListed();
|
|
20374
20459
|
if (listed) {
|
|
20375
|
-
return /* @__PURE__ */ (0,
|
|
20460
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { "data-matrx-table-toolbar-action": true, className: "inline-flex", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
20376
20461
|
Button,
|
|
20377
20462
|
{
|
|
20378
20463
|
type: "button",
|
|
@@ -20385,17 +20470,17 @@ function TableToolbarAction({
|
|
|
20385
20470
|
disabled,
|
|
20386
20471
|
onClick,
|
|
20387
20472
|
children: [
|
|
20388
|
-
(0,
|
|
20389
|
-
/* @__PURE__ */ (0,
|
|
20473
|
+
(0, import_react47.isValidElement)(children) ? (0, import_react47.cloneElement)(children, { className: cn("h-4 w-4", children.props.className) }) : children,
|
|
20474
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { children: ariaLabel })
|
|
20390
20475
|
]
|
|
20391
20476
|
}
|
|
20392
20477
|
) });
|
|
20393
20478
|
}
|
|
20394
20479
|
if (HostAction) {
|
|
20395
|
-
return /* @__PURE__ */ (0,
|
|
20480
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { "data-matrx-table-toolbar-action": true, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(HostAction, { ariaLabel, tooltip, disabled, busy, onClick, children }) });
|
|
20396
20481
|
}
|
|
20397
|
-
return /* @__PURE__ */ (0,
|
|
20398
|
-
/* @__PURE__ */ (0,
|
|
20482
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Tooltip, { children: [
|
|
20483
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { "data-matrx-table-toolbar-action": true, className: "inline-flex", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
20399
20484
|
Button2,
|
|
20400
20485
|
{
|
|
20401
20486
|
variant: "quiet",
|
|
@@ -20407,7 +20492,7 @@ function TableToolbarAction({
|
|
|
20407
20492
|
icon: children
|
|
20408
20493
|
}
|
|
20409
20494
|
) }) }),
|
|
20410
|
-
/* @__PURE__ */ (0,
|
|
20495
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TooltipContent, { children: tooltip ?? ariaLabel })
|
|
20411
20496
|
] });
|
|
20412
20497
|
}
|
|
20413
20498
|
function customActionsHeaderNeed(header) {
|
|
@@ -20432,7 +20517,7 @@ function TableRowCopyControl({
|
|
|
20432
20517
|
sourceId,
|
|
20433
20518
|
defaultColumns
|
|
20434
20519
|
}) {
|
|
20435
|
-
return /* @__PURE__ */ (0,
|
|
20520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(DeferredCopyButtons, { size, ...tableRowCopyProps(copy, row, sourceId, defaultColumns) });
|
|
20436
20521
|
}
|
|
20437
20522
|
function tableRowCopyProps(copy, row, sourceId, defaultColumns) {
|
|
20438
20523
|
const aiVariants = copy.rowAiVariants?.(row);
|
|
@@ -20479,10 +20564,10 @@ function freeUrlTableId(base) {
|
|
|
20479
20564
|
}
|
|
20480
20565
|
}
|
|
20481
20566
|
function useDefaultUrlTableId(base, auto) {
|
|
20482
|
-
const [claimed, setClaimed] = (0,
|
|
20567
|
+
const [claimed, setClaimed] = (0, import_react47.useState)(null);
|
|
20483
20568
|
const held = claimed && claimed.base === base ? claimed.id : null;
|
|
20484
20569
|
const candidate = !auto || !base ? base : held ?? freeUrlTableId(base);
|
|
20485
|
-
(0,
|
|
20570
|
+
(0, import_react47.useLayoutEffect)(() => {
|
|
20486
20571
|
if (!auto || !base || !candidate) return;
|
|
20487
20572
|
const id = urlTableIdHeld(candidate) ? freeUrlTableId(base) : candidate;
|
|
20488
20573
|
if (id !== base) {
|
|
@@ -20496,7 +20581,7 @@ function useDefaultUrlTableId(base, auto) {
|
|
|
20496
20581
|
}, [base, auto]);
|
|
20497
20582
|
return candidate;
|
|
20498
20583
|
}
|
|
20499
|
-
var InsideMatrxDataTableContext = (0,
|
|
20584
|
+
var InsideMatrxDataTableContext = (0, import_react47.createContext)(false);
|
|
20500
20585
|
function gridCardsAcross(el) {
|
|
20501
20586
|
return Math.max(1, Math.floor(((el?.clientWidth ?? 0) - 8 + 12) / (160 + 12)));
|
|
20502
20587
|
}
|
|
@@ -20573,7 +20658,7 @@ function clearHeadersUnderScrollControls(el, hints) {
|
|
|
20573
20658
|
}
|
|
20574
20659
|
}
|
|
20575
20660
|
function MatrxDataTable(suppliedProps) {
|
|
20576
|
-
const nestedInTable = (0,
|
|
20661
|
+
const nestedInTable = (0, import_react47.useContext)(InsideMatrxDataTableContext);
|
|
20577
20662
|
const card = useMatrxTableCard();
|
|
20578
20663
|
const lookHost = useMatrxDataTableHost();
|
|
20579
20664
|
const lookedProps = suppliedProps.look === void 0 && lookHost.defaultLook !== void 0 ? { ...suppliedProps, look: lookHost.defaultLook } : suppliedProps;
|
|
@@ -20618,7 +20703,7 @@ function MatrxDataTable(suppliedProps) {
|
|
|
20618
20703
|
const sourceRows = props.query?.mode === "controlled-append" ? props.query.pagination.rows : props.data;
|
|
20619
20704
|
const availableRows = sourceRows ?? EMPTY_TABLE_ROWS;
|
|
20620
20705
|
const selectionTableId = props.tableId ?? (props.urlState || void 0)?.id;
|
|
20621
|
-
const [defaultSelectionState, setDefaultSelectionState] = (0,
|
|
20706
|
+
const [defaultSelectionState, setDefaultSelectionState] = (0, import_react47.useState)({
|
|
20622
20707
|
tableId: selectionTableId,
|
|
20623
20708
|
selectedIds: []
|
|
20624
20709
|
});
|
|
@@ -20642,7 +20727,7 @@ function MatrxDataTable(suppliedProps) {
|
|
|
20642
20727
|
resolvedUrlState?.auto ? resolvedUrlState.config.id : null,
|
|
20643
20728
|
Boolean(resolvedUrlState?.auto)
|
|
20644
20729
|
);
|
|
20645
|
-
return /* @__PURE__ */ (0,
|
|
20730
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(MacLookContext.Provider, { value: props.look === "mac" ? props.density ?? lookHost.defaultDensity ?? "normal" : null, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(MacLookLayer, { density: props.look === "mac" ? props.density ?? lookHost.defaultDensity ?? "normal" : null, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(InsideMatrxDataTableContext.Provider, { value: true, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(MatrxTableCardContext.Provider, { value: null, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TableCardOwnerContext.Provider, { value: card, children: resolvedUrlState ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
20646
20731
|
MatrxDataTableWithUrlState,
|
|
20647
20732
|
{
|
|
20648
20733
|
...presentedProps,
|
|
@@ -20650,7 +20735,7 @@ function MatrxDataTable(suppliedProps) {
|
|
|
20650
20735
|
autoUrlState: resolvedUrlState.auto
|
|
20651
20736
|
},
|
|
20652
20737
|
resolvedUrlState.auto ? defaultUrlId ?? resolvedUrlState.config.id : resolvedUrlState.config.id
|
|
20653
|
-
) : /* @__PURE__ */ (0,
|
|
20738
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(MatrxDataTableCore, { ...presentedProps, urlState: false }) }) }) }) }) });
|
|
20654
20739
|
}
|
|
20655
20740
|
var NO_CUSTOM_FIELD_COLUMNS = [];
|
|
20656
20741
|
function noCustomFieldColumns() {
|
|
@@ -20668,7 +20753,7 @@ function useHostCustomFieldColumns(token, rows) {
|
|
|
20668
20753
|
const host = useMatrxDataTableHost();
|
|
20669
20754
|
const useColumns = host.useCustomFieldColumns ?? noCustomFieldColumns;
|
|
20670
20755
|
const orgKey = token ? rowOrganizationIds(rows).join(",") : "";
|
|
20671
|
-
const organizationIds = (0,
|
|
20756
|
+
const organizationIds = (0, import_react47.useMemo)(() => orgKey ? orgKey.split(",") : [], [orgKey]);
|
|
20672
20757
|
const answer = useColumns(token, organizationIds);
|
|
20673
20758
|
return answer?.columns ?? NO_CUSTOM_FIELD_COLUMNS;
|
|
20674
20759
|
}
|
|
@@ -20706,7 +20791,7 @@ function listPresentationProps(props) {
|
|
|
20706
20791
|
...props.focusRowId === void 0 && props.activeRowId ? { focusRowId: props.activeRowId } : {},
|
|
20707
20792
|
mobileCardsBreakpoint: "always",
|
|
20708
20793
|
cardsLayout: "list",
|
|
20709
|
-
mobileCards: props.mobileCards ?? ((row, _index, controls) => /* @__PURE__ */ (0,
|
|
20794
|
+
mobileCards: props.mobileCards ?? ((row, _index, controls) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
20710
20795
|
TableListItem,
|
|
20711
20796
|
{
|
|
20712
20797
|
title: titleOf(row),
|
|
@@ -20744,8 +20829,8 @@ function MatrxDataTableWithUrlState({
|
|
|
20744
20829
|
const seedSearch = props.initialSearch ?? "";
|
|
20745
20830
|
const seedFilters = props.initialColumnFilters;
|
|
20746
20831
|
const hasSeedFilters = Boolean(seedFilters && Object.keys(seedFilters).length > 0);
|
|
20747
|
-
const [seeded, setSeeded] = (0,
|
|
20748
|
-
(0,
|
|
20832
|
+
const [seeded, setSeeded] = (0, import_react47.useState)(!seedSearch && !hasSeedFilters);
|
|
20833
|
+
(0, import_react47.useEffect)(() => {
|
|
20749
20834
|
if (seeded) return;
|
|
20750
20835
|
const params = new URLSearchParams(window.location.search);
|
|
20751
20836
|
const patch = {};
|
|
@@ -20758,7 +20843,7 @@ function MatrxDataTableWithUrlState({
|
|
|
20758
20843
|
if (Object.keys(patch).length > 0) (0, import_url_state5.commitUrlParams)(patch, "replace");
|
|
20759
20844
|
setSeeded(true);
|
|
20760
20845
|
}, []);
|
|
20761
|
-
const seededState = (0,
|
|
20846
|
+
const seededState = (0, import_react47.useMemo)(
|
|
20762
20847
|
() => seeded ? table.state : {
|
|
20763
20848
|
...table.state,
|
|
20764
20849
|
search: table.state.search || seedSearch,
|
|
@@ -20766,7 +20851,7 @@ function MatrxDataTableWithUrlState({
|
|
|
20766
20851
|
},
|
|
20767
20852
|
[seeded, table.state, seedSearch, seedFilters, hasSeedFilters]
|
|
20768
20853
|
);
|
|
20769
|
-
(0,
|
|
20854
|
+
(0, import_react47.useEffect)(() => {
|
|
20770
20855
|
const id = urlState.id;
|
|
20771
20856
|
if (!autoUrlState) {
|
|
20772
20857
|
if (urlTableIdHeld(id)) {
|
|
@@ -20817,8 +20902,8 @@ function MatrxDataTableWithUrlState({
|
|
|
20817
20902
|
}
|
|
20818
20903
|
} : props.selection;
|
|
20819
20904
|
const viewSearch = (0, import_url_state5.useUrlSearchParams)().toString();
|
|
20820
|
-
const carryView = (0,
|
|
20821
|
-
return /* @__PURE__ */ (0,
|
|
20905
|
+
const carryView = (0, import_react47.useCallback)((href) => carryTableViewParams(href, viewSearch, urlState.id), [viewSearch, urlState.id]);
|
|
20906
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TableViewHrefContext.Provider, { value: carryView, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
20822
20907
|
MatrxDataTableCore,
|
|
20823
20908
|
{
|
|
20824
20909
|
...props,
|
|
@@ -20882,7 +20967,7 @@ function opensRowHref(event) {
|
|
|
20882
20967
|
return event.metaKey || event.ctrlKey || event.shiftKey || event.button === 1;
|
|
20883
20968
|
}
|
|
20884
20969
|
function TableContextPassthrough({ children }) {
|
|
20885
|
-
return /* @__PURE__ */ (0,
|
|
20970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_jsx_runtime69.Fragment, { children });
|
|
20886
20971
|
}
|
|
20887
20972
|
function sameWindow(a, b) {
|
|
20888
20973
|
if (a === null || b === null) return a === b;
|
|
@@ -20898,7 +20983,7 @@ var DND_MEASURING = { droppable: { strategy: import_core4.MeasuringStrategy.Alwa
|
|
|
20898
20983
|
var NO_LAYERED_FILTERS = [];
|
|
20899
20984
|
var NO_GROUPING_VALUE = "__matrx_no_grouping__";
|
|
20900
20985
|
function useRenderEpoch(values) {
|
|
20901
|
-
const held = (0,
|
|
20986
|
+
const held = (0, import_react47.useRef)(null);
|
|
20902
20987
|
const previous = held.current;
|
|
20903
20988
|
if (previous !== null && previous.values.length === values.length && previous.values.every((value, i) => Object.is(value, values[i]))) {
|
|
20904
20989
|
return previous.epoch;
|
|
@@ -20940,15 +21025,15 @@ function versionFacts(version) {
|
|
|
20940
21025
|
function sameBodyRow(a, b) {
|
|
20941
21026
|
return a.row === b.row && a.index === b.index && a.epoch === b.epoch && a.probe === b.probe && a.rowId === b.rowId && a.facts.length === b.facts.length && a.facts.every((fact, i) => Object.is(fact, b.facts[i]));
|
|
20942
21027
|
}
|
|
20943
|
-
var MatrxTableBodyRow = (0,
|
|
21028
|
+
var MatrxTableBodyRow = (0, import_react47.memo)(function MatrxTableBodyRow2(props) {
|
|
20944
21029
|
const { rowId, row, index, draw } = props;
|
|
20945
|
-
const last = (0,
|
|
21030
|
+
const last = (0, import_react47.useRef)(null);
|
|
20946
21031
|
const fresh = last.current === null || !sameBodyRow({ ...last.current, probe: props.probe }, props);
|
|
20947
21032
|
last.current = props;
|
|
20948
21033
|
return draw(rowId, row, index, fresh);
|
|
20949
21034
|
}, sameBodyRow);
|
|
20950
|
-
var MatrxTableChrome = (0,
|
|
20951
|
-
return /* @__PURE__ */ (0,
|
|
21035
|
+
var MatrxTableChrome = (0, import_react47.memo)(function MatrxTableChrome2({ render }) {
|
|
21036
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_jsx_runtime69.Fragment, { children: render() });
|
|
20952
21037
|
}, (a, b) => a.part === b.part && a.epoch === b.epoch);
|
|
20953
21038
|
function columnsSignature(columns) {
|
|
20954
21039
|
const out = [];
|
|
@@ -21067,10 +21152,10 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21067
21152
|
appearance = "standalone"
|
|
21068
21153
|
} = coreProps;
|
|
21069
21154
|
const macPortalAttrs = useMacLookAttributes();
|
|
21070
|
-
const wearMacLook = (node) => macPortalAttrs["data-matrx-table-look"] ? /* @__PURE__ */ (0,
|
|
21155
|
+
const wearMacLook = (node) => macPortalAttrs["data-matrx-table-look"] ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "contents", ...macPortalAttrs, children: node }) : node;
|
|
21071
21156
|
const urlState = suppliedUrlState || void 0;
|
|
21072
21157
|
const drill = isAnsweredDrillConfig(suppliedDrill) ? suppliedDrill : void 0;
|
|
21073
|
-
const labelForField = (0,
|
|
21158
|
+
const labelForField = (0, import_react47.useCallback)(
|
|
21074
21159
|
(key) => {
|
|
21075
21160
|
const column = suppliedColumns.find((c) => c.accessorKey === key || c.id === key);
|
|
21076
21161
|
if (!column) return void 0;
|
|
@@ -21078,7 +21163,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21078
21163
|
},
|
|
21079
21164
|
[suppliedColumns]
|
|
21080
21165
|
);
|
|
21081
|
-
const columns = (0,
|
|
21166
|
+
const columns = (0, import_react47.useMemo)(() => suppliedColumns.filter((column) => !("customActions" in column) || column.customActions !== void 0).map((column) => {
|
|
21082
21167
|
if (!column.customActions) return column;
|
|
21083
21168
|
const {
|
|
21084
21169
|
accessorKey: _key,
|
|
@@ -21101,13 +21186,13 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21101
21186
|
}), [suppliedColumns]);
|
|
21102
21187
|
const compact = appearance === "compact";
|
|
21103
21188
|
const embedded = appearance === "embedded" || compact;
|
|
21104
|
-
const [compactToolbarSlot, setCompactToolbarSlot] = (0,
|
|
21189
|
+
const [compactToolbarSlot, setCompactToolbarSlot] = (0, import_react47.useState)(null);
|
|
21105
21190
|
const zebra = suppliedZebra ?? !embedded;
|
|
21106
|
-
const tableCard = (0,
|
|
21191
|
+
const tableCard = (0, import_react47.useContext)(TableCardOwnerContext);
|
|
21107
21192
|
const selectionConfig = suppliedSelectionConfig === false ? void 0 : suppliedSelectionConfig;
|
|
21108
21193
|
const appendQuery = query?.mode === "controlled-append" ? query : null;
|
|
21109
21194
|
const appendQueryKey = appendQuery?.pagination.queryKey ?? null;
|
|
21110
|
-
const committedAppendQueryKey = (0,
|
|
21195
|
+
const committedAppendQueryKey = (0, import_react47.useRef)(appendQueryKey);
|
|
21111
21196
|
const appendSourceChanged = appendQuery !== null && committedAppendQueryKey.current !== appendQueryKey;
|
|
21112
21197
|
const data = (appendQuery ? appendQuery.pagination.rows : suppliedData) ?? EMPTY_TABLE_ROWS;
|
|
21113
21198
|
const appendFirstPagePending = appendQuery !== null && data.length === 0 && appendQuery.pagination.hasNextPage && !appendQuery.pagination.error;
|
|
@@ -21116,14 +21201,14 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21116
21201
|
const frameHeight = isLoading && loadingRows === "fill" ? "fill" : askedFrameHeight;
|
|
21117
21202
|
const skeletonRowCount = loadingRows === "fill" ? 40 : Math.max(1, Math.min(100, Math.round(loadingRows ?? (defaultPageSize > 0 ? defaultPageSize : 6))));
|
|
21118
21203
|
const isFetching = appendQuery ? appendQuery.pagination.isFetchingNextPage : suppliedFetching;
|
|
21119
|
-
const everLoadingRef = (0,
|
|
21204
|
+
const everLoadingRef = (0, import_react47.useRef)(false);
|
|
21120
21205
|
if (isLoading) everLoadingRef.current = true;
|
|
21121
21206
|
const everLoading = everLoadingRef.current;
|
|
21122
21207
|
const host = useMatrxDataTableHost();
|
|
21123
|
-
const carryTableView = (0,
|
|
21208
|
+
const carryTableView = (0, import_react47.useContext)(TableViewHrefContext);
|
|
21124
21209
|
const ReadFailureView = host.ReadFailure ?? DefaultTableReadFailure;
|
|
21125
21210
|
const StaleNoticeView = host.StaleNotice ?? DefaultTableStaleNotice;
|
|
21126
|
-
const readFailure = readView.failure ? /* @__PURE__ */ (0,
|
|
21211
|
+
const readFailure = readView.failure ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ReadFailureView, { error: read?.error ?? true, what: readView.what, onRetry: read?.onRetry }) : null;
|
|
21127
21212
|
const ContextMenuBoundary = host.ContextMenuBoundary ?? TableContextPassthrough;
|
|
21128
21213
|
const resolvedDensity = density ?? host.defaultDensity ?? "normal";
|
|
21129
21214
|
const explicitRowHeight = askedRowHeight ?? (look === "mac" ? MAC_ROW_HEIGHT_BY_DENSITY[resolvedDensity] : void 0);
|
|
@@ -21133,17 +21218,17 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21133
21218
|
const Link = host.Link ?? DefaultTableLink;
|
|
21134
21219
|
const SidePanelSurface = host.SidePanelSurface ?? DefaultTableSidePanel;
|
|
21135
21220
|
const { notify: toast, notice } = useTableNotice();
|
|
21136
|
-
const [savedViewError, setSavedViewError] = (0,
|
|
21137
|
-
const [toolbarActionError, setToolbarActionError] = (0,
|
|
21138
|
-
const [toolbarActionPending, setToolbarActionPending] = (0,
|
|
21139
|
-
const toolbarActionPendingRef = (0,
|
|
21221
|
+
const [savedViewError, setSavedViewError] = (0, import_react47.useState)(null);
|
|
21222
|
+
const [toolbarActionError, setToolbarActionError] = (0, import_react47.useState)(null);
|
|
21223
|
+
const [toolbarActionPending, setToolbarActionPending] = (0, import_react47.useState)({ refresh: false, add: false });
|
|
21224
|
+
const toolbarActionPendingRef = (0, import_react47.useRef)({ refresh: false, add: false });
|
|
21140
21225
|
const CHECKBOX_TAP_AREA = "h-4 w-4 touch-manipulation";
|
|
21141
21226
|
const mobileCardsClass = mobileCardsBreakpoint === "always" ? "" : mobileCardsBreakpoint === "lg" ? "lg:hidden" : mobileCardsBreakpoint === "md" ? "md:hidden" : "sm:hidden";
|
|
21142
21227
|
const tableWithCardsClass = mobileCardsBreakpoint === "always" ? "hidden" : mobileCardsBreakpoint === "lg" ? "max-lg:hidden" : mobileCardsBreakpoint === "md" ? "max-md:hidden" : "max-sm:hidden";
|
|
21143
21228
|
const cardsQuery = mobileCardsBreakpoint === "always" ? "all" : mobileCardsBreakpoint === "lg" ? "(max-width: 1023px)" : mobileCardsBreakpoint === "md" ? "(max-width: 767px)" : "(max-width: 639px)";
|
|
21144
|
-
const [cardsActive, setCardsActive] = (0,
|
|
21145
|
-
const [touchSelection, setTouchSelection] = (0,
|
|
21146
|
-
(0,
|
|
21229
|
+
const [cardsActive, setCardsActive] = (0, import_react47.useState)(null);
|
|
21230
|
+
const [touchSelection, setTouchSelection] = (0, import_react47.useState)(false);
|
|
21231
|
+
(0, import_react47.useLayoutEffect)(() => {
|
|
21147
21232
|
if (typeof window === "undefined" || !window.matchMedia) return;
|
|
21148
21233
|
const media = window.matchMedia("(pointer: coarse), (max-width: 639px)");
|
|
21149
21234
|
const read2 = () => setTouchSelection(media.matches);
|
|
@@ -21152,7 +21237,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21152
21237
|
return () => media.removeEventListener?.("change", read2);
|
|
21153
21238
|
}, []);
|
|
21154
21239
|
const canonicalSelectionWidth = touchSelection ? 44 : SELECTION_COLUMN_PX;
|
|
21155
|
-
(0,
|
|
21240
|
+
(0, import_react47.useEffect)(() => {
|
|
21156
21241
|
if (!mobileCards || typeof window === "undefined" || !window.matchMedia) return;
|
|
21157
21242
|
const mql = window.matchMedia(cardsQuery);
|
|
21158
21243
|
const read2 = () => setCardsActive(mql.matches);
|
|
@@ -21163,7 +21248,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21163
21248
|
const inactiveProps = (active) => cardsActive === null || active ? {} : { inert: true, "aria-hidden": true };
|
|
21164
21249
|
const controlledQuery = query?.mode === "controlled" || query?.mode === "controlled-local" || query?.mode === "controlled-append" ? query : null;
|
|
21165
21250
|
const remoteQuery = query?.mode === "controlled" || query?.mode === "controlled-append" ? query : null;
|
|
21166
|
-
const [mountedControlledState] = (0,
|
|
21251
|
+
const [mountedControlledState] = (0, import_react47.useState)(() => controlledQuery?.state ?? null);
|
|
21167
21252
|
const sourceProcessing = query?.mode === "controlled" || query?.mode === "controlled-local" ? query.sourceProcessing : appendQuery?.sourceProcessing;
|
|
21168
21253
|
const appendUsesLocalProcessing = appendQuery !== null && sourceProcessing !== void 0;
|
|
21169
21254
|
const appendDefaultsToSourceProcessing = appendQuery !== null && sourceProcessing === void 0;
|
|
@@ -21174,7 +21259,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21174
21259
|
const sourceOwnsIntelligentSearch = sourceProcessing?.intelligentSearch === "source";
|
|
21175
21260
|
const sourceOwnsSearch = remoteQuery?.mode === "controlled" && sourceProcessing?.search !== "local" || appendQuery !== null && sourceProcessing === void 0 || sourceProcessing?.search === "source" || sourceOwnsIntelligentSearch;
|
|
21176
21261
|
const intelligentSearchEnabled = toolbar?.intelligentSearch !== void 0 && (sourceOwnsIntelligentSearch || remoteQuery === null && !sourceOwnsSearch);
|
|
21177
|
-
const emitControlledQueryChange = (0,
|
|
21262
|
+
const emitControlledQueryChange = (0, import_react47.useCallback)(
|
|
21178
21263
|
(patch, options) => {
|
|
21179
21264
|
if (!controlledQuery) return;
|
|
21180
21265
|
controlledQuery.onStateChange(
|
|
@@ -21183,8 +21268,8 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21183
21268
|
},
|
|
21184
21269
|
[controlledQuery]
|
|
21185
21270
|
);
|
|
21186
|
-
const [internalSearch, setInternalSearch] = (0,
|
|
21187
|
-
const [draggedRowId, setDraggedRowId] = (0,
|
|
21271
|
+
const [internalSearch, setInternalSearch] = (0, import_react47.useState)(initialSearch ?? "");
|
|
21272
|
+
const [draggedRowId, setDraggedRowId] = (0, import_react47.useState)(null);
|
|
21188
21273
|
const hierarchySensors = (0, import_core4.useSensors)((0, import_core4.useSensor)(import_core4.PointerSensor, POINTER_SENSOR_OPTIONS));
|
|
21189
21274
|
const toolbarSearchControlled = toolbar?.searchValue !== void 0;
|
|
21190
21275
|
const searchValue = controlledQuery ? controlledQuery.state.search : toolbarSearchControlled ? toolbar?.searchValue ?? "" : internalSearch;
|
|
@@ -21196,7 +21281,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21196
21281
|
}
|
|
21197
21282
|
toolbar?.onSearchChange?.(v);
|
|
21198
21283
|
};
|
|
21199
|
-
const [internalSearchMatchMode, setInternalSearchMatchMode] = (0,
|
|
21284
|
+
const [internalSearchMatchMode, setInternalSearchMatchMode] = (0, import_react47.useState)(
|
|
21200
21285
|
toolbar?.searchMatch?.defaultMode ?? "contains"
|
|
21201
21286
|
);
|
|
21202
21287
|
const searchMatchMode = controlledQuery ? controlledQuery.state.searchMatchMode ?? toolbar?.searchMatch?.defaultMode ?? "contains" : internalSearchMatchMode;
|
|
@@ -21207,7 +21292,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21207
21292
|
}
|
|
21208
21293
|
setInternalSearchMatchMode(mode);
|
|
21209
21294
|
};
|
|
21210
|
-
const [internalSearchScope, setInternalSearchScope] = (0,
|
|
21295
|
+
const [internalSearchScope, setInternalSearchScope] = (0, import_react47.useState)("all");
|
|
21211
21296
|
const searchScope = controlledQuery ? controlledQuery.state.searchScope ?? "all" : internalSearchScope;
|
|
21212
21297
|
const setSearchScope = (scope) => {
|
|
21213
21298
|
if (controlledQuery) {
|
|
@@ -21216,7 +21301,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21216
21301
|
}
|
|
21217
21302
|
setInternalSearchScope(scope);
|
|
21218
21303
|
};
|
|
21219
|
-
const [internalAnyOf, setInternalAnyOf] = (0,
|
|
21304
|
+
const [internalAnyOf, setInternalAnyOf] = (0, import_react47.useState)("");
|
|
21220
21305
|
const toolbarAnyOfControlled = toolbar?.anyOf?.value !== void 0;
|
|
21221
21306
|
const anyOfValue = controlledQuery ? controlledQuery.state.anyOf : toolbarAnyOfControlled ? toolbar?.anyOf?.value ?? "" : internalAnyOf;
|
|
21222
21307
|
const setAnyOfValue = (v) => {
|
|
@@ -21227,7 +21312,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21227
21312
|
}
|
|
21228
21313
|
toolbar?.anyOf?.onChange?.(v);
|
|
21229
21314
|
};
|
|
21230
|
-
const [internalLayeredFilters, setInternalLayeredFilters] = (0,
|
|
21315
|
+
const [internalLayeredFilters, setInternalLayeredFilters] = (0, import_react47.useState)([]);
|
|
21231
21316
|
const layeredFilters = controlledQuery ? controlledQuery.state.layeredFilters ?? NO_LAYERED_FILTERS : internalLayeredFilters;
|
|
21232
21317
|
const setLayeredFilters = (next) => {
|
|
21233
21318
|
if (controlledQuery) {
|
|
@@ -21236,9 +21321,9 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21236
21321
|
}
|
|
21237
21322
|
setInternalLayeredFilters(next);
|
|
21238
21323
|
};
|
|
21239
|
-
const [internalColumnFilters, setInternalColumnFilters] = (0,
|
|
21324
|
+
const [internalColumnFilters, setInternalColumnFilters] = (0, import_react47.useState)(initialColumnFilters ?? {});
|
|
21240
21325
|
const columnFilters = controlledQuery ? controlledQuery.state.columnFilters : internalColumnFilters;
|
|
21241
|
-
const localColumnFilters = (0,
|
|
21326
|
+
const localColumnFilters = (0, import_react47.useMemo)(() => {
|
|
21242
21327
|
if (appendDefaultsToSourceProcessing) return {};
|
|
21243
21328
|
if (sourceColumnFilterOwnership === "source") return {};
|
|
21244
21329
|
if (sourceColumnFilterOwnership === void 0 || sourceColumnFilterOwnership === "local") {
|
|
@@ -21260,7 +21345,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21260
21345
|
}
|
|
21261
21346
|
setInternalColumnFilters(nextFilters);
|
|
21262
21347
|
};
|
|
21263
|
-
const [internalSort, setInternalSort] = (0,
|
|
21348
|
+
const [internalSort, setInternalSort] = (0, import_react47.useState)(defaultSort);
|
|
21264
21349
|
const sort = controlledQuery ? controlledQuery.state.sort : internalSort;
|
|
21265
21350
|
const setSort = (next) => {
|
|
21266
21351
|
if (controlledQuery) {
|
|
@@ -21269,7 +21354,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21269
21354
|
}
|
|
21270
21355
|
setInternalSort(next);
|
|
21271
21356
|
};
|
|
21272
|
-
const [internalPage, setInternalPage] = (0,
|
|
21357
|
+
const [internalPage, setInternalPage] = (0, import_react47.useState)(1);
|
|
21273
21358
|
const page = controlledQuery ? controlledQuery.state.page : internalPage;
|
|
21274
21359
|
const setPage = (next) => {
|
|
21275
21360
|
if (controlledQuery) {
|
|
@@ -21278,7 +21363,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21278
21363
|
}
|
|
21279
21364
|
setInternalPage(next);
|
|
21280
21365
|
};
|
|
21281
|
-
const [internalPageSize, setInternalPageSize] = (0,
|
|
21366
|
+
const [internalPageSize, setInternalPageSize] = (0, import_react47.useState)(
|
|
21282
21367
|
defaultPageSize
|
|
21283
21368
|
);
|
|
21284
21369
|
const pageSize = controlledQuery ? controlledQuery.state.pageSize : internalPageSize;
|
|
@@ -21289,29 +21374,29 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21289
21374
|
}
|
|
21290
21375
|
setInternalPageSize(next);
|
|
21291
21376
|
};
|
|
21292
|
-
const [uncontrolledSelectedId, setUncontrolledSelectedId] = (0,
|
|
21377
|
+
const [uncontrolledSelectedId, setUncontrolledSelectedId] = (0, import_react47.useState)(null);
|
|
21293
21378
|
const rawSelectedId = controlledSelectedId !== void 0 ? controlledSelectedId : uncontrolledSelectedId;
|
|
21294
21379
|
const selectedId = appendSourceChanged ? null : rawSelectedId;
|
|
21295
|
-
const [openRequest, setOpenRequest] = (0,
|
|
21380
|
+
const [openRequest, setOpenRequest] = (0, import_react47.useState)(0);
|
|
21296
21381
|
const setSelectedId = (id) => {
|
|
21297
21382
|
if (controlledSelectedId === void 0) setUncontrolledSelectedId(id);
|
|
21298
21383
|
onSelectedIdChange?.(id);
|
|
21299
21384
|
};
|
|
21300
|
-
const [uncontrolledWindowRowId, setUncontrolledWindowRowId] = (0,
|
|
21385
|
+
const [uncontrolledWindowRowId, setUncontrolledWindowRowId] = (0, import_react47.useState)(null);
|
|
21301
21386
|
const rawWindowRowId = controlledWindowRowId !== void 0 ? controlledWindowRowId : uncontrolledWindowRowId;
|
|
21302
21387
|
const windowRowId = appendSourceChanged ? null : rawWindowRowId;
|
|
21303
21388
|
const setWindowRowId = (id) => {
|
|
21304
21389
|
if (controlledWindowRowId === void 0) setUncontrolledWindowRowId(id);
|
|
21305
21390
|
onWindowRowIdChange?.(id);
|
|
21306
21391
|
};
|
|
21307
|
-
const [windowRowSnapshot, setWindowRowSnapshot] = (0,
|
|
21392
|
+
const [windowRowSnapshot, setWindowRowSnapshot] = (0, import_react47.useState)(null);
|
|
21308
21393
|
const editScopeKey = appendQueryKey === null ? "\0local" : `append:${appendQueryKey}`;
|
|
21309
|
-
const [editsByScope, setEditsByScope] = (0,
|
|
21310
|
-
const editRevisionRef = (0,
|
|
21311
|
-
const [savingByScope, setSavingByScope] = (0,
|
|
21312
|
-
const savingScopesRef = (0,
|
|
21313
|
-
const [editRequest, setEditRequest] = (0,
|
|
21314
|
-
const [confirmForeignDraftDiscard, setConfirmForeignDraftDiscard] = (0,
|
|
21394
|
+
const [editsByScope, setEditsByScope] = (0, import_react47.useState)({});
|
|
21395
|
+
const editRevisionRef = (0, import_react47.useRef)({});
|
|
21396
|
+
const [savingByScope, setSavingByScope] = (0, import_react47.useState)({});
|
|
21397
|
+
const savingScopesRef = (0, import_react47.useRef)(/* @__PURE__ */ new Set());
|
|
21398
|
+
const [editRequest, setEditRequest] = (0, import_react47.useState)(null);
|
|
21399
|
+
const [confirmForeignDraftDiscard, setConfirmForeignDraftDiscard] = (0, import_react47.useState)(false);
|
|
21315
21400
|
const edits = editsByScope[editScopeKey]?.values ?? {};
|
|
21316
21401
|
const saving = (savingByScope[editScopeKey] ?? 0) > 0;
|
|
21317
21402
|
const setEdits = (next) => {
|
|
@@ -21381,10 +21466,10 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21381
21466
|
selectionConfig?.scopeKey === void 0 ? "receipt" : "membership",
|
|
21382
21467
|
selectionConfig?.scopeKey ?? appendQueryKey
|
|
21383
21468
|
]);
|
|
21384
|
-
const committedSelectionSourceKey = (0,
|
|
21469
|
+
const committedSelectionSourceKey = (0, import_react47.useRef)(selectionSourceKey);
|
|
21385
21470
|
const selectionSourceChanged = selectionSourceKey !== null && committedSelectionSourceKey.current !== null && committedSelectionSourceKey.current !== selectionSourceKey;
|
|
21386
21471
|
const selection = selectionSourceChanged && selectionConfig ? { ...selectionConfig, selectedIds: [] } : selectionConfig;
|
|
21387
|
-
(0,
|
|
21472
|
+
(0, import_react47.useEffect)(() => {
|
|
21388
21473
|
const previous = committedAppendQueryKey.current;
|
|
21389
21474
|
committedAppendQueryKey.current = appendQueryKey;
|
|
21390
21475
|
if (previous === null || appendQueryKey === null || previous === appendQueryKey) {
|
|
@@ -21401,22 +21486,22 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21401
21486
|
onWindowRowIdChange
|
|
21402
21487
|
]);
|
|
21403
21488
|
const onSelectionSourceChange = selectionConfig?.onSelectedIdsChange;
|
|
21404
|
-
(0,
|
|
21489
|
+
(0, import_react47.useEffect)(() => {
|
|
21405
21490
|
const previous = committedSelectionSourceKey.current;
|
|
21406
21491
|
committedSelectionSourceKey.current = selectionSourceKey;
|
|
21407
21492
|
if (previous !== null && selectionSourceKey !== null && previous !== selectionSourceKey) {
|
|
21408
21493
|
onSelectionSourceChange?.([]);
|
|
21409
21494
|
}
|
|
21410
21495
|
}, [selectionSourceKey, onSelectionSourceChange]);
|
|
21411
|
-
const scrollRef = (0,
|
|
21412
|
-
const tableRef = (0,
|
|
21413
|
-
const tableHeaderRef = (0,
|
|
21414
|
-
const cardsScrollRef = (0,
|
|
21415
|
-
const scrollContainers = (0,
|
|
21416
|
-
const [documentStickyHeader, setDocumentStickyHeader] = (0,
|
|
21417
|
-
const documentStickyHeaderRef = (0,
|
|
21418
|
-
const previousAppendKeyForScrollReset = (0,
|
|
21419
|
-
(0,
|
|
21496
|
+
const scrollRef = (0, import_react47.useRef)(null);
|
|
21497
|
+
const tableRef = (0, import_react47.useRef)(null);
|
|
21498
|
+
const tableHeaderRef = (0, import_react47.useRef)(null);
|
|
21499
|
+
const cardsScrollRef = (0, import_react47.useRef)(null);
|
|
21500
|
+
const scrollContainers = (0, import_react47.useMemo)(() => [scrollRef, cardsScrollRef], []);
|
|
21501
|
+
const [documentStickyHeader, setDocumentStickyHeader] = (0, import_react47.useState)(false);
|
|
21502
|
+
const documentStickyHeaderRef = (0, import_react47.useRef)(false);
|
|
21503
|
+
const previousAppendKeyForScrollReset = (0, import_react47.useRef)(appendQueryKey);
|
|
21504
|
+
(0, import_react47.useLayoutEffect)(() => {
|
|
21420
21505
|
const previous = previousAppendKeyForScrollReset.current;
|
|
21421
21506
|
previousAppendKeyForScrollReset.current = appendQueryKey;
|
|
21422
21507
|
if (previous === null || appendQueryKey === null || previous === appendQueryKey) {
|
|
@@ -21442,16 +21527,16 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21442
21527
|
...appendScrollPolicy?.mode === "scroll" && appendScrollPolicy.thresholdPx !== void 0 ? { thresholdPx: appendScrollPolicy.thresholdPx } : {},
|
|
21443
21528
|
...appendScrollPolicy?.mode === "scroll" && appendScrollPolicy.intentTimeoutMs !== void 0 ? { intentTimeoutMs: appendScrollPolicy.intentTimeoutMs } : {}
|
|
21444
21529
|
});
|
|
21445
|
-
const rootRef = (0,
|
|
21530
|
+
const rootRef = (0, import_react47.useRef)(null);
|
|
21446
21531
|
useClippedContentGuard(rootRef, {
|
|
21447
21532
|
label: typeof copy === "object" && copy.listLabel ? `Table: ${copy.listLabel}` : "MatrxDataTable"
|
|
21448
21533
|
});
|
|
21449
|
-
const [scrollHintRight, setScrollHintRight] = (0,
|
|
21450
|
-
const [scrollHintLeft, setScrollHintLeft] = (0,
|
|
21451
|
-
const [scrollHintRightInset, setScrollHintRightInset] = (0,
|
|
21452
|
-
const [scrollHintTop, setScrollHintTop] = (0,
|
|
21453
|
-
const hintScrollLeft = (0,
|
|
21454
|
-
const updateScrollHint = (0,
|
|
21534
|
+
const [scrollHintRight, setScrollHintRight] = (0, import_react47.useState)(false);
|
|
21535
|
+
const [scrollHintLeft, setScrollHintLeft] = (0, import_react47.useState)(false);
|
|
21536
|
+
const [scrollHintRightInset, setScrollHintRightInset] = (0, import_react47.useState)(6);
|
|
21537
|
+
const [scrollHintTop, setScrollHintTop] = (0, import_react47.useState)(null);
|
|
21538
|
+
const hintScrollLeft = (0, import_react47.useRef)(0);
|
|
21539
|
+
const updateScrollHint = (0, import_react47.useCallback)(() => {
|
|
21455
21540
|
const el = scrollRef.current;
|
|
21456
21541
|
if (!el) return;
|
|
21457
21542
|
hintScrollLeft.current = el.scrollLeft;
|
|
@@ -21484,7 +21569,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21484
21569
|
setScrollHintTop(box.height > 0 ? Math.round(box.top - frame.getBoundingClientRect().top + box.height / 2) : null);
|
|
21485
21570
|
} else setScrollHintTop(null);
|
|
21486
21571
|
}, []);
|
|
21487
|
-
const onTableScroll = (0,
|
|
21572
|
+
const onTableScroll = (0, import_react47.useCallback)(() => {
|
|
21488
21573
|
const el = scrollRef.current;
|
|
21489
21574
|
if (!el || el.scrollLeft === hintScrollLeft.current) return;
|
|
21490
21575
|
updateScrollHint();
|
|
@@ -21497,7 +21582,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21497
21582
|
behavior: "smooth"
|
|
21498
21583
|
});
|
|
21499
21584
|
};
|
|
21500
|
-
(0,
|
|
21585
|
+
(0, import_react47.useEffect)(() => {
|
|
21501
21586
|
window.addEventListener("resize", updateScrollHint);
|
|
21502
21587
|
const el = scrollRef.current;
|
|
21503
21588
|
const observer = el && typeof ResizeObserver !== "undefined" ? new ResizeObserver(updateScrollHint) : null;
|
|
@@ -21512,7 +21597,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21512
21597
|
observer?.disconnect();
|
|
21513
21598
|
};
|
|
21514
21599
|
}, [updateScrollHint, data, columns]);
|
|
21515
|
-
(0,
|
|
21600
|
+
(0, import_react47.useLayoutEffect)(() => {
|
|
21516
21601
|
const scroll = scrollRef.current;
|
|
21517
21602
|
const table = tableRef.current;
|
|
21518
21603
|
const header = tableHeaderRef.current;
|
|
@@ -21571,7 +21656,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21571
21656
|
window.removeEventListener("resize", requestUpdate);
|
|
21572
21657
|
};
|
|
21573
21658
|
}, [stickyHeader, data, columns]);
|
|
21574
|
-
const rowActions = (0,
|
|
21659
|
+
const rowActions = (0, import_react47.useMemo)(() => {
|
|
21575
21660
|
if (!rowActionDefs || rowActionDefs.length === 0) return rowActionsProp;
|
|
21576
21661
|
return (row, controls) => {
|
|
21577
21662
|
const own = rowActionsProp ? rowActionsProp(row, controls) : [];
|
|
@@ -21589,30 +21674,30 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21589
21674
|
})];
|
|
21590
21675
|
};
|
|
21591
21676
|
}, [rowActionsProp, rowActionDefs]);
|
|
21592
|
-
const [columnOrder, setColumnOrder] = (0,
|
|
21593
|
-
const [hiddenColumnIds, setHiddenColumnIds] = (0,
|
|
21677
|
+
const [columnOrder, setColumnOrder] = (0, import_react47.useState)(() => columnState?.order ?? columns.map(columnId));
|
|
21678
|
+
const [hiddenColumnIds, setHiddenColumnIds] = (0, import_react47.useState)(
|
|
21594
21679
|
() => new Set(columnState?.hidden ?? columns.filter((column) => column.hidden).map(columnId))
|
|
21595
21680
|
);
|
|
21596
|
-
const [columnWidths, setColumnWidths] = (0,
|
|
21681
|
+
const [columnWidths, setColumnWidths] = (0, import_react47.useState)(
|
|
21597
21682
|
() => normalizeColumnWidthsForColumns(columnState?.widths, columns)
|
|
21598
21683
|
);
|
|
21599
|
-
const [fixedTableGeometry, setFixedTableGeometry] = (0,
|
|
21600
|
-
const knownColumnIds = (0,
|
|
21601
|
-
const draggedColumnId = (0,
|
|
21602
|
-
const columnDragActive = (0,
|
|
21603
|
-
const columnDragRaf = (0,
|
|
21604
|
-
const columnDragScrollDirection = (0,
|
|
21605
|
-
const [columnDragPreview, setColumnDragPreview] = (0,
|
|
21606
|
-
const stopColumnDragScroll = (0,
|
|
21684
|
+
const [fixedTableGeometry, setFixedTableGeometry] = (0, import_react47.useState)(null);
|
|
21685
|
+
const knownColumnIds = (0, import_react47.useRef)(new Set(columns.map(columnId)));
|
|
21686
|
+
const draggedColumnId = (0, import_react47.useRef)(null);
|
|
21687
|
+
const columnDragActive = (0, import_react47.useRef)(false);
|
|
21688
|
+
const columnDragRaf = (0, import_react47.useRef)(null);
|
|
21689
|
+
const columnDragScrollDirection = (0, import_react47.useRef)(0);
|
|
21690
|
+
const [columnDragPreview, setColumnDragPreview] = (0, import_react47.useState)(null);
|
|
21691
|
+
const stopColumnDragScroll = (0, import_react47.useCallback)(() => {
|
|
21607
21692
|
if (columnDragRaf.current !== null) cancelAnimationFrame(columnDragRaf.current);
|
|
21608
21693
|
columnDragRaf.current = null;
|
|
21609
21694
|
columnDragScrollDirection.current = 0;
|
|
21610
21695
|
}, []);
|
|
21611
|
-
(0,
|
|
21696
|
+
(0, import_react47.useEffect)(() => () => {
|
|
21612
21697
|
columnDragActive.current = false;
|
|
21613
21698
|
stopColumnDragScroll();
|
|
21614
21699
|
}, [stopColumnDragScroll]);
|
|
21615
|
-
const startColumnDragScroll = (0,
|
|
21700
|
+
const startColumnDragScroll = (0, import_react47.useCallback)(() => {
|
|
21616
21701
|
if (!columnDragActive.current || columnDragRaf.current !== null) return;
|
|
21617
21702
|
const scrollStep = () => {
|
|
21618
21703
|
const scroll = scrollRef.current;
|
|
@@ -21639,32 +21724,32 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21639
21724
|
};
|
|
21640
21725
|
columnDragRaf.current = requestAnimationFrame(scrollStep);
|
|
21641
21726
|
}, []);
|
|
21642
|
-
const commitColumnState = (0,
|
|
21727
|
+
const commitColumnState = (0, import_react47.useCallback)((order, hidden) => {
|
|
21643
21728
|
if (columnState) columnState.onChange({ order, hidden: [...hidden] });
|
|
21644
21729
|
else {
|
|
21645
21730
|
setColumnOrder(order);
|
|
21646
21731
|
setHiddenColumnIds(hidden);
|
|
21647
21732
|
}
|
|
21648
21733
|
}, [columnState]);
|
|
21649
|
-
const [internalColumnManagerOpen, setInternalColumnManagerOpen] = (0,
|
|
21734
|
+
const [internalColumnManagerOpen, setInternalColumnManagerOpen] = (0, import_react47.useState)(false);
|
|
21650
21735
|
const columnManagerOpen = controlledColumnManager?.open ?? internalColumnManagerOpen;
|
|
21651
21736
|
const setColumnManagerOpen = controlledColumnManager?.onOpenChange ?? setInternalColumnManagerOpen;
|
|
21652
|
-
const columnIds = (0,
|
|
21653
|
-
const effectiveColumnOrder = (0,
|
|
21654
|
-
const effectiveHiddenColumnIds = (0,
|
|
21655
|
-
const [shownGroupedColumnId, setShownGroupedColumnId] = (0,
|
|
21737
|
+
const columnIds = (0, import_react47.useMemo)(() => columns.map(columnId), [columns]);
|
|
21738
|
+
const effectiveColumnOrder = (0, import_react47.useMemo)(() => columnState ? [...columnState.order.filter((id, index, values) => columnIds.includes(id) && values.indexOf(id) === index), ...columnIds.filter((id) => !columnState.order.includes(id))] : columnOrder, [columnIds, columnOrder, columnState]);
|
|
21739
|
+
const effectiveHiddenColumnIds = (0, import_react47.useMemo)(() => columnState ? new Set(hiddenWithColumnDefaults(columnState.order, columnState.hidden, columns).filter((id) => columnIds.includes(id))) : hiddenColumnIds, [columnIds, columns, columnState, hiddenColumnIds]);
|
|
21740
|
+
const [shownGroupedColumnId, setShownGroupedColumnId] = (0, import_react47.useState)(null);
|
|
21656
21741
|
const groupedColumnId = drill ? null : grouping?.columnId ?? null;
|
|
21657
21742
|
const groupedColumnShown = groupedColumnId !== null && (grouping?.showColumn ?? shownGroupedColumnId === groupedColumnId);
|
|
21658
21743
|
const autoHiddenGroupColumnId = groupedColumnId !== null && !groupedColumnShown && columnIds.includes(groupedColumnId) && !effectiveHiddenColumnIds.has(groupedColumnId) ? groupedColumnId : null;
|
|
21659
|
-
const drawnHiddenColumnIds = (0,
|
|
21744
|
+
const drawnHiddenColumnIds = (0, import_react47.useMemo)(
|
|
21660
21745
|
() => autoHiddenGroupColumnId ? /* @__PURE__ */ new Set([...effectiveHiddenColumnIds, autoHiddenGroupColumnId]) : effectiveHiddenColumnIds,
|
|
21661
21746
|
[effectiveHiddenColumnIds, autoHiddenGroupColumnId]
|
|
21662
21747
|
);
|
|
21663
|
-
const setGroupedColumnShown = (0,
|
|
21748
|
+
const setGroupedColumnShown = (0, import_react47.useCallback)((show) => {
|
|
21664
21749
|
if (grouping?.onShowColumnChange) grouping.onShowColumnChange(show);
|
|
21665
21750
|
else setShownGroupedColumnId(show ? groupedColumnId : null);
|
|
21666
21751
|
}, [grouping, groupedColumnId]);
|
|
21667
|
-
const applyColumnManager = (0,
|
|
21752
|
+
const applyColumnManager = (0, import_react47.useCallback)((order, hidden) => {
|
|
21668
21753
|
const next = new Set(hidden);
|
|
21669
21754
|
if (groupedColumnId !== null && !effectiveHiddenColumnIds.has(groupedColumnId)) {
|
|
21670
21755
|
const wantsShown = !next.has(groupedColumnId);
|
|
@@ -21673,24 +21758,24 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21673
21758
|
}
|
|
21674
21759
|
commitColumnState(order, next);
|
|
21675
21760
|
}, [groupedColumnId, effectiveHiddenColumnIds, groupedColumnShown, setGroupedColumnShown, commitColumnState]);
|
|
21676
|
-
const columnManagerDefaults = (0,
|
|
21761
|
+
const columnManagerDefaults = (0, import_react47.useMemo)(
|
|
21677
21762
|
() => columnState?.defaults ? { order: columnState.defaults.order, hidden: new Set(columnState.defaults.hidden) } : void 0,
|
|
21678
21763
|
[columnState?.defaults]
|
|
21679
21764
|
);
|
|
21680
|
-
const [autoResizeSnapshot, setAutoResizeSnapshot] = (0,
|
|
21681
|
-
const persistedColumnWidths = (0,
|
|
21765
|
+
const [autoResizeSnapshot, setAutoResizeSnapshot] = (0, import_react47.useState)(null);
|
|
21766
|
+
const persistedColumnWidths = (0, import_react47.useMemo)(
|
|
21682
21767
|
() => normalizeColumnWidthsForColumns(columnState?.widths ?? columnWidths, columns),
|
|
21683
21768
|
[columns, columnState?.widths, columnWidths]
|
|
21684
21769
|
);
|
|
21685
|
-
const effectiveColumnWidths = (0,
|
|
21770
|
+
const effectiveColumnWidths = (0, import_react47.useMemo)(
|
|
21686
21771
|
() => normalizeColumnWidthsForColumns({
|
|
21687
21772
|
...persistedColumnWidths,
|
|
21688
21773
|
...autoResizeSnapshot?.widths
|
|
21689
21774
|
}, columns),
|
|
21690
21775
|
[columns, persistedColumnWidths, autoResizeSnapshot]
|
|
21691
21776
|
);
|
|
21692
|
-
const resizeGestureSnapshotRef = (0,
|
|
21693
|
-
const measureVisibleColumnWidths = (0,
|
|
21777
|
+
const resizeGestureSnapshotRef = (0, import_react47.useRef)(null);
|
|
21778
|
+
const measureVisibleColumnWidths = (0, import_react47.useCallback)(() => {
|
|
21694
21779
|
const measured = {};
|
|
21695
21780
|
const headers = tableRef.current ? Array.from(tableRef.current.querySelectorAll(
|
|
21696
21781
|
"thead th[data-matrx-table-column-id]"
|
|
@@ -21704,7 +21789,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21704
21789
|
}
|
|
21705
21790
|
return normalizeColumnWidthsForColumns(measured, columns);
|
|
21706
21791
|
}, [columns]);
|
|
21707
|
-
const measureFixedTableGeometry = (0,
|
|
21792
|
+
const measureFixedTableGeometry = (0, import_react47.useCallback)(() => {
|
|
21708
21793
|
const table = tableRef.current;
|
|
21709
21794
|
const headers = table ? Array.from(table.querySelectorAll("thead th")) : [];
|
|
21710
21795
|
const widthFor = (selector) => {
|
|
@@ -21739,7 +21824,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21739
21824
|
...actionsWidth === void 0 ? {} : { actionsWidth }
|
|
21740
21825
|
};
|
|
21741
21826
|
}, [resolvedDensity, canonicalSelectionWidth]);
|
|
21742
|
-
const captureResizeGestureSnapshot = (0,
|
|
21827
|
+
const captureResizeGestureSnapshot = (0, import_react47.useCallback)(() => {
|
|
21743
21828
|
const snapshot = {
|
|
21744
21829
|
widths: measureVisibleColumnWidths(),
|
|
21745
21830
|
geometry: measureFixedTableGeometry()
|
|
@@ -21749,11 +21834,11 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21749
21834
|
setAutoResizeSnapshot(snapshot);
|
|
21750
21835
|
}
|
|
21751
21836
|
}, [measureFixedTableGeometry, measureVisibleColumnWidths]);
|
|
21752
|
-
const clearResizeGestureSnapshot = (0,
|
|
21837
|
+
const clearResizeGestureSnapshot = (0, import_react47.useCallback)(() => {
|
|
21753
21838
|
resizeGestureSnapshotRef.current = null;
|
|
21754
21839
|
setAutoResizeSnapshot(null);
|
|
21755
21840
|
}, []);
|
|
21756
|
-
const commitColumnWidths = (0,
|
|
21841
|
+
const commitColumnWidths = (0, import_react47.useCallback)((next, captureInitialWidths = false) => {
|
|
21757
21842
|
const gestureSnapshot = captureInitialWidths ? resizeGestureSnapshotRef.current : null;
|
|
21758
21843
|
resizeGestureSnapshotRef.current = null;
|
|
21759
21844
|
setAutoResizeSnapshot(null);
|
|
@@ -21773,11 +21858,11 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21773
21858
|
}
|
|
21774
21859
|
setColumnWidths(normalized);
|
|
21775
21860
|
}, [columnIds, columnState, columns, measureFixedTableGeometry, measureVisibleColumnWidths]);
|
|
21776
|
-
const resetColumnWidth = (0,
|
|
21861
|
+
const resetColumnWidth = (0, import_react47.useCallback)((id) => {
|
|
21777
21862
|
const { [id]: _dropped, ...rest } = effectiveColumnWidths;
|
|
21778
21863
|
commitColumnWidths(rest);
|
|
21779
21864
|
}, [commitColumnWidths, effectiveColumnWidths]);
|
|
21780
|
-
(0,
|
|
21865
|
+
(0, import_react47.useEffect)(() => {
|
|
21781
21866
|
const ids = columns.map(columnId);
|
|
21782
21867
|
if (columnState) return;
|
|
21783
21868
|
const previousIds = knownColumnIds.current;
|
|
@@ -21796,31 +21881,31 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21796
21881
|
setColumnWidths((current) => normalizeColumnWidthsForColumns(current, columns));
|
|
21797
21882
|
knownColumnIds.current = new Set(ids);
|
|
21798
21883
|
}, [columns, columnState]);
|
|
21799
|
-
(0,
|
|
21884
|
+
(0, import_react47.useLayoutEffect)(() => {
|
|
21800
21885
|
for (const id of columnIds) {
|
|
21801
21886
|
tableRef.current?.style.removeProperty(columnResizeCssVar(id));
|
|
21802
21887
|
}
|
|
21803
21888
|
});
|
|
21804
|
-
const previewColumnOrder = (0,
|
|
21889
|
+
const previewColumnOrder = (0, import_react47.useMemo)(
|
|
21805
21890
|
() => projectColumnDragOrder(effectiveColumnOrder, columnDragPreview),
|
|
21806
21891
|
[columnDragPreview, effectiveColumnOrder]
|
|
21807
21892
|
);
|
|
21808
21893
|
useColumnReorderAnimation(tableRef, previewColumnOrder.join("\0"), columnDragPreview !== null);
|
|
21809
|
-
const visibleColumns = (0,
|
|
21894
|
+
const visibleColumns = (0, import_react47.useMemo)(() => {
|
|
21810
21895
|
const byId = new Map(columns.map((column) => [columnId(column), column]));
|
|
21811
21896
|
return previewColumnOrder.map((id) => byId.get(id)).filter(
|
|
21812
21897
|
(column) => column !== void 0 && !drawnHiddenColumnIds.has(columnId(column))
|
|
21813
21898
|
);
|
|
21814
21899
|
}, [columns, drawnHiddenColumnIds, previewColumnOrder]);
|
|
21815
21900
|
const usesMeasuredFixedLayout = visibleColumns.length > 0 && visibleColumns.every((column) => effectiveColumnWidths[columnId(column)] !== void 0);
|
|
21816
|
-
(0,
|
|
21901
|
+
(0, import_react47.useLayoutEffect)(() => {
|
|
21817
21902
|
if (!usesMeasuredFixedLayout) {
|
|
21818
21903
|
if (fixedTableGeometry !== null) setFixedTableGeometry(null);
|
|
21819
21904
|
return;
|
|
21820
21905
|
}
|
|
21821
21906
|
if (fixedTableGeometry === null) setFixedTableGeometry(measureFixedTableGeometry());
|
|
21822
21907
|
}, [fixedTableGeometry, measureFixedTableGeometry, usesMeasuredFixedLayout]);
|
|
21823
|
-
(0,
|
|
21908
|
+
(0, import_react47.useLayoutEffect)(() => {
|
|
21824
21909
|
if (!usesMeasuredFixedLayout) return;
|
|
21825
21910
|
const table = tableRef.current;
|
|
21826
21911
|
if (!table) return;
|
|
@@ -21845,15 +21930,15 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21845
21930
|
const fixedLayoutActive = usesMeasuredFixedLayout && fixedLayoutGeometry !== null;
|
|
21846
21931
|
const freezeWanted = visibleColumns.some((column) => column.frozen);
|
|
21847
21932
|
const selectionColumnWidth = selection ? canonicalSelectionWidth : void 0;
|
|
21848
|
-
const [fitSpace, setFitSpace] = (0,
|
|
21849
|
-
const fitReadRef = (0,
|
|
21850
|
-
const fitSettlePasses = (0,
|
|
21851
|
-
(0,
|
|
21933
|
+
const [fitSpace, setFitSpace] = (0, import_react47.useState)(null);
|
|
21934
|
+
const fitReadRef = (0, import_react47.useRef)(null);
|
|
21935
|
+
const fitSettlePasses = (0, import_react47.useRef)(0);
|
|
21936
|
+
(0, import_react47.useLayoutEffect)(() => {
|
|
21852
21937
|
if (!fitSpace || fitSettlePasses.current >= 4) return;
|
|
21853
21938
|
fitSettlePasses.current += 1;
|
|
21854
21939
|
fitReadRef.current?.();
|
|
21855
21940
|
}, [fitSpace]);
|
|
21856
|
-
(0,
|
|
21941
|
+
(0, import_react47.useLayoutEffect)(() => {
|
|
21857
21942
|
if (!fitToWidth) {
|
|
21858
21943
|
setFitSpace(null);
|
|
21859
21944
|
return;
|
|
@@ -21904,7 +21989,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21904
21989
|
if (table) observer.observe(table);
|
|
21905
21990
|
return () => observer.disconnect();
|
|
21906
21991
|
}, [fitToWidth, data.length, isLoading]);
|
|
21907
|
-
const fit = (0,
|
|
21992
|
+
const fit = (0, import_react47.useMemo)(() => {
|
|
21908
21993
|
if (!fitToWidth || !fitSpace) return null;
|
|
21909
21994
|
const contentWidth = (col) => col.customActions ? fitSpace.custom[columnId(col)] : void 0;
|
|
21910
21995
|
const keepsItsWidth = (col) => resolveColumnMarker(col) !== void 0 || col.resizable === false && pixelWidth(col.width) !== void 0 || contentWidth(col) !== void 0;
|
|
@@ -21951,14 +22036,14 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21951
22036
|
}, [fitToWidth, fitSpace, visibleColumns, selection, selectionColumnWidth, effectiveColumnWidths]);
|
|
21952
22037
|
const fittedWidths = fit?.widths ?? null;
|
|
21953
22038
|
const fitTableWidth = fit?.widths ? fit.tableWidth : void 0;
|
|
21954
|
-
const holdFitForGesture = (0,
|
|
22039
|
+
const holdFitForGesture = (0, import_react47.useCallback)(() => {
|
|
21955
22040
|
captureResizeGestureSnapshot();
|
|
21956
22041
|
if (!fit?.widths || fit.scalingIds.length === 0) return;
|
|
21957
22042
|
const held = {};
|
|
21958
22043
|
for (const id of fit.scalingIds) held[id] = fit.widths[id];
|
|
21959
22044
|
commitColumnWidths({ ...effectiveColumnWidths, ...held }, true);
|
|
21960
22045
|
}, [captureResizeGestureSnapshot, commitColumnWidths, effectiveColumnWidths, fit]);
|
|
21961
|
-
const resetFitColumnWidth = (0,
|
|
22046
|
+
const resetFitColumnWidth = (0, import_react47.useCallback)((id) => {
|
|
21962
22047
|
const automatic = fit?.automatic[id];
|
|
21963
22048
|
const { [id]: _dropped, ...rest } = effectiveColumnWidths;
|
|
21964
22049
|
const othersSized = visibleColumns.some((col) => {
|
|
@@ -21973,7 +22058,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
21973
22058
|
}, [commitColumnWidths, effectiveColumnWidths, fit, fitToWidth, resetColumnWidth, visibleColumns]);
|
|
21974
22059
|
const fitActive = fittedWidths !== null;
|
|
21975
22060
|
const actionsColumnWidth = fitActive && fitSpace ? fitSpace.actions : fixedLayoutGeometry?.actionsWidth;
|
|
21976
|
-
const frozenColumns = (0,
|
|
22061
|
+
const frozenColumns = (0, import_react47.useMemo)(() => {
|
|
21977
22062
|
if (!freezeWanted) return NO_FROZEN_COLUMNS;
|
|
21978
22063
|
const ids = visibleColumns.map(columnId);
|
|
21979
22064
|
const byId = new Map(visibleColumns.map((column) => [columnId(column), column]));
|
|
@@ -22021,18 +22106,18 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22021
22106
|
const color = cellTintColor(row, id, colId);
|
|
22022
22107
|
return color ? CELL_TINT_CLASS[color] : void 0;
|
|
22023
22108
|
};
|
|
22024
|
-
const declaredVisibleCopyColumns = (0,
|
|
22109
|
+
const declaredVisibleCopyColumns = (0, import_react47.useMemo)(
|
|
22025
22110
|
() => visibleColumns.filter((column) => column.accessorFn !== void 0 || column.accessorKey !== void 0),
|
|
22026
22111
|
[visibleColumns]
|
|
22027
22112
|
);
|
|
22028
|
-
const tableCopySourceNamespace = (0,
|
|
22029
|
-
const tableContextMenuInstanceId = (0,
|
|
22030
|
-
const tableDndContextId = (0,
|
|
22113
|
+
const tableCopySourceNamespace = (0, import_react47.useId)();
|
|
22114
|
+
const tableContextMenuInstanceId = (0, import_react47.useId)();
|
|
22115
|
+
const tableDndContextId = (0, import_react47.useId)();
|
|
22031
22116
|
const defaultCopyTitle = toolbar?.title || "Table";
|
|
22032
|
-
const copyColumnsLatest = (0,
|
|
22117
|
+
const copyColumnsLatest = (0, import_react47.useRef)(declaredVisibleCopyColumns);
|
|
22033
22118
|
copyColumnsLatest.current = declaredVisibleCopyColumns;
|
|
22034
22119
|
const readDeclaredCopyColumns = lazyCallback(() => copyColumnsLatest.current);
|
|
22035
|
-
const defaultCopy = (0,
|
|
22120
|
+
const defaultCopy = (0, import_react47.useMemo)(() => ({
|
|
22036
22121
|
label: defaultCopyTitle,
|
|
22037
22122
|
listLabel: defaultCopyTitle,
|
|
22038
22123
|
location: defaultCopyTitle,
|
|
@@ -22047,17 +22132,17 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22047
22132
|
agentRow: (row) => projectDefaultTableCopyRow(row, copyColumnsLatest.current)
|
|
22048
22133
|
}), [defaultCopyTitle, remoteQuery]);
|
|
22049
22134
|
const effectiveCopy = copy === false ? void 0 : copy ?? defaultCopy;
|
|
22050
|
-
const visibleDataColumns = (0,
|
|
22135
|
+
const visibleDataColumns = (0, import_react47.useMemo)(() => visibleColumns.filter((column) => !column.customActions), [visibleColumns]);
|
|
22051
22136
|
const effectiveCopyColumns = copy === void 0 ? declaredVisibleCopyColumns : visibleDataColumns;
|
|
22052
22137
|
const copySubsetVariant2 = useCopySubsetVariant();
|
|
22053
|
-
const chromeLatest = (0,
|
|
22138
|
+
const chromeLatest = (0, import_react47.useRef)({
|
|
22054
22139
|
processed: [],
|
|
22055
22140
|
data: [],
|
|
22056
22141
|
toggleAllOnPage: () => void 0,
|
|
22057
22142
|
showMore: async () => void 0,
|
|
22058
22143
|
applySavedView: () => void 0
|
|
22059
22144
|
});
|
|
22060
|
-
const applyLatestSavedView = (0,
|
|
22145
|
+
const applyLatestSavedView = (0, import_react47.useCallback)((snapshot) => chromeLatest.current.applySavedView(snapshot), []);
|
|
22061
22146
|
const copySubsetColumns = () => effectiveCopyColumns.filter((c) => c.filter !== false || c.accessorKey || c.accessorFn).map((c) => ({
|
|
22062
22147
|
id: columnId(c),
|
|
22063
22148
|
header: typeof c.header === "string" ? c.header : columnId(c),
|
|
@@ -22079,7 +22164,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22079
22164
|
serializer: (shaped) => buildViewAgentInput(effectiveCopy, shaped, chromeLatest.current.data, { scope: "custom" })
|
|
22080
22165
|
}), copySubsetSize(rows().length, copySubsetColumns().length))
|
|
22081
22166
|
] : [];
|
|
22082
|
-
const filterMeta = (0,
|
|
22167
|
+
const filterMeta = (0, import_react47.useMemo)(() => {
|
|
22083
22168
|
const meta = /* @__PURE__ */ new Map();
|
|
22084
22169
|
for (const col of visibleColumns) {
|
|
22085
22170
|
const id = columnId(col);
|
|
@@ -22087,21 +22172,21 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22087
22172
|
}
|
|
22088
22173
|
return meta;
|
|
22089
22174
|
}, [visibleColumns, data, remoteQuery]);
|
|
22090
|
-
const intelligentSearchScopes = (0,
|
|
22175
|
+
const intelligentSearchScopes = (0, import_react47.useMemo)(
|
|
22091
22176
|
() => resolveTableSearchScopes(data, columns, {
|
|
22092
22177
|
...toolbar?.intelligentSearch?.roles === void 0 ? {} : { roles: toolbar.intelligentSearch.roles },
|
|
22093
22178
|
...toolbar?.intelligentSearch?.scopes === void 0 ? {} : { scopes: toolbar.intelligentSearch.scopes }
|
|
22094
22179
|
}),
|
|
22095
22180
|
[columns, data, toolbar?.intelligentSearch?.roles, toolbar?.intelligentSearch?.scopes]
|
|
22096
22181
|
);
|
|
22097
|
-
const getRowIdForSearch = (0,
|
|
22182
|
+
const getRowIdForSearch = (0, import_react47.useRef)(getRowId);
|
|
22098
22183
|
getRowIdForSearch.current = getRowId;
|
|
22099
|
-
const rowIdForSearch = (0,
|
|
22100
|
-
const searchTextWithId = (0,
|
|
22184
|
+
const rowIdForSearch = (0, import_react47.useCallback)((row) => getRowIdForSearch.current(row), []);
|
|
22185
|
+
const searchTextWithId = (0, import_react47.useCallback)(
|
|
22101
22186
|
(row) => searchText?.(row) ?? "",
|
|
22102
22187
|
[searchText]
|
|
22103
22188
|
);
|
|
22104
|
-
const processed = (0,
|
|
22189
|
+
const processed = (0, import_react47.useMemo)(() => {
|
|
22105
22190
|
if (remoteQuery && !appendUsesLocalProcessing && !remoteQueryUsesLocalProcessing) return data;
|
|
22106
22191
|
if (processLocalRows) {
|
|
22107
22192
|
return processLocalRows(data, {
|
|
@@ -22168,7 +22253,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22168
22253
|
searchScope
|
|
22169
22254
|
]);
|
|
22170
22255
|
const drillAnswerRows = drill?.answerRows;
|
|
22171
|
-
const drillAnswers = (0,
|
|
22256
|
+
const drillAnswers = (0, import_react47.useMemo)(
|
|
22172
22257
|
() => drillAnswerRows ? drillAnswerRows.call(drill, processed) : drill?.answers ?? {},
|
|
22173
22258
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- `drill` is read only for its answers
|
|
22174
22259
|
[drillAnswerRows, processed, drill?.answers]
|
|
@@ -22184,11 +22269,11 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22184
22269
|
sort
|
|
22185
22270
|
};
|
|
22186
22271
|
const viewQueryKey = onViewChange ? JSON.stringify(viewQuery) : "";
|
|
22187
|
-
const viewQueryRef = (0,
|
|
22272
|
+
const viewQueryRef = (0, import_react47.useRef)(viewQuery);
|
|
22188
22273
|
viewQueryRef.current = viewQuery;
|
|
22189
|
-
const lastNotifiedViewRows = (0,
|
|
22190
|
-
const lastNotifiedViewQueryKey = (0,
|
|
22191
|
-
(0,
|
|
22274
|
+
const lastNotifiedViewRows = (0, import_react47.useRef)(null);
|
|
22275
|
+
const lastNotifiedViewQueryKey = (0, import_react47.useRef)(null);
|
|
22276
|
+
(0, import_react47.useEffect)(() => {
|
|
22192
22277
|
if (!onViewChange) {
|
|
22193
22278
|
lastNotifiedViewRows.current = null;
|
|
22194
22279
|
lastNotifiedViewQueryKey.current = null;
|
|
@@ -22199,7 +22284,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22199
22284
|
lastNotifiedViewQueryKey.current = viewQueryKey;
|
|
22200
22285
|
if (changed) onViewChange(processed, viewQueryRef.current);
|
|
22201
22286
|
}, [processed, viewQueryKey, onViewChange]);
|
|
22202
|
-
(0,
|
|
22287
|
+
(0, import_react47.useEffect)(() => {
|
|
22203
22288
|
if (controlledQuery) return;
|
|
22204
22289
|
setInternalPage(1);
|
|
22205
22290
|
}, [
|
|
@@ -22215,16 +22300,16 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22215
22300
|
const drillGrouped = Boolean(drill && drill.question.by.length > 0);
|
|
22216
22301
|
const drillOwnRow = Boolean(drill && (drill.controls ?? (hideToolbar ? "trail" : "toolbar")) === "trail");
|
|
22217
22302
|
const groupingColumnId = drill ? null : grouping?.columnId ?? null;
|
|
22218
|
-
const [uncontrolledCollapsed, setUncontrolledCollapsed] = (0,
|
|
22303
|
+
const [uncontrolledCollapsed, setUncontrolledCollapsed] = (0, import_react47.useState)([]);
|
|
22219
22304
|
const collapsedGroups = grouping?.collapsed ?? uncontrolledCollapsed;
|
|
22220
|
-
const setCollapsedGroups = (0,
|
|
22305
|
+
const setCollapsedGroups = (0, import_react47.useCallback)(
|
|
22221
22306
|
(next) => {
|
|
22222
22307
|
if (grouping?.onCollapsedChange) grouping.onCollapsedChange(next);
|
|
22223
22308
|
else setUncontrolledCollapsed(next);
|
|
22224
22309
|
},
|
|
22225
22310
|
[grouping]
|
|
22226
22311
|
);
|
|
22227
|
-
const groups = (0,
|
|
22312
|
+
const groups = (0, import_react47.useMemo)(() => {
|
|
22228
22313
|
if (!grouping || !groupingColumnId) return null;
|
|
22229
22314
|
const groupColumn2 = columns.find((col) => columnId(col) === groupingColumnId);
|
|
22230
22315
|
if (!groupColumn2) return null;
|
|
@@ -22251,7 +22336,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22251
22336
|
});
|
|
22252
22337
|
return built.length === 1 ? null : built;
|
|
22253
22338
|
}, [grouping, groupingColumnId, columns, processed]);
|
|
22254
|
-
const orderedRows = (0,
|
|
22339
|
+
const orderedRows = (0, import_react47.useMemo)(
|
|
22255
22340
|
() => groups ? groupedVisibleRows(groups, collapsedGroups) : processed,
|
|
22256
22341
|
[groups, collapsedGroups, processed]
|
|
22257
22342
|
);
|
|
@@ -22299,9 +22384,9 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22299
22384
|
const pageOffset = remoteQuery || hidePagination || localProgressiveEnabled || pageSize === 0 ? 0 : (safePage - 1) * effectivePageSize;
|
|
22300
22385
|
const focusIndex = focusRowId ? orderedRows.findIndex((r) => getRowId(r) === focusRowId) : -1;
|
|
22301
22386
|
const focusedRowId = focusIndex >= 0 ? focusRowId ?? null : null;
|
|
22302
|
-
const focusPagedFor = (0,
|
|
22387
|
+
const focusPagedFor = (0, import_react47.useRef)(null);
|
|
22303
22388
|
const focusPageable = !remoteQuery && !hidePagination && !localProgressiveEnabled && pageSize !== 0;
|
|
22304
|
-
(0,
|
|
22389
|
+
(0, import_react47.useEffect)(() => {
|
|
22305
22390
|
if (!focusedRowId) {
|
|
22306
22391
|
focusPagedFor.current = null;
|
|
22307
22392
|
return;
|
|
@@ -22311,19 +22396,19 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22311
22396
|
if (focusPageable) setPage(Math.floor(focusIndex / effectivePageSize) + 1);
|
|
22312
22397
|
}, [focusedRowId]);
|
|
22313
22398
|
const focusShownPage = focusedRowId !== null && (!focusPageable || safePage === Math.floor(focusIndex / effectivePageSize) + 1);
|
|
22314
|
-
(0,
|
|
22399
|
+
(0, import_react47.useEffect)(() => {
|
|
22315
22400
|
if (!focusedRowId || !focusShownPage) return;
|
|
22316
22401
|
const row = rootRef.current?.querySelector(`tr[data-row-id="${CSS.escape(focusedRowId)}"]`);
|
|
22317
22402
|
row?.scrollIntoView?.({ block: "center" });
|
|
22318
22403
|
}, [focusedRowId, focusShownPage, safePage]);
|
|
22319
|
-
const paginated = (0,
|
|
22404
|
+
const paginated = (0, import_react47.useMemo)(() => {
|
|
22320
22405
|
if (remoteQuery) return orderedRows;
|
|
22321
22406
|
if (hidePagination) return orderedRows;
|
|
22322
22407
|
if (localProgressiveEnabled) return [...progressiveRows.rows];
|
|
22323
22408
|
if (pageSize === 0) return orderedRows;
|
|
22324
22409
|
return orderedRows.slice(pageOffset, pageOffset + effectivePageSize);
|
|
22325
22410
|
}, [orderedRows, pageOffset, effectivePageSize, pageSize, remoteQuery, hidePagination, localProgressiveEnabled, progressiveRows.rows]);
|
|
22326
|
-
const groupableColumns = (0,
|
|
22411
|
+
const groupableColumns = (0, import_react47.useMemo)(() => {
|
|
22327
22412
|
const allowed = grouping?.groupableColumnIds;
|
|
22328
22413
|
const visibleIds = new Set(visibleColumns.map((col) => columnId(col)));
|
|
22329
22414
|
return visibleColumns.concat(
|
|
@@ -22337,7 +22422,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22337
22422
|
return col.accessorKey !== void 0 || col.accessorFn !== void 0;
|
|
22338
22423
|
});
|
|
22339
22424
|
}, [visibleColumns, columns, autoHiddenGroupColumnId, groupingColumnId, grouping?.groupableColumnIds]);
|
|
22340
|
-
const groupedRenderRows = (0,
|
|
22425
|
+
const groupedRenderRows = (0, import_react47.useMemo)(
|
|
22341
22426
|
() => groups ? pageGroupRenderRows(groups, collapsedGroups, pageOffset, paginated.length) : null,
|
|
22342
22427
|
[groups, collapsedGroups, pageOffset, paginated.length]
|
|
22343
22428
|
);
|
|
@@ -22349,7 +22434,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22349
22434
|
const bodyEntryCount = groupedRenderRows ? groupedRenderRows.length : paginated.length;
|
|
22350
22435
|
const virtualizeActive = virtualizeConfig !== null && virtualizeConfig.enabled !== false && bodyEntryCount > virtualThreshold && !hierarchy && expandedDetail === void 0;
|
|
22351
22436
|
const columnWindowWidth = virtualizeConfig?.columnWidth ?? 160;
|
|
22352
|
-
const frozenRunLength = (0,
|
|
22437
|
+
const frozenRunLength = (0, import_react47.useMemo)(() => {
|
|
22353
22438
|
let run = 0;
|
|
22354
22439
|
for (const col of visibleColumns) {
|
|
22355
22440
|
if (frozenColumns.offsets[columnId(col)] === void 0) break;
|
|
@@ -22358,9 +22443,9 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22358
22443
|
return run;
|
|
22359
22444
|
}, [visibleColumns, frozenColumns]);
|
|
22360
22445
|
const columnVirtualizeActive = virtualizeConfig !== null && virtualizeConfig.enabled !== false && virtualizeConfig.columns === true && visibleColumns.length - frozenRunLength > 30 && !hierarchy && mobileCards === void 0;
|
|
22361
|
-
const [rowWindow, setRowWindow] = (0,
|
|
22362
|
-
const [columnWindow, setColumnWindow] = (0,
|
|
22363
|
-
const windowInputs = (0,
|
|
22446
|
+
const [rowWindow, setRowWindow] = (0, import_react47.useState)(null);
|
|
22447
|
+
const [columnWindow, setColumnWindow] = (0, import_react47.useState)(null);
|
|
22448
|
+
const windowInputs = (0, import_react47.useRef)({
|
|
22364
22449
|
virtualizeActive: false,
|
|
22365
22450
|
bodyEntryCount: 0,
|
|
22366
22451
|
virtualRowHeight: 40,
|
|
@@ -22380,7 +22465,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22380
22465
|
columnWindowWidth,
|
|
22381
22466
|
frozenRunLength
|
|
22382
22467
|
};
|
|
22383
|
-
const recomputeWindows = (0,
|
|
22468
|
+
const recomputeWindows = (0, import_react47.useCallback)(() => {
|
|
22384
22469
|
const el = scrollRef.current;
|
|
22385
22470
|
const input = windowInputs.current;
|
|
22386
22471
|
const nextRow = input.virtualizeActive ? computeWindow({
|
|
@@ -22401,7 +22486,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22401
22486
|
setRowWindow((prev) => sameWindow(prev, nextRow) ? prev : nextRow);
|
|
22402
22487
|
setColumnWindow((prev) => sameWindow(prev, nextColumn) ? prev : nextColumn);
|
|
22403
22488
|
}, []);
|
|
22404
|
-
const effectiveRowWindow = (0,
|
|
22489
|
+
const effectiveRowWindow = (0, import_react47.useMemo)(() => {
|
|
22405
22490
|
if (!virtualizeActive) return null;
|
|
22406
22491
|
if (rowWindow && rowWindow.end <= bodyEntryCount) return rowWindow;
|
|
22407
22492
|
return computeWindow({
|
|
@@ -22412,7 +22497,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22412
22497
|
overscan: virtualizeConfig?.overscan ?? 8
|
|
22413
22498
|
});
|
|
22414
22499
|
}, [virtualizeActive, rowWindow, bodyEntryCount, virtualRowHeight, virtualizeConfig?.overscan]);
|
|
22415
|
-
const effectiveColumnWindow = (0,
|
|
22500
|
+
const effectiveColumnWindow = (0, import_react47.useMemo)(() => {
|
|
22416
22501
|
if (!columnVirtualizeActive) return null;
|
|
22417
22502
|
if (columnWindow && columnWindow.end <= visibleColumns.length) return columnWindow;
|
|
22418
22503
|
return computeWindow({
|
|
@@ -22432,7 +22517,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22432
22517
|
frozenRunLength
|
|
22433
22518
|
]);
|
|
22434
22519
|
const metricsWanted = virtualizeActive || columnVirtualizeActive;
|
|
22435
|
-
(0,
|
|
22520
|
+
(0, import_react47.useEffect)(() => {
|
|
22436
22521
|
recomputeWindows();
|
|
22437
22522
|
}, [
|
|
22438
22523
|
recomputeWindows,
|
|
@@ -22444,7 +22529,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22444
22529
|
columnWindowWidth,
|
|
22445
22530
|
frozenRunLength
|
|
22446
22531
|
]);
|
|
22447
|
-
(0,
|
|
22532
|
+
(0, import_react47.useEffect)(() => {
|
|
22448
22533
|
if (!metricsWanted) return;
|
|
22449
22534
|
const el = scrollRef.current;
|
|
22450
22535
|
if (!el) return;
|
|
@@ -22469,9 +22554,9 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22469
22554
|
const cardsGridWindowed = cardsLayout === "grid" && groupedRenderRows === null;
|
|
22470
22555
|
const cardsVirtualActive = cardsMounted && virtualizeActive && (cardsLayout !== "grid" || cardsGridWindowed);
|
|
22471
22556
|
const cardEstimate = resolvedDensity === "condensed" ? 72 : resolvedDensity === "spacious" ? 104 : 88;
|
|
22472
|
-
const measuredCardSize = (0,
|
|
22473
|
-
const [cardWindow, setCardWindow] = (0,
|
|
22474
|
-
const cardWindowInputs = (0,
|
|
22557
|
+
const measuredCardSize = (0, import_react47.useRef)(0);
|
|
22558
|
+
const [cardWindow, setCardWindow] = (0, import_react47.useState)(null);
|
|
22559
|
+
const cardWindowInputs = (0, import_react47.useRef)({ active: false, grid: false, count: 0, size: 88, overscan: 8 });
|
|
22475
22560
|
cardWindowInputs.current = {
|
|
22476
22561
|
active: cardsVirtualActive,
|
|
22477
22562
|
grid: cardsGridWindowed,
|
|
@@ -22479,7 +22564,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22479
22564
|
size: measuredCardSize.current || cardEstimate,
|
|
22480
22565
|
overscan: virtualizeConfig?.overscan ?? 8
|
|
22481
22566
|
};
|
|
22482
|
-
const computeCardWindow = (0,
|
|
22567
|
+
const computeCardWindow = (0, import_react47.useCallback)(() => {
|
|
22483
22568
|
const el = cardsScrollRef.current;
|
|
22484
22569
|
const input = cardWindowInputs.current;
|
|
22485
22570
|
if (!input.active) return null;
|
|
@@ -22493,15 +22578,15 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22493
22578
|
});
|
|
22494
22579
|
return across === 1 ? rows : { ...rows, start: rows.start * across, end: Math.min(input.count, rows.end * across) };
|
|
22495
22580
|
}, []);
|
|
22496
|
-
const recomputeCardWindow = (0,
|
|
22581
|
+
const recomputeCardWindow = (0, import_react47.useCallback)(() => {
|
|
22497
22582
|
const next = computeCardWindow();
|
|
22498
22583
|
setCardWindow((prev) => sameWindow(prev, next) ? prev : next);
|
|
22499
22584
|
}, [computeCardWindow]);
|
|
22500
22585
|
const effectiveCardWindow = cardsVirtualActive ? cardWindow && cardWindow.end <= bodyEntryCount ? cardWindow : computeCardWindow() : null;
|
|
22501
|
-
(0,
|
|
22586
|
+
(0, import_react47.useEffect)(() => {
|
|
22502
22587
|
recomputeCardWindow();
|
|
22503
22588
|
}, [recomputeCardWindow, cardsVirtualActive, bodyEntryCount, cardEstimate]);
|
|
22504
|
-
(0,
|
|
22589
|
+
(0, import_react47.useEffect)(() => {
|
|
22505
22590
|
if (!cardsVirtualActive) return;
|
|
22506
22591
|
const el = cardsScrollRef.current;
|
|
22507
22592
|
if (!el) return;
|
|
@@ -22522,7 +22607,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22522
22607
|
observer?.disconnect();
|
|
22523
22608
|
};
|
|
22524
22609
|
}, [cardsVirtualActive, recomputeCardWindow]);
|
|
22525
|
-
(0,
|
|
22610
|
+
(0, import_react47.useLayoutEffect)(() => {
|
|
22526
22611
|
if (!effectiveCardWindow) return;
|
|
22527
22612
|
const el = cardsScrollRef.current;
|
|
22528
22613
|
const head = el?.querySelector(':scope > [data-matrx-cards-pad="start"]');
|
|
@@ -22536,7 +22621,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22536
22621
|
recomputeCardWindow();
|
|
22537
22622
|
}
|
|
22538
22623
|
});
|
|
22539
|
-
const renderedColumns = (0,
|
|
22624
|
+
const renderedColumns = (0, import_react47.useMemo)(
|
|
22540
22625
|
() => effectiveColumnWindow ? [
|
|
22541
22626
|
...visibleColumns.slice(0, frozenRunLength),
|
|
22542
22627
|
...visibleColumns.slice(effectiveColumnWindow.start, effectiveColumnWindow.end)
|
|
@@ -22549,7 +22634,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22549
22634
|
return !column.customActions && !column.compact && !resolveColumnMarker(column) && (frozenColumns.offsets[id] === void 0 || frozenEdgeId === id);
|
|
22550
22635
|
}) : void 0;
|
|
22551
22636
|
const slackId = slackColumn ? columnId(slackColumn) : void 0;
|
|
22552
|
-
const windowedWidthFor = (0,
|
|
22637
|
+
const windowedWidthFor = (0, import_react47.useCallback)(
|
|
22553
22638
|
(id, declared) => {
|
|
22554
22639
|
const fitted = fittedWidths?.[id];
|
|
22555
22640
|
if (fitted !== void 0) return fitted;
|
|
@@ -22561,7 +22646,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22561
22646
|
[effectiveColumnWindow, effectiveColumnWidths, frozenColumns, columnWindowWidth, fittedWidths]
|
|
22562
22647
|
);
|
|
22563
22648
|
const coverageUnanswered = readView.failure || read?.status === "loading" && data.length === 0;
|
|
22564
|
-
const coverageResult = (0,
|
|
22649
|
+
const coverageResult = (0, import_react47.useMemo)(() => {
|
|
22565
22650
|
if (!coverage || coverageUnanswered || isLoading) return null;
|
|
22566
22651
|
return describeCoverage({
|
|
22567
22652
|
loaded: coverage.loaded ?? data.length,
|
|
@@ -22572,7 +22657,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22572
22657
|
...coverage.noun === void 0 ? {} : { noun: coverage.noun }
|
|
22573
22658
|
});
|
|
22574
22659
|
}, [coverage, coverageUnanswered, data.length, isLoading]);
|
|
22575
|
-
const bodyEntries = (0,
|
|
22660
|
+
const bodyEntries = (0, import_react47.useMemo)(() => {
|
|
22576
22661
|
const from = effectiveRowWindow ? effectiveRowWindow.start : 0;
|
|
22577
22662
|
const to = effectiveRowWindow ? effectiveRowWindow.end : void 0;
|
|
22578
22663
|
const windowed = groupedRenderRows ? groupedRenderRows.slice(from, to).map(
|
|
@@ -22591,28 +22676,28 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22591
22676
|
windowed.push({ kind: "spacer", height: effectiveRowWindow.padEnd, place: "end" });
|
|
22592
22677
|
return windowed;
|
|
22593
22678
|
}, [groupedRenderRows, collapsedGroups, paginated, effectiveRowWindow]);
|
|
22594
|
-
const getRowIdRef = (0,
|
|
22679
|
+
const getRowIdRef = (0, import_react47.useRef)(getRowId);
|
|
22595
22680
|
getRowIdRef.current = getRowId;
|
|
22596
|
-
const spreadsheetRowIds = (0,
|
|
22681
|
+
const spreadsheetRowIds = (0, import_react47.useMemo)(
|
|
22597
22682
|
() => paginated.map((row) => getRowIdRef.current(row)),
|
|
22598
22683
|
[paginated]
|
|
22599
22684
|
);
|
|
22600
|
-
const spreadsheetColumnIds = (0,
|
|
22685
|
+
const spreadsheetColumnIds = (0, import_react47.useMemo)(
|
|
22601
22686
|
() => visibleColumns.filter((col) => !col.customActions).map((col) => columnId(col)),
|
|
22602
22687
|
[visibleColumns]
|
|
22603
22688
|
);
|
|
22604
|
-
const spreadsheetRowById = (0,
|
|
22689
|
+
const spreadsheetRowById = (0, import_react47.useMemo)(() => {
|
|
22605
22690
|
const map = /* @__PURE__ */ new Map();
|
|
22606
22691
|
for (const row of paginated) map.set(getRowIdRef.current(row), row);
|
|
22607
22692
|
return map;
|
|
22608
22693
|
}, [paginated]);
|
|
22609
|
-
const spreadsheetColumnById = (0,
|
|
22694
|
+
const spreadsheetColumnById = (0, import_react47.useMemo)(() => {
|
|
22610
22695
|
const map = /* @__PURE__ */ new Map();
|
|
22611
22696
|
for (const col of visibleColumns) if (!col.customActions) map.set(columnId(col), col);
|
|
22612
22697
|
return map;
|
|
22613
22698
|
}, [visibleColumns]);
|
|
22614
22699
|
const spreadsheetEnabled = Boolean(spreadsheet && spreadsheet.enabled !== false);
|
|
22615
|
-
const openRowRef = (0,
|
|
22700
|
+
const openRowRef = (0, import_react47.useRef)(() => void 0);
|
|
22616
22701
|
const sheet = useSpreadsheetGrid(
|
|
22617
22702
|
spreadsheetEnabled && spreadsheet ? {
|
|
22618
22703
|
rowIds: spreadsheetRowIds,
|
|
@@ -22654,12 +22739,12 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22654
22739
|
} : null
|
|
22655
22740
|
);
|
|
22656
22741
|
if (spreadsheet?.controllerRef) spreadsheet.controllerRef.current = spreadsheetEnabled ? sheet.controller : null;
|
|
22657
|
-
const sheetRef = (0,
|
|
22742
|
+
const sheetRef = (0, import_react47.useRef)(sheet);
|
|
22658
22743
|
sheetRef.current = sheet;
|
|
22659
|
-
const onSheetSelectionRef = (0,
|
|
22744
|
+
const onSheetSelectionRef = (0, import_react47.useRef)(spreadsheet?.onSelectionChange);
|
|
22660
22745
|
onSheetSelectionRef.current = spreadsheet?.onSelectionChange;
|
|
22661
22746
|
const sheetSelectionKey = sheet.range ? `${sheet.range.anchor.rowId}\0${sheet.range.anchor.fieldName}\0${sheet.range.focus.rowId}\0${sheet.range.focus.fieldName}\0${sheet.bounds ? `${sheet.bounds.r0}:${sheet.bounds.r1}:${sheet.bounds.c0}:${sheet.bounds.c1}` : ""}` : "";
|
|
22662
|
-
(0,
|
|
22747
|
+
(0, import_react47.useEffect)(() => {
|
|
22663
22748
|
const tell = onSheetSelectionRef.current;
|
|
22664
22749
|
if (!tell) return;
|
|
22665
22750
|
const current = sheetRef.current;
|
|
@@ -22676,12 +22761,12 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22676
22761
|
tsv: current.selectionTsv()
|
|
22677
22762
|
});
|
|
22678
22763
|
}, [sheetSelectionKey]);
|
|
22679
|
-
const searchValueRef = (0,
|
|
22764
|
+
const searchValueRef = (0, import_react47.useRef)(searchValue);
|
|
22680
22765
|
searchValueRef.current = searchValue;
|
|
22681
22766
|
const facetsEnabled = Boolean(facets && facets.enabled !== false);
|
|
22682
22767
|
const coreSuggestionsEnabled = facets?.enabled !== false;
|
|
22683
|
-
const [facetState, setFacetState] = (0,
|
|
22684
|
-
const facetReadCell = (0,
|
|
22768
|
+
const [facetState, setFacetState] = (0, import_react47.useState)({});
|
|
22769
|
+
const facetReadCell = (0, import_react47.useCallback)(
|
|
22685
22770
|
(row, colId) => {
|
|
22686
22771
|
if (facets?.readCell) return facets.readCell(row, colId);
|
|
22687
22772
|
const col = visibleColumns.find((candidate) => columnId(candidate) === colId);
|
|
@@ -22691,11 +22776,11 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22691
22776
|
);
|
|
22692
22777
|
const coreFacetTotal = remoteQuery?.mode === "controlled" ? remoteQuery.totalItems : appendQuery?.pagination.sourceRecords?.total ?? coverage?.matched ?? coverage?.total;
|
|
22693
22778
|
const coreFacetLoaded = appendQuery?.pagination.sourceRecords?.loaded;
|
|
22694
|
-
const facetInputsRef = (0,
|
|
22779
|
+
const facetInputsRef = (0, import_react47.useRef)({ data, facets, facetReadCell, coreFacetTotal, coreFacetLoaded });
|
|
22695
22780
|
facetInputsRef.current = { data, facets, facetReadCell, coreFacetTotal, coreFacetLoaded };
|
|
22696
|
-
const facetRequestRef = (0,
|
|
22697
|
-
const requestedFacetColumns = (0,
|
|
22698
|
-
const requestFacets = (0,
|
|
22781
|
+
const facetRequestRef = (0, import_react47.useRef)(/* @__PURE__ */ new Map());
|
|
22782
|
+
const requestedFacetColumns = (0, import_react47.useRef)(/* @__PURE__ */ new Set());
|
|
22783
|
+
const requestFacets = (0, import_react47.useCallback)((colId) => {
|
|
22699
22784
|
requestedFacetColumns.current.add(colId);
|
|
22700
22785
|
const { data: rows, facets: config, facetReadCell: readCell, coreFacetTotal: total, coreFacetLoaded: loaded } = facetInputsRef.current;
|
|
22701
22786
|
if (!config || config.enabled === false) {
|
|
@@ -22778,7 +22863,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22778
22863
|
}));
|
|
22779
22864
|
});
|
|
22780
22865
|
}, []);
|
|
22781
|
-
(0,
|
|
22866
|
+
(0, import_react47.useEffect)(() => {
|
|
22782
22867
|
setFacetState((current) => Object.keys(current).length === 0 ? current : {});
|
|
22783
22868
|
for (const [colId, ticket] of facetRequestRef.current) {
|
|
22784
22869
|
facetRequestRef.current.set(colId, ticket + 1);
|
|
@@ -22788,15 +22873,15 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22788
22873
|
}
|
|
22789
22874
|
}, [facetsEnabled, coreSuggestionsEnabled, data, searchValue, coreFacetTotal, coreFacetLoaded, requestFacets]);
|
|
22790
22875
|
const totalIsKnown = !isLoading && !readView.failure;
|
|
22791
|
-
(0,
|
|
22876
|
+
(0, import_react47.useEffect)(() => {
|
|
22792
22877
|
if (!controlledQuery || !totalIsKnown || controlledQuery.state.page === safePage) return;
|
|
22793
22878
|
emitControlledQueryChange({ page: safePage });
|
|
22794
22879
|
}, [controlledQuery, emitControlledQueryChange, safePage, totalIsKnown]);
|
|
22795
|
-
const selectedRow = (0,
|
|
22880
|
+
const selectedRow = (0, import_react47.useMemo)(() => {
|
|
22796
22881
|
if (!selectedId) return null;
|
|
22797
22882
|
return data.find((r) => getRowId(r) === selectedId) ?? null;
|
|
22798
22883
|
}, [data, selectedId, getRowId]);
|
|
22799
|
-
const windowRow = (0,
|
|
22884
|
+
const windowRow = (0, import_react47.useMemo)(() => {
|
|
22800
22885
|
if (!windowRowId) return null;
|
|
22801
22886
|
return data.find((r) => getRowId(r) === windowRowId) ?? (windowRowSnapshot && windowRowSnapshot.queryKey === appendQueryKey && getRowId(windowRowSnapshot.row) === windowRowId ? windowRowSnapshot.row : null);
|
|
22802
22887
|
}, [data, windowRowId, windowRowSnapshot, getRowId, appendQueryKey]);
|
|
@@ -22829,14 +22914,14 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22829
22914
|
const reportCardTotal = embedded ? tableCard?.reportTotal : void 0;
|
|
22830
22915
|
const cardTotal = appendQuery ? appendQuery.pagination.totalItems : remoteQuery?.mode === "controlled" ? isLoading ? void 0 : remoteQuery.totalItems : isLoading ? void 0 : sourceProcessing ? sourceTotal : data.length;
|
|
22831
22916
|
const embeddedControlledPage = embedded && remoteQuery?.mode === "controlled" ? remoteQuery.state.page : 1;
|
|
22832
|
-
(0,
|
|
22917
|
+
(0, import_react47.useEffect)(() => {
|
|
22833
22918
|
if (embeddedControlledPage !== 1) emitControlledQueryChange({ page: 1 });
|
|
22834
22919
|
}, [embeddedControlledPage]);
|
|
22835
|
-
(0,
|
|
22920
|
+
(0, import_react47.useEffect)(() => {
|
|
22836
22921
|
reportCardTotal?.(cardTotal);
|
|
22837
22922
|
}, [reportCardTotal, cardTotal]);
|
|
22838
|
-
(0,
|
|
22839
|
-
const [pinnedEl, setPinnedEl] = (0,
|
|
22923
|
+
(0, import_react47.useEffect)(() => () => reportCardTotal?.(void 0), [reportCardTotal]);
|
|
22924
|
+
const [pinnedEl, setPinnedEl] = (0, import_react47.useState)(null);
|
|
22840
22925
|
const pinnedRowActive = Boolean(
|
|
22841
22926
|
toolbar?.singleRow && toolbar.overflow && toolbar.overflow.mode !== "sheet" && (toolbar.overflow.pinned || toolbar.overflow.mode === "menu")
|
|
22842
22927
|
);
|
|
@@ -22849,7 +22934,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22849
22934
|
const mode = overflow?.mode ?? "inline";
|
|
22850
22935
|
const primary = overflow?.primary;
|
|
22851
22936
|
if (mode === "sheet") {
|
|
22852
|
-
return /* @__PURE__ */ (0,
|
|
22937
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(ToolbarOverflowSheet, { ...overflow?.label ? { label: overflow.label } : {}, top: overflow?.sheetTop, children: [
|
|
22853
22938
|
controls,
|
|
22854
22939
|
overflow?.pinned,
|
|
22855
22940
|
primary,
|
|
@@ -22859,17 +22944,17 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22859
22944
|
}
|
|
22860
22945
|
if (!pinnedRowActive) {
|
|
22861
22946
|
if (mode === "menu") {
|
|
22862
|
-
return /* @__PURE__ */ (0,
|
|
22947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
|
|
22863
22948
|
overflow?.pinned,
|
|
22864
22949
|
primary,
|
|
22865
|
-
/* @__PURE__ */ (0,
|
|
22950
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(ToolbarOverflowMenu, { children: [
|
|
22866
22951
|
controls,
|
|
22867
22952
|
overflow?.sheetExtras,
|
|
22868
22953
|
trailing
|
|
22869
22954
|
] })
|
|
22870
22955
|
] });
|
|
22871
22956
|
}
|
|
22872
|
-
return /* @__PURE__ */ (0,
|
|
22957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
|
|
22873
22958
|
controls,
|
|
22874
22959
|
overflow?.pinned,
|
|
22875
22960
|
primary,
|
|
@@ -22877,34 +22962,34 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22877
22962
|
] });
|
|
22878
22963
|
}
|
|
22879
22964
|
const folded = pinnedFolded;
|
|
22880
|
-
toolbarEnd.node = /* @__PURE__ */ (0,
|
|
22965
|
+
toolbarEnd.node = /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
22881
22966
|
"span",
|
|
22882
22967
|
{
|
|
22883
22968
|
ref: setPinnedEl,
|
|
22884
22969
|
"data-matrx-table-toolbar-pinned": "",
|
|
22885
22970
|
...folded ? { "data-matrx-table-toolbar-pinned-folded": "" } : {},
|
|
22886
22971
|
className: "sticky right-0 z-[1] -ml-1 flex shrink-0 items-center bg-background pl-1 before:pointer-events-none before:absolute before:inset-y-0 before:-left-6 before:w-6 before:bg-gradient-to-l before:from-background before:to-transparent",
|
|
22887
|
-
children: folded ? /* @__PURE__ */ (0,
|
|
22972
|
+
children: folded ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
|
|
22888
22973
|
primary,
|
|
22889
|
-
/* @__PURE__ */ (0,
|
|
22890
|
-
toolbarSearch.node ? /* @__PURE__ */ (0,
|
|
22974
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(ToolbarOverflowMenu, { children: [
|
|
22975
|
+
toolbarSearch.node ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { "data-matrx-table-toolbar-folded-search": "", "data-matrx-table-tools-keep-open": "", children: toolbarSearch.node }) : null,
|
|
22891
22976
|
controls,
|
|
22892
22977
|
overflow?.pinned,
|
|
22893
22978
|
overflow?.sheetExtras,
|
|
22894
22979
|
trailing
|
|
22895
22980
|
] })
|
|
22896
|
-
] }) : mode === "menu" ? /* @__PURE__ */ (0,
|
|
22897
|
-
/* @__PURE__ */ (0,
|
|
22981
|
+
] }) : mode === "menu" ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
|
|
22982
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("span", { className: "flex items-center gap-1", children: [
|
|
22898
22983
|
overflow?.pinned,
|
|
22899
22984
|
primary
|
|
22900
22985
|
] }),
|
|
22901
|
-
/* @__PURE__ */ (0,
|
|
22986
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(ToolbarOverflowMenu, { children: [
|
|
22902
22987
|
controls,
|
|
22903
22988
|
overflow?.sheetExtras,
|
|
22904
22989
|
trailing
|
|
22905
22990
|
] })
|
|
22906
|
-
] }) : /* @__PURE__ */ (0,
|
|
22907
|
-
/* @__PURE__ */ (0,
|
|
22991
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
|
|
22992
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("span", { className: "flex items-center gap-1", children: [
|
|
22908
22993
|
overflow?.pinned,
|
|
22909
22994
|
primary
|
|
22910
22995
|
] }),
|
|
@@ -22920,10 +23005,10 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22920
23005
|
return actionSlots;
|
|
22921
23006
|
};
|
|
22922
23007
|
const renderRowActions = (row, controls) => {
|
|
22923
|
-
const actions = rowActions ? /* @__PURE__ */ (0,
|
|
22924
|
-
const scopedActions = /* @__PURE__ */ (0,
|
|
23008
|
+
const actions = rowActions ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TableIconActions, { actions: rowActions(row, controls), inline: rowActionsInline, slots: pageActionSlots() }) : null;
|
|
23009
|
+
const scopedActions = /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(MatrxTableRowControlsScope, { value: controls, children: actions });
|
|
22925
23010
|
if (!effectiveCopy || !showRowCopy) return scopedActions;
|
|
22926
|
-
return /* @__PURE__ */ (0,
|
|
23011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
22927
23012
|
MatrxTableRowAlchemyProvider,
|
|
22928
23013
|
{
|
|
22929
23014
|
copy: tableRowCopyProps(effectiveCopy, row, `${tableCopySourceNamespace}:row:${getRowId(row)}`, copy === void 0 ? readDeclaredCopyColumns : void 0),
|
|
@@ -22981,7 +23066,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22981
23066
|
if (value === null) return "\u2014";
|
|
22982
23067
|
const formatted = kpi.op === "count" ? null : formatColumnValue(col, value);
|
|
22983
23068
|
const text = formatted?.text ?? value.toLocaleString(void 0, { maximumFractionDigits: 2 });
|
|
22984
|
-
return tone ? /* @__PURE__ */ (0,
|
|
23069
|
+
return tone ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: COLUMN_TONE_CLASS[tone], children: text }) : text;
|
|
22985
23070
|
}
|
|
22986
23071
|
}))
|
|
22987
23072
|
);
|
|
@@ -22996,7 +23081,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
22996
23081
|
...resolveSummaryValue(summary?.source?.totals?.[id], value)
|
|
22997
23082
|
}));
|
|
22998
23083
|
const hasSummaryTotals = summaryTotals.length > 0;
|
|
22999
|
-
const changeCount = (0,
|
|
23084
|
+
const changeCount = (0, import_react47.useMemo)(() => {
|
|
23000
23085
|
let n = 0;
|
|
23001
23086
|
for (const fields of Object.values(edits)) {
|
|
23002
23087
|
n += Object.keys(fields).length;
|
|
@@ -23049,7 +23134,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
23049
23134
|
}
|
|
23050
23135
|
expandedDetail.onExpandedIdChange(expandedDetail.expandedId === id ? null : id);
|
|
23051
23136
|
};
|
|
23052
|
-
const warnedRowWithoutPage = (0,
|
|
23137
|
+
const warnedRowWithoutPage = (0, import_react47.useRef)(false);
|
|
23053
23138
|
const openRow = (row) => {
|
|
23054
23139
|
if (canExpandRow(row)) {
|
|
23055
23140
|
toggleExpanded(row);
|
|
@@ -23114,7 +23199,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
23114
23199
|
};
|
|
23115
23200
|
const renderedEmptyState = (remoteQuery === null || remoteQueryUsesLocalProcessing) && data.length > 0 && hasActiveFilters ? {
|
|
23116
23201
|
title: "No matching rows",
|
|
23117
|
-
action: /* @__PURE__ */ (0,
|
|
23202
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Button, { type: "button", variant: "outline", size: "sm", onClick: clearAllFilters, children: "Clear filters" }),
|
|
23118
23203
|
icon: void 0
|
|
23119
23204
|
} : emptyState;
|
|
23120
23205
|
const commitCell = (rowId, field, next) => {
|
|
@@ -23202,7 +23287,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
23202
23287
|
}));
|
|
23203
23288
|
return true;
|
|
23204
23289
|
};
|
|
23205
|
-
const requestCellEditRef = (0,
|
|
23290
|
+
const requestCellEditRef = (0, import_react47.useRef)(requestCellEdit);
|
|
23206
23291
|
requestCellEditRef.current = requestCellEdit;
|
|
23207
23292
|
const buildRecordControls = (row) => {
|
|
23208
23293
|
const rowId = getRowId(row);
|
|
@@ -23229,7 +23314,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
23229
23314
|
};
|
|
23230
23315
|
const hierarchyRows = hierarchy?.rows ?? data;
|
|
23231
23316
|
const hierarchyGetParentId = hierarchy?.getParentId;
|
|
23232
|
-
const hierarchyIndex = (0,
|
|
23317
|
+
const hierarchyIndex = (0, import_react47.useMemo)(() => {
|
|
23233
23318
|
if (!hierarchyGetParentId) return null;
|
|
23234
23319
|
const byId = /* @__PURE__ */ new Map();
|
|
23235
23320
|
const parentById = /* @__PURE__ */ new Map();
|
|
@@ -23261,7 +23346,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
23261
23346
|
return { byId, parentById, depthById };
|
|
23262
23347
|
}, [hierarchyGetParentId, hierarchyRows, getRowId]);
|
|
23263
23348
|
const draggedRow = draggedRowId && hierarchyIndex ? hierarchyIndex.byId.get(draggedRowId) : void 0;
|
|
23264
|
-
const hierarchyBlockedIds = (0,
|
|
23349
|
+
const hierarchyBlockedIds = (0, import_react47.useMemo)(() => {
|
|
23265
23350
|
if (!draggedRowId || !hierarchyIndex) return null;
|
|
23266
23351
|
const childrenById = /* @__PURE__ */ new Map();
|
|
23267
23352
|
for (const [id, parentId] of hierarchyIndex.parentById) {
|
|
@@ -23544,16 +23629,16 @@ function MatrxDataTableCore(coreProps) {
|
|
|
23544
23629
|
return [];
|
|
23545
23630
|
}
|
|
23546
23631
|
};
|
|
23547
|
-
const menuSectionsForRef = (0,
|
|
23632
|
+
const menuSectionsForRef = (0, import_react47.useRef)(menuSectionsFor);
|
|
23548
23633
|
menuSectionsForRef.current = menuSectionsFor;
|
|
23549
23634
|
const hasMenuSections = Boolean(contextMenu?.sections);
|
|
23550
|
-
const boundarySections = (0,
|
|
23635
|
+
const boundarySections = (0, import_react47.useCallback)(
|
|
23551
23636
|
(target) => menuSectionsForRef.current(target),
|
|
23552
23637
|
[]
|
|
23553
23638
|
);
|
|
23554
|
-
const resolveMenuLevelRef = (0,
|
|
23639
|
+
const resolveMenuLevelRef = (0, import_react47.useRef)(resolveMenuLevel);
|
|
23555
23640
|
resolveMenuLevelRef.current = resolveMenuLevel;
|
|
23556
|
-
(0,
|
|
23641
|
+
(0, import_react47.useEffect)(() => {
|
|
23557
23642
|
if (!host.rowContextRegistry) return;
|
|
23558
23643
|
return host.rowContextRegistry.register(
|
|
23559
23644
|
tableContextMenuInstanceId,
|
|
@@ -23562,20 +23647,20 @@ function MatrxDataTableCore(coreProps) {
|
|
|
23562
23647
|
}, [host.rowContextRegistry, tableContextMenuInstanceId]);
|
|
23563
23648
|
const showActionsCol = actionsColumn !== "none" && declaredActionsColumn === void 0 && (windowEnabled || Boolean(rowActions) || showInlineRowCopy);
|
|
23564
23649
|
const actionsHeaderCount = visibleColumns.filter((column) => typeof column.header === "string" && column.header.trim().toLowerCase() === "actions").length + (showActionsCol ? 1 : 0);
|
|
23565
|
-
(0,
|
|
23650
|
+
(0, import_react47.useEffect)(() => {
|
|
23566
23651
|
if (actionsHeaderCount > 1) {
|
|
23567
23652
|
console.error(
|
|
23568
23653
|
`[matrx-table] ${actionsHeaderCount} "Actions" columns in one table \u2014 a table has ONE actions column. Declare one customActions column headed "Actions"; the table folds copy, row actions and open-in-window into it.`
|
|
23569
23654
|
);
|
|
23570
23655
|
}
|
|
23571
23656
|
}, [actionsHeaderCount]);
|
|
23572
|
-
const renderWindowOpen = (row) => windowEnabled ? /* @__PURE__ */ (0,
|
|
23657
|
+
const renderWindowOpen = (row) => windowEnabled ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
23573
23658
|
TapTargetButtonTransparent,
|
|
23574
23659
|
{
|
|
23575
23660
|
"data-matrx-table-icon-action": "",
|
|
23576
23661
|
tone: "muted",
|
|
23577
23662
|
ariaLabel: windowConfig?.openOnRowClick === true ? "Open in side panel" : "Open in window",
|
|
23578
|
-
icon: opensWindowOnRowClick ? /* @__PURE__ */ (0,
|
|
23663
|
+
icon: opensWindowOnRowClick ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(PanelRightIcon, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(PanelRightIcon, { "aria-hidden": true }),
|
|
23579
23664
|
onClick: (e) => {
|
|
23580
23665
|
e?.stopPropagation();
|
|
23581
23666
|
if (windowConfig?.openOnRowClick === true) rowLatest.current.openDetail(row);
|
|
@@ -23588,14 +23673,14 @@ function MatrxDataTableCore(coreProps) {
|
|
|
23588
23673
|
const getSelectionId = selection?.getSelectionId ?? getRowId;
|
|
23589
23674
|
const selectionMatchingTotal = !selection ? void 0 : appendQuery ? processed.length === data.length ? appendQuery.pagination.totalItems : void 0 : remoteQuery ? remoteQuery.mode === "controlled" && processed.length === data.length ? Math.max(0, remoteQuery.totalItems) : void 0 : orderedRows.length;
|
|
23590
23675
|
const allMatchingKey = JSON.stringify([selectionSourceKey, appendQueryKey, savedViewsId, selectionMatchingTotal]);
|
|
23591
|
-
const [ownAllMatchingKey, setOwnAllMatchingKey] = (0,
|
|
23676
|
+
const [ownAllMatchingKey, setOwnAllMatchingKey] = (0, import_react47.useState)(null);
|
|
23592
23677
|
const allMatchingControlled = selection?.allMatching !== void 0;
|
|
23593
23678
|
const allMatching = Boolean(selection) && (selection?.selectedIds.length ?? 0) > 0 && selectionMatchingTotal !== void 0 && (allMatchingControlled ? selection?.allMatching === true : ownAllMatchingKey === allMatchingKey);
|
|
23594
23679
|
const setAllMatching = (next) => {
|
|
23595
23680
|
if (!allMatchingControlled) setOwnAllMatchingKey(next ? allMatchingKey : null);
|
|
23596
23681
|
if (next !== allMatching) selection?.onAllMatchingChange?.(next);
|
|
23597
23682
|
};
|
|
23598
|
-
const selectedIdSet = (0,
|
|
23683
|
+
const selectedIdSet = (0, import_react47.useMemo)(() => {
|
|
23599
23684
|
const ids = new Set(selection?.selectedIds ?? []);
|
|
23600
23685
|
if (allMatching) {
|
|
23601
23686
|
for (const row of data) {
|
|
@@ -23612,7 +23697,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
23612
23697
|
);
|
|
23613
23698
|
const allOnPageSelected = selectableRows.length > 0 && selectedOnPage.length === selectableRows.length;
|
|
23614
23699
|
const someOnPageSelected = selectedOnPage.length > 0 && !allOnPageSelected;
|
|
23615
|
-
const selectedRows = (0,
|
|
23700
|
+
const selectedRows = (0, import_react47.useMemo)(() => {
|
|
23616
23701
|
const resolved = /* @__PURE__ */ new Set();
|
|
23617
23702
|
return data.filter((row) => {
|
|
23618
23703
|
const id = getSelectionId(row);
|
|
@@ -23622,8 +23707,8 @@ function MatrxDataTableCore(coreProps) {
|
|
|
23622
23707
|
});
|
|
23623
23708
|
}, [data, getSelectionId, selectedIdSet]);
|
|
23624
23709
|
const selectedCopyRows = useSelectedCopyRows(data, selectedIdSet, getSelectionId, savedViewsId, selection?.scopeKey);
|
|
23625
|
-
const lastToggledIndex = (0,
|
|
23626
|
-
(0,
|
|
23710
|
+
const lastToggledIndex = (0, import_react47.useRef)(null);
|
|
23711
|
+
(0, import_react47.useEffect)(() => {
|
|
23627
23712
|
lastToggledIndex.current = null;
|
|
23628
23713
|
}, [savedViewsId, selection?.scopeKey]);
|
|
23629
23714
|
const setSelectedIds = (next) => {
|
|
@@ -23700,16 +23785,16 @@ function MatrxDataTableCore(coreProps) {
|
|
|
23700
23785
|
};
|
|
23701
23786
|
const drawsOnlyShutSections = paginated.length === 0 && !readFailure && groupedRenderRows !== null && groupedRenderRows.length > 0;
|
|
23702
23787
|
const messageOutsideTable = slackId === void 0 && !fixedLayoutActive && !fitActive && !isLoading && !drillGrouped && (Boolean(readFailure) || paginated.length === 0 && !drawsOnlyShutSections);
|
|
23703
|
-
const tableMessage = /* @__PURE__ */ (0,
|
|
23788
|
+
const tableMessage = /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
23704
23789
|
"div",
|
|
23705
23790
|
{
|
|
23706
23791
|
"data-matrx-table-empty-state": readFailure ? void 0 : "",
|
|
23707
23792
|
className: "sticky left-0 flex flex-col items-center gap-2 whitespace-normal px-4",
|
|
23708
23793
|
style: { width: "100cqw", maxWidth: "100%" },
|
|
23709
|
-
children: readFailure ?? /* @__PURE__ */ (0,
|
|
23794
|
+
children: readFailure ?? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
|
|
23710
23795
|
renderedEmptyState?.icon,
|
|
23711
|
-
/* @__PURE__ */ (0,
|
|
23712
|
-
renderedEmptyState?.description ? /* @__PURE__ */ (0,
|
|
23796
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("p", { className: "text-sm font-medium text-foreground", children: renderedEmptyState?.title ?? "No rows" }),
|
|
23797
|
+
renderedEmptyState?.description ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("p", { className: "text-xs text-muted-foreground", children: renderedEmptyState.description }) : null,
|
|
23713
23798
|
renderedEmptyState?.action
|
|
23714
23799
|
] })
|
|
23715
23800
|
}
|
|
@@ -23725,7 +23810,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
23725
23810
|
}
|
|
23726
23811
|
} : facet
|
|
23727
23812
|
) : toolbar?.facets;
|
|
23728
|
-
const rowLatest = (0,
|
|
23813
|
+
const rowLatest = (0, import_react47.useRef)(null);
|
|
23729
23814
|
const renderRecordCell = (row, col, index, suppliedControls) => {
|
|
23730
23815
|
const id = getRowId(row);
|
|
23731
23816
|
const field = col.accessorKey ? String(col.accessorKey) : columnId(col);
|
|
@@ -23733,10 +23818,10 @@ function MatrxDataTableCore(coreProps) {
|
|
|
23733
23818
|
const displayRow = applyRowEdits(row, rowEdits);
|
|
23734
23819
|
if (col.customActions) {
|
|
23735
23820
|
const controls = suppliedControls ?? liveRecordControls(displayRow);
|
|
23736
|
-
const content = /* @__PURE__ */ (0,
|
|
23821
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(MatrxTableRowControlsScope, { value: controls, children: col.customActions(displayRow, controls) });
|
|
23737
23822
|
const copyHere = rowCopyInCustomColumn && effectiveCopy && menuActionsColumn !== void 0 && columnId(col) === columnId(menuActionsColumn);
|
|
23738
|
-
return /* @__PURE__ */ (0,
|
|
23739
|
-
copyHere && effectiveCopy ? /* @__PURE__ */ (0,
|
|
23823
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { "data-matrx-table-custom-actions": true, "data-matrx-cell-control": true, className: cn("inline-flex items-center justify-end gap-0", compactRows && "[&_button]:h-6 [&_button]:min-h-6"), onClick: (event) => event.stopPropagation(), children: [
|
|
23824
|
+
copyHere && effectiveCopy ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
23740
23825
|
TableRowCopyControl,
|
|
23741
23826
|
{
|
|
23742
23827
|
size: "toolbar",
|
|
@@ -23746,7 +23831,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
23746
23831
|
...copy === void 0 ? { defaultColumns: readDeclaredCopyColumns } : {}
|
|
23747
23832
|
}
|
|
23748
23833
|
) : null,
|
|
23749
|
-
effectiveCopy && showRowCopy ? /* @__PURE__ */ (0,
|
|
23834
|
+
effectiveCopy && showRowCopy ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
23750
23835
|
MatrxTableRowAlchemyProvider,
|
|
23751
23836
|
{
|
|
23752
23837
|
copy: tableRowCopyProps(effectiveCopy, displayRow, `${tableCopySourceNamespace}:row:${getRowId(displayRow)}`, copy === void 0 ? readDeclaredCopyColumns : void 0),
|
|
@@ -23755,7 +23840,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
23755
23840
|
children: content
|
|
23756
23841
|
}
|
|
23757
23842
|
) : content,
|
|
23758
|
-
declaredActionsColumn !== void 0 && columnId(col) === columnId(declaredActionsColumn) ? /* @__PURE__ */ (0,
|
|
23843
|
+
declaredActionsColumn !== void 0 && columnId(col) === columnId(declaredActionsColumn) ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
|
|
23759
23844
|
renderRowActions(displayRow, controls),
|
|
23760
23845
|
renderWindowOpen(row)
|
|
23761
23846
|
] }) : null
|
|
@@ -23764,7 +23849,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
23764
23849
|
const display = renderCell(displayRow, col, index);
|
|
23765
23850
|
const href = col.href?.(row) ?? void 0;
|
|
23766
23851
|
if (editEnabled && col.editable && (col.editableIf?.(row) ?? true)) {
|
|
23767
|
-
return /* @__PURE__ */ (0,
|
|
23852
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
23768
23853
|
EditableTableCell,
|
|
23769
23854
|
{
|
|
23770
23855
|
value: rowEdits && field in rowEdits ? rowEdits[field] : getCellValue(row, col),
|
|
@@ -23791,7 +23876,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
23791
23876
|
}
|
|
23792
23877
|
);
|
|
23793
23878
|
}
|
|
23794
|
-
return href ? /* @__PURE__ */ (0,
|
|
23879
|
+
return href ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Link, { href, onClick: (event) => event.stopPropagation(), className: "block w-full min-w-0 rounded outline-none focus-visible:ring-2 focus-visible:ring-ring", children: display }) : display;
|
|
23795
23880
|
};
|
|
23796
23881
|
const recordFieldColumns = columns.filter((col) => !col.customActions);
|
|
23797
23882
|
const recordFieldLabel = (col) => col.label ?? (typeof col.header === "string" ? col.header : (0, import_text_case2.displayLabel)(void 0, columnId(col)));
|
|
@@ -23807,7 +23892,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
23807
23892
|
...col.accessorKey !== void 0 || col.accessorFn !== void 0 ? { value: getCellValue(displayRow, col) } : {},
|
|
23808
23893
|
render: () => {
|
|
23809
23894
|
const display = renderCell(displayRow, col, 0);
|
|
23810
|
-
return href ? /* @__PURE__ */ (0,
|
|
23895
|
+
return href ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Link, { href, className: "min-w-0 rounded outline-none focus-visible:ring-2 focus-visible:ring-ring", children: display }) : display;
|
|
23811
23896
|
}
|
|
23812
23897
|
};
|
|
23813
23898
|
});
|
|
@@ -23822,8 +23907,8 @@ function MatrxDataTableCore(coreProps) {
|
|
|
23822
23907
|
const rowHref = getRowHref?.(row);
|
|
23823
23908
|
if (!rowHref) return null;
|
|
23824
23909
|
const href = carryTableView(rowHref);
|
|
23825
|
-
return /* @__PURE__ */ (0,
|
|
23826
|
-
/* @__PURE__ */ (0,
|
|
23910
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Tooltip, { children: [
|
|
23911
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
23827
23912
|
Link,
|
|
23828
23913
|
{
|
|
23829
23914
|
href,
|
|
@@ -23831,13 +23916,13 @@ function MatrxDataTableCore(coreProps) {
|
|
|
23831
23916
|
"data-matrx-record-page-door": true,
|
|
23832
23917
|
"aria-label": "Open full page",
|
|
23833
23918
|
className: "inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground outline-none hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",
|
|
23834
|
-
children: /* @__PURE__ */ (0,
|
|
23919
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Maximize2Icon, { className: "h-4 w-4" })
|
|
23835
23920
|
}
|
|
23836
23921
|
) }),
|
|
23837
|
-
/* @__PURE__ */ (0,
|
|
23922
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TooltipContent, { children: "Open full page" })
|
|
23838
23923
|
] });
|
|
23839
23924
|
};
|
|
23840
|
-
const currentViewSnapshot = (0,
|
|
23925
|
+
const currentViewSnapshot = (0, import_react47.useMemo)(
|
|
23841
23926
|
() => ({
|
|
23842
23927
|
__kind: "matrx-table-view",
|
|
23843
23928
|
version: 1,
|
|
@@ -23877,7 +23962,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
23877
23962
|
const controlledDefaultState = controlledQuery?.defaultState ?? mountedControlledState;
|
|
23878
23963
|
const declaredDefaultSort = urlState ? urlState.defaultSort ?? null : controlledDefaultState ? controlledDefaultState.sort ?? null : defaultSort;
|
|
23879
23964
|
const declaredDefaultPageSize = controlledDefaultState?.pageSize ?? defaultPageSize;
|
|
23880
|
-
const declaredDefaultViewSnapshot = (0,
|
|
23965
|
+
const declaredDefaultViewSnapshot = (0, import_react47.useMemo)(
|
|
23881
23966
|
() => defaultViewSnapshot ?? {
|
|
23882
23967
|
__kind: "matrx-table-view",
|
|
23883
23968
|
version: 1,
|
|
@@ -23896,7 +23981,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
23896
23981
|
},
|
|
23897
23982
|
[columns, declaredDefaultPageSize, declaredDefaultSort, defaultViewSnapshot, viewFilters]
|
|
23898
23983
|
);
|
|
23899
|
-
const applySavedView = (0,
|
|
23984
|
+
const applySavedView = (0, import_react47.useCallback)(
|
|
23900
23985
|
(rawSnapshot) => {
|
|
23901
23986
|
const snapshot = parseTableViewSnapshot(rawSnapshot);
|
|
23902
23987
|
if (!snapshot) {
|
|
@@ -24073,7 +24158,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24073
24158
|
];
|
|
24074
24159
|
const rowEpoch = useRenderEpoch(rowShape.filter((value) => typeof value !== "function" && (typeof value !== "object" || value === null)));
|
|
24075
24160
|
const rowProbe = useRenderEpoch(rowShape.filter((value) => typeof value === "function" || typeof value === "object" && value !== null));
|
|
24076
|
-
const rowDrawings = (0,
|
|
24161
|
+
const rowDrawings = (0, import_react47.useRef)(null);
|
|
24077
24162
|
rowDrawings.current ??= new RowDrawings();
|
|
24078
24163
|
const drawBodyRow = (rowId, row, index, fresh) => rowDrawings.current.draw(rowId, renderRecordRow(row, index), fresh);
|
|
24079
24164
|
chromeLatest.current = { processed, data, toggleAllOnPage, showMore: progressiveRows.showMore, applySavedView };
|
|
@@ -24257,7 +24342,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24257
24342
|
});
|
|
24258
24343
|
const canHoverFrozenCell = background.frozenHover;
|
|
24259
24344
|
const frozenRowBackgroundClass = background.frozen;
|
|
24260
|
-
const rowNode = /* @__PURE__ */ (0,
|
|
24345
|
+
const rowNode = /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
24261
24346
|
"tr",
|
|
24262
24347
|
{
|
|
24263
24348
|
"data-row-id": id,
|
|
@@ -24286,7 +24371,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24286
24371
|
background.row
|
|
24287
24372
|
),
|
|
24288
24373
|
children: [
|
|
24289
|
-
selection ? /* @__PURE__ */ (0,
|
|
24374
|
+
selection ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24290
24375
|
"td",
|
|
24291
24376
|
{
|
|
24292
24377
|
className: cn(
|
|
@@ -24304,7 +24389,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24304
24389
|
),
|
|
24305
24390
|
style: fixedUtilityWidth(selectionColumnWidth),
|
|
24306
24391
|
onClick: (e) => e.stopPropagation(),
|
|
24307
|
-
children: selection.isRowSelectable?.(row) ?? true ? /* @__PURE__ */ (0,
|
|
24392
|
+
children: selection.isRowSelectable?.(row) ?? true ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24308
24393
|
"div",
|
|
24309
24394
|
{
|
|
24310
24395
|
"data-matrx-table-selection-target": true,
|
|
@@ -24313,7 +24398,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24313
24398
|
event.currentTarget.querySelector('[role="checkbox"]')?.click();
|
|
24314
24399
|
}
|
|
24315
24400
|
},
|
|
24316
|
-
children: /* @__PURE__ */ (0,
|
|
24401
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24317
24402
|
Checkbox,
|
|
24318
24403
|
{
|
|
24319
24404
|
className: CHECKBOX_TAP_AREA,
|
|
@@ -24326,7 +24411,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24326
24411
|
) : null
|
|
24327
24412
|
}
|
|
24328
24413
|
) : null,
|
|
24329
|
-
columnSpacers && columnSpacers.start > 0 ? /* @__PURE__ */ (0,
|
|
24414
|
+
columnSpacers && columnSpacers.start > 0 ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24330
24415
|
"td",
|
|
24331
24416
|
{
|
|
24332
24417
|
"aria-hidden": "true",
|
|
@@ -24347,7 +24432,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24347
24432
|
columnId(col)
|
|
24348
24433
|
);
|
|
24349
24434
|
const cellTone = col.tone?.(row);
|
|
24350
|
-
return /* @__PURE__ */ (0,
|
|
24435
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
24351
24436
|
"td",
|
|
24352
24437
|
{
|
|
24353
24438
|
"data-matrx-table-column-id": columnId(col),
|
|
@@ -24423,14 +24508,14 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24423
24508
|
...frozenStyle(columnId(col))
|
|
24424
24509
|
},
|
|
24425
24510
|
children: [
|
|
24426
|
-
/* @__PURE__ */ (0,
|
|
24511
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
24427
24512
|
"div",
|
|
24428
24513
|
{
|
|
24429
24514
|
className: cn(
|
|
24430
24515
|
colIdx === 0 && (hierarchy || canExpandRow(row)) && "flex min-w-0 items-center"
|
|
24431
24516
|
),
|
|
24432
24517
|
children: [
|
|
24433
|
-
colIdx === 0 && hierarchy ? /* @__PURE__ */ (0,
|
|
24518
|
+
colIdx === 0 && hierarchy ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24434
24519
|
HierarchyDragHandle,
|
|
24435
24520
|
{
|
|
24436
24521
|
id,
|
|
@@ -24438,8 +24523,8 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24438
24523
|
disabled: !(hierarchy.canReparent?.(row) ?? true)
|
|
24439
24524
|
}
|
|
24440
24525
|
) : null,
|
|
24441
|
-
colIdx === 0 && canExpandRow(row) ? /* @__PURE__ */ (0,
|
|
24442
|
-
/* @__PURE__ */ (0,
|
|
24526
|
+
colIdx === 0 && canExpandRow(row) ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Tooltip, { children: [
|
|
24527
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24443
24528
|
Button,
|
|
24444
24529
|
{
|
|
24445
24530
|
type: "button",
|
|
@@ -24459,7 +24544,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24459
24544
|
event.stopPropagation();
|
|
24460
24545
|
rowLatest.current.toggleExpanded(row);
|
|
24461
24546
|
},
|
|
24462
|
-
children: /* @__PURE__ */ (0,
|
|
24547
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24463
24548
|
ChevronRightIcon,
|
|
24464
24549
|
{
|
|
24465
24550
|
className: cn(
|
|
@@ -24470,9 +24555,9 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24470
24555
|
)
|
|
24471
24556
|
}
|
|
24472
24557
|
) }),
|
|
24473
|
-
/* @__PURE__ */ (0,
|
|
24558
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TooltipContent, { children: isRowExpanded(row) ? "Collapse details" : "Expand details" })
|
|
24474
24559
|
] }) : null,
|
|
24475
|
-
/* @__PURE__ */ (0,
|
|
24560
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24476
24561
|
"div",
|
|
24477
24562
|
{
|
|
24478
24563
|
"data-matrx-cell-content": true,
|
|
@@ -24484,7 +24569,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24484
24569
|
]
|
|
24485
24570
|
}
|
|
24486
24571
|
),
|
|
24487
|
-
carriesFillHandle ? /* @__PURE__ */ (0,
|
|
24572
|
+
carriesFillHandle ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24488
24573
|
"button",
|
|
24489
24574
|
{
|
|
24490
24575
|
type: "button",
|
|
@@ -24499,7 +24584,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24499
24584
|
columnId(col)
|
|
24500
24585
|
);
|
|
24501
24586
|
}),
|
|
24502
|
-
columnSpacers && columnSpacers.end > 0 ? /* @__PURE__ */ (0,
|
|
24587
|
+
columnSpacers && columnSpacers.end > 0 ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24503
24588
|
"td",
|
|
24504
24589
|
{
|
|
24505
24590
|
"aria-hidden": "true",
|
|
@@ -24509,7 +24594,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24509
24594
|
},
|
|
24510
24595
|
"matrx-column-spacer-end"
|
|
24511
24596
|
) : null,
|
|
24512
|
-
showActionsCol && /* @__PURE__ */ (0,
|
|
24597
|
+
showActionsCol && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24513
24598
|
"td",
|
|
24514
24599
|
{
|
|
24515
24600
|
"data-matrx-table-row-action-cell": true,
|
|
@@ -24526,7 +24611,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24526
24611
|
canHoverFrozenCell && "sm:group-hover/matrx-row:bg-[color-mix(in_oklab,var(--color-muted)_50%,var(--color-card))]"
|
|
24527
24612
|
),
|
|
24528
24613
|
style: fixedUtilityWidth(actionsColumnWidth),
|
|
24529
|
-
children: /* @__PURE__ */ (0,
|
|
24614
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
24530
24615
|
"div",
|
|
24531
24616
|
{
|
|
24532
24617
|
"data-matrx-table-row-actions": true,
|
|
@@ -24536,7 +24621,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24536
24621
|
),
|
|
24537
24622
|
onClick: (e) => e.stopPropagation(),
|
|
24538
24623
|
children: [
|
|
24539
|
-
showInlineRowCopy && effectiveCopy ? /* @__PURE__ */ (0,
|
|
24624
|
+
showInlineRowCopy && effectiveCopy ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24540
24625
|
TableRowCopyControl,
|
|
24541
24626
|
{
|
|
24542
24627
|
size: "toolbar",
|
|
@@ -24558,12 +24643,12 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24558
24643
|
id
|
|
24559
24644
|
);
|
|
24560
24645
|
const wrappedRow = rowWrapper ? rowWrapper(row, rowNode) : rowNode;
|
|
24561
|
-
const inlineDetail = expandedDetail && isRowExpanded(row) ? /* @__PURE__ */ (0,
|
|
24646
|
+
const inlineDetail = expandedDetail && isRowExpanded(row) ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24562
24647
|
"tr",
|
|
24563
24648
|
{
|
|
24564
24649
|
"data-matrx-table-expanded-detail": id,
|
|
24565
24650
|
className: cn("bg-muted/20", expandedDetail.className),
|
|
24566
|
-
children: /* @__PURE__ */ (0,
|
|
24651
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24567
24652
|
"td",
|
|
24568
24653
|
{
|
|
24569
24654
|
colSpan: renderedColSpan,
|
|
@@ -24574,8 +24659,8 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24574
24659
|
},
|
|
24575
24660
|
`${id}:expanded-detail`
|
|
24576
24661
|
) : null;
|
|
24577
|
-
return hierarchy ? /* @__PURE__ */ (0,
|
|
24578
|
-
/* @__PURE__ */ (0,
|
|
24662
|
+
return hierarchy ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_react47.Fragment, { children: [
|
|
24663
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24579
24664
|
HierarchyDroppableRow,
|
|
24580
24665
|
{
|
|
24581
24666
|
id,
|
|
@@ -24584,18 +24669,18 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24584
24669
|
}
|
|
24585
24670
|
),
|
|
24586
24671
|
inlineDetail
|
|
24587
|
-
] }, id) : /* @__PURE__ */ (0,
|
|
24672
|
+
] }, id) : /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_react47.Fragment, { children: [
|
|
24588
24673
|
wrappedRow,
|
|
24589
24674
|
inlineDetail
|
|
24590
24675
|
] }, id);
|
|
24591
24676
|
};
|
|
24592
|
-
return /* @__PURE__ */ (0,
|
|
24677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24593
24678
|
ContextMenuBoundary,
|
|
24594
24679
|
{
|
|
24595
24680
|
label: tableId ?? "Data table",
|
|
24596
24681
|
...hasMenuSections ? { sections: boundarySections } : {},
|
|
24597
24682
|
...contextMenu?.designedMenu ? { designedMenu: true } : {},
|
|
24598
|
-
children: /* @__PURE__ */ (0,
|
|
24683
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
24599
24684
|
import_core4.DndContext,
|
|
24600
24685
|
{
|
|
24601
24686
|
id: tableDndContextId,
|
|
@@ -24684,8 +24769,8 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24684
24769
|
commitColumnState(order, effectiveHiddenColumnIds);
|
|
24685
24770
|
},
|
|
24686
24771
|
children: [
|
|
24687
|
-
/* @__PURE__ */ (0,
|
|
24688
|
-
/* @__PURE__ */ (0,
|
|
24772
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(DragCursorMonitor, {}),
|
|
24773
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
24689
24774
|
"div",
|
|
24690
24775
|
{
|
|
24691
24776
|
ref: rootRef,
|
|
@@ -24698,16 +24783,18 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24698
24783
|
"data-url-state-table": urlState?.id,
|
|
24699
24784
|
"data-matrx-table-appearance": appearance,
|
|
24700
24785
|
"data-matrx-table-embedded": embedded || void 0,
|
|
24786
|
+
style: { "--matrx-table-row-height": `${explicitRowHeight ?? densityRowHeight}px` },
|
|
24701
24787
|
className: cn(
|
|
24702
24788
|
"flex h-full min-h-0 flex-col gap-2 px-0 pt-2 pb-0",
|
|
24703
24789
|
embedded && "h-auto gap-0 pt-0",
|
|
24704
24790
|
className
|
|
24705
24791
|
),
|
|
24706
24792
|
children: [
|
|
24793
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(MultilineRowMarker, {}),
|
|
24707
24794
|
notice,
|
|
24708
|
-
savedViewError ? /* @__PURE__ */ (0,
|
|
24709
|
-
toolbarActionError ? /* @__PURE__ */ (0,
|
|
24710
|
-
summaryMetrics.length > 0 ? /* @__PURE__ */ (0,
|
|
24795
|
+
savedViewError ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ErrorBox, { className: "shrink-0 text-xs text-destructive-ink", message: savedViewError, operation: "Save or apply a saved view", origin: "design-system/MatrxDataTable" }) : null,
|
|
24796
|
+
toolbarActionError ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ErrorBox, { className: "shrink-0 text-xs text-destructive-ink", message: toolbarActionError, operation: "Run a table toolbar action", origin: "design-system/MatrxDataTable" }) : null,
|
|
24797
|
+
summaryMetrics.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24711
24798
|
"section",
|
|
24712
24799
|
{
|
|
24713
24800
|
"data-matrx-table-summary": true,
|
|
@@ -24719,34 +24806,34 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24719
24806
|
"w-full min-w-0 shrink-0",
|
|
24720
24807
|
summary?.variant === "large" ? "grid grid-cols-[repeat(auto-fit,minmax(10rem,1fr))] gap-3" : "flex flex-nowrap items-stretch gap-3 overflow-x-auto overscroll-x-contain"
|
|
24721
24808
|
),
|
|
24722
|
-
children: summaryMetrics.map((metric) => /* @__PURE__ */ (0,
|
|
24723
|
-
/* @__PURE__ */ (0,
|
|
24724
|
-
/* @__PURE__ */ (0,
|
|
24809
|
+
children: summaryMetrics.map((metric) => /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { "data-matrx-table-summary-card": true, title: metric.description || void 0, className: cn("min-w-0 whitespace-nowrap rounded-md border border-border bg-card shadow-xs", summary?.variant === "large" ? "px-4 py-3" : "shrink-0 min-w-24 px-3.5 py-2.5"), children: [
|
|
24810
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "truncate text-sm font-medium text-muted-foreground", children: metric.label }),
|
|
24811
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: cn("truncate font-semibold tabular-nums text-foreground", summary?.variant === "large" ? "mt-1 text-xl" : "mt-0.5 text-sm"), children: [
|
|
24725
24812
|
metric.value,
|
|
24726
|
-
metric.unavailable ? /* @__PURE__ */ (0,
|
|
24813
|
+
metric.unavailable ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ErrorBox, { as: "span", className: "sr-only", message: `${metric.label} is unavailable`, operation: "Summarize this table", origin: "design-system/MatrxDataTable" }) : null
|
|
24727
24814
|
] }),
|
|
24728
|
-
summary?.hints === "shown" && metric.description ? /* @__PURE__ */ (0,
|
|
24815
|
+
summary?.hints === "shown" && metric.description ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { "data-matrx-table-summary-description": true, className: "mt-1 truncate text-xs font-normal text-muted-foreground", children: metric.description }) : null
|
|
24729
24816
|
] }, metric.id))
|
|
24730
24817
|
}
|
|
24731
24818
|
) : null,
|
|
24732
|
-
scopeBar ? /* @__PURE__ */ (0,
|
|
24733
|
-
/* @__PURE__ */ (0,
|
|
24734
|
-
const tabsNode = viewTabs && viewTabsStore ? /* @__PURE__ */ (0,
|
|
24819
|
+
scopeBar ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TableScopeBar, { ...scopeBar }) : null,
|
|
24820
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(MatrxTableChrome, { part: "toolbar", epoch: toolbarEpoch, render: () => {
|
|
24821
|
+
const tabsNode = viewTabs && viewTabsStore ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TableViewWorkspace, { snapshot: currentViewSnapshot, onApply: applyLatestSavedView, related: relatedTableActions, ...viewTabsStore ? { store: viewTabsStore } : {} }, savedViewsId ?? "table") : viewTabs && savedViewsId && SavedViews ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(SavedViews, { tableId: savedViewsId, snapshot: currentViewSnapshot, defaultSnapshot: declaredDefaultViewSnapshot, onApply: applyLatestSavedView, presentation: "tabs", related: relatedTableActions }) : void 0;
|
|
24735
24822
|
const tabsPlaced = Boolean(toolbar && "tabsPortalInto" in toolbar);
|
|
24736
24823
|
const tabsTarget = toolbar && "tabsPortalInto" in toolbar ? toolbar.tabsPortalInto : null;
|
|
24737
|
-
return /* @__PURE__ */ (0,
|
|
24824
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
|
|
24738
24825
|
tabsPlaced && tabsTarget && tabsNode && !hideToolbar ? (0, import_react_dom2.createPortal)(
|
|
24739
|
-
/* @__PURE__ */ (0,
|
|
24826
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { ...macPortalAttrs, "data-matrx-table-toolbar-tabs": "", "data-matrx-table-tabs-placed": "", className: "flex min-w-0 max-w-full [&_[data-matrx-table-tabs]]:min-w-0 [&_[data-matrx-table-tabs]]:shrink [&_[data-matrx-table-tabs]]:border-b-0", children: tabsNode }),
|
|
24740
24827
|
tabsTarget
|
|
24741
24828
|
) : null,
|
|
24742
|
-
placeToolbar(!hideToolbar && (showViewTabs || toolbar?.title || toolbar?.titleCount || showSearch || toolbar?.customSearch || toolbar?.anyOf || toolbar?.layeredFilters || toolbar?.facets && toolbar.facets.length > 0 || toolbar?.leading || toolbar?.actions || toolbar?.refresh || toolbar?.add || savedViewsId && SavedViews || hasActiveFilters || showToolbarCopy || columns.length > 0) && /* @__PURE__ */ (0,
|
|
24829
|
+
placeToolbar(!hideToolbar && (showViewTabs || toolbar?.title || toolbar?.titleCount || showSearch || toolbar?.customSearch || toolbar?.anyOf || toolbar?.layeredFilters || toolbar?.facets && toolbar.facets.length > 0 || toolbar?.leading || toolbar?.actions || toolbar?.refresh || toolbar?.add || savedViewsId && SavedViews || hasActiveFilters || showToolbarCopy || columns.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
24743
24830
|
TableTitleRow,
|
|
24744
24831
|
{
|
|
24745
24832
|
...toolbar?.singleRow ? { singleRow: true } : {},
|
|
24746
24833
|
tabs: tabsPlaced ? void 0 : tabsNode,
|
|
24747
24834
|
...toolbar?.title === void 0 ? {} : { title: toolbar.title },
|
|
24748
24835
|
...toolbar?.titleCount === void 0 ? {} : { count: toolbar.titleCount },
|
|
24749
|
-
context: savedViewsId && SavedViews && !viewTabs ? /* @__PURE__ */ (0,
|
|
24836
|
+
context: savedViewsId && SavedViews && !viewTabs ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { "data-matrx-table-view-control": true, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24750
24837
|
SavedViews,
|
|
24751
24838
|
{
|
|
24752
24839
|
tableId: savedViewsId,
|
|
@@ -24755,7 +24842,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24755
24842
|
onApply: applyLatestSavedView
|
|
24756
24843
|
}
|
|
24757
24844
|
) }) : void 0,
|
|
24758
|
-
search: (toolbarSearch.node = toolbar?.customSearch ?? (showSearch ? intelligentSearchEnabled ? /* @__PURE__ */ (0,
|
|
24845
|
+
search: (toolbarSearch.node = toolbar?.customSearch ?? (showSearch ? intelligentSearchEnabled ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24759
24846
|
TableSearch,
|
|
24760
24847
|
{
|
|
24761
24848
|
value: searchValue,
|
|
@@ -24765,7 +24852,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24765
24852
|
scopes: intelligentSearchScopes,
|
|
24766
24853
|
...toolbar?.searchPlaceholder === void 0 ? {} : { placeholder: toolbar.searchPlaceholder }
|
|
24767
24854
|
}
|
|
24768
|
-
) : /* @__PURE__ */ (0,
|
|
24855
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
24769
24856
|
"div",
|
|
24770
24857
|
{
|
|
24771
24858
|
"data-matrx-table-search": true,
|
|
@@ -24774,7 +24861,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24774
24861
|
toolbar?.searchMatch ? "sm:max-w-md" : "sm:max-w-xs"
|
|
24775
24862
|
),
|
|
24776
24863
|
children: [
|
|
24777
|
-
/* @__PURE__ */ (0,
|
|
24864
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24778
24865
|
SearchField,
|
|
24779
24866
|
{
|
|
24780
24867
|
value: searchValue,
|
|
@@ -24782,15 +24869,15 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24782
24869
|
placeholder: toolbar?.searchPlaceholder ?? "Search\u2026",
|
|
24783
24870
|
"aria-label": (toolbar?.searchPlaceholder ?? "Search").replace(/[….]+$/, "") || "Search table",
|
|
24784
24871
|
className: "min-w-0 flex-1",
|
|
24785
|
-
end: searchValue ? /* @__PURE__ */ (0,
|
|
24872
|
+
end: searchValue ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("button", { type: "button", "aria-label": "Clear search", title: "Clear search", onClick: () => setSearchValue(""), children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(XIcon, { "aria-hidden": "true" }) }) : void 0
|
|
24786
24873
|
}
|
|
24787
24874
|
),
|
|
24788
|
-
toolbar?.searchMatch ? /* @__PURE__ */ (0,
|
|
24789
|
-
/* @__PURE__ */ (0,
|
|
24875
|
+
toolbar?.searchMatch ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Tooltip, { children: [
|
|
24876
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24790
24877
|
Button2,
|
|
24791
24878
|
{
|
|
24792
24879
|
variant: searchMatchMode === "whole_words" ? "primary" : "outline",
|
|
24793
|
-
icon: /* @__PURE__ */ (0,
|
|
24880
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(WholeWord, { "aria-hidden": "true" }),
|
|
24794
24881
|
"aria-pressed": searchMatchMode === "whole_words",
|
|
24795
24882
|
"aria-label": `Search match: ${searchMatchMode === "whole_words" ? "whole words" : "contains text"}`,
|
|
24796
24883
|
onClick: () => setSearchMatchMode(
|
|
@@ -24799,13 +24886,13 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24799
24886
|
children: searchMatchMode === "whole_words" ? "Whole words" : "Contains"
|
|
24800
24887
|
}
|
|
24801
24888
|
) }),
|
|
24802
|
-
/* @__PURE__ */ (0,
|
|
24889
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TooltipContent, { children: searchMatchMode === "whole_words" ? "Whole words \u2014 click to match text anywhere" : "Contains text \u2014 click to require whole words" })
|
|
24803
24890
|
] }) : null
|
|
24804
24891
|
]
|
|
24805
24892
|
}
|
|
24806
24893
|
) : null), pinnedFolded && pinnedRowActive ? void 0 : toolbarSearch.node),
|
|
24807
24894
|
children: [
|
|
24808
|
-
toolbar?.layeredFilters ? /* @__PURE__ */ (0,
|
|
24895
|
+
toolbar?.layeredFilters ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24809
24896
|
LayeredFilterBuilder,
|
|
24810
24897
|
{
|
|
24811
24898
|
fields: toolbar.layeredFilters.fields,
|
|
@@ -24815,9 +24902,9 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24815
24902
|
label: toolbar.layeredFilters.label
|
|
24816
24903
|
}
|
|
24817
24904
|
) : null,
|
|
24818
|
-
toolbar?.anyOf ? /* @__PURE__ */ (0,
|
|
24819
|
-
/* @__PURE__ */ (0,
|
|
24820
|
-
/* @__PURE__ */ (0,
|
|
24905
|
+
toolbar?.anyOf ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "relative w-full max-w-xs", children: [
|
|
24906
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(SearchIcon, { className: "absolute left-2 top-1/2 h-5 w-5 -translate-y-1/2 text-muted-foreground" }),
|
|
24907
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24821
24908
|
Input,
|
|
24822
24909
|
{
|
|
24823
24910
|
value: anyOfValue,
|
|
@@ -24827,22 +24914,22 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24827
24914
|
style: { fontSize: "16px" }
|
|
24828
24915
|
}
|
|
24829
24916
|
),
|
|
24830
|
-
anyOfValue ? /* @__PURE__ */ (0,
|
|
24831
|
-
/* @__PURE__ */ (0,
|
|
24917
|
+
anyOfValue ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Tooltip, { children: [
|
|
24918
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24832
24919
|
"button",
|
|
24833
24920
|
{
|
|
24834
24921
|
type: "button",
|
|
24835
24922
|
"aria-label": "Clear match-any search",
|
|
24836
24923
|
className: "absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground hover:text-foreground",
|
|
24837
24924
|
onClick: () => setAnyOfValue(""),
|
|
24838
|
-
children: /* @__PURE__ */ (0,
|
|
24925
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(XIcon, { className: "h-5 w-5" })
|
|
24839
24926
|
}
|
|
24840
24927
|
) }),
|
|
24841
|
-
/* @__PURE__ */ (0,
|
|
24928
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TooltipContent, { children: "Clear match-any search" })
|
|
24842
24929
|
] }) : null
|
|
24843
24930
|
] }) : null,
|
|
24844
|
-
renderedFacets ? /* @__PURE__ */ (0,
|
|
24845
|
-
toolbar?.leading ? /* @__PURE__ */ (0,
|
|
24931
|
+
renderedFacets ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ToolbarFacets, { facets: renderedFacets }) : null,
|
|
24932
|
+
toolbar?.leading ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24846
24933
|
"div",
|
|
24847
24934
|
{
|
|
24848
24935
|
"data-matrx-table-toolbar-extras": true,
|
|
@@ -24850,7 +24937,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24850
24937
|
children: toolbar.leading
|
|
24851
24938
|
}
|
|
24852
24939
|
) : null,
|
|
24853
|
-
drill && !drillOwnRow && (drill.question.where.length > 0 || drillIsPeriodWindow(drill.question.window) || (drill.base?.length ?? 0) > 0) ? /* @__PURE__ */ (0,
|
|
24940
|
+
drill && !drillOwnRow && (drill.question.where.length > 0 || drillIsPeriodWindow(drill.question.window) || (drill.base?.length ?? 0) > 0) ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24854
24941
|
MatrxDrillTrail,
|
|
24855
24942
|
{
|
|
24856
24943
|
base: drill.base,
|
|
@@ -24867,7 +24954,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24867
24954
|
className: "max-w-full"
|
|
24868
24955
|
}
|
|
24869
24956
|
) : null,
|
|
24870
|
-
/* @__PURE__ */ (0,
|
|
24957
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
24871
24958
|
"div",
|
|
24872
24959
|
{
|
|
24873
24960
|
"data-matrx-table-actions": true,
|
|
@@ -24876,8 +24963,8 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24876
24963
|
toolbar?.singleRow ? "shrink-0 flex-nowrap" : "flex-wrap"
|
|
24877
24964
|
),
|
|
24878
24965
|
children: [
|
|
24879
|
-
toolbar?.singleRow && coverageResult && coverageResult.notice ? /* @__PURE__ */ (0,
|
|
24880
|
-
/* @__PURE__ */ (0,
|
|
24966
|
+
toolbar?.singleRow && coverageResult && coverageResult.notice ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Tooltip, { children: [
|
|
24967
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
24881
24968
|
"span",
|
|
24882
24969
|
{
|
|
24883
24970
|
"data-matrx-table-coverage": true,
|
|
@@ -24887,28 +24974,28 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24887
24974
|
className: "mr-1 inline-flex shrink-0 items-center whitespace-nowrap rounded-md border border-amber-300/70 bg-amber-50 px-2 py-0.5 text-[11px] font-semibold text-amber-900 dark:border-amber-500/40 dark:bg-amber-950/40 dark:text-amber-200",
|
|
24888
24975
|
children: [
|
|
24889
24976
|
coverageResult.badge,
|
|
24890
|
-
/* @__PURE__ */ (0,
|
|
24977
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("span", { className: "sr-only", children: [
|
|
24891
24978
|
": ",
|
|
24892
24979
|
coverageResult.notice
|
|
24893
24980
|
] })
|
|
24894
24981
|
]
|
|
24895
24982
|
}
|
|
24896
24983
|
) }),
|
|
24897
|
-
/* @__PURE__ */ (0,
|
|
24984
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TooltipContent, { className: "max-w-xs", children: coverageResult.notice })
|
|
24898
24985
|
] }) : null,
|
|
24899
|
-
renderToolbarControls(/* @__PURE__ */ (0,
|
|
24900
|
-
hasActiveFilters ? /* @__PURE__ */ (0,
|
|
24986
|
+
renderToolbarControls(/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
|
|
24987
|
+
hasActiveFilters ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24901
24988
|
TableToolbarAction,
|
|
24902
24989
|
{
|
|
24903
24990
|
HostAction: host.ToolbarAction,
|
|
24904
24991
|
ariaLabel: "Clear all filters",
|
|
24905
24992
|
tooltip: "Clear search and filters; keep columns and sort",
|
|
24906
24993
|
onClick: clearAllFilters,
|
|
24907
|
-
children: /* @__PURE__ */ (0,
|
|
24994
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Eraser, {})
|
|
24908
24995
|
}
|
|
24909
24996
|
) : null,
|
|
24910
|
-
drill ? drillOwnRow ? null : /* @__PURE__ */ (0,
|
|
24911
|
-
drill.windowDimension ? /* @__PURE__ */ (0,
|
|
24997
|
+
drill ? drillOwnRow ? null : /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
|
|
24998
|
+
drill.windowDimension ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24912
24999
|
MatrxDrillWindowMenu,
|
|
24913
25000
|
{
|
|
24914
25001
|
question: drill.question,
|
|
@@ -24916,7 +25003,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24916
25003
|
dimensionLabel: drill.dimensions.find((d) => d.key === drill.windowDimension)?.label ?? drill.windowDimension
|
|
24917
25004
|
}
|
|
24918
25005
|
) : null,
|
|
24919
|
-
drillGrouped ? /* @__PURE__ */ (0,
|
|
25006
|
+
drillGrouped ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24920
25007
|
MatrxDrillMeasurePicker,
|
|
24921
25008
|
{
|
|
24922
25009
|
measures: drill.measures,
|
|
@@ -24924,7 +25011,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24924
25011
|
onQuestionChange: drill.onQuestionChange
|
|
24925
25012
|
}
|
|
24926
25013
|
) : null,
|
|
24927
|
-
/* @__PURE__ */ (0,
|
|
25014
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24928
25015
|
MatrxDrillGroupByMenu,
|
|
24929
25016
|
{
|
|
24930
25017
|
dimensions: drill.dimensions,
|
|
@@ -24935,8 +25022,8 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24935
25022
|
] }) : grouping?.onColumnIdChange ? (
|
|
24936
25023
|
// The shared Select (playground review A): the same 28px capsule as every
|
|
24937
25024
|
// other control in the row, never a second select with its own padding.
|
|
24938
|
-
/* @__PURE__ */ (0,
|
|
24939
|
-
/* @__PURE__ */ (0,
|
|
25025
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("span", { "data-matrx-table-group-by": "", className: "inline-flex", children: [
|
|
25026
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24940
25027
|
Select2,
|
|
24941
25028
|
{
|
|
24942
25029
|
"aria-label": "Group rows by a column",
|
|
@@ -24956,7 +25043,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24956
25043
|
const chosen = grouping.thenColumnIds ?? [];
|
|
24957
25044
|
if (at2 > chosen.length) return null;
|
|
24958
25045
|
const taken = /* @__PURE__ */ new Set([groupingColumnId, ...chosen.filter((_, i) => i !== at2)]);
|
|
24959
|
-
return /* @__PURE__ */ (0,
|
|
25046
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24960
25047
|
Select2,
|
|
24961
25048
|
{
|
|
24962
25049
|
"aria-label": `Then group rows by a column (level ${at2 + 2})`,
|
|
@@ -24981,17 +25068,17 @@ function MatrxDataTableCore(coreProps) {
|
|
|
24981
25068
|
}) : null
|
|
24982
25069
|
] })
|
|
24983
25070
|
) : null,
|
|
24984
|
-
columns.length > 0 && toolbar?.columns !== false ? /* @__PURE__ */ (0,
|
|
25071
|
+
columns.length > 0 && toolbar?.columns !== false ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24985
25072
|
TableToolbarAction,
|
|
24986
25073
|
{
|
|
24987
25074
|
HostAction: host.ToolbarAction,
|
|
24988
25075
|
ariaLabel: "Columns",
|
|
24989
25076
|
tooltip: "Show, hide, or reorder columns",
|
|
24990
25077
|
onClick: () => setColumnManagerOpen(true),
|
|
24991
|
-
children: /* @__PURE__ */ (0,
|
|
25078
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(SlidersHorizontal, {})
|
|
24992
25079
|
}
|
|
24993
25080
|
) : null,
|
|
24994
|
-
toolbar?.refresh ? /* @__PURE__ */ (0,
|
|
25081
|
+
toolbar?.refresh ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
24995
25082
|
TableToolbarAction,
|
|
24996
25083
|
{
|
|
24997
25084
|
HostAction: host.ToolbarAction,
|
|
@@ -25013,10 +25100,10 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25013
25100
|
setToolbarActionPending((current) => ({ ...current, refresh: false }));
|
|
25014
25101
|
});
|
|
25015
25102
|
},
|
|
25016
|
-
children: /* @__PURE__ */ (0,
|
|
25103
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(RefreshControlIcon, { spinning: isFetching || toolbarActionPending.refresh })
|
|
25017
25104
|
}
|
|
25018
25105
|
) : null,
|
|
25019
|
-
toolbar?.add ? /* @__PURE__ */ (0,
|
|
25106
|
+
toolbar?.add ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25020
25107
|
TableToolbarAction,
|
|
25021
25108
|
{
|
|
25022
25109
|
HostAction: host.ToolbarAction,
|
|
@@ -25038,11 +25125,11 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25038
25125
|
setToolbarActionPending((current) => ({ ...current, add: false }));
|
|
25039
25126
|
});
|
|
25040
25127
|
},
|
|
25041
|
-
children: /* @__PURE__ */ (0,
|
|
25128
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(PlusIcon, {})
|
|
25042
25129
|
}
|
|
25043
25130
|
) : null,
|
|
25044
25131
|
toolbar?.actions
|
|
25045
|
-
] }), showToolbarCopy && effectiveCopy ? /* @__PURE__ */ (0,
|
|
25132
|
+
] }), showToolbarCopy && effectiveCopy ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ToolbarListedLabel, { label: "Copy or export", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25046
25133
|
CopyButtons,
|
|
25047
25134
|
{
|
|
25048
25135
|
size: "toolbar",
|
|
@@ -25103,9 +25190,9 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25103
25190
|
))
|
|
25104
25191
|
] });
|
|
25105
25192
|
} }),
|
|
25106
|
-
/* @__PURE__ */ (0,
|
|
25107
|
-
drill && drillOwnRow ? /* @__PURE__ */ (0,
|
|
25108
|
-
coverageResult && coverageResult.notice && !toolbar?.singleRow ? /* @__PURE__ */ (0,
|
|
25193
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { "data-matrx-table-body-region": true, className: "flex min-h-0 flex-1 flex-col gap-2", children: [
|
|
25194
|
+
drill && drillOwnRow ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(MatrxDrillBar, { drill, answers: drillAnswers, rowNoun: grouping?.rowNoun }) : null,
|
|
25195
|
+
coverageResult && coverageResult.notice && !toolbar?.singleRow ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
25109
25196
|
"div",
|
|
25110
25197
|
{
|
|
25111
25198
|
"data-matrx-table-coverage": true,
|
|
@@ -25113,14 +25200,14 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25113
25200
|
role: "status",
|
|
25114
25201
|
className: "flex shrink-0 items-start gap-2 rounded-md border border-amber-300/70 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-500/40 dark:bg-amber-950/40 dark:text-amber-200",
|
|
25115
25202
|
children: [
|
|
25116
|
-
/* @__PURE__ */ (0,
|
|
25117
|
-
/* @__PURE__ */ (0,
|
|
25203
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "shrink-0 whitespace-nowrap font-semibold", children: coverageResult.badge }),
|
|
25204
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "min-w-0", children: coverageResult.notice })
|
|
25118
25205
|
]
|
|
25119
25206
|
}
|
|
25120
25207
|
) : null,
|
|
25121
|
-
readView.stale ? /* @__PURE__ */ (0,
|
|
25122
|
-
/* @__PURE__ */ (0,
|
|
25123
|
-
mobileCards && cardsMounted ? /* @__PURE__ */ (0,
|
|
25208
|
+
readView.stale ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(StaleNoticeView, { error: read?.error ?? true, what: readView.what, onRetry: read?.onRetry }) : null,
|
|
25209
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { "data-matrx-table-scroll-frame": "", className: cn("relative min-h-0", frameHeight === "content" ? "flex flex-initial flex-col" : "flex-1"), children: [
|
|
25210
|
+
mobileCards && cardsMounted ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
25124
25211
|
"div",
|
|
25125
25212
|
{
|
|
25126
25213
|
ref: cardsScrollRef,
|
|
@@ -25138,36 +25225,36 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25138
25225
|
mobileCardsClass
|
|
25139
25226
|
),
|
|
25140
25227
|
children: [
|
|
25141
|
-
isFetching && !isLoading && appendQuery === null ? /* @__PURE__ */ (0,
|
|
25228
|
+
isFetching && !isLoading && appendQuery === null ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
25142
25229
|
"div",
|
|
25143
25230
|
{
|
|
25144
25231
|
role: "status",
|
|
25145
25232
|
className: "pointer-events-none absolute inset-x-0 top-0 z-20 h-0.5 overflow-hidden bg-primary/15",
|
|
25146
25233
|
children: [
|
|
25147
|
-
/* @__PURE__ */ (0,
|
|
25148
|
-
/* @__PURE__ */ (0,
|
|
25234
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "h-full w-full animate-pulse bg-primary" }),
|
|
25235
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "sr-only", children: "Refreshing table data" })
|
|
25149
25236
|
]
|
|
25150
25237
|
}
|
|
25151
25238
|
) : null,
|
|
25152
|
-
isLoading ? Array.from({ length: 4 }).map((_, index) => /* @__PURE__ */ (0,
|
|
25239
|
+
isLoading ? Array.from({ length: 4 }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25153
25240
|
Skeleton,
|
|
25154
25241
|
{
|
|
25155
25242
|
className: "col-span-full h-52 w-full shrink-0 rounded-lg"
|
|
25156
25243
|
},
|
|
25157
25244
|
`mobile-card-sk-${index}`
|
|
25158
|
-
)) : readFailure ? /* @__PURE__ */ (0,
|
|
25245
|
+
)) : readFailure ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "col-span-full flex min-h-48 flex-1 items-center justify-center px-4 py-12 text-center", children: readFailure }) : paginated.length === 0 && !drawsOnlyShutSections ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "col-span-full flex min-h-48 flex-1 items-center justify-center px-4 py-12 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex max-w-sm flex-col items-center gap-2", children: [
|
|
25159
25246
|
renderedEmptyState?.icon,
|
|
25160
|
-
/* @__PURE__ */ (0,
|
|
25161
|
-
renderedEmptyState?.description ? /* @__PURE__ */ (0,
|
|
25247
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("p", { className: "text-sm font-medium text-foreground", children: renderedEmptyState?.title ?? "No rows" }),
|
|
25248
|
+
renderedEmptyState?.description ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("p", { className: "text-xs text-muted-foreground", children: renderedEmptyState.description }) : null,
|
|
25162
25249
|
renderedEmptyState?.action
|
|
25163
|
-
] }) }) : /* @__PURE__ */ (0,
|
|
25164
|
-
effectiveCardWindow ? /* @__PURE__ */ (0,
|
|
25250
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
|
|
25251
|
+
effectiveCardWindow ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { "data-matrx-cards-pad": "start", "aria-hidden": "true", className: "col-span-full shrink-0", style: { height: effectiveCardWindow.padStart } }) : null,
|
|
25165
25252
|
((rows) => effectiveCardWindow ? rows.slice(effectiveCardWindow.start, effectiveCardWindow.end) : rows)(
|
|
25166
25253
|
groupedRenderRows ?? paginated.map((row, dataIndex) => ({ kind: "row", row, dataIndex }))
|
|
25167
25254
|
).map((entry) => {
|
|
25168
25255
|
if (entry.kind === "group") {
|
|
25169
25256
|
const count = entry.group.rows.length;
|
|
25170
|
-
return /* @__PURE__ */ (0,
|
|
25257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25171
25258
|
MatrxTableGroupCardHeader,
|
|
25172
25259
|
{
|
|
25173
25260
|
groupKey: entry.group.key,
|
|
@@ -25188,7 +25275,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25188
25275
|
const displayRow = applyRowEdits(row, edits[id]);
|
|
25189
25276
|
const controls = buildRecordControls(displayRow);
|
|
25190
25277
|
const selectable = selection?.isRowSelectable?.(row) ?? Boolean(selection);
|
|
25191
|
-
return /* @__PURE__ */ (0,
|
|
25278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { "data-row-id": id, "data-matrx-row-tint": rowTintColor(row, id) ?? void 0, className: "contents", children: mobileCards(displayRow, index, {
|
|
25192
25279
|
renderCell: (columnKey) => {
|
|
25193
25280
|
const column = columns.find((candidate) => columnId(candidate) === columnKey);
|
|
25194
25281
|
return column ? renderRecordCell(row, column, index, controls) : null;
|
|
@@ -25205,14 +25292,14 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25205
25292
|
else next.delete(selectionId);
|
|
25206
25293
|
setSelectedIds(next);
|
|
25207
25294
|
},
|
|
25208
|
-
actions: showInlineRowCopy || rowActions || visibleColumns.some((column) => column.customActions) ? /* @__PURE__ */ (0,
|
|
25295
|
+
actions: showInlineRowCopy || rowActions || visibleColumns.some((column) => column.customActions) ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
25209
25296
|
"div",
|
|
25210
25297
|
{
|
|
25211
25298
|
"data-matrx-table-row-actions": true,
|
|
25212
25299
|
className: "inline-flex items-center justify-end gap-0",
|
|
25213
25300
|
onClick: (event) => event.stopPropagation(),
|
|
25214
25301
|
children: [
|
|
25215
|
-
showInlineRowCopy && effectiveCopy ? /* @__PURE__ */ (0,
|
|
25302
|
+
showInlineRowCopy && effectiveCopy ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25216
25303
|
TableRowCopyControl,
|
|
25217
25304
|
{
|
|
25218
25305
|
size: "toolbar",
|
|
@@ -25223,7 +25310,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25223
25310
|
}
|
|
25224
25311
|
) : null,
|
|
25225
25312
|
renderRowActions(displayRow, controls),
|
|
25226
|
-
visibleColumns.filter((column) => column.customActions).map((column) => /* @__PURE__ */ (0,
|
|
25313
|
+
visibleColumns.filter((column) => column.customActions).map((column) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react47.Fragment, { children: renderRecordCell(row, column, index, controls) }, columnId(column)))
|
|
25227
25314
|
]
|
|
25228
25315
|
}
|
|
25229
25316
|
) : null,
|
|
@@ -25235,9 +25322,9 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25235
25322
|
expandedDetail: expandedDetail && isRowExpanded(row) ? expandedDetail.render(displayRow, controls) : null
|
|
25236
25323
|
}) }, id);
|
|
25237
25324
|
}),
|
|
25238
|
-
effectiveCardWindow ? /* @__PURE__ */ (0,
|
|
25325
|
+
effectiveCardWindow ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { "data-matrx-cards-pad": "end", "aria-hidden": "true", className: "col-span-full shrink-0", style: { height: effectiveCardWindow.padEnd } }) : null
|
|
25239
25326
|
] }),
|
|
25240
|
-
appendQuery !== null && isFetching && !isLoading ? /* @__PURE__ */ (0,
|
|
25327
|
+
appendQuery !== null && isFetching && !isLoading ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
25241
25328
|
"div",
|
|
25242
25329
|
{
|
|
25243
25330
|
"data-matrx-table-append-loading-card": true,
|
|
@@ -25245,7 +25332,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25245
25332
|
"aria-live": "polite",
|
|
25246
25333
|
className: "sticky bottom-0 z-20 col-span-full 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",
|
|
25247
25334
|
children: [
|
|
25248
|
-
/* @__PURE__ */ (0,
|
|
25335
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25249
25336
|
Loader2Icon,
|
|
25250
25337
|
{
|
|
25251
25338
|
"aria-hidden": "true",
|
|
@@ -25259,7 +25346,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25259
25346
|
]
|
|
25260
25347
|
}
|
|
25261
25348
|
) : null,
|
|
25262
|
-
/* @__PURE__ */ (0,
|
|
25349
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
25263
25350
|
"div",
|
|
25264
25351
|
{
|
|
25265
25352
|
ref: scrollRef,
|
|
@@ -25303,34 +25390,34 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25303
25390
|
tableClassName
|
|
25304
25391
|
),
|
|
25305
25392
|
children: [
|
|
25306
|
-
spreadsheetEnabled ? /* @__PURE__ */ (0,
|
|
25307
|
-
hierarchy && draggedRow ? /* @__PURE__ */ (0,
|
|
25393
|
+
spreadsheetEnabled ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("textarea", { ...sheet.typeCatcherProps }) : null,
|
|
25394
|
+
hierarchy && draggedRow ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25308
25395
|
HierarchyRootDropTarget,
|
|
25309
25396
|
{
|
|
25310
25397
|
label: hierarchy.rootDropLabel ?? "Drop here to move to the top level",
|
|
25311
25398
|
draggedLabel: hierarchy.itemLabel?.(draggedRow) ?? "Moving row"
|
|
25312
25399
|
}
|
|
25313
25400
|
) : null,
|
|
25314
|
-
hierarchy && draggedRowId ? /* @__PURE__ */ (0,
|
|
25401
|
+
hierarchy && draggedRowId ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25315
25402
|
HierarchyDragIndicatorLayer,
|
|
25316
25403
|
{
|
|
25317
25404
|
scrollRef,
|
|
25318
25405
|
resolve: resolveHierarchyMove
|
|
25319
25406
|
}
|
|
25320
25407
|
) : null,
|
|
25321
|
-
isFetching && !isLoading && appendQuery === null ? /* @__PURE__ */ (0,
|
|
25408
|
+
isFetching && !isLoading && appendQuery === null ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
25322
25409
|
"div",
|
|
25323
25410
|
{
|
|
25324
25411
|
role: "status",
|
|
25325
25412
|
"data-matrx-table-refreshing": "",
|
|
25326
25413
|
className: "pointer-events-none sticky inset-x-0 top-0 z-40 -mb-0.5 block h-0.5 overflow-hidden bg-primary/15",
|
|
25327
25414
|
children: [
|
|
25328
|
-
/* @__PURE__ */ (0,
|
|
25329
|
-
/* @__PURE__ */ (0,
|
|
25415
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "h-full w-full animate-pulse bg-primary" }),
|
|
25416
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "sr-only", children: "Refreshing table data" })
|
|
25330
25417
|
]
|
|
25331
25418
|
}
|
|
25332
25419
|
) : null,
|
|
25333
|
-
drillGrouped && drill ? /* @__PURE__ */ (0,
|
|
25420
|
+
drillGrouped && drill ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25334
25421
|
MatrxDrillAnswerTable,
|
|
25335
25422
|
{
|
|
25336
25423
|
dimensions: drill.dimensions,
|
|
@@ -25347,7 +25434,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25347
25434
|
cross: drill.cross,
|
|
25348
25435
|
look
|
|
25349
25436
|
}
|
|
25350
|
-
) : /* @__PURE__ */ (0,
|
|
25437
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
25351
25438
|
"table",
|
|
25352
25439
|
{
|
|
25353
25440
|
ref: tableRef,
|
|
@@ -25373,7 +25460,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25373
25460
|
"data-matrx-table-fit": fitActive ? "" : void 0,
|
|
25374
25461
|
"data-matrx-table-fit-grow": fitActive && fitTableWidth !== void 0 ? "" : void 0,
|
|
25375
25462
|
children: [
|
|
25376
|
-
/* @__PURE__ */ (0,
|
|
25463
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(MatrxTableChrome, { part: "header", epoch: headerEpoch, render: () => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25377
25464
|
"thead",
|
|
25378
25465
|
{
|
|
25379
25466
|
ref: tableHeaderRef,
|
|
@@ -25391,8 +25478,8 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25391
25478
|
embedded && "bg-card/95 shadow-none",
|
|
25392
25479
|
stickyHeader && (documentStickyHeader ? "relative translate-y-[var(--matrx-document-sticky-offset)]" : "sticky top-0")
|
|
25393
25480
|
),
|
|
25394
|
-
children: /* @__PURE__ */ (0,
|
|
25395
|
-
selection ? /* @__PURE__ */ (0,
|
|
25481
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("tr", { children: [
|
|
25482
|
+
selection ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25396
25483
|
"th",
|
|
25397
25484
|
{
|
|
25398
25485
|
"data-matrx-table-selection-column": true,
|
|
@@ -25402,7 +25489,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25402
25489
|
embedded && "sm:bg-card max-sm:bg-card"
|
|
25403
25490
|
),
|
|
25404
25491
|
style: fixedUtilityWidth(selectionColumnWidth),
|
|
25405
|
-
children: /* @__PURE__ */ (0,
|
|
25492
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25406
25493
|
"div",
|
|
25407
25494
|
{
|
|
25408
25495
|
"data-matrx-table-selection-target": true,
|
|
@@ -25411,7 +25498,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25411
25498
|
event.currentTarget.querySelector('[role="checkbox"]')?.click();
|
|
25412
25499
|
}
|
|
25413
25500
|
},
|
|
25414
|
-
children: /* @__PURE__ */ (0,
|
|
25501
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25415
25502
|
Checkbox,
|
|
25416
25503
|
{
|
|
25417
25504
|
className: CHECKBOX_TAP_AREA,
|
|
@@ -25425,7 +25512,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25425
25512
|
)
|
|
25426
25513
|
}
|
|
25427
25514
|
) : null,
|
|
25428
|
-
columnSpacers && columnSpacers.start > 0 ? /* @__PURE__ */ (0,
|
|
25515
|
+
columnSpacers && columnSpacers.start > 0 ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25429
25516
|
"th",
|
|
25430
25517
|
{
|
|
25431
25518
|
"aria-hidden": "true",
|
|
@@ -25450,7 +25537,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25450
25537
|
const compact2 = col.compact || marker !== void 0;
|
|
25451
25538
|
const width = marker && col.width === void 0 ? 40 : col.width;
|
|
25452
25539
|
const minWidth = marker && col.minWidth === void 0 ? 40 : col.minWidth;
|
|
25453
|
-
return /* @__PURE__ */ (0,
|
|
25540
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
25454
25541
|
"th",
|
|
25455
25542
|
{
|
|
25456
25543
|
"data-matrx-table-column-id": id,
|
|
@@ -25505,7 +25592,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25505
25592
|
...frozenStyle(id)
|
|
25506
25593
|
},
|
|
25507
25594
|
children: [
|
|
25508
|
-
/* @__PURE__ */ (0,
|
|
25595
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ColumnHeaderDropZone, { id, enabled: reorderableColumns && col.reorderable !== false, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25509
25596
|
ColumnHeaderCell,
|
|
25510
25597
|
{
|
|
25511
25598
|
label: col.header,
|
|
@@ -25564,7 +25651,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25564
25651
|
MenuIcon: host.MenuIcon
|
|
25565
25652
|
}
|
|
25566
25653
|
) }),
|
|
25567
|
-
columnResizable ? /* @__PURE__ */ (0,
|
|
25654
|
+
columnResizable ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25568
25655
|
ColumnResizeHandle,
|
|
25569
25656
|
{
|
|
25570
25657
|
columnId: id,
|
|
@@ -25583,7 +25670,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25583
25670
|
id
|
|
25584
25671
|
);
|
|
25585
25672
|
}),
|
|
25586
|
-
columnSpacers && columnSpacers.end > 0 ? /* @__PURE__ */ (0,
|
|
25673
|
+
columnSpacers && columnSpacers.end > 0 ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25587
25674
|
"th",
|
|
25588
25675
|
{
|
|
25589
25676
|
"aria-hidden": "true",
|
|
@@ -25593,7 +25680,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25593
25680
|
},
|
|
25594
25681
|
"matrx-column-spacer-end"
|
|
25595
25682
|
) : null,
|
|
25596
|
-
showActionsCol && /* @__PURE__ */ (0,
|
|
25683
|
+
showActionsCol && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25597
25684
|
"th",
|
|
25598
25685
|
{
|
|
25599
25686
|
"data-matrx-table-actions-column": true,
|
|
@@ -25605,40 +25692,40 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25605
25692
|
embedded && "sm:bg-card"
|
|
25606
25693
|
),
|
|
25607
25694
|
style: fixedUtilityWidth(actionsColumnWidth),
|
|
25608
|
-
children: compact && !(toolbar && "portalInto" in toolbar) && !(tableCard && embedded) ? /* @__PURE__ */ (0,
|
|
25695
|
+
children: compact && !(toolbar && "portalInto" in toolbar) && !(tableCard && embedded) ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25609
25696
|
"span",
|
|
25610
25697
|
{
|
|
25611
25698
|
ref: setCompactToolbarSlot,
|
|
25612
25699
|
"data-matrx-table-compact-controls": "",
|
|
25613
25700
|
className: "inline-flex items-center justify-center normal-case tracking-normal"
|
|
25614
25701
|
}
|
|
25615
|
-
) : /* @__PURE__ */ (0,
|
|
25702
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { "data-matrx-table-actions-label": true, className: "inline-block whitespace-nowrap", children: "Actions" })
|
|
25616
25703
|
}
|
|
25617
25704
|
)
|
|
25618
25705
|
] })
|
|
25619
25706
|
}
|
|
25620
25707
|
) }),
|
|
25621
|
-
/* @__PURE__ */ (0,
|
|
25708
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
25622
25709
|
"tbody",
|
|
25623
25710
|
{
|
|
25624
25711
|
className: cn("transition-opacity duration-150", isFetching && !isLoading && appendQuery === null && "opacity-60"),
|
|
25625
25712
|
children: [
|
|
25626
|
-
isLoading ? Array.from({ length: skeletonRowCount }).map((_, i) => /* @__PURE__ */ (0,
|
|
25713
|
+
isLoading ? Array.from({ length: skeletonRowCount }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
25627
25714
|
"tr",
|
|
25628
25715
|
{
|
|
25629
25716
|
className: "border-b border-border/60",
|
|
25630
25717
|
"data-matrx-table-skeleton-row": "",
|
|
25631
25718
|
style: explicitRowHeight !== void 0 ? { height: `${explicitRowHeight}px` } : loadingRowHeight !== void 0 ? { height: `${loadingRowHeight}px` } : void 0,
|
|
25632
25719
|
children: [
|
|
25633
|
-
selection ? /* @__PURE__ */ (0,
|
|
25720
|
+
selection ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25634
25721
|
"td",
|
|
25635
25722
|
{
|
|
25636
25723
|
className: cn("px-2 py-1.5 align-middle lg:py-0.5", compactRows && "py-0 lg:py-0"),
|
|
25637
25724
|
style: fixedUtilityWidth(selectionColumnWidth),
|
|
25638
|
-
children: /* @__PURE__ */ (0,
|
|
25725
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Skeleton, { className: "h-3.5 w-3.5" })
|
|
25639
25726
|
}
|
|
25640
25727
|
) : null,
|
|
25641
|
-
columnSpacers && columnSpacers.start > 0 ? /* @__PURE__ */ (0,
|
|
25728
|
+
columnSpacers && columnSpacers.start > 0 ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25642
25729
|
"td",
|
|
25643
25730
|
{
|
|
25644
25731
|
"aria-hidden": "true",
|
|
@@ -25648,7 +25735,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25648
25735
|
},
|
|
25649
25736
|
"matrx-column-spacer-start"
|
|
25650
25737
|
) : null,
|
|
25651
|
-
renderedColumns.map((col) => /* @__PURE__ */ (0,
|
|
25738
|
+
renderedColumns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25652
25739
|
"td",
|
|
25653
25740
|
{
|
|
25654
25741
|
...col.customActions && col.customActionsGhostRow !== void 0 ? { "data-matrx-table-column-id": columnId(col) } : {},
|
|
@@ -25662,20 +25749,20 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25662
25749
|
col.customActions && col.customActionsGhostRow !== void 0 && "w-px whitespace-nowrap"
|
|
25663
25750
|
),
|
|
25664
25751
|
style: phoneColumnMinStyle(col),
|
|
25665
|
-
children: col.customActions && col.customActionsGhostRow !== void 0 ? /* @__PURE__ */ (0,
|
|
25752
|
+
children: col.customActions && col.customActionsGhostRow !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { "aria-hidden": "true", inert: true, className: "invisible", children: renderRecordCell(col.customActionsGhostRow, col, 0) }) : /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Skeleton, { className: cn("w-full", compactRows ? "h-4" : "h-6") })
|
|
25666
25753
|
},
|
|
25667
25754
|
columnId(col)
|
|
25668
25755
|
)),
|
|
25669
|
-
showActionsCol && /* @__PURE__ */ (0,
|
|
25756
|
+
showActionsCol && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25670
25757
|
"td",
|
|
25671
25758
|
{
|
|
25672
25759
|
"data-matrx-table-skeleton-actions": "",
|
|
25673
25760
|
className: cn("px-2 py-1.5 text-right align-middle lg:py-0.5", compactRows && "py-0 lg:py-0"),
|
|
25674
25761
|
style: fixedUtilityWidth(actionsColumnWidth),
|
|
25675
|
-
children: /* @__PURE__ */ (0,
|
|
25762
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Skeleton, { className: cn("ml-auto w-10", compactRows ? "h-6" : "h-8") })
|
|
25676
25763
|
}
|
|
25677
25764
|
),
|
|
25678
|
-
columnSpacers && columnSpacers.end > 0 ? /* @__PURE__ */ (0,
|
|
25765
|
+
columnSpacers && columnSpacers.end > 0 ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25679
25766
|
"td",
|
|
25680
25767
|
{
|
|
25681
25768
|
"aria-hidden": "true",
|
|
@@ -25688,15 +25775,15 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25688
25775
|
]
|
|
25689
25776
|
},
|
|
25690
25777
|
`sk-${i}`
|
|
25691
|
-
)) : readFailure || paginated.length === 0 && !drawsOnlyShutSections ? messageOutsideTable ? null : /* @__PURE__ */ (0,
|
|
25778
|
+
)) : readFailure || paginated.length === 0 && !drawsOnlyShutSections ? messageOutsideTable ? null : /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("td", { colSpan: renderedColSpan, "data-matrx-table-message-cell": true, className: "overflow-visible! px-0 py-12 text-center", children: tableMessage }) }) : bodyEntries.map((entry) => {
|
|
25692
25779
|
if (entry.kind === "spacer") {
|
|
25693
|
-
return /* @__PURE__ */ (0,
|
|
25780
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25694
25781
|
"tr",
|
|
25695
25782
|
{
|
|
25696
25783
|
"aria-hidden": "true",
|
|
25697
25784
|
"data-matrx-table-virtual-spacer": entry.place,
|
|
25698
25785
|
style: { height: `${entry.height}px` },
|
|
25699
|
-
children: /* @__PURE__ */ (0,
|
|
25786
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25700
25787
|
"td",
|
|
25701
25788
|
{
|
|
25702
25789
|
className: "border-0 p-0",
|
|
@@ -25708,7 +25795,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25708
25795
|
);
|
|
25709
25796
|
}
|
|
25710
25797
|
if (entry.kind === "group") {
|
|
25711
|
-
return /* @__PURE__ */ (0,
|
|
25798
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25712
25799
|
TableGroupHeaderRow,
|
|
25713
25800
|
{
|
|
25714
25801
|
group: entry.group,
|
|
@@ -25732,7 +25819,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25732
25819
|
const row = entry.row;
|
|
25733
25820
|
const index = entry.index;
|
|
25734
25821
|
const id = getRowId(row);
|
|
25735
|
-
return /* @__PURE__ */ (0,
|
|
25822
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25736
25823
|
MatrxTableBodyRow,
|
|
25737
25824
|
{
|
|
25738
25825
|
rowId: id,
|
|
@@ -25746,16 +25833,16 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25746
25833
|
id
|
|
25747
25834
|
);
|
|
25748
25835
|
}),
|
|
25749
|
-
entryRow ? /* @__PURE__ */ (0,
|
|
25836
|
+
entryRow ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
25750
25837
|
"tr",
|
|
25751
25838
|
{
|
|
25752
25839
|
"data-matrx-table-entry-row": "",
|
|
25753
25840
|
"aria-label": entryRow.label ?? "New row",
|
|
25754
25841
|
className: "border-b border-border/60 bg-card",
|
|
25755
25842
|
children: [
|
|
25756
|
-
selection ? /* @__PURE__ */ (0,
|
|
25757
|
-
columnSpacers && columnSpacers.start > 0 ? /* @__PURE__ */ (0,
|
|
25758
|
-
renderedColumns.map((column) => /* @__PURE__ */ (0,
|
|
25843
|
+
selection ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("td", { className: "px-2 py-1.5" }) : null,
|
|
25844
|
+
columnSpacers && columnSpacers.start > 0 ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("td", { "aria-hidden": "true", className: "border-0 p-0", style: { width: `${columnSpacers.start}px`, minWidth: `${columnSpacers.start}px` } }) : null,
|
|
25845
|
+
renderedColumns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25759
25846
|
"td",
|
|
25760
25847
|
{
|
|
25761
25848
|
"data-matrx-table-entry-cell": columnId(column),
|
|
@@ -25768,25 +25855,25 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25768
25855
|
},
|
|
25769
25856
|
columnId(column)
|
|
25770
25857
|
)),
|
|
25771
|
-
columnSpacers && columnSpacers.end > 0 ? /* @__PURE__ */ (0,
|
|
25772
|
-
showActionsCol ? /* @__PURE__ */ (0,
|
|
25858
|
+
columnSpacers && columnSpacers.end > 0 ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("td", { "aria-hidden": "true", className: "border-0 p-0", style: { width: `${columnSpacers.end}px`, minWidth: `${columnSpacers.end}px` } }) : null,
|
|
25859
|
+
showActionsCol ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("td", { className: "px-2 py-1.5", children: entryRow.actions ?? null }) : null
|
|
25773
25860
|
]
|
|
25774
25861
|
}
|
|
25775
25862
|
) : null,
|
|
25776
|
-
entryRow?.below ? /* @__PURE__ */ (0,
|
|
25777
|
-
appendQuery !== null && isFetching && !isLoading ? /* @__PURE__ */ (0,
|
|
25863
|
+
entryRow?.below ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("tr", { "data-matrx-table-entry-below": "", className: "bg-card", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("td", { colSpan: renderedColSpan, className: "px-2 py-1.5", children: entryRow.below }) }) : null,
|
|
25864
|
+
appendQuery !== null && isFetching && !isLoading ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("tr", { "data-matrx-table-append-loading-row": true, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25778
25865
|
"td",
|
|
25779
25866
|
{
|
|
25780
25867
|
colSpan: renderedColSpan,
|
|
25781
25868
|
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",
|
|
25782
|
-
children: /* @__PURE__ */ (0,
|
|
25869
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
25783
25870
|
"div",
|
|
25784
25871
|
{
|
|
25785
25872
|
role: "status",
|
|
25786
25873
|
"aria-live": "polite",
|
|
25787
25874
|
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",
|
|
25788
25875
|
children: [
|
|
25789
|
-
/* @__PURE__ */ (0,
|
|
25876
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25790
25877
|
Loader2Icon,
|
|
25791
25878
|
{
|
|
25792
25879
|
"aria-hidden": "true",
|
|
@@ -25802,16 +25889,16 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25802
25889
|
]
|
|
25803
25890
|
}
|
|
25804
25891
|
),
|
|
25805
|
-
/* @__PURE__ */ (0,
|
|
25892
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(MatrxTableChrome, { part: "footer", epoch: footerEpoch, render: () => footerRows.length > 0 || hasSummaryTotals ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("tfoot", { className: cn(
|
|
25806
25893
|
"border-t-2 border-border bg-muted/50 font-semibold",
|
|
25807
25894
|
// Frozen body cells sit at z-20. The sticky totals band is
|
|
25808
25895
|
// a separate stacking context and must sit above them, or a
|
|
25809
25896
|
// frozen first cell covers the totals label at the footer.
|
|
25810
25897
|
hasSummaryTotals && "sticky bottom-0 z-30 bg-muted/95 backdrop-blur-sm"
|
|
25811
25898
|
), children: [
|
|
25812
|
-
hasSummaryTotals ? /* @__PURE__ */ (0,
|
|
25813
|
-
selection ? /* @__PURE__ */ (0,
|
|
25814
|
-
columnSpacers && columnSpacers.start > 0 ? /* @__PURE__ */ (0,
|
|
25899
|
+
hasSummaryTotals ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_jsx_runtime69.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("tr", { "data-matrx-table-summary-totals": true, "data-matrx-table-summary-scope": summaryUsesSource ? "source" : summaryCoverage, children: [
|
|
25900
|
+
selection ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("td", { className: "px-2 py-2" }) : null,
|
|
25901
|
+
columnSpacers && columnSpacers.start > 0 ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25815
25902
|
"td",
|
|
25816
25903
|
{
|
|
25817
25904
|
"aria-hidden": "true",
|
|
@@ -25824,7 +25911,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25824
25911
|
renderedColumns.map((column, columnIndex) => {
|
|
25825
25912
|
const total = summaryTotals.find((candidate) => candidate.id === columnId(column));
|
|
25826
25913
|
const totalAlign = alignForFormat(column);
|
|
25827
|
-
return /* @__PURE__ */ (0,
|
|
25914
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
25828
25915
|
"td",
|
|
25829
25916
|
{
|
|
25830
25917
|
...total ? { "data-matrx-table-summary-total": columnId(column) } : {},
|
|
@@ -25842,19 +25929,19 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25842
25929
|
resizableColumns && column.resizable !== false
|
|
25843
25930
|
),
|
|
25844
25931
|
children: [
|
|
25845
|
-
columnIndex === 0 ? /* @__PURE__ */ (0,
|
|
25932
|
+
columnIndex === 0 ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("span", { "data-matrx-table-summary-total-label": true, className: "text-sm font-semibold text-foreground", children: [
|
|
25846
25933
|
summaryCaption,
|
|
25847
|
-
readView.stale ? /* @__PURE__ */ (0,
|
|
25934
|
+
readView.stale ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "ml-1 text-xs text-amber-700 dark:text-amber-300", children: "Retained rows may be out of date." }) : null
|
|
25848
25935
|
] }) : null,
|
|
25849
|
-
columnIndex === 0 && total?.value != null ? /* @__PURE__ */ (0,
|
|
25936
|
+
columnIndex === 0 && total?.value != null ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "ml-2", children: total.value }) : null,
|
|
25850
25937
|
columnIndex !== 0 ? total?.value : null,
|
|
25851
|
-
total?.unavailable ? /* @__PURE__ */ (0,
|
|
25938
|
+
total?.unavailable ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ErrorBox, { as: "span", className: "sr-only", message: `${columnId(column)} total is unavailable`, operation: "Total this column", origin: "design-system/MatrxDataTable" }) : null
|
|
25852
25939
|
]
|
|
25853
25940
|
},
|
|
25854
25941
|
columnId(column)
|
|
25855
25942
|
);
|
|
25856
25943
|
}),
|
|
25857
|
-
columnSpacers && columnSpacers.end > 0 ? /* @__PURE__ */ (0,
|
|
25944
|
+
columnSpacers && columnSpacers.end > 0 ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25858
25945
|
"td",
|
|
25859
25946
|
{
|
|
25860
25947
|
"aria-hidden": "true",
|
|
@@ -25864,11 +25951,11 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25864
25951
|
},
|
|
25865
25952
|
"matrx-summary-column-spacer-end"
|
|
25866
25953
|
) : null,
|
|
25867
|
-
showActionsCol ? /* @__PURE__ */ (0,
|
|
25954
|
+
showActionsCol ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("td", {}) : null
|
|
25868
25955
|
] }) }) : null,
|
|
25869
|
-
footerRows.map((row, index) => /* @__PURE__ */ (0,
|
|
25870
|
-
selection ? /* @__PURE__ */ (0,
|
|
25871
|
-
columnSpacers && columnSpacers.start > 0 ? /* @__PURE__ */ (0,
|
|
25956
|
+
footerRows.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("tr", { children: [
|
|
25957
|
+
selection ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("td", { className: "px-2 py-2" }) : null,
|
|
25958
|
+
columnSpacers && columnSpacers.start > 0 ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25872
25959
|
"td",
|
|
25873
25960
|
{
|
|
25874
25961
|
"aria-hidden": "true",
|
|
@@ -25878,7 +25965,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25878
25965
|
},
|
|
25879
25966
|
"matrx-column-spacer-start"
|
|
25880
25967
|
) : null,
|
|
25881
|
-
renderedColumns.map((column) => /* @__PURE__ */ (0,
|
|
25968
|
+
renderedColumns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25882
25969
|
"td",
|
|
25883
25970
|
{
|
|
25884
25971
|
className: cn(
|
|
@@ -25898,7 +25985,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25898
25985
|
},
|
|
25899
25986
|
columnId(column)
|
|
25900
25987
|
)),
|
|
25901
|
-
columnSpacers && columnSpacers.end > 0 ? /* @__PURE__ */ (0,
|
|
25988
|
+
columnSpacers && columnSpacers.end > 0 ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25902
25989
|
"td",
|
|
25903
25990
|
{
|
|
25904
25991
|
"aria-hidden": "true",
|
|
@@ -25908,18 +25995,18 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25908
25995
|
},
|
|
25909
25996
|
"matrx-column-spacer-end"
|
|
25910
25997
|
) : null,
|
|
25911
|
-
showActionsCol ? /* @__PURE__ */ (0,
|
|
25998
|
+
showActionsCol ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("td", {}) : null
|
|
25912
25999
|
] }, `footer-${index}`))
|
|
25913
26000
|
] }) : null })
|
|
25914
26001
|
]
|
|
25915
26002
|
}
|
|
25916
26003
|
),
|
|
25917
|
-
messageOutsideTable ? /* @__PURE__ */ (0,
|
|
26004
|
+
messageOutsideTable ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { "data-matrx-table-message-outside": true, className: "py-12 text-center", children: tableMessage }) : null
|
|
25918
26005
|
]
|
|
25919
26006
|
}
|
|
25920
26007
|
),
|
|
25921
|
-
scrollHintLeft ? /* @__PURE__ */ (0,
|
|
25922
|
-
/* @__PURE__ */ (0,
|
|
26008
|
+
scrollHintLeft ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Tooltip, { children: [
|
|
26009
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25923
26010
|
Button,
|
|
25924
26011
|
{
|
|
25925
26012
|
type: "button",
|
|
@@ -25931,13 +26018,13 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25931
26018
|
...scrollHintTop === null ? {} : { style: { top: scrollHintTop } },
|
|
25932
26019
|
className: cn(scrollHintTop === null ? "top-1/2 h-11 w-11" : "h-7 w-7", "absolute left-1.5 z-30 hidden -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"),
|
|
25933
26020
|
onClick: () => scrollTableHorizontally("left"),
|
|
25934
|
-
children: /* @__PURE__ */ (0,
|
|
26021
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ChevronLeftIcon, { className: "h-5 w-5" })
|
|
25935
26022
|
}
|
|
25936
26023
|
) }),
|
|
25937
|
-
/* @__PURE__ */ (0,
|
|
26024
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TooltipContent, { children: "More columns to the left" })
|
|
25938
26025
|
] }) : null,
|
|
25939
|
-
scrollHintRight ? /* @__PURE__ */ (0,
|
|
25940
|
-
/* @__PURE__ */ (0,
|
|
26026
|
+
scrollHintRight ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Tooltip, { children: [
|
|
26027
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25941
26028
|
Button,
|
|
25942
26029
|
{
|
|
25943
26030
|
type: "button",
|
|
@@ -25949,26 +26036,26 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25949
26036
|
style: scrollHintTop === null ? { right: scrollHintRightInset } : { right: scrollHintRightInset, top: scrollHintTop },
|
|
25950
26037
|
className: cn(scrollHintTop === null ? "top-1/2 h-11 w-11" : "h-7 w-7", "transition-[background-color,box-shadow,opacity] absolute z-30 hidden -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"),
|
|
25951
26038
|
onClick: () => scrollTableHorizontally("right"),
|
|
25952
|
-
children: /* @__PURE__ */ (0,
|
|
26039
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ChevronRightIcon, { className: "h-5 w-5" })
|
|
25953
26040
|
}
|
|
25954
26041
|
) }),
|
|
25955
|
-
/* @__PURE__ */ (0,
|
|
26042
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TooltipContent, { children: "More columns to the right" })
|
|
25956
26043
|
] }) : null
|
|
25957
26044
|
] }),
|
|
25958
|
-
appendQuery ? /* @__PURE__ */ (0,
|
|
26045
|
+
appendQuery ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
25959
26046
|
"div",
|
|
25960
26047
|
{
|
|
25961
26048
|
"data-matrx-table-footer": true,
|
|
25962
26049
|
className: "flex min-h-8 shrink-0 flex-wrap items-center gap-2 border-t border-border",
|
|
25963
26050
|
"aria-busy": isLoading || isFetching,
|
|
25964
26051
|
children: [
|
|
25965
|
-
/* @__PURE__ */ (0,
|
|
26052
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
25966
26053
|
"div",
|
|
25967
26054
|
{
|
|
25968
26055
|
...isFetching && !isLoading ? {} : { role: "status", "aria-live": "polite" },
|
|
25969
26056
|
className: "flex w-full min-w-0 items-center gap-2 text-xs text-muted-foreground sm:w-auto sm:flex-1",
|
|
25970
26057
|
children: [
|
|
25971
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
26058
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25972
26059
|
Loader2Icon,
|
|
25973
26060
|
{
|
|
25974
26061
|
"data-matrx-table-append-loader": true,
|
|
@@ -25976,20 +26063,20 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25976
26063
|
className: "h-5 w-5 shrink-0 animate-spin text-primary-ink motion-reduce:animate-none"
|
|
25977
26064
|
}
|
|
25978
26065
|
) : null,
|
|
25979
|
-
/* @__PURE__ */ (0,
|
|
25980
|
-
/* @__PURE__ */ (0,
|
|
25981
|
-
appendQuery.pagination.sourceUntil || appendUsesLocalProcessing ? /* @__PURE__ */ (0,
|
|
25982
|
-
/* @__PURE__ */ (0,
|
|
25983
|
-
/* @__PURE__ */ (0,
|
|
25984
|
-
appendQuery.pagination.sourceUntil ? /* @__PURE__ */ (0,
|
|
26066
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex min-w-0 flex-1 flex-wrap items-center gap-x-2", children: [
|
|
26067
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("p", { className: "min-w-0 break-words font-medium text-foreground", children: isLoading ? "Loading rows\u2026" : readView.failure ? "Nothing loaded \u2014 the read failed" : appendQuery.pagination.sourceRecords ? `${(0, import_format14.formatCount)(processed.length)} ${appendQuery.pagination.sourceRecords.rowLabel}${appendQuery.pagination.sourceRecords.matchedRecords === void 0 ? "" : ` (${(0, import_format14.formatCount)(appendQuery.pagination.sourceRecords.matchedRecords)} matching ${appendQuery.pagination.sourceRecords.label})`} \xB7 ${(0, import_format14.formatCount)(appendQuery.pagination.sourceRecords.loaded)}${appendQuery.pagination.sourceRecords.total === void 0 ? "" : ` / ${(0, import_format14.formatCount)(appendQuery.pagination.sourceRecords.total)}`} ${appendQuery.pagination.sourceRecords.label} loaded` : `${processed.length === data.length ? "" : `${(0, import_format14.formatCount)(processed.length)} matching loaded ${processed.length === 1 ? "row" : "rows"} \xB7 `}${(0, import_format14.formatCount)(data.length)} loaded${appendQuery.pagination.totalItems === void 0 ? "" : ` of ${(0, import_format14.formatCount)(appendQuery.pagination.totalItems)}`}` }),
|
|
26068
|
+
appendQuery.pagination.sourceUntil || appendUsesLocalProcessing ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Tooltip, { children: [
|
|
26069
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("button", { type: "button", "aria-label": "Source coverage", className: "shrink-0 text-xs text-muted-foreground underline decoration-dotted underline-offset-4", children: "Source info" }) }),
|
|
26070
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(TooltipContent, { children: [
|
|
26071
|
+
appendQuery.pagination.sourceUntil ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("p", { children: [
|
|
25985
26072
|
"Source fixed through ",
|
|
25986
26073
|
new Date(appendQuery.pagination.sourceUntil).toLocaleString(),
|
|
25987
26074
|
"."
|
|
25988
26075
|
] }) : null,
|
|
25989
|
-
/* @__PURE__ */ (0,
|
|
26076
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("p", { children: !isLoading && !isFetching && !appendQuery.pagination.loadAll?.isLoading && !scrollPagination.error && !appendQuery.pagination.hasNextPage && appendQuery.pagination.totalItems !== void 0 && data.length === appendQuery.pagination.totalItems ? "All source rows are loaded." : appendUsesLocalProcessing ? sourceOwnsColumnFilters ? "Local processing covers loaded rows; source-owned column filters are applied by the source." : "Local search and filters cover loaded rows." : "Source paging is active." })
|
|
25990
26077
|
] })
|
|
25991
26078
|
] }) : null,
|
|
25992
|
-
scrollPagination.error ? /* @__PURE__ */ (0,
|
|
26079
|
+
scrollPagination.error ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
25993
26080
|
ErrorBox,
|
|
25994
26081
|
{
|
|
25995
26082
|
className: "text-destructive-ink",
|
|
@@ -25999,7 +26086,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
25999
26086
|
origin: "design-system/MatrxDataTable"
|
|
26000
26087
|
}
|
|
26001
26088
|
) : null,
|
|
26002
|
-
appendScrollPolicy?.mode === "suspended" ? /* @__PURE__ */ (0,
|
|
26089
|
+
appendScrollPolicy?.mode === "suspended" ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("p", { role: "status", children: [
|
|
26003
26090
|
appendScrollPolicy.reason,
|
|
26004
26091
|
" Load more remains available."
|
|
26005
26092
|
] }) : null
|
|
@@ -26007,27 +26094,27 @@ function MatrxDataTableCore(coreProps) {
|
|
|
26007
26094
|
]
|
|
26008
26095
|
}
|
|
26009
26096
|
),
|
|
26010
|
-
appendQuery.pagination.sourcePageSize ? /* @__PURE__ */ (0,
|
|
26097
|
+
appendQuery.pagination.sourcePageSize ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
26011
26098
|
Select,
|
|
26012
26099
|
{
|
|
26013
26100
|
value: String(appendQuery.pagination.sourcePageSize.value),
|
|
26014
26101
|
onValueChange: (value) => appendQuery.pagination.sourcePageSize?.onChange(Number(value)),
|
|
26015
26102
|
children: [
|
|
26016
|
-
/* @__PURE__ */ (0,
|
|
26103
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26017
26104
|
SelectTrigger,
|
|
26018
26105
|
{
|
|
26019
26106
|
"aria-label": "Rows per load",
|
|
26020
26107
|
className: "h-8 min-w-20 shrink-0 rounded-md border border-border bg-card px-3 text-sm [&_svg]:size-5",
|
|
26021
26108
|
disabled: isLoading || isFetching || appendQuery.pagination.loadAll?.isLoading,
|
|
26022
|
-
children: /* @__PURE__ */ (0,
|
|
26109
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(SelectValue, {})
|
|
26023
26110
|
}
|
|
26024
26111
|
),
|
|
26025
|
-
/* @__PURE__ */ (0,
|
|
26112
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(SelectContent, { children: appendQuery.pagination.sourcePageSize.options.map((size) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(SelectItem, { value: String(size), children: size }, size)) })
|
|
26026
26113
|
]
|
|
26027
26114
|
}
|
|
26028
26115
|
) : null,
|
|
26029
|
-
/* @__PURE__ */ (0,
|
|
26030
|
-
/* @__PURE__ */ (0,
|
|
26116
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex min-w-0 max-w-full flex-wrap gap-0", children: [
|
|
26117
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26031
26118
|
Button,
|
|
26032
26119
|
{
|
|
26033
26120
|
type: "button",
|
|
@@ -26038,7 +26125,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
26038
26125
|
children: "Load more"
|
|
26039
26126
|
}
|
|
26040
26127
|
),
|
|
26041
|
-
appendQuery.pagination.loadAll ? /* @__PURE__ */ (0,
|
|
26128
|
+
appendQuery.pagination.loadAll ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26042
26129
|
Button,
|
|
26043
26130
|
{
|
|
26044
26131
|
type: "button",
|
|
@@ -26050,7 +26137,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
26050
26137
|
}
|
|
26051
26138
|
) : null
|
|
26052
26139
|
] }),
|
|
26053
|
-
appendQuery.pagination.loadAll?.isLoading ? /* @__PURE__ */ (0,
|
|
26140
|
+
appendQuery.pagination.loadAll?.isLoading ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26054
26141
|
Button,
|
|
26055
26142
|
{
|
|
26056
26143
|
type: "button",
|
|
@@ -26059,7 +26146,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
26059
26146
|
onClick: appendQuery.pagination.loadAll.stop,
|
|
26060
26147
|
children: "Stop loading"
|
|
26061
26148
|
}
|
|
26062
|
-
) : scrollPagination.error ? /* @__PURE__ */ (0,
|
|
26149
|
+
) : scrollPagination.error ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26063
26150
|
Button,
|
|
26064
26151
|
{
|
|
26065
26152
|
type: "button",
|
|
@@ -26068,7 +26155,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
26068
26155
|
onClick: appendQuery.pagination.retrySource ?? (appendQuery.pagination.hasNextPage ? appendQuery.pagination.loadNextPage : appendQuery.pagination.refresh),
|
|
26069
26156
|
children: appendQuery.pagination.retrySource ? "Retry source" : appendQuery.pagination.hasNextPage ? "Retry" : "Reload rows"
|
|
26070
26157
|
}
|
|
26071
|
-
) : !isLoading && appendQuery.pagination.totalItems !== void 0 && data.length === appendQuery.pagination.totalItems ? /* @__PURE__ */ (0,
|
|
26158
|
+
) : !isLoading && appendQuery.pagination.totalItems !== void 0 && data.length === appendQuery.pagination.totalItems ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "min-w-0 max-w-full break-words whitespace-normal px-3 text-xs text-muted-foreground sm:text-sm", children: "All rows loaded" }) : null
|
|
26072
26159
|
]
|
|
26073
26160
|
}
|
|
26074
26161
|
) : embedded && !hidePagination && !drillGrouped && (localProgressiveEnabled || pageCount <= 1 || remoteQuery?.mode === "controlled") ? (
|
|
@@ -26076,7 +26163,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
26076
26163
|
// rows than the card's first batch, ONE quiet "Show more" with its honest count, drawn
|
|
26077
26164
|
// in the card's footer row beside "+ Add" when the card has one. Rows held locally are
|
|
26078
26165
|
// revealed; a server-paged source is asked for a bigger first page (a real fetch).
|
|
26079
|
-
localProgressiveEnabled && progressiveRows.hasMore ? /* @__PURE__ */ (0,
|
|
26166
|
+
localProgressiveEnabled && progressiveRows.hasMore ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26080
26167
|
MatrxTableCardShowMore,
|
|
26081
26168
|
{
|
|
26082
26169
|
card: tableCard,
|
|
@@ -26084,7 +26171,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
26084
26171
|
total: totalItems,
|
|
26085
26172
|
onShowMore: () => void chromeLatest.current.showMore()
|
|
26086
26173
|
}
|
|
26087
|
-
) : remoteQuery?.mode === "controlled" && !isLoading && totalItems > data.length ? /* @__PURE__ */ (0,
|
|
26174
|
+
) : remoteQuery?.mode === "controlled" && !isLoading && totalItems > data.length ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26088
26175
|
MatrxTableCardShowMore,
|
|
26089
26176
|
{
|
|
26090
26177
|
card: tableCard,
|
|
@@ -26098,7 +26185,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
26098
26185
|
// Keep the footer and disabled page controls in place for an empty table,
|
|
26099
26186
|
// including an unfiltered empty source. The empty-state copy explains why
|
|
26100
26187
|
// there are no records; the stable footer preserves the table controls.
|
|
26101
|
-
/* @__PURE__ */ (0,
|
|
26188
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(MatrxTableChrome, { part: "pagination", epoch: paginationEpoch, render: () => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26102
26189
|
GenericTablePagination,
|
|
26103
26190
|
{
|
|
26104
26191
|
totalItems,
|
|
@@ -26128,13 +26215,13 @@ function MatrxDataTableCore(coreProps) {
|
|
|
26128
26215
|
}
|
|
26129
26216
|
) }) })
|
|
26130
26217
|
) : null,
|
|
26131
|
-
selection && selectionCount > 0 ? /* @__PURE__ */ (0,
|
|
26218
|
+
selection && selectionCount > 0 ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
26132
26219
|
"div",
|
|
26133
26220
|
{
|
|
26134
26221
|
"data-matrx-table-bulk-bar": true,
|
|
26135
26222
|
className: "mt-2 flex shrink-0 flex-nowrap items-center gap-2 rounded-md border border-primary/30 bg-primary/5 px-2 py-1.5",
|
|
26136
26223
|
children: [
|
|
26137
|
-
/* @__PURE__ */ (0,
|
|
26224
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
26138
26225
|
"span",
|
|
26139
26226
|
{
|
|
26140
26227
|
"data-matrx-table-selection-count": true,
|
|
@@ -26150,7 +26237,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
26150
26237
|
]
|
|
26151
26238
|
}
|
|
26152
26239
|
),
|
|
26153
|
-
offerSelectAllMatching && selectionMatchingTotal !== void 0 ? /* @__PURE__ */ (0,
|
|
26240
|
+
offerSelectAllMatching && selectionMatchingTotal !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26154
26241
|
Button2,
|
|
26155
26242
|
{
|
|
26156
26243
|
type: "button",
|
|
@@ -26160,12 +26247,12 @@ function MatrxDataTableCore(coreProps) {
|
|
|
26160
26247
|
children: `Select all ${(0, import_format14.formatCount)(selectionMatchingTotal)}`
|
|
26161
26248
|
}
|
|
26162
26249
|
) : null,
|
|
26163
|
-
/* @__PURE__ */ (0,
|
|
26250
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26164
26251
|
Button2,
|
|
26165
26252
|
{
|
|
26166
26253
|
type: "button",
|
|
26167
26254
|
variant: "quiet",
|
|
26168
|
-
icon: /* @__PURE__ */ (0,
|
|
26255
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(XIcon, { "aria-hidden": "true" }),
|
|
26169
26256
|
onClick: () => {
|
|
26170
26257
|
lastToggledIndex.current = null;
|
|
26171
26258
|
if (allMatching) setAllMatching(false);
|
|
@@ -26174,13 +26261,13 @@ function MatrxDataTableCore(coreProps) {
|
|
|
26174
26261
|
children: "Clear"
|
|
26175
26262
|
}
|
|
26176
26263
|
),
|
|
26177
|
-
/* @__PURE__ */ (0,
|
|
26264
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
26178
26265
|
"div",
|
|
26179
26266
|
{
|
|
26180
26267
|
"data-matrx-table-bulk-actions": true,
|
|
26181
26268
|
className: "flex min-w-0 flex-1 flex-nowrap items-center justify-start gap-0 overflow-x-auto sm:justify-end [&>*]:shrink-0",
|
|
26182
26269
|
children: [
|
|
26183
|
-
effectiveCopy ? /* @__PURE__ */ (0,
|
|
26270
|
+
effectiveCopy ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26184
26271
|
CopyButtons,
|
|
26185
26272
|
{
|
|
26186
26273
|
size: "icon",
|
|
@@ -26219,7 +26306,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
26219
26306
|
}
|
|
26220
26307
|
) : null
|
|
26221
26308
|
] }),
|
|
26222
|
-
/* @__PURE__ */ (0,
|
|
26309
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26223
26310
|
ColumnManager,
|
|
26224
26311
|
{
|
|
26225
26312
|
open: columnManagerOpen,
|
|
@@ -26231,7 +26318,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
26231
26318
|
defaults: columnManagerDefaults
|
|
26232
26319
|
}
|
|
26233
26320
|
),
|
|
26234
|
-
detailEnabled && selectedRow ? /* @__PURE__ */ (0,
|
|
26321
|
+
detailEnabled && selectedRow ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26235
26322
|
SidePanelSurface,
|
|
26236
26323
|
{
|
|
26237
26324
|
title: resolveStringTitle(
|
|
@@ -26243,8 +26330,8 @@ function MatrxDataTableCore(coreProps) {
|
|
|
26243
26330
|
onClose: () => setSelectedId(null),
|
|
26244
26331
|
openRequest,
|
|
26245
26332
|
defaultWidth: detail?.defaultWidth ?? 480,
|
|
26246
|
-
headerActions: /* @__PURE__ */ (0,
|
|
26247
|
-
effectiveCopy && showRowCopy ? /* @__PURE__ */ (0,
|
|
26333
|
+
headerActions: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
26334
|
+
effectiveCopy && showRowCopy ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26248
26335
|
TableRowCopyControl,
|
|
26249
26336
|
{
|
|
26250
26337
|
size: "icon",
|
|
@@ -26257,8 +26344,8 @@ function MatrxDataTableCore(coreProps) {
|
|
|
26257
26344
|
) : null,
|
|
26258
26345
|
detail?.headerActions?.(selectedRow),
|
|
26259
26346
|
renderRecordPageDoor(selectedRow),
|
|
26260
|
-
windowEnabled ? /* @__PURE__ */ (0,
|
|
26261
|
-
/* @__PURE__ */ (0,
|
|
26347
|
+
windowEnabled ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Tooltip, { children: [
|
|
26348
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26262
26349
|
Button,
|
|
26263
26350
|
{
|
|
26264
26351
|
type: "button",
|
|
@@ -26268,10 +26355,10 @@ function MatrxDataTableCore(coreProps) {
|
|
|
26268
26355
|
className: "h-7 w-7",
|
|
26269
26356
|
"aria-label": "Open in window",
|
|
26270
26357
|
onClick: () => openWindow(selectedRow),
|
|
26271
|
-
children: /* @__PURE__ */ (0,
|
|
26358
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(PanelRightIcon, { className: "h-5 w-5" })
|
|
26272
26359
|
}
|
|
26273
26360
|
) }),
|
|
26274
|
-
/* @__PURE__ */ (0,
|
|
26361
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TooltipContent, { children: "Open in window" })
|
|
26275
26362
|
] }) : null
|
|
26276
26363
|
] }),
|
|
26277
26364
|
children: detail?.render ? (
|
|
@@ -26282,7 +26369,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
26282
26369
|
// fixes the whole class at once — a custom body that already
|
|
26283
26370
|
// scrolls (`h-full` + `overflow-y-auto` root) still resolves to
|
|
26284
26371
|
// this container's height, so no second scrollbar appears.
|
|
26285
|
-
/* @__PURE__ */ (0,
|
|
26372
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "h-full min-h-0 overflow-y-auto", children: detail.render(selectedRow, {
|
|
26286
26373
|
closeDetail: () => setSelectedId(null),
|
|
26287
26374
|
openDetail: () => openDetail(selectedRow),
|
|
26288
26375
|
openWindow: () => openWindow(selectedRow),
|
|
@@ -26290,7 +26377,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
26290
26377
|
hasPendingEdits: Boolean(edits[getRowId(selectedRow)]),
|
|
26291
26378
|
discardPendingEdits: () => discardRowEdits(getRowId(selectedRow))
|
|
26292
26379
|
}) })
|
|
26293
|
-
) : /* @__PURE__ */ (0,
|
|
26380
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26294
26381
|
DataRowInspector,
|
|
26295
26382
|
{
|
|
26296
26383
|
row: selectedRow,
|
|
@@ -26304,7 +26391,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
26304
26391
|
)
|
|
26305
26392
|
}
|
|
26306
26393
|
) : null,
|
|
26307
|
-
windowRow ? /* @__PURE__ */ (0,
|
|
26394
|
+
windowRow ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26308
26395
|
DataRowWindow,
|
|
26309
26396
|
{
|
|
26310
26397
|
isOpen: true,
|
|
@@ -26315,10 +26402,10 @@ function MatrxDataTableCore(coreProps) {
|
|
|
26315
26402
|
height: windowConfig?.height,
|
|
26316
26403
|
windowId: `matrx-data-row-${urlState?.id ?? "local"}-${getRowId(windowRow)}`,
|
|
26317
26404
|
defaultTab: windowConfig?.defaultTab,
|
|
26318
|
-
headerActions: /* @__PURE__ */ (0,
|
|
26405
|
+
headerActions: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
26319
26406
|
renderRecordPageDoor(windowRow),
|
|
26320
|
-
windowConfig?.openOnRowClick === true && detail?.enabled === true ? /* @__PURE__ */ (0,
|
|
26321
|
-
/* @__PURE__ */ (0,
|
|
26407
|
+
windowConfig?.openOnRowClick === true && detail?.enabled === true ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Tooltip, { children: [
|
|
26408
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26322
26409
|
Button,
|
|
26323
26410
|
{
|
|
26324
26411
|
type: "button",
|
|
@@ -26331,12 +26418,12 @@ function MatrxDataTableCore(coreProps) {
|
|
|
26331
26418
|
closeWindow();
|
|
26332
26419
|
openDetail(windowRow);
|
|
26333
26420
|
},
|
|
26334
|
-
children: /* @__PURE__ */ (0,
|
|
26421
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(PanelRightIcon, { className: "h-5 w-5" })
|
|
26335
26422
|
}
|
|
26336
26423
|
) }),
|
|
26337
|
-
/* @__PURE__ */ (0,
|
|
26424
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TooltipContent, { children: "Open in side panel" })
|
|
26338
26425
|
] }) : null,
|
|
26339
|
-
effectiveCopy && showRowCopy ? /* @__PURE__ */ (0,
|
|
26426
|
+
effectiveCopy && showRowCopy ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26340
26427
|
TableRowCopyControl,
|
|
26341
26428
|
{
|
|
26342
26429
|
size: "icon",
|
|
@@ -26355,7 +26442,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
26355
26442
|
closeWindow,
|
|
26356
26443
|
hasPendingEdits: Boolean(edits[getRowId(windowRow)]),
|
|
26357
26444
|
discardPendingEdits: () => discardRowEdits(getRowId(windowRow))
|
|
26358
|
-
}) ?? /* @__PURE__ */ (0,
|
|
26445
|
+
}) ?? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26359
26446
|
DataRowInspector,
|
|
26360
26447
|
{
|
|
26361
26448
|
row: windowRow,
|
|
@@ -26384,7 +26471,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
26384
26471
|
discardPendingEdits: () => discardRowEdits(getRowId(windowRow))
|
|
26385
26472
|
}) : editableFieldColumns(windowRow).length > 0 ? (
|
|
26386
26473
|
// THE DEFAULT EDIT TAB: the editable columns with the grid's own editors.
|
|
26387
|
-
/* @__PURE__ */ (0,
|
|
26474
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26388
26475
|
DataRowInspector,
|
|
26389
26476
|
{
|
|
26390
26477
|
row: windowRow,
|
|
@@ -26404,7 +26491,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
26404
26491
|
})
|
|
26405
26492
|
}
|
|
26406
26493
|
) : null,
|
|
26407
|
-
missingWindowRowId ? /* @__PURE__ */ (0,
|
|
26494
|
+
missingWindowRowId ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26408
26495
|
DataRowWindow,
|
|
26409
26496
|
{
|
|
26410
26497
|
isOpen: true,
|
|
@@ -26413,7 +26500,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
26413
26500
|
width: 520,
|
|
26414
26501
|
height: 360,
|
|
26415
26502
|
windowId: `matrx-data-row-${urlState?.id ?? "local"}-missing-${missingWindowRowId}`,
|
|
26416
|
-
viewContent: /* @__PURE__ */ (0,
|
|
26503
|
+
viewContent: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26417
26504
|
MissingRowNotice,
|
|
26418
26505
|
{
|
|
26419
26506
|
id: missingWindowRowId,
|
|
@@ -26424,15 +26511,15 @@ function MatrxDataTableCore(coreProps) {
|
|
|
26424
26511
|
)
|
|
26425
26512
|
}
|
|
26426
26513
|
) : null,
|
|
26427
|
-
editEnabled ? /* @__PURE__ */ (0,
|
|
26428
|
-
foreignDrafts.length > 0 ? /* @__PURE__ */ (0,
|
|
26514
|
+
editEnabled ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
|
|
26515
|
+
foreignDrafts.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
26429
26516
|
"div",
|
|
26430
26517
|
{
|
|
26431
26518
|
"data-matrx-foreign-drafts": true,
|
|
26432
26519
|
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",
|
|
26433
26520
|
children: [
|
|
26434
|
-
/* @__PURE__ */ (0,
|
|
26435
|
-
/* @__PURE__ */ (0,
|
|
26521
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { children: "Unsaved edits from previous results" }),
|
|
26522
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26436
26523
|
CopyButtons,
|
|
26437
26524
|
{
|
|
26438
26525
|
size: "xs",
|
|
@@ -26441,11 +26528,11 @@ function MatrxDataTableCore(coreProps) {
|
|
|
26441
26528
|
json: () => foreignDraftPayload
|
|
26442
26529
|
}
|
|
26443
26530
|
),
|
|
26444
|
-
/* @__PURE__ */ (0,
|
|
26531
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Button, { type: "button", size: "sm", variant: "ghost", className: "h-7 text-xs text-destructive-ink", onClick: () => setConfirmForeignDraftDiscard(true), children: "Discard drafts" })
|
|
26445
26532
|
]
|
|
26446
26533
|
}
|
|
26447
26534
|
) : null,
|
|
26448
|
-
/* @__PURE__ */ (0,
|
|
26535
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26449
26536
|
ConfirmDialog,
|
|
26450
26537
|
{
|
|
26451
26538
|
open: confirmForeignDraftDiscard,
|
|
@@ -26465,7 +26552,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
26465
26552
|
}
|
|
26466
26553
|
}
|
|
26467
26554
|
),
|
|
26468
|
-
/* @__PURE__ */ (0,
|
|
26555
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26469
26556
|
DirtySavePill,
|
|
26470
26557
|
{
|
|
26471
26558
|
changeCount,
|
|
@@ -26478,11 +26565,11 @@ function MatrxDataTableCore(coreProps) {
|
|
|
26478
26565
|
]
|
|
26479
26566
|
}
|
|
26480
26567
|
),
|
|
26481
|
-
/* @__PURE__ */ (0,
|
|
26568
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_core4.DragOverlay, { children: draggedRow ? (
|
|
26482
26569
|
// w-max: the overlay inherits the ACTIVE node's size, and the active
|
|
26483
26570
|
// node is the 16px grip handle — without it the label wraps to one
|
|
26484
26571
|
// character per line.
|
|
26485
|
-
/* @__PURE__ */ (0,
|
|
26572
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.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" })
|
|
26486
26573
|
) : null })
|
|
26487
26574
|
]
|
|
26488
26575
|
}
|
|
@@ -26499,7 +26586,7 @@ function HierarchyDragHandle({
|
|
|
26499
26586
|
id,
|
|
26500
26587
|
disabled
|
|
26501
26588
|
});
|
|
26502
|
-
return /* @__PURE__ */ (0,
|
|
26589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26503
26590
|
"button",
|
|
26504
26591
|
{
|
|
26505
26592
|
ref: setNodeRef,
|
|
@@ -26511,7 +26598,7 @@ function HierarchyDragHandle({
|
|
|
26511
26598
|
onClick: (event) => event.stopPropagation(),
|
|
26512
26599
|
...attributes,
|
|
26513
26600
|
...listeners,
|
|
26514
|
-
children: /* @__PURE__ */ (0,
|
|
26601
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(GripVerticalIcon, { className: "h-3.5 w-3.5" })
|
|
26515
26602
|
}
|
|
26516
26603
|
);
|
|
26517
26604
|
}
|
|
@@ -26520,7 +26607,7 @@ function HierarchyRootDropTarget({
|
|
|
26520
26607
|
draggedLabel
|
|
26521
26608
|
}) {
|
|
26522
26609
|
const { isOver, setNodeRef } = (0, import_core4.useDroppable)({ id: "__root__" });
|
|
26523
|
-
return /* @__PURE__ */ (0,
|
|
26610
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
26524
26611
|
"div",
|
|
26525
26612
|
{
|
|
26526
26613
|
ref: setNodeRef,
|
|
@@ -26530,8 +26617,8 @@ function HierarchyRootDropTarget({
|
|
|
26530
26617
|
isOver && "border-solid bg-primary/20 shadow-md shadow-primary/25"
|
|
26531
26618
|
),
|
|
26532
26619
|
children: [
|
|
26533
|
-
/* @__PURE__ */ (0,
|
|
26534
|
-
/* @__PURE__ */ (0,
|
|
26620
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "truncate", children: draggedLabel }),
|
|
26621
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "text-primary-ink/75", children: label })
|
|
26535
26622
|
]
|
|
26536
26623
|
}
|
|
26537
26624
|
);
|
|
@@ -26540,7 +26627,7 @@ function HierarchyDragIndicatorLayer({
|
|
|
26540
26627
|
scrollRef,
|
|
26541
26628
|
resolve
|
|
26542
26629
|
}) {
|
|
26543
|
-
const [indicator, setIndicator] = (0,
|
|
26630
|
+
const [indicator, setIndicator] = (0, import_react47.useState)(
|
|
26544
26631
|
null
|
|
26545
26632
|
);
|
|
26546
26633
|
(0, import_core4.useDndMonitor)({
|
|
@@ -26580,7 +26667,7 @@ function HierarchyDragIndicatorLayer({
|
|
|
26580
26667
|
const { preview } = indicator;
|
|
26581
26668
|
const indent = indicator.left + 10 + preview.depth * 12;
|
|
26582
26669
|
if (preview.position === "inside") {
|
|
26583
|
-
return /* @__PURE__ */ (0,
|
|
26670
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26584
26671
|
"div",
|
|
26585
26672
|
{
|
|
26586
26673
|
"aria-hidden": "true",
|
|
@@ -26592,7 +26679,7 @@ function HierarchyDragIndicatorLayer({
|
|
|
26592
26679
|
width: Math.max(0, indicator.width - 4),
|
|
26593
26680
|
height: indicator.height
|
|
26594
26681
|
},
|
|
26595
|
-
children: /* @__PURE__ */ (0,
|
|
26682
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
26596
26683
|
"span",
|
|
26597
26684
|
{
|
|
26598
26685
|
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-ink",
|
|
@@ -26607,7 +26694,7 @@ function HierarchyDragIndicatorLayer({
|
|
|
26607
26694
|
);
|
|
26608
26695
|
}
|
|
26609
26696
|
const lineTop = preview.position === "before" ? indicator.top - 1 : indicator.top + indicator.height - 1;
|
|
26610
|
-
return /* @__PURE__ */ (0,
|
|
26697
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26611
26698
|
"div",
|
|
26612
26699
|
{
|
|
26613
26700
|
"aria-hidden": "true",
|
|
@@ -26618,9 +26705,9 @@ function HierarchyDragIndicatorLayer({
|
|
|
26618
26705
|
left: indent,
|
|
26619
26706
|
width: Math.max(0, indicator.left + indicator.width - indent - 8)
|
|
26620
26707
|
},
|
|
26621
|
-
children: /* @__PURE__ */ (0,
|
|
26622
|
-
/* @__PURE__ */ (0,
|
|
26623
|
-
/* @__PURE__ */ (0,
|
|
26708
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "relative h-0.5 rounded-full bg-primary", children: [
|
|
26709
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.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" }),
|
|
26710
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
26624
26711
|
"span",
|
|
26625
26712
|
{
|
|
26626
26713
|
className: cn(
|
|
@@ -26644,9 +26731,9 @@ function HierarchyDroppableRow({
|
|
|
26644
26731
|
children
|
|
26645
26732
|
}) {
|
|
26646
26733
|
const { setNodeRef } = (0, import_core4.useDroppable)({ id, disabled });
|
|
26647
|
-
if (!(0,
|
|
26734
|
+
if (!(0, import_react47.isValidElement)(children) || children.type !== "tr") return children;
|
|
26648
26735
|
const row = children;
|
|
26649
|
-
return (0,
|
|
26736
|
+
return (0, import_react47.cloneElement)(row, {
|
|
26650
26737
|
ref: setNodeRef,
|
|
26651
26738
|
className: row.props.className
|
|
26652
26739
|
});
|
|
@@ -26661,7 +26748,7 @@ function ColumnHeaderDropZone({
|
|
|
26661
26748
|
disabled: !enabled,
|
|
26662
26749
|
data: { matrxDragKind: "column-header", columnId: id }
|
|
26663
26750
|
});
|
|
26664
|
-
return /* @__PURE__ */ (0,
|
|
26751
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { ref: setNodeRef, className: "flex min-w-0 items-center", children });
|
|
26665
26752
|
}
|
|
26666
26753
|
function fixedUtilityWidth(width) {
|
|
26667
26754
|
return width === void 0 ? void 0 : { width: `${width}px`, minWidth: `${width}px`, maxWidth: `${width}px` };
|
|
@@ -26710,7 +26797,7 @@ function TableGroupHeaderRow({
|
|
|
26710
26797
|
const qualifier = sourceCount !== null || scope === "all" ? "" : scope === "page" ? " on this page" : " loaded";
|
|
26711
26798
|
const summary = `${(0, import_format14.formatCount)(count)} ${noun}${qualifier}`;
|
|
26712
26799
|
const [first, ...rest] = columns;
|
|
26713
|
-
return /* @__PURE__ */ (0,
|
|
26800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26714
26801
|
MatrxTableGroupHeaderRow,
|
|
26715
26802
|
{
|
|
26716
26803
|
groupKey: group.key,
|
|
@@ -26760,14 +26847,14 @@ function columnWidthVar(width, resizedWidth, id, resizable) {
|
|
|
26760
26847
|
};
|
|
26761
26848
|
}
|
|
26762
26849
|
function DefaultJsonCell({ value }) {
|
|
26763
|
-
const [open, setOpen] = (0,
|
|
26850
|
+
const [open, setOpen] = (0, import_react47.useState)(false);
|
|
26764
26851
|
const host = useMatrxDataTableHost();
|
|
26765
26852
|
const Viewer = host.JsonViewer;
|
|
26766
26853
|
const text = JSON.stringify(value, null, 2);
|
|
26767
26854
|
const summary = Array.isArray(value) ? `${value.length} items` : Object.keys(value).slice(0, 3).join(", ") || "Empty object";
|
|
26768
|
-
return /* @__PURE__ */ (0,
|
|
26769
|
-
/* @__PURE__ */ (0,
|
|
26770
|
-
/* @__PURE__ */ (0,
|
|
26855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
|
|
26856
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Tooltip, { children: [
|
|
26857
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("button", { type: "button", className: "block max-w-full truncate text-left", onClick: (event) => {
|
|
26771
26858
|
event.stopPropagation();
|
|
26772
26859
|
setOpen(true);
|
|
26773
26860
|
}, style: { display: "-webkit-box", WebkitLineClamp: 2, WebkitBoxOrient: "vertical", overflow: "hidden", whiteSpace: "normal", overflowWrap: "anywhere" }, "aria-label": "Open JSON value", children: [
|
|
@@ -26775,9 +26862,9 @@ function DefaultJsonCell({ value }) {
|
|
|
26775
26862
|
" ",
|
|
26776
26863
|
summary
|
|
26777
26864
|
] }) }),
|
|
26778
|
-
/* @__PURE__ */ (0,
|
|
26865
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TooltipContent, { className: "max-w-md max-h-80 overflow-auto whitespace-pre-wrap break-words", children: text })
|
|
26779
26866
|
] }),
|
|
26780
|
-
/* @__PURE__ */ (0,
|
|
26867
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(DataRowWindow, { isOpen: open, onClose: () => setOpen(false), title: "JSON value", row: value, viewContent: Viewer ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Viewer, { data: value }) : /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("pre", { className: "overflow-auto whitespace-pre-wrap p-3 text-xs", children: text }) })
|
|
26781
26868
|
] });
|
|
26782
26869
|
}
|
|
26783
26870
|
function DefaultMarkerCell({
|
|
@@ -26786,8 +26873,8 @@ function DefaultMarkerCell({
|
|
|
26786
26873
|
}) {
|
|
26787
26874
|
const label = marker === "favorite" ? value ? "Favorite" : "Not favorite" : value ? "Pinned" : "Not pinned";
|
|
26788
26875
|
const Icon2 = marker === "favorite" ? StarIcon : PinIcon;
|
|
26789
|
-
return /* @__PURE__ */ (0,
|
|
26790
|
-
/* @__PURE__ */ (0,
|
|
26876
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Tooltip, { children: [
|
|
26877
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26791
26878
|
"span",
|
|
26792
26879
|
{
|
|
26793
26880
|
role: "img",
|
|
@@ -26796,10 +26883,10 @@ function DefaultMarkerCell({
|
|
|
26796
26883
|
"inline-flex size-5 items-center justify-center",
|
|
26797
26884
|
value ? "text-amber-500" : "text-muted-foreground/45"
|
|
26798
26885
|
),
|
|
26799
|
-
children: /* @__PURE__ */ (0,
|
|
26886
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Icon2, { className: "size-4", ...value ? { fill: "currentColor" } : {} })
|
|
26800
26887
|
}
|
|
26801
26888
|
) }),
|
|
26802
|
-
/* @__PURE__ */ (0,
|
|
26889
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TooltipContent, { children: label })
|
|
26803
26890
|
] });
|
|
26804
26891
|
}
|
|
26805
26892
|
function renderFooterCell(row, col, index) {
|
|
@@ -26809,7 +26896,7 @@ function renderFooterCell(row, col, index) {
|
|
|
26809
26896
|
function renderCell(row, col, index) {
|
|
26810
26897
|
if (col.loading?.(row)) {
|
|
26811
26898
|
const align = alignForFormat(col);
|
|
26812
|
-
return /* @__PURE__ */ (0,
|
|
26899
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26813
26900
|
Skeleton,
|
|
26814
26901
|
{
|
|
26815
26902
|
"data-matrx-table-cell-loading": "",
|
|
@@ -26820,13 +26907,13 @@ function renderCell(row, col, index) {
|
|
|
26820
26907
|
if (col.cell) return col.cell(row, index);
|
|
26821
26908
|
const raw = getCellValue(row, col);
|
|
26822
26909
|
const formattedByDeclaration = formatColumnValue(col, raw);
|
|
26823
|
-
if (formattedByDeclaration) return /* @__PURE__ */ (0,
|
|
26910
|
+
if (formattedByDeclaration) return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(FormattedCell, { result: formattedByDeclaration });
|
|
26824
26911
|
const kind = col.cellKind ?? "auto";
|
|
26825
26912
|
const asUuid = kind === "uuid" || kind === "fk" || kind === "auto" && (0, import_uuid2.isUuidValue)(raw);
|
|
26826
26913
|
if (asUuid && typeof raw === "string") {
|
|
26827
26914
|
const forbidden = typeof col.fk?.forbidden === "function" ? col.fk.forbidden(raw, row) : Boolean(col.fk?.forbidden);
|
|
26828
26915
|
const declaredToken = typeof col.fk?.token === "function" ? col.fk.token(row) : col.fk?.token;
|
|
26829
|
-
return /* @__PURE__ */ (0,
|
|
26916
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
26830
26917
|
RecordId,
|
|
26831
26918
|
{
|
|
26832
26919
|
value: raw,
|
|
@@ -26838,14 +26925,14 @@ function renderCell(row, col, index) {
|
|
|
26838
26925
|
}
|
|
26839
26926
|
);
|
|
26840
26927
|
}
|
|
26841
|
-
if (raw !== null && typeof raw === "object" && !(raw instanceof Date)) return /* @__PURE__ */ (0,
|
|
26928
|
+
if (raw !== null && typeof raw === "object" && !(raw instanceof Date)) return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(DefaultJsonCell, { value: raw });
|
|
26842
26929
|
if (typeof raw === "boolean") {
|
|
26843
26930
|
const marker = resolveColumnMarker(col);
|
|
26844
|
-
if (marker) return /* @__PURE__ */ (0,
|
|
26845
|
-
return /* @__PURE__ */ (0,
|
|
26931
|
+
if (marker) return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(DefaultMarkerCell, { marker, value: raw });
|
|
26932
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: raw ? "rounded bg-emerald-500/10 px-1.5 py-0.5 text-xs text-emerald-600" : "rounded bg-slate-500/10 px-1.5 py-0.5 text-xs text-muted-foreground", children: raw ? "Yes" : "No" });
|
|
26846
26933
|
}
|
|
26847
26934
|
const formatted = formatTableDisplayValue(raw);
|
|
26848
|
-
return /* @__PURE__ */ (0,
|
|
26935
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "block", title: formatted, style: { display: "-webkit-box", WebkitLineClamp: 2, WebkitBoxOrient: "vertical", overflow: "hidden", overflowWrap: "anywhere" }, children: formatted });
|
|
26849
26936
|
}
|
|
26850
26937
|
function resolveStringTitle(title, fallback) {
|
|
26851
26938
|
if (typeof title === "string" && title.trim()) return title;
|
|
@@ -26854,8 +26941,8 @@ function resolveStringTitle(title, fallback) {
|
|
|
26854
26941
|
}
|
|
26855
26942
|
|
|
26856
26943
|
// src/data-table/MatrxTableCard.tsx
|
|
26857
|
-
var
|
|
26858
|
-
var
|
|
26944
|
+
var import_react48 = require("react");
|
|
26945
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
26859
26946
|
function nounText(noun) {
|
|
26860
26947
|
return `${noun.count.toLocaleString()} ${noun.count === 1 ? noun.singular : noun.plural}`;
|
|
26861
26948
|
}
|
|
@@ -26878,10 +26965,10 @@ function MatrxTableCard({
|
|
|
26878
26965
|
className
|
|
26879
26966
|
}) {
|
|
26880
26967
|
const { Link } = useMatrxDataTableHost();
|
|
26881
|
-
const [toolbarSlot, setToolbarSlot] = (0,
|
|
26882
|
-
const [footerSlot, setFooterSlot] = (0,
|
|
26883
|
-
const [reportedTotal, setReportedTotal] = (0,
|
|
26884
|
-
const context = (0,
|
|
26968
|
+
const [toolbarSlot, setToolbarSlot] = (0, import_react48.useState)(null);
|
|
26969
|
+
const [footerSlot, setFooterSlot] = (0, import_react48.useState)(null);
|
|
26970
|
+
const [reportedTotal, setReportedTotal] = (0, import_react48.useState)(void 0);
|
|
26971
|
+
const context = (0, import_react48.useMemo)(
|
|
26885
26972
|
() => ({ appearance: "embedded", toolbarSlot, footerSlot, initialRows, reportTotal: setReportedTotal }),
|
|
26886
26973
|
[toolbarSlot, footerSlot, initialRows]
|
|
26887
26974
|
);
|
|
@@ -26894,8 +26981,8 @@ function MatrxTableCard({
|
|
|
26894
26981
|
...facts ?? []
|
|
26895
26982
|
];
|
|
26896
26983
|
const ghostButton = cn(buttonVariants({ variant: "ghost", size: "sm" }), "h-8 gap-1 px-2");
|
|
26897
|
-
const renderLink = (href, className2, content) => Link ? /* @__PURE__ */ (0,
|
|
26898
|
-
return /* @__PURE__ */ (0,
|
|
26984
|
+
const renderLink = (href, className2, content) => Link ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Link, { href, className: className2, children: content }) : /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("a", { href, className: className2, children: content });
|
|
26985
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(MatrxTableCardContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
26899
26986
|
"section",
|
|
26900
26987
|
{
|
|
26901
26988
|
"data-matrx-table-card": true,
|
|
@@ -26904,10 +26991,10 @@ function MatrxTableCard({
|
|
|
26904
26991
|
className
|
|
26905
26992
|
),
|
|
26906
26993
|
children: [
|
|
26907
|
-
railClassName ? /* @__PURE__ */ (0,
|
|
26908
|
-
/* @__PURE__ */ (0,
|
|
26909
|
-
/* @__PURE__ */ (0,
|
|
26910
|
-
icon ? /* @__PURE__ */ (0,
|
|
26994
|
+
railClassName ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("span", { "aria-hidden": true, className: cn("absolute inset-y-0 left-0 w-1 opacity-70", railClassName) }) : null,
|
|
26995
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("header", { "data-matrx-table-card-header": true, className: "mb-4 flex flex-wrap items-start justify-between gap-3", children: [
|
|
26996
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "flex min-w-0 items-center gap-3", children: [
|
|
26997
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
26911
26998
|
"div",
|
|
26912
26999
|
{
|
|
26913
27000
|
"aria-hidden": true,
|
|
@@ -26915,25 +27002,25 @@ function MatrxTableCard({
|
|
|
26915
27002
|
children: icon
|
|
26916
27003
|
}
|
|
26917
27004
|
) : null,
|
|
26918
|
-
/* @__PURE__ */ (0,
|
|
26919
|
-
/* @__PURE__ */ (0,
|
|
26920
|
-
countsLine.length > 0 ? /* @__PURE__ */ (0,
|
|
27005
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "min-w-0", children: [
|
|
27006
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Heading, { className: "truncate text-lg font-semibold text-foreground", children: title }),
|
|
27007
|
+
countsLine.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("p", { "data-matrx-table-card-counts": true, className: "text-xs text-muted-foreground", children: countsLine.map((part, index) => /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("span", { children: [
|
|
26921
27008
|
index > 0 ? " \xB7 " : null,
|
|
26922
27009
|
part
|
|
26923
27010
|
] }, index)) }) : null
|
|
26924
27011
|
] })
|
|
26925
27012
|
] }),
|
|
26926
|
-
/* @__PURE__ */ (0,
|
|
26927
|
-
/* @__PURE__ */ (0,
|
|
27013
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { "data-matrx-table-card-actions": true, className: "flex min-w-0 flex-auto flex-wrap items-center justify-end gap-1", children: [
|
|
27014
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { ref: setToolbarSlot, "data-matrx-table-card-toolbar": true, className: "flex min-w-0 flex-auto justify-end empty:hidden" }),
|
|
26928
27015
|
headerActions,
|
|
26929
27016
|
edit ? "href" in edit ? renderLink(
|
|
26930
27017
|
edit.href,
|
|
26931
27018
|
ghostButton,
|
|
26932
|
-
/* @__PURE__ */ (0,
|
|
26933
|
-
/* @__PURE__ */ (0,
|
|
26934
|
-
/* @__PURE__ */ (0,
|
|
27019
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_jsx_runtime70.Fragment, { children: [
|
|
27020
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(PencilIcon, { className: "h-3.5 w-3.5" }),
|
|
27021
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("span", { className: "sr-only", children: edit.label ?? `Edit ${title}` })
|
|
26935
27022
|
] })
|
|
26936
|
-
) : /* @__PURE__ */ (0,
|
|
27023
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
26937
27024
|
"button",
|
|
26938
27025
|
{
|
|
26939
27026
|
type: "button",
|
|
@@ -26941,40 +27028,40 @@ function MatrxTableCard({
|
|
|
26941
27028
|
onClick: edit.onEdit,
|
|
26942
27029
|
"aria-label": edit.label ?? `Edit ${title}`,
|
|
26943
27030
|
title: edit.label ?? `Edit ${title}`,
|
|
26944
|
-
children: /* @__PURE__ */ (0,
|
|
27031
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(PencilIcon, { className: "h-3.5 w-3.5" })
|
|
26945
27032
|
}
|
|
26946
27033
|
) : null,
|
|
26947
27034
|
open ? renderLink(
|
|
26948
27035
|
open.href,
|
|
26949
27036
|
ghostButton,
|
|
26950
|
-
/* @__PURE__ */ (0,
|
|
27037
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_jsx_runtime70.Fragment, { children: [
|
|
26951
27038
|
open.label ?? "Open",
|
|
26952
|
-
/* @__PURE__ */ (0,
|
|
26953
|
-
/* @__PURE__ */ (0,
|
|
27039
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(ChevronRightIcon, { className: "h-3.5 w-3.5" }),
|
|
27040
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("span", { className: "sr-only", children: ` ${title}` })
|
|
26954
27041
|
] })
|
|
26955
27042
|
) : null
|
|
26956
27043
|
] })
|
|
26957
27044
|
] }),
|
|
26958
|
-
/* @__PURE__ */ (0,
|
|
26959
|
-
/* @__PURE__ */ (0,
|
|
27045
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { "data-matrx-table-card-body": true, className: "-mx-2 min-w-0", children }),
|
|
27046
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
26960
27047
|
"footer",
|
|
26961
27048
|
{
|
|
26962
27049
|
"data-matrx-table-card-footer": true,
|
|
26963
27050
|
className: cn("flex flex-wrap items-center justify-between gap-2", (add || adding) && "mt-3"),
|
|
26964
27051
|
children: [
|
|
26965
|
-
adding ? /* @__PURE__ */ (0,
|
|
27052
|
+
adding ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "w-full", children: adding }) : add ? /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
26966
27053
|
"button",
|
|
26967
27054
|
{
|
|
26968
27055
|
type: "button",
|
|
26969
27056
|
onClick: add.onAdd,
|
|
26970
27057
|
className: cn(ghostButton, "text-muted-foreground hover:text-foreground"),
|
|
26971
27058
|
children: [
|
|
26972
|
-
/* @__PURE__ */ (0,
|
|
27059
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(PlusIcon, { className: "h-3.5 w-3.5" }),
|
|
26973
27060
|
add.label
|
|
26974
27061
|
]
|
|
26975
27062
|
}
|
|
26976
27063
|
) : null,
|
|
26977
|
-
/* @__PURE__ */ (0,
|
|
27064
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { ref: setFooterSlot, "data-matrx-table-card-pager": true, className: "ml-auto flex items-center gap-2 empty:hidden" })
|
|
26978
27065
|
]
|
|
26979
27066
|
}
|
|
26980
27067
|
)
|
|
@@ -26983,10 +27070,10 @@ function MatrxTableCard({
|
|
|
26983
27070
|
) });
|
|
26984
27071
|
}
|
|
26985
27072
|
function MatrxTableCardEmpty({ message, action, children }) {
|
|
26986
|
-
return /* @__PURE__ */ (0,
|
|
26987
|
-
/* @__PURE__ */ (0,
|
|
26988
|
-
action ? /* @__PURE__ */ (0,
|
|
26989
|
-
/* @__PURE__ */ (0,
|
|
27073
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { "data-matrx-table-card-empty": true, className: "mx-2 rounded-lg border-2 border-dashed border-border py-6 text-center", children: [
|
|
27074
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("p", { className: "mb-3 text-sm text-muted-foreground", children: message }),
|
|
27075
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("button", { type: "button", onClick: action.onClick, className: cn(buttonVariants({ size: "sm" }), "gap-1.5"), children: [
|
|
27076
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(PlusIcon, { className: "h-3.5 w-3.5" }),
|
|
26990
27077
|
action.label
|
|
26991
27078
|
] }) : null,
|
|
26992
27079
|
children
|
|
@@ -26994,8 +27081,8 @@ function MatrxTableCardEmpty({ message, action, children }) {
|
|
|
26994
27081
|
}
|
|
26995
27082
|
|
|
26996
27083
|
// src/data-table/SavedViewsControl.tsx
|
|
26997
|
-
var
|
|
26998
|
-
var
|
|
27084
|
+
var import_react49 = require("react");
|
|
27085
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
26999
27086
|
function SavedViewsControl({
|
|
27000
27087
|
views,
|
|
27001
27088
|
activeId = null,
|
|
@@ -27011,14 +27098,14 @@ function SavedViewsControl({
|
|
|
27011
27098
|
onRemove,
|
|
27012
27099
|
related
|
|
27013
27100
|
}) {
|
|
27014
|
-
const unsavedChangesId = (0,
|
|
27015
|
-
const [saveOpen, setSaveOpen] = (0,
|
|
27016
|
-
const [name, setName] = (0,
|
|
27017
|
-
const [saving, setSaving] = (0,
|
|
27018
|
-
const [removing, setRemoving] = (0,
|
|
27019
|
-
const [actionError, setActionError] = (0,
|
|
27020
|
-
const [pendingSelect, setPendingSelect] = (0,
|
|
27021
|
-
const [pendingRemove, setPendingRemove] = (0,
|
|
27101
|
+
const unsavedChangesId = (0, import_react49.useId)();
|
|
27102
|
+
const [saveOpen, setSaveOpen] = (0, import_react49.useState)(false);
|
|
27103
|
+
const [name, setName] = (0, import_react49.useState)("");
|
|
27104
|
+
const [saving, setSaving] = (0, import_react49.useState)(false);
|
|
27105
|
+
const [removing, setRemoving] = (0, import_react49.useState)(false);
|
|
27106
|
+
const [actionError, setActionError] = (0, import_react49.useState)(null);
|
|
27107
|
+
const [pendingSelect, setPendingSelect] = (0, import_react49.useState)(void 0);
|
|
27108
|
+
const [pendingRemove, setPendingRemove] = (0, import_react49.useState)(null);
|
|
27022
27109
|
const visibleError = actionError ?? error;
|
|
27023
27110
|
const select = (id) => {
|
|
27024
27111
|
if (id === activeId) return;
|
|
@@ -27087,9 +27174,9 @@ function SavedViewsControl({
|
|
|
27087
27174
|
}
|
|
27088
27175
|
};
|
|
27089
27176
|
const activeName = activeId ? views.find((view) => view.id === activeId)?.name : void 0;
|
|
27090
|
-
return /* @__PURE__ */ (0,
|
|
27091
|
-
presentation === "tabs" ? /* @__PURE__ */ (0,
|
|
27092
|
-
/* @__PURE__ */ (0,
|
|
27177
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "flex min-w-0 flex-wrap items-center gap-1", "data-matrx-table-saved-views": true, children: [
|
|
27178
|
+
presentation === "tabs" ? /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(import_jsx_runtime71.Fragment, { children: [
|
|
27179
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
27093
27180
|
TableViewTabs,
|
|
27094
27181
|
{
|
|
27095
27182
|
tabs: [{ id: "default", label: "Default view" }, ...views.map((view) => ({ id: view.id, label: view.name }))],
|
|
@@ -27110,10 +27197,10 @@ function SavedViewsControl({
|
|
|
27110
27197
|
related
|
|
27111
27198
|
}
|
|
27112
27199
|
),
|
|
27113
|
-
loading ? /* @__PURE__ */ (0,
|
|
27114
|
-
] }) : /* @__PURE__ */ (0,
|
|
27115
|
-
/* @__PURE__ */ (0,
|
|
27116
|
-
/* @__PURE__ */ (0,
|
|
27200
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { role: "status", className: "text-xs text-muted-foreground", children: "Loading views\u2026" }) : null
|
|
27201
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(DropdownMenu, { children: [
|
|
27202
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(Tooltip, { children: [
|
|
27203
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
27117
27204
|
Button2,
|
|
27118
27205
|
{
|
|
27119
27206
|
variant: "quiet",
|
|
@@ -27121,74 +27208,74 @@ function SavedViewsControl({
|
|
|
27121
27208
|
"aria-label": `Table view: ${loading ? "Loading views" : activeName ?? "Default view"}${dirty ? ", unsaved changes" : ""}`,
|
|
27122
27209
|
"aria-describedby": dirty ? unsavedChangesId : void 0,
|
|
27123
27210
|
disabled: saving,
|
|
27124
|
-
iconEnd: /* @__PURE__ */ (0,
|
|
27211
|
+
iconEnd: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(ChevronDownIcon, { "aria-hidden": "true" }),
|
|
27125
27212
|
children: [
|
|
27126
|
-
/* @__PURE__ */ (0,
|
|
27127
|
-
dirty ? /* @__PURE__ */ (0,
|
|
27213
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "min-w-0 flex-1 truncate", children: loading ? "Loading views\u2026" : activeName ?? "Default view" }),
|
|
27214
|
+
dirty ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { "aria-hidden": "true", className: "size-1.5 shrink-0 rounded-full bg-amber-500" }) : null
|
|
27128
27215
|
]
|
|
27129
27216
|
}
|
|
27130
27217
|
) }) }),
|
|
27131
|
-
/* @__PURE__ */ (0,
|
|
27218
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(TooltipContent, { children: "Choose or save a table view" })
|
|
27132
27219
|
] }),
|
|
27133
|
-
/* @__PURE__ */ (0,
|
|
27134
|
-
/* @__PURE__ */ (0,
|
|
27135
|
-
/* @__PURE__ */ (0,
|
|
27136
|
-
/* @__PURE__ */ (0,
|
|
27137
|
-
views.map((view) => /* @__PURE__ */ (0,
|
|
27220
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(DropdownMenuContent, { align: "end", children: [
|
|
27221
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(DropdownMenuLabel, { children: "Views" }),
|
|
27222
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(DropdownMenuRadioGroup, { value: activeId ?? "__default__", onValueChange: (value) => select(value === "__default__" ? null : value), children: [
|
|
27223
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(DropdownMenuRadioItem, { value: "__default__", children: "Default view" }),
|
|
27224
|
+
views.map((view) => /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(DropdownMenuRadioItem, { value: view.id, children: view.name }, view.id))
|
|
27138
27225
|
] }),
|
|
27139
|
-
/* @__PURE__ */ (0,
|
|
27140
|
-
/* @__PURE__ */ (0,
|
|
27226
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(DropdownMenuSeparator, {}),
|
|
27227
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(DropdownMenuItem, { disabled: saving, onSelect: () => {
|
|
27141
27228
|
setActionError(null);
|
|
27142
27229
|
setSaveOpen(true);
|
|
27143
27230
|
}, children: "Save current view\u2026" }),
|
|
27144
|
-
activeId && onUpdate ? /* @__PURE__ */ (0,
|
|
27145
|
-
activeId && onRemove ? /* @__PURE__ */ (0,
|
|
27146
|
-
onReload ? /* @__PURE__ */ (0,
|
|
27231
|
+
activeId && onUpdate ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(DropdownMenuItem, { disabled: saving, onSelect: () => void update(), children: "Update current view" }) : null,
|
|
27232
|
+
activeId && onRemove ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(DropdownMenuItem, { disabled: saving || removing, onSelect: () => requestRemove(activeId), children: "Delete current view\u2026" }) : null,
|
|
27233
|
+
onReload ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(DropdownMenuItem, { disabled: saving || loading, onSelect: () => void reload(), children: "Reload views" }) : null
|
|
27147
27234
|
] })
|
|
27148
27235
|
] }),
|
|
27149
|
-
dirty ? /* @__PURE__ */ (0,
|
|
27150
|
-
dirty ? onUpdate ? /* @__PURE__ */ (0,
|
|
27151
|
-
visibleError && !saveOpen && !pendingRemove ? /* @__PURE__ */ (0,
|
|
27152
|
-
/* @__PURE__ */ (0,
|
|
27153
|
-
/* @__PURE__ */ (0,
|
|
27154
|
-
visibleError ? /* @__PURE__ */ (0,
|
|
27155
|
-
/* @__PURE__ */ (0,
|
|
27156
|
-
/* @__PURE__ */ (0,
|
|
27157
|
-
/* @__PURE__ */ (0,
|
|
27158
|
-
/* @__PURE__ */ (0,
|
|
27236
|
+
dirty ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { id: unsavedChangesId, role: "status", className: "sr-only", children: "Unsaved changes" }) : null,
|
|
27237
|
+
dirty ? onUpdate ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Button2, { variant: "quiet", disabled: saving, onClick: () => void update(), children: "Save changes" }) : /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Button2, { variant: "quiet", disabled: saving, onClick: () => setSaveOpen(true), children: "Save as view" }) : null,
|
|
27238
|
+
visibleError && !saveOpen && !pendingRemove ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(ErrorBox, { className: "basis-full break-words text-xs text-destructive-ink", message: visibleError, operation: "Load or save a saved view", origin: "design-system/SavedViewsControl" }) : null,
|
|
27239
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Dialog, { open: saveOpen, onOpenChange: setSaveOpen, children: /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(DialogContent, { children: [
|
|
27240
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(DialogTitle, { children: "Save current view" }) }),
|
|
27241
|
+
visibleError ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(ErrorBox, { className: "text-sm text-destructive-ink", message: visibleError, operation: "Save a view", origin: "design-system/SavedViewsControl" }) : null,
|
|
27242
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Input, { "aria-label": "View name", value: name, onChange: (event) => setName(event.target.value), placeholder: "View name", autoFocus: true }),
|
|
27243
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(DialogFooter, { children: [
|
|
27244
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Button, { type: "button", variant: "outline", onClick: () => setSaveOpen(false), children: "Cancel" }),
|
|
27245
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Button, { type: "button", disabled: !name.trim() || saving, onClick: () => void save(), children: saving ? "Saving\u2026" : "Save view" })
|
|
27159
27246
|
] })
|
|
27160
27247
|
] }) }),
|
|
27161
|
-
/* @__PURE__ */ (0,
|
|
27248
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Dialog, { open: pendingSelect !== void 0, onOpenChange: (open) => {
|
|
27162
27249
|
if (!open) setPendingSelect(void 0);
|
|
27163
|
-
}, children: /* @__PURE__ */ (0,
|
|
27164
|
-
/* @__PURE__ */ (0,
|
|
27165
|
-
/* @__PURE__ */ (0,
|
|
27166
|
-
/* @__PURE__ */ (0,
|
|
27167
|
-
/* @__PURE__ */ (0,
|
|
27168
|
-
/* @__PURE__ */ (0,
|
|
27250
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(DialogContent, { children: [
|
|
27251
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(DialogTitle, { children: "Unsaved view changes" }) }),
|
|
27252
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(DialogDescription, { children: "Switching views will discard the changes you have not saved." }),
|
|
27253
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(DialogFooter, { children: [
|
|
27254
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Button, { type: "button", variant: "outline", onClick: () => setPendingSelect(void 0), children: "Stay on this view" }),
|
|
27255
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Button, { type: "button", onClick: () => {
|
|
27169
27256
|
const next = pendingSelect;
|
|
27170
27257
|
setPendingSelect(void 0);
|
|
27171
27258
|
if (next !== void 0) onSelect(next);
|
|
27172
27259
|
}, children: "Discard changes and switch" })
|
|
27173
27260
|
] })
|
|
27174
27261
|
] }) }),
|
|
27175
|
-
/* @__PURE__ */ (0,
|
|
27262
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Dialog, { open: pendingRemove !== null, onOpenChange: (open) => {
|
|
27176
27263
|
if (!open && !removing) setPendingRemove(null);
|
|
27177
|
-
}, children: /* @__PURE__ */ (0,
|
|
27178
|
-
/* @__PURE__ */ (0,
|
|
27264
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(DialogContent, { children: [
|
|
27265
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(DialogTitle, { children: [
|
|
27179
27266
|
"Delete ",
|
|
27180
27267
|
pendingRemove ? `\u201C${pendingRemove.name}\u201D` : "saved view",
|
|
27181
27268
|
"?"
|
|
27182
27269
|
] }) }),
|
|
27183
|
-
actionError ? /* @__PURE__ */ (0,
|
|
27184
|
-
/* @__PURE__ */ (0,
|
|
27270
|
+
actionError ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(ErrorBox, { className: "text-sm text-destructive-ink", message: actionError, operation: "Delete a saved view", origin: "design-system/SavedViewsControl" }) : null,
|
|
27271
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(DialogDescription, { children: [
|
|
27185
27272
|
"This removes the saved view from your account",
|
|
27186
27273
|
activeId === pendingRemove?.id && dirty ? " and discards its unsaved layout changes" : "",
|
|
27187
27274
|
"."
|
|
27188
27275
|
] }),
|
|
27189
|
-
/* @__PURE__ */ (0,
|
|
27190
|
-
/* @__PURE__ */ (0,
|
|
27191
|
-
/* @__PURE__ */ (0,
|
|
27276
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(DialogFooter, { children: [
|
|
27277
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Button, { type: "button", variant: "outline", disabled: removing, onClick: () => setPendingRemove(null), children: "Cancel" }),
|
|
27278
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Button, { type: "button", variant: "destructive", disabled: removing, onClick: () => void remove(), children: removing ? "Deleting\u2026" : "Delete view" })
|
|
27192
27279
|
] })
|
|
27193
27280
|
] }) })
|
|
27194
27281
|
] });
|
|
@@ -27273,7 +27360,7 @@ function comparisonGridRecords(grid) {
|
|
|
27273
27360
|
}
|
|
27274
27361
|
|
|
27275
27362
|
// src/data-table/MatrxComparisonTable.tsx
|
|
27276
|
-
var
|
|
27363
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
27277
27364
|
var ROW_COLUMN_ID = "__comparison_row";
|
|
27278
27365
|
var subjectColumnId = (subject) => `subject:${subject.id}`;
|
|
27279
27366
|
function buildGridRows(rows, subjects, footer) {
|
|
@@ -27287,7 +27374,7 @@ function buildGridRows(rows, subjects, footer) {
|
|
|
27287
27374
|
});
|
|
27288
27375
|
}
|
|
27289
27376
|
function PlaceBadge({ place }) {
|
|
27290
|
-
return /* @__PURE__ */ (0,
|
|
27377
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Badge, { tone: place === 1 ? "success" : "neutral", title: `${comparisonOrdinal(place)} place on this row`, children: comparisonOrdinal(place) });
|
|
27291
27378
|
}
|
|
27292
27379
|
function MatrxComparisonTable({
|
|
27293
27380
|
subjects: rawSubjects,
|
|
@@ -27336,11 +27423,11 @@ function MatrxComparisonTable({
|
|
|
27336
27423
|
minWidth: 120,
|
|
27337
27424
|
accessorFn: (line) => line.row.label,
|
|
27338
27425
|
copyValue: (line) => line.row.label,
|
|
27339
|
-
cell: (line) => line.row.header ?? /* @__PURE__ */ (0,
|
|
27426
|
+
cell: (line) => line.row.header ?? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: line.row.emphasized || line.footer ? "font-semibold text-foreground" : "text-foreground", children: line.row.label })
|
|
27340
27427
|
},
|
|
27341
27428
|
...subjects.map((subject, index) => ({
|
|
27342
27429
|
id: subjectColumnId(subject),
|
|
27343
|
-
header: subject.header ? /* @__PURE__ */ (0,
|
|
27430
|
+
header: subject.header ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { title: subject.title, children: subject.header }) : /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { title: subject.title, children: subject.label }),
|
|
27344
27431
|
label: subject.label,
|
|
27345
27432
|
width: subjectWidth,
|
|
27346
27433
|
minWidth: 96,
|
|
@@ -27356,16 +27443,16 @@ function MatrxComparisonTable({
|
|
|
27356
27443
|
},
|
|
27357
27444
|
cell: (line) => {
|
|
27358
27445
|
const cell = line.cells[index];
|
|
27359
|
-
if (!cell) return /* @__PURE__ */ (0,
|
|
27446
|
+
if (!cell) return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
27360
27447
|
const place = places ? line.ranking.places[subject.id] : null;
|
|
27361
|
-
return /* @__PURE__ */ (0,
|
|
27448
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(
|
|
27362
27449
|
"span",
|
|
27363
27450
|
{
|
|
27364
27451
|
className: align === "right" ? "inline-flex items-center justify-end gap-1.5" : "inline-flex items-center gap-1.5",
|
|
27365
27452
|
"data-comparison-highlight": line.ranking.highlights[subject.id] ?? void 0,
|
|
27366
27453
|
children: [
|
|
27367
|
-
cell.node ?? /* @__PURE__ */ (0,
|
|
27368
|
-
place != null ? /* @__PURE__ */ (0,
|
|
27454
|
+
cell.node ?? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { children: cell.text }),
|
|
27455
|
+
place != null ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(PlaceBadge, { place }) : null
|
|
27369
27456
|
]
|
|
27370
27457
|
}
|
|
27371
27458
|
);
|
|
@@ -27417,7 +27504,7 @@ function MatrxComparisonTable({
|
|
|
27417
27504
|
};
|
|
27418
27505
|
}
|
|
27419
27506
|
};
|
|
27420
|
-
return /* @__PURE__ */ (0,
|
|
27507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
27421
27508
|
MatrxDataTable,
|
|
27422
27509
|
{
|
|
27423
27510
|
data,
|
|
@@ -27448,8 +27535,8 @@ function MatrxComparisonTable({
|
|
|
27448
27535
|
}
|
|
27449
27536
|
|
|
27450
27537
|
// src/data-table/MatrxBatchGrid.tsx
|
|
27451
|
-
var
|
|
27452
|
-
var
|
|
27538
|
+
var import_react50 = require("react");
|
|
27539
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
27453
27540
|
var BATCH_COLUMN_FLOOR_CAP_PX = 480;
|
|
27454
27541
|
function freeColumnId(wanted, fallback, taken) {
|
|
27455
27542
|
if (!taken.has(wanted)) return wanted;
|
|
@@ -27465,13 +27552,13 @@ var TONE_CLASS = {
|
|
|
27465
27552
|
};
|
|
27466
27553
|
function BatchRowStatusIcon({ status }) {
|
|
27467
27554
|
const Glyph = status.tone === "ready" ? CircleCheck : AlertTriangleIcon;
|
|
27468
|
-
return /* @__PURE__ */ (0,
|
|
27555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { role: "img", "aria-label": status.label, title: status.label, "data-matrx-batch-status": status.tone, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Glyph, { className: cn("h-4 w-4 shrink-0", TONE_CLASS[status.tone]) }) });
|
|
27469
27556
|
}
|
|
27470
27557
|
function BatchRowKindBadge({
|
|
27471
27558
|
kind,
|
|
27472
27559
|
words: words2
|
|
27473
27560
|
}) {
|
|
27474
|
-
return /* @__PURE__ */ (0,
|
|
27561
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
27475
27562
|
"span",
|
|
27476
27563
|
{
|
|
27477
27564
|
"data-matrx-batch-kind": kind,
|
|
@@ -27485,16 +27572,16 @@ function BatchRowKindBadge({
|
|
|
27485
27572
|
);
|
|
27486
27573
|
}
|
|
27487
27574
|
function BatchFillButton({ fill, disabled }) {
|
|
27488
|
-
const [open, setOpen] = (0,
|
|
27489
|
-
const [value, setValue] = (0,
|
|
27575
|
+
const [open, setOpen] = (0, import_react50.useState)(false);
|
|
27576
|
+
const [value, setValue] = (0, import_react50.useState)(void 0);
|
|
27490
27577
|
const stop = (event) => event.stopPropagation();
|
|
27491
|
-
return /* @__PURE__ */ (0,
|
|
27492
|
-
/* @__PURE__ */ (0,
|
|
27578
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Popover, { open, onOpenChange: setOpen, children: [
|
|
27579
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
27493
27580
|
Button2,
|
|
27494
27581
|
{
|
|
27495
27582
|
type: "button",
|
|
27496
27583
|
variant: "quiet",
|
|
27497
|
-
icon: /* @__PURE__ */ (0,
|
|
27584
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(ArrowDownToLine, { className: "h-3.5 w-3.5" }),
|
|
27498
27585
|
disabled,
|
|
27499
27586
|
"data-matrx-batch-fill": true,
|
|
27500
27587
|
title: fill.title,
|
|
@@ -27507,7 +27594,7 @@ function BatchFillButton({ fill, disabled }) {
|
|
|
27507
27594
|
children: fill.label ?? ""
|
|
27508
27595
|
}
|
|
27509
27596
|
) }),
|
|
27510
|
-
/* @__PURE__ */ (0,
|
|
27597
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
|
|
27511
27598
|
PopoverContent,
|
|
27512
27599
|
{
|
|
27513
27600
|
align: "start",
|
|
@@ -27518,9 +27605,9 @@ function BatchFillButton({ fill, disabled }) {
|
|
|
27518
27605
|
onPointerDown: stop,
|
|
27519
27606
|
onMouseDown: stop,
|
|
27520
27607
|
children: [
|
|
27521
|
-
/* @__PURE__ */ (0,
|
|
27608
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("p", { className: "type-meta text-muted-foreground", children: fill.limits }),
|
|
27522
27609
|
fill.renderControl(value, setValue),
|
|
27523
|
-
/* @__PURE__ */ (0,
|
|
27610
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
27524
27611
|
Button,
|
|
27525
27612
|
{
|
|
27526
27613
|
type: "button",
|
|
@@ -27539,15 +27626,15 @@ function BatchFillButton({ fill, disabled }) {
|
|
|
27539
27626
|
] });
|
|
27540
27627
|
}
|
|
27541
27628
|
function ColumnHeader({ column, disabled }) {
|
|
27542
|
-
return /* @__PURE__ */ (0,
|
|
27543
|
-
/* @__PURE__ */ (0,
|
|
27544
|
-
/* @__PURE__ */ (0,
|
|
27545
|
-
/* @__PURE__ */ (0,
|
|
27546
|
-
column.required ? /* @__PURE__ */ (0,
|
|
27629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("span", { className: "flex min-w-0 items-start gap-1.5", "data-matrx-batch-header": column.id, children: [
|
|
27630
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("span", { className: "min-w-0", children: [
|
|
27631
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("span", { className: "flex items-center gap-1", children: [
|
|
27632
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "truncate", children: column.header }),
|
|
27633
|
+
column.required ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "text-destructive-ink", title: "Required", "aria-label": "Required", children: "*" }) : null
|
|
27547
27634
|
] }),
|
|
27548
|
-
column.caption ? /* @__PURE__ */ (0,
|
|
27635
|
+
column.caption ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "type-meta block truncate font-normal normal-case tracking-normal text-muted-foreground", children: column.caption }) : null
|
|
27549
27636
|
] }),
|
|
27550
|
-
column.fill ? /* @__PURE__ */ (0,
|
|
27637
|
+
column.fill ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "ml-auto pt-0.5", children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(BatchFillButton, { fill: column.fill, disabled }) }) : null
|
|
27551
27638
|
] });
|
|
27552
27639
|
}
|
|
27553
27640
|
function MatrxBatchGrid({
|
|
@@ -27576,10 +27663,10 @@ function MatrxBatchGrid({
|
|
|
27576
27663
|
}) {
|
|
27577
27664
|
const host = useMatrxDataTableHost();
|
|
27578
27665
|
const density = ownDensity ?? host.defaultDensity ?? "condensed";
|
|
27579
|
-
const [folded, setFolded] = (0,
|
|
27580
|
-
const gridRef = (0,
|
|
27581
|
-
const [floors, setFloors] = (0,
|
|
27582
|
-
(0,
|
|
27666
|
+
const [folded, setFolded] = (0, import_react50.useState)(/* @__PURE__ */ new Set());
|
|
27667
|
+
const gridRef = (0, import_react50.useRef)(null);
|
|
27668
|
+
const [floors, setFloors] = (0, import_react50.useState)({});
|
|
27669
|
+
(0, import_react50.useLayoutEffect)(() => {
|
|
27583
27670
|
const root = gridRef.current;
|
|
27584
27671
|
if (!root) return;
|
|
27585
27672
|
const need = {};
|
|
@@ -27622,11 +27709,11 @@ function MatrxBatchGrid({
|
|
|
27622
27709
|
const done = doneRowIds?.has(id) ?? false;
|
|
27623
27710
|
const health = status?.(row) ?? null;
|
|
27624
27711
|
const rowKind2 = kind?.(row) ?? null;
|
|
27625
|
-
return /* @__PURE__ */ (0,
|
|
27626
|
-
done ? /* @__PURE__ */ (0,
|
|
27627
|
-
rowKind2 ? /* @__PURE__ */ (0,
|
|
27628
|
-
/* @__PURE__ */ (0,
|
|
27629
|
-
done ? /* @__PURE__ */ (0,
|
|
27712
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("span", { className: "flex min-w-0 items-center gap-2", "data-matrx-batch-row": id, children: [
|
|
27713
|
+
done ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(BatchRowStatusIcon, { status: { tone: "ready", label: doneLabel } }) : health ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(BatchRowStatusIcon, { status: health }) : null,
|
|
27714
|
+
rowKind2 ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(BatchRowKindBadge, { kind: rowKind2, words: kindWords }) : null,
|
|
27715
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "min-w-0 flex-1", children: rowHeader.render ? rowHeader.render(row) : rowHeader.label(row) }),
|
|
27716
|
+
done ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "type-meta shrink-0 text-success-ink", children: doneLabel }) : null
|
|
27630
27717
|
] });
|
|
27631
27718
|
}
|
|
27632
27719
|
};
|
|
@@ -27634,7 +27721,7 @@ function MatrxBatchGrid({
|
|
|
27634
27721
|
const typed = column.type !== void 0 && column.render === void 0;
|
|
27635
27722
|
const def = {
|
|
27636
27723
|
id: column.id,
|
|
27637
|
-
header: /* @__PURE__ */ (0,
|
|
27724
|
+
header: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(ColumnHeader, { column, disabled }),
|
|
27638
27725
|
label: column.header,
|
|
27639
27726
|
...column.helpText ? { helpText: column.helpText } : {},
|
|
27640
27727
|
accessorFn: (row) => banded(row) ? null : column.read(row),
|
|
@@ -27653,7 +27740,7 @@ function MatrxBatchGrid({
|
|
|
27653
27740
|
def.editableIf = (row) => !banded(row) && (column.editableIf ? column.editableIf(row) : true);
|
|
27654
27741
|
} else if (column.render) {
|
|
27655
27742
|
const draw = column.render;
|
|
27656
|
-
def.cell = (row) => banded(row) ? null : /* @__PURE__ */ (0,
|
|
27743
|
+
def.cell = (row) => banded(row) ? null : /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { ...{ [CELL_EDITOR_ATTR]: "" }, "data-matrx-batch-cell": column.id, className: "min-w-0", children: draw(row) });
|
|
27657
27744
|
}
|
|
27658
27745
|
return def;
|
|
27659
27746
|
});
|
|
@@ -27685,8 +27772,8 @@ function MatrxBatchGrid({
|
|
|
27685
27772
|
const expandedIds = new Set(
|
|
27686
27773
|
data.map(getRowId).filter((id) => !folded.has(id) && hasDetail(byId.get(id)))
|
|
27687
27774
|
);
|
|
27688
|
-
return /* @__PURE__ */ (0,
|
|
27689
|
-
/* @__PURE__ */ (0,
|
|
27775
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { ref: gridRef, className: "min-w-0", "data-matrx-batch-grid": tableId, children: [
|
|
27776
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
27690
27777
|
MatrxDataTable,
|
|
27691
27778
|
{
|
|
27692
27779
|
tableId,
|
|
@@ -27741,9 +27828,9 @@ function MatrxBatchGrid({
|
|
|
27741
27828
|
expandedIds,
|
|
27742
27829
|
onExpandedIdsChange: (next) => setFolded(new Set(data.map(getRowId).filter((id) => !next.has(id)))),
|
|
27743
27830
|
canExpand: hasDetail,
|
|
27744
|
-
render: (row) => /* @__PURE__ */ (0,
|
|
27745
|
-
banded(row) ? /* @__PURE__ */ (0,
|
|
27746
|
-
notesOf(row).length > 0 ? /* @__PURE__ */ (0,
|
|
27831
|
+
render: (row) => /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(import_jsx_runtime73.Fragment, { children: [
|
|
27832
|
+
banded(row) ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { "data-matrx-batch-band": true, className: "px-3 py-1.5 text-sm text-muted-foreground", children: bandOf(row) }) : null,
|
|
27833
|
+
notesOf(row).length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(BatchRowNotes, { notes: notesOf(row) }) : null
|
|
27747
27834
|
] })
|
|
27748
27835
|
},
|
|
27749
27836
|
...onRemoveRow ? {
|
|
@@ -27763,12 +27850,12 @@ function MatrxBatchGrid({
|
|
|
27763
27850
|
} : {}
|
|
27764
27851
|
}
|
|
27765
27852
|
),
|
|
27766
|
-
footnote ? /* @__PURE__ */ (0,
|
|
27853
|
+
footnote ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "type-meta px-3 py-2 text-muted-foreground", children: footnote }) : null
|
|
27767
27854
|
] });
|
|
27768
27855
|
}
|
|
27769
27856
|
function BatchRowNotes({ notes }) {
|
|
27770
27857
|
const blocked = notes.some((note) => note.tone === "blocked");
|
|
27771
|
-
return /* @__PURE__ */ (0,
|
|
27858
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
27772
27859
|
"ul",
|
|
27773
27860
|
{
|
|
27774
27861
|
"data-matrx-batch-notes": true,
|
|
@@ -27776,16 +27863,16 @@ function BatchRowNotes({ notes }) {
|
|
|
27776
27863
|
"type-meta space-y-0.5 px-3 py-1.5 text-foreground",
|
|
27777
27864
|
blocked ? "bg-destructive/5" : "bg-warning/10"
|
|
27778
27865
|
),
|
|
27779
|
-
children: notes.map((note) => /* @__PURE__ */ (0,
|
|
27780
|
-
/* @__PURE__ */ (0,
|
|
27781
|
-
/* @__PURE__ */ (0,
|
|
27866
|
+
children: notes.map((note) => /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("li", { className: "flex items-start gap-1.5", children: [
|
|
27867
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(AlertTriangleIcon, { className: cn("mt-0.5 h-3.5 w-3.5 shrink-0", note.tone === "blocked" ? "text-destructive-ink" : "text-warning-ink") }),
|
|
27868
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { children: note.text })
|
|
27782
27869
|
] }, note.text))
|
|
27783
27870
|
}
|
|
27784
27871
|
);
|
|
27785
27872
|
}
|
|
27786
27873
|
|
|
27787
27874
|
// src/data-table/MatrxDetailGrid.tsx
|
|
27788
|
-
var
|
|
27875
|
+
var import_react51 = require("react");
|
|
27789
27876
|
|
|
27790
27877
|
// src/data-table/detail-grid.ts
|
|
27791
27878
|
var import_delimited4 = require("@ai-matrx/kit/delimited");
|
|
@@ -27856,22 +27943,22 @@ function detailGridText(rows, columns, labelHeader = "Field") {
|
|
|
27856
27943
|
}
|
|
27857
27944
|
|
|
27858
27945
|
// src/data-table/MatrxDetailGrid.tsx
|
|
27859
|
-
var
|
|
27946
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
27860
27947
|
var DEFAULT_COLUMNS = [{ key: "value", label: "Value" }];
|
|
27861
27948
|
var DEFAULT_CLAMP = 400;
|
|
27862
27949
|
function JsonValue2({ data }) {
|
|
27863
27950
|
const host = useMatrxDataTableHost();
|
|
27864
27951
|
const Viewer = host.JsonViewer;
|
|
27865
|
-
if (Viewer) return /* @__PURE__ */ (0,
|
|
27866
|
-
return /* @__PURE__ */ (0,
|
|
27952
|
+
if (Viewer) return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Viewer, { data });
|
|
27953
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("pre", { className: "max-h-96 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/40 p-2 font-mono text-xs leading-relaxed text-foreground", children: detailValueText(data) });
|
|
27867
27954
|
}
|
|
27868
27955
|
function ClampedText({ text, clampChars, mono }) {
|
|
27869
|
-
const [open, setOpen] = (0,
|
|
27956
|
+
const [open, setOpen] = (0, import_react51.useState)(false);
|
|
27870
27957
|
const long = text.length > clampChars;
|
|
27871
27958
|
const shown = long && !open ? `${text.slice(0, clampChars).trimEnd()}\u2026` : text;
|
|
27872
|
-
return /* @__PURE__ */ (0,
|
|
27959
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("span", { className: cn("block min-w-0 whitespace-pre-wrap break-words", mono && "font-mono"), children: [
|
|
27873
27960
|
shown,
|
|
27874
|
-
long ? /* @__PURE__ */ (0,
|
|
27961
|
+
long ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
27875
27962
|
Button2,
|
|
27876
27963
|
{
|
|
27877
27964
|
type: "button",
|
|
@@ -27886,9 +27973,9 @@ function ClampedText({ text, clampChars, mono }) {
|
|
|
27886
27973
|
] });
|
|
27887
27974
|
}
|
|
27888
27975
|
function CollectedValue({ data }) {
|
|
27889
|
-
const [open, setOpen] = (0,
|
|
27890
|
-
return /* @__PURE__ */ (0,
|
|
27891
|
-
/* @__PURE__ */ (0,
|
|
27976
|
+
const [open, setOpen] = (0, import_react51.useState)(false);
|
|
27977
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("span", { className: "block min-w-0", children: [
|
|
27978
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
27892
27979
|
Button2,
|
|
27893
27980
|
{
|
|
27894
27981
|
type: "button",
|
|
@@ -27900,7 +27987,7 @@ function CollectedValue({ data }) {
|
|
|
27900
27987
|
children: collectedDetailSummary(data)
|
|
27901
27988
|
}
|
|
27902
27989
|
),
|
|
27903
|
-
open ? /* @__PURE__ */ (0,
|
|
27990
|
+
open ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "mt-1 block", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(JsonValue2, { data }) }) : null
|
|
27904
27991
|
] });
|
|
27905
27992
|
}
|
|
27906
27993
|
function MatrxDetailValue({
|
|
@@ -27911,13 +27998,13 @@ function MatrxDetailValue({
|
|
|
27911
27998
|
clampChars = DEFAULT_CLAMP
|
|
27912
27999
|
}) {
|
|
27913
28000
|
if (isBlankDetailValue(value)) {
|
|
27914
|
-
return /* @__PURE__ */ (0,
|
|
28001
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "italic text-muted-foreground", "data-matrx-detail-empty": "", children: emptyLabel });
|
|
27915
28002
|
}
|
|
27916
|
-
if ((0, import_uuid2.isUuidValue)(value)) return /* @__PURE__ */ (0,
|
|
28003
|
+
if ((0, import_uuid2.isUuidValue)(value)) return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(RecordId, { value, label });
|
|
27917
28004
|
const collected = collectedDetailValue(value);
|
|
27918
|
-
if (collected) return /* @__PURE__ */ (0,
|
|
28005
|
+
if (collected) return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(CollectedValue, { data: collected });
|
|
27919
28006
|
const text = Array.isArray(value) ? value.map((item) => detailValueText(item)).join(", ") : typeof value === "string" ? value : formatTableDisplayValue(value);
|
|
27920
|
-
return /* @__PURE__ */ (0,
|
|
28007
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(ClampedText, { text, clampChars, mono });
|
|
27921
28008
|
}
|
|
27922
28009
|
function MatrxDetailGrid({
|
|
27923
28010
|
rows,
|
|
@@ -27939,8 +28026,8 @@ function MatrxDetailGrid({
|
|
|
27939
28026
|
const { before, after } = detailGridBeforeAfter(columns);
|
|
27940
28027
|
const reviewing = Boolean(before && after);
|
|
27941
28028
|
const changedCount = reviewing ? detailGridChangedCount(rows, columns) : 0;
|
|
27942
|
-
const [changedOnly, setChangedOnly] = (0,
|
|
27943
|
-
const [showAll, setShowAll] = (0,
|
|
28029
|
+
const [changedOnly, setChangedOnly] = (0, import_react51.useState)(false);
|
|
28030
|
+
const [showAll, setShowAll] = (0, import_react51.useState)(false);
|
|
27944
28031
|
const filtered = changedOnly ? rows.filter((row) => isDetailRowChanged(row, columns)) : rows;
|
|
27945
28032
|
const limit = initialRows && !showAll ? initialRows : filtered.length;
|
|
27946
28033
|
const shown = filtered.slice(0, limit);
|
|
@@ -27949,14 +28036,14 @@ function MatrxDetailGrid({
|
|
|
27949
28036
|
const value = row.values[column.key];
|
|
27950
28037
|
if (!copy || isBlankDetailValue(value)) return null;
|
|
27951
28038
|
const label = columns.length > 1 ? `${row.label} \xB7 ${column.label}` : row.label;
|
|
27952
|
-
return /* @__PURE__ */ (0,
|
|
28039
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
27953
28040
|
"span",
|
|
27954
28041
|
{
|
|
27955
28042
|
className: cn(
|
|
27956
28043
|
"shrink-0 opacity-0 transition-opacity focus-within:opacity-100 group-hover/detail:opacity-100",
|
|
27957
28044
|
floating && "absolute right-1 top-0.5 rounded-md bg-card"
|
|
27958
28045
|
),
|
|
27959
|
-
children: /* @__PURE__ */ (0,
|
|
28046
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
27960
28047
|
DeferredCopyButtons,
|
|
27961
28048
|
{
|
|
27962
28049
|
size: "xs",
|
|
@@ -27975,12 +28062,12 @@ function MatrxDetailGrid({
|
|
|
27975
28062
|
);
|
|
27976
28063
|
};
|
|
27977
28064
|
if (rows.length === 0) {
|
|
27978
|
-
return /* @__PURE__ */ (0,
|
|
28065
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: cn("type-secondary text-muted-foreground", className), children: empty ?? "Nothing to show" });
|
|
27979
28066
|
}
|
|
27980
28067
|
const showHeader = header ?? columns.length > 1;
|
|
27981
28068
|
const singleRecord = columns.length === 1 && !showHeader;
|
|
27982
|
-
const footer = /* @__PURE__ */ (0,
|
|
27983
|
-
filtered.length > limit ? /* @__PURE__ */ (0,
|
|
28069
|
+
const footer = /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(import_jsx_runtime74.Fragment, { children: [
|
|
28070
|
+
filtered.length > limit ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
27984
28071
|
Button2,
|
|
27985
28072
|
{
|
|
27986
28073
|
type: "button",
|
|
@@ -27991,11 +28078,11 @@ function MatrxDetailGrid({
|
|
|
27991
28078
|
children: `Show all ${filtered.length}`
|
|
27992
28079
|
}
|
|
27993
28080
|
) : null,
|
|
27994
|
-
held > rows.length ? /* @__PURE__ */ (0,
|
|
28081
|
+
held > rows.length ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "mt-1 type-meta text-muted-foreground", "data-matrx-detail-held": "", children: `${rows.length} of ${held} rows shown` }) : null
|
|
27995
28082
|
] });
|
|
27996
28083
|
if (singleRecord) {
|
|
27997
28084
|
const column = columns[0];
|
|
27998
|
-
return /* @__PURE__ */ (0,
|
|
28085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: cn("min-w-0", className), "data-matrx-detail-grid": "record", "data-matrx-table-look": macLook, children: [
|
|
27999
28086
|
shown.map((row) => {
|
|
28000
28087
|
const value = row.values[column.key];
|
|
28001
28088
|
const meta = copyFor(row, column);
|
|
@@ -28010,18 +28097,18 @@ function MatrxDetailGrid({
|
|
|
28010
28097
|
...meta ? { meta } : {}
|
|
28011
28098
|
};
|
|
28012
28099
|
if (custom === void 0 && isBlankDetailValue(value)) {
|
|
28013
|
-
return /* @__PURE__ */ (0,
|
|
28100
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(PropertyRow, { ...common, missing: column.emptyLabel ?? true }, row.key);
|
|
28014
28101
|
}
|
|
28015
28102
|
if (collected) {
|
|
28016
|
-
return /* @__PURE__ */ (0,
|
|
28103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(PropertyRow, { ...common, data: collected, expanded: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(JsonValue2, { data: collected }) }, row.key);
|
|
28017
28104
|
}
|
|
28018
|
-
return /* @__PURE__ */ (0,
|
|
28105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(PropertyRow, { ...common, mono: Boolean(row.mono ?? column.mono), children: custom ?? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(MatrxDetailValue, { value, label: row.label, mono: row.mono ?? column.mono, clampChars }) }, row.key);
|
|
28019
28106
|
}),
|
|
28020
28107
|
footer
|
|
28021
28108
|
] });
|
|
28022
28109
|
}
|
|
28023
28110
|
const template = `minmax(5rem, 11rem) repeat(${columns.length}, minmax(0, 1fr))`;
|
|
28024
|
-
const copyAll = copy ? /* @__PURE__ */ (0,
|
|
28111
|
+
const copyAll = copy ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
28025
28112
|
DeferredCopyButtons,
|
|
28026
28113
|
{
|
|
28027
28114
|
size: "xs",
|
|
@@ -28036,11 +28123,11 @@ function MatrxDetailGrid({
|
|
|
28036
28123
|
})
|
|
28037
28124
|
}
|
|
28038
28125
|
) : null;
|
|
28039
|
-
return /* @__PURE__ */ (0,
|
|
28040
|
-
reviewing ? /* @__PURE__ */ (0,
|
|
28041
|
-
reviewing ? /* @__PURE__ */ (0,
|
|
28042
|
-
/* @__PURE__ */ (0,
|
|
28043
|
-
changedCount > 0 && changedCount < rows.length ? /* @__PURE__ */ (0,
|
|
28126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: cn("min-w-0", className), "data-matrx-detail-grid": reviewing ? "review" : "grid", "data-matrx-table-look": macLook, children: [
|
|
28127
|
+
reviewing ? /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "mb-1 flex min-h-7 items-center gap-2", "data-matrx-detail-bar": "", children: [
|
|
28128
|
+
reviewing ? /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(import_jsx_runtime74.Fragment, { children: [
|
|
28129
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "type-secondary text-muted-foreground", "data-matrx-detail-changed-count": "", children: `${changedCount} changed` }),
|
|
28130
|
+
changedCount > 0 && changedCount < rows.length ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
28044
28131
|
Button2,
|
|
28045
28132
|
{
|
|
28046
28133
|
type: "button",
|
|
@@ -28053,10 +28140,10 @@ function MatrxDetailGrid({
|
|
|
28053
28140
|
}
|
|
28054
28141
|
) : null
|
|
28055
28142
|
] }) : null,
|
|
28056
|
-
copyAll ? /* @__PURE__ */ (0,
|
|
28143
|
+
copyAll ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "ml-auto", children: copyAll }) : null
|
|
28057
28144
|
] }) : null,
|
|
28058
|
-
/* @__PURE__ */ (0,
|
|
28059
|
-
!reviewing && copyAll ? /* @__PURE__ */ (0,
|
|
28145
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "group/detail-grid relative", children: [
|
|
28146
|
+
!reviewing && copyAll ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
28060
28147
|
"span",
|
|
28061
28148
|
{
|
|
28062
28149
|
"data-matrx-detail-copy-all": "",
|
|
@@ -28064,22 +28151,22 @@ function MatrxDetailGrid({
|
|
|
28064
28151
|
children: copyAll
|
|
28065
28152
|
}
|
|
28066
28153
|
) : null,
|
|
28067
|
-
/* @__PURE__ */ (0,
|
|
28068
|
-
showHeader ? /* @__PURE__ */ (0,
|
|
28069
|
-
/* @__PURE__ */ (0,
|
|
28070
|
-
columns.map((column) => /* @__PURE__ */ (0,
|
|
28154
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "overflow-x-auto rounded-md border border-border", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { role: "table", className: "grid min-w-max sm:min-w-0", style: { gridTemplateColumns: template }, children: [
|
|
28155
|
+
showHeader ? /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { role: "row", className: "contents", children: [
|
|
28156
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { role: "columnheader", className: "border-b border-border bg-muted/40 px-2 py-1 type-label text-muted-foreground", children: labelHeader }),
|
|
28157
|
+
columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { role: "columnheader", className: "border-b border-border bg-muted/40 px-2 py-1 type-label text-muted-foreground", children: column.label }, column.key))
|
|
28071
28158
|
] }) : null,
|
|
28072
28159
|
shown.map((row, index) => {
|
|
28073
28160
|
const changed = reviewing && isDetailRowChanged(row, columns);
|
|
28074
28161
|
const last = index === shown.length - 1;
|
|
28075
28162
|
const edge = last ? "" : "border-b border-border";
|
|
28076
|
-
return /* @__PURE__ */ (0,
|
|
28077
|
-
/* @__PURE__ */ (0,
|
|
28163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { role: "row", className: "contents", "data-matrx-detail-row": row.key, ...changed ? { "data-changed": "" } : {}, children: [
|
|
28164
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { role: "rowheader", className: cn("px-2 py-1 type-secondary text-muted-foreground", edge), children: row.label }),
|
|
28078
28165
|
columns.map((column) => {
|
|
28079
28166
|
const value = row.values[column.key];
|
|
28080
28167
|
const emphasise = changed && column.key === after;
|
|
28081
28168
|
const muted = reviewing && !emphasise;
|
|
28082
|
-
return /* @__PURE__ */ (0,
|
|
28169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
|
|
28083
28170
|
"div",
|
|
28084
28171
|
{
|
|
28085
28172
|
role: "cell",
|
|
@@ -28091,7 +28178,7 @@ function MatrxDetailGrid({
|
|
|
28091
28178
|
),
|
|
28092
28179
|
...emphasise ? { "data-changed-cell": "" } : {},
|
|
28093
28180
|
children: [
|
|
28094
|
-
/* @__PURE__ */ (0,
|
|
28181
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "block min-w-0", children: row.render?.[column.key] ?? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
28095
28182
|
MatrxDetailValue,
|
|
28096
28183
|
{
|
|
28097
28184
|
value,
|
|
@@ -28116,7 +28203,7 @@ function MatrxDetailGrid({
|
|
|
28116
28203
|
}
|
|
28117
28204
|
|
|
28118
28205
|
// src/data-table/MatrxVersionTimeline.tsx
|
|
28119
|
-
var
|
|
28206
|
+
var import_react52 = require("react");
|
|
28120
28207
|
|
|
28121
28208
|
// src/data-table/version-timeline.ts
|
|
28122
28209
|
function versionTimelineRows(versions, currentNumber) {
|
|
@@ -28139,7 +28226,7 @@ function versionTimelineRows(versions, currentNumber) {
|
|
|
28139
28226
|
}
|
|
28140
28227
|
|
|
28141
28228
|
// src/data-table/MatrxVersionTimeline.tsx
|
|
28142
|
-
var
|
|
28229
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
28143
28230
|
var lucide = (props) => ({
|
|
28144
28231
|
width: 24,
|
|
28145
28232
|
height: 24,
|
|
@@ -28152,26 +28239,26 @@ var lucide = (props) => ({
|
|
|
28152
28239
|
...props
|
|
28153
28240
|
});
|
|
28154
28241
|
function CompareIcon(props) {
|
|
28155
|
-
return /* @__PURE__ */ (0,
|
|
28156
|
-
/* @__PURE__ */ (0,
|
|
28157
|
-
/* @__PURE__ */ (0,
|
|
28158
|
-
/* @__PURE__ */ (0,
|
|
28159
|
-
/* @__PURE__ */ (0,
|
|
28160
|
-
/* @__PURE__ */ (0,
|
|
28161
|
-
/* @__PURE__ */ (0,
|
|
28242
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("svg", { ...lucide(props), children: [
|
|
28243
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("circle", { cx: "5", cy: "6", r: "3" }),
|
|
28244
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("path", { d: "M12 6h5a2 2 0 0 1 2 2v7" }),
|
|
28245
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("path", { d: "m15 9-3-3 3-3" }),
|
|
28246
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("circle", { cx: "19", cy: "18", r: "3" }),
|
|
28247
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("path", { d: "M12 18H7a2 2 0 0 1-2-2V9" }),
|
|
28248
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("path", { d: "m9 15 3 3-3 3" })
|
|
28162
28249
|
] });
|
|
28163
28250
|
}
|
|
28164
28251
|
function RestoreIcon(props) {
|
|
28165
|
-
return /* @__PURE__ */ (0,
|
|
28166
|
-
/* @__PURE__ */ (0,
|
|
28167
|
-
/* @__PURE__ */ (0,
|
|
28252
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("svg", { ...lucide(props), children: [
|
|
28253
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }),
|
|
28254
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("path", { d: "M3 3v5h5" })
|
|
28168
28255
|
] });
|
|
28169
28256
|
}
|
|
28170
28257
|
function NextIcon(props) {
|
|
28171
|
-
return /* @__PURE__ */ (0,
|
|
28258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ArrowRightIcon, { ...props });
|
|
28172
28259
|
}
|
|
28173
28260
|
function LoadIcon(props) {
|
|
28174
|
-
return /* @__PURE__ */ (0,
|
|
28261
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ChevronDownIcon, { ...props });
|
|
28175
28262
|
}
|
|
28176
28263
|
function formatWhen(at2) {
|
|
28177
28264
|
if (!at2) return "";
|
|
@@ -28180,8 +28267,8 @@ function formatWhen(at2) {
|
|
|
28180
28267
|
return `${date.toLocaleDateString()} ${date.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" })}`;
|
|
28181
28268
|
}
|
|
28182
28269
|
function VersionCell({ row }) {
|
|
28183
|
-
return /* @__PURE__ */ (0,
|
|
28184
|
-
/* @__PURE__ */ (0,
|
|
28270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("span", { className: "inline-flex items-center gap-1.5", "data-matrx-version": row.entry.number, children: [
|
|
28271
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
28185
28272
|
"span",
|
|
28186
28273
|
{
|
|
28187
28274
|
"aria-hidden": true,
|
|
@@ -28192,8 +28279,8 @@ function VersionCell({ row }) {
|
|
|
28192
28279
|
)
|
|
28193
28280
|
}
|
|
28194
28281
|
),
|
|
28195
|
-
/* @__PURE__ */ (0,
|
|
28196
|
-
row.isCurrent ? /* @__PURE__ */ (0,
|
|
28282
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: cn("font-mono font-medium tabular-nums", row.isCurrent ? "font-semibold text-foreground" : "text-foreground"), children: `v${row.entry.number}` }),
|
|
28283
|
+
row.isCurrent ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "sr-only", children: "Current" }) : null
|
|
28197
28284
|
] });
|
|
28198
28285
|
}
|
|
28199
28286
|
function MatrxVersionTimeline({
|
|
@@ -28212,9 +28299,9 @@ function MatrxVersionTimeline({
|
|
|
28212
28299
|
}) {
|
|
28213
28300
|
const host = useMatrxDataTableHost();
|
|
28214
28301
|
const rows = versionTimelineRows(versions, currentNumber);
|
|
28215
|
-
const [expandedId, setExpandedId] = (0,
|
|
28216
|
-
const [pendingRestore, setPendingRestore] = (0,
|
|
28217
|
-
const [restoring, setRestoring] = (0,
|
|
28302
|
+
const [expandedId, setExpandedId] = (0, import_react52.useState)(null);
|
|
28303
|
+
const [pendingRestore, setPendingRestore] = (0, import_react52.useState)(null);
|
|
28304
|
+
const [restoring, setRestoring] = (0, import_react52.useState)(false);
|
|
28218
28305
|
const has = (pick) => versions.some((entry) => pick(entry) != null && pick(entry) !== "");
|
|
28219
28306
|
const columns = [
|
|
28220
28307
|
{
|
|
@@ -28222,7 +28309,7 @@ function MatrxVersionTimeline({
|
|
|
28222
28309
|
header: "Version",
|
|
28223
28310
|
accessorFn: (row) => row.entry.number,
|
|
28224
28311
|
copyValue: (row) => `v${row.entry.number}`,
|
|
28225
|
-
cell: (row) => /* @__PURE__ */ (0,
|
|
28312
|
+
cell: (row) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(VersionCell, { row }),
|
|
28226
28313
|
format: { id: "integer" },
|
|
28227
28314
|
width: 96,
|
|
28228
28315
|
frozen: true
|
|
@@ -28241,7 +28328,7 @@ function MatrxVersionTimeline({
|
|
|
28241
28328
|
id: "at",
|
|
28242
28329
|
header: "When",
|
|
28243
28330
|
accessorFn: (row) => row.entry.at instanceof Date ? row.entry.at.toISOString() : row.entry.at ?? "",
|
|
28244
|
-
cell: (row) => /* @__PURE__ */ (0,
|
|
28331
|
+
cell: (row) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "text-muted-foreground", children: formatWhen(row.entry.at) }),
|
|
28245
28332
|
format: { id: "datetime" },
|
|
28246
28333
|
width: 160
|
|
28247
28334
|
});
|
|
@@ -28261,15 +28348,15 @@ function MatrxVersionTimeline({
|
|
|
28261
28348
|
id: "changes",
|
|
28262
28349
|
header: "Changes",
|
|
28263
28350
|
accessorFn: (row) => [row.entry.note, row.entry.changesText].filter(Boolean).join(" \xB7 "),
|
|
28264
|
-
cell: (row) => /* @__PURE__ */ (0,
|
|
28265
|
-
row.entry.note ? /* @__PURE__ */ (0,
|
|
28266
|
-
row.entry.changes ?? (row.entry.loaded === false ? onLoad ? null : /* @__PURE__ */ (0,
|
|
28267
|
-
row.entry.loaded === false && onLoad ? /* @__PURE__ */ (0,
|
|
28351
|
+
cell: (row) => /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "min-w-0 space-y-1", children: [
|
|
28352
|
+
row.entry.note ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "text-muted-foreground", children: row.entry.note }) : null,
|
|
28353
|
+
row.entry.changes ?? (row.entry.loaded === false ? onLoad ? null : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "text-muted-foreground", children: "\u2014" }) : row.previous ? row.entry.changesText ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "text-muted-foreground", children: row.entry.changesText }) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "text-muted-foreground", children: "No changes" }) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "text-muted-foreground", children: "First version" })),
|
|
28354
|
+
row.entry.loaded === false && onLoad ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
28268
28355
|
Button2,
|
|
28269
28356
|
{
|
|
28270
28357
|
type: "button",
|
|
28271
28358
|
variant: "link",
|
|
28272
|
-
icon: /* @__PURE__ */ (0,
|
|
28359
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(LoadIcon, { className: "size-3", "aria-hidden": true }),
|
|
28273
28360
|
"data-matrx-version-load": "",
|
|
28274
28361
|
className: "shrink-0",
|
|
28275
28362
|
onClick: (event) => {
|
|
@@ -28315,8 +28402,8 @@ function MatrxVersionTimeline({
|
|
|
28315
28402
|
return actions;
|
|
28316
28403
|
};
|
|
28317
28404
|
const words2 = pendingRestore && restore ? restore.confirm(pendingRestore) : null;
|
|
28318
|
-
return /* @__PURE__ */ (0,
|
|
28319
|
-
/* @__PURE__ */ (0,
|
|
28405
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
28406
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
28320
28407
|
MatrxDataTable,
|
|
28321
28408
|
{
|
|
28322
28409
|
tableId,
|
|
@@ -28342,7 +28429,7 @@ function MatrxVersionTimeline({
|
|
|
28342
28429
|
} : {}
|
|
28343
28430
|
}
|
|
28344
28431
|
),
|
|
28345
|
-
words2 ? /* @__PURE__ */ (0,
|
|
28432
|
+
words2 ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
28346
28433
|
ConfirmDialog,
|
|
28347
28434
|
{
|
|
28348
28435
|
open: true,
|