@ai-matrx/design-system 0.19.8 → 0.19.10
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 +16 -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.cjs.map +1 -1
- package/dist/data-table/host.d.cts +3 -2
- package/dist/data-table/host.d.ts +3 -2
- package/dist/data-table/host.js.map +1 -1
- package/dist/data-table/index.cjs +78 -28
- 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 +78 -28
- 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/pagination.cjs +2 -1
- package/dist/data-table/pagination.cjs.map +1 -1
- package/dist/data-table/pagination.js +2 -1
- package/dist/data-table/pagination.js.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/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/tap-target.css +95 -10
- package/dist/{types-BcIcmIxd.d.cts → types-DqlfNcC5.d.cts} +4 -1
- package/dist/{types-xTXSqmR7.d.ts → types-lNw7TnTM.d.ts} +4 -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 {
|
|
4
|
-
export { A as AnyOfColumnSearch,
|
|
3
|
+
import { g as MatrxDataTableProps, h as TableViewSnapshot } from '../types-DqlfNcC5.cjs';
|
|
4
|
+
export { A as AnyOfColumnSearch, i as CellEditType, j as CellEditsMap, e as ColumnFilterKind, a as ColumnFilterValue, C as ColumnFiltersState, M as MatrxColumnDef, f as MatrxDataTableCopyConfig, c as MatrxDataTableDensity, k as MatrxDataTableDetailConfig, l as MatrxDataTableEditConfig, m as MatrxDataTableEmptyState, n as MatrxDataTableFilterUi, o as MatrxDataTableHierarchyConfig, p as MatrxDataTableHierarchyMove, q as MatrxDataTableMobileCardControls, r as MatrxDataTableQueryControl, d as MatrxDataTableQueryState, s as MatrxDataTableRecordControls, t as MatrxDataTableSelectionConfig, u as MatrxDataTableSourceProcessing, v as MatrxDataTableToolbar, w as MatrxDataTableUrlStateConfig, x as MatrxDataTableWindowConfig, y as MatrxTablePagination, z as SortDirection, S as SortState, b as TableSavedViewsProps, T as TableSearchMatchMode, B as TableViewQuery, D as TextFilterMode, E as ToolbarFacet } from '../types-DqlfNcC5.cjs';
|
|
5
5
|
export { MatrxDataTableHost, MatrxDataTableProvider, TableDoors, TableEntityRefProps, TableLinkProps, TablePeekProps, TableSidePanelProps, TableToolbarActionProps, TableWindowPanelProps, useMatrxDataTableHost } from './host.cjs';
|
|
6
6
|
export { DataRowInspector } from './data-row-inspector.cjs';
|
|
7
7
|
export { DataRowWindow, DataRowWindowProps, DataRowWindowTab } from './data-row-window.cjs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
export { A as AnyOfColumnSearch,
|
|
3
|
+
import { g as MatrxDataTableProps, h as TableViewSnapshot } from '../types-lNw7TnTM.js';
|
|
4
|
+
export { A as AnyOfColumnSearch, i as CellEditType, j as CellEditsMap, e as ColumnFilterKind, a as ColumnFilterValue, C as ColumnFiltersState, M as MatrxColumnDef, f as MatrxDataTableCopyConfig, c as MatrxDataTableDensity, k as MatrxDataTableDetailConfig, l as MatrxDataTableEditConfig, m as MatrxDataTableEmptyState, n as MatrxDataTableFilterUi, o as MatrxDataTableHierarchyConfig, p as MatrxDataTableHierarchyMove, q as MatrxDataTableMobileCardControls, r as MatrxDataTableQueryControl, d as MatrxDataTableQueryState, s as MatrxDataTableRecordControls, t as MatrxDataTableSelectionConfig, u as MatrxDataTableSourceProcessing, v as MatrxDataTableToolbar, w as MatrxDataTableUrlStateConfig, x as MatrxDataTableWindowConfig, y as MatrxTablePagination, z as SortDirection, S as SortState, b as TableSavedViewsProps, T as TableSearchMatchMode, B as TableViewQuery, D as TextFilterMode, E as ToolbarFacet } from '../types-lNw7TnTM.js';
|
|
5
5
|
export { MatrxDataTableHost, MatrxDataTableProvider, TableDoors, TableEntityRefProps, TableLinkProps, TablePeekProps, TableSidePanelProps, TableToolbarActionProps, TableWindowPanelProps, useMatrxDataTableHost } from './host.js';
|
|
6
6
|
export { DataRowInspector } from './data-row-inspector.js';
|
|
7
7
|
export { DataRowWindow, DataRowWindowProps, DataRowWindowTab } from './data-row-window.js';
|
package/dist/data-table/index.js
CHANGED
|
@@ -1844,7 +1844,7 @@ function PaginationAction({
|
|
|
1844
1844
|
...props
|
|
1845
1845
|
}) {
|
|
1846
1846
|
if (HostAction) {
|
|
1847
|
-
return /* @__PURE__ */ jsx20("span", { className: visibilityClassName, children: /* @__PURE__ */ jsx20(
|
|
1847
|
+
return /* @__PURE__ */ jsx20("span", { "data-matrx-table-icon-action": true, className: visibilityClassName, children: /* @__PURE__ */ jsx20(
|
|
1848
1848
|
HostAction,
|
|
1849
1849
|
{
|
|
1850
1850
|
...props,
|
|
@@ -1869,6 +1869,7 @@ function PaginationAction({
|
|
|
1869
1869
|
fallbackClassName
|
|
1870
1870
|
),
|
|
1871
1871
|
"aria-current": active ? "page" : void 0,
|
|
1872
|
+
"data-matrx-table-icon-action": true,
|
|
1872
1873
|
children: props.children
|
|
1873
1874
|
}
|
|
1874
1875
|
);
|
|
@@ -7912,10 +7913,10 @@ function TableToolbarAction({
|
|
|
7912
7913
|
children
|
|
7913
7914
|
}) {
|
|
7914
7915
|
if (HostAction) {
|
|
7915
|
-
return /* @__PURE__ */ jsx38(HostAction, { ariaLabel, tooltip, disabled, busy, onClick, children });
|
|
7916
|
+
return /* @__PURE__ */ jsx38("span", { "data-matrx-table-toolbar-action": true, children: /* @__PURE__ */ jsx38(HostAction, { ariaLabel, tooltip, disabled, busy, onClick, children }) });
|
|
7916
7917
|
}
|
|
7917
7918
|
return /* @__PURE__ */ jsxs28(Tooltip, { children: [
|
|
7918
|
-
/* @__PURE__ */ jsx38(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx38("span", { className: "inline-flex", children: /* @__PURE__ */ jsx38(Button, { type: "button", variant: "ghost", size: "icon", className: "h-11 w-11 [&_svg]:size-5", "aria-label": ariaLabel, "aria-busy": busy || void 0, disabled, onClick, children: isValidElement2(children) ? cloneElement2(children, { className: cn("h-5 w-5", children.props.className) }) : children }) }) }),
|
|
7919
|
+
/* @__PURE__ */ jsx38(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx38("span", { "data-matrx-table-toolbar-action": true, className: "inline-flex", children: /* @__PURE__ */ jsx38(Button, { type: "button", variant: "ghost", size: "icon", className: "h-11 w-11 [&_svg]:size-5", "aria-label": ariaLabel, "aria-busy": busy || void 0, disabled, onClick, children: isValidElement2(children) ? cloneElement2(children, { className: cn("h-5 w-5", children.props.className) }) : children }) }) }),
|
|
7919
7920
|
/* @__PURE__ */ jsx38(TooltipContent, { children: tooltip ?? ariaLabel })
|
|
7920
7921
|
] });
|
|
7921
7922
|
}
|
|
@@ -8086,7 +8087,8 @@ function MatrxDataTableCore({
|
|
|
8086
8087
|
tableClassName,
|
|
8087
8088
|
mobileCards,
|
|
8088
8089
|
mobileCardsBreakpoint = "sm",
|
|
8089
|
-
onRowOpen
|
|
8090
|
+
onRowOpen,
|
|
8091
|
+
density
|
|
8090
8092
|
}) {
|
|
8091
8093
|
const appendQuery = query?.mode === "controlled-append" ? query : null;
|
|
8092
8094
|
const appendQueryKey = appendQuery?.pagination.queryKey ?? null;
|
|
@@ -8096,6 +8098,7 @@ function MatrxDataTableCore({
|
|
|
8096
8098
|
const isLoading = appendQuery ? appendQuery.pagination.loading : suppliedLoading;
|
|
8097
8099
|
const isFetching = appendQuery ? appendQuery.pagination.isFetchingNextPage : suppliedFetching;
|
|
8098
8100
|
const host = useMatrxDataTableHost();
|
|
8101
|
+
const resolvedDensity = density ?? host.defaultDensity ?? "normal";
|
|
8099
8102
|
const SavedViews = host.SavedViews;
|
|
8100
8103
|
const Link = host.Link ?? DefaultTableLink;
|
|
8101
8104
|
const SidePanelSurface = host.SidePanelSurface ?? DefaultTableSidePanel;
|
|
@@ -8104,7 +8107,7 @@ function MatrxDataTableCore({
|
|
|
8104
8107
|
const [toolbarActionError, setToolbarActionError] = useState18(null);
|
|
8105
8108
|
const [toolbarActionPending, setToolbarActionPending] = useState18({ refresh: false, add: false });
|
|
8106
8109
|
const toolbarActionPendingRef = useRef9({ refresh: false, add: false });
|
|
8107
|
-
const CHECKBOX_TAP_AREA = "
|
|
8110
|
+
const CHECKBOX_TAP_AREA = "h-4 w-4 touch-manipulation";
|
|
8108
8111
|
const mobileCardsClass = mobileCardsBreakpoint === "lg" ? "lg:hidden" : "sm:hidden";
|
|
8109
8112
|
const tableWithCardsClass = mobileCardsBreakpoint === "lg" ? "max-lg:hidden" : "max-sm:hidden";
|
|
8110
8113
|
const controlledQuery = query?.mode === "controlled" || query?.mode === "controlled-local" || query?.mode === "controlled-append" ? query : null;
|
|
@@ -8525,13 +8528,23 @@ function MatrxDataTableCore({
|
|
|
8525
8528
|
0
|
|
8526
8529
|
);
|
|
8527
8530
|
const selectionWidth = widthFor("th[data-matrx-table-selection-column]");
|
|
8528
|
-
const
|
|
8531
|
+
const headerActionsWidth = widthFor("th[data-matrx-table-actions-column]");
|
|
8532
|
+
const visibleActionStrips = Array.from(
|
|
8533
|
+
table?.querySelectorAll("[data-matrx-table-row-actions]") ?? []
|
|
8534
|
+
).filter(
|
|
8535
|
+
(element) => element.closest("table") === table && element.getClientRects().length > 0
|
|
8536
|
+
);
|
|
8537
|
+
const actionContentWidth = Math.max(
|
|
8538
|
+
0,
|
|
8539
|
+
...visibleActionStrips.map((element) => Math.ceil(element.scrollWidth))
|
|
8540
|
+
);
|
|
8541
|
+
const actionsWidth = actionContentWidth || headerActionsWidth;
|
|
8529
8542
|
return {
|
|
8530
8543
|
...headerTotal > 0 ? { tableWidth: Math.ceil(headerTotal) } : {},
|
|
8531
8544
|
...selectionWidth === void 0 ? {} : { selectionWidth },
|
|
8532
8545
|
...actionsWidth === void 0 ? {} : { actionsWidth }
|
|
8533
8546
|
};
|
|
8534
|
-
}, []);
|
|
8547
|
+
}, [resolvedDensity]);
|
|
8535
8548
|
const captureResizeGestureSnapshot = useCallback5(() => {
|
|
8536
8549
|
resizeGestureSnapshotRef.current = {
|
|
8537
8550
|
widths: measureVisibleColumnWidths(),
|
|
@@ -8602,6 +8615,27 @@ function MatrxDataTableCore({
|
|
|
8602
8615
|
}
|
|
8603
8616
|
if (fixedTableGeometry === null) setFixedTableGeometry(measureFixedTableGeometry());
|
|
8604
8617
|
}, [fixedTableGeometry, measureFixedTableGeometry, usesMeasuredFixedLayout]);
|
|
8618
|
+
useLayoutEffect(() => {
|
|
8619
|
+
if (!usesMeasuredFixedLayout) return;
|
|
8620
|
+
const table = tableRef.current;
|
|
8621
|
+
if (!table) return;
|
|
8622
|
+
const utilityHeaders = Array.from(table.querySelectorAll(
|
|
8623
|
+
"th[data-matrx-table-selection-column], th[data-matrx-table-actions-column]"
|
|
8624
|
+
));
|
|
8625
|
+
const utilityStyles = utilityHeaders.map((header) => header.getAttribute("style"));
|
|
8626
|
+
const resizedWidth = table.style.getPropertyValue("--matrx-resized-table-width");
|
|
8627
|
+
for (const header of utilityHeaders) header.removeAttribute("style");
|
|
8628
|
+
table.style.removeProperty("--matrx-resized-table-width");
|
|
8629
|
+
void table.getBoundingClientRect();
|
|
8630
|
+
const geometry = measureFixedTableGeometry();
|
|
8631
|
+
utilityHeaders.forEach((header, index) => {
|
|
8632
|
+
const style = utilityStyles[index];
|
|
8633
|
+
if (style == null) header.removeAttribute("style");
|
|
8634
|
+
else header.setAttribute("style", style);
|
|
8635
|
+
});
|
|
8636
|
+
table.style.setProperty("--matrx-resized-table-width", resizedWidth);
|
|
8637
|
+
setFixedTableGeometry(geometry);
|
|
8638
|
+
}, [resolvedDensity, measureFixedTableGeometry, usesMeasuredFixedLayout]);
|
|
8605
8639
|
const fixedLayoutActive = usesMeasuredFixedLayout && fixedTableGeometry !== null;
|
|
8606
8640
|
const declaredVisibleCopyColumns = useMemo6(
|
|
8607
8641
|
() => visibleColumns.filter((column) => column.accessorFn !== void 0 || column.accessorKey !== void 0),
|
|
@@ -9407,16 +9441,10 @@ function MatrxDataTableCore({
|
|
|
9407
9441
|
{
|
|
9408
9442
|
ref: setDiagnosticBoundaryRef,
|
|
9409
9443
|
"data-matrx-table": true,
|
|
9444
|
+
"data-matrx-table-density": resolvedDensity,
|
|
9410
9445
|
"data-url-state-table": urlState?.id,
|
|
9411
9446
|
className: cn(
|
|
9412
|
-
|
|
9413
|
-
// switches. Radix renders those as `<button role="checkbox">`, so the
|
|
9414
|
-
// blanket `[&_button]` rule inflated a 14px checkbox into a 44×44
|
|
9415
|
-
// bordered empty box — measured on Search Console → Queries at 375px,
|
|
9416
|
-
// where every row read as an empty text input rather than a selection
|
|
9417
|
-
// control. The control keeps its own size and gains the 44px tap area
|
|
9418
|
-
// as an invisible ::before below.
|
|
9419
|
-
"flex h-full min-h-0 flex-col gap-2 px-0 py-2 max-lg:[&_button:not([role=checkbox]):not([role=radio]):not([role=switch])]:min-h-11 max-lg:[&_button:not([role=checkbox]):not([role=radio]):not([role=switch])]:min-w-11 max-lg:[&_input]:min-h-11 max-lg:[&_table_a]:inline-flex max-lg:[&_table_a]:min-h-11 max-lg:[&_table_a]:items-center",
|
|
9447
|
+
"flex h-full min-h-0 flex-col gap-2 px-0 py-2",
|
|
9420
9448
|
className
|
|
9421
9449
|
),
|
|
9422
9450
|
children: [
|
|
@@ -9428,7 +9456,7 @@ function MatrxDataTableCore({
|
|
|
9428
9456
|
TableTitleRow,
|
|
9429
9457
|
{
|
|
9430
9458
|
...toolbar?.title === void 0 ? {} : { title: toolbar.title },
|
|
9431
|
-
context: tableId && SavedViews ? /* @__PURE__ */ jsx38(
|
|
9459
|
+
context: tableId && SavedViews ? /* @__PURE__ */ jsx38("span", { "data-matrx-table-view-control": true, children: /* @__PURE__ */ jsx38(
|
|
9432
9460
|
SavedViews,
|
|
9433
9461
|
{
|
|
9434
9462
|
tableId,
|
|
@@ -9436,7 +9464,7 @@ function MatrxDataTableCore({
|
|
|
9436
9464
|
defaultSnapshot: declaredDefaultViewSnapshot,
|
|
9437
9465
|
onApply: applySavedView
|
|
9438
9466
|
}
|
|
9439
|
-
) : void 0,
|
|
9467
|
+
) }) : void 0,
|
|
9440
9468
|
search: showSearch ? intelligentSearchEnabled ? /* @__PURE__ */ jsx38(
|
|
9441
9469
|
TableSearch,
|
|
9442
9470
|
{
|
|
@@ -9918,13 +9946,24 @@ function MatrxDataTableCore({
|
|
|
9918
9946
|
className: "h-9 w-9 px-2 text-left align-middle",
|
|
9919
9947
|
style: fixedUtilityWidth(fixedTableGeometry?.selectionWidth),
|
|
9920
9948
|
children: /* @__PURE__ */ jsx38(
|
|
9921
|
-
|
|
9949
|
+
"div",
|
|
9922
9950
|
{
|
|
9923
|
-
|
|
9924
|
-
|
|
9925
|
-
|
|
9926
|
-
|
|
9927
|
-
|
|
9951
|
+
"data-matrx-table-selection-target": true,
|
|
9952
|
+
onClick: (event) => {
|
|
9953
|
+
if (event.target === event.currentTarget) {
|
|
9954
|
+
event.currentTarget.querySelector('[role="checkbox"]')?.click();
|
|
9955
|
+
}
|
|
9956
|
+
},
|
|
9957
|
+
children: /* @__PURE__ */ jsx38(
|
|
9958
|
+
Checkbox,
|
|
9959
|
+
{
|
|
9960
|
+
className: CHECKBOX_TAP_AREA,
|
|
9961
|
+
checked: allOnPageSelected ? true : someOnPageSelected ? "indeterminate" : false,
|
|
9962
|
+
disabled: selectableRows.length === 0,
|
|
9963
|
+
onCheckedChange: toggleAllOnPage,
|
|
9964
|
+
"aria-label": allOnPageSelected ? "Clear selection on this page" : "Select every row on this page"
|
|
9965
|
+
}
|
|
9966
|
+
)
|
|
9928
9967
|
}
|
|
9929
9968
|
)
|
|
9930
9969
|
}
|
|
@@ -10099,12 +10138,23 @@ function MatrxDataTableCore({
|
|
|
10099
10138
|
style: fixedUtilityWidth(fixedTableGeometry?.selectionWidth),
|
|
10100
10139
|
onClick: (e) => e.stopPropagation(),
|
|
10101
10140
|
children: selection.isRowSelectable?.(row) ?? true ? /* @__PURE__ */ jsx38(
|
|
10102
|
-
|
|
10141
|
+
"div",
|
|
10103
10142
|
{
|
|
10104
|
-
|
|
10105
|
-
|
|
10106
|
-
|
|
10107
|
-
|
|
10143
|
+
"data-matrx-table-selection-target": true,
|
|
10144
|
+
onClick: (event) => {
|
|
10145
|
+
if (event.target === event.currentTarget) {
|
|
10146
|
+
event.currentTarget.querySelector('[role="checkbox"]')?.click();
|
|
10147
|
+
}
|
|
10148
|
+
},
|
|
10149
|
+
children: /* @__PURE__ */ jsx38(
|
|
10150
|
+
Checkbox,
|
|
10151
|
+
{
|
|
10152
|
+
className: CHECKBOX_TAP_AREA,
|
|
10153
|
+
checked: isChecked,
|
|
10154
|
+
"aria-label": `Select this ${selectionNoun}`,
|
|
10155
|
+
onClick: (e) => toggleRowSelected(index, e.shiftKey)
|
|
10156
|
+
}
|
|
10157
|
+
)
|
|
10108
10158
|
}
|
|
10109
10159
|
) : null
|
|
10110
10160
|
}
|