@ai-matrx/design-system 0.19.7 → 0.19.9
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 +17 -1
- 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 +65 -25
- 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 +65 -25
- 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 +91 -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;
|
|
@@ -8531,7 +8534,7 @@ function MatrxDataTableCore({
|
|
|
8531
8534
|
...selectionWidth === void 0 ? {} : { selectionWidth },
|
|
8532
8535
|
...actionsWidth === void 0 ? {} : { actionsWidth }
|
|
8533
8536
|
};
|
|
8534
|
-
}, []);
|
|
8537
|
+
}, [resolvedDensity]);
|
|
8535
8538
|
const captureResizeGestureSnapshot = useCallback5(() => {
|
|
8536
8539
|
resizeGestureSnapshotRef.current = {
|
|
8537
8540
|
widths: measureVisibleColumnWidths(),
|
|
@@ -8602,6 +8605,27 @@ function MatrxDataTableCore({
|
|
|
8602
8605
|
}
|
|
8603
8606
|
if (fixedTableGeometry === null) setFixedTableGeometry(measureFixedTableGeometry());
|
|
8604
8607
|
}, [fixedTableGeometry, measureFixedTableGeometry, usesMeasuredFixedLayout]);
|
|
8608
|
+
useLayoutEffect(() => {
|
|
8609
|
+
if (!usesMeasuredFixedLayout) return;
|
|
8610
|
+
const table = tableRef.current;
|
|
8611
|
+
if (!table) return;
|
|
8612
|
+
const utilityHeaders = Array.from(table.querySelectorAll(
|
|
8613
|
+
"th[data-matrx-table-selection-column], th[data-matrx-table-actions-column]"
|
|
8614
|
+
));
|
|
8615
|
+
const utilityStyles = utilityHeaders.map((header) => header.getAttribute("style"));
|
|
8616
|
+
const resizedWidth = table.style.getPropertyValue("--matrx-resized-table-width");
|
|
8617
|
+
for (const header of utilityHeaders) header.removeAttribute("style");
|
|
8618
|
+
table.style.removeProperty("--matrx-resized-table-width");
|
|
8619
|
+
void table.getBoundingClientRect();
|
|
8620
|
+
const geometry = measureFixedTableGeometry();
|
|
8621
|
+
utilityHeaders.forEach((header, index) => {
|
|
8622
|
+
const style = utilityStyles[index];
|
|
8623
|
+
if (style == null) header.removeAttribute("style");
|
|
8624
|
+
else header.setAttribute("style", style);
|
|
8625
|
+
});
|
|
8626
|
+
table.style.setProperty("--matrx-resized-table-width", resizedWidth);
|
|
8627
|
+
setFixedTableGeometry(geometry);
|
|
8628
|
+
}, [resolvedDensity, measureFixedTableGeometry, usesMeasuredFixedLayout]);
|
|
8605
8629
|
const fixedLayoutActive = usesMeasuredFixedLayout && fixedTableGeometry !== null;
|
|
8606
8630
|
const declaredVisibleCopyColumns = useMemo6(
|
|
8607
8631
|
() => visibleColumns.filter((column) => column.accessorFn !== void 0 || column.accessorKey !== void 0),
|
|
@@ -9407,16 +9431,10 @@ function MatrxDataTableCore({
|
|
|
9407
9431
|
{
|
|
9408
9432
|
ref: setDiagnosticBoundaryRef,
|
|
9409
9433
|
"data-matrx-table": true,
|
|
9434
|
+
"data-matrx-table-density": resolvedDensity,
|
|
9410
9435
|
"data-url-state-table": urlState?.id,
|
|
9411
9436
|
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 p-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",
|
|
9437
|
+
"flex h-full min-h-0 flex-col gap-2 px-0 py-2",
|
|
9420
9438
|
className
|
|
9421
9439
|
),
|
|
9422
9440
|
children: [
|
|
@@ -9918,13 +9936,24 @@ function MatrxDataTableCore({
|
|
|
9918
9936
|
className: "h-9 w-9 px-2 text-left align-middle",
|
|
9919
9937
|
style: fixedUtilityWidth(fixedTableGeometry?.selectionWidth),
|
|
9920
9938
|
children: /* @__PURE__ */ jsx38(
|
|
9921
|
-
|
|
9939
|
+
"div",
|
|
9922
9940
|
{
|
|
9923
|
-
|
|
9924
|
-
|
|
9925
|
-
|
|
9926
|
-
|
|
9927
|
-
|
|
9941
|
+
"data-matrx-table-selection-target": true,
|
|
9942
|
+
onClick: (event) => {
|
|
9943
|
+
if (event.target === event.currentTarget) {
|
|
9944
|
+
event.currentTarget.querySelector('[role="checkbox"]')?.click();
|
|
9945
|
+
}
|
|
9946
|
+
},
|
|
9947
|
+
children: /* @__PURE__ */ jsx38(
|
|
9948
|
+
Checkbox,
|
|
9949
|
+
{
|
|
9950
|
+
className: CHECKBOX_TAP_AREA,
|
|
9951
|
+
checked: allOnPageSelected ? true : someOnPageSelected ? "indeterminate" : false,
|
|
9952
|
+
disabled: selectableRows.length === 0,
|
|
9953
|
+
onCheckedChange: toggleAllOnPage,
|
|
9954
|
+
"aria-label": allOnPageSelected ? "Clear selection on this page" : "Select every row on this page"
|
|
9955
|
+
}
|
|
9956
|
+
)
|
|
9928
9957
|
}
|
|
9929
9958
|
)
|
|
9930
9959
|
}
|
|
@@ -10099,12 +10128,23 @@ function MatrxDataTableCore({
|
|
|
10099
10128
|
style: fixedUtilityWidth(fixedTableGeometry?.selectionWidth),
|
|
10100
10129
|
onClick: (e) => e.stopPropagation(),
|
|
10101
10130
|
children: selection.isRowSelectable?.(row) ?? true ? /* @__PURE__ */ jsx38(
|
|
10102
|
-
|
|
10131
|
+
"div",
|
|
10103
10132
|
{
|
|
10104
|
-
|
|
10105
|
-
|
|
10106
|
-
|
|
10107
|
-
|
|
10133
|
+
"data-matrx-table-selection-target": true,
|
|
10134
|
+
onClick: (event) => {
|
|
10135
|
+
if (event.target === event.currentTarget) {
|
|
10136
|
+
event.currentTarget.querySelector('[role="checkbox"]')?.click();
|
|
10137
|
+
}
|
|
10138
|
+
},
|
|
10139
|
+
children: /* @__PURE__ */ jsx38(
|
|
10140
|
+
Checkbox,
|
|
10141
|
+
{
|
|
10142
|
+
className: CHECKBOX_TAP_AREA,
|
|
10143
|
+
checked: isChecked,
|
|
10144
|
+
"aria-label": `Select this ${selectionNoun}`,
|
|
10145
|
+
onClick: (e) => toggleRowSelected(index, e.shiftKey)
|
|
10146
|
+
}
|
|
10147
|
+
)
|
|
10108
10148
|
}
|
|
10109
10149
|
) : null
|
|
10110
10150
|
}
|