@ai-matrx/design-system 0.21.4 → 0.21.6
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 +8 -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/data-row-inspector.cjs.map +1 -1
- package/dist/data-table/data-row-inspector.js.map +1 -1
- package/dist/data-table/data-row-window.cjs.map +1 -1
- package/dist/data-table/data-row-window.js.map +1 -1
- package/dist/data-table/filter-engine.d.cts +1 -1
- package/dist/data-table/filter-engine.d.ts +1 -1
- package/dist/data-table/host.d.cts +1 -1
- package/dist/data-table/host.d.ts +1 -1
- package/dist/data-table/index.cjs +101 -22
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.d.cts +10 -3
- package/dist/data-table/index.d.ts +10 -3
- package/dist/data-table/index.js +101 -22
- package/dist/data-table/index.js.map +1 -1
- package/dist/data-table/infer-filter.cjs +16 -0
- package/dist/data-table/infer-filter.cjs.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/infer-filter.js +16 -0
- package/dist/data-table/infer-filter.js.map +1 -1
- package/dist/data-table/layered-filters.d.cts +1 -1
- package/dist/data-table/layered-filters.d.ts +1 -1
- package/dist/data-table/pagination.cjs.map +1 -1
- package/dist/data-table/pagination.js.map +1 -1
- package/dist/data-table/query-control.cjs +19 -0
- package/dist/data-table/query-control.cjs.map +1 -1
- package/dist/data-table/query-control.d.cts +1 -1
- package/dist/data-table/query-control.d.ts +1 -1
- package/dist/data-table/query-control.js +19 -0
- package/dist/data-table/query-control.js.map +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/uuid-cell.cjs.map +1 -1
- package/dist/data-table/uuid-cell.js.map +1 -1
- package/dist/data-table/xlsx.d.cts +1 -1
- package/dist/data-table/xlsx.d.ts +1 -1
- package/dist/{types-CbGNfo7r.d.ts → types-Dpl8OW_m.d.ts} +17 -1
- package/dist/{types-DRusLYrU.d.cts → types-DsmrqJHN.d.cts} +17 -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 } from '../types-
|
|
4
|
-
export { A as AnyOfColumnSearch,
|
|
3
|
+
import { h as MatrxDataTableProps, i as TableViewSnapshot, c as MatrxDataTableRecordControls, j as ColumnMarker, M as MatrxColumnDef } from '../types-DsmrqJHN.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 MatrxDataTableFilterUi, r as MatrxDataTableHierarchyConfig, s as MatrxDataTableHierarchyMove, t as MatrxDataTableMobileCardControls, u as MatrxDataTableQueryControl, e as MatrxDataTableQueryState, v as MatrxDataTableSelectionConfig, w as MatrxDataTableSourceProcessing, x as MatrxDataTableToolbar, y as MatrxDataTableUrlStateConfig, z as MatrxDataTableWindowConfig, B as MatrxTablePagination, D as SortDirection, S as SortState, b as TableSavedViewsProps, T as TableSearchMatchMode, E as TableViewQuery, F as TextFilterMode, G as ToolbarFacet } from '../types-DsmrqJHN.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';
|
|
@@ -78,6 +78,13 @@ declare function MatrxTableRowAlchemyProvider({ copy, placement, controls, child
|
|
|
78
78
|
children: ReactNode;
|
|
79
79
|
}): React.JSX.Element;
|
|
80
80
|
|
|
81
|
+
type ResolvedColumnMarker = Exclude<ColumnMarker, false>;
|
|
82
|
+
/**
|
|
83
|
+
* Resolve the semantic without guessing from partial names. A field such as
|
|
84
|
+
* `favorite_count` is not a marker; consumers can always opt in explicitly.
|
|
85
|
+
*/
|
|
86
|
+
declare function resolveColumnMarker<T>(column: MatrxColumnDef<T>): ResolvedColumnMarker | undefined;
|
|
87
|
+
|
|
81
88
|
interface TableViewTab {
|
|
82
89
|
id: string;
|
|
83
90
|
label: string;
|
|
@@ -96,4 +103,4 @@ interface TableViewTabsProps {
|
|
|
96
103
|
/** One shared tab strip; hosts may own URL state without copying its UI. */
|
|
97
104
|
declare function TableViewTabs({ tabs, activeId, onSelect, onAdd, onClose, onRename, related }: TableViewTabsProps): React.JSX.Element;
|
|
98
105
|
|
|
99
|
-
export { MatrxDataTable, MatrxDataTableProps, MatrxDataTableRecordControls, MatrxTableRowAlchemyProvider, SavedViewsControl, type SavedViewsControlProps, TableTitleRow, type TableTitleRowProps, TableViewSnapshot, type TableViewTab, TableViewTabs, type TableViewTabsProps, parseTableViewSnapshot };
|
|
106
|
+
export { ColumnMarker, MatrxColumnDef, MatrxDataTable, MatrxDataTableProps, MatrxDataTableRecordControls, MatrxTableRowAlchemyProvider, type ResolvedColumnMarker, SavedViewsControl, type SavedViewsControlProps, TableTitleRow, type TableTitleRowProps, TableViewSnapshot, type TableViewTab, TableViewTabs, type TableViewTabsProps, parseTableViewSnapshot, resolveColumnMarker };
|
|
@@ -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 } from '../types-
|
|
4
|
-
export { A as AnyOfColumnSearch,
|
|
3
|
+
import { h as MatrxDataTableProps, i as TableViewSnapshot, c as MatrxDataTableRecordControls, j as ColumnMarker, M as MatrxColumnDef } from '../types-Dpl8OW_m.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 MatrxDataTableFilterUi, r as MatrxDataTableHierarchyConfig, s as MatrxDataTableHierarchyMove, t as MatrxDataTableMobileCardControls, u as MatrxDataTableQueryControl, e as MatrxDataTableQueryState, v as MatrxDataTableSelectionConfig, w as MatrxDataTableSourceProcessing, x as MatrxDataTableToolbar, y as MatrxDataTableUrlStateConfig, z as MatrxDataTableWindowConfig, B as MatrxTablePagination, D as SortDirection, S as SortState, b as TableSavedViewsProps, T as TableSearchMatchMode, E as TableViewQuery, F as TextFilterMode, G as ToolbarFacet } from '../types-Dpl8OW_m.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';
|
|
@@ -78,6 +78,13 @@ declare function MatrxTableRowAlchemyProvider({ copy, placement, controls, child
|
|
|
78
78
|
children: ReactNode;
|
|
79
79
|
}): React.JSX.Element;
|
|
80
80
|
|
|
81
|
+
type ResolvedColumnMarker = Exclude<ColumnMarker, false>;
|
|
82
|
+
/**
|
|
83
|
+
* Resolve the semantic without guessing from partial names. A field such as
|
|
84
|
+
* `favorite_count` is not a marker; consumers can always opt in explicitly.
|
|
85
|
+
*/
|
|
86
|
+
declare function resolveColumnMarker<T>(column: MatrxColumnDef<T>): ResolvedColumnMarker | undefined;
|
|
87
|
+
|
|
81
88
|
interface TableViewTab {
|
|
82
89
|
id: string;
|
|
83
90
|
label: string;
|
|
@@ -96,4 +103,4 @@ interface TableViewTabsProps {
|
|
|
96
103
|
/** One shared tab strip; hosts may own URL state without copying its UI. */
|
|
97
104
|
declare function TableViewTabs({ tabs, activeId, onSelect, onAdd, onClose, onRename, related }: TableViewTabsProps): React.JSX.Element;
|
|
98
105
|
|
|
99
|
-
export { MatrxDataTable, MatrxDataTableProps, MatrxDataTableRecordControls, MatrxTableRowAlchemyProvider, SavedViewsControl, type SavedViewsControlProps, TableTitleRow, type TableTitleRowProps, TableViewSnapshot, type TableViewTab, TableViewTabs, type TableViewTabsProps, parseTableViewSnapshot };
|
|
106
|
+
export { ColumnMarker, MatrxColumnDef, MatrxDataTable, MatrxDataTableProps, MatrxDataTableRecordControls, MatrxTableRowAlchemyProvider, type ResolvedColumnMarker, SavedViewsControl, type SavedViewsControlProps, TableTitleRow, type TableTitleRowProps, TableViewSnapshot, type TableViewTab, TableViewTabs, type TableViewTabsProps, parseTableViewSnapshot, resolveColumnMarker };
|
package/dist/data-table/index.js
CHANGED
|
@@ -45,6 +45,8 @@ var Search = (p) => /* @__PURE__ */ jsxs(Icon, { ...p, children: [
|
|
|
45
45
|
/* @__PURE__ */ jsx("path", { d: "m16 16 4 4" })
|
|
46
46
|
] });
|
|
47
47
|
var Plus = (p) => /* @__PURE__ */ jsx(Icon, { ...p, children: path });
|
|
48
|
+
var Star = (p) => /* @__PURE__ */ jsx(Icon, { ...p, children: /* @__PURE__ */ jsx("path", { d: "m12 2 3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z" }) });
|
|
49
|
+
var Pin = (p) => /* @__PURE__ */ jsx(Icon, { ...p, children: /* @__PURE__ */ jsx("path", { d: "M12 17v5M9 3h6l1 7 3 3v2H5v-2l3-3 1-7z" }) });
|
|
48
50
|
var Eraser = (p) => /* @__PURE__ */ jsx(Icon, { ...p, children: /* @__PURE__ */ jsx("path", { d: "m16 3 5 5-11 11H5l-3-3L13 5l3-2Z M8 10l6 6 M10 19h12" }) });
|
|
49
51
|
var GripVertical = (p) => /* @__PURE__ */ jsxs(Icon, { ...p, children: [
|
|
50
52
|
/* @__PURE__ */ jsx("circle", { cx: "9", cy: "6", r: "1" }),
|
|
@@ -5783,6 +5785,34 @@ var CommandShortcut = ({
|
|
|
5783
5785
|
};
|
|
5784
5786
|
CommandShortcut.displayName = "CommandShortcut";
|
|
5785
5787
|
|
|
5788
|
+
// src/data-table/column-marker.ts
|
|
5789
|
+
var MARKER_ACCESSORS = {
|
|
5790
|
+
favorite: "favorite",
|
|
5791
|
+
is_favorite: "favorite",
|
|
5792
|
+
favourite: "favorite",
|
|
5793
|
+
is_favourite: "favorite",
|
|
5794
|
+
pinned: "pin",
|
|
5795
|
+
is_pinned: "pin"
|
|
5796
|
+
};
|
|
5797
|
+
function resolveColumnMarker(column) {
|
|
5798
|
+
if (column.marker === false) return void 0;
|
|
5799
|
+
if (column.marker) return column.marker;
|
|
5800
|
+
return column.accessorKey ? MARKER_ACCESSORS[column.accessorKey] : void 0;
|
|
5801
|
+
}
|
|
5802
|
+
function markerCopy(marker) {
|
|
5803
|
+
return marker === "favorite" ? {
|
|
5804
|
+
label: "Favorites",
|
|
5805
|
+
lowerLabel: "favorites",
|
|
5806
|
+
onlyLabel: "Favorites only",
|
|
5807
|
+
notLabel: "Not favorites"
|
|
5808
|
+
} : {
|
|
5809
|
+
label: "Pins",
|
|
5810
|
+
lowerLabel: "pins",
|
|
5811
|
+
onlyLabel: "Pins only",
|
|
5812
|
+
notLabel: "Not pinned"
|
|
5813
|
+
};
|
|
5814
|
+
}
|
|
5815
|
+
|
|
5786
5816
|
// src/data-table/ColumnHeaderCell.tsx
|
|
5787
5817
|
import { Fragment as Fragment4, jsx as jsx31, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5788
5818
|
var HeaderButton = forwardRef12(({ dragDescription, "aria-describedby": tooltipDescription, ...props }, ref) => {
|
|
@@ -5815,6 +5845,7 @@ function ColumnHeaderCell({
|
|
|
5815
5845
|
align = "left",
|
|
5816
5846
|
className,
|
|
5817
5847
|
compact = false,
|
|
5848
|
+
marker,
|
|
5818
5849
|
filterApplyLabel,
|
|
5819
5850
|
filterShowCancel = false,
|
|
5820
5851
|
filterFooterHint,
|
|
@@ -5866,7 +5897,9 @@ function ColumnHeaderCell({
|
|
|
5866
5897
|
if (deferredFilter) setDraftFilter(next);
|
|
5867
5898
|
else onFilterChange(next);
|
|
5868
5899
|
};
|
|
5869
|
-
const
|
|
5900
|
+
const markerLabels = marker ? markerCopy(marker) : void 0;
|
|
5901
|
+
const accessibleLabel = markerLabels?.label ?? labelText;
|
|
5902
|
+
const menuLabel = accessibleLabel ? `Sort or filter ${accessibleLabel}` : "Sort or filter column";
|
|
5870
5903
|
const menuContent = /* @__PURE__ */ jsxs22(
|
|
5871
5904
|
PopoverContent,
|
|
5872
5905
|
{
|
|
@@ -5895,7 +5928,7 @@ function ColumnHeaderCell({
|
|
|
5895
5928
|
onClick: onSortAsc,
|
|
5896
5929
|
children: [
|
|
5897
5930
|
/* @__PURE__ */ jsx31(ArrowUp, { className: "h-3.5 w-3.5" }),
|
|
5898
|
-
"Sort ascending"
|
|
5931
|
+
markerLabels ? `${markerLabels.label} last` : "Sort ascending"
|
|
5899
5932
|
]
|
|
5900
5933
|
}
|
|
5901
5934
|
),
|
|
@@ -5908,7 +5941,7 @@ function ColumnHeaderCell({
|
|
|
5908
5941
|
onClick: onSortDesc,
|
|
5909
5942
|
children: [
|
|
5910
5943
|
/* @__PURE__ */ jsx31(ArrowDown, { className: "h-3.5 w-3.5" }),
|
|
5911
|
-
"Sort descending"
|
|
5944
|
+
markerLabels ? `${markerLabels.label} first` : "Sort descending"
|
|
5912
5945
|
]
|
|
5913
5946
|
}
|
|
5914
5947
|
),
|
|
@@ -5921,7 +5954,7 @@ function ColumnHeaderCell({
|
|
|
5921
5954
|
onClick: onClearSort,
|
|
5922
5955
|
children: [
|
|
5923
5956
|
/* @__PURE__ */ jsx31(ListX, { className: "h-3.5 w-3.5" }),
|
|
5924
|
-
"Clear sort"
|
|
5957
|
+
markerLabels ? `Clear ${markerLabels.lowerLabel} sort` : "Clear sort"
|
|
5925
5958
|
]
|
|
5926
5959
|
}
|
|
5927
5960
|
) : null
|
|
@@ -5940,6 +5973,13 @@ function ColumnHeaderCell({
|
|
|
5940
5973
|
},
|
|
5941
5974
|
selectOptions,
|
|
5942
5975
|
selectSingle,
|
|
5976
|
+
...markerLabels ? {
|
|
5977
|
+
booleanLabels: {
|
|
5978
|
+
all: "All",
|
|
5979
|
+
true: markerLabels.onlyLabel,
|
|
5980
|
+
false: markerLabels.notLabel
|
|
5981
|
+
}
|
|
5982
|
+
} : {},
|
|
5943
5983
|
allowNullModes
|
|
5944
5984
|
}
|
|
5945
5985
|
) : null,
|
|
@@ -6155,7 +6195,8 @@ function FilterBody({
|
|
|
6155
6195
|
onChange,
|
|
6156
6196
|
selectOptions,
|
|
6157
6197
|
selectSingle = false,
|
|
6158
|
-
allowNullModes = false
|
|
6198
|
+
allowNullModes = false,
|
|
6199
|
+
booleanLabels
|
|
6159
6200
|
}) {
|
|
6160
6201
|
if (kind === "text") {
|
|
6161
6202
|
const text = value?.kind === "text" ? value.value : "";
|
|
@@ -6242,9 +6283,9 @@ function FilterBody({
|
|
|
6242
6283
|
children: [
|
|
6243
6284
|
/* @__PURE__ */ jsx31(SelectTrigger, { className: "h-8 text-xs", children: /* @__PURE__ */ jsx31(SelectValue, {}) }),
|
|
6244
6285
|
/* @__PURE__ */ jsxs22(SelectContent, { children: [
|
|
6245
|
-
/* @__PURE__ */ jsx31(SelectItem, { value: "__all__", children: "All" }),
|
|
6246
|
-
/* @__PURE__ */ jsx31(SelectItem, { value: "true", children: "Yes" }),
|
|
6247
|
-
/* @__PURE__ */ jsx31(SelectItem, { value: "false", children: "No" })
|
|
6286
|
+
/* @__PURE__ */ jsx31(SelectItem, { value: "__all__", children: booleanLabels?.all ?? "All" }),
|
|
6287
|
+
/* @__PURE__ */ jsx31(SelectItem, { value: "true", children: booleanLabels?.true ?? "Yes" }),
|
|
6288
|
+
/* @__PURE__ */ jsx31(SelectItem, { value: "false", children: booleanLabels?.false ?? "No" })
|
|
6248
6289
|
] })
|
|
6249
6290
|
]
|
|
6250
6291
|
}
|
|
@@ -8353,6 +8394,7 @@ var SELECT_CARDINALITY_CAP = 24;
|
|
|
8353
8394
|
function resolveFilterKind(col, sampleRows) {
|
|
8354
8395
|
if (col.filter === false) return null;
|
|
8355
8396
|
if (col.filter && col.filter !== "auto") return col.filter;
|
|
8397
|
+
if (resolveColumnMarker(col)) return "boolean";
|
|
8356
8398
|
const values = sampleRows.slice(0, 200).map((row) => getCellValue(row, col)).filter((v) => v != null);
|
|
8357
8399
|
if (values.length === 0) return "text";
|
|
8358
8400
|
if (values.every((v) => typeof v === "boolean")) return "boolean";
|
|
@@ -8418,6 +8460,9 @@ function resolveQueryFilterMeta(column, rows, controlled) {
|
|
|
8418
8460
|
};
|
|
8419
8461
|
}
|
|
8420
8462
|
if (column.filter === false) return { kind: null, options: [] };
|
|
8463
|
+
if (resolveColumnMarker(column) && (column.filter === void 0 || column.filter === "auto")) {
|
|
8464
|
+
return { kind: "boolean", options: [] };
|
|
8465
|
+
}
|
|
8421
8466
|
const declared = column.filter;
|
|
8422
8467
|
const kind = declared && declared !== "auto" ? declared : column.filterOptions?.length ? "select" : "text";
|
|
8423
8468
|
return {
|
|
@@ -10659,6 +10704,10 @@ function MatrxDataTableCore({
|
|
|
10659
10704
|
const defaultSortDirection = col.defaultSortDirection ?? "asc";
|
|
10660
10705
|
const isColumnDragShadow = columnDragPreview?.draggedId === id && columnDragPreview.targetId !== null;
|
|
10661
10706
|
const columnResizable = resizableColumns && col.resizable !== false;
|
|
10707
|
+
const marker = resolveColumnMarker(col);
|
|
10708
|
+
const compact = col.compact || marker !== void 0;
|
|
10709
|
+
const width = marker && col.width === void 0 ? 40 : col.width;
|
|
10710
|
+
const minWidth = marker && col.minWidth === void 0 ? 40 : col.minWidth;
|
|
10662
10711
|
return /* @__PURE__ */ jsxs31(
|
|
10663
10712
|
"th",
|
|
10664
10713
|
{
|
|
@@ -10670,7 +10719,7 @@ function MatrxDataTableCore({
|
|
|
10670
10719
|
// ICON COLUMN (MatrxColumnDef.compact): a 40px star
|
|
10671
10720
|
// column cannot honor `width: 40` while paying 16px of
|
|
10672
10721
|
// padding for a 14px glyph.
|
|
10673
|
-
|
|
10722
|
+
compact ? "px-1" : "px-2",
|
|
10674
10723
|
// An intentional mobile column set (see
|
|
10675
10724
|
// MatrxColumnDef.mobileHidden). CSS, not a JS
|
|
10676
10725
|
// breakpoint — no hydration mismatch, and the column
|
|
@@ -10681,13 +10730,13 @@ function MatrxDataTableCore({
|
|
|
10681
10730
|
// it, a crowded table crushes a declared 190px column to a
|
|
10682
10731
|
// few characters wide instead of using the canonical
|
|
10683
10732
|
// horizontal-scroll surface.
|
|
10684
|
-
(
|
|
10733
|
+
(width !== void 0 || columnResizable) && "sm:w-[var(--matrx-col-w)] sm:min-w-[var(--matrx-col-w)]",
|
|
10685
10734
|
col.headerClassName,
|
|
10686
10735
|
isColumnDragShadow && "bg-primary/10 shadow-[inset_2px_0_0_var(--primary),inset_-2px_0_0_var(--primary)]",
|
|
10687
10736
|
col.align === "center" && "text-center",
|
|
10688
10737
|
col.align === "right" && "text-right"
|
|
10689
10738
|
),
|
|
10690
|
-
style: columnWidthVar(
|
|
10739
|
+
style: columnWidthVar(width, effectiveColumnWidths[id], id, columnResizable),
|
|
10691
10740
|
children: [
|
|
10692
10741
|
/* @__PURE__ */ jsx41(ColumnHeaderDropZone, { id, enabled: reorderableColumns, children: /* @__PURE__ */ jsx41(
|
|
10693
10742
|
ColumnHeaderCell,
|
|
@@ -10722,7 +10771,8 @@ function MatrxDataTableCore({
|
|
|
10722
10771
|
allowNegation: filterUi?.allowNegation,
|
|
10723
10772
|
allowNullModes: filterUi?.allowNullModes,
|
|
10724
10773
|
align: col.align,
|
|
10725
|
-
compact
|
|
10774
|
+
compact,
|
|
10775
|
+
marker,
|
|
10726
10776
|
reorderColumn: reorderableColumns ? { id, label: headerLabel } : void 0
|
|
10727
10777
|
}
|
|
10728
10778
|
) }),
|
|
@@ -10732,12 +10782,12 @@ function MatrxDataTableCore({
|
|
|
10732
10782
|
columnId: id,
|
|
10733
10783
|
label: headerLabel,
|
|
10734
10784
|
tableRef,
|
|
10735
|
-
minWidth
|
|
10785
|
+
minWidth,
|
|
10736
10786
|
maxWidth: col.maxWidth,
|
|
10737
10787
|
onResizeStart: captureResizeGestureSnapshot,
|
|
10738
10788
|
onResizeCancel: clearResizeGestureSnapshot,
|
|
10739
|
-
onResizeCommit: (columnId2,
|
|
10740
|
-
{ ...effectiveColumnWidths, [columnId2]:
|
|
10789
|
+
onResizeCommit: (columnId2, width2) => commitColumnWidths(
|
|
10790
|
+
{ ...effectiveColumnWidths, [columnId2]: width2 },
|
|
10741
10791
|
true
|
|
10742
10792
|
)
|
|
10743
10793
|
}
|
|
@@ -10767,7 +10817,7 @@ function MatrxDataTableCore({
|
|
|
10767
10817
|
{
|
|
10768
10818
|
className: cn(
|
|
10769
10819
|
"py-2",
|
|
10770
|
-
col.compact ? "px-1" : "px-2",
|
|
10820
|
+
col.compact || resolveColumnMarker(col) !== void 0 ? "px-1" : "px-2",
|
|
10771
10821
|
col.mobileHidden && "max-sm:hidden"
|
|
10772
10822
|
),
|
|
10773
10823
|
children: /* @__PURE__ */ jsx41(Skeleton, { className: "h-5 w-full" })
|
|
@@ -10853,19 +10903,19 @@ function MatrxDataTableCore({
|
|
|
10853
10903
|
"data-matrx-column-drag-shadow": isColumnDragShadow ? "true" : void 0,
|
|
10854
10904
|
className: cn(
|
|
10855
10905
|
"py-1.5 align-middle lg:py-0.5",
|
|
10856
|
-
col.compact ? "px-1" : "px-2",
|
|
10906
|
+
col.compact || resolveColumnMarker(col) !== void 0 ? "px-1" : "px-2",
|
|
10857
10907
|
// nowrap (NOT truncate — truncate clips the cell and
|
|
10858
10908
|
// defeats w-max, killing the horizontal scroll).
|
|
10859
10909
|
"max-sm:whitespace-nowrap",
|
|
10860
10910
|
col.mobileHidden && "max-sm:hidden",
|
|
10861
|
-
(col.width !== void 0 || resizableColumns && col.resizable !== false) && "sm:w-[var(--matrx-col-w)] sm:min-w-[var(--matrx-col-w)] sm:max-w-[var(--matrx-col-w)]",
|
|
10911
|
+
((resolveColumnMarker(col) && col.width === void 0 ? 40 : col.width) !== void 0 || resizableColumns && col.resizable !== false) && "sm:w-[var(--matrx-col-w)] sm:min-w-[var(--matrx-col-w)] sm:max-w-[var(--matrx-col-w)]",
|
|
10862
10912
|
col.className,
|
|
10863
10913
|
isColumnDragShadow && "bg-primary/10 shadow-[inset_2px_0_0_var(--primary),inset_-2px_0_0_var(--primary)]",
|
|
10864
10914
|
col.align === "center" && "text-center",
|
|
10865
10915
|
col.align === "right" && "text-right"
|
|
10866
10916
|
),
|
|
10867
10917
|
style: columnWidthVar(
|
|
10868
|
-
col.width,
|
|
10918
|
+
resolveColumnMarker(col) && col.width === void 0 ? 40 : col.width,
|
|
10869
10919
|
effectiveColumnWidths[columnId(col)],
|
|
10870
10920
|
columnId(col),
|
|
10871
10921
|
resizableColumns && col.resizable !== false
|
|
@@ -10997,13 +11047,13 @@ function MatrxDataTableCore({
|
|
|
10997
11047
|
{
|
|
10998
11048
|
className: cn(
|
|
10999
11049
|
"px-2 py-2 align-middle",
|
|
11000
|
-
column.compact && "px-1",
|
|
11050
|
+
(column.compact || resolveColumnMarker(column) !== void 0) && "px-1",
|
|
11001
11051
|
column.className,
|
|
11002
11052
|
column.align === "center" && "text-center",
|
|
11003
11053
|
column.align === "right" && "text-right"
|
|
11004
11054
|
),
|
|
11005
11055
|
style: columnWidthVar(
|
|
11006
|
-
column.width,
|
|
11056
|
+
resolveColumnMarker(column) && column.width === void 0 ? 40 : column.width,
|
|
11007
11057
|
effectiveColumnWidths[columnId(column)],
|
|
11008
11058
|
columnId(column),
|
|
11009
11059
|
resizableColumns && column.resizable !== false
|
|
@@ -11595,7 +11645,11 @@ function normalizeColumnWidthsForColumns(widths, columns) {
|
|
|
11595
11645
|
return Object.fromEntries(
|
|
11596
11646
|
Object.entries(normalized).map(([id, width]) => {
|
|
11597
11647
|
const column = byId.get(id);
|
|
11598
|
-
const
|
|
11648
|
+
const marker = column ? resolveColumnMarker(column) : void 0;
|
|
11649
|
+
const bounds = resolveColumnResizeBounds(
|
|
11650
|
+
marker && column?.minWidth === void 0 ? 40 : column?.minWidth,
|
|
11651
|
+
column?.maxWidth
|
|
11652
|
+
);
|
|
11599
11653
|
return [id, clampColumnWidth(width, bounds)];
|
|
11600
11654
|
})
|
|
11601
11655
|
);
|
|
@@ -11629,6 +11683,28 @@ function DefaultJsonCell({ value }) {
|
|
|
11629
11683
|
/* @__PURE__ */ jsx41(DataRowWindow, { isOpen: open, onClose: () => setOpen(false), title: "JSON value", row: value, viewContent: Viewer ? /* @__PURE__ */ jsx41(Viewer, { data: value }) : /* @__PURE__ */ jsx41("pre", { className: "overflow-auto whitespace-pre-wrap p-3 text-xs", children: text }) })
|
|
11630
11684
|
] });
|
|
11631
11685
|
}
|
|
11686
|
+
function DefaultMarkerCell({
|
|
11687
|
+
marker,
|
|
11688
|
+
value
|
|
11689
|
+
}) {
|
|
11690
|
+
const label = marker === "favorite" ? value ? "Favorite" : "Not favorite" : value ? "Pinned" : "Not pinned";
|
|
11691
|
+
const Icon3 = marker === "favorite" ? Star : Pin;
|
|
11692
|
+
return /* @__PURE__ */ jsxs31(Tooltip, { children: [
|
|
11693
|
+
/* @__PURE__ */ jsx41(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx41(
|
|
11694
|
+
"span",
|
|
11695
|
+
{
|
|
11696
|
+
role: "img",
|
|
11697
|
+
"aria-label": label,
|
|
11698
|
+
className: cn(
|
|
11699
|
+
"inline-flex size-5 items-center justify-center",
|
|
11700
|
+
value ? "text-amber-500" : "text-muted-foreground/45"
|
|
11701
|
+
),
|
|
11702
|
+
children: /* @__PURE__ */ jsx41(Icon3, { className: "size-4", ...value ? { fill: "currentColor" } : {} })
|
|
11703
|
+
}
|
|
11704
|
+
) }),
|
|
11705
|
+
/* @__PURE__ */ jsx41(TooltipContent, { children: label })
|
|
11706
|
+
] });
|
|
11707
|
+
}
|
|
11632
11708
|
function renderCell(row, col, index) {
|
|
11633
11709
|
if (col.cell) return col.cell(row, index);
|
|
11634
11710
|
const raw = getCellValue(row, col);
|
|
@@ -11651,6 +11727,8 @@ function renderCell(row, col, index) {
|
|
|
11651
11727
|
}
|
|
11652
11728
|
if (raw !== null && typeof raw === "object" && !(raw instanceof Date)) return /* @__PURE__ */ jsx41(DefaultJsonCell, { value: raw });
|
|
11653
11729
|
if (typeof raw === "boolean") {
|
|
11730
|
+
const marker = resolveColumnMarker(col);
|
|
11731
|
+
if (marker) return /* @__PURE__ */ jsx41(DefaultMarkerCell, { marker, value: raw });
|
|
11654
11732
|
return /* @__PURE__ */ jsx41("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" });
|
|
11655
11733
|
}
|
|
11656
11734
|
const formatted = formatTableDisplayValue(raw);
|
|
@@ -11959,6 +12037,7 @@ export {
|
|
|
11959
12037
|
downloadTableAsXlsx,
|
|
11960
12038
|
filterKindLabel,
|
|
11961
12039
|
parseTableViewSnapshot,
|
|
12040
|
+
resolveColumnMarker,
|
|
11962
12041
|
resolveFilterKind,
|
|
11963
12042
|
rowsToCsvFromColumns,
|
|
11964
12043
|
rowsToMarkdownTable,
|