@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
package/dist/data-table/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
DEFAULT_TABLE_PAGE_SIZES,
|
|
7
7
|
GenericTablePagination
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-LS3C7IUV.js";
|
|
9
9
|
import {
|
|
10
10
|
useScrollPagination
|
|
11
11
|
} from "../chunk-VOFK23MG.js";
|
|
@@ -145,7 +145,7 @@ import {
|
|
|
145
145
|
ConfirmDialog,
|
|
146
146
|
EmptyState,
|
|
147
147
|
Tile
|
|
148
|
-
} from "../chunk-
|
|
148
|
+
} from "../chunk-WLKHQGX5.js";
|
|
149
149
|
import "../chunk-K4XCB576.js";
|
|
150
150
|
import {
|
|
151
151
|
ErrorBox
|
|
@@ -171,7 +171,7 @@ import {
|
|
|
171
171
|
MacLookLayer,
|
|
172
172
|
useMacLookAttributes,
|
|
173
173
|
withMacLookDefaults
|
|
174
|
-
} from "../chunk-
|
|
174
|
+
} from "../chunk-UGUVTE77.js";
|
|
175
175
|
import "../chunk-YC5GAO35.js";
|
|
176
176
|
import {
|
|
177
177
|
Checkbox
|
|
@@ -215,7 +215,7 @@ import {
|
|
|
215
215
|
searchValueVariants,
|
|
216
216
|
stringifyCellValue,
|
|
217
217
|
tokenFromColumnName
|
|
218
|
-
} from "../chunk-
|
|
218
|
+
} from "../chunk-2QFA6CK4.js";
|
|
219
219
|
import {
|
|
220
220
|
TIME_RANGE_PRESETS,
|
|
221
221
|
TIME_RANGE_PRESET_VALUES,
|
|
@@ -239,7 +239,7 @@ import {
|
|
|
239
239
|
} from "../chunk-FXT7PZAF.js";
|
|
240
240
|
import {
|
|
241
241
|
PropertyRow
|
|
242
|
-
} from "../chunk-
|
|
242
|
+
} from "../chunk-3YTF4MH2.js";
|
|
243
243
|
import "../chunk-WFBPCMPF.js";
|
|
244
244
|
import "../chunk-KGW373MK.js";
|
|
245
245
|
import {
|
|
@@ -257,7 +257,7 @@ import {
|
|
|
257
257
|
RecordId,
|
|
258
258
|
shortUuid,
|
|
259
259
|
useTableNotice
|
|
260
|
-
} from "../chunk-
|
|
260
|
+
} from "../chunk-RO5CRIOL.js";
|
|
261
261
|
import {
|
|
262
262
|
Badge,
|
|
263
263
|
Button as Button2,
|
|
@@ -266,7 +266,7 @@ import {
|
|
|
266
266
|
SegmentedControl,
|
|
267
267
|
Select as Select2,
|
|
268
268
|
Tabs
|
|
269
|
-
} from "../chunk-
|
|
269
|
+
} from "../chunk-KOUHF4JC.js";
|
|
270
270
|
import "../chunk-BD77DHUO.js";
|
|
271
271
|
import "../chunk-BKCJUFD3.js";
|
|
272
272
|
import {
|
|
@@ -289,7 +289,7 @@ import {
|
|
|
289
289
|
DropdownMenuSubContent,
|
|
290
290
|
DropdownMenuSubTrigger,
|
|
291
291
|
DropdownMenuTrigger
|
|
292
|
-
} from "../chunk-
|
|
292
|
+
} from "../chunk-AKSKVT2M.js";
|
|
293
293
|
import "../chunk-BNXNIN2S.js";
|
|
294
294
|
import {
|
|
295
295
|
peopleErrorSentence
|
|
@@ -632,11 +632,11 @@ import {
|
|
|
632
632
|
isValidElement,
|
|
633
633
|
memo,
|
|
634
634
|
useCallback as useCallback4,
|
|
635
|
-
useEffect as
|
|
635
|
+
useEffect as useEffect15,
|
|
636
636
|
useId as useId2,
|
|
637
637
|
useLayoutEffect as useLayoutEffect2,
|
|
638
638
|
useMemo as useMemo8,
|
|
639
|
-
useRef as
|
|
639
|
+
useRef as useRef15,
|
|
640
640
|
useState as useState17,
|
|
641
641
|
useContext as useContext5,
|
|
642
642
|
createContext as createContext4
|
|
@@ -8203,7 +8203,85 @@ function hiddenWithColumnDefaults(order, hidden, columns) {
|
|
|
8203
8203
|
|
|
8204
8204
|
// src/data-table/MatrxDataTable.tsx
|
|
8205
8205
|
import { openOutbound as openOutbound2 } from "@ai-matrx/kit/outbound";
|
|
8206
|
-
|
|
8206
|
+
|
|
8207
|
+
// src/data-table/MultilineRowMarker.tsx
|
|
8208
|
+
import { useRef as useRef14 } from "react";
|
|
8209
|
+
|
|
8210
|
+
// src/data-table/multiline-rows.ts
|
|
8211
|
+
import { useEffect as useEffect14 } from "react";
|
|
8212
|
+
var MULTI = "multi";
|
|
8213
|
+
function cellTextIsMultiline(cell) {
|
|
8214
|
+
const lineHeight = Number.parseFloat(getComputedStyle(cell).lineHeight);
|
|
8215
|
+
const minStep = Number.isFinite(lineHeight) ? lineHeight * 0.75 : 10;
|
|
8216
|
+
const walker = cell.ownerDocument.createTreeWalker(cell, NodeFilter.SHOW_TEXT);
|
|
8217
|
+
const range = cell.ownerDocument.createRange();
|
|
8218
|
+
let firstTop = null;
|
|
8219
|
+
for (let node = walker.nextNode(); node; node = walker.nextNode()) {
|
|
8220
|
+
if (!node.textContent?.trim()) continue;
|
|
8221
|
+
range.selectNodeContents(node);
|
|
8222
|
+
for (const rect of Array.from(range.getClientRects())) {
|
|
8223
|
+
if (rect.width === 0 || rect.height === 0) continue;
|
|
8224
|
+
if (firstTop === null) firstTop = rect.top;
|
|
8225
|
+
else if (Math.abs(rect.top - firstTop) >= minStep) return true;
|
|
8226
|
+
}
|
|
8227
|
+
}
|
|
8228
|
+
return false;
|
|
8229
|
+
}
|
|
8230
|
+
function markRows(root) {
|
|
8231
|
+
for (const row of Array.from(root.querySelectorAll("tbody > tr[data-row-id]"))) {
|
|
8232
|
+
let multi = false;
|
|
8233
|
+
for (const cell of Array.from(row.querySelectorAll("[data-matrx-cell-content]"))) {
|
|
8234
|
+
if (cellTextIsMultiline(cell)) {
|
|
8235
|
+
multi = true;
|
|
8236
|
+
break;
|
|
8237
|
+
}
|
|
8238
|
+
}
|
|
8239
|
+
if (multi) {
|
|
8240
|
+
if (row.getAttribute("data-matrx-row-lines") !== MULTI) row.setAttribute("data-matrx-row-lines", MULTI);
|
|
8241
|
+
} else if (row.hasAttribute("data-matrx-row-lines")) {
|
|
8242
|
+
row.removeAttribute("data-matrx-row-lines");
|
|
8243
|
+
}
|
|
8244
|
+
}
|
|
8245
|
+
}
|
|
8246
|
+
function useMultilineRowMarker(anchorRef) {
|
|
8247
|
+
useEffect14(() => {
|
|
8248
|
+
const root = anchorRef.current?.closest("[data-matrx-table]");
|
|
8249
|
+
if (!root || typeof ResizeObserver === "undefined" || typeof MutationObserver === "undefined") return;
|
|
8250
|
+
let pending = false;
|
|
8251
|
+
const run = () => {
|
|
8252
|
+
pending = false;
|
|
8253
|
+
if (root.isConnected) markRows(root);
|
|
8254
|
+
};
|
|
8255
|
+
const schedule = () => {
|
|
8256
|
+
if (pending) return;
|
|
8257
|
+
pending = true;
|
|
8258
|
+
setTimeout(run, 0);
|
|
8259
|
+
};
|
|
8260
|
+
schedule();
|
|
8261
|
+
const mutations = new MutationObserver(schedule);
|
|
8262
|
+
mutations.observe(root, { childList: true, subtree: true, characterData: true });
|
|
8263
|
+
const sizes = new ResizeObserver(schedule);
|
|
8264
|
+
sizes.observe(root);
|
|
8265
|
+
document.addEventListener("visibilitychange", schedule);
|
|
8266
|
+
return () => {
|
|
8267
|
+
pending = true;
|
|
8268
|
+
mutations.disconnect();
|
|
8269
|
+
sizes.disconnect();
|
|
8270
|
+
document.removeEventListener("visibilitychange", schedule);
|
|
8271
|
+
};
|
|
8272
|
+
}, [anchorRef]);
|
|
8273
|
+
}
|
|
8274
|
+
|
|
8275
|
+
// src/data-table/MultilineRowMarker.tsx
|
|
8276
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
8277
|
+
function MultilineRowMarker() {
|
|
8278
|
+
const anchorRef = useRef14(null);
|
|
8279
|
+
useMultilineRowMarker(anchorRef);
|
|
8280
|
+
return /* @__PURE__ */ jsx23("span", { ref: anchorRef, hidden: true, "aria-hidden": true, "data-matrx-multiline-row-marker": "" });
|
|
8281
|
+
}
|
|
8282
|
+
|
|
8283
|
+
// src/data-table/MatrxDataTable.tsx
|
|
8284
|
+
import { Fragment as Fragment15, jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
8207
8285
|
var EMPTY_TABLE_ROWS = [];
|
|
8208
8286
|
function TableToolbarAction({
|
|
8209
8287
|
HostAction,
|
|
@@ -8216,7 +8294,7 @@ function TableToolbarAction({
|
|
|
8216
8294
|
}) {
|
|
8217
8295
|
const listed = useToolbarListed();
|
|
8218
8296
|
if (listed) {
|
|
8219
|
-
return /* @__PURE__ */
|
|
8297
|
+
return /* @__PURE__ */ jsx24("span", { "data-matrx-table-toolbar-action": true, className: "inline-flex", children: /* @__PURE__ */ jsxs22(
|
|
8220
8298
|
Button,
|
|
8221
8299
|
{
|
|
8222
8300
|
type: "button",
|
|
@@ -8230,16 +8308,16 @@ function TableToolbarAction({
|
|
|
8230
8308
|
onClick,
|
|
8231
8309
|
children: [
|
|
8232
8310
|
isValidElement(children) ? cloneElement(children, { className: cn("h-4 w-4", children.props.className) }) : children,
|
|
8233
|
-
/* @__PURE__ */
|
|
8311
|
+
/* @__PURE__ */ jsx24("span", { children: ariaLabel })
|
|
8234
8312
|
]
|
|
8235
8313
|
}
|
|
8236
8314
|
) });
|
|
8237
8315
|
}
|
|
8238
8316
|
if (HostAction) {
|
|
8239
|
-
return /* @__PURE__ */
|
|
8317
|
+
return /* @__PURE__ */ jsx24("span", { "data-matrx-table-toolbar-action": true, children: /* @__PURE__ */ jsx24(HostAction, { ariaLabel, tooltip, disabled, busy, onClick, children }) });
|
|
8240
8318
|
}
|
|
8241
8319
|
return /* @__PURE__ */ jsxs22(Tooltip, { children: [
|
|
8242
|
-
/* @__PURE__ */
|
|
8320
|
+
/* @__PURE__ */ jsx24(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx24("span", { "data-matrx-table-toolbar-action": true, className: "inline-flex", children: /* @__PURE__ */ jsx24(
|
|
8243
8321
|
Button2,
|
|
8244
8322
|
{
|
|
8245
8323
|
variant: "quiet",
|
|
@@ -8251,7 +8329,7 @@ function TableToolbarAction({
|
|
|
8251
8329
|
icon: children
|
|
8252
8330
|
}
|
|
8253
8331
|
) }) }),
|
|
8254
|
-
/* @__PURE__ */
|
|
8332
|
+
/* @__PURE__ */ jsx24(TooltipContent, { children: tooltip ?? ariaLabel })
|
|
8255
8333
|
] });
|
|
8256
8334
|
}
|
|
8257
8335
|
function customActionsHeaderNeed(header) {
|
|
@@ -8276,7 +8354,7 @@ function TableRowCopyControl({
|
|
|
8276
8354
|
sourceId,
|
|
8277
8355
|
defaultColumns
|
|
8278
8356
|
}) {
|
|
8279
|
-
return /* @__PURE__ */
|
|
8357
|
+
return /* @__PURE__ */ jsx24(DeferredCopyButtons, { size, ...tableRowCopyProps(copy, row, sourceId, defaultColumns) });
|
|
8280
8358
|
}
|
|
8281
8359
|
function tableRowCopyProps(copy, row, sourceId, defaultColumns) {
|
|
8282
8360
|
const aiVariants = copy.rowAiVariants?.(row);
|
|
@@ -8486,7 +8564,7 @@ function MatrxDataTable(suppliedProps) {
|
|
|
8486
8564
|
resolvedUrlState?.auto ? resolvedUrlState.config.id : null,
|
|
8487
8565
|
Boolean(resolvedUrlState?.auto)
|
|
8488
8566
|
);
|
|
8489
|
-
return /* @__PURE__ */
|
|
8567
|
+
return /* @__PURE__ */ jsx24(MacLookContext.Provider, { value: props.look === "mac" ? props.density ?? lookHost.defaultDensity ?? "normal" : null, children: /* @__PURE__ */ jsx24(MacLookLayer, { density: props.look === "mac" ? props.density ?? lookHost.defaultDensity ?? "normal" : null, children: /* @__PURE__ */ jsx24(InsideMatrxDataTableContext.Provider, { value: true, children: /* @__PURE__ */ jsx24(MatrxTableCardContext.Provider, { value: null, children: /* @__PURE__ */ jsx24(TableCardOwnerContext.Provider, { value: card, children: resolvedUrlState ? /* @__PURE__ */ jsx24(
|
|
8490
8568
|
MatrxDataTableWithUrlState,
|
|
8491
8569
|
{
|
|
8492
8570
|
...presentedProps,
|
|
@@ -8494,7 +8572,7 @@ function MatrxDataTable(suppliedProps) {
|
|
|
8494
8572
|
autoUrlState: resolvedUrlState.auto
|
|
8495
8573
|
},
|
|
8496
8574
|
resolvedUrlState.auto ? defaultUrlId ?? resolvedUrlState.config.id : resolvedUrlState.config.id
|
|
8497
|
-
) : /* @__PURE__ */
|
|
8575
|
+
) : /* @__PURE__ */ jsx24(MatrxDataTableCore, { ...presentedProps, urlState: false }) }) }) }) }) });
|
|
8498
8576
|
}
|
|
8499
8577
|
var NO_CUSTOM_FIELD_COLUMNS = [];
|
|
8500
8578
|
function noCustomFieldColumns() {
|
|
@@ -8550,7 +8628,7 @@ function listPresentationProps(props) {
|
|
|
8550
8628
|
...props.focusRowId === void 0 && props.activeRowId ? { focusRowId: props.activeRowId } : {},
|
|
8551
8629
|
mobileCardsBreakpoint: "always",
|
|
8552
8630
|
cardsLayout: "list",
|
|
8553
|
-
mobileCards: props.mobileCards ?? ((row, _index, controls) => /* @__PURE__ */
|
|
8631
|
+
mobileCards: props.mobileCards ?? ((row, _index, controls) => /* @__PURE__ */ jsx24(
|
|
8554
8632
|
TableListItem,
|
|
8555
8633
|
{
|
|
8556
8634
|
title: titleOf(row),
|
|
@@ -8589,7 +8667,7 @@ function MatrxDataTableWithUrlState({
|
|
|
8589
8667
|
const seedFilters = props.initialColumnFilters;
|
|
8590
8668
|
const hasSeedFilters = Boolean(seedFilters && Object.keys(seedFilters).length > 0);
|
|
8591
8669
|
const [seeded, setSeeded] = useState17(!seedSearch && !hasSeedFilters);
|
|
8592
|
-
|
|
8670
|
+
useEffect15(() => {
|
|
8593
8671
|
if (seeded) return;
|
|
8594
8672
|
const params = new URLSearchParams(window.location.search);
|
|
8595
8673
|
const patch = {};
|
|
@@ -8610,7 +8688,7 @@ function MatrxDataTableWithUrlState({
|
|
|
8610
8688
|
},
|
|
8611
8689
|
[seeded, table.state, seedSearch, seedFilters, hasSeedFilters]
|
|
8612
8690
|
);
|
|
8613
|
-
|
|
8691
|
+
useEffect15(() => {
|
|
8614
8692
|
const id = urlState.id;
|
|
8615
8693
|
if (!autoUrlState) {
|
|
8616
8694
|
if (urlTableIdHeld(id)) {
|
|
@@ -8662,7 +8740,7 @@ function MatrxDataTableWithUrlState({
|
|
|
8662
8740
|
} : props.selection;
|
|
8663
8741
|
const viewSearch = useUrlSearchParams2().toString();
|
|
8664
8742
|
const carryView = useCallback4((href) => carryTableViewParams(href, viewSearch, urlState.id), [viewSearch, urlState.id]);
|
|
8665
|
-
return /* @__PURE__ */
|
|
8743
|
+
return /* @__PURE__ */ jsx24(TableViewHrefContext.Provider, { value: carryView, children: /* @__PURE__ */ jsx24(
|
|
8666
8744
|
MatrxDataTableCore,
|
|
8667
8745
|
{
|
|
8668
8746
|
...props,
|
|
@@ -8726,7 +8804,7 @@ function opensRowHref(event) {
|
|
|
8726
8804
|
return event.metaKey || event.ctrlKey || event.shiftKey || event.button === 1;
|
|
8727
8805
|
}
|
|
8728
8806
|
function TableContextPassthrough({ children }) {
|
|
8729
|
-
return /* @__PURE__ */
|
|
8807
|
+
return /* @__PURE__ */ jsx24(Fragment15, { children });
|
|
8730
8808
|
}
|
|
8731
8809
|
function sameWindow(a, b) {
|
|
8732
8810
|
if (a === null || b === null) return a === b;
|
|
@@ -8742,7 +8820,7 @@ var DND_MEASURING = { droppable: { strategy: MeasuringStrategy.Always } };
|
|
|
8742
8820
|
var NO_LAYERED_FILTERS = [];
|
|
8743
8821
|
var NO_GROUPING_VALUE = "__matrx_no_grouping__";
|
|
8744
8822
|
function useRenderEpoch(values) {
|
|
8745
|
-
const held =
|
|
8823
|
+
const held = useRef15(null);
|
|
8746
8824
|
const previous = held.current;
|
|
8747
8825
|
if (previous !== null && previous.values.length === values.length && previous.values.every((value, i) => Object.is(value, values[i]))) {
|
|
8748
8826
|
return previous.epoch;
|
|
@@ -8786,13 +8864,13 @@ function sameBodyRow(a, b) {
|
|
|
8786
8864
|
}
|
|
8787
8865
|
var MatrxTableBodyRow = memo(function MatrxTableBodyRow2(props) {
|
|
8788
8866
|
const { rowId, row, index, draw } = props;
|
|
8789
|
-
const last =
|
|
8867
|
+
const last = useRef15(null);
|
|
8790
8868
|
const fresh = last.current === null || !sameBodyRow({ ...last.current, probe: props.probe }, props);
|
|
8791
8869
|
last.current = props;
|
|
8792
8870
|
return draw(rowId, row, index, fresh);
|
|
8793
8871
|
}, sameBodyRow);
|
|
8794
8872
|
var MatrxTableChrome = memo(function MatrxTableChrome2({ render }) {
|
|
8795
|
-
return /* @__PURE__ */
|
|
8873
|
+
return /* @__PURE__ */ jsx24(Fragment15, { children: render() });
|
|
8796
8874
|
}, (a, b) => a.part === b.part && a.epoch === b.epoch);
|
|
8797
8875
|
function columnsSignature(columns) {
|
|
8798
8876
|
const out = [];
|
|
@@ -8911,7 +8989,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
8911
8989
|
appearance = "standalone"
|
|
8912
8990
|
} = coreProps;
|
|
8913
8991
|
const macPortalAttrs = useMacLookAttributes();
|
|
8914
|
-
const wearMacLook = (node) => macPortalAttrs["data-matrx-table-look"] ? /* @__PURE__ */
|
|
8992
|
+
const wearMacLook = (node) => macPortalAttrs["data-matrx-table-look"] ? /* @__PURE__ */ jsx24("div", { className: "contents", ...macPortalAttrs, children: node }) : node;
|
|
8915
8993
|
const urlState = suppliedUrlState || void 0;
|
|
8916
8994
|
const drill = isAnsweredDrillConfig(suppliedDrill) ? suppliedDrill : void 0;
|
|
8917
8995
|
const labelForField = useCallback4(
|
|
@@ -8951,7 +9029,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
8951
9029
|
const selectionConfig = suppliedSelectionConfig === false ? void 0 : suppliedSelectionConfig;
|
|
8952
9030
|
const appendQuery = query?.mode === "controlled-append" ? query : null;
|
|
8953
9031
|
const appendQueryKey = appendQuery?.pagination.queryKey ?? null;
|
|
8954
|
-
const committedAppendQueryKey =
|
|
9032
|
+
const committedAppendQueryKey = useRef15(appendQueryKey);
|
|
8955
9033
|
const appendSourceChanged = appendQuery !== null && committedAppendQueryKey.current !== appendQueryKey;
|
|
8956
9034
|
const data = (appendQuery ? appendQuery.pagination.rows : suppliedData) ?? EMPTY_TABLE_ROWS;
|
|
8957
9035
|
const appendFirstPagePending = appendQuery !== null && data.length === 0 && appendQuery.pagination.hasNextPage && !appendQuery.pagination.error;
|
|
@@ -8960,14 +9038,14 @@ function MatrxDataTableCore(coreProps) {
|
|
|
8960
9038
|
const frameHeight = isLoading && loadingRows === "fill" ? "fill" : askedFrameHeight;
|
|
8961
9039
|
const skeletonRowCount = loadingRows === "fill" ? 40 : Math.max(1, Math.min(100, Math.round(loadingRows ?? (defaultPageSize > 0 ? defaultPageSize : 6))));
|
|
8962
9040
|
const isFetching = appendQuery ? appendQuery.pagination.isFetchingNextPage : suppliedFetching;
|
|
8963
|
-
const everLoadingRef =
|
|
9041
|
+
const everLoadingRef = useRef15(false);
|
|
8964
9042
|
if (isLoading) everLoadingRef.current = true;
|
|
8965
9043
|
const everLoading = everLoadingRef.current;
|
|
8966
9044
|
const host = useMatrxDataTableHost();
|
|
8967
9045
|
const carryTableView = useContext5(TableViewHrefContext);
|
|
8968
9046
|
const ReadFailureView = host.ReadFailure ?? DefaultTableReadFailure;
|
|
8969
9047
|
const StaleNoticeView = host.StaleNotice ?? DefaultTableStaleNotice;
|
|
8970
|
-
const readFailure = readView.failure ? /* @__PURE__ */
|
|
9048
|
+
const readFailure = readView.failure ? /* @__PURE__ */ jsx24(ReadFailureView, { error: read?.error ?? true, what: readView.what, onRetry: read?.onRetry }) : null;
|
|
8971
9049
|
const ContextMenuBoundary = host.ContextMenuBoundary ?? TableContextPassthrough;
|
|
8972
9050
|
const resolvedDensity = density ?? host.defaultDensity ?? "normal";
|
|
8973
9051
|
const explicitRowHeight = askedRowHeight ?? (look === "mac" ? MAC_ROW_HEIGHT_BY_DENSITY[resolvedDensity] : void 0);
|
|
@@ -8980,7 +9058,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
8980
9058
|
const [savedViewError, setSavedViewError] = useState17(null);
|
|
8981
9059
|
const [toolbarActionError, setToolbarActionError] = useState17(null);
|
|
8982
9060
|
const [toolbarActionPending, setToolbarActionPending] = useState17({ refresh: false, add: false });
|
|
8983
|
-
const toolbarActionPendingRef =
|
|
9061
|
+
const toolbarActionPendingRef = useRef15({ refresh: false, add: false });
|
|
8984
9062
|
const CHECKBOX_TAP_AREA = "h-4 w-4 touch-manipulation";
|
|
8985
9063
|
const mobileCardsClass = mobileCardsBreakpoint === "always" ? "" : mobileCardsBreakpoint === "lg" ? "lg:hidden" : mobileCardsBreakpoint === "md" ? "md:hidden" : "sm:hidden";
|
|
8986
9064
|
const tableWithCardsClass = mobileCardsBreakpoint === "always" ? "hidden" : mobileCardsBreakpoint === "lg" ? "max-lg:hidden" : mobileCardsBreakpoint === "md" ? "max-md:hidden" : "max-sm:hidden";
|
|
@@ -8996,7 +9074,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
8996
9074
|
return () => media.removeEventListener?.("change", read2);
|
|
8997
9075
|
}, []);
|
|
8998
9076
|
const canonicalSelectionWidth = touchSelection ? 44 : SELECTION_COLUMN_PX;
|
|
8999
|
-
|
|
9077
|
+
useEffect15(() => {
|
|
9000
9078
|
if (!mobileCards || typeof window === "undefined" || !window.matchMedia) return;
|
|
9001
9079
|
const mql = window.matchMedia(cardsQuery);
|
|
9002
9080
|
const read2 = () => setCardsActive(mql.matches);
|
|
@@ -9151,9 +9229,9 @@ function MatrxDataTableCore(coreProps) {
|
|
|
9151
9229
|
const [windowRowSnapshot, setWindowRowSnapshot] = useState17(null);
|
|
9152
9230
|
const editScopeKey = appendQueryKey === null ? "\0local" : `append:${appendQueryKey}`;
|
|
9153
9231
|
const [editsByScope, setEditsByScope] = useState17({});
|
|
9154
|
-
const editRevisionRef =
|
|
9232
|
+
const editRevisionRef = useRef15({});
|
|
9155
9233
|
const [savingByScope, setSavingByScope] = useState17({});
|
|
9156
|
-
const savingScopesRef =
|
|
9234
|
+
const savingScopesRef = useRef15(/* @__PURE__ */ new Set());
|
|
9157
9235
|
const [editRequest, setEditRequest] = useState17(null);
|
|
9158
9236
|
const [confirmForeignDraftDiscard, setConfirmForeignDraftDiscard] = useState17(false);
|
|
9159
9237
|
const edits = editsByScope[editScopeKey]?.values ?? {};
|
|
@@ -9225,10 +9303,10 @@ function MatrxDataTableCore(coreProps) {
|
|
|
9225
9303
|
selectionConfig?.scopeKey === void 0 ? "receipt" : "membership",
|
|
9226
9304
|
selectionConfig?.scopeKey ?? appendQueryKey
|
|
9227
9305
|
]);
|
|
9228
|
-
const committedSelectionSourceKey =
|
|
9306
|
+
const committedSelectionSourceKey = useRef15(selectionSourceKey);
|
|
9229
9307
|
const selectionSourceChanged = selectionSourceKey !== null && committedSelectionSourceKey.current !== null && committedSelectionSourceKey.current !== selectionSourceKey;
|
|
9230
9308
|
const selection = selectionSourceChanged && selectionConfig ? { ...selectionConfig, selectedIds: [] } : selectionConfig;
|
|
9231
|
-
|
|
9309
|
+
useEffect15(() => {
|
|
9232
9310
|
const previous = committedAppendQueryKey.current;
|
|
9233
9311
|
committedAppendQueryKey.current = appendQueryKey;
|
|
9234
9312
|
if (previous === null || appendQueryKey === null || previous === appendQueryKey) {
|
|
@@ -9245,21 +9323,21 @@ function MatrxDataTableCore(coreProps) {
|
|
|
9245
9323
|
onWindowRowIdChange
|
|
9246
9324
|
]);
|
|
9247
9325
|
const onSelectionSourceChange = selectionConfig?.onSelectedIdsChange;
|
|
9248
|
-
|
|
9326
|
+
useEffect15(() => {
|
|
9249
9327
|
const previous = committedSelectionSourceKey.current;
|
|
9250
9328
|
committedSelectionSourceKey.current = selectionSourceKey;
|
|
9251
9329
|
if (previous !== null && selectionSourceKey !== null && previous !== selectionSourceKey) {
|
|
9252
9330
|
onSelectionSourceChange?.([]);
|
|
9253
9331
|
}
|
|
9254
9332
|
}, [selectionSourceKey, onSelectionSourceChange]);
|
|
9255
|
-
const scrollRef =
|
|
9256
|
-
const tableRef =
|
|
9257
|
-
const tableHeaderRef =
|
|
9258
|
-
const cardsScrollRef =
|
|
9333
|
+
const scrollRef = useRef15(null);
|
|
9334
|
+
const tableRef = useRef15(null);
|
|
9335
|
+
const tableHeaderRef = useRef15(null);
|
|
9336
|
+
const cardsScrollRef = useRef15(null);
|
|
9259
9337
|
const scrollContainers = useMemo8(() => [scrollRef, cardsScrollRef], []);
|
|
9260
9338
|
const [documentStickyHeader, setDocumentStickyHeader] = useState17(false);
|
|
9261
|
-
const documentStickyHeaderRef =
|
|
9262
|
-
const previousAppendKeyForScrollReset =
|
|
9339
|
+
const documentStickyHeaderRef = useRef15(false);
|
|
9340
|
+
const previousAppendKeyForScrollReset = useRef15(appendQueryKey);
|
|
9263
9341
|
useLayoutEffect2(() => {
|
|
9264
9342
|
const previous = previousAppendKeyForScrollReset.current;
|
|
9265
9343
|
previousAppendKeyForScrollReset.current = appendQueryKey;
|
|
@@ -9286,7 +9364,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
9286
9364
|
...appendScrollPolicy?.mode === "scroll" && appendScrollPolicy.thresholdPx !== void 0 ? { thresholdPx: appendScrollPolicy.thresholdPx } : {},
|
|
9287
9365
|
...appendScrollPolicy?.mode === "scroll" && appendScrollPolicy.intentTimeoutMs !== void 0 ? { intentTimeoutMs: appendScrollPolicy.intentTimeoutMs } : {}
|
|
9288
9366
|
});
|
|
9289
|
-
const rootRef =
|
|
9367
|
+
const rootRef = useRef15(null);
|
|
9290
9368
|
useClippedContentGuard(rootRef, {
|
|
9291
9369
|
label: typeof copy === "object" && copy.listLabel ? `Table: ${copy.listLabel}` : "MatrxDataTable"
|
|
9292
9370
|
});
|
|
@@ -9294,7 +9372,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
9294
9372
|
const [scrollHintLeft, setScrollHintLeft] = useState17(false);
|
|
9295
9373
|
const [scrollHintRightInset, setScrollHintRightInset] = useState17(6);
|
|
9296
9374
|
const [scrollHintTop, setScrollHintTop] = useState17(null);
|
|
9297
|
-
const hintScrollLeft =
|
|
9375
|
+
const hintScrollLeft = useRef15(0);
|
|
9298
9376
|
const updateScrollHint = useCallback4(() => {
|
|
9299
9377
|
const el = scrollRef.current;
|
|
9300
9378
|
if (!el) return;
|
|
@@ -9341,7 +9419,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
9341
9419
|
behavior: "smooth"
|
|
9342
9420
|
});
|
|
9343
9421
|
};
|
|
9344
|
-
|
|
9422
|
+
useEffect15(() => {
|
|
9345
9423
|
window.addEventListener("resize", updateScrollHint);
|
|
9346
9424
|
const el = scrollRef.current;
|
|
9347
9425
|
const observer = el && typeof ResizeObserver !== "undefined" ? new ResizeObserver(updateScrollHint) : null;
|
|
@@ -9441,18 +9519,18 @@ function MatrxDataTableCore(coreProps) {
|
|
|
9441
9519
|
() => normalizeColumnWidthsForColumns(columnState?.widths, columns)
|
|
9442
9520
|
);
|
|
9443
9521
|
const [fixedTableGeometry, setFixedTableGeometry] = useState17(null);
|
|
9444
|
-
const knownColumnIds =
|
|
9445
|
-
const draggedColumnId =
|
|
9446
|
-
const columnDragActive =
|
|
9447
|
-
const columnDragRaf =
|
|
9448
|
-
const columnDragScrollDirection =
|
|
9522
|
+
const knownColumnIds = useRef15(new Set(columns.map(columnId)));
|
|
9523
|
+
const draggedColumnId = useRef15(null);
|
|
9524
|
+
const columnDragActive = useRef15(false);
|
|
9525
|
+
const columnDragRaf = useRef15(null);
|
|
9526
|
+
const columnDragScrollDirection = useRef15(0);
|
|
9449
9527
|
const [columnDragPreview, setColumnDragPreview] = useState17(null);
|
|
9450
9528
|
const stopColumnDragScroll = useCallback4(() => {
|
|
9451
9529
|
if (columnDragRaf.current !== null) cancelAnimationFrame(columnDragRaf.current);
|
|
9452
9530
|
columnDragRaf.current = null;
|
|
9453
9531
|
columnDragScrollDirection.current = 0;
|
|
9454
9532
|
}, []);
|
|
9455
|
-
|
|
9533
|
+
useEffect15(() => () => {
|
|
9456
9534
|
columnDragActive.current = false;
|
|
9457
9535
|
stopColumnDragScroll();
|
|
9458
9536
|
}, [stopColumnDragScroll]);
|
|
@@ -9533,7 +9611,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
9533
9611
|
}, columns),
|
|
9534
9612
|
[columns, persistedColumnWidths, autoResizeSnapshot]
|
|
9535
9613
|
);
|
|
9536
|
-
const resizeGestureSnapshotRef =
|
|
9614
|
+
const resizeGestureSnapshotRef = useRef15(null);
|
|
9537
9615
|
const measureVisibleColumnWidths = useCallback4(() => {
|
|
9538
9616
|
const measured = {};
|
|
9539
9617
|
const headers = tableRef.current ? Array.from(tableRef.current.querySelectorAll(
|
|
@@ -9621,7 +9699,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
9621
9699
|
const { [id]: _dropped, ...rest } = effectiveColumnWidths;
|
|
9622
9700
|
commitColumnWidths(rest);
|
|
9623
9701
|
}, [commitColumnWidths, effectiveColumnWidths]);
|
|
9624
|
-
|
|
9702
|
+
useEffect15(() => {
|
|
9625
9703
|
const ids = columns.map(columnId);
|
|
9626
9704
|
if (columnState) return;
|
|
9627
9705
|
const previousIds = knownColumnIds.current;
|
|
@@ -9690,8 +9768,8 @@ function MatrxDataTableCore(coreProps) {
|
|
|
9690
9768
|
const freezeWanted = visibleColumns.some((column) => column.frozen);
|
|
9691
9769
|
const selectionColumnWidth = selection ? canonicalSelectionWidth : void 0;
|
|
9692
9770
|
const [fitSpace, setFitSpace] = useState17(null);
|
|
9693
|
-
const fitReadRef =
|
|
9694
|
-
const fitSettlePasses =
|
|
9771
|
+
const fitReadRef = useRef15(null);
|
|
9772
|
+
const fitSettlePasses = useRef15(0);
|
|
9695
9773
|
useLayoutEffect2(() => {
|
|
9696
9774
|
if (!fitSpace || fitSettlePasses.current >= 4) return;
|
|
9697
9775
|
fitSettlePasses.current += 1;
|
|
@@ -9873,7 +9951,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
9873
9951
|
const tableContextMenuInstanceId = useId2();
|
|
9874
9952
|
const tableDndContextId = useId2();
|
|
9875
9953
|
const defaultCopyTitle = toolbar?.title || "Table";
|
|
9876
|
-
const copyColumnsLatest =
|
|
9954
|
+
const copyColumnsLatest = useRef15(declaredVisibleCopyColumns);
|
|
9877
9955
|
copyColumnsLatest.current = declaredVisibleCopyColumns;
|
|
9878
9956
|
const readDeclaredCopyColumns = lazyCallback(() => copyColumnsLatest.current);
|
|
9879
9957
|
const defaultCopy = useMemo8(() => ({
|
|
@@ -9894,7 +9972,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
9894
9972
|
const visibleDataColumns = useMemo8(() => visibleColumns.filter((column) => !column.customActions), [visibleColumns]);
|
|
9895
9973
|
const effectiveCopyColumns = copy === void 0 ? declaredVisibleCopyColumns : visibleDataColumns;
|
|
9896
9974
|
const copySubsetVariant2 = useCopySubsetVariant();
|
|
9897
|
-
const chromeLatest =
|
|
9975
|
+
const chromeLatest = useRef15({
|
|
9898
9976
|
processed: [],
|
|
9899
9977
|
data: [],
|
|
9900
9978
|
toggleAllOnPage: () => void 0,
|
|
@@ -9938,7 +10016,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
9938
10016
|
}),
|
|
9939
10017
|
[columns, data, toolbar?.intelligentSearch?.roles, toolbar?.intelligentSearch?.scopes]
|
|
9940
10018
|
);
|
|
9941
|
-
const getRowIdForSearch =
|
|
10019
|
+
const getRowIdForSearch = useRef15(getRowId);
|
|
9942
10020
|
getRowIdForSearch.current = getRowId;
|
|
9943
10021
|
const rowIdForSearch = useCallback4((row) => getRowIdForSearch.current(row), []);
|
|
9944
10022
|
const searchTextWithId = useCallback4(
|
|
@@ -10028,11 +10106,11 @@ function MatrxDataTableCore(coreProps) {
|
|
|
10028
10106
|
sort
|
|
10029
10107
|
};
|
|
10030
10108
|
const viewQueryKey = onViewChange ? JSON.stringify(viewQuery) : "";
|
|
10031
|
-
const viewQueryRef =
|
|
10109
|
+
const viewQueryRef = useRef15(viewQuery);
|
|
10032
10110
|
viewQueryRef.current = viewQuery;
|
|
10033
|
-
const lastNotifiedViewRows =
|
|
10034
|
-
const lastNotifiedViewQueryKey =
|
|
10035
|
-
|
|
10111
|
+
const lastNotifiedViewRows = useRef15(null);
|
|
10112
|
+
const lastNotifiedViewQueryKey = useRef15(null);
|
|
10113
|
+
useEffect15(() => {
|
|
10036
10114
|
if (!onViewChange) {
|
|
10037
10115
|
lastNotifiedViewRows.current = null;
|
|
10038
10116
|
lastNotifiedViewQueryKey.current = null;
|
|
@@ -10043,7 +10121,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
10043
10121
|
lastNotifiedViewQueryKey.current = viewQueryKey;
|
|
10044
10122
|
if (changed) onViewChange(processed, viewQueryRef.current);
|
|
10045
10123
|
}, [processed, viewQueryKey, onViewChange]);
|
|
10046
|
-
|
|
10124
|
+
useEffect15(() => {
|
|
10047
10125
|
if (controlledQuery) return;
|
|
10048
10126
|
setInternalPage(1);
|
|
10049
10127
|
}, [
|
|
@@ -10143,9 +10221,9 @@ function MatrxDataTableCore(coreProps) {
|
|
|
10143
10221
|
const pageOffset = remoteQuery || hidePagination || localProgressiveEnabled || pageSize === 0 ? 0 : (safePage - 1) * effectivePageSize;
|
|
10144
10222
|
const focusIndex = focusRowId ? orderedRows.findIndex((r) => getRowId(r) === focusRowId) : -1;
|
|
10145
10223
|
const focusedRowId = focusIndex >= 0 ? focusRowId ?? null : null;
|
|
10146
|
-
const focusPagedFor =
|
|
10224
|
+
const focusPagedFor = useRef15(null);
|
|
10147
10225
|
const focusPageable = !remoteQuery && !hidePagination && !localProgressiveEnabled && pageSize !== 0;
|
|
10148
|
-
|
|
10226
|
+
useEffect15(() => {
|
|
10149
10227
|
if (!focusedRowId) {
|
|
10150
10228
|
focusPagedFor.current = null;
|
|
10151
10229
|
return;
|
|
@@ -10155,7 +10233,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
10155
10233
|
if (focusPageable) setPage(Math.floor(focusIndex / effectivePageSize) + 1);
|
|
10156
10234
|
}, [focusedRowId]);
|
|
10157
10235
|
const focusShownPage = focusedRowId !== null && (!focusPageable || safePage === Math.floor(focusIndex / effectivePageSize) + 1);
|
|
10158
|
-
|
|
10236
|
+
useEffect15(() => {
|
|
10159
10237
|
if (!focusedRowId || !focusShownPage) return;
|
|
10160
10238
|
const row = rootRef.current?.querySelector(`tr[data-row-id="${CSS.escape(focusedRowId)}"]`);
|
|
10161
10239
|
row?.scrollIntoView?.({ block: "center" });
|
|
@@ -10204,7 +10282,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
10204
10282
|
const columnVirtualizeActive = virtualizeConfig !== null && virtualizeConfig.enabled !== false && virtualizeConfig.columns === true && visibleColumns.length - frozenRunLength > 30 && !hierarchy && mobileCards === void 0;
|
|
10205
10283
|
const [rowWindow, setRowWindow] = useState17(null);
|
|
10206
10284
|
const [columnWindow, setColumnWindow] = useState17(null);
|
|
10207
|
-
const windowInputs =
|
|
10285
|
+
const windowInputs = useRef15({
|
|
10208
10286
|
virtualizeActive: false,
|
|
10209
10287
|
bodyEntryCount: 0,
|
|
10210
10288
|
virtualRowHeight: 40,
|
|
@@ -10276,7 +10354,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
10276
10354
|
frozenRunLength
|
|
10277
10355
|
]);
|
|
10278
10356
|
const metricsWanted = virtualizeActive || columnVirtualizeActive;
|
|
10279
|
-
|
|
10357
|
+
useEffect15(() => {
|
|
10280
10358
|
recomputeWindows();
|
|
10281
10359
|
}, [
|
|
10282
10360
|
recomputeWindows,
|
|
@@ -10288,7 +10366,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
10288
10366
|
columnWindowWidth,
|
|
10289
10367
|
frozenRunLength
|
|
10290
10368
|
]);
|
|
10291
|
-
|
|
10369
|
+
useEffect15(() => {
|
|
10292
10370
|
if (!metricsWanted) return;
|
|
10293
10371
|
const el = scrollRef.current;
|
|
10294
10372
|
if (!el) return;
|
|
@@ -10313,9 +10391,9 @@ function MatrxDataTableCore(coreProps) {
|
|
|
10313
10391
|
const cardsGridWindowed = cardsLayout === "grid" && groupedRenderRows === null;
|
|
10314
10392
|
const cardsVirtualActive = cardsMounted && virtualizeActive && (cardsLayout !== "grid" || cardsGridWindowed);
|
|
10315
10393
|
const cardEstimate = resolvedDensity === "condensed" ? 72 : resolvedDensity === "spacious" ? 104 : 88;
|
|
10316
|
-
const measuredCardSize =
|
|
10394
|
+
const measuredCardSize = useRef15(0);
|
|
10317
10395
|
const [cardWindow, setCardWindow] = useState17(null);
|
|
10318
|
-
const cardWindowInputs =
|
|
10396
|
+
const cardWindowInputs = useRef15({ active: false, grid: false, count: 0, size: 88, overscan: 8 });
|
|
10319
10397
|
cardWindowInputs.current = {
|
|
10320
10398
|
active: cardsVirtualActive,
|
|
10321
10399
|
grid: cardsGridWindowed,
|
|
@@ -10342,10 +10420,10 @@ function MatrxDataTableCore(coreProps) {
|
|
|
10342
10420
|
setCardWindow((prev) => sameWindow(prev, next) ? prev : next);
|
|
10343
10421
|
}, [computeCardWindow]);
|
|
10344
10422
|
const effectiveCardWindow = cardsVirtualActive ? cardWindow && cardWindow.end <= bodyEntryCount ? cardWindow : computeCardWindow() : null;
|
|
10345
|
-
|
|
10423
|
+
useEffect15(() => {
|
|
10346
10424
|
recomputeCardWindow();
|
|
10347
10425
|
}, [recomputeCardWindow, cardsVirtualActive, bodyEntryCount, cardEstimate]);
|
|
10348
|
-
|
|
10426
|
+
useEffect15(() => {
|
|
10349
10427
|
if (!cardsVirtualActive) return;
|
|
10350
10428
|
const el = cardsScrollRef.current;
|
|
10351
10429
|
if (!el) return;
|
|
@@ -10435,7 +10513,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
10435
10513
|
windowed.push({ kind: "spacer", height: effectiveRowWindow.padEnd, place: "end" });
|
|
10436
10514
|
return windowed;
|
|
10437
10515
|
}, [groupedRenderRows, collapsedGroups, paginated, effectiveRowWindow]);
|
|
10438
|
-
const getRowIdRef =
|
|
10516
|
+
const getRowIdRef = useRef15(getRowId);
|
|
10439
10517
|
getRowIdRef.current = getRowId;
|
|
10440
10518
|
const spreadsheetRowIds = useMemo8(
|
|
10441
10519
|
() => paginated.map((row) => getRowIdRef.current(row)),
|
|
@@ -10456,7 +10534,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
10456
10534
|
return map;
|
|
10457
10535
|
}, [visibleColumns]);
|
|
10458
10536
|
const spreadsheetEnabled = Boolean(spreadsheet && spreadsheet.enabled !== false);
|
|
10459
|
-
const openRowRef =
|
|
10537
|
+
const openRowRef = useRef15(() => void 0);
|
|
10460
10538
|
const sheet = useSpreadsheetGrid(
|
|
10461
10539
|
spreadsheetEnabled && spreadsheet ? {
|
|
10462
10540
|
rowIds: spreadsheetRowIds,
|
|
@@ -10498,12 +10576,12 @@ function MatrxDataTableCore(coreProps) {
|
|
|
10498
10576
|
} : null
|
|
10499
10577
|
);
|
|
10500
10578
|
if (spreadsheet?.controllerRef) spreadsheet.controllerRef.current = spreadsheetEnabled ? sheet.controller : null;
|
|
10501
|
-
const sheetRef =
|
|
10579
|
+
const sheetRef = useRef15(sheet);
|
|
10502
10580
|
sheetRef.current = sheet;
|
|
10503
|
-
const onSheetSelectionRef =
|
|
10581
|
+
const onSheetSelectionRef = useRef15(spreadsheet?.onSelectionChange);
|
|
10504
10582
|
onSheetSelectionRef.current = spreadsheet?.onSelectionChange;
|
|
10505
10583
|
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}` : ""}` : "";
|
|
10506
|
-
|
|
10584
|
+
useEffect15(() => {
|
|
10507
10585
|
const tell = onSheetSelectionRef.current;
|
|
10508
10586
|
if (!tell) return;
|
|
10509
10587
|
const current = sheetRef.current;
|
|
@@ -10520,7 +10598,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
10520
10598
|
tsv: current.selectionTsv()
|
|
10521
10599
|
});
|
|
10522
10600
|
}, [sheetSelectionKey]);
|
|
10523
|
-
const searchValueRef =
|
|
10601
|
+
const searchValueRef = useRef15(searchValue);
|
|
10524
10602
|
searchValueRef.current = searchValue;
|
|
10525
10603
|
const facetsEnabled = Boolean(facets && facets.enabled !== false);
|
|
10526
10604
|
const coreSuggestionsEnabled = facets?.enabled !== false;
|
|
@@ -10535,10 +10613,10 @@ function MatrxDataTableCore(coreProps) {
|
|
|
10535
10613
|
);
|
|
10536
10614
|
const coreFacetTotal = remoteQuery?.mode === "controlled" ? remoteQuery.totalItems : appendQuery?.pagination.sourceRecords?.total ?? coverage?.matched ?? coverage?.total;
|
|
10537
10615
|
const coreFacetLoaded = appendQuery?.pagination.sourceRecords?.loaded;
|
|
10538
|
-
const facetInputsRef =
|
|
10616
|
+
const facetInputsRef = useRef15({ data, facets, facetReadCell, coreFacetTotal, coreFacetLoaded });
|
|
10539
10617
|
facetInputsRef.current = { data, facets, facetReadCell, coreFacetTotal, coreFacetLoaded };
|
|
10540
|
-
const facetRequestRef =
|
|
10541
|
-
const requestedFacetColumns =
|
|
10618
|
+
const facetRequestRef = useRef15(/* @__PURE__ */ new Map());
|
|
10619
|
+
const requestedFacetColumns = useRef15(/* @__PURE__ */ new Set());
|
|
10542
10620
|
const requestFacets = useCallback4((colId) => {
|
|
10543
10621
|
requestedFacetColumns.current.add(colId);
|
|
10544
10622
|
const { data: rows, facets: config, facetReadCell: readCell, coreFacetTotal: total, coreFacetLoaded: loaded } = facetInputsRef.current;
|
|
@@ -10622,7 +10700,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
10622
10700
|
}));
|
|
10623
10701
|
});
|
|
10624
10702
|
}, []);
|
|
10625
|
-
|
|
10703
|
+
useEffect15(() => {
|
|
10626
10704
|
setFacetState((current) => Object.keys(current).length === 0 ? current : {});
|
|
10627
10705
|
for (const [colId, ticket] of facetRequestRef.current) {
|
|
10628
10706
|
facetRequestRef.current.set(colId, ticket + 1);
|
|
@@ -10632,7 +10710,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
10632
10710
|
}
|
|
10633
10711
|
}, [facetsEnabled, coreSuggestionsEnabled, data, searchValue, coreFacetTotal, coreFacetLoaded, requestFacets]);
|
|
10634
10712
|
const totalIsKnown = !isLoading && !readView.failure;
|
|
10635
|
-
|
|
10713
|
+
useEffect15(() => {
|
|
10636
10714
|
if (!controlledQuery || !totalIsKnown || controlledQuery.state.page === safePage) return;
|
|
10637
10715
|
emitControlledQueryChange({ page: safePage });
|
|
10638
10716
|
}, [controlledQuery, emitControlledQueryChange, safePage, totalIsKnown]);
|
|
@@ -10673,13 +10751,13 @@ function MatrxDataTableCore(coreProps) {
|
|
|
10673
10751
|
const reportCardTotal = embedded ? tableCard?.reportTotal : void 0;
|
|
10674
10752
|
const cardTotal = appendQuery ? appendQuery.pagination.totalItems : remoteQuery?.mode === "controlled" ? isLoading ? void 0 : remoteQuery.totalItems : isLoading ? void 0 : sourceProcessing ? sourceTotal : data.length;
|
|
10675
10753
|
const embeddedControlledPage = embedded && remoteQuery?.mode === "controlled" ? remoteQuery.state.page : 1;
|
|
10676
|
-
|
|
10754
|
+
useEffect15(() => {
|
|
10677
10755
|
if (embeddedControlledPage !== 1) emitControlledQueryChange({ page: 1 });
|
|
10678
10756
|
}, [embeddedControlledPage]);
|
|
10679
|
-
|
|
10757
|
+
useEffect15(() => {
|
|
10680
10758
|
reportCardTotal?.(cardTotal);
|
|
10681
10759
|
}, [reportCardTotal, cardTotal]);
|
|
10682
|
-
|
|
10760
|
+
useEffect15(() => () => reportCardTotal?.(void 0), [reportCardTotal]);
|
|
10683
10761
|
const [pinnedEl, setPinnedEl] = useState17(null);
|
|
10684
10762
|
const pinnedRowActive = Boolean(
|
|
10685
10763
|
toolbar?.singleRow && toolbar.overflow && toolbar.overflow.mode !== "sheet" && (toolbar.overflow.pinned || toolbar.overflow.mode === "menu")
|
|
@@ -10721,7 +10799,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
10721
10799
|
] });
|
|
10722
10800
|
}
|
|
10723
10801
|
const folded = pinnedFolded;
|
|
10724
|
-
toolbarEnd.node = /* @__PURE__ */
|
|
10802
|
+
toolbarEnd.node = /* @__PURE__ */ jsx24(
|
|
10725
10803
|
"span",
|
|
10726
10804
|
{
|
|
10727
10805
|
ref: setPinnedEl,
|
|
@@ -10731,7 +10809,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
10731
10809
|
children: folded ? /* @__PURE__ */ jsxs22(Fragment15, { children: [
|
|
10732
10810
|
primary,
|
|
10733
10811
|
/* @__PURE__ */ jsxs22(ToolbarOverflowMenu, { children: [
|
|
10734
|
-
toolbarSearch.node ? /* @__PURE__ */
|
|
10812
|
+
toolbarSearch.node ? /* @__PURE__ */ jsx24("div", { "data-matrx-table-toolbar-folded-search": "", "data-matrx-table-tools-keep-open": "", children: toolbarSearch.node }) : null,
|
|
10735
10813
|
controls,
|
|
10736
10814
|
overflow?.pinned,
|
|
10737
10815
|
overflow?.sheetExtras,
|
|
@@ -10764,10 +10842,10 @@ function MatrxDataTableCore(coreProps) {
|
|
|
10764
10842
|
return actionSlots;
|
|
10765
10843
|
};
|
|
10766
10844
|
const renderRowActions = (row, controls) => {
|
|
10767
|
-
const actions = rowActions ? /* @__PURE__ */
|
|
10768
|
-
const scopedActions = /* @__PURE__ */
|
|
10845
|
+
const actions = rowActions ? /* @__PURE__ */ jsx24(TableIconActions, { actions: rowActions(row, controls), inline: rowActionsInline, slots: pageActionSlots() }) : null;
|
|
10846
|
+
const scopedActions = /* @__PURE__ */ jsx24(MatrxTableRowControlsScope, { value: controls, children: actions });
|
|
10769
10847
|
if (!effectiveCopy || !showRowCopy) return scopedActions;
|
|
10770
|
-
return /* @__PURE__ */
|
|
10848
|
+
return /* @__PURE__ */ jsx24(
|
|
10771
10849
|
MatrxTableRowAlchemyProvider,
|
|
10772
10850
|
{
|
|
10773
10851
|
copy: tableRowCopyProps(effectiveCopy, row, `${tableCopySourceNamespace}:row:${getRowId(row)}`, copy === void 0 ? readDeclaredCopyColumns : void 0),
|
|
@@ -10825,7 +10903,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
10825
10903
|
if (value === null) return "\u2014";
|
|
10826
10904
|
const formatted = kpi.op === "count" ? null : formatColumnValue(col, value);
|
|
10827
10905
|
const text = formatted?.text ?? value.toLocaleString(void 0, { maximumFractionDigits: 2 });
|
|
10828
|
-
return tone ? /* @__PURE__ */
|
|
10906
|
+
return tone ? /* @__PURE__ */ jsx24("span", { className: COLUMN_TONE_CLASS[tone], children: text }) : text;
|
|
10829
10907
|
}
|
|
10830
10908
|
}))
|
|
10831
10909
|
);
|
|
@@ -10893,7 +10971,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
10893
10971
|
}
|
|
10894
10972
|
expandedDetail.onExpandedIdChange(expandedDetail.expandedId === id ? null : id);
|
|
10895
10973
|
};
|
|
10896
|
-
const warnedRowWithoutPage =
|
|
10974
|
+
const warnedRowWithoutPage = useRef15(false);
|
|
10897
10975
|
const openRow = (row) => {
|
|
10898
10976
|
if (canExpandRow(row)) {
|
|
10899
10977
|
toggleExpanded(row);
|
|
@@ -10958,7 +11036,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
10958
11036
|
};
|
|
10959
11037
|
const renderedEmptyState = (remoteQuery === null || remoteQueryUsesLocalProcessing) && data.length > 0 && hasActiveFilters ? {
|
|
10960
11038
|
title: "No matching rows",
|
|
10961
|
-
action: /* @__PURE__ */
|
|
11039
|
+
action: /* @__PURE__ */ jsx24(Button, { type: "button", variant: "outline", size: "sm", onClick: clearAllFilters, children: "Clear filters" }),
|
|
10962
11040
|
icon: void 0
|
|
10963
11041
|
} : emptyState;
|
|
10964
11042
|
const commitCell = (rowId, field, next) => {
|
|
@@ -11046,7 +11124,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
11046
11124
|
}));
|
|
11047
11125
|
return true;
|
|
11048
11126
|
};
|
|
11049
|
-
const requestCellEditRef =
|
|
11127
|
+
const requestCellEditRef = useRef15(requestCellEdit);
|
|
11050
11128
|
requestCellEditRef.current = requestCellEdit;
|
|
11051
11129
|
const buildRecordControls = (row) => {
|
|
11052
11130
|
const rowId = getRowId(row);
|
|
@@ -11388,16 +11466,16 @@ function MatrxDataTableCore(coreProps) {
|
|
|
11388
11466
|
return [];
|
|
11389
11467
|
}
|
|
11390
11468
|
};
|
|
11391
|
-
const menuSectionsForRef =
|
|
11469
|
+
const menuSectionsForRef = useRef15(menuSectionsFor);
|
|
11392
11470
|
menuSectionsForRef.current = menuSectionsFor;
|
|
11393
11471
|
const hasMenuSections = Boolean(contextMenu?.sections);
|
|
11394
11472
|
const boundarySections = useCallback4(
|
|
11395
11473
|
(target) => menuSectionsForRef.current(target),
|
|
11396
11474
|
[]
|
|
11397
11475
|
);
|
|
11398
|
-
const resolveMenuLevelRef =
|
|
11476
|
+
const resolveMenuLevelRef = useRef15(resolveMenuLevel);
|
|
11399
11477
|
resolveMenuLevelRef.current = resolveMenuLevel;
|
|
11400
|
-
|
|
11478
|
+
useEffect15(() => {
|
|
11401
11479
|
if (!host.rowContextRegistry) return;
|
|
11402
11480
|
return host.rowContextRegistry.register(
|
|
11403
11481
|
tableContextMenuInstanceId,
|
|
@@ -11406,20 +11484,20 @@ function MatrxDataTableCore(coreProps) {
|
|
|
11406
11484
|
}, [host.rowContextRegistry, tableContextMenuInstanceId]);
|
|
11407
11485
|
const showActionsCol = actionsColumn !== "none" && declaredActionsColumn === void 0 && (windowEnabled || Boolean(rowActions) || showInlineRowCopy);
|
|
11408
11486
|
const actionsHeaderCount = visibleColumns.filter((column) => typeof column.header === "string" && column.header.trim().toLowerCase() === "actions").length + (showActionsCol ? 1 : 0);
|
|
11409
|
-
|
|
11487
|
+
useEffect15(() => {
|
|
11410
11488
|
if (actionsHeaderCount > 1) {
|
|
11411
11489
|
console.error(
|
|
11412
11490
|
`[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.`
|
|
11413
11491
|
);
|
|
11414
11492
|
}
|
|
11415
11493
|
}, [actionsHeaderCount]);
|
|
11416
|
-
const renderWindowOpen = (row) => windowEnabled ? /* @__PURE__ */
|
|
11494
|
+
const renderWindowOpen = (row) => windowEnabled ? /* @__PURE__ */ jsx24(
|
|
11417
11495
|
TapTargetButtonTransparent,
|
|
11418
11496
|
{
|
|
11419
11497
|
"data-matrx-table-icon-action": "",
|
|
11420
11498
|
tone: "muted",
|
|
11421
11499
|
ariaLabel: windowConfig?.openOnRowClick === true ? "Open in side panel" : "Open in window",
|
|
11422
|
-
icon: opensWindowOnRowClick ? /* @__PURE__ */
|
|
11500
|
+
icon: opensWindowOnRowClick ? /* @__PURE__ */ jsx24(PanelRightIcon, { "aria-hidden": true }) : /* @__PURE__ */ jsx24(PanelRightIcon, { "aria-hidden": true }),
|
|
11423
11501
|
onClick: (e) => {
|
|
11424
11502
|
e?.stopPropagation();
|
|
11425
11503
|
if (windowConfig?.openOnRowClick === true) rowLatest.current.openDetail(row);
|
|
@@ -11466,8 +11544,8 @@ function MatrxDataTableCore(coreProps) {
|
|
|
11466
11544
|
});
|
|
11467
11545
|
}, [data, getSelectionId, selectedIdSet]);
|
|
11468
11546
|
const selectedCopyRows = useSelectedCopyRows(data, selectedIdSet, getSelectionId, savedViewsId, selection?.scopeKey);
|
|
11469
|
-
const lastToggledIndex =
|
|
11470
|
-
|
|
11547
|
+
const lastToggledIndex = useRef15(null);
|
|
11548
|
+
useEffect15(() => {
|
|
11471
11549
|
lastToggledIndex.current = null;
|
|
11472
11550
|
}, [savedViewsId, selection?.scopeKey]);
|
|
11473
11551
|
const setSelectedIds = (next) => {
|
|
@@ -11544,7 +11622,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
11544
11622
|
};
|
|
11545
11623
|
const drawsOnlyShutSections = paginated.length === 0 && !readFailure && groupedRenderRows !== null && groupedRenderRows.length > 0;
|
|
11546
11624
|
const messageOutsideTable = slackId === void 0 && !fixedLayoutActive && !fitActive && !isLoading && !drillGrouped && (Boolean(readFailure) || paginated.length === 0 && !drawsOnlyShutSections);
|
|
11547
|
-
const tableMessage = /* @__PURE__ */
|
|
11625
|
+
const tableMessage = /* @__PURE__ */ jsx24(
|
|
11548
11626
|
"div",
|
|
11549
11627
|
{
|
|
11550
11628
|
"data-matrx-table-empty-state": readFailure ? void 0 : "",
|
|
@@ -11552,8 +11630,8 @@ function MatrxDataTableCore(coreProps) {
|
|
|
11552
11630
|
style: { width: "100cqw", maxWidth: "100%" },
|
|
11553
11631
|
children: readFailure ?? /* @__PURE__ */ jsxs22(Fragment15, { children: [
|
|
11554
11632
|
renderedEmptyState?.icon,
|
|
11555
|
-
/* @__PURE__ */
|
|
11556
|
-
renderedEmptyState?.description ? /* @__PURE__ */
|
|
11633
|
+
/* @__PURE__ */ jsx24("p", { className: "text-sm font-medium text-foreground", children: renderedEmptyState?.title ?? "No rows" }),
|
|
11634
|
+
renderedEmptyState?.description ? /* @__PURE__ */ jsx24("p", { className: "text-xs text-muted-foreground", children: renderedEmptyState.description }) : null,
|
|
11557
11635
|
renderedEmptyState?.action
|
|
11558
11636
|
] })
|
|
11559
11637
|
}
|
|
@@ -11569,7 +11647,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
11569
11647
|
}
|
|
11570
11648
|
} : facet
|
|
11571
11649
|
) : toolbar?.facets;
|
|
11572
|
-
const rowLatest =
|
|
11650
|
+
const rowLatest = useRef15(null);
|
|
11573
11651
|
const renderRecordCell = (row, col, index, suppliedControls) => {
|
|
11574
11652
|
const id = getRowId(row);
|
|
11575
11653
|
const field = col.accessorKey ? String(col.accessorKey) : columnId(col);
|
|
@@ -11577,10 +11655,10 @@ function MatrxDataTableCore(coreProps) {
|
|
|
11577
11655
|
const displayRow = applyRowEdits(row, rowEdits);
|
|
11578
11656
|
if (col.customActions) {
|
|
11579
11657
|
const controls = suppliedControls ?? liveRecordControls(displayRow);
|
|
11580
|
-
const content = /* @__PURE__ */
|
|
11658
|
+
const content = /* @__PURE__ */ jsx24(MatrxTableRowControlsScope, { value: controls, children: col.customActions(displayRow, controls) });
|
|
11581
11659
|
const copyHere = rowCopyInCustomColumn && effectiveCopy && menuActionsColumn !== void 0 && columnId(col) === columnId(menuActionsColumn);
|
|
11582
11660
|
return /* @__PURE__ */ jsxs22("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: [
|
|
11583
|
-
copyHere && effectiveCopy ? /* @__PURE__ */
|
|
11661
|
+
copyHere && effectiveCopy ? /* @__PURE__ */ jsx24(
|
|
11584
11662
|
TableRowCopyControl,
|
|
11585
11663
|
{
|
|
11586
11664
|
size: "toolbar",
|
|
@@ -11590,7 +11668,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
11590
11668
|
...copy === void 0 ? { defaultColumns: readDeclaredCopyColumns } : {}
|
|
11591
11669
|
}
|
|
11592
11670
|
) : null,
|
|
11593
|
-
effectiveCopy && showRowCopy ? /* @__PURE__ */
|
|
11671
|
+
effectiveCopy && showRowCopy ? /* @__PURE__ */ jsx24(
|
|
11594
11672
|
MatrxTableRowAlchemyProvider,
|
|
11595
11673
|
{
|
|
11596
11674
|
copy: tableRowCopyProps(effectiveCopy, displayRow, `${tableCopySourceNamespace}:row:${getRowId(displayRow)}`, copy === void 0 ? readDeclaredCopyColumns : void 0),
|
|
@@ -11608,7 +11686,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
11608
11686
|
const display = renderCell(displayRow, col, index);
|
|
11609
11687
|
const href = col.href?.(row) ?? void 0;
|
|
11610
11688
|
if (editEnabled && col.editable && (col.editableIf?.(row) ?? true)) {
|
|
11611
|
-
return /* @__PURE__ */
|
|
11689
|
+
return /* @__PURE__ */ jsx24(
|
|
11612
11690
|
EditableTableCell,
|
|
11613
11691
|
{
|
|
11614
11692
|
value: rowEdits && field in rowEdits ? rowEdits[field] : getCellValue(row, col),
|
|
@@ -11635,7 +11713,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
11635
11713
|
}
|
|
11636
11714
|
);
|
|
11637
11715
|
}
|
|
11638
|
-
return href ? /* @__PURE__ */
|
|
11716
|
+
return href ? /* @__PURE__ */ jsx24(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;
|
|
11639
11717
|
};
|
|
11640
11718
|
const recordFieldColumns = columns.filter((col) => !col.customActions);
|
|
11641
11719
|
const recordFieldLabel = (col) => col.label ?? (typeof col.header === "string" ? col.header : displayLabel(void 0, columnId(col)));
|
|
@@ -11651,7 +11729,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
11651
11729
|
...col.accessorKey !== void 0 || col.accessorFn !== void 0 ? { value: getCellValue(displayRow, col) } : {},
|
|
11652
11730
|
render: () => {
|
|
11653
11731
|
const display = renderCell(displayRow, col, 0);
|
|
11654
|
-
return href ? /* @__PURE__ */
|
|
11732
|
+
return href ? /* @__PURE__ */ jsx24(Link, { href, className: "min-w-0 rounded outline-none focus-visible:ring-2 focus-visible:ring-ring", children: display }) : display;
|
|
11655
11733
|
}
|
|
11656
11734
|
};
|
|
11657
11735
|
});
|
|
@@ -11667,7 +11745,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
11667
11745
|
if (!rowHref) return null;
|
|
11668
11746
|
const href = carryTableView(rowHref);
|
|
11669
11747
|
return /* @__PURE__ */ jsxs22(Tooltip, { children: [
|
|
11670
|
-
/* @__PURE__ */
|
|
11748
|
+
/* @__PURE__ */ jsx24(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx24(
|
|
11671
11749
|
Link,
|
|
11672
11750
|
{
|
|
11673
11751
|
href,
|
|
@@ -11675,10 +11753,10 @@ function MatrxDataTableCore(coreProps) {
|
|
|
11675
11753
|
"data-matrx-record-page-door": true,
|
|
11676
11754
|
"aria-label": "Open full page",
|
|
11677
11755
|
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",
|
|
11678
|
-
children: /* @__PURE__ */
|
|
11756
|
+
children: /* @__PURE__ */ jsx24(Maximize2Icon, { className: "h-4 w-4" })
|
|
11679
11757
|
}
|
|
11680
11758
|
) }),
|
|
11681
|
-
/* @__PURE__ */
|
|
11759
|
+
/* @__PURE__ */ jsx24(TooltipContent, { children: "Open full page" })
|
|
11682
11760
|
] });
|
|
11683
11761
|
};
|
|
11684
11762
|
const currentViewSnapshot = useMemo8(
|
|
@@ -11917,7 +11995,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
11917
11995
|
];
|
|
11918
11996
|
const rowEpoch = useRenderEpoch(rowShape.filter((value) => typeof value !== "function" && (typeof value !== "object" || value === null)));
|
|
11919
11997
|
const rowProbe = useRenderEpoch(rowShape.filter((value) => typeof value === "function" || typeof value === "object" && value !== null));
|
|
11920
|
-
const rowDrawings =
|
|
11998
|
+
const rowDrawings = useRef15(null);
|
|
11921
11999
|
rowDrawings.current ??= new RowDrawings();
|
|
11922
12000
|
const drawBodyRow = (rowId, row, index, fresh) => rowDrawings.current.draw(rowId, renderRecordRow(row, index), fresh);
|
|
11923
12001
|
chromeLatest.current = { processed, data, toggleAllOnPage, showMore: progressiveRows.showMore, applySavedView };
|
|
@@ -12130,7 +12208,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12130
12208
|
background.row
|
|
12131
12209
|
),
|
|
12132
12210
|
children: [
|
|
12133
|
-
selection ? /* @__PURE__ */
|
|
12211
|
+
selection ? /* @__PURE__ */ jsx24(
|
|
12134
12212
|
"td",
|
|
12135
12213
|
{
|
|
12136
12214
|
className: cn(
|
|
@@ -12148,7 +12226,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12148
12226
|
),
|
|
12149
12227
|
style: fixedUtilityWidth(selectionColumnWidth),
|
|
12150
12228
|
onClick: (e) => e.stopPropagation(),
|
|
12151
|
-
children: selection.isRowSelectable?.(row) ?? true ? /* @__PURE__ */
|
|
12229
|
+
children: selection.isRowSelectable?.(row) ?? true ? /* @__PURE__ */ jsx24(
|
|
12152
12230
|
"div",
|
|
12153
12231
|
{
|
|
12154
12232
|
"data-matrx-table-selection-target": true,
|
|
@@ -12157,7 +12235,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12157
12235
|
event.currentTarget.querySelector('[role="checkbox"]')?.click();
|
|
12158
12236
|
}
|
|
12159
12237
|
},
|
|
12160
|
-
children: /* @__PURE__ */
|
|
12238
|
+
children: /* @__PURE__ */ jsx24(
|
|
12161
12239
|
Checkbox,
|
|
12162
12240
|
{
|
|
12163
12241
|
className: CHECKBOX_TAP_AREA,
|
|
@@ -12170,7 +12248,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12170
12248
|
) : null
|
|
12171
12249
|
}
|
|
12172
12250
|
) : null,
|
|
12173
|
-
columnSpacers && columnSpacers.start > 0 ? /* @__PURE__ */
|
|
12251
|
+
columnSpacers && columnSpacers.start > 0 ? /* @__PURE__ */ jsx24(
|
|
12174
12252
|
"td",
|
|
12175
12253
|
{
|
|
12176
12254
|
"aria-hidden": "true",
|
|
@@ -12274,7 +12352,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12274
12352
|
colIdx === 0 && (hierarchy || canExpandRow(row)) && "flex min-w-0 items-center"
|
|
12275
12353
|
),
|
|
12276
12354
|
children: [
|
|
12277
|
-
colIdx === 0 && hierarchy ? /* @__PURE__ */
|
|
12355
|
+
colIdx === 0 && hierarchy ? /* @__PURE__ */ jsx24(
|
|
12278
12356
|
HierarchyDragHandle,
|
|
12279
12357
|
{
|
|
12280
12358
|
id,
|
|
@@ -12283,7 +12361,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12283
12361
|
}
|
|
12284
12362
|
) : null,
|
|
12285
12363
|
colIdx === 0 && canExpandRow(row) ? /* @__PURE__ */ jsxs22(Tooltip, { children: [
|
|
12286
|
-
/* @__PURE__ */
|
|
12364
|
+
/* @__PURE__ */ jsx24(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx24(
|
|
12287
12365
|
Button,
|
|
12288
12366
|
{
|
|
12289
12367
|
type: "button",
|
|
@@ -12303,7 +12381,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12303
12381
|
event.stopPropagation();
|
|
12304
12382
|
rowLatest.current.toggleExpanded(row);
|
|
12305
12383
|
},
|
|
12306
|
-
children: /* @__PURE__ */
|
|
12384
|
+
children: /* @__PURE__ */ jsx24(
|
|
12307
12385
|
ChevronRightIcon,
|
|
12308
12386
|
{
|
|
12309
12387
|
className: cn(
|
|
@@ -12314,9 +12392,9 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12314
12392
|
)
|
|
12315
12393
|
}
|
|
12316
12394
|
) }),
|
|
12317
|
-
/* @__PURE__ */
|
|
12395
|
+
/* @__PURE__ */ jsx24(TooltipContent, { children: isRowExpanded(row) ? "Collapse details" : "Expand details" })
|
|
12318
12396
|
] }) : null,
|
|
12319
|
-
/* @__PURE__ */
|
|
12397
|
+
/* @__PURE__ */ jsx24(
|
|
12320
12398
|
"div",
|
|
12321
12399
|
{
|
|
12322
12400
|
"data-matrx-cell-content": true,
|
|
@@ -12328,7 +12406,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12328
12406
|
]
|
|
12329
12407
|
}
|
|
12330
12408
|
),
|
|
12331
|
-
carriesFillHandle ? /* @__PURE__ */
|
|
12409
|
+
carriesFillHandle ? /* @__PURE__ */ jsx24(
|
|
12332
12410
|
"button",
|
|
12333
12411
|
{
|
|
12334
12412
|
type: "button",
|
|
@@ -12343,7 +12421,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12343
12421
|
columnId(col)
|
|
12344
12422
|
);
|
|
12345
12423
|
}),
|
|
12346
|
-
columnSpacers && columnSpacers.end > 0 ? /* @__PURE__ */
|
|
12424
|
+
columnSpacers && columnSpacers.end > 0 ? /* @__PURE__ */ jsx24(
|
|
12347
12425
|
"td",
|
|
12348
12426
|
{
|
|
12349
12427
|
"aria-hidden": "true",
|
|
@@ -12353,7 +12431,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12353
12431
|
},
|
|
12354
12432
|
"matrx-column-spacer-end"
|
|
12355
12433
|
) : null,
|
|
12356
|
-
showActionsCol && /* @__PURE__ */
|
|
12434
|
+
showActionsCol && /* @__PURE__ */ jsx24(
|
|
12357
12435
|
"td",
|
|
12358
12436
|
{
|
|
12359
12437
|
"data-matrx-table-row-action-cell": true,
|
|
@@ -12380,7 +12458,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12380
12458
|
),
|
|
12381
12459
|
onClick: (e) => e.stopPropagation(),
|
|
12382
12460
|
children: [
|
|
12383
|
-
showInlineRowCopy && effectiveCopy ? /* @__PURE__ */
|
|
12461
|
+
showInlineRowCopy && effectiveCopy ? /* @__PURE__ */ jsx24(
|
|
12384
12462
|
TableRowCopyControl,
|
|
12385
12463
|
{
|
|
12386
12464
|
size: "toolbar",
|
|
@@ -12402,12 +12480,12 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12402
12480
|
id
|
|
12403
12481
|
);
|
|
12404
12482
|
const wrappedRow = rowWrapper ? rowWrapper(row, rowNode) : rowNode;
|
|
12405
|
-
const inlineDetail = expandedDetail && isRowExpanded(row) ? /* @__PURE__ */
|
|
12483
|
+
const inlineDetail = expandedDetail && isRowExpanded(row) ? /* @__PURE__ */ jsx24(
|
|
12406
12484
|
"tr",
|
|
12407
12485
|
{
|
|
12408
12486
|
"data-matrx-table-expanded-detail": id,
|
|
12409
12487
|
className: cn("bg-muted/20", expandedDetail.className),
|
|
12410
|
-
children: /* @__PURE__ */
|
|
12488
|
+
children: /* @__PURE__ */ jsx24(
|
|
12411
12489
|
"td",
|
|
12412
12490
|
{
|
|
12413
12491
|
colSpan: renderedColSpan,
|
|
@@ -12419,7 +12497,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12419
12497
|
`${id}:expanded-detail`
|
|
12420
12498
|
) : null;
|
|
12421
12499
|
return hierarchy ? /* @__PURE__ */ jsxs22(Fragment14, { children: [
|
|
12422
|
-
/* @__PURE__ */
|
|
12500
|
+
/* @__PURE__ */ jsx24(
|
|
12423
12501
|
HierarchyDroppableRow,
|
|
12424
12502
|
{
|
|
12425
12503
|
id,
|
|
@@ -12433,7 +12511,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12433
12511
|
inlineDetail
|
|
12434
12512
|
] }, id);
|
|
12435
12513
|
};
|
|
12436
|
-
return /* @__PURE__ */
|
|
12514
|
+
return /* @__PURE__ */ jsx24(TooltipProvider, { children: /* @__PURE__ */ jsx24(
|
|
12437
12515
|
ContextMenuBoundary,
|
|
12438
12516
|
{
|
|
12439
12517
|
label: tableId ?? "Data table",
|
|
@@ -12528,7 +12606,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12528
12606
|
commitColumnState(order, effectiveHiddenColumnIds);
|
|
12529
12607
|
},
|
|
12530
12608
|
children: [
|
|
12531
|
-
/* @__PURE__ */
|
|
12609
|
+
/* @__PURE__ */ jsx24(DragCursorMonitor, {}),
|
|
12532
12610
|
/* @__PURE__ */ jsxs22(
|
|
12533
12611
|
"div",
|
|
12534
12612
|
{
|
|
@@ -12542,16 +12620,18 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12542
12620
|
"data-url-state-table": urlState?.id,
|
|
12543
12621
|
"data-matrx-table-appearance": appearance,
|
|
12544
12622
|
"data-matrx-table-embedded": embedded || void 0,
|
|
12623
|
+
style: { "--matrx-table-row-height": `${explicitRowHeight ?? densityRowHeight}px` },
|
|
12545
12624
|
className: cn(
|
|
12546
12625
|
"flex h-full min-h-0 flex-col gap-2 px-0 pt-2 pb-0",
|
|
12547
12626
|
embedded && "h-auto gap-0 pt-0",
|
|
12548
12627
|
className
|
|
12549
12628
|
),
|
|
12550
12629
|
children: [
|
|
12630
|
+
/* @__PURE__ */ jsx24(MultilineRowMarker, {}),
|
|
12551
12631
|
notice,
|
|
12552
|
-
savedViewError ? /* @__PURE__ */
|
|
12553
|
-
toolbarActionError ? /* @__PURE__ */
|
|
12554
|
-
summaryMetrics.length > 0 ? /* @__PURE__ */
|
|
12632
|
+
savedViewError ? /* @__PURE__ */ jsx24(ErrorBox, { className: "shrink-0 text-xs text-destructive-ink", message: savedViewError, operation: "Save or apply a saved view", origin: "design-system/MatrxDataTable" }) : null,
|
|
12633
|
+
toolbarActionError ? /* @__PURE__ */ jsx24(ErrorBox, { className: "shrink-0 text-xs text-destructive-ink", message: toolbarActionError, operation: "Run a table toolbar action", origin: "design-system/MatrxDataTable" }) : null,
|
|
12634
|
+
summaryMetrics.length > 0 ? /* @__PURE__ */ jsx24(
|
|
12555
12635
|
"section",
|
|
12556
12636
|
{
|
|
12557
12637
|
"data-matrx-table-summary": true,
|
|
@@ -12564,23 +12644,23 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12564
12644
|
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"
|
|
12565
12645
|
),
|
|
12566
12646
|
children: summaryMetrics.map((metric) => /* @__PURE__ */ jsxs22("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: [
|
|
12567
|
-
/* @__PURE__ */
|
|
12647
|
+
/* @__PURE__ */ jsx24("div", { className: "truncate text-sm font-medium text-muted-foreground", children: metric.label }),
|
|
12568
12648
|
/* @__PURE__ */ jsxs22("div", { className: cn("truncate font-semibold tabular-nums text-foreground", summary?.variant === "large" ? "mt-1 text-xl" : "mt-0.5 text-sm"), children: [
|
|
12569
12649
|
metric.value,
|
|
12570
|
-
metric.unavailable ? /* @__PURE__ */
|
|
12650
|
+
metric.unavailable ? /* @__PURE__ */ jsx24(ErrorBox, { as: "span", className: "sr-only", message: `${metric.label} is unavailable`, operation: "Summarize this table", origin: "design-system/MatrxDataTable" }) : null
|
|
12571
12651
|
] }),
|
|
12572
|
-
summary?.hints === "shown" && metric.description ? /* @__PURE__ */
|
|
12652
|
+
summary?.hints === "shown" && metric.description ? /* @__PURE__ */ jsx24("div", { "data-matrx-table-summary-description": true, className: "mt-1 truncate text-xs font-normal text-muted-foreground", children: metric.description }) : null
|
|
12573
12653
|
] }, metric.id))
|
|
12574
12654
|
}
|
|
12575
12655
|
) : null,
|
|
12576
|
-
scopeBar ? /* @__PURE__ */
|
|
12577
|
-
/* @__PURE__ */
|
|
12578
|
-
const tabsNode = viewTabs && viewTabsStore ? /* @__PURE__ */
|
|
12656
|
+
scopeBar ? /* @__PURE__ */ jsx24(TableScopeBar, { ...scopeBar }) : null,
|
|
12657
|
+
/* @__PURE__ */ jsx24(MatrxTableChrome, { part: "toolbar", epoch: toolbarEpoch, render: () => {
|
|
12658
|
+
const tabsNode = viewTabs && viewTabsStore ? /* @__PURE__ */ jsx24(TableViewWorkspace, { snapshot: currentViewSnapshot, onApply: applyLatestSavedView, related: relatedTableActions, ...viewTabsStore ? { store: viewTabsStore } : {} }, savedViewsId ?? "table") : viewTabs && savedViewsId && SavedViews ? /* @__PURE__ */ jsx24(SavedViews, { tableId: savedViewsId, snapshot: currentViewSnapshot, defaultSnapshot: declaredDefaultViewSnapshot, onApply: applyLatestSavedView, presentation: "tabs", related: relatedTableActions }) : void 0;
|
|
12579
12659
|
const tabsPlaced = Boolean(toolbar && "tabsPortalInto" in toolbar);
|
|
12580
12660
|
const tabsTarget = toolbar && "tabsPortalInto" in toolbar ? toolbar.tabsPortalInto : null;
|
|
12581
12661
|
return /* @__PURE__ */ jsxs22(Fragment15, { children: [
|
|
12582
12662
|
tabsPlaced && tabsTarget && tabsNode && !hideToolbar ? createPortal2(
|
|
12583
|
-
/* @__PURE__ */
|
|
12663
|
+
/* @__PURE__ */ jsx24("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 }),
|
|
12584
12664
|
tabsTarget
|
|
12585
12665
|
) : null,
|
|
12586
12666
|
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__ */ jsxs22(
|
|
@@ -12590,7 +12670,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12590
12670
|
tabs: tabsPlaced ? void 0 : tabsNode,
|
|
12591
12671
|
...toolbar?.title === void 0 ? {} : { title: toolbar.title },
|
|
12592
12672
|
...toolbar?.titleCount === void 0 ? {} : { count: toolbar.titleCount },
|
|
12593
|
-
context: savedViewsId && SavedViews && !viewTabs ? /* @__PURE__ */
|
|
12673
|
+
context: savedViewsId && SavedViews && !viewTabs ? /* @__PURE__ */ jsx24("span", { "data-matrx-table-view-control": true, children: /* @__PURE__ */ jsx24(
|
|
12594
12674
|
SavedViews,
|
|
12595
12675
|
{
|
|
12596
12676
|
tableId: savedViewsId,
|
|
@@ -12599,7 +12679,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12599
12679
|
onApply: applyLatestSavedView
|
|
12600
12680
|
}
|
|
12601
12681
|
) }) : void 0,
|
|
12602
|
-
search: (toolbarSearch.node = toolbar?.customSearch ?? (showSearch ? intelligentSearchEnabled ? /* @__PURE__ */
|
|
12682
|
+
search: (toolbarSearch.node = toolbar?.customSearch ?? (showSearch ? intelligentSearchEnabled ? /* @__PURE__ */ jsx24(
|
|
12603
12683
|
TableSearch,
|
|
12604
12684
|
{
|
|
12605
12685
|
value: searchValue,
|
|
@@ -12618,7 +12698,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12618
12698
|
toolbar?.searchMatch ? "sm:max-w-md" : "sm:max-w-xs"
|
|
12619
12699
|
),
|
|
12620
12700
|
children: [
|
|
12621
|
-
/* @__PURE__ */
|
|
12701
|
+
/* @__PURE__ */ jsx24(
|
|
12622
12702
|
SearchField,
|
|
12623
12703
|
{
|
|
12624
12704
|
value: searchValue,
|
|
@@ -12626,15 +12706,15 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12626
12706
|
placeholder: toolbar?.searchPlaceholder ?? "Search\u2026",
|
|
12627
12707
|
"aria-label": (toolbar?.searchPlaceholder ?? "Search").replace(/[….]+$/, "") || "Search table",
|
|
12628
12708
|
className: "min-w-0 flex-1",
|
|
12629
|
-
end: searchValue ? /* @__PURE__ */
|
|
12709
|
+
end: searchValue ? /* @__PURE__ */ jsx24("button", { type: "button", "aria-label": "Clear search", title: "Clear search", onClick: () => setSearchValue(""), children: /* @__PURE__ */ jsx24(XIcon, { "aria-hidden": "true" }) }) : void 0
|
|
12630
12710
|
}
|
|
12631
12711
|
),
|
|
12632
12712
|
toolbar?.searchMatch ? /* @__PURE__ */ jsxs22(Tooltip, { children: [
|
|
12633
|
-
/* @__PURE__ */
|
|
12713
|
+
/* @__PURE__ */ jsx24(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx24(
|
|
12634
12714
|
Button2,
|
|
12635
12715
|
{
|
|
12636
12716
|
variant: searchMatchMode === "whole_words" ? "primary" : "outline",
|
|
12637
|
-
icon: /* @__PURE__ */
|
|
12717
|
+
icon: /* @__PURE__ */ jsx24(WholeWord, { "aria-hidden": "true" }),
|
|
12638
12718
|
"aria-pressed": searchMatchMode === "whole_words",
|
|
12639
12719
|
"aria-label": `Search match: ${searchMatchMode === "whole_words" ? "whole words" : "contains text"}`,
|
|
12640
12720
|
onClick: () => setSearchMatchMode(
|
|
@@ -12643,13 +12723,13 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12643
12723
|
children: searchMatchMode === "whole_words" ? "Whole words" : "Contains"
|
|
12644
12724
|
}
|
|
12645
12725
|
) }),
|
|
12646
|
-
/* @__PURE__ */
|
|
12726
|
+
/* @__PURE__ */ jsx24(TooltipContent, { children: searchMatchMode === "whole_words" ? "Whole words \u2014 click to match text anywhere" : "Contains text \u2014 click to require whole words" })
|
|
12647
12727
|
] }) : null
|
|
12648
12728
|
]
|
|
12649
12729
|
}
|
|
12650
12730
|
) : null), pinnedFolded && pinnedRowActive ? void 0 : toolbarSearch.node),
|
|
12651
12731
|
children: [
|
|
12652
|
-
toolbar?.layeredFilters ? /* @__PURE__ */
|
|
12732
|
+
toolbar?.layeredFilters ? /* @__PURE__ */ jsx24(
|
|
12653
12733
|
LayeredFilterBuilder,
|
|
12654
12734
|
{
|
|
12655
12735
|
fields: toolbar.layeredFilters.fields,
|
|
@@ -12660,8 +12740,8 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12660
12740
|
}
|
|
12661
12741
|
) : null,
|
|
12662
12742
|
toolbar?.anyOf ? /* @__PURE__ */ jsxs22("div", { className: "relative w-full max-w-xs", children: [
|
|
12663
|
-
/* @__PURE__ */
|
|
12664
|
-
/* @__PURE__ */
|
|
12743
|
+
/* @__PURE__ */ jsx24(SearchIcon, { className: "absolute left-2 top-1/2 h-5 w-5 -translate-y-1/2 text-muted-foreground" }),
|
|
12744
|
+
/* @__PURE__ */ jsx24(
|
|
12665
12745
|
Input,
|
|
12666
12746
|
{
|
|
12667
12747
|
value: anyOfValue,
|
|
@@ -12672,21 +12752,21 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12672
12752
|
}
|
|
12673
12753
|
),
|
|
12674
12754
|
anyOfValue ? /* @__PURE__ */ jsxs22(Tooltip, { children: [
|
|
12675
|
-
/* @__PURE__ */
|
|
12755
|
+
/* @__PURE__ */ jsx24(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx24(
|
|
12676
12756
|
"button",
|
|
12677
12757
|
{
|
|
12678
12758
|
type: "button",
|
|
12679
12759
|
"aria-label": "Clear match-any search",
|
|
12680
12760
|
className: "absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground hover:text-foreground",
|
|
12681
12761
|
onClick: () => setAnyOfValue(""),
|
|
12682
|
-
children: /* @__PURE__ */
|
|
12762
|
+
children: /* @__PURE__ */ jsx24(XIcon, { className: "h-5 w-5" })
|
|
12683
12763
|
}
|
|
12684
12764
|
) }),
|
|
12685
|
-
/* @__PURE__ */
|
|
12765
|
+
/* @__PURE__ */ jsx24(TooltipContent, { children: "Clear match-any search" })
|
|
12686
12766
|
] }) : null
|
|
12687
12767
|
] }) : null,
|
|
12688
|
-
renderedFacets ? /* @__PURE__ */
|
|
12689
|
-
toolbar?.leading ? /* @__PURE__ */
|
|
12768
|
+
renderedFacets ? /* @__PURE__ */ jsx24(ToolbarFacets, { facets: renderedFacets }) : null,
|
|
12769
|
+
toolbar?.leading ? /* @__PURE__ */ jsx24(
|
|
12690
12770
|
"div",
|
|
12691
12771
|
{
|
|
12692
12772
|
"data-matrx-table-toolbar-extras": true,
|
|
@@ -12694,7 +12774,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12694
12774
|
children: toolbar.leading
|
|
12695
12775
|
}
|
|
12696
12776
|
) : null,
|
|
12697
|
-
drill && !drillOwnRow && (drill.question.where.length > 0 || drillIsPeriodWindow(drill.question.window) || (drill.base?.length ?? 0) > 0) ? /* @__PURE__ */
|
|
12777
|
+
drill && !drillOwnRow && (drill.question.where.length > 0 || drillIsPeriodWindow(drill.question.window) || (drill.base?.length ?? 0) > 0) ? /* @__PURE__ */ jsx24(
|
|
12698
12778
|
MatrxDrillTrail,
|
|
12699
12779
|
{
|
|
12700
12780
|
base: drill.base,
|
|
@@ -12721,7 +12801,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12721
12801
|
),
|
|
12722
12802
|
children: [
|
|
12723
12803
|
toolbar?.singleRow && coverageResult && coverageResult.notice ? /* @__PURE__ */ jsxs22(Tooltip, { children: [
|
|
12724
|
-
/* @__PURE__ */
|
|
12804
|
+
/* @__PURE__ */ jsx24(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs22(
|
|
12725
12805
|
"span",
|
|
12726
12806
|
{
|
|
12727
12807
|
"data-matrx-table-coverage": true,
|
|
@@ -12738,21 +12818,21 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12738
12818
|
]
|
|
12739
12819
|
}
|
|
12740
12820
|
) }),
|
|
12741
|
-
/* @__PURE__ */
|
|
12821
|
+
/* @__PURE__ */ jsx24(TooltipContent, { className: "max-w-xs", children: coverageResult.notice })
|
|
12742
12822
|
] }) : null,
|
|
12743
12823
|
renderToolbarControls(/* @__PURE__ */ jsxs22(Fragment15, { children: [
|
|
12744
|
-
hasActiveFilters ? /* @__PURE__ */
|
|
12824
|
+
hasActiveFilters ? /* @__PURE__ */ jsx24(
|
|
12745
12825
|
TableToolbarAction,
|
|
12746
12826
|
{
|
|
12747
12827
|
HostAction: host.ToolbarAction,
|
|
12748
12828
|
ariaLabel: "Clear all filters",
|
|
12749
12829
|
tooltip: "Clear search and filters; keep columns and sort",
|
|
12750
12830
|
onClick: clearAllFilters,
|
|
12751
|
-
children: /* @__PURE__ */
|
|
12831
|
+
children: /* @__PURE__ */ jsx24(Eraser, {})
|
|
12752
12832
|
}
|
|
12753
12833
|
) : null,
|
|
12754
12834
|
drill ? drillOwnRow ? null : /* @__PURE__ */ jsxs22(Fragment15, { children: [
|
|
12755
|
-
drill.windowDimension ? /* @__PURE__ */
|
|
12835
|
+
drill.windowDimension ? /* @__PURE__ */ jsx24(
|
|
12756
12836
|
MatrxDrillWindowMenu,
|
|
12757
12837
|
{
|
|
12758
12838
|
question: drill.question,
|
|
@@ -12760,7 +12840,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12760
12840
|
dimensionLabel: drill.dimensions.find((d) => d.key === drill.windowDimension)?.label ?? drill.windowDimension
|
|
12761
12841
|
}
|
|
12762
12842
|
) : null,
|
|
12763
|
-
drillGrouped ? /* @__PURE__ */
|
|
12843
|
+
drillGrouped ? /* @__PURE__ */ jsx24(
|
|
12764
12844
|
MatrxDrillMeasurePicker,
|
|
12765
12845
|
{
|
|
12766
12846
|
measures: drill.measures,
|
|
@@ -12768,7 +12848,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12768
12848
|
onQuestionChange: drill.onQuestionChange
|
|
12769
12849
|
}
|
|
12770
12850
|
) : null,
|
|
12771
|
-
/* @__PURE__ */
|
|
12851
|
+
/* @__PURE__ */ jsx24(
|
|
12772
12852
|
MatrxDrillGroupByMenu,
|
|
12773
12853
|
{
|
|
12774
12854
|
dimensions: drill.dimensions,
|
|
@@ -12780,7 +12860,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12780
12860
|
// The shared Select (playground review A): the same 28px capsule as every
|
|
12781
12861
|
// other control in the row, never a second select with its own padding.
|
|
12782
12862
|
/* @__PURE__ */ jsxs22("span", { "data-matrx-table-group-by": "", className: "inline-flex", children: [
|
|
12783
|
-
/* @__PURE__ */
|
|
12863
|
+
/* @__PURE__ */ jsx24(
|
|
12784
12864
|
Select2,
|
|
12785
12865
|
{
|
|
12786
12866
|
"aria-label": "Group rows by a column",
|
|
@@ -12800,7 +12880,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12800
12880
|
const chosen = grouping.thenColumnIds ?? [];
|
|
12801
12881
|
if (at2 > chosen.length) return null;
|
|
12802
12882
|
const taken = /* @__PURE__ */ new Set([groupingColumnId, ...chosen.filter((_, i) => i !== at2)]);
|
|
12803
|
-
return /* @__PURE__ */
|
|
12883
|
+
return /* @__PURE__ */ jsx24(
|
|
12804
12884
|
Select2,
|
|
12805
12885
|
{
|
|
12806
12886
|
"aria-label": `Then group rows by a column (level ${at2 + 2})`,
|
|
@@ -12825,17 +12905,17 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12825
12905
|
}) : null
|
|
12826
12906
|
] })
|
|
12827
12907
|
) : null,
|
|
12828
|
-
columns.length > 0 && toolbar?.columns !== false ? /* @__PURE__ */
|
|
12908
|
+
columns.length > 0 && toolbar?.columns !== false ? /* @__PURE__ */ jsx24(
|
|
12829
12909
|
TableToolbarAction,
|
|
12830
12910
|
{
|
|
12831
12911
|
HostAction: host.ToolbarAction,
|
|
12832
12912
|
ariaLabel: "Columns",
|
|
12833
12913
|
tooltip: "Show, hide, or reorder columns",
|
|
12834
12914
|
onClick: () => setColumnManagerOpen(true),
|
|
12835
|
-
children: /* @__PURE__ */
|
|
12915
|
+
children: /* @__PURE__ */ jsx24(SlidersHorizontal, {})
|
|
12836
12916
|
}
|
|
12837
12917
|
) : null,
|
|
12838
|
-
toolbar?.refresh ? /* @__PURE__ */
|
|
12918
|
+
toolbar?.refresh ? /* @__PURE__ */ jsx24(
|
|
12839
12919
|
TableToolbarAction,
|
|
12840
12920
|
{
|
|
12841
12921
|
HostAction: host.ToolbarAction,
|
|
@@ -12857,10 +12937,10 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12857
12937
|
setToolbarActionPending((current) => ({ ...current, refresh: false }));
|
|
12858
12938
|
});
|
|
12859
12939
|
},
|
|
12860
|
-
children: /* @__PURE__ */
|
|
12940
|
+
children: /* @__PURE__ */ jsx24(RefreshControlIcon, { spinning: isFetching || toolbarActionPending.refresh })
|
|
12861
12941
|
}
|
|
12862
12942
|
) : null,
|
|
12863
|
-
toolbar?.add ? /* @__PURE__ */
|
|
12943
|
+
toolbar?.add ? /* @__PURE__ */ jsx24(
|
|
12864
12944
|
TableToolbarAction,
|
|
12865
12945
|
{
|
|
12866
12946
|
HostAction: host.ToolbarAction,
|
|
@@ -12882,11 +12962,11 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12882
12962
|
setToolbarActionPending((current) => ({ ...current, add: false }));
|
|
12883
12963
|
});
|
|
12884
12964
|
},
|
|
12885
|
-
children: /* @__PURE__ */
|
|
12965
|
+
children: /* @__PURE__ */ jsx24(PlusIcon, {})
|
|
12886
12966
|
}
|
|
12887
12967
|
) : null,
|
|
12888
12968
|
toolbar?.actions
|
|
12889
|
-
] }), showToolbarCopy && effectiveCopy ? /* @__PURE__ */
|
|
12969
|
+
] }), showToolbarCopy && effectiveCopy ? /* @__PURE__ */ jsx24(ToolbarListedLabel, { label: "Copy or export", children: /* @__PURE__ */ jsx24(
|
|
12890
12970
|
CopyButtons,
|
|
12891
12971
|
{
|
|
12892
12972
|
size: "toolbar",
|
|
@@ -12948,7 +13028,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12948
13028
|
] });
|
|
12949
13029
|
} }),
|
|
12950
13030
|
/* @__PURE__ */ jsxs22("div", { "data-matrx-table-body-region": true, className: "flex min-h-0 flex-1 flex-col gap-2", children: [
|
|
12951
|
-
drill && drillOwnRow ? /* @__PURE__ */
|
|
13031
|
+
drill && drillOwnRow ? /* @__PURE__ */ jsx24(MatrxDrillBar, { drill, answers: drillAnswers, rowNoun: grouping?.rowNoun }) : null,
|
|
12952
13032
|
coverageResult && coverageResult.notice && !toolbar?.singleRow ? /* @__PURE__ */ jsxs22(
|
|
12953
13033
|
"div",
|
|
12954
13034
|
{
|
|
@@ -12957,12 +13037,12 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12957
13037
|
role: "status",
|
|
12958
13038
|
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",
|
|
12959
13039
|
children: [
|
|
12960
|
-
/* @__PURE__ */
|
|
12961
|
-
/* @__PURE__ */
|
|
13040
|
+
/* @__PURE__ */ jsx24("span", { className: "shrink-0 whitespace-nowrap font-semibold", children: coverageResult.badge }),
|
|
13041
|
+
/* @__PURE__ */ jsx24("span", { className: "min-w-0", children: coverageResult.notice })
|
|
12962
13042
|
]
|
|
12963
13043
|
}
|
|
12964
13044
|
) : null,
|
|
12965
|
-
readView.stale ? /* @__PURE__ */
|
|
13045
|
+
readView.stale ? /* @__PURE__ */ jsx24(StaleNoticeView, { error: read?.error ?? true, what: readView.what, onRetry: read?.onRetry }) : null,
|
|
12966
13046
|
/* @__PURE__ */ jsxs22("div", { "data-matrx-table-scroll-frame": "", className: cn("relative min-h-0", frameHeight === "content" ? "flex flex-initial flex-col" : "flex-1"), children: [
|
|
12967
13047
|
mobileCards && cardsMounted ? /* @__PURE__ */ jsxs22(
|
|
12968
13048
|
"div",
|
|
@@ -12988,30 +13068,30 @@ function MatrxDataTableCore(coreProps) {
|
|
|
12988
13068
|
role: "status",
|
|
12989
13069
|
className: "pointer-events-none absolute inset-x-0 top-0 z-20 h-0.5 overflow-hidden bg-primary/15",
|
|
12990
13070
|
children: [
|
|
12991
|
-
/* @__PURE__ */
|
|
12992
|
-
/* @__PURE__ */
|
|
13071
|
+
/* @__PURE__ */ jsx24("div", { className: "h-full w-full animate-pulse bg-primary" }),
|
|
13072
|
+
/* @__PURE__ */ jsx24("span", { className: "sr-only", children: "Refreshing table data" })
|
|
12993
13073
|
]
|
|
12994
13074
|
}
|
|
12995
13075
|
) : null,
|
|
12996
|
-
isLoading ? Array.from({ length: 4 }).map((_, index) => /* @__PURE__ */
|
|
13076
|
+
isLoading ? Array.from({ length: 4 }).map((_, index) => /* @__PURE__ */ jsx24(
|
|
12997
13077
|
Skeleton,
|
|
12998
13078
|
{
|
|
12999
13079
|
className: "col-span-full h-52 w-full shrink-0 rounded-lg"
|
|
13000
13080
|
},
|
|
13001
13081
|
`mobile-card-sk-${index}`
|
|
13002
|
-
)) : readFailure ? /* @__PURE__ */
|
|
13082
|
+
)) : readFailure ? /* @__PURE__ */ jsx24("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__ */ jsx24("div", { className: "col-span-full flex min-h-48 flex-1 items-center justify-center px-4 py-12 text-center", children: /* @__PURE__ */ jsxs22("div", { className: "flex max-w-sm flex-col items-center gap-2", children: [
|
|
13003
13083
|
renderedEmptyState?.icon,
|
|
13004
|
-
/* @__PURE__ */
|
|
13005
|
-
renderedEmptyState?.description ? /* @__PURE__ */
|
|
13084
|
+
/* @__PURE__ */ jsx24("p", { className: "text-sm font-medium text-foreground", children: renderedEmptyState?.title ?? "No rows" }),
|
|
13085
|
+
renderedEmptyState?.description ? /* @__PURE__ */ jsx24("p", { className: "text-xs text-muted-foreground", children: renderedEmptyState.description }) : null,
|
|
13006
13086
|
renderedEmptyState?.action
|
|
13007
13087
|
] }) }) : /* @__PURE__ */ jsxs22(Fragment15, { children: [
|
|
13008
|
-
effectiveCardWindow ? /* @__PURE__ */
|
|
13088
|
+
effectiveCardWindow ? /* @__PURE__ */ jsx24("div", { "data-matrx-cards-pad": "start", "aria-hidden": "true", className: "col-span-full shrink-0", style: { height: effectiveCardWindow.padStart } }) : null,
|
|
13009
13089
|
((rows) => effectiveCardWindow ? rows.slice(effectiveCardWindow.start, effectiveCardWindow.end) : rows)(
|
|
13010
13090
|
groupedRenderRows ?? paginated.map((row, dataIndex) => ({ kind: "row", row, dataIndex }))
|
|
13011
13091
|
).map((entry) => {
|
|
13012
13092
|
if (entry.kind === "group") {
|
|
13013
13093
|
const count = entry.group.rows.length;
|
|
13014
|
-
return /* @__PURE__ */
|
|
13094
|
+
return /* @__PURE__ */ jsx24(
|
|
13015
13095
|
MatrxTableGroupCardHeader,
|
|
13016
13096
|
{
|
|
13017
13097
|
groupKey: entry.group.key,
|
|
@@ -13032,7 +13112,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13032
13112
|
const displayRow = applyRowEdits(row, edits[id]);
|
|
13033
13113
|
const controls = buildRecordControls(displayRow);
|
|
13034
13114
|
const selectable = selection?.isRowSelectable?.(row) ?? Boolean(selection);
|
|
13035
|
-
return /* @__PURE__ */
|
|
13115
|
+
return /* @__PURE__ */ jsx24("div", { "data-row-id": id, "data-matrx-row-tint": rowTintColor(row, id) ?? void 0, className: "contents", children: mobileCards(displayRow, index, {
|
|
13036
13116
|
renderCell: (columnKey) => {
|
|
13037
13117
|
const column = columns.find((candidate) => columnId(candidate) === columnKey);
|
|
13038
13118
|
return column ? renderRecordCell(row, column, index, controls) : null;
|
|
@@ -13056,7 +13136,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13056
13136
|
className: "inline-flex items-center justify-end gap-0",
|
|
13057
13137
|
onClick: (event) => event.stopPropagation(),
|
|
13058
13138
|
children: [
|
|
13059
|
-
showInlineRowCopy && effectiveCopy ? /* @__PURE__ */
|
|
13139
|
+
showInlineRowCopy && effectiveCopy ? /* @__PURE__ */ jsx24(
|
|
13060
13140
|
TableRowCopyControl,
|
|
13061
13141
|
{
|
|
13062
13142
|
size: "toolbar",
|
|
@@ -13067,7 +13147,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13067
13147
|
}
|
|
13068
13148
|
) : null,
|
|
13069
13149
|
renderRowActions(displayRow, controls),
|
|
13070
|
-
visibleColumns.filter((column) => column.customActions).map((column) => /* @__PURE__ */
|
|
13150
|
+
visibleColumns.filter((column) => column.customActions).map((column) => /* @__PURE__ */ jsx24(Fragment14, { children: renderRecordCell(row, column, index, controls) }, columnId(column)))
|
|
13071
13151
|
]
|
|
13072
13152
|
}
|
|
13073
13153
|
) : null,
|
|
@@ -13079,7 +13159,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13079
13159
|
expandedDetail: expandedDetail && isRowExpanded(row) ? expandedDetail.render(displayRow, controls) : null
|
|
13080
13160
|
}) }, id);
|
|
13081
13161
|
}),
|
|
13082
|
-
effectiveCardWindow ? /* @__PURE__ */
|
|
13162
|
+
effectiveCardWindow ? /* @__PURE__ */ jsx24("div", { "data-matrx-cards-pad": "end", "aria-hidden": "true", className: "col-span-full shrink-0", style: { height: effectiveCardWindow.padEnd } }) : null
|
|
13083
13163
|
] }),
|
|
13084
13164
|
appendQuery !== null && isFetching && !isLoading ? /* @__PURE__ */ jsxs22(
|
|
13085
13165
|
"div",
|
|
@@ -13089,7 +13169,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13089
13169
|
"aria-live": "polite",
|
|
13090
13170
|
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",
|
|
13091
13171
|
children: [
|
|
13092
|
-
/* @__PURE__ */
|
|
13172
|
+
/* @__PURE__ */ jsx24(
|
|
13093
13173
|
Loader2Icon,
|
|
13094
13174
|
{
|
|
13095
13175
|
"aria-hidden": "true",
|
|
@@ -13147,15 +13227,15 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13147
13227
|
tableClassName
|
|
13148
13228
|
),
|
|
13149
13229
|
children: [
|
|
13150
|
-
spreadsheetEnabled ? /* @__PURE__ */
|
|
13151
|
-
hierarchy && draggedRow ? /* @__PURE__ */
|
|
13230
|
+
spreadsheetEnabled ? /* @__PURE__ */ jsx24("textarea", { ...sheet.typeCatcherProps }) : null,
|
|
13231
|
+
hierarchy && draggedRow ? /* @__PURE__ */ jsx24(
|
|
13152
13232
|
HierarchyRootDropTarget,
|
|
13153
13233
|
{
|
|
13154
13234
|
label: hierarchy.rootDropLabel ?? "Drop here to move to the top level",
|
|
13155
13235
|
draggedLabel: hierarchy.itemLabel?.(draggedRow) ?? "Moving row"
|
|
13156
13236
|
}
|
|
13157
13237
|
) : null,
|
|
13158
|
-
hierarchy && draggedRowId ? /* @__PURE__ */
|
|
13238
|
+
hierarchy && draggedRowId ? /* @__PURE__ */ jsx24(
|
|
13159
13239
|
HierarchyDragIndicatorLayer,
|
|
13160
13240
|
{
|
|
13161
13241
|
scrollRef,
|
|
@@ -13169,12 +13249,12 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13169
13249
|
"data-matrx-table-refreshing": "",
|
|
13170
13250
|
className: "pointer-events-none sticky inset-x-0 top-0 z-40 -mb-0.5 block h-0.5 overflow-hidden bg-primary/15",
|
|
13171
13251
|
children: [
|
|
13172
|
-
/* @__PURE__ */
|
|
13173
|
-
/* @__PURE__ */
|
|
13252
|
+
/* @__PURE__ */ jsx24("div", { className: "h-full w-full animate-pulse bg-primary" }),
|
|
13253
|
+
/* @__PURE__ */ jsx24("span", { className: "sr-only", children: "Refreshing table data" })
|
|
13174
13254
|
]
|
|
13175
13255
|
}
|
|
13176
13256
|
) : null,
|
|
13177
|
-
drillGrouped && drill ? /* @__PURE__ */
|
|
13257
|
+
drillGrouped && drill ? /* @__PURE__ */ jsx24(
|
|
13178
13258
|
MatrxDrillAnswerTable,
|
|
13179
13259
|
{
|
|
13180
13260
|
dimensions: drill.dimensions,
|
|
@@ -13217,7 +13297,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13217
13297
|
"data-matrx-table-fit": fitActive ? "" : void 0,
|
|
13218
13298
|
"data-matrx-table-fit-grow": fitActive && fitTableWidth !== void 0 ? "" : void 0,
|
|
13219
13299
|
children: [
|
|
13220
|
-
/* @__PURE__ */
|
|
13300
|
+
/* @__PURE__ */ jsx24(MatrxTableChrome, { part: "header", epoch: headerEpoch, render: () => /* @__PURE__ */ jsx24(
|
|
13221
13301
|
"thead",
|
|
13222
13302
|
{
|
|
13223
13303
|
ref: tableHeaderRef,
|
|
@@ -13236,7 +13316,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13236
13316
|
stickyHeader && (documentStickyHeader ? "relative translate-y-[var(--matrx-document-sticky-offset)]" : "sticky top-0")
|
|
13237
13317
|
),
|
|
13238
13318
|
children: /* @__PURE__ */ jsxs22("tr", { children: [
|
|
13239
|
-
selection ? /* @__PURE__ */
|
|
13319
|
+
selection ? /* @__PURE__ */ jsx24(
|
|
13240
13320
|
"th",
|
|
13241
13321
|
{
|
|
13242
13322
|
"data-matrx-table-selection-column": true,
|
|
@@ -13246,7 +13326,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13246
13326
|
embedded && "sm:bg-card max-sm:bg-card"
|
|
13247
13327
|
),
|
|
13248
13328
|
style: fixedUtilityWidth(selectionColumnWidth),
|
|
13249
|
-
children: /* @__PURE__ */
|
|
13329
|
+
children: /* @__PURE__ */ jsx24(
|
|
13250
13330
|
"div",
|
|
13251
13331
|
{
|
|
13252
13332
|
"data-matrx-table-selection-target": true,
|
|
@@ -13255,7 +13335,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13255
13335
|
event.currentTarget.querySelector('[role="checkbox"]')?.click();
|
|
13256
13336
|
}
|
|
13257
13337
|
},
|
|
13258
|
-
children: /* @__PURE__ */
|
|
13338
|
+
children: /* @__PURE__ */ jsx24(
|
|
13259
13339
|
Checkbox,
|
|
13260
13340
|
{
|
|
13261
13341
|
className: CHECKBOX_TAP_AREA,
|
|
@@ -13269,7 +13349,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13269
13349
|
)
|
|
13270
13350
|
}
|
|
13271
13351
|
) : null,
|
|
13272
|
-
columnSpacers && columnSpacers.start > 0 ? /* @__PURE__ */
|
|
13352
|
+
columnSpacers && columnSpacers.start > 0 ? /* @__PURE__ */ jsx24(
|
|
13273
13353
|
"th",
|
|
13274
13354
|
{
|
|
13275
13355
|
"aria-hidden": "true",
|
|
@@ -13349,7 +13429,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13349
13429
|
...frozenStyle(id)
|
|
13350
13430
|
},
|
|
13351
13431
|
children: [
|
|
13352
|
-
/* @__PURE__ */
|
|
13432
|
+
/* @__PURE__ */ jsx24(ColumnHeaderDropZone, { id, enabled: reorderableColumns && col.reorderable !== false, children: /* @__PURE__ */ jsx24(
|
|
13353
13433
|
ColumnHeaderCell,
|
|
13354
13434
|
{
|
|
13355
13435
|
label: col.header,
|
|
@@ -13408,7 +13488,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13408
13488
|
MenuIcon: host.MenuIcon
|
|
13409
13489
|
}
|
|
13410
13490
|
) }),
|
|
13411
|
-
columnResizable ? /* @__PURE__ */
|
|
13491
|
+
columnResizable ? /* @__PURE__ */ jsx24(
|
|
13412
13492
|
ColumnResizeHandle,
|
|
13413
13493
|
{
|
|
13414
13494
|
columnId: id,
|
|
@@ -13427,7 +13507,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13427
13507
|
id
|
|
13428
13508
|
);
|
|
13429
13509
|
}),
|
|
13430
|
-
columnSpacers && columnSpacers.end > 0 ? /* @__PURE__ */
|
|
13510
|
+
columnSpacers && columnSpacers.end > 0 ? /* @__PURE__ */ jsx24(
|
|
13431
13511
|
"th",
|
|
13432
13512
|
{
|
|
13433
13513
|
"aria-hidden": "true",
|
|
@@ -13437,7 +13517,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13437
13517
|
},
|
|
13438
13518
|
"matrx-column-spacer-end"
|
|
13439
13519
|
) : null,
|
|
13440
|
-
showActionsCol && /* @__PURE__ */
|
|
13520
|
+
showActionsCol && /* @__PURE__ */ jsx24(
|
|
13441
13521
|
"th",
|
|
13442
13522
|
{
|
|
13443
13523
|
"data-matrx-table-actions-column": true,
|
|
@@ -13449,14 +13529,14 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13449
13529
|
embedded && "sm:bg-card"
|
|
13450
13530
|
),
|
|
13451
13531
|
style: fixedUtilityWidth(actionsColumnWidth),
|
|
13452
|
-
children: compact && !(toolbar && "portalInto" in toolbar) && !(tableCard && embedded) ? /* @__PURE__ */
|
|
13532
|
+
children: compact && !(toolbar && "portalInto" in toolbar) && !(tableCard && embedded) ? /* @__PURE__ */ jsx24(
|
|
13453
13533
|
"span",
|
|
13454
13534
|
{
|
|
13455
13535
|
ref: setCompactToolbarSlot,
|
|
13456
13536
|
"data-matrx-table-compact-controls": "",
|
|
13457
13537
|
className: "inline-flex items-center justify-center normal-case tracking-normal"
|
|
13458
13538
|
}
|
|
13459
|
-
) : /* @__PURE__ */
|
|
13539
|
+
) : /* @__PURE__ */ jsx24("span", { "data-matrx-table-actions-label": true, className: "inline-block whitespace-nowrap", children: "Actions" })
|
|
13460
13540
|
}
|
|
13461
13541
|
)
|
|
13462
13542
|
] })
|
|
@@ -13474,15 +13554,15 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13474
13554
|
"data-matrx-table-skeleton-row": "",
|
|
13475
13555
|
style: explicitRowHeight !== void 0 ? { height: `${explicitRowHeight}px` } : loadingRowHeight !== void 0 ? { height: `${loadingRowHeight}px` } : void 0,
|
|
13476
13556
|
children: [
|
|
13477
|
-
selection ? /* @__PURE__ */
|
|
13557
|
+
selection ? /* @__PURE__ */ jsx24(
|
|
13478
13558
|
"td",
|
|
13479
13559
|
{
|
|
13480
13560
|
className: cn("px-2 py-1.5 align-middle lg:py-0.5", compactRows && "py-0 lg:py-0"),
|
|
13481
13561
|
style: fixedUtilityWidth(selectionColumnWidth),
|
|
13482
|
-
children: /* @__PURE__ */
|
|
13562
|
+
children: /* @__PURE__ */ jsx24(Skeleton, { className: "h-3.5 w-3.5" })
|
|
13483
13563
|
}
|
|
13484
13564
|
) : null,
|
|
13485
|
-
columnSpacers && columnSpacers.start > 0 ? /* @__PURE__ */
|
|
13565
|
+
columnSpacers && columnSpacers.start > 0 ? /* @__PURE__ */ jsx24(
|
|
13486
13566
|
"td",
|
|
13487
13567
|
{
|
|
13488
13568
|
"aria-hidden": "true",
|
|
@@ -13492,7 +13572,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13492
13572
|
},
|
|
13493
13573
|
"matrx-column-spacer-start"
|
|
13494
13574
|
) : null,
|
|
13495
|
-
renderedColumns.map((col) => /* @__PURE__ */
|
|
13575
|
+
renderedColumns.map((col) => /* @__PURE__ */ jsx24(
|
|
13496
13576
|
"td",
|
|
13497
13577
|
{
|
|
13498
13578
|
...col.customActions && col.customActionsGhostRow !== void 0 ? { "data-matrx-table-column-id": columnId(col) } : {},
|
|
@@ -13506,20 +13586,20 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13506
13586
|
col.customActions && col.customActionsGhostRow !== void 0 && "w-px whitespace-nowrap"
|
|
13507
13587
|
),
|
|
13508
13588
|
style: phoneColumnMinStyle(col),
|
|
13509
|
-
children: col.customActions && col.customActionsGhostRow !== void 0 ? /* @__PURE__ */
|
|
13589
|
+
children: col.customActions && col.customActionsGhostRow !== void 0 ? /* @__PURE__ */ jsx24("div", { "aria-hidden": "true", inert: true, className: "invisible", children: renderRecordCell(col.customActionsGhostRow, col, 0) }) : /* @__PURE__ */ jsx24(Skeleton, { className: cn("w-full", compactRows ? "h-4" : "h-6") })
|
|
13510
13590
|
},
|
|
13511
13591
|
columnId(col)
|
|
13512
13592
|
)),
|
|
13513
|
-
showActionsCol && /* @__PURE__ */
|
|
13593
|
+
showActionsCol && /* @__PURE__ */ jsx24(
|
|
13514
13594
|
"td",
|
|
13515
13595
|
{
|
|
13516
13596
|
"data-matrx-table-skeleton-actions": "",
|
|
13517
13597
|
className: cn("px-2 py-1.5 text-right align-middle lg:py-0.5", compactRows && "py-0 lg:py-0"),
|
|
13518
13598
|
style: fixedUtilityWidth(actionsColumnWidth),
|
|
13519
|
-
children: /* @__PURE__ */
|
|
13599
|
+
children: /* @__PURE__ */ jsx24(Skeleton, { className: cn("ml-auto w-10", compactRows ? "h-6" : "h-8") })
|
|
13520
13600
|
}
|
|
13521
13601
|
),
|
|
13522
|
-
columnSpacers && columnSpacers.end > 0 ? /* @__PURE__ */
|
|
13602
|
+
columnSpacers && columnSpacers.end > 0 ? /* @__PURE__ */ jsx24(
|
|
13523
13603
|
"td",
|
|
13524
13604
|
{
|
|
13525
13605
|
"aria-hidden": "true",
|
|
@@ -13532,15 +13612,15 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13532
13612
|
]
|
|
13533
13613
|
},
|
|
13534
13614
|
`sk-${i}`
|
|
13535
|
-
)) : readFailure || paginated.length === 0 && !drawsOnlyShutSections ? messageOutsideTable ? null : /* @__PURE__ */
|
|
13615
|
+
)) : readFailure || paginated.length === 0 && !drawsOnlyShutSections ? messageOutsideTable ? null : /* @__PURE__ */ jsx24("tr", { children: /* @__PURE__ */ jsx24("td", { colSpan: renderedColSpan, "data-matrx-table-message-cell": true, className: "overflow-visible! px-0 py-12 text-center", children: tableMessage }) }) : bodyEntries.map((entry) => {
|
|
13536
13616
|
if (entry.kind === "spacer") {
|
|
13537
|
-
return /* @__PURE__ */
|
|
13617
|
+
return /* @__PURE__ */ jsx24(
|
|
13538
13618
|
"tr",
|
|
13539
13619
|
{
|
|
13540
13620
|
"aria-hidden": "true",
|
|
13541
13621
|
"data-matrx-table-virtual-spacer": entry.place,
|
|
13542
13622
|
style: { height: `${entry.height}px` },
|
|
13543
|
-
children: /* @__PURE__ */
|
|
13623
|
+
children: /* @__PURE__ */ jsx24(
|
|
13544
13624
|
"td",
|
|
13545
13625
|
{
|
|
13546
13626
|
className: "border-0 p-0",
|
|
@@ -13552,7 +13632,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13552
13632
|
);
|
|
13553
13633
|
}
|
|
13554
13634
|
if (entry.kind === "group") {
|
|
13555
|
-
return /* @__PURE__ */
|
|
13635
|
+
return /* @__PURE__ */ jsx24(
|
|
13556
13636
|
TableGroupHeaderRow,
|
|
13557
13637
|
{
|
|
13558
13638
|
group: entry.group,
|
|
@@ -13576,7 +13656,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13576
13656
|
const row = entry.row;
|
|
13577
13657
|
const index = entry.index;
|
|
13578
13658
|
const id = getRowId(row);
|
|
13579
|
-
return /* @__PURE__ */
|
|
13659
|
+
return /* @__PURE__ */ jsx24(
|
|
13580
13660
|
MatrxTableBodyRow,
|
|
13581
13661
|
{
|
|
13582
13662
|
rowId: id,
|
|
@@ -13597,9 +13677,9 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13597
13677
|
"aria-label": entryRow.label ?? "New row",
|
|
13598
13678
|
className: "border-b border-border/60 bg-card",
|
|
13599
13679
|
children: [
|
|
13600
|
-
selection ? /* @__PURE__ */
|
|
13601
|
-
columnSpacers && columnSpacers.start > 0 ? /* @__PURE__ */
|
|
13602
|
-
renderedColumns.map((column) => /* @__PURE__ */
|
|
13680
|
+
selection ? /* @__PURE__ */ jsx24("td", { className: "px-2 py-1.5" }) : null,
|
|
13681
|
+
columnSpacers && columnSpacers.start > 0 ? /* @__PURE__ */ jsx24("td", { "aria-hidden": "true", className: "border-0 p-0", style: { width: `${columnSpacers.start}px`, minWidth: `${columnSpacers.start}px` } }) : null,
|
|
13682
|
+
renderedColumns.map((column) => /* @__PURE__ */ jsx24(
|
|
13603
13683
|
"td",
|
|
13604
13684
|
{
|
|
13605
13685
|
"data-matrx-table-entry-cell": columnId(column),
|
|
@@ -13612,13 +13692,13 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13612
13692
|
},
|
|
13613
13693
|
columnId(column)
|
|
13614
13694
|
)),
|
|
13615
|
-
columnSpacers && columnSpacers.end > 0 ? /* @__PURE__ */
|
|
13616
|
-
showActionsCol ? /* @__PURE__ */
|
|
13695
|
+
columnSpacers && columnSpacers.end > 0 ? /* @__PURE__ */ jsx24("td", { "aria-hidden": "true", className: "border-0 p-0", style: { width: `${columnSpacers.end}px`, minWidth: `${columnSpacers.end}px` } }) : null,
|
|
13696
|
+
showActionsCol ? /* @__PURE__ */ jsx24("td", { className: "px-2 py-1.5", children: entryRow.actions ?? null }) : null
|
|
13617
13697
|
]
|
|
13618
13698
|
}
|
|
13619
13699
|
) : null,
|
|
13620
|
-
entryRow?.below ? /* @__PURE__ */
|
|
13621
|
-
appendQuery !== null && isFetching && !isLoading ? /* @__PURE__ */
|
|
13700
|
+
entryRow?.below ? /* @__PURE__ */ jsx24("tr", { "data-matrx-table-entry-below": "", className: "bg-card", children: /* @__PURE__ */ jsx24("td", { colSpan: renderedColSpan, className: "px-2 py-1.5", children: entryRow.below }) }) : null,
|
|
13701
|
+
appendQuery !== null && isFetching && !isLoading ? /* @__PURE__ */ jsx24("tr", { "data-matrx-table-append-loading-row": true, children: /* @__PURE__ */ jsx24(
|
|
13622
13702
|
"td",
|
|
13623
13703
|
{
|
|
13624
13704
|
colSpan: renderedColSpan,
|
|
@@ -13630,7 +13710,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13630
13710
|
"aria-live": "polite",
|
|
13631
13711
|
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",
|
|
13632
13712
|
children: [
|
|
13633
|
-
/* @__PURE__ */
|
|
13713
|
+
/* @__PURE__ */ jsx24(
|
|
13634
13714
|
Loader2Icon,
|
|
13635
13715
|
{
|
|
13636
13716
|
"aria-hidden": "true",
|
|
@@ -13646,16 +13726,16 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13646
13726
|
]
|
|
13647
13727
|
}
|
|
13648
13728
|
),
|
|
13649
|
-
/* @__PURE__ */
|
|
13729
|
+
/* @__PURE__ */ jsx24(MatrxTableChrome, { part: "footer", epoch: footerEpoch, render: () => footerRows.length > 0 || hasSummaryTotals ? /* @__PURE__ */ jsxs22("tfoot", { className: cn(
|
|
13650
13730
|
"border-t-2 border-border bg-muted/50 font-semibold",
|
|
13651
13731
|
// Frozen body cells sit at z-20. The sticky totals band is
|
|
13652
13732
|
// a separate stacking context and must sit above them, or a
|
|
13653
13733
|
// frozen first cell covers the totals label at the footer.
|
|
13654
13734
|
hasSummaryTotals && "sticky bottom-0 z-30 bg-muted/95 backdrop-blur-sm"
|
|
13655
13735
|
), children: [
|
|
13656
|
-
hasSummaryTotals ? /* @__PURE__ */
|
|
13657
|
-
selection ? /* @__PURE__ */
|
|
13658
|
-
columnSpacers && columnSpacers.start > 0 ? /* @__PURE__ */
|
|
13736
|
+
hasSummaryTotals ? /* @__PURE__ */ jsx24(Fragment15, { children: /* @__PURE__ */ jsxs22("tr", { "data-matrx-table-summary-totals": true, "data-matrx-table-summary-scope": summaryUsesSource ? "source" : summaryCoverage, children: [
|
|
13737
|
+
selection ? /* @__PURE__ */ jsx24("td", { className: "px-2 py-2" }) : null,
|
|
13738
|
+
columnSpacers && columnSpacers.start > 0 ? /* @__PURE__ */ jsx24(
|
|
13659
13739
|
"td",
|
|
13660
13740
|
{
|
|
13661
13741
|
"aria-hidden": "true",
|
|
@@ -13688,17 +13768,17 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13688
13768
|
children: [
|
|
13689
13769
|
columnIndex === 0 ? /* @__PURE__ */ jsxs22("span", { "data-matrx-table-summary-total-label": true, className: "text-sm font-semibold text-foreground", children: [
|
|
13690
13770
|
summaryCaption,
|
|
13691
|
-
readView.stale ? /* @__PURE__ */
|
|
13771
|
+
readView.stale ? /* @__PURE__ */ jsx24("span", { className: "ml-1 text-xs text-amber-700 dark:text-amber-300", children: "Retained rows may be out of date." }) : null
|
|
13692
13772
|
] }) : null,
|
|
13693
|
-
columnIndex === 0 && total?.value != null ? /* @__PURE__ */
|
|
13773
|
+
columnIndex === 0 && total?.value != null ? /* @__PURE__ */ jsx24("span", { className: "ml-2", children: total.value }) : null,
|
|
13694
13774
|
columnIndex !== 0 ? total?.value : null,
|
|
13695
|
-
total?.unavailable ? /* @__PURE__ */
|
|
13775
|
+
total?.unavailable ? /* @__PURE__ */ jsx24(ErrorBox, { as: "span", className: "sr-only", message: `${columnId(column)} total is unavailable`, operation: "Total this column", origin: "design-system/MatrxDataTable" }) : null
|
|
13696
13776
|
]
|
|
13697
13777
|
},
|
|
13698
13778
|
columnId(column)
|
|
13699
13779
|
);
|
|
13700
13780
|
}),
|
|
13701
|
-
columnSpacers && columnSpacers.end > 0 ? /* @__PURE__ */
|
|
13781
|
+
columnSpacers && columnSpacers.end > 0 ? /* @__PURE__ */ jsx24(
|
|
13702
13782
|
"td",
|
|
13703
13783
|
{
|
|
13704
13784
|
"aria-hidden": "true",
|
|
@@ -13708,11 +13788,11 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13708
13788
|
},
|
|
13709
13789
|
"matrx-summary-column-spacer-end"
|
|
13710
13790
|
) : null,
|
|
13711
|
-
showActionsCol ? /* @__PURE__ */
|
|
13791
|
+
showActionsCol ? /* @__PURE__ */ jsx24("td", {}) : null
|
|
13712
13792
|
] }) }) : null,
|
|
13713
13793
|
footerRows.map((row, index) => /* @__PURE__ */ jsxs22("tr", { children: [
|
|
13714
|
-
selection ? /* @__PURE__ */
|
|
13715
|
-
columnSpacers && columnSpacers.start > 0 ? /* @__PURE__ */
|
|
13794
|
+
selection ? /* @__PURE__ */ jsx24("td", { className: "px-2 py-2" }) : null,
|
|
13795
|
+
columnSpacers && columnSpacers.start > 0 ? /* @__PURE__ */ jsx24(
|
|
13716
13796
|
"td",
|
|
13717
13797
|
{
|
|
13718
13798
|
"aria-hidden": "true",
|
|
@@ -13722,7 +13802,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13722
13802
|
},
|
|
13723
13803
|
"matrx-column-spacer-start"
|
|
13724
13804
|
) : null,
|
|
13725
|
-
renderedColumns.map((column) => /* @__PURE__ */
|
|
13805
|
+
renderedColumns.map((column) => /* @__PURE__ */ jsx24(
|
|
13726
13806
|
"td",
|
|
13727
13807
|
{
|
|
13728
13808
|
className: cn(
|
|
@@ -13742,7 +13822,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13742
13822
|
},
|
|
13743
13823
|
columnId(column)
|
|
13744
13824
|
)),
|
|
13745
|
-
columnSpacers && columnSpacers.end > 0 ? /* @__PURE__ */
|
|
13825
|
+
columnSpacers && columnSpacers.end > 0 ? /* @__PURE__ */ jsx24(
|
|
13746
13826
|
"td",
|
|
13747
13827
|
{
|
|
13748
13828
|
"aria-hidden": "true",
|
|
@@ -13752,18 +13832,18 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13752
13832
|
},
|
|
13753
13833
|
"matrx-column-spacer-end"
|
|
13754
13834
|
) : null,
|
|
13755
|
-
showActionsCol ? /* @__PURE__ */
|
|
13835
|
+
showActionsCol ? /* @__PURE__ */ jsx24("td", {}) : null
|
|
13756
13836
|
] }, `footer-${index}`))
|
|
13757
13837
|
] }) : null })
|
|
13758
13838
|
]
|
|
13759
13839
|
}
|
|
13760
13840
|
),
|
|
13761
|
-
messageOutsideTable ? /* @__PURE__ */
|
|
13841
|
+
messageOutsideTable ? /* @__PURE__ */ jsx24("div", { "data-matrx-table-message-outside": true, className: "py-12 text-center", children: tableMessage }) : null
|
|
13762
13842
|
]
|
|
13763
13843
|
}
|
|
13764
13844
|
),
|
|
13765
13845
|
scrollHintLeft ? /* @__PURE__ */ jsxs22(Tooltip, { children: [
|
|
13766
|
-
/* @__PURE__ */
|
|
13846
|
+
/* @__PURE__ */ jsx24(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx24(
|
|
13767
13847
|
Button,
|
|
13768
13848
|
{
|
|
13769
13849
|
type: "button",
|
|
@@ -13775,13 +13855,13 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13775
13855
|
...scrollHintTop === null ? {} : { style: { top: scrollHintTop } },
|
|
13776
13856
|
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"),
|
|
13777
13857
|
onClick: () => scrollTableHorizontally("left"),
|
|
13778
|
-
children: /* @__PURE__ */
|
|
13858
|
+
children: /* @__PURE__ */ jsx24(ChevronLeftIcon, { className: "h-5 w-5" })
|
|
13779
13859
|
}
|
|
13780
13860
|
) }),
|
|
13781
|
-
/* @__PURE__ */
|
|
13861
|
+
/* @__PURE__ */ jsx24(TooltipContent, { children: "More columns to the left" })
|
|
13782
13862
|
] }) : null,
|
|
13783
13863
|
scrollHintRight ? /* @__PURE__ */ jsxs22(Tooltip, { children: [
|
|
13784
|
-
/* @__PURE__ */
|
|
13864
|
+
/* @__PURE__ */ jsx24(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx24(
|
|
13785
13865
|
Button,
|
|
13786
13866
|
{
|
|
13787
13867
|
type: "button",
|
|
@@ -13793,10 +13873,10 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13793
13873
|
style: scrollHintTop === null ? { right: scrollHintRightInset } : { right: scrollHintRightInset, top: scrollHintTop },
|
|
13794
13874
|
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"),
|
|
13795
13875
|
onClick: () => scrollTableHorizontally("right"),
|
|
13796
|
-
children: /* @__PURE__ */
|
|
13876
|
+
children: /* @__PURE__ */ jsx24(ChevronRightIcon, { className: "h-5 w-5" })
|
|
13797
13877
|
}
|
|
13798
13878
|
) }),
|
|
13799
|
-
/* @__PURE__ */
|
|
13879
|
+
/* @__PURE__ */ jsx24(TooltipContent, { children: "More columns to the right" })
|
|
13800
13880
|
] }) : null
|
|
13801
13881
|
] }),
|
|
13802
13882
|
appendQuery ? /* @__PURE__ */ jsxs22(
|
|
@@ -13812,7 +13892,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13812
13892
|
...isFetching && !isLoading ? {} : { role: "status", "aria-live": "polite" },
|
|
13813
13893
|
className: "flex w-full min-w-0 items-center gap-2 text-xs text-muted-foreground sm:w-auto sm:flex-1",
|
|
13814
13894
|
children: [
|
|
13815
|
-
isLoading ? /* @__PURE__ */
|
|
13895
|
+
isLoading ? /* @__PURE__ */ jsx24(
|
|
13816
13896
|
Loader2Icon,
|
|
13817
13897
|
{
|
|
13818
13898
|
"data-matrx-table-append-loader": true,
|
|
@@ -13821,19 +13901,19 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13821
13901
|
}
|
|
13822
13902
|
) : null,
|
|
13823
13903
|
/* @__PURE__ */ jsxs22("div", { className: "flex min-w-0 flex-1 flex-wrap items-center gap-x-2", children: [
|
|
13824
|
-
/* @__PURE__ */
|
|
13904
|
+
/* @__PURE__ */ jsx24("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 ? `${formatCount10(processed.length)} ${appendQuery.pagination.sourceRecords.rowLabel}${appendQuery.pagination.sourceRecords.matchedRecords === void 0 ? "" : ` (${formatCount10(appendQuery.pagination.sourceRecords.matchedRecords)} matching ${appendQuery.pagination.sourceRecords.label})`} \xB7 ${formatCount10(appendQuery.pagination.sourceRecords.loaded)}${appendQuery.pagination.sourceRecords.total === void 0 ? "" : ` / ${formatCount10(appendQuery.pagination.sourceRecords.total)}`} ${appendQuery.pagination.sourceRecords.label} loaded` : `${processed.length === data.length ? "" : `${formatCount10(processed.length)} matching loaded ${processed.length === 1 ? "row" : "rows"} \xB7 `}${formatCount10(data.length)} loaded${appendQuery.pagination.totalItems === void 0 ? "" : ` of ${formatCount10(appendQuery.pagination.totalItems)}`}` }),
|
|
13825
13905
|
appendQuery.pagination.sourceUntil || appendUsesLocalProcessing ? /* @__PURE__ */ jsxs22(Tooltip, { children: [
|
|
13826
|
-
/* @__PURE__ */
|
|
13906
|
+
/* @__PURE__ */ jsx24(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx24("button", { type: "button", "aria-label": "Source coverage", className: "shrink-0 text-xs text-muted-foreground underline decoration-dotted underline-offset-4", children: "Source info" }) }),
|
|
13827
13907
|
/* @__PURE__ */ jsxs22(TooltipContent, { children: [
|
|
13828
13908
|
appendQuery.pagination.sourceUntil ? /* @__PURE__ */ jsxs22("p", { children: [
|
|
13829
13909
|
"Source fixed through ",
|
|
13830
13910
|
new Date(appendQuery.pagination.sourceUntil).toLocaleString(),
|
|
13831
13911
|
"."
|
|
13832
13912
|
] }) : null,
|
|
13833
|
-
/* @__PURE__ */
|
|
13913
|
+
/* @__PURE__ */ jsx24("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." })
|
|
13834
13914
|
] })
|
|
13835
13915
|
] }) : null,
|
|
13836
|
-
scrollPagination.error ? /* @__PURE__ */
|
|
13916
|
+
scrollPagination.error ? /* @__PURE__ */ jsx24(
|
|
13837
13917
|
ErrorBox,
|
|
13838
13918
|
{
|
|
13839
13919
|
className: "text-destructive-ink",
|
|
@@ -13857,21 +13937,21 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13857
13937
|
value: String(appendQuery.pagination.sourcePageSize.value),
|
|
13858
13938
|
onValueChange: (value) => appendQuery.pagination.sourcePageSize?.onChange(Number(value)),
|
|
13859
13939
|
children: [
|
|
13860
|
-
/* @__PURE__ */
|
|
13940
|
+
/* @__PURE__ */ jsx24(
|
|
13861
13941
|
SelectTrigger,
|
|
13862
13942
|
{
|
|
13863
13943
|
"aria-label": "Rows per load",
|
|
13864
13944
|
className: "h-8 min-w-20 shrink-0 rounded-md border border-border bg-card px-3 text-sm [&_svg]:size-5",
|
|
13865
13945
|
disabled: isLoading || isFetching || appendQuery.pagination.loadAll?.isLoading,
|
|
13866
|
-
children: /* @__PURE__ */
|
|
13946
|
+
children: /* @__PURE__ */ jsx24(SelectValue, {})
|
|
13867
13947
|
}
|
|
13868
13948
|
),
|
|
13869
|
-
/* @__PURE__ */
|
|
13949
|
+
/* @__PURE__ */ jsx24(SelectContent, { children: appendQuery.pagination.sourcePageSize.options.map((size) => /* @__PURE__ */ jsx24(SelectItem, { value: String(size), children: size }, size)) })
|
|
13870
13950
|
]
|
|
13871
13951
|
}
|
|
13872
13952
|
) : null,
|
|
13873
13953
|
/* @__PURE__ */ jsxs22("div", { className: "flex min-w-0 max-w-full flex-wrap gap-0", children: [
|
|
13874
|
-
/* @__PURE__ */
|
|
13954
|
+
/* @__PURE__ */ jsx24(
|
|
13875
13955
|
Button,
|
|
13876
13956
|
{
|
|
13877
13957
|
type: "button",
|
|
@@ -13882,7 +13962,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13882
13962
|
children: "Load more"
|
|
13883
13963
|
}
|
|
13884
13964
|
),
|
|
13885
|
-
appendQuery.pagination.loadAll ? /* @__PURE__ */
|
|
13965
|
+
appendQuery.pagination.loadAll ? /* @__PURE__ */ jsx24(
|
|
13886
13966
|
Button,
|
|
13887
13967
|
{
|
|
13888
13968
|
type: "button",
|
|
@@ -13894,7 +13974,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13894
13974
|
}
|
|
13895
13975
|
) : null
|
|
13896
13976
|
] }),
|
|
13897
|
-
appendQuery.pagination.loadAll?.isLoading ? /* @__PURE__ */
|
|
13977
|
+
appendQuery.pagination.loadAll?.isLoading ? /* @__PURE__ */ jsx24(
|
|
13898
13978
|
Button,
|
|
13899
13979
|
{
|
|
13900
13980
|
type: "button",
|
|
@@ -13903,7 +13983,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13903
13983
|
onClick: appendQuery.pagination.loadAll.stop,
|
|
13904
13984
|
children: "Stop loading"
|
|
13905
13985
|
}
|
|
13906
|
-
) : scrollPagination.error ? /* @__PURE__ */
|
|
13986
|
+
) : scrollPagination.error ? /* @__PURE__ */ jsx24(
|
|
13907
13987
|
Button,
|
|
13908
13988
|
{
|
|
13909
13989
|
type: "button",
|
|
@@ -13912,7 +13992,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13912
13992
|
onClick: appendQuery.pagination.retrySource ?? (appendQuery.pagination.hasNextPage ? appendQuery.pagination.loadNextPage : appendQuery.pagination.refresh),
|
|
13913
13993
|
children: appendQuery.pagination.retrySource ? "Retry source" : appendQuery.pagination.hasNextPage ? "Retry" : "Reload rows"
|
|
13914
13994
|
}
|
|
13915
|
-
) : !isLoading && appendQuery.pagination.totalItems !== void 0 && data.length === appendQuery.pagination.totalItems ? /* @__PURE__ */
|
|
13995
|
+
) : !isLoading && appendQuery.pagination.totalItems !== void 0 && data.length === appendQuery.pagination.totalItems ? /* @__PURE__ */ jsx24("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
|
|
13916
13996
|
]
|
|
13917
13997
|
}
|
|
13918
13998
|
) : embedded && !hidePagination && !drillGrouped && (localProgressiveEnabled || pageCount <= 1 || remoteQuery?.mode === "controlled") ? (
|
|
@@ -13920,7 +14000,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13920
14000
|
// rows than the card's first batch, ONE quiet "Show more" with its honest count, drawn
|
|
13921
14001
|
// in the card's footer row beside "+ Add" when the card has one. Rows held locally are
|
|
13922
14002
|
// revealed; a server-paged source is asked for a bigger first page (a real fetch).
|
|
13923
|
-
localProgressiveEnabled && progressiveRows.hasMore ? /* @__PURE__ */
|
|
14003
|
+
localProgressiveEnabled && progressiveRows.hasMore ? /* @__PURE__ */ jsx24(
|
|
13924
14004
|
MatrxTableCardShowMore,
|
|
13925
14005
|
{
|
|
13926
14006
|
card: tableCard,
|
|
@@ -13928,7 +14008,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13928
14008
|
total: totalItems,
|
|
13929
14009
|
onShowMore: () => void chromeLatest.current.showMore()
|
|
13930
14010
|
}
|
|
13931
|
-
) : remoteQuery?.mode === "controlled" && !isLoading && totalItems > data.length ? /* @__PURE__ */
|
|
14011
|
+
) : remoteQuery?.mode === "controlled" && !isLoading && totalItems > data.length ? /* @__PURE__ */ jsx24(
|
|
13932
14012
|
MatrxTableCardShowMore,
|
|
13933
14013
|
{
|
|
13934
14014
|
card: tableCard,
|
|
@@ -13942,7 +14022,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13942
14022
|
// Keep the footer and disabled page controls in place for an empty table,
|
|
13943
14023
|
// including an unfiltered empty source. The empty-state copy explains why
|
|
13944
14024
|
// there are no records; the stable footer preserves the table controls.
|
|
13945
|
-
/* @__PURE__ */
|
|
14025
|
+
/* @__PURE__ */ jsx24(MatrxTableChrome, { part: "pagination", epoch: paginationEpoch, render: () => /* @__PURE__ */ jsx24("div", { className: "shrink-0", children: /* @__PURE__ */ jsx24(
|
|
13946
14026
|
GenericTablePagination,
|
|
13947
14027
|
{
|
|
13948
14028
|
totalItems,
|
|
@@ -13994,7 +14074,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
13994
14074
|
]
|
|
13995
14075
|
}
|
|
13996
14076
|
),
|
|
13997
|
-
offerSelectAllMatching && selectionMatchingTotal !== void 0 ? /* @__PURE__ */
|
|
14077
|
+
offerSelectAllMatching && selectionMatchingTotal !== void 0 ? /* @__PURE__ */ jsx24(
|
|
13998
14078
|
Button2,
|
|
13999
14079
|
{
|
|
14000
14080
|
type: "button",
|
|
@@ -14004,12 +14084,12 @@ function MatrxDataTableCore(coreProps) {
|
|
|
14004
14084
|
children: `Select all ${formatCount10(selectionMatchingTotal)}`
|
|
14005
14085
|
}
|
|
14006
14086
|
) : null,
|
|
14007
|
-
/* @__PURE__ */
|
|
14087
|
+
/* @__PURE__ */ jsx24(
|
|
14008
14088
|
Button2,
|
|
14009
14089
|
{
|
|
14010
14090
|
type: "button",
|
|
14011
14091
|
variant: "quiet",
|
|
14012
|
-
icon: /* @__PURE__ */
|
|
14092
|
+
icon: /* @__PURE__ */ jsx24(XIcon, { "aria-hidden": "true" }),
|
|
14013
14093
|
onClick: () => {
|
|
14014
14094
|
lastToggledIndex.current = null;
|
|
14015
14095
|
if (allMatching) setAllMatching(false);
|
|
@@ -14024,7 +14104,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
14024
14104
|
"data-matrx-table-bulk-actions": true,
|
|
14025
14105
|
className: "flex min-w-0 flex-1 flex-nowrap items-center justify-start gap-0 overflow-x-auto sm:justify-end [&>*]:shrink-0",
|
|
14026
14106
|
children: [
|
|
14027
|
-
effectiveCopy ? /* @__PURE__ */
|
|
14107
|
+
effectiveCopy ? /* @__PURE__ */ jsx24(
|
|
14028
14108
|
CopyButtons,
|
|
14029
14109
|
{
|
|
14030
14110
|
size: "icon",
|
|
@@ -14063,7 +14143,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
14063
14143
|
}
|
|
14064
14144
|
) : null
|
|
14065
14145
|
] }),
|
|
14066
|
-
/* @__PURE__ */
|
|
14146
|
+
/* @__PURE__ */ jsx24(
|
|
14067
14147
|
ColumnManager,
|
|
14068
14148
|
{
|
|
14069
14149
|
open: columnManagerOpen,
|
|
@@ -14075,7 +14155,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
14075
14155
|
defaults: columnManagerDefaults
|
|
14076
14156
|
}
|
|
14077
14157
|
),
|
|
14078
|
-
detailEnabled && selectedRow ? /* @__PURE__ */
|
|
14158
|
+
detailEnabled && selectedRow ? /* @__PURE__ */ jsx24(
|
|
14079
14159
|
SidePanelSurface,
|
|
14080
14160
|
{
|
|
14081
14161
|
title: resolveStringTitle(
|
|
@@ -14088,7 +14168,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
14088
14168
|
openRequest,
|
|
14089
14169
|
defaultWidth: detail?.defaultWidth ?? 480,
|
|
14090
14170
|
headerActions: /* @__PURE__ */ jsxs22("div", { className: "flex items-center gap-1", children: [
|
|
14091
|
-
effectiveCopy && showRowCopy ? /* @__PURE__ */
|
|
14171
|
+
effectiveCopy && showRowCopy ? /* @__PURE__ */ jsx24(
|
|
14092
14172
|
TableRowCopyControl,
|
|
14093
14173
|
{
|
|
14094
14174
|
size: "icon",
|
|
@@ -14102,7 +14182,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
14102
14182
|
detail?.headerActions?.(selectedRow),
|
|
14103
14183
|
renderRecordPageDoor(selectedRow),
|
|
14104
14184
|
windowEnabled ? /* @__PURE__ */ jsxs22(Tooltip, { children: [
|
|
14105
|
-
/* @__PURE__ */
|
|
14185
|
+
/* @__PURE__ */ jsx24(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx24(
|
|
14106
14186
|
Button,
|
|
14107
14187
|
{
|
|
14108
14188
|
type: "button",
|
|
@@ -14112,10 +14192,10 @@ function MatrxDataTableCore(coreProps) {
|
|
|
14112
14192
|
className: "h-7 w-7",
|
|
14113
14193
|
"aria-label": "Open in window",
|
|
14114
14194
|
onClick: () => openWindow(selectedRow),
|
|
14115
|
-
children: /* @__PURE__ */
|
|
14195
|
+
children: /* @__PURE__ */ jsx24(PanelRightIcon, { className: "h-5 w-5" })
|
|
14116
14196
|
}
|
|
14117
14197
|
) }),
|
|
14118
|
-
/* @__PURE__ */
|
|
14198
|
+
/* @__PURE__ */ jsx24(TooltipContent, { children: "Open in window" })
|
|
14119
14199
|
] }) : null
|
|
14120
14200
|
] }),
|
|
14121
14201
|
children: detail?.render ? (
|
|
@@ -14126,7 +14206,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
14126
14206
|
// fixes the whole class at once — a custom body that already
|
|
14127
14207
|
// scrolls (`h-full` + `overflow-y-auto` root) still resolves to
|
|
14128
14208
|
// this container's height, so no second scrollbar appears.
|
|
14129
|
-
/* @__PURE__ */
|
|
14209
|
+
/* @__PURE__ */ jsx24("div", { className: "h-full min-h-0 overflow-y-auto", children: detail.render(selectedRow, {
|
|
14130
14210
|
closeDetail: () => setSelectedId(null),
|
|
14131
14211
|
openDetail: () => openDetail(selectedRow),
|
|
14132
14212
|
openWindow: () => openWindow(selectedRow),
|
|
@@ -14134,7 +14214,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
14134
14214
|
hasPendingEdits: Boolean(edits[getRowId(selectedRow)]),
|
|
14135
14215
|
discardPendingEdits: () => discardRowEdits(getRowId(selectedRow))
|
|
14136
14216
|
}) })
|
|
14137
|
-
) : /* @__PURE__ */
|
|
14217
|
+
) : /* @__PURE__ */ jsx24(
|
|
14138
14218
|
DataRowInspector,
|
|
14139
14219
|
{
|
|
14140
14220
|
row: selectedRow,
|
|
@@ -14148,7 +14228,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
14148
14228
|
)
|
|
14149
14229
|
}
|
|
14150
14230
|
) : null,
|
|
14151
|
-
windowRow ? /* @__PURE__ */
|
|
14231
|
+
windowRow ? /* @__PURE__ */ jsx24(
|
|
14152
14232
|
DataRowWindow,
|
|
14153
14233
|
{
|
|
14154
14234
|
isOpen: true,
|
|
@@ -14162,7 +14242,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
14162
14242
|
headerActions: /* @__PURE__ */ jsxs22("div", { className: "flex items-center gap-1", children: [
|
|
14163
14243
|
renderRecordPageDoor(windowRow),
|
|
14164
14244
|
windowConfig?.openOnRowClick === true && detail?.enabled === true ? /* @__PURE__ */ jsxs22(Tooltip, { children: [
|
|
14165
|
-
/* @__PURE__ */
|
|
14245
|
+
/* @__PURE__ */ jsx24(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx24(
|
|
14166
14246
|
Button,
|
|
14167
14247
|
{
|
|
14168
14248
|
type: "button",
|
|
@@ -14175,12 +14255,12 @@ function MatrxDataTableCore(coreProps) {
|
|
|
14175
14255
|
closeWindow();
|
|
14176
14256
|
openDetail(windowRow);
|
|
14177
14257
|
},
|
|
14178
|
-
children: /* @__PURE__ */
|
|
14258
|
+
children: /* @__PURE__ */ jsx24(PanelRightIcon, { className: "h-5 w-5" })
|
|
14179
14259
|
}
|
|
14180
14260
|
) }),
|
|
14181
|
-
/* @__PURE__ */
|
|
14261
|
+
/* @__PURE__ */ jsx24(TooltipContent, { children: "Open in side panel" })
|
|
14182
14262
|
] }) : null,
|
|
14183
|
-
effectiveCopy && showRowCopy ? /* @__PURE__ */
|
|
14263
|
+
effectiveCopy && showRowCopy ? /* @__PURE__ */ jsx24(
|
|
14184
14264
|
TableRowCopyControl,
|
|
14185
14265
|
{
|
|
14186
14266
|
size: "icon",
|
|
@@ -14199,7 +14279,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
14199
14279
|
closeWindow,
|
|
14200
14280
|
hasPendingEdits: Boolean(edits[getRowId(windowRow)]),
|
|
14201
14281
|
discardPendingEdits: () => discardRowEdits(getRowId(windowRow))
|
|
14202
|
-
}) ?? /* @__PURE__ */
|
|
14282
|
+
}) ?? /* @__PURE__ */ jsx24(
|
|
14203
14283
|
DataRowInspector,
|
|
14204
14284
|
{
|
|
14205
14285
|
row: windowRow,
|
|
@@ -14228,7 +14308,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
14228
14308
|
discardPendingEdits: () => discardRowEdits(getRowId(windowRow))
|
|
14229
14309
|
}) : editableFieldColumns(windowRow).length > 0 ? (
|
|
14230
14310
|
// THE DEFAULT EDIT TAB: the editable columns with the grid's own editors.
|
|
14231
|
-
/* @__PURE__ */
|
|
14311
|
+
/* @__PURE__ */ jsx24(
|
|
14232
14312
|
DataRowInspector,
|
|
14233
14313
|
{
|
|
14234
14314
|
row: windowRow,
|
|
@@ -14248,7 +14328,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
14248
14328
|
})
|
|
14249
14329
|
}
|
|
14250
14330
|
) : null,
|
|
14251
|
-
missingWindowRowId ? /* @__PURE__ */
|
|
14331
|
+
missingWindowRowId ? /* @__PURE__ */ jsx24(
|
|
14252
14332
|
DataRowWindow,
|
|
14253
14333
|
{
|
|
14254
14334
|
isOpen: true,
|
|
@@ -14257,7 +14337,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
14257
14337
|
width: 520,
|
|
14258
14338
|
height: 360,
|
|
14259
14339
|
windowId: `matrx-data-row-${urlState?.id ?? "local"}-missing-${missingWindowRowId}`,
|
|
14260
|
-
viewContent: /* @__PURE__ */
|
|
14340
|
+
viewContent: /* @__PURE__ */ jsx24(
|
|
14261
14341
|
MissingRowNotice,
|
|
14262
14342
|
{
|
|
14263
14343
|
id: missingWindowRowId,
|
|
@@ -14275,8 +14355,8 @@ function MatrxDataTableCore(coreProps) {
|
|
|
14275
14355
|
"data-matrx-foreign-drafts": true,
|
|
14276
14356
|
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",
|
|
14277
14357
|
children: [
|
|
14278
|
-
/* @__PURE__ */
|
|
14279
|
-
/* @__PURE__ */
|
|
14358
|
+
/* @__PURE__ */ jsx24("span", { children: "Unsaved edits from previous results" }),
|
|
14359
|
+
/* @__PURE__ */ jsx24(
|
|
14280
14360
|
CopyButtons,
|
|
14281
14361
|
{
|
|
14282
14362
|
size: "xs",
|
|
@@ -14285,11 +14365,11 @@ function MatrxDataTableCore(coreProps) {
|
|
|
14285
14365
|
json: () => foreignDraftPayload
|
|
14286
14366
|
}
|
|
14287
14367
|
),
|
|
14288
|
-
/* @__PURE__ */
|
|
14368
|
+
/* @__PURE__ */ jsx24(Button, { type: "button", size: "sm", variant: "ghost", className: "h-7 text-xs text-destructive-ink", onClick: () => setConfirmForeignDraftDiscard(true), children: "Discard drafts" })
|
|
14289
14369
|
]
|
|
14290
14370
|
}
|
|
14291
14371
|
) : null,
|
|
14292
|
-
/* @__PURE__ */
|
|
14372
|
+
/* @__PURE__ */ jsx24(
|
|
14293
14373
|
ConfirmDialog,
|
|
14294
14374
|
{
|
|
14295
14375
|
open: confirmForeignDraftDiscard,
|
|
@@ -14309,7 +14389,7 @@ function MatrxDataTableCore(coreProps) {
|
|
|
14309
14389
|
}
|
|
14310
14390
|
}
|
|
14311
14391
|
),
|
|
14312
|
-
/* @__PURE__ */
|
|
14392
|
+
/* @__PURE__ */ jsx24(
|
|
14313
14393
|
DirtySavePill,
|
|
14314
14394
|
{
|
|
14315
14395
|
changeCount,
|
|
@@ -14322,11 +14402,11 @@ function MatrxDataTableCore(coreProps) {
|
|
|
14322
14402
|
]
|
|
14323
14403
|
}
|
|
14324
14404
|
),
|
|
14325
|
-
/* @__PURE__ */
|
|
14405
|
+
/* @__PURE__ */ jsx24(DragOverlay, { children: draggedRow ? (
|
|
14326
14406
|
// w-max: the overlay inherits the ACTIVE node's size, and the active
|
|
14327
14407
|
// node is the 16px grip handle — without it the label wraps to one
|
|
14328
14408
|
// character per line.
|
|
14329
|
-
/* @__PURE__ */
|
|
14409
|
+
/* @__PURE__ */ jsx24("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" })
|
|
14330
14410
|
) : null })
|
|
14331
14411
|
]
|
|
14332
14412
|
}
|
|
@@ -14343,7 +14423,7 @@ function HierarchyDragHandle({
|
|
|
14343
14423
|
id,
|
|
14344
14424
|
disabled
|
|
14345
14425
|
});
|
|
14346
|
-
return /* @__PURE__ */
|
|
14426
|
+
return /* @__PURE__ */ jsx24(
|
|
14347
14427
|
"button",
|
|
14348
14428
|
{
|
|
14349
14429
|
ref: setNodeRef,
|
|
@@ -14355,7 +14435,7 @@ function HierarchyDragHandle({
|
|
|
14355
14435
|
onClick: (event) => event.stopPropagation(),
|
|
14356
14436
|
...attributes,
|
|
14357
14437
|
...listeners,
|
|
14358
|
-
children: /* @__PURE__ */
|
|
14438
|
+
children: /* @__PURE__ */ jsx24(GripVerticalIcon, { className: "h-3.5 w-3.5" })
|
|
14359
14439
|
}
|
|
14360
14440
|
);
|
|
14361
14441
|
}
|
|
@@ -14374,8 +14454,8 @@ function HierarchyRootDropTarget({
|
|
|
14374
14454
|
isOver && "border-solid bg-primary/20 shadow-md shadow-primary/25"
|
|
14375
14455
|
),
|
|
14376
14456
|
children: [
|
|
14377
|
-
/* @__PURE__ */
|
|
14378
|
-
/* @__PURE__ */
|
|
14457
|
+
/* @__PURE__ */ jsx24("span", { className: "truncate", children: draggedLabel }),
|
|
14458
|
+
/* @__PURE__ */ jsx24("span", { className: "text-primary-ink/75", children: label })
|
|
14379
14459
|
]
|
|
14380
14460
|
}
|
|
14381
14461
|
);
|
|
@@ -14424,7 +14504,7 @@ function HierarchyDragIndicatorLayer({
|
|
|
14424
14504
|
const { preview } = indicator;
|
|
14425
14505
|
const indent = indicator.left + 10 + preview.depth * 12;
|
|
14426
14506
|
if (preview.position === "inside") {
|
|
14427
|
-
return /* @__PURE__ */
|
|
14507
|
+
return /* @__PURE__ */ jsx24(
|
|
14428
14508
|
"div",
|
|
14429
14509
|
{
|
|
14430
14510
|
"aria-hidden": "true",
|
|
@@ -14451,7 +14531,7 @@ function HierarchyDragIndicatorLayer({
|
|
|
14451
14531
|
);
|
|
14452
14532
|
}
|
|
14453
14533
|
const lineTop = preview.position === "before" ? indicator.top - 1 : indicator.top + indicator.height - 1;
|
|
14454
|
-
return /* @__PURE__ */
|
|
14534
|
+
return /* @__PURE__ */ jsx24(
|
|
14455
14535
|
"div",
|
|
14456
14536
|
{
|
|
14457
14537
|
"aria-hidden": "true",
|
|
@@ -14463,7 +14543,7 @@ function HierarchyDragIndicatorLayer({
|
|
|
14463
14543
|
width: Math.max(0, indicator.left + indicator.width - indent - 8)
|
|
14464
14544
|
},
|
|
14465
14545
|
children: /* @__PURE__ */ jsxs22("div", { className: "relative h-0.5 rounded-full bg-primary", children: [
|
|
14466
|
-
/* @__PURE__ */
|
|
14546
|
+
/* @__PURE__ */ jsx24("span", { className: "absolute -left-1 top-1/2 h-2 w-2 -translate-y-1/2 rounded-full border-2 border-primary bg-card" }),
|
|
14467
14547
|
/* @__PURE__ */ jsxs22(
|
|
14468
14548
|
"span",
|
|
14469
14549
|
{
|
|
@@ -14505,7 +14585,7 @@ function ColumnHeaderDropZone({
|
|
|
14505
14585
|
disabled: !enabled,
|
|
14506
14586
|
data: { matrxDragKind: "column-header", columnId: id }
|
|
14507
14587
|
});
|
|
14508
|
-
return /* @__PURE__ */
|
|
14588
|
+
return /* @__PURE__ */ jsx24("div", { ref: setNodeRef, className: "flex min-w-0 items-center", children });
|
|
14509
14589
|
}
|
|
14510
14590
|
function fixedUtilityWidth(width) {
|
|
14511
14591
|
return width === void 0 ? void 0 : { width: `${width}px`, minWidth: `${width}px`, maxWidth: `${width}px` };
|
|
@@ -14554,7 +14634,7 @@ function TableGroupHeaderRow({
|
|
|
14554
14634
|
const qualifier = sourceCount !== null || scope === "all" ? "" : scope === "page" ? " on this page" : " loaded";
|
|
14555
14635
|
const summary = `${formatCount10(count)} ${noun}${qualifier}`;
|
|
14556
14636
|
const [first, ...rest] = columns;
|
|
14557
|
-
return /* @__PURE__ */
|
|
14637
|
+
return /* @__PURE__ */ jsx24(
|
|
14558
14638
|
MatrxTableGroupHeaderRow,
|
|
14559
14639
|
{
|
|
14560
14640
|
groupKey: group.key,
|
|
@@ -14611,7 +14691,7 @@ function DefaultJsonCell({ value }) {
|
|
|
14611
14691
|
const summary = Array.isArray(value) ? `${value.length} items` : Object.keys(value).slice(0, 3).join(", ") || "Empty object";
|
|
14612
14692
|
return /* @__PURE__ */ jsxs22(Fragment15, { children: [
|
|
14613
14693
|
/* @__PURE__ */ jsxs22(Tooltip, { children: [
|
|
14614
|
-
/* @__PURE__ */
|
|
14694
|
+
/* @__PURE__ */ jsx24(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs22("button", { type: "button", className: "block max-w-full truncate text-left", onClick: (event) => {
|
|
14615
14695
|
event.stopPropagation();
|
|
14616
14696
|
setOpen(true);
|
|
14617
14697
|
}, style: { display: "-webkit-box", WebkitLineClamp: 2, WebkitBoxOrient: "vertical", overflow: "hidden", whiteSpace: "normal", overflowWrap: "anywhere" }, "aria-label": "Open JSON value", children: [
|
|
@@ -14619,9 +14699,9 @@ function DefaultJsonCell({ value }) {
|
|
|
14619
14699
|
" ",
|
|
14620
14700
|
summary
|
|
14621
14701
|
] }) }),
|
|
14622
|
-
/* @__PURE__ */
|
|
14702
|
+
/* @__PURE__ */ jsx24(TooltipContent, { className: "max-w-md max-h-80 overflow-auto whitespace-pre-wrap break-words", children: text })
|
|
14623
14703
|
] }),
|
|
14624
|
-
/* @__PURE__ */
|
|
14704
|
+
/* @__PURE__ */ jsx24(DataRowWindow, { isOpen: open, onClose: () => setOpen(false), title: "JSON value", row: value, viewContent: Viewer ? /* @__PURE__ */ jsx24(Viewer, { data: value }) : /* @__PURE__ */ jsx24("pre", { className: "overflow-auto whitespace-pre-wrap p-3 text-xs", children: text }) })
|
|
14625
14705
|
] });
|
|
14626
14706
|
}
|
|
14627
14707
|
function DefaultMarkerCell({
|
|
@@ -14631,7 +14711,7 @@ function DefaultMarkerCell({
|
|
|
14631
14711
|
const label = marker === "favorite" ? value ? "Favorite" : "Not favorite" : value ? "Pinned" : "Not pinned";
|
|
14632
14712
|
const Icon = marker === "favorite" ? StarIcon : PinIcon;
|
|
14633
14713
|
return /* @__PURE__ */ jsxs22(Tooltip, { children: [
|
|
14634
|
-
/* @__PURE__ */
|
|
14714
|
+
/* @__PURE__ */ jsx24(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx24(
|
|
14635
14715
|
"span",
|
|
14636
14716
|
{
|
|
14637
14717
|
role: "img",
|
|
@@ -14640,10 +14720,10 @@ function DefaultMarkerCell({
|
|
|
14640
14720
|
"inline-flex size-5 items-center justify-center",
|
|
14641
14721
|
value ? "text-amber-500" : "text-muted-foreground/45"
|
|
14642
14722
|
),
|
|
14643
|
-
children: /* @__PURE__ */
|
|
14723
|
+
children: /* @__PURE__ */ jsx24(Icon, { className: "size-4", ...value ? { fill: "currentColor" } : {} })
|
|
14644
14724
|
}
|
|
14645
14725
|
) }),
|
|
14646
|
-
/* @__PURE__ */
|
|
14726
|
+
/* @__PURE__ */ jsx24(TooltipContent, { children: label })
|
|
14647
14727
|
] });
|
|
14648
14728
|
}
|
|
14649
14729
|
function renderFooterCell(row, col, index) {
|
|
@@ -14653,7 +14733,7 @@ function renderFooterCell(row, col, index) {
|
|
|
14653
14733
|
function renderCell(row, col, index) {
|
|
14654
14734
|
if (col.loading?.(row)) {
|
|
14655
14735
|
const align = alignForFormat(col);
|
|
14656
|
-
return /* @__PURE__ */
|
|
14736
|
+
return /* @__PURE__ */ jsx24(
|
|
14657
14737
|
Skeleton,
|
|
14658
14738
|
{
|
|
14659
14739
|
"data-matrx-table-cell-loading": "",
|
|
@@ -14664,13 +14744,13 @@ function renderCell(row, col, index) {
|
|
|
14664
14744
|
if (col.cell) return col.cell(row, index);
|
|
14665
14745
|
const raw = getCellValue(row, col);
|
|
14666
14746
|
const formattedByDeclaration = formatColumnValue(col, raw);
|
|
14667
|
-
if (formattedByDeclaration) return /* @__PURE__ */
|
|
14747
|
+
if (formattedByDeclaration) return /* @__PURE__ */ jsx24(FormattedCell, { result: formattedByDeclaration });
|
|
14668
14748
|
const kind = col.cellKind ?? "auto";
|
|
14669
14749
|
const asUuid = kind === "uuid" || kind === "fk" || kind === "auto" && isUuidValue(raw);
|
|
14670
14750
|
if (asUuid && typeof raw === "string") {
|
|
14671
14751
|
const forbidden = typeof col.fk?.forbidden === "function" ? col.fk.forbidden(raw, row) : Boolean(col.fk?.forbidden);
|
|
14672
14752
|
const declaredToken = typeof col.fk?.token === "function" ? col.fk.token(row) : col.fk?.token;
|
|
14673
|
-
return /* @__PURE__ */
|
|
14753
|
+
return /* @__PURE__ */ jsx24(
|
|
14674
14754
|
RecordId,
|
|
14675
14755
|
{
|
|
14676
14756
|
value: raw,
|
|
@@ -14682,14 +14762,14 @@ function renderCell(row, col, index) {
|
|
|
14682
14762
|
}
|
|
14683
14763
|
);
|
|
14684
14764
|
}
|
|
14685
|
-
if (raw !== null && typeof raw === "object" && !(raw instanceof Date)) return /* @__PURE__ */
|
|
14765
|
+
if (raw !== null && typeof raw === "object" && !(raw instanceof Date)) return /* @__PURE__ */ jsx24(DefaultJsonCell, { value: raw });
|
|
14686
14766
|
if (typeof raw === "boolean") {
|
|
14687
14767
|
const marker = resolveColumnMarker(col);
|
|
14688
|
-
if (marker) return /* @__PURE__ */
|
|
14689
|
-
return /* @__PURE__ */
|
|
14768
|
+
if (marker) return /* @__PURE__ */ jsx24(DefaultMarkerCell, { marker, value: raw });
|
|
14769
|
+
return /* @__PURE__ */ jsx24("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" });
|
|
14690
14770
|
}
|
|
14691
14771
|
const formatted = formatTableDisplayValue(raw);
|
|
14692
|
-
return /* @__PURE__ */
|
|
14772
|
+
return /* @__PURE__ */ jsx24("span", { className: "block", title: formatted, style: { display: "-webkit-box", WebkitLineClamp: 2, WebkitBoxOrient: "vertical", overflow: "hidden", overflowWrap: "anywhere" }, children: formatted });
|
|
14693
14773
|
}
|
|
14694
14774
|
function resolveStringTitle(title, fallback) {
|
|
14695
14775
|
if (typeof title === "string" && title.trim()) return title;
|
|
@@ -14699,7 +14779,7 @@ function resolveStringTitle(title, fallback) {
|
|
|
14699
14779
|
|
|
14700
14780
|
// src/data-table/MatrxTableCard.tsx
|
|
14701
14781
|
import { useMemo as useMemo9, useState as useState18 } from "react";
|
|
14702
|
-
import { Fragment as Fragment16, jsx as
|
|
14782
|
+
import { Fragment as Fragment16, jsx as jsx25, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
14703
14783
|
function nounText(noun) {
|
|
14704
14784
|
return `${noun.count.toLocaleString()} ${noun.count === 1 ? noun.singular : noun.plural}`;
|
|
14705
14785
|
}
|
|
@@ -14738,8 +14818,8 @@ function MatrxTableCard({
|
|
|
14738
14818
|
...facts ?? []
|
|
14739
14819
|
];
|
|
14740
14820
|
const ghostButton = cn(buttonVariants({ variant: "ghost", size: "sm" }), "h-8 gap-1 px-2");
|
|
14741
|
-
const renderLink = (href, className2, content) => Link ? /* @__PURE__ */
|
|
14742
|
-
return /* @__PURE__ */
|
|
14821
|
+
const renderLink = (href, className2, content) => Link ? /* @__PURE__ */ jsx25(Link, { href, className: className2, children: content }) : /* @__PURE__ */ jsx25("a", { href, className: className2, children: content });
|
|
14822
|
+
return /* @__PURE__ */ jsx25(MatrxTableCardContext.Provider, { value: context, children: /* @__PURE__ */ jsxs23(
|
|
14743
14823
|
"section",
|
|
14744
14824
|
{
|
|
14745
14825
|
"data-matrx-table-card": true,
|
|
@@ -14748,10 +14828,10 @@ function MatrxTableCard({
|
|
|
14748
14828
|
className
|
|
14749
14829
|
),
|
|
14750
14830
|
children: [
|
|
14751
|
-
railClassName ? /* @__PURE__ */
|
|
14831
|
+
railClassName ? /* @__PURE__ */ jsx25("span", { "aria-hidden": true, className: cn("absolute inset-y-0 left-0 w-1 opacity-70", railClassName) }) : null,
|
|
14752
14832
|
/* @__PURE__ */ jsxs23("header", { "data-matrx-table-card-header": true, className: "mb-4 flex flex-wrap items-start justify-between gap-3", children: [
|
|
14753
14833
|
/* @__PURE__ */ jsxs23("div", { className: "flex min-w-0 items-center gap-3", children: [
|
|
14754
|
-
icon ? /* @__PURE__ */
|
|
14834
|
+
icon ? /* @__PURE__ */ jsx25(
|
|
14755
14835
|
"div",
|
|
14756
14836
|
{
|
|
14757
14837
|
"aria-hidden": true,
|
|
@@ -14760,24 +14840,24 @@ function MatrxTableCard({
|
|
|
14760
14840
|
}
|
|
14761
14841
|
) : null,
|
|
14762
14842
|
/* @__PURE__ */ jsxs23("div", { className: "min-w-0", children: [
|
|
14763
|
-
/* @__PURE__ */
|
|
14764
|
-
countsLine.length > 0 ? /* @__PURE__ */
|
|
14843
|
+
/* @__PURE__ */ jsx25(Heading, { className: "truncate text-lg font-semibold text-foreground", children: title }),
|
|
14844
|
+
countsLine.length > 0 ? /* @__PURE__ */ jsx25("p", { "data-matrx-table-card-counts": true, className: "text-xs text-muted-foreground", children: countsLine.map((part, index) => /* @__PURE__ */ jsxs23("span", { children: [
|
|
14765
14845
|
index > 0 ? " \xB7 " : null,
|
|
14766
14846
|
part
|
|
14767
14847
|
] }, index)) }) : null
|
|
14768
14848
|
] })
|
|
14769
14849
|
] }),
|
|
14770
14850
|
/* @__PURE__ */ jsxs23("div", { "data-matrx-table-card-actions": true, className: "flex min-w-0 flex-auto flex-wrap items-center justify-end gap-1", children: [
|
|
14771
|
-
/* @__PURE__ */
|
|
14851
|
+
/* @__PURE__ */ jsx25("div", { ref: setToolbarSlot, "data-matrx-table-card-toolbar": true, className: "flex min-w-0 flex-auto justify-end empty:hidden" }),
|
|
14772
14852
|
headerActions,
|
|
14773
14853
|
edit ? "href" in edit ? renderLink(
|
|
14774
14854
|
edit.href,
|
|
14775
14855
|
ghostButton,
|
|
14776
14856
|
/* @__PURE__ */ jsxs23(Fragment16, { children: [
|
|
14777
|
-
/* @__PURE__ */
|
|
14778
|
-
/* @__PURE__ */
|
|
14857
|
+
/* @__PURE__ */ jsx25(PencilIcon, { className: "h-3.5 w-3.5" }),
|
|
14858
|
+
/* @__PURE__ */ jsx25("span", { className: "sr-only", children: edit.label ?? `Edit ${title}` })
|
|
14779
14859
|
] })
|
|
14780
|
-
) : /* @__PURE__ */
|
|
14860
|
+
) : /* @__PURE__ */ jsx25(
|
|
14781
14861
|
"button",
|
|
14782
14862
|
{
|
|
14783
14863
|
type: "button",
|
|
@@ -14785,7 +14865,7 @@ function MatrxTableCard({
|
|
|
14785
14865
|
onClick: edit.onEdit,
|
|
14786
14866
|
"aria-label": edit.label ?? `Edit ${title}`,
|
|
14787
14867
|
title: edit.label ?? `Edit ${title}`,
|
|
14788
|
-
children: /* @__PURE__ */
|
|
14868
|
+
children: /* @__PURE__ */ jsx25(PencilIcon, { className: "h-3.5 w-3.5" })
|
|
14789
14869
|
}
|
|
14790
14870
|
) : null,
|
|
14791
14871
|
open ? renderLink(
|
|
@@ -14793,32 +14873,32 @@ function MatrxTableCard({
|
|
|
14793
14873
|
ghostButton,
|
|
14794
14874
|
/* @__PURE__ */ jsxs23(Fragment16, { children: [
|
|
14795
14875
|
open.label ?? "Open",
|
|
14796
|
-
/* @__PURE__ */
|
|
14797
|
-
/* @__PURE__ */
|
|
14876
|
+
/* @__PURE__ */ jsx25(ChevronRightIcon, { className: "h-3.5 w-3.5" }),
|
|
14877
|
+
/* @__PURE__ */ jsx25("span", { className: "sr-only", children: ` ${title}` })
|
|
14798
14878
|
] })
|
|
14799
14879
|
) : null
|
|
14800
14880
|
] })
|
|
14801
14881
|
] }),
|
|
14802
|
-
/* @__PURE__ */
|
|
14882
|
+
/* @__PURE__ */ jsx25("div", { "data-matrx-table-card-body": true, className: "-mx-2 min-w-0", children }),
|
|
14803
14883
|
/* @__PURE__ */ jsxs23(
|
|
14804
14884
|
"footer",
|
|
14805
14885
|
{
|
|
14806
14886
|
"data-matrx-table-card-footer": true,
|
|
14807
14887
|
className: cn("flex flex-wrap items-center justify-between gap-2", (add || adding) && "mt-3"),
|
|
14808
14888
|
children: [
|
|
14809
|
-
adding ? /* @__PURE__ */
|
|
14889
|
+
adding ? /* @__PURE__ */ jsx25("div", { className: "w-full", children: adding }) : add ? /* @__PURE__ */ jsxs23(
|
|
14810
14890
|
"button",
|
|
14811
14891
|
{
|
|
14812
14892
|
type: "button",
|
|
14813
14893
|
onClick: add.onAdd,
|
|
14814
14894
|
className: cn(ghostButton, "text-muted-foreground hover:text-foreground"),
|
|
14815
14895
|
children: [
|
|
14816
|
-
/* @__PURE__ */
|
|
14896
|
+
/* @__PURE__ */ jsx25(PlusIcon, { className: "h-3.5 w-3.5" }),
|
|
14817
14897
|
add.label
|
|
14818
14898
|
]
|
|
14819
14899
|
}
|
|
14820
14900
|
) : null,
|
|
14821
|
-
/* @__PURE__ */
|
|
14901
|
+
/* @__PURE__ */ jsx25("div", { ref: setFooterSlot, "data-matrx-table-card-pager": true, className: "ml-auto flex items-center gap-2 empty:hidden" })
|
|
14822
14902
|
]
|
|
14823
14903
|
}
|
|
14824
14904
|
)
|
|
@@ -14828,9 +14908,9 @@ function MatrxTableCard({
|
|
|
14828
14908
|
}
|
|
14829
14909
|
function MatrxTableCardEmpty({ message, action, children }) {
|
|
14830
14910
|
return /* @__PURE__ */ jsxs23("div", { "data-matrx-table-card-empty": true, className: "mx-2 rounded-lg border-2 border-dashed border-border py-6 text-center", children: [
|
|
14831
|
-
/* @__PURE__ */
|
|
14911
|
+
/* @__PURE__ */ jsx25("p", { className: "mb-3 text-sm text-muted-foreground", children: message }),
|
|
14832
14912
|
action ? /* @__PURE__ */ jsxs23("button", { type: "button", onClick: action.onClick, className: cn(buttonVariants({ size: "sm" }), "gap-1.5"), children: [
|
|
14833
|
-
/* @__PURE__ */
|
|
14913
|
+
/* @__PURE__ */ jsx25(PlusIcon, { className: "h-3.5 w-3.5" }),
|
|
14834
14914
|
action.label
|
|
14835
14915
|
] }) : null,
|
|
14836
14916
|
children
|
|
@@ -14839,7 +14919,7 @@ function MatrxTableCardEmpty({ message, action, children }) {
|
|
|
14839
14919
|
|
|
14840
14920
|
// src/data-table/SavedViewsControl.tsx
|
|
14841
14921
|
import { useId as useId3, useState as useState19 } from "react";
|
|
14842
|
-
import { Fragment as Fragment17, jsx as
|
|
14922
|
+
import { Fragment as Fragment17, jsx as jsx26, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
14843
14923
|
function SavedViewsControl({
|
|
14844
14924
|
views,
|
|
14845
14925
|
activeId = null,
|
|
@@ -14933,7 +15013,7 @@ function SavedViewsControl({
|
|
|
14933
15013
|
const activeName = activeId ? views.find((view) => view.id === activeId)?.name : void 0;
|
|
14934
15014
|
return /* @__PURE__ */ jsxs24("div", { className: "flex min-w-0 flex-wrap items-center gap-1", "data-matrx-table-saved-views": true, children: [
|
|
14935
15015
|
presentation === "tabs" ? /* @__PURE__ */ jsxs24(Fragment17, { children: [
|
|
14936
|
-
/* @__PURE__ */
|
|
15016
|
+
/* @__PURE__ */ jsx26(
|
|
14937
15017
|
TableViewTabs,
|
|
14938
15018
|
{
|
|
14939
15019
|
tabs: [{ id: "default", label: "Default view" }, ...views.map((view) => ({ id: view.id, label: view.name }))],
|
|
@@ -14954,10 +15034,10 @@ function SavedViewsControl({
|
|
|
14954
15034
|
related
|
|
14955
15035
|
}
|
|
14956
15036
|
),
|
|
14957
|
-
loading ? /* @__PURE__ */
|
|
15037
|
+
loading ? /* @__PURE__ */ jsx26("span", { role: "status", className: "text-xs text-muted-foreground", children: "Loading views\u2026" }) : null
|
|
14958
15038
|
] }) : /* @__PURE__ */ jsxs24(DropdownMenu, { children: [
|
|
14959
15039
|
/* @__PURE__ */ jsxs24(Tooltip, { children: [
|
|
14960
|
-
/* @__PURE__ */
|
|
15040
|
+
/* @__PURE__ */ jsx26(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx26(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs24(
|
|
14961
15041
|
Button2,
|
|
14962
15042
|
{
|
|
14963
15043
|
variant: "quiet",
|
|
@@ -14965,74 +15045,74 @@ function SavedViewsControl({
|
|
|
14965
15045
|
"aria-label": `Table view: ${loading ? "Loading views" : activeName ?? "Default view"}${dirty ? ", unsaved changes" : ""}`,
|
|
14966
15046
|
"aria-describedby": dirty ? unsavedChangesId : void 0,
|
|
14967
15047
|
disabled: saving,
|
|
14968
|
-
iconEnd: /* @__PURE__ */
|
|
15048
|
+
iconEnd: /* @__PURE__ */ jsx26(ChevronDownIcon, { "aria-hidden": "true" }),
|
|
14969
15049
|
children: [
|
|
14970
|
-
/* @__PURE__ */
|
|
14971
|
-
dirty ? /* @__PURE__ */
|
|
15050
|
+
/* @__PURE__ */ jsx26("span", { className: "min-w-0 flex-1 truncate", children: loading ? "Loading views\u2026" : activeName ?? "Default view" }),
|
|
15051
|
+
dirty ? /* @__PURE__ */ jsx26("span", { "aria-hidden": "true", className: "size-1.5 shrink-0 rounded-full bg-amber-500" }) : null
|
|
14972
15052
|
]
|
|
14973
15053
|
}
|
|
14974
15054
|
) }) }),
|
|
14975
|
-
/* @__PURE__ */
|
|
15055
|
+
/* @__PURE__ */ jsx26(TooltipContent, { children: "Choose or save a table view" })
|
|
14976
15056
|
] }),
|
|
14977
15057
|
/* @__PURE__ */ jsxs24(DropdownMenuContent, { align: "end", children: [
|
|
14978
|
-
/* @__PURE__ */
|
|
15058
|
+
/* @__PURE__ */ jsx26(DropdownMenuLabel, { children: "Views" }),
|
|
14979
15059
|
/* @__PURE__ */ jsxs24(DropdownMenuRadioGroup, { value: activeId ?? "__default__", onValueChange: (value) => select(value === "__default__" ? null : value), children: [
|
|
14980
|
-
/* @__PURE__ */
|
|
14981
|
-
views.map((view) => /* @__PURE__ */
|
|
15060
|
+
/* @__PURE__ */ jsx26(DropdownMenuRadioItem, { value: "__default__", children: "Default view" }),
|
|
15061
|
+
views.map((view) => /* @__PURE__ */ jsx26(DropdownMenuRadioItem, { value: view.id, children: view.name }, view.id))
|
|
14982
15062
|
] }),
|
|
14983
|
-
/* @__PURE__ */
|
|
14984
|
-
/* @__PURE__ */
|
|
15063
|
+
/* @__PURE__ */ jsx26(DropdownMenuSeparator, {}),
|
|
15064
|
+
/* @__PURE__ */ jsx26(DropdownMenuItem, { disabled: saving, onSelect: () => {
|
|
14985
15065
|
setActionError(null);
|
|
14986
15066
|
setSaveOpen(true);
|
|
14987
15067
|
}, children: "Save current view\u2026" }),
|
|
14988
|
-
activeId && onUpdate ? /* @__PURE__ */
|
|
14989
|
-
activeId && onRemove ? /* @__PURE__ */
|
|
14990
|
-
onReload ? /* @__PURE__ */
|
|
15068
|
+
activeId && onUpdate ? /* @__PURE__ */ jsx26(DropdownMenuItem, { disabled: saving, onSelect: () => void update(), children: "Update current view" }) : null,
|
|
15069
|
+
activeId && onRemove ? /* @__PURE__ */ jsx26(DropdownMenuItem, { disabled: saving || removing, onSelect: () => requestRemove(activeId), children: "Delete current view\u2026" }) : null,
|
|
15070
|
+
onReload ? /* @__PURE__ */ jsx26(DropdownMenuItem, { disabled: saving || loading, onSelect: () => void reload(), children: "Reload views" }) : null
|
|
14991
15071
|
] })
|
|
14992
15072
|
] }),
|
|
14993
|
-
dirty ? /* @__PURE__ */
|
|
14994
|
-
dirty ? onUpdate ? /* @__PURE__ */
|
|
14995
|
-
visibleError && !saveOpen && !pendingRemove ? /* @__PURE__ */
|
|
14996
|
-
/* @__PURE__ */
|
|
14997
|
-
/* @__PURE__ */
|
|
14998
|
-
visibleError ? /* @__PURE__ */
|
|
14999
|
-
/* @__PURE__ */
|
|
15073
|
+
dirty ? /* @__PURE__ */ jsx26("span", { id: unsavedChangesId, role: "status", className: "sr-only", children: "Unsaved changes" }) : null,
|
|
15074
|
+
dirty ? onUpdate ? /* @__PURE__ */ jsx26(Button2, { variant: "quiet", disabled: saving, onClick: () => void update(), children: "Save changes" }) : /* @__PURE__ */ jsx26(Button2, { variant: "quiet", disabled: saving, onClick: () => setSaveOpen(true), children: "Save as view" }) : null,
|
|
15075
|
+
visibleError && !saveOpen && !pendingRemove ? /* @__PURE__ */ jsx26(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,
|
|
15076
|
+
/* @__PURE__ */ jsx26(Dialog, { open: saveOpen, onOpenChange: setSaveOpen, children: /* @__PURE__ */ jsxs24(DialogContent, { children: [
|
|
15077
|
+
/* @__PURE__ */ jsx26(DialogHeader, { children: /* @__PURE__ */ jsx26(DialogTitle, { children: "Save current view" }) }),
|
|
15078
|
+
visibleError ? /* @__PURE__ */ jsx26(ErrorBox, { className: "text-sm text-destructive-ink", message: visibleError, operation: "Save a view", origin: "design-system/SavedViewsControl" }) : null,
|
|
15079
|
+
/* @__PURE__ */ jsx26(Input, { "aria-label": "View name", value: name, onChange: (event) => setName(event.target.value), placeholder: "View name", autoFocus: true }),
|
|
15000
15080
|
/* @__PURE__ */ jsxs24(DialogFooter, { children: [
|
|
15001
|
-
/* @__PURE__ */
|
|
15002
|
-
/* @__PURE__ */
|
|
15081
|
+
/* @__PURE__ */ jsx26(Button, { type: "button", variant: "outline", onClick: () => setSaveOpen(false), children: "Cancel" }),
|
|
15082
|
+
/* @__PURE__ */ jsx26(Button, { type: "button", disabled: !name.trim() || saving, onClick: () => void save(), children: saving ? "Saving\u2026" : "Save view" })
|
|
15003
15083
|
] })
|
|
15004
15084
|
] }) }),
|
|
15005
|
-
/* @__PURE__ */
|
|
15085
|
+
/* @__PURE__ */ jsx26(Dialog, { open: pendingSelect !== void 0, onOpenChange: (open) => {
|
|
15006
15086
|
if (!open) setPendingSelect(void 0);
|
|
15007
15087
|
}, children: /* @__PURE__ */ jsxs24(DialogContent, { children: [
|
|
15008
|
-
/* @__PURE__ */
|
|
15009
|
-
/* @__PURE__ */
|
|
15088
|
+
/* @__PURE__ */ jsx26(DialogHeader, { children: /* @__PURE__ */ jsx26(DialogTitle, { children: "Unsaved view changes" }) }),
|
|
15089
|
+
/* @__PURE__ */ jsx26(DialogDescription, { children: "Switching views will discard the changes you have not saved." }),
|
|
15010
15090
|
/* @__PURE__ */ jsxs24(DialogFooter, { children: [
|
|
15011
|
-
/* @__PURE__ */
|
|
15012
|
-
/* @__PURE__ */
|
|
15091
|
+
/* @__PURE__ */ jsx26(Button, { type: "button", variant: "outline", onClick: () => setPendingSelect(void 0), children: "Stay on this view" }),
|
|
15092
|
+
/* @__PURE__ */ jsx26(Button, { type: "button", onClick: () => {
|
|
15013
15093
|
const next = pendingSelect;
|
|
15014
15094
|
setPendingSelect(void 0);
|
|
15015
15095
|
if (next !== void 0) onSelect(next);
|
|
15016
15096
|
}, children: "Discard changes and switch" })
|
|
15017
15097
|
] })
|
|
15018
15098
|
] }) }),
|
|
15019
|
-
/* @__PURE__ */
|
|
15099
|
+
/* @__PURE__ */ jsx26(Dialog, { open: pendingRemove !== null, onOpenChange: (open) => {
|
|
15020
15100
|
if (!open && !removing) setPendingRemove(null);
|
|
15021
15101
|
}, children: /* @__PURE__ */ jsxs24(DialogContent, { children: [
|
|
15022
|
-
/* @__PURE__ */
|
|
15102
|
+
/* @__PURE__ */ jsx26(DialogHeader, { children: /* @__PURE__ */ jsxs24(DialogTitle, { children: [
|
|
15023
15103
|
"Delete ",
|
|
15024
15104
|
pendingRemove ? `\u201C${pendingRemove.name}\u201D` : "saved view",
|
|
15025
15105
|
"?"
|
|
15026
15106
|
] }) }),
|
|
15027
|
-
actionError ? /* @__PURE__ */
|
|
15107
|
+
actionError ? /* @__PURE__ */ jsx26(ErrorBox, { className: "text-sm text-destructive-ink", message: actionError, operation: "Delete a saved view", origin: "design-system/SavedViewsControl" }) : null,
|
|
15028
15108
|
/* @__PURE__ */ jsxs24(DialogDescription, { children: [
|
|
15029
15109
|
"This removes the saved view from your account",
|
|
15030
15110
|
activeId === pendingRemove?.id && dirty ? " and discards its unsaved layout changes" : "",
|
|
15031
15111
|
"."
|
|
15032
15112
|
] }),
|
|
15033
15113
|
/* @__PURE__ */ jsxs24(DialogFooter, { children: [
|
|
15034
|
-
/* @__PURE__ */
|
|
15035
|
-
/* @__PURE__ */
|
|
15114
|
+
/* @__PURE__ */ jsx26(Button, { type: "button", variant: "outline", disabled: removing, onClick: () => setPendingRemove(null), children: "Cancel" }),
|
|
15115
|
+
/* @__PURE__ */ jsx26(Button, { type: "button", variant: "destructive", disabled: removing, onClick: () => void remove(), children: removing ? "Deleting\u2026" : "Delete view" })
|
|
15036
15116
|
] })
|
|
15037
15117
|
] }) })
|
|
15038
15118
|
] });
|
|
@@ -15117,7 +15197,7 @@ function comparisonGridRecords(grid) {
|
|
|
15117
15197
|
}
|
|
15118
15198
|
|
|
15119
15199
|
// src/data-table/MatrxComparisonTable.tsx
|
|
15120
|
-
import { jsx as
|
|
15200
|
+
import { jsx as jsx27, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
15121
15201
|
var ROW_COLUMN_ID = "__comparison_row";
|
|
15122
15202
|
var subjectColumnId = (subject) => `subject:${subject.id}`;
|
|
15123
15203
|
function buildGridRows(rows, subjects, footer) {
|
|
@@ -15131,7 +15211,7 @@ function buildGridRows(rows, subjects, footer) {
|
|
|
15131
15211
|
});
|
|
15132
15212
|
}
|
|
15133
15213
|
function PlaceBadge({ place }) {
|
|
15134
|
-
return /* @__PURE__ */
|
|
15214
|
+
return /* @__PURE__ */ jsx27(Badge, { tone: place === 1 ? "success" : "neutral", title: `${comparisonOrdinal(place)} place on this row`, children: comparisonOrdinal(place) });
|
|
15135
15215
|
}
|
|
15136
15216
|
function MatrxComparisonTable({
|
|
15137
15217
|
subjects: rawSubjects,
|
|
@@ -15180,11 +15260,11 @@ function MatrxComparisonTable({
|
|
|
15180
15260
|
minWidth: 120,
|
|
15181
15261
|
accessorFn: (line) => line.row.label,
|
|
15182
15262
|
copyValue: (line) => line.row.label,
|
|
15183
|
-
cell: (line) => line.row.header ?? /* @__PURE__ */
|
|
15263
|
+
cell: (line) => line.row.header ?? /* @__PURE__ */ jsx27("span", { className: line.row.emphasized || line.footer ? "font-semibold text-foreground" : "text-foreground", children: line.row.label })
|
|
15184
15264
|
},
|
|
15185
15265
|
...subjects.map((subject, index) => ({
|
|
15186
15266
|
id: subjectColumnId(subject),
|
|
15187
|
-
header: subject.header ? /* @__PURE__ */
|
|
15267
|
+
header: subject.header ? /* @__PURE__ */ jsx27("span", { title: subject.title, children: subject.header }) : /* @__PURE__ */ jsx27("span", { title: subject.title, children: subject.label }),
|
|
15188
15268
|
label: subject.label,
|
|
15189
15269
|
width: subjectWidth,
|
|
15190
15270
|
minWidth: 96,
|
|
@@ -15200,7 +15280,7 @@ function MatrxComparisonTable({
|
|
|
15200
15280
|
},
|
|
15201
15281
|
cell: (line) => {
|
|
15202
15282
|
const cell = line.cells[index];
|
|
15203
|
-
if (!cell) return /* @__PURE__ */
|
|
15283
|
+
if (!cell) return /* @__PURE__ */ jsx27("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
15204
15284
|
const place = places ? line.ranking.places[subject.id] : null;
|
|
15205
15285
|
return /* @__PURE__ */ jsxs25(
|
|
15206
15286
|
"span",
|
|
@@ -15208,8 +15288,8 @@ function MatrxComparisonTable({
|
|
|
15208
15288
|
className: align === "right" ? "inline-flex items-center justify-end gap-1.5" : "inline-flex items-center gap-1.5",
|
|
15209
15289
|
"data-comparison-highlight": line.ranking.highlights[subject.id] ?? void 0,
|
|
15210
15290
|
children: [
|
|
15211
|
-
cell.node ?? /* @__PURE__ */
|
|
15212
|
-
place != null ? /* @__PURE__ */
|
|
15291
|
+
cell.node ?? /* @__PURE__ */ jsx27("span", { children: cell.text }),
|
|
15292
|
+
place != null ? /* @__PURE__ */ jsx27(PlaceBadge, { place }) : null
|
|
15213
15293
|
]
|
|
15214
15294
|
}
|
|
15215
15295
|
);
|
|
@@ -15261,7 +15341,7 @@ function MatrxComparisonTable({
|
|
|
15261
15341
|
};
|
|
15262
15342
|
}
|
|
15263
15343
|
};
|
|
15264
|
-
return /* @__PURE__ */
|
|
15344
|
+
return /* @__PURE__ */ jsx27(
|
|
15265
15345
|
MatrxDataTable,
|
|
15266
15346
|
{
|
|
15267
15347
|
data,
|
|
@@ -15292,8 +15372,8 @@ function MatrxComparisonTable({
|
|
|
15292
15372
|
}
|
|
15293
15373
|
|
|
15294
15374
|
// src/data-table/MatrxBatchGrid.tsx
|
|
15295
|
-
import { useLayoutEffect as useLayoutEffect3, useRef as
|
|
15296
|
-
import { Fragment as Fragment18, jsx as
|
|
15375
|
+
import { useLayoutEffect as useLayoutEffect3, useRef as useRef16, useState as useState20 } from "react";
|
|
15376
|
+
import { Fragment as Fragment18, jsx as jsx28, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
15297
15377
|
var BATCH_COLUMN_FLOOR_CAP_PX = 480;
|
|
15298
15378
|
function freeColumnId(wanted, fallback, taken) {
|
|
15299
15379
|
if (!taken.has(wanted)) return wanted;
|
|
@@ -15309,13 +15389,13 @@ var TONE_CLASS = {
|
|
|
15309
15389
|
};
|
|
15310
15390
|
function BatchRowStatusIcon({ status }) {
|
|
15311
15391
|
const Glyph = status.tone === "ready" ? CircleCheck : AlertTriangleIcon;
|
|
15312
|
-
return /* @__PURE__ */
|
|
15392
|
+
return /* @__PURE__ */ jsx28("span", { role: "img", "aria-label": status.label, title: status.label, "data-matrx-batch-status": status.tone, children: /* @__PURE__ */ jsx28(Glyph, { className: cn("h-4 w-4 shrink-0", TONE_CLASS[status.tone]) }) });
|
|
15313
15393
|
}
|
|
15314
15394
|
function BatchRowKindBadge({
|
|
15315
15395
|
kind,
|
|
15316
15396
|
words
|
|
15317
15397
|
}) {
|
|
15318
|
-
return /* @__PURE__ */
|
|
15398
|
+
return /* @__PURE__ */ jsx28(
|
|
15319
15399
|
"span",
|
|
15320
15400
|
{
|
|
15321
15401
|
"data-matrx-batch-kind": kind,
|
|
@@ -15333,12 +15413,12 @@ function BatchFillButton({ fill, disabled }) {
|
|
|
15333
15413
|
const [value, setValue] = useState20(void 0);
|
|
15334
15414
|
const stop = (event) => event.stopPropagation();
|
|
15335
15415
|
return /* @__PURE__ */ jsxs26(Popover, { open, onOpenChange: setOpen, children: [
|
|
15336
|
-
/* @__PURE__ */
|
|
15416
|
+
/* @__PURE__ */ jsx28(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx28(
|
|
15337
15417
|
Button2,
|
|
15338
15418
|
{
|
|
15339
15419
|
type: "button",
|
|
15340
15420
|
variant: "quiet",
|
|
15341
|
-
icon: /* @__PURE__ */
|
|
15421
|
+
icon: /* @__PURE__ */ jsx28(ArrowDownToLine, { className: "h-3.5 w-3.5" }),
|
|
15342
15422
|
disabled,
|
|
15343
15423
|
"data-matrx-batch-fill": true,
|
|
15344
15424
|
title: fill.title,
|
|
@@ -15362,9 +15442,9 @@ function BatchFillButton({ fill, disabled }) {
|
|
|
15362
15442
|
onPointerDown: stop,
|
|
15363
15443
|
onMouseDown: stop,
|
|
15364
15444
|
children: [
|
|
15365
|
-
/* @__PURE__ */
|
|
15445
|
+
/* @__PURE__ */ jsx28("p", { className: "type-meta text-muted-foreground", children: fill.limits }),
|
|
15366
15446
|
fill.renderControl(value, setValue),
|
|
15367
|
-
/* @__PURE__ */
|
|
15447
|
+
/* @__PURE__ */ jsx28(
|
|
15368
15448
|
Button,
|
|
15369
15449
|
{
|
|
15370
15450
|
type: "button",
|
|
@@ -15386,12 +15466,12 @@ function ColumnHeader({ column, disabled }) {
|
|
|
15386
15466
|
return /* @__PURE__ */ jsxs26("span", { className: "flex min-w-0 items-start gap-1.5", "data-matrx-batch-header": column.id, children: [
|
|
15387
15467
|
/* @__PURE__ */ jsxs26("span", { className: "min-w-0", children: [
|
|
15388
15468
|
/* @__PURE__ */ jsxs26("span", { className: "flex items-center gap-1", children: [
|
|
15389
|
-
/* @__PURE__ */
|
|
15390
|
-
column.required ? /* @__PURE__ */
|
|
15469
|
+
/* @__PURE__ */ jsx28("span", { className: "truncate", children: column.header }),
|
|
15470
|
+
column.required ? /* @__PURE__ */ jsx28("span", { className: "text-destructive-ink", title: "Required", "aria-label": "Required", children: "*" }) : null
|
|
15391
15471
|
] }),
|
|
15392
|
-
column.caption ? /* @__PURE__ */
|
|
15472
|
+
column.caption ? /* @__PURE__ */ jsx28("span", { className: "type-meta block truncate font-normal normal-case tracking-normal text-muted-foreground", children: column.caption }) : null
|
|
15393
15473
|
] }),
|
|
15394
|
-
column.fill ? /* @__PURE__ */
|
|
15474
|
+
column.fill ? /* @__PURE__ */ jsx28("span", { className: "ml-auto pt-0.5", children: /* @__PURE__ */ jsx28(BatchFillButton, { fill: column.fill, disabled }) }) : null
|
|
15395
15475
|
] });
|
|
15396
15476
|
}
|
|
15397
15477
|
function MatrxBatchGrid({
|
|
@@ -15421,7 +15501,7 @@ function MatrxBatchGrid({
|
|
|
15421
15501
|
const host = useMatrxDataTableHost();
|
|
15422
15502
|
const density = ownDensity ?? host.defaultDensity ?? "condensed";
|
|
15423
15503
|
const [folded, setFolded] = useState20(/* @__PURE__ */ new Set());
|
|
15424
|
-
const gridRef =
|
|
15504
|
+
const gridRef = useRef16(null);
|
|
15425
15505
|
const [floors, setFloors] = useState20({});
|
|
15426
15506
|
useLayoutEffect3(() => {
|
|
15427
15507
|
const root = gridRef.current;
|
|
@@ -15467,10 +15547,10 @@ function MatrxBatchGrid({
|
|
|
15467
15547
|
const health = status?.(row) ?? null;
|
|
15468
15548
|
const rowKind = kind?.(row) ?? null;
|
|
15469
15549
|
return /* @__PURE__ */ jsxs26("span", { className: "flex min-w-0 items-center gap-2", "data-matrx-batch-row": id, children: [
|
|
15470
|
-
done ? /* @__PURE__ */
|
|
15471
|
-
rowKind ? /* @__PURE__ */
|
|
15472
|
-
/* @__PURE__ */
|
|
15473
|
-
done ? /* @__PURE__ */
|
|
15550
|
+
done ? /* @__PURE__ */ jsx28(BatchRowStatusIcon, { status: { tone: "ready", label: doneLabel } }) : health ? /* @__PURE__ */ jsx28(BatchRowStatusIcon, { status: health }) : null,
|
|
15551
|
+
rowKind ? /* @__PURE__ */ jsx28(BatchRowKindBadge, { kind: rowKind, words: kindWords }) : null,
|
|
15552
|
+
/* @__PURE__ */ jsx28("span", { className: "min-w-0 flex-1", children: rowHeader.render ? rowHeader.render(row) : rowHeader.label(row) }),
|
|
15553
|
+
done ? /* @__PURE__ */ jsx28("span", { className: "type-meta shrink-0 text-success-ink", children: doneLabel }) : null
|
|
15474
15554
|
] });
|
|
15475
15555
|
}
|
|
15476
15556
|
};
|
|
@@ -15478,7 +15558,7 @@ function MatrxBatchGrid({
|
|
|
15478
15558
|
const typed = column.type !== void 0 && column.render === void 0;
|
|
15479
15559
|
const def = {
|
|
15480
15560
|
id: column.id,
|
|
15481
|
-
header: /* @__PURE__ */
|
|
15561
|
+
header: /* @__PURE__ */ jsx28(ColumnHeader, { column, disabled }),
|
|
15482
15562
|
label: column.header,
|
|
15483
15563
|
...column.helpText ? { helpText: column.helpText } : {},
|
|
15484
15564
|
accessorFn: (row) => banded(row) ? null : column.read(row),
|
|
@@ -15497,7 +15577,7 @@ function MatrxBatchGrid({
|
|
|
15497
15577
|
def.editableIf = (row) => !banded(row) && (column.editableIf ? column.editableIf(row) : true);
|
|
15498
15578
|
} else if (column.render) {
|
|
15499
15579
|
const draw = column.render;
|
|
15500
|
-
def.cell = (row) => banded(row) ? null : /* @__PURE__ */
|
|
15580
|
+
def.cell = (row) => banded(row) ? null : /* @__PURE__ */ jsx28("div", { ...{ [CELL_EDITOR_ATTR]: "" }, "data-matrx-batch-cell": column.id, className: "min-w-0", children: draw(row) });
|
|
15501
15581
|
}
|
|
15502
15582
|
return def;
|
|
15503
15583
|
});
|
|
@@ -15530,7 +15610,7 @@ function MatrxBatchGrid({
|
|
|
15530
15610
|
data.map(getRowId).filter((id) => !folded.has(id) && hasDetail(byId.get(id)))
|
|
15531
15611
|
);
|
|
15532
15612
|
return /* @__PURE__ */ jsxs26("div", { ref: gridRef, className: "min-w-0", "data-matrx-batch-grid": tableId, children: [
|
|
15533
|
-
/* @__PURE__ */
|
|
15613
|
+
/* @__PURE__ */ jsx28(
|
|
15534
15614
|
MatrxDataTable,
|
|
15535
15615
|
{
|
|
15536
15616
|
tableId,
|
|
@@ -15586,8 +15666,8 @@ function MatrxBatchGrid({
|
|
|
15586
15666
|
onExpandedIdsChange: (next) => setFolded(new Set(data.map(getRowId).filter((id) => !next.has(id)))),
|
|
15587
15667
|
canExpand: hasDetail,
|
|
15588
15668
|
render: (row) => /* @__PURE__ */ jsxs26(Fragment18, { children: [
|
|
15589
|
-
banded(row) ? /* @__PURE__ */
|
|
15590
|
-
notesOf(row).length > 0 ? /* @__PURE__ */
|
|
15669
|
+
banded(row) ? /* @__PURE__ */ jsx28("div", { "data-matrx-batch-band": true, className: "px-3 py-1.5 text-sm text-muted-foreground", children: bandOf(row) }) : null,
|
|
15670
|
+
notesOf(row).length > 0 ? /* @__PURE__ */ jsx28(BatchRowNotes, { notes: notesOf(row) }) : null
|
|
15591
15671
|
] })
|
|
15592
15672
|
},
|
|
15593
15673
|
...onRemoveRow ? {
|
|
@@ -15607,12 +15687,12 @@ function MatrxBatchGrid({
|
|
|
15607
15687
|
} : {}
|
|
15608
15688
|
}
|
|
15609
15689
|
),
|
|
15610
|
-
footnote ? /* @__PURE__ */
|
|
15690
|
+
footnote ? /* @__PURE__ */ jsx28("div", { className: "type-meta px-3 py-2 text-muted-foreground", children: footnote }) : null
|
|
15611
15691
|
] });
|
|
15612
15692
|
}
|
|
15613
15693
|
function BatchRowNotes({ notes }) {
|
|
15614
15694
|
const blocked = notes.some((note) => note.tone === "blocked");
|
|
15615
|
-
return /* @__PURE__ */
|
|
15695
|
+
return /* @__PURE__ */ jsx28(
|
|
15616
15696
|
"ul",
|
|
15617
15697
|
{
|
|
15618
15698
|
"data-matrx-batch-notes": true,
|
|
@@ -15621,8 +15701,8 @@ function BatchRowNotes({ notes }) {
|
|
|
15621
15701
|
blocked ? "bg-destructive/5" : "bg-warning/10"
|
|
15622
15702
|
),
|
|
15623
15703
|
children: notes.map((note) => /* @__PURE__ */ jsxs26("li", { className: "flex items-start gap-1.5", children: [
|
|
15624
|
-
/* @__PURE__ */
|
|
15625
|
-
/* @__PURE__ */
|
|
15704
|
+
/* @__PURE__ */ jsx28(AlertTriangleIcon, { className: cn("mt-0.5 h-3.5 w-3.5 shrink-0", note.tone === "blocked" ? "text-destructive-ink" : "text-warning-ink") }),
|
|
15705
|
+
/* @__PURE__ */ jsx28("span", { children: note.text })
|
|
15626
15706
|
] }, note.text))
|
|
15627
15707
|
}
|
|
15628
15708
|
);
|
|
@@ -15700,14 +15780,14 @@ function detailGridText(rows, columns, labelHeader = "Field") {
|
|
|
15700
15780
|
}
|
|
15701
15781
|
|
|
15702
15782
|
// src/data-table/MatrxDetailGrid.tsx
|
|
15703
|
-
import { Fragment as Fragment19, jsx as
|
|
15783
|
+
import { Fragment as Fragment19, jsx as jsx29, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
15704
15784
|
var DEFAULT_COLUMNS = [{ key: "value", label: "Value" }];
|
|
15705
15785
|
var DEFAULT_CLAMP = 400;
|
|
15706
15786
|
function JsonValue({ data }) {
|
|
15707
15787
|
const host = useMatrxDataTableHost();
|
|
15708
15788
|
const Viewer = host.JsonViewer;
|
|
15709
|
-
if (Viewer) return /* @__PURE__ */
|
|
15710
|
-
return /* @__PURE__ */
|
|
15789
|
+
if (Viewer) return /* @__PURE__ */ jsx29(Viewer, { data });
|
|
15790
|
+
return /* @__PURE__ */ jsx29("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) });
|
|
15711
15791
|
}
|
|
15712
15792
|
function ClampedText({ text, clampChars, mono }) {
|
|
15713
15793
|
const [open, setOpen] = useState21(false);
|
|
@@ -15715,7 +15795,7 @@ function ClampedText({ text, clampChars, mono }) {
|
|
|
15715
15795
|
const shown = long && !open ? `${text.slice(0, clampChars).trimEnd()}\u2026` : text;
|
|
15716
15796
|
return /* @__PURE__ */ jsxs27("span", { className: cn("block min-w-0 whitespace-pre-wrap break-words", mono && "font-mono"), children: [
|
|
15717
15797
|
shown,
|
|
15718
|
-
long ? /* @__PURE__ */
|
|
15798
|
+
long ? /* @__PURE__ */ jsx29(
|
|
15719
15799
|
Button2,
|
|
15720
15800
|
{
|
|
15721
15801
|
type: "button",
|
|
@@ -15732,7 +15812,7 @@ function ClampedText({ text, clampChars, mono }) {
|
|
|
15732
15812
|
function CollectedValue({ data }) {
|
|
15733
15813
|
const [open, setOpen] = useState21(false);
|
|
15734
15814
|
return /* @__PURE__ */ jsxs27("span", { className: "block min-w-0", children: [
|
|
15735
|
-
/* @__PURE__ */
|
|
15815
|
+
/* @__PURE__ */ jsx29(
|
|
15736
15816
|
Button2,
|
|
15737
15817
|
{
|
|
15738
15818
|
type: "button",
|
|
@@ -15744,7 +15824,7 @@ function CollectedValue({ data }) {
|
|
|
15744
15824
|
children: collectedDetailSummary(data)
|
|
15745
15825
|
}
|
|
15746
15826
|
),
|
|
15747
|
-
open ? /* @__PURE__ */
|
|
15827
|
+
open ? /* @__PURE__ */ jsx29("span", { className: "mt-1 block", children: /* @__PURE__ */ jsx29(JsonValue, { data }) }) : null
|
|
15748
15828
|
] });
|
|
15749
15829
|
}
|
|
15750
15830
|
function MatrxDetailValue({
|
|
@@ -15755,13 +15835,13 @@ function MatrxDetailValue({
|
|
|
15755
15835
|
clampChars = DEFAULT_CLAMP
|
|
15756
15836
|
}) {
|
|
15757
15837
|
if (isBlankDetailValue(value)) {
|
|
15758
|
-
return /* @__PURE__ */
|
|
15838
|
+
return /* @__PURE__ */ jsx29("span", { className: "italic text-muted-foreground", "data-matrx-detail-empty": "", children: emptyLabel });
|
|
15759
15839
|
}
|
|
15760
|
-
if (isUuidValue(value)) return /* @__PURE__ */
|
|
15840
|
+
if (isUuidValue(value)) return /* @__PURE__ */ jsx29(RecordId, { value, label });
|
|
15761
15841
|
const collected = collectedDetailValue(value);
|
|
15762
|
-
if (collected) return /* @__PURE__ */
|
|
15842
|
+
if (collected) return /* @__PURE__ */ jsx29(CollectedValue, { data: collected });
|
|
15763
15843
|
const text = Array.isArray(value) ? value.map((item) => detailValueText(item)).join(", ") : typeof value === "string" ? value : formatTableDisplayValue(value);
|
|
15764
|
-
return /* @__PURE__ */
|
|
15844
|
+
return /* @__PURE__ */ jsx29(ClampedText, { text, clampChars, mono });
|
|
15765
15845
|
}
|
|
15766
15846
|
function MatrxDetailGrid({
|
|
15767
15847
|
rows,
|
|
@@ -15793,14 +15873,14 @@ function MatrxDetailGrid({
|
|
|
15793
15873
|
const value = row.values[column.key];
|
|
15794
15874
|
if (!copy || isBlankDetailValue(value)) return null;
|
|
15795
15875
|
const label = columns.length > 1 ? `${row.label} \xB7 ${column.label}` : row.label;
|
|
15796
|
-
return /* @__PURE__ */
|
|
15876
|
+
return /* @__PURE__ */ jsx29(
|
|
15797
15877
|
"span",
|
|
15798
15878
|
{
|
|
15799
15879
|
className: cn(
|
|
15800
15880
|
"shrink-0 opacity-0 transition-opacity focus-within:opacity-100 group-hover/detail:opacity-100",
|
|
15801
15881
|
floating && "absolute right-1 top-0.5 rounded-md bg-card"
|
|
15802
15882
|
),
|
|
15803
|
-
children: /* @__PURE__ */
|
|
15883
|
+
children: /* @__PURE__ */ jsx29(
|
|
15804
15884
|
DeferredCopyButtons,
|
|
15805
15885
|
{
|
|
15806
15886
|
size: "xs",
|
|
@@ -15819,12 +15899,12 @@ function MatrxDetailGrid({
|
|
|
15819
15899
|
);
|
|
15820
15900
|
};
|
|
15821
15901
|
if (rows.length === 0) {
|
|
15822
|
-
return /* @__PURE__ */
|
|
15902
|
+
return /* @__PURE__ */ jsx29("div", { className: cn("type-secondary text-muted-foreground", className), children: empty ?? "Nothing to show" });
|
|
15823
15903
|
}
|
|
15824
15904
|
const showHeader = header ?? columns.length > 1;
|
|
15825
15905
|
const singleRecord = columns.length === 1 && !showHeader;
|
|
15826
15906
|
const footer = /* @__PURE__ */ jsxs27(Fragment19, { children: [
|
|
15827
|
-
filtered.length > limit ? /* @__PURE__ */
|
|
15907
|
+
filtered.length > limit ? /* @__PURE__ */ jsx29(
|
|
15828
15908
|
Button2,
|
|
15829
15909
|
{
|
|
15830
15910
|
type: "button",
|
|
@@ -15835,7 +15915,7 @@ function MatrxDetailGrid({
|
|
|
15835
15915
|
children: `Show all ${filtered.length}`
|
|
15836
15916
|
}
|
|
15837
15917
|
) : null,
|
|
15838
|
-
held > rows.length ? /* @__PURE__ */
|
|
15918
|
+
held > rows.length ? /* @__PURE__ */ jsx29("div", { className: "mt-1 type-meta text-muted-foreground", "data-matrx-detail-held": "", children: `${rows.length} of ${held} rows shown` }) : null
|
|
15839
15919
|
] });
|
|
15840
15920
|
if (singleRecord) {
|
|
15841
15921
|
const column = columns[0];
|
|
@@ -15854,18 +15934,18 @@ function MatrxDetailGrid({
|
|
|
15854
15934
|
...meta ? { meta } : {}
|
|
15855
15935
|
};
|
|
15856
15936
|
if (custom === void 0 && isBlankDetailValue(value)) {
|
|
15857
|
-
return /* @__PURE__ */
|
|
15937
|
+
return /* @__PURE__ */ jsx29(PropertyRow, { ...common, missing: column.emptyLabel ?? true }, row.key);
|
|
15858
15938
|
}
|
|
15859
15939
|
if (collected) {
|
|
15860
|
-
return /* @__PURE__ */
|
|
15940
|
+
return /* @__PURE__ */ jsx29(PropertyRow, { ...common, data: collected, expanded: /* @__PURE__ */ jsx29(JsonValue, { data: collected }) }, row.key);
|
|
15861
15941
|
}
|
|
15862
|
-
return /* @__PURE__ */
|
|
15942
|
+
return /* @__PURE__ */ jsx29(PropertyRow, { ...common, mono: Boolean(row.mono ?? column.mono), children: custom ?? /* @__PURE__ */ jsx29(MatrxDetailValue, { value, label: row.label, mono: row.mono ?? column.mono, clampChars }) }, row.key);
|
|
15863
15943
|
}),
|
|
15864
15944
|
footer
|
|
15865
15945
|
] });
|
|
15866
15946
|
}
|
|
15867
15947
|
const template = `minmax(5rem, 11rem) repeat(${columns.length}, minmax(0, 1fr))`;
|
|
15868
|
-
const copyAll = copy ? /* @__PURE__ */
|
|
15948
|
+
const copyAll = copy ? /* @__PURE__ */ jsx29(
|
|
15869
15949
|
DeferredCopyButtons,
|
|
15870
15950
|
{
|
|
15871
15951
|
size: "xs",
|
|
@@ -15883,8 +15963,8 @@ function MatrxDetailGrid({
|
|
|
15883
15963
|
return /* @__PURE__ */ jsxs27("div", { className: cn("min-w-0", className), "data-matrx-detail-grid": reviewing ? "review" : "grid", "data-matrx-table-look": macLook, children: [
|
|
15884
15964
|
reviewing ? /* @__PURE__ */ jsxs27("div", { className: "mb-1 flex min-h-7 items-center gap-2", "data-matrx-detail-bar": "", children: [
|
|
15885
15965
|
reviewing ? /* @__PURE__ */ jsxs27(Fragment19, { children: [
|
|
15886
|
-
/* @__PURE__ */
|
|
15887
|
-
changedCount > 0 && changedCount < rows.length ? /* @__PURE__ */
|
|
15966
|
+
/* @__PURE__ */ jsx29("span", { className: "type-secondary text-muted-foreground", "data-matrx-detail-changed-count": "", children: `${changedCount} changed` }),
|
|
15967
|
+
changedCount > 0 && changedCount < rows.length ? /* @__PURE__ */ jsx29(
|
|
15888
15968
|
Button2,
|
|
15889
15969
|
{
|
|
15890
15970
|
type: "button",
|
|
@@ -15897,10 +15977,10 @@ function MatrxDetailGrid({
|
|
|
15897
15977
|
}
|
|
15898
15978
|
) : null
|
|
15899
15979
|
] }) : null,
|
|
15900
|
-
copyAll ? /* @__PURE__ */
|
|
15980
|
+
copyAll ? /* @__PURE__ */ jsx29("span", { className: "ml-auto", children: copyAll }) : null
|
|
15901
15981
|
] }) : null,
|
|
15902
15982
|
/* @__PURE__ */ jsxs27("div", { className: "group/detail-grid relative", children: [
|
|
15903
|
-
!reviewing && copyAll ? /* @__PURE__ */
|
|
15983
|
+
!reviewing && copyAll ? /* @__PURE__ */ jsx29(
|
|
15904
15984
|
"span",
|
|
15905
15985
|
{
|
|
15906
15986
|
"data-matrx-detail-copy-all": "",
|
|
@@ -15908,17 +15988,17 @@ function MatrxDetailGrid({
|
|
|
15908
15988
|
children: copyAll
|
|
15909
15989
|
}
|
|
15910
15990
|
) : null,
|
|
15911
|
-
/* @__PURE__ */
|
|
15991
|
+
/* @__PURE__ */ jsx29("div", { className: "overflow-x-auto rounded-md border border-border", children: /* @__PURE__ */ jsxs27("div", { role: "table", className: "grid min-w-max sm:min-w-0", style: { gridTemplateColumns: template }, children: [
|
|
15912
15992
|
showHeader ? /* @__PURE__ */ jsxs27("div", { role: "row", className: "contents", children: [
|
|
15913
|
-
/* @__PURE__ */
|
|
15914
|
-
columns.map((column) => /* @__PURE__ */
|
|
15993
|
+
/* @__PURE__ */ jsx29("div", { role: "columnheader", className: "border-b border-border bg-muted/40 px-2 py-1 type-label text-muted-foreground", children: labelHeader }),
|
|
15994
|
+
columns.map((column) => /* @__PURE__ */ jsx29("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))
|
|
15915
15995
|
] }) : null,
|
|
15916
15996
|
shown.map((row, index) => {
|
|
15917
15997
|
const changed = reviewing && isDetailRowChanged(row, columns);
|
|
15918
15998
|
const last = index === shown.length - 1;
|
|
15919
15999
|
const edge = last ? "" : "border-b border-border";
|
|
15920
16000
|
return /* @__PURE__ */ jsxs27("div", { role: "row", className: "contents", "data-matrx-detail-row": row.key, ...changed ? { "data-changed": "" } : {}, children: [
|
|
15921
|
-
/* @__PURE__ */
|
|
16001
|
+
/* @__PURE__ */ jsx29("div", { role: "rowheader", className: cn("px-2 py-1 type-secondary text-muted-foreground", edge), children: row.label }),
|
|
15922
16002
|
columns.map((column) => {
|
|
15923
16003
|
const value = row.values[column.key];
|
|
15924
16004
|
const emphasise = changed && column.key === after;
|
|
@@ -15935,7 +16015,7 @@ function MatrxDetailGrid({
|
|
|
15935
16015
|
),
|
|
15936
16016
|
...emphasise ? { "data-changed-cell": "" } : {},
|
|
15937
16017
|
children: [
|
|
15938
|
-
/* @__PURE__ */
|
|
16018
|
+
/* @__PURE__ */ jsx29("span", { className: "block min-w-0", children: row.render?.[column.key] ?? /* @__PURE__ */ jsx29(
|
|
15939
16019
|
MatrxDetailValue,
|
|
15940
16020
|
{
|
|
15941
16021
|
value,
|
|
@@ -15983,7 +16063,7 @@ function versionTimelineRows(versions, currentNumber) {
|
|
|
15983
16063
|
}
|
|
15984
16064
|
|
|
15985
16065
|
// src/data-table/MatrxVersionTimeline.tsx
|
|
15986
|
-
import { Fragment as Fragment20, jsx as
|
|
16066
|
+
import { Fragment as Fragment20, jsx as jsx30, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
15987
16067
|
var lucide = (props) => ({
|
|
15988
16068
|
width: 24,
|
|
15989
16069
|
height: 24,
|
|
@@ -15997,25 +16077,25 @@ var lucide = (props) => ({
|
|
|
15997
16077
|
});
|
|
15998
16078
|
function CompareIcon(props) {
|
|
15999
16079
|
return /* @__PURE__ */ jsxs28("svg", { ...lucide(props), children: [
|
|
16000
|
-
/* @__PURE__ */
|
|
16001
|
-
/* @__PURE__ */
|
|
16002
|
-
/* @__PURE__ */
|
|
16003
|
-
/* @__PURE__ */
|
|
16004
|
-
/* @__PURE__ */
|
|
16005
|
-
/* @__PURE__ */
|
|
16080
|
+
/* @__PURE__ */ jsx30("circle", { cx: "5", cy: "6", r: "3" }),
|
|
16081
|
+
/* @__PURE__ */ jsx30("path", { d: "M12 6h5a2 2 0 0 1 2 2v7" }),
|
|
16082
|
+
/* @__PURE__ */ jsx30("path", { d: "m15 9-3-3 3-3" }),
|
|
16083
|
+
/* @__PURE__ */ jsx30("circle", { cx: "19", cy: "18", r: "3" }),
|
|
16084
|
+
/* @__PURE__ */ jsx30("path", { d: "M12 18H7a2 2 0 0 1-2-2V9" }),
|
|
16085
|
+
/* @__PURE__ */ jsx30("path", { d: "m9 15 3 3-3 3" })
|
|
16006
16086
|
] });
|
|
16007
16087
|
}
|
|
16008
16088
|
function RestoreIcon(props) {
|
|
16009
16089
|
return /* @__PURE__ */ jsxs28("svg", { ...lucide(props), children: [
|
|
16010
|
-
/* @__PURE__ */
|
|
16011
|
-
/* @__PURE__ */
|
|
16090
|
+
/* @__PURE__ */ jsx30("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }),
|
|
16091
|
+
/* @__PURE__ */ jsx30("path", { d: "M3 3v5h5" })
|
|
16012
16092
|
] });
|
|
16013
16093
|
}
|
|
16014
16094
|
function NextIcon(props) {
|
|
16015
|
-
return /* @__PURE__ */
|
|
16095
|
+
return /* @__PURE__ */ jsx30(ArrowRightIcon, { ...props });
|
|
16016
16096
|
}
|
|
16017
16097
|
function LoadIcon(props) {
|
|
16018
|
-
return /* @__PURE__ */
|
|
16098
|
+
return /* @__PURE__ */ jsx30(ChevronDownIcon, { ...props });
|
|
16019
16099
|
}
|
|
16020
16100
|
function formatWhen(at2) {
|
|
16021
16101
|
if (!at2) return "";
|
|
@@ -16025,7 +16105,7 @@ function formatWhen(at2) {
|
|
|
16025
16105
|
}
|
|
16026
16106
|
function VersionCell({ row }) {
|
|
16027
16107
|
return /* @__PURE__ */ jsxs28("span", { className: "inline-flex items-center gap-1.5", "data-matrx-version": row.entry.number, children: [
|
|
16028
|
-
/* @__PURE__ */
|
|
16108
|
+
/* @__PURE__ */ jsx30(
|
|
16029
16109
|
"span",
|
|
16030
16110
|
{
|
|
16031
16111
|
"aria-hidden": true,
|
|
@@ -16036,8 +16116,8 @@ function VersionCell({ row }) {
|
|
|
16036
16116
|
)
|
|
16037
16117
|
}
|
|
16038
16118
|
),
|
|
16039
|
-
/* @__PURE__ */
|
|
16040
|
-
row.isCurrent ? /* @__PURE__ */
|
|
16119
|
+
/* @__PURE__ */ jsx30("span", { className: cn("font-mono font-medium tabular-nums", row.isCurrent ? "font-semibold text-foreground" : "text-foreground"), children: `v${row.entry.number}` }),
|
|
16120
|
+
row.isCurrent ? /* @__PURE__ */ jsx30("span", { className: "sr-only", children: "Current" }) : null
|
|
16041
16121
|
] });
|
|
16042
16122
|
}
|
|
16043
16123
|
function MatrxVersionTimeline({
|
|
@@ -16066,7 +16146,7 @@ function MatrxVersionTimeline({
|
|
|
16066
16146
|
header: "Version",
|
|
16067
16147
|
accessorFn: (row) => row.entry.number,
|
|
16068
16148
|
copyValue: (row) => `v${row.entry.number}`,
|
|
16069
|
-
cell: (row) => /* @__PURE__ */
|
|
16149
|
+
cell: (row) => /* @__PURE__ */ jsx30(VersionCell, { row }),
|
|
16070
16150
|
format: { id: "integer" },
|
|
16071
16151
|
width: 96,
|
|
16072
16152
|
frozen: true
|
|
@@ -16085,7 +16165,7 @@ function MatrxVersionTimeline({
|
|
|
16085
16165
|
id: "at",
|
|
16086
16166
|
header: "When",
|
|
16087
16167
|
accessorFn: (row) => row.entry.at instanceof Date ? row.entry.at.toISOString() : row.entry.at ?? "",
|
|
16088
|
-
cell: (row) => /* @__PURE__ */
|
|
16168
|
+
cell: (row) => /* @__PURE__ */ jsx30("span", { className: "text-muted-foreground", children: formatWhen(row.entry.at) }),
|
|
16089
16169
|
format: { id: "datetime" },
|
|
16090
16170
|
width: 160
|
|
16091
16171
|
});
|
|
@@ -16106,14 +16186,14 @@ function MatrxVersionTimeline({
|
|
|
16106
16186
|
header: "Changes",
|
|
16107
16187
|
accessorFn: (row) => [row.entry.note, row.entry.changesText].filter(Boolean).join(" \xB7 "),
|
|
16108
16188
|
cell: (row) => /* @__PURE__ */ jsxs28("div", { className: "min-w-0 space-y-1", children: [
|
|
16109
|
-
row.entry.note ? /* @__PURE__ */
|
|
16110
|
-
row.entry.changes ?? (row.entry.loaded === false ? onLoad ? null : /* @__PURE__ */
|
|
16111
|
-
row.entry.loaded === false && onLoad ? /* @__PURE__ */
|
|
16189
|
+
row.entry.note ? /* @__PURE__ */ jsx30("div", { className: "text-muted-foreground", children: row.entry.note }) : null,
|
|
16190
|
+
row.entry.changes ?? (row.entry.loaded === false ? onLoad ? null : /* @__PURE__ */ jsx30("span", { className: "text-muted-foreground", children: "\u2014" }) : row.previous ? row.entry.changesText ? /* @__PURE__ */ jsx30("span", { className: "text-muted-foreground", children: row.entry.changesText }) : /* @__PURE__ */ jsx30("span", { className: "text-muted-foreground", children: "No changes" }) : /* @__PURE__ */ jsx30("span", { className: "text-muted-foreground", children: "First version" })),
|
|
16191
|
+
row.entry.loaded === false && onLoad ? /* @__PURE__ */ jsx30(
|
|
16112
16192
|
Button2,
|
|
16113
16193
|
{
|
|
16114
16194
|
type: "button",
|
|
16115
16195
|
variant: "link",
|
|
16116
|
-
icon: /* @__PURE__ */
|
|
16196
|
+
icon: /* @__PURE__ */ jsx30(LoadIcon, { className: "size-3", "aria-hidden": true }),
|
|
16117
16197
|
"data-matrx-version-load": "",
|
|
16118
16198
|
className: "shrink-0",
|
|
16119
16199
|
onClick: (event) => {
|
|
@@ -16160,7 +16240,7 @@ function MatrxVersionTimeline({
|
|
|
16160
16240
|
};
|
|
16161
16241
|
const words = pendingRestore && restore ? restore.confirm(pendingRestore) : null;
|
|
16162
16242
|
return /* @__PURE__ */ jsxs28(Fragment20, { children: [
|
|
16163
|
-
/* @__PURE__ */
|
|
16243
|
+
/* @__PURE__ */ jsx30(
|
|
16164
16244
|
MatrxDataTable,
|
|
16165
16245
|
{
|
|
16166
16246
|
tableId,
|
|
@@ -16186,7 +16266,7 @@ function MatrxVersionTimeline({
|
|
|
16186
16266
|
} : {}
|
|
16187
16267
|
}
|
|
16188
16268
|
),
|
|
16189
|
-
words ? /* @__PURE__ */
|
|
16269
|
+
words ? /* @__PURE__ */ jsx30(
|
|
16190
16270
|
ConfirmDialog,
|
|
16191
16271
|
{
|
|
16192
16272
|
open: true,
|