@ai-matrx/design-system 0.21.10 → 0.21.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/data-table/copy-helpers.d.cts +1 -1
- package/dist/data-table/copy-helpers.d.ts +1 -1
- package/dist/data-table/filter-engine.d.cts +1 -1
- package/dist/data-table/filter-engine.d.ts +1 -1
- package/dist/data-table/host.d.cts +1 -1
- package/dist/data-table/host.d.ts +1 -1
- package/dist/data-table/index.cjs +110 -31
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.d.cts +2 -2
- package/dist/data-table/index.d.ts +2 -2
- package/dist/data-table/index.js +110 -31
- package/dist/data-table/index.js.map +1 -1
- package/dist/data-table/infer-filter.d.cts +1 -1
- package/dist/data-table/infer-filter.d.ts +1 -1
- package/dist/data-table/layered-filters.d.cts +1 -1
- package/dist/data-table/layered-filters.d.ts +1 -1
- package/dist/data-table/query-control.d.cts +1 -1
- package/dist/data-table/query-control.d.ts +1 -1
- package/dist/data-table/types.cjs.map +1 -1
- package/dist/data-table/types.d.cts +1 -1
- package/dist/data-table/types.d.ts +1 -1
- package/dist/data-table/url-state.d.cts +1 -1
- package/dist/data-table/url-state.d.ts +1 -1
- package/dist/data-table/xlsx.d.cts +1 -1
- package/dist/data-table/xlsx.d.ts +1 -1
- package/dist/{types-BAJiOaQL.d.cts → types-9Ii-b9EJ.d.cts} +30 -1
- package/dist/{types-Da781-Wq.d.ts → types-wy1EEaeG.d.ts} +30 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { h as MatrxDataTableProps, i as TableViewSnapshot, c as MatrxDataTableRecordControls, j as ColumnMarker, M as MatrxColumnDef } from '../types-
|
|
4
|
-
export { A as AnyOfColumnSearch, k as CellEditType, l as CellEditsMap, f as ColumnFilterKind, a as ColumnFilterValue, C as ColumnFiltersState, m as MatrxDataTableContextMenuConfig, g as MatrxDataTableCopyConfig, d as MatrxDataTableDensity, n as MatrxDataTableDetailConfig, o as MatrxDataTableEditConfig, p as MatrxDataTableEmptyState, q as
|
|
3
|
+
import { h as MatrxDataTableProps, i as TableViewSnapshot, c as MatrxDataTableRecordControls, j as ColumnMarker, M as MatrxColumnDef } from '../types-9Ii-b9EJ.cjs';
|
|
4
|
+
export { A as AnyOfColumnSearch, k as CellEditType, l as CellEditsMap, f as ColumnFilterKind, a as ColumnFilterValue, C as ColumnFiltersState, m as MatrxDataTableContextMenuConfig, g as MatrxDataTableCopyConfig, d as MatrxDataTableDensity, n as MatrxDataTableDetailConfig, o as MatrxDataTableEditConfig, p as MatrxDataTableEmptyState, q as MatrxDataTableExpandedDetailConfig, r as MatrxDataTableFilterUi, s as MatrxDataTableHierarchyConfig, t as MatrxDataTableHierarchyMove, u as MatrxDataTableMobileCardControls, v as MatrxDataTableQueryControl, e as MatrxDataTableQueryState, w as MatrxDataTableSelectionConfig, x as MatrxDataTableSourceProcessing, y as MatrxDataTableToolbar, z as MatrxDataTableUrlStateConfig, B as MatrxDataTableWindowConfig, D as MatrxTablePagination, E as SortDirection, S as SortState, b as TableSavedViewsProps, T as TableSearchMatchMode, F as TableViewQuery, G as TextFilterMode, H as ToolbarFacet } from '../types-9Ii-b9EJ.cjs';
|
|
5
5
|
export { MatrxDataTableHost, MatrxDataTableProvider, MatrxTableRowAlchemy, TableDoors, TableEntityRefProps, TableLinkProps, TablePeekProps, TableSidePanelProps, TableToolbarActionProps, TableWindowPanelProps, useMatrxDataTableHost, useMatrxTableRowAlchemy } from './host.cjs';
|
|
6
6
|
import { CopyControlProps } from './copy-types.cjs';
|
|
7
7
|
export { AgentPayloadInput } from './copy-types.cjs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { h as MatrxDataTableProps, i as TableViewSnapshot, c as MatrxDataTableRecordControls, j as ColumnMarker, M as MatrxColumnDef } from '../types-
|
|
4
|
-
export { A as AnyOfColumnSearch, k as CellEditType, l as CellEditsMap, f as ColumnFilterKind, a as ColumnFilterValue, C as ColumnFiltersState, m as MatrxDataTableContextMenuConfig, g as MatrxDataTableCopyConfig, d as MatrxDataTableDensity, n as MatrxDataTableDetailConfig, o as MatrxDataTableEditConfig, p as MatrxDataTableEmptyState, q as
|
|
3
|
+
import { h as MatrxDataTableProps, i as TableViewSnapshot, c as MatrxDataTableRecordControls, j as ColumnMarker, M as MatrxColumnDef } from '../types-wy1EEaeG.js';
|
|
4
|
+
export { A as AnyOfColumnSearch, k as CellEditType, l as CellEditsMap, f as ColumnFilterKind, a as ColumnFilterValue, C as ColumnFiltersState, m as MatrxDataTableContextMenuConfig, g as MatrxDataTableCopyConfig, d as MatrxDataTableDensity, n as MatrxDataTableDetailConfig, o as MatrxDataTableEditConfig, p as MatrxDataTableEmptyState, q as MatrxDataTableExpandedDetailConfig, r as MatrxDataTableFilterUi, s as MatrxDataTableHierarchyConfig, t as MatrxDataTableHierarchyMove, u as MatrxDataTableMobileCardControls, v as MatrxDataTableQueryControl, e as MatrxDataTableQueryState, w as MatrxDataTableSelectionConfig, x as MatrxDataTableSourceProcessing, y as MatrxDataTableToolbar, z as MatrxDataTableUrlStateConfig, B as MatrxDataTableWindowConfig, D as MatrxTablePagination, E as SortDirection, S as SortState, b as TableSavedViewsProps, T as TableSearchMatchMode, F as TableViewQuery, G as TextFilterMode, H as ToolbarFacet } from '../types-wy1EEaeG.js';
|
|
5
5
|
export { MatrxDataTableHost, MatrxDataTableProvider, MatrxTableRowAlchemy, TableDoors, TableEntityRefProps, TableLinkProps, TablePeekProps, TableSidePanelProps, TableToolbarActionProps, TableWindowPanelProps, useMatrxDataTableHost, useMatrxTableRowAlchemy } from './host.js';
|
|
6
6
|
import { CopyControlProps } from './copy-types.js';
|
|
7
7
|
export { AgentPayloadInput } from './copy-types.js';
|
package/dist/data-table/index.js
CHANGED
|
@@ -5907,6 +5907,7 @@ function ColumnHeaderCell({
|
|
|
5907
5907
|
onFilterChange,
|
|
5908
5908
|
selectOptions = [],
|
|
5909
5909
|
selectSingle = false,
|
|
5910
|
+
selectAllowCustom = false,
|
|
5910
5911
|
align = "left",
|
|
5911
5912
|
className,
|
|
5912
5913
|
compact = false,
|
|
@@ -5942,9 +5943,13 @@ function ColumnHeaderCell({
|
|
|
5942
5943
|
const filterActive = isColumnFilterActive(filterValue);
|
|
5943
5944
|
const deferredFilter = filterApplyLabel !== void 0 || filterShowCancel || filterFooterHint !== void 0;
|
|
5944
5945
|
const [filterOpen, setFilterOpen] = useState14(false);
|
|
5946
|
+
const [pendingNegation, setPendingNegation] = useState14(false);
|
|
5945
5947
|
const [draftFilter, setDraftFilter] = useState14(filterValue);
|
|
5946
5948
|
useEffect9(() => {
|
|
5947
|
-
if (!filterOpen)
|
|
5949
|
+
if (!filterOpen) {
|
|
5950
|
+
setDraftFilter(filterValue);
|
|
5951
|
+
setPendingNegation(filterValue?.negated ?? false);
|
|
5952
|
+
}
|
|
5948
5953
|
}, [filterOpen, filterValue]);
|
|
5949
5954
|
const applyFilter = () => {
|
|
5950
5955
|
onFilterChange(draftFilter);
|
|
@@ -5956,6 +5961,7 @@ function ColumnHeaderCell({
|
|
|
5956
5961
|
};
|
|
5957
5962
|
const visibleFilter = deferredFilter ? draftFilter : filterValue;
|
|
5958
5963
|
const setNegated = (negated) => {
|
|
5964
|
+
setPendingNegation(negated);
|
|
5959
5965
|
if (!visibleFilter) return;
|
|
5960
5966
|
const next = { ...visibleFilter, ...negated ? { negated: true } : {} };
|
|
5961
5967
|
if (!negated) delete next.negated;
|
|
@@ -6032,12 +6038,13 @@ function ColumnHeaderCell({
|
|
|
6032
6038
|
kind: filterKind,
|
|
6033
6039
|
value: visibleFilter,
|
|
6034
6040
|
onChange: (next) => {
|
|
6035
|
-
const preservingNegation = next && visibleFilter?.negated ? { ...next, negated: true } : next;
|
|
6041
|
+
const preservingNegation = next && (visibleFilter?.negated ?? pendingNegation) ? { ...next, negated: true } : next;
|
|
6036
6042
|
if (deferredFilter) setDraftFilter(preservingNegation);
|
|
6037
6043
|
else onFilterChange(preservingNegation);
|
|
6038
6044
|
},
|
|
6039
6045
|
selectOptions,
|
|
6040
6046
|
selectSingle,
|
|
6047
|
+
selectAllowCustom,
|
|
6041
6048
|
...markerLabels ? {
|
|
6042
6049
|
booleanLabels: {
|
|
6043
6050
|
all: "All",
|
|
@@ -6048,18 +6055,18 @@ function ColumnHeaderCell({
|
|
|
6048
6055
|
allowNullModes
|
|
6049
6056
|
}
|
|
6050
6057
|
) : null,
|
|
6051
|
-
filterKind &&
|
|
6058
|
+
filterKind && allowNegation ? /* @__PURE__ */ jsxs22("div", { className: "mt-2 border-t border-border pt-2", children: [
|
|
6052
6059
|
/* @__PURE__ */ jsx31("p", { className: "mb-1 text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: "Match mode" }),
|
|
6053
6060
|
/* @__PURE__ */ jsxs22("div", { className: "grid grid-cols-2 gap-1 rounded-md border p-0.5", children: [
|
|
6054
6061
|
/* @__PURE__ */ jsx31(
|
|
6055
6062
|
"button",
|
|
6056
6063
|
{
|
|
6057
6064
|
type: "button",
|
|
6058
|
-
"aria-pressed": !visibleFilter
|
|
6065
|
+
"aria-pressed": !(visibleFilter?.negated ?? pendingNegation),
|
|
6059
6066
|
onClick: () => setNegated(false),
|
|
6060
6067
|
className: cn(
|
|
6061
6068
|
"rounded px-2 py-1.5 text-xs transition-colors",
|
|
6062
|
-
!visibleFilter
|
|
6069
|
+
!(visibleFilter?.negated ?? pendingNegation) ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:bg-muted"
|
|
6063
6070
|
),
|
|
6064
6071
|
children: "Include"
|
|
6065
6072
|
}
|
|
@@ -6068,11 +6075,11 @@ function ColumnHeaderCell({
|
|
|
6068
6075
|
"button",
|
|
6069
6076
|
{
|
|
6070
6077
|
type: "button",
|
|
6071
|
-
"aria-pressed": visibleFilter
|
|
6078
|
+
"aria-pressed": visibleFilter?.negated ?? pendingNegation,
|
|
6072
6079
|
onClick: () => setNegated(true),
|
|
6073
6080
|
className: cn(
|
|
6074
6081
|
"rounded px-2 py-1.5 text-xs transition-colors",
|
|
6075
|
-
visibleFilter
|
|
6082
|
+
visibleFilter?.negated ?? pendingNegation ? "bg-destructive text-destructive-foreground" : "text-muted-foreground hover:bg-muted"
|
|
6076
6083
|
),
|
|
6077
6084
|
children: "Exclude"
|
|
6078
6085
|
}
|
|
@@ -6260,6 +6267,7 @@ function FilterBody({
|
|
|
6260
6267
|
onChange,
|
|
6261
6268
|
selectOptions,
|
|
6262
6269
|
selectSingle = false,
|
|
6270
|
+
selectAllowCustom = false,
|
|
6263
6271
|
allowNullModes = false,
|
|
6264
6272
|
booleanLabels
|
|
6265
6273
|
}) {
|
|
@@ -6323,15 +6331,29 @@ function FilterBody({
|
|
|
6323
6331
|
}
|
|
6324
6332
|
if (kind === "select") {
|
|
6325
6333
|
const selected = value?.kind === "select" ? value.values ?? (value.value && value.value !== "__all__" ? [value.value] : []) : [];
|
|
6326
|
-
return /* @__PURE__ */
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
|
-
|
|
6330
|
-
|
|
6331
|
-
|
|
6332
|
-
|
|
6333
|
-
|
|
6334
|
-
|
|
6334
|
+
return /* @__PURE__ */ jsxs22("div", { className: "space-y-2", children: [
|
|
6335
|
+
allowNullModes && /* @__PURE__ */ jsx31("div", { className: "flex flex-wrap gap-1", "aria-label": "Blank checks", children: [["empty", "(empty)"], ["not_empty", "(not empty)"], ["null", "(null)"], ["not_null", "(not null)"]].map(([mode, label]) => /* @__PURE__ */ jsx31(
|
|
6336
|
+
"button",
|
|
6337
|
+
{
|
|
6338
|
+
type: "button",
|
|
6339
|
+
"aria-pressed": value?.kind === "text" && value.mode === mode,
|
|
6340
|
+
className: "rounded border px-1.5 py-0.5 text-[10px] hover:bg-muted",
|
|
6341
|
+
onClick: () => onChange({ kind: "text", value: "", mode }),
|
|
6342
|
+
children: label
|
|
6343
|
+
},
|
|
6344
|
+
mode
|
|
6345
|
+
)) }),
|
|
6346
|
+
/* @__PURE__ */ jsx31(
|
|
6347
|
+
SearchableSelectFilter,
|
|
6348
|
+
{
|
|
6349
|
+
selected,
|
|
6350
|
+
options: selectOptions,
|
|
6351
|
+
onChange,
|
|
6352
|
+
single: selectSingle,
|
|
6353
|
+
allowCustom: selectAllowCustom
|
|
6354
|
+
}
|
|
6355
|
+
)
|
|
6356
|
+
] });
|
|
6335
6357
|
}
|
|
6336
6358
|
if (kind === "boolean") {
|
|
6337
6359
|
const current = value?.kind === "boolean" ? value.value : "__all__";
|
|
@@ -6363,7 +6385,8 @@ function SearchableSelectFilter({
|
|
|
6363
6385
|
selected,
|
|
6364
6386
|
options,
|
|
6365
6387
|
onChange,
|
|
6366
|
-
single = false
|
|
6388
|
+
single = false,
|
|
6389
|
+
allowCustom = false
|
|
6367
6390
|
}) {
|
|
6368
6391
|
const [query, setQuery] = useState14("");
|
|
6369
6392
|
const filtered = useMemo5(() => {
|
|
@@ -6413,6 +6436,11 @@ function SearchableSelectFilter({
|
|
|
6413
6436
|
/* @__PURE__ */ jsxs22(CommandList, { className: "max-h-48", children: [
|
|
6414
6437
|
/* @__PURE__ */ jsx31(CommandEmpty, { className: "py-3 text-xs text-muted-foreground", children: "No matches" }),
|
|
6415
6438
|
/* @__PURE__ */ jsxs22(CommandGroup, { children: [
|
|
6439
|
+
allowCustom && query.trim() && !options.some((option) => option.value === query.trim()) && /* @__PURE__ */ jsxs22(CommandItem, { value: `custom:${query.trim()}`, onSelect: () => toggle(query.trim()), className: "text-xs", children: [
|
|
6440
|
+
"Use \u201C",
|
|
6441
|
+
query.trim(),
|
|
6442
|
+
"\u201D"
|
|
6443
|
+
] }),
|
|
6416
6444
|
/* @__PURE__ */ jsx31(
|
|
6417
6445
|
CommandItem,
|
|
6418
6446
|
{
|
|
@@ -8605,6 +8633,10 @@ function TableToolbarAction({
|
|
|
8605
8633
|
function hasSameRowReferences(previous, next) {
|
|
8606
8634
|
return previous.length === next.length && previous.every((row, index) => row === next[index]);
|
|
8607
8635
|
}
|
|
8636
|
+
var VERTICAL_SCROLL_GEOMETRY_TOLERANCE_PX = 2;
|
|
8637
|
+
function hasUsableVerticalScroll(element) {
|
|
8638
|
+
return element.scrollHeight - element.clientHeight > VERTICAL_SCROLL_GEOMETRY_TOLERANCE_PX;
|
|
8639
|
+
}
|
|
8608
8640
|
function TableRowCopyControl({
|
|
8609
8641
|
copy,
|
|
8610
8642
|
row,
|
|
@@ -8770,6 +8802,7 @@ function MatrxDataTableCore({
|
|
|
8770
8802
|
hidePagination = false,
|
|
8771
8803
|
filterUi,
|
|
8772
8804
|
detail,
|
|
8805
|
+
expandedDetail,
|
|
8773
8806
|
window: windowConfig,
|
|
8774
8807
|
copy,
|
|
8775
8808
|
contextMenu,
|
|
@@ -9119,7 +9152,7 @@ function MatrxDataTableCore({
|
|
|
9119
9152
|
if (!scroll || !table || !header || !stickyHeader) return;
|
|
9120
9153
|
let frame = 0;
|
|
9121
9154
|
const update = () => {
|
|
9122
|
-
const hasInternalVerticalScroll = scroll
|
|
9155
|
+
const hasInternalVerticalScroll = hasUsableVerticalScroll(scroll);
|
|
9123
9156
|
const nextDocumentSticky = !hasInternalVerticalScroll;
|
|
9124
9157
|
if (documentStickyHeaderRef.current !== nextDocumentSticky) {
|
|
9125
9158
|
documentStickyHeaderRef.current = nextDocumentSticky;
|
|
@@ -9139,7 +9172,7 @@ function MatrxDataTableCore({
|
|
|
9139
9172
|
for (let ancestor = scroll.parentElement; ancestor; ancestor = ancestor.parentElement) {
|
|
9140
9173
|
const ancestorStyle = window.getComputedStyle(ancestor);
|
|
9141
9174
|
const overflowY = ancestorStyle.overflowY;
|
|
9142
|
-
if (/^(auto|scroll|overlay)$/.test(overflowY) && ancestor
|
|
9175
|
+
if (/^(auto|scroll|overlay)$/.test(overflowY) && hasUsableVerticalScroll(ancestor)) {
|
|
9143
9176
|
const scrollPaddingTop = Number.parseFloat(ancestorStyle.scrollPaddingTop) || 0;
|
|
9144
9177
|
scrollTargetTop = ancestor.getBoundingClientRect().top + scrollPaddingTop;
|
|
9145
9178
|
break;
|
|
@@ -9637,7 +9670,20 @@ function MatrxDataTableCore({
|
|
|
9637
9670
|
setWindowRowId(null);
|
|
9638
9671
|
setWindowRowSnapshot(null);
|
|
9639
9672
|
};
|
|
9673
|
+
const canExpandRow = (row) => Boolean(expandedDetail && (expandedDetail.canExpand?.(row) ?? true));
|
|
9674
|
+
const isRowExpanded = (row) => canExpandRow(row) && expandedDetail?.expandedId === getRowId(row);
|
|
9675
|
+
const toggleExpanded = (row) => {
|
|
9676
|
+
if (!expandedDetail || !canExpandRow(row)) return;
|
|
9677
|
+
const id = getRowId(row);
|
|
9678
|
+
expandedDetail.onExpandedIdChange(
|
|
9679
|
+
expandedDetail.expandedId === id ? null : id
|
|
9680
|
+
);
|
|
9681
|
+
};
|
|
9640
9682
|
const openRow = (row) => {
|
|
9683
|
+
if (canExpandRow(row)) {
|
|
9684
|
+
toggleExpanded(row);
|
|
9685
|
+
return;
|
|
9686
|
+
}
|
|
9641
9687
|
if (opensWindowOnRowClick) {
|
|
9642
9688
|
openWindow(row);
|
|
9643
9689
|
return;
|
|
@@ -9741,7 +9787,11 @@ function MatrxDataTableCore({
|
|
|
9741
9787
|
} : {},
|
|
9742
9788
|
...editEnabled && visibleColumns.some(
|
|
9743
9789
|
(column) => column.editable && (column.editableIf?.(row) ?? true)
|
|
9744
|
-
) ? { beginEdit: () => beginRowEdit(row) } : {}
|
|
9790
|
+
) ? { beginEdit: () => beginRowEdit(row) } : {},
|
|
9791
|
+
...canExpandRow(row) ? {
|
|
9792
|
+
isExpanded: isRowExpanded(row),
|
|
9793
|
+
toggleExpanded: () => toggleExpanded(row)
|
|
9794
|
+
} : {}
|
|
9745
9795
|
};
|
|
9746
9796
|
};
|
|
9747
9797
|
const hierarchyRows = hierarchy?.rows ?? data;
|
|
@@ -10647,6 +10697,7 @@ function MatrxDataTableCore({
|
|
|
10647
10697
|
] }) }) : paginated.map((row, index) => {
|
|
10648
10698
|
const id = getRowId(row);
|
|
10649
10699
|
const displayRow = applyRowEdits(row, edits[id]);
|
|
10700
|
+
const controls = buildRecordControls(displayRow);
|
|
10650
10701
|
const selectable = selection?.isRowSelectable?.(row) ?? Boolean(selection);
|
|
10651
10702
|
return /* @__PURE__ */ jsx41("div", { "data-row-id": id, className: "contents", children: mobileCards(displayRow, index, {
|
|
10652
10703
|
renderCell: (columnKey) => {
|
|
@@ -10681,10 +10732,15 @@ function MatrxDataTableCore({
|
|
|
10681
10732
|
...copy === void 0 ? { defaultColumns: declaredVisibleCopyColumns } : {}
|
|
10682
10733
|
}
|
|
10683
10734
|
) : null,
|
|
10684
|
-
renderRowActions(displayRow,
|
|
10735
|
+
renderRowActions(displayRow, controls)
|
|
10685
10736
|
]
|
|
10686
10737
|
}
|
|
10687
|
-
) : null
|
|
10738
|
+
) : null,
|
|
10739
|
+
...canExpandRow(row) ? {
|
|
10740
|
+
isExpanded: isRowExpanded(row),
|
|
10741
|
+
toggleExpanded: () => toggleExpanded(row)
|
|
10742
|
+
} : {},
|
|
10743
|
+
expandedDetail: expandedDetail && isRowExpanded(row) ? expandedDetail.render(displayRow, controls) : null
|
|
10688
10744
|
}) }, id);
|
|
10689
10745
|
}),
|
|
10690
10746
|
appendQuery !== null && isFetching && !isLoading ? /* @__PURE__ */ jsxs31(
|
|
@@ -10874,6 +10930,7 @@ function MatrxDataTableCore({
|
|
|
10874
10930
|
onFilterChange: (next) => setColumnFilter(id, next),
|
|
10875
10931
|
selectOptions: meta?.options,
|
|
10876
10932
|
selectSingle: col.filterSingle,
|
|
10933
|
+
selectAllowCustom: col.filterAllowCustom,
|
|
10877
10934
|
filterApplyLabel: filterUi?.applyLabel,
|
|
10878
10935
|
filterShowCancel: filterUi?.showCancel,
|
|
10879
10936
|
filterFooterHint: filterUi?.footerHint,
|
|
@@ -10951,6 +11008,7 @@ function MatrxDataTableCore({
|
|
|
10951
11008
|
const isSelected = selectedId === id;
|
|
10952
11009
|
const rowEdits = edits[id];
|
|
10953
11010
|
const displayRow = applyRowEdits(row, rowEdits);
|
|
11011
|
+
const controls = buildRecordControls(displayRow);
|
|
10954
11012
|
const isChecked = selectedIdSet.has(id);
|
|
10955
11013
|
const rowNode = /* @__PURE__ */ jsxs31(
|
|
10956
11014
|
"tr",
|
|
@@ -10979,7 +11037,7 @@ function MatrxDataTableCore({
|
|
|
10979
11037
|
// horizontally. The translucent zebra/hover tints remain
|
|
10980
11038
|
// desktop-only so densely layered mobile content stays crisp.
|
|
10981
11039
|
"border-b border-border/60 bg-card transition-colors",
|
|
10982
|
-
(detailEnabled || Boolean(onRowOpen)) && "cursor-pointer sm:hover:bg-muted/50",
|
|
11040
|
+
(detailEnabled || Boolean(onRowOpen) || canExpandRow(row)) && "cursor-pointer sm:hover:bg-muted/50",
|
|
10983
11041
|
isSelected && "bg-muted",
|
|
10984
11042
|
isChecked && "bg-primary/5",
|
|
10985
11043
|
highlightedIndex === index && "bg-muted ring-1 ring-inset ring-primary/60",
|
|
@@ -11095,7 +11153,7 @@ function MatrxDataTableCore({
|
|
|
11095
11153
|
...copy === void 0 ? { defaultColumns: declaredVisibleCopyColumns } : {}
|
|
11096
11154
|
}
|
|
11097
11155
|
) : null,
|
|
11098
|
-
renderRowActions(displayRow,
|
|
11156
|
+
renderRowActions(displayRow, controls),
|
|
11099
11157
|
windowEnabled ? /* @__PURE__ */ jsxs31(Tooltip, { children: [
|
|
11100
11158
|
/* @__PURE__ */ jsx41(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx41(
|
|
11101
11159
|
Button,
|
|
@@ -11126,15 +11184,36 @@ function MatrxDataTableCore({
|
|
|
11126
11184
|
id
|
|
11127
11185
|
);
|
|
11128
11186
|
const wrappedRow = rowWrapper ? rowWrapper(row, rowNode) : rowNode;
|
|
11129
|
-
|
|
11130
|
-
|
|
11187
|
+
const inlineDetail = expandedDetail && isRowExpanded(row) ? /* @__PURE__ */ jsx41(
|
|
11188
|
+
"tr",
|
|
11131
11189
|
{
|
|
11132
|
-
id,
|
|
11133
|
-
|
|
11134
|
-
children:
|
|
11190
|
+
"data-matrx-table-expanded-detail": id,
|
|
11191
|
+
className: cn("bg-muted/20", expandedDetail.className),
|
|
11192
|
+
children: /* @__PURE__ */ jsx41(
|
|
11193
|
+
"td",
|
|
11194
|
+
{
|
|
11195
|
+
colSpan: visibleColumns.length + leadingCols + (showActionsCol ? 1 : 0),
|
|
11196
|
+
className: "p-4",
|
|
11197
|
+
children: expandedDetail.render(displayRow, controls)
|
|
11198
|
+
}
|
|
11199
|
+
)
|
|
11135
11200
|
},
|
|
11136
|
-
id
|
|
11137
|
-
) :
|
|
11201
|
+
`${id}:expanded-detail`
|
|
11202
|
+
) : null;
|
|
11203
|
+
return hierarchy ? /* @__PURE__ */ jsxs31(Fragment6, { children: [
|
|
11204
|
+
/* @__PURE__ */ jsx41(
|
|
11205
|
+
HierarchyDroppableRow,
|
|
11206
|
+
{
|
|
11207
|
+
id,
|
|
11208
|
+
disabled: !canDropOn(row),
|
|
11209
|
+
children: wrappedRow
|
|
11210
|
+
}
|
|
11211
|
+
),
|
|
11212
|
+
inlineDetail
|
|
11213
|
+
] }, id) : /* @__PURE__ */ jsxs31(Fragment6, { children: [
|
|
11214
|
+
wrappedRow,
|
|
11215
|
+
inlineDetail
|
|
11216
|
+
] }, id);
|
|
11138
11217
|
}),
|
|
11139
11218
|
appendQuery !== null && isFetching && !isLoading ? /* @__PURE__ */ jsx41("tr", { "data-matrx-table-append-loading-row": true, children: /* @__PURE__ */ jsx41(
|
|
11140
11219
|
"td",
|