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