@ai-matrx/design-system 0.48.6 → 0.48.8

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.
Files changed (37) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/data-table/copy-helpers.d.cts +1 -1
  3. package/dist/data-table/copy-helpers.d.ts +1 -1
  4. package/dist/data-table/filter-engine.d.cts +1 -1
  5. package/dist/data-table/filter-engine.d.ts +1 -1
  6. package/dist/data-table/host.d.cts +1 -1
  7. package/dist/data-table/host.d.ts +1 -1
  8. package/dist/data-table/index.cjs +22 -4
  9. package/dist/data-table/index.cjs.map +1 -1
  10. package/dist/data-table/index.d.cts +2 -2
  11. package/dist/data-table/index.d.ts +2 -2
  12. package/dist/data-table/index.js +22 -4
  13. package/dist/data-table/index.js.map +1 -1
  14. package/dist/data-table/infer-filter.d.cts +1 -1
  15. package/dist/data-table/infer-filter.d.ts +1 -1
  16. package/dist/data-table/layered-filters.d.cts +1 -1
  17. package/dist/data-table/layered-filters.d.ts +1 -1
  18. package/dist/data-table/pagination.cjs +1 -1
  19. package/dist/data-table/pagination.cjs.map +1 -1
  20. package/dist/data-table/pagination.js +1 -1
  21. package/dist/data-table/pagination.js.map +1 -1
  22. package/dist/data-table/query-control.d.cts +1 -1
  23. package/dist/data-table/query-control.d.ts +1 -1
  24. package/dist/data-table/spreadsheet.cjs +18 -0
  25. package/dist/data-table/spreadsheet.cjs.map +1 -1
  26. package/dist/data-table/spreadsheet.js +18 -0
  27. package/dist/data-table/spreadsheet.js.map +1 -1
  28. package/dist/data-table/types.cjs.map +1 -1
  29. package/dist/data-table/types.d.cts +1 -1
  30. package/dist/data-table/types.d.ts +1 -1
  31. package/dist/data-table/url-state.d.cts +1 -1
  32. package/dist/data-table/url-state.d.ts +1 -1
  33. package/dist/data-table/xlsx.d.cts +1 -1
  34. package/dist/data-table/xlsx.d.ts +1 -1
  35. package/dist/{types-hMqC2Fwn.d.ts → types-BqLsZ2o1.d.ts} +3 -3
  36. package/dist/{types-Dh3wRc0N.d.cts → types-ufKpwnVR.d.cts} +3 -3
  37. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.48.8
4
+
5
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
6
+ `git diff npm/design-system/v0.48.7..npm/design-system/v0.48.8 -- apps/shared/design-system`).
7
+ No source changes intended and no consumer action required.
8
+
9
+ ## 0.48.7
10
+ ### Unreleased
11
+
12
+ ### DATA-V2-BASICS (2026-09-27): a click off the table lets go
13
+
14
+ - **`useSpreadsheetGrid`: while a range is held, a pointerdown outside the table (its `[data-matrx-table]` root) and outside every layer it may have opened (menu, listbox, dialog, popper, toast) clears the range and takes the keyboard off the grid.** An open cell editor loses focus with it and saves as a Tab away would. Before, a 12-cell range survived a click on the page header or the sidebar while the keyboard fell to `<body>`, so Escape could not clear it either (Arman: "that's often the easiest way you get yourself out of strange state conditions").
15
+ - Proof: `data-table/MatrxDataTable.outside-click-lets-go.test.tsx` (red on the previous hook: the range survived).
16
+
3
17
  ## 0.48.6
4
18
 
5
19
  Automatic changed-only republish (docs/metadata drift since the last tag — see
@@ -1,5 +1,5 @@
1
1
  import { AgentPayloadInput } from './copy-types.cjs';
2
- import { g as MatrxDataTableCopyConfig, M as MatrxColumnDef } from '../types-Dh3wRc0N.cjs';
2
+ import { g as MatrxDataTableCopyConfig, M as MatrxColumnDef } from '../types-ufKpwnVR.cjs';
3
3
  import '../content-transfer.cjs';
4
4
  import 'react';
5
5
  import '@ai-matrx/kit/content-transfer';
@@ -1,5 +1,5 @@
1
1
  import { AgentPayloadInput } from './copy-types.js';
2
- import { g as MatrxDataTableCopyConfig, M as MatrxColumnDef } from '../types-hMqC2Fwn.js';
2
+ import { g as MatrxDataTableCopyConfig, M as MatrxColumnDef } from '../types-BqLsZ2o1.js';
3
3
  import '../content-transfer.js';
4
4
  import 'react';
5
5
  import '@ai-matrx/kit/content-transfer';
@@ -1,4 +1,4 @@
1
- import { M as MatrxColumnDef, C as ColumnFiltersState, S as SortState, L as LayeredFilterRule, T as TableSearchMatchMode, a as ColumnFilterValue } from '../types-Dh3wRc0N.cjs';
1
+ import { M as MatrxColumnDef, C as ColumnFiltersState, S as SortState, L as LayeredFilterRule, T as TableSearchMatchMode, a as ColumnFilterValue } from '../types-ufKpwnVR.cjs';
2
2
  import '../content-transfer.cjs';
3
3
  import 'react';
4
4
  import '@ai-matrx/kit/content-transfer';
@@ -1,4 +1,4 @@
1
- import { M as MatrxColumnDef, C as ColumnFiltersState, S as SortState, L as LayeredFilterRule, T as TableSearchMatchMode, a as ColumnFilterValue } from '../types-hMqC2Fwn.js';
1
+ import { M as MatrxColumnDef, C as ColumnFiltersState, S as SortState, L as LayeredFilterRule, T as TableSearchMatchMode, a as ColumnFilterValue } from '../types-BqLsZ2o1.js';
2
2
  import '../content-transfer.js';
3
3
  import 'react';
4
4
  import '@ai-matrx/kit/content-transfer';
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { ComponentType, ReactNode, MouseEventHandler } from 'react';
3
3
  import { CopyControlProps } from './copy-types.cjs';
4
4
  export { AgentPayloadInput, AiCustomSource, AiVariant, CopyExportConfig } from './copy-types.cjs';
5
- import { b as TableSavedViewsProps, c as MatrxDataTableDensity, d as MatrxDataTableRecordControls } from '../types-Dh3wRc0N.cjs';
5
+ import { b as TableSavedViewsProps, c as MatrxDataTableDensity, d as MatrxDataTableRecordControls } from '../types-ufKpwnVR.cjs';
6
6
  import { MatrxTableMenuTarget, MatrxTableMenuPayload, MatrxTableMenuSectionsResolver, MatrxTableMenuIconName } from './menu-targets.cjs';
7
7
  export { MatrxTableMenuItem, MatrxTableMenuSection } from './menu-targets.cjs';
8
8
  import '../content-transfer.cjs';
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { ComponentType, ReactNode, MouseEventHandler } from 'react';
3
3
  import { CopyControlProps } from './copy-types.js';
4
4
  export { AgentPayloadInput, AiCustomSource, AiVariant, CopyExportConfig } from './copy-types.js';
5
- import { b as TableSavedViewsProps, c as MatrxDataTableDensity, d as MatrxDataTableRecordControls } from '../types-hMqC2Fwn.js';
5
+ import { b as TableSavedViewsProps, c as MatrxDataTableDensity, d as MatrxDataTableRecordControls } from '../types-BqLsZ2o1.js';
6
6
  import { MatrxTableMenuTarget, MatrxTableMenuPayload, MatrxTableMenuSectionsResolver, MatrxTableMenuIconName } from './menu-targets.js';
7
7
  export { MatrxTableMenuItem, MatrxTableMenuSection } from './menu-targets.js';
8
8
  import '../content-transfer.js';
@@ -36601,7 +36601,7 @@ function GenericTablePagination({
36601
36601
  }
36602
36602
  ) }),
36603
36603
  /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TooltipContent, { children: "Show more already-loaded rows" })
36604
- ] }) : null : showPageControls && (unknownTotal ? currentPage > 1 || unknownTotal.hasNextPage : totalPages > 1) && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
36604
+ ] }) : null : showPageControls && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
36605
36605
  "div",
36606
36606
  {
36607
36607
  className: cn(
@@ -43019,6 +43019,7 @@ function camePastAPortalIntoTheContainer(target) {
43019
43019
  if (!element) return false;
43020
43020
  return element.closest('[data-matrx-table-spreadsheet="true"]') === null;
43021
43021
  }
43022
+ var LAYERS_THE_GRID_OPENS = '[data-radix-popper-content-wrapper], [data-radix-portal], [role="menu"], [role="listbox"], [role="dialog"], [role="alertdialog"], [data-sonner-toaster]';
43022
43023
  var READ_ONLY_REASON = "This table is view-only \u2014 you can select and copy, but not change cells.";
43023
43024
  function useSpreadsheetGrid(options) {
43024
43025
  const [range, setRange] = (0, import_react15.useState)(null);
@@ -43273,6 +43274,23 @@ function useSpreadsheetGrid(options) {
43273
43274
  },
43274
43275
  [endEdit, focusIsLost]
43275
43276
  );
43277
+ const holdsARange = range !== null;
43278
+ (0, import_react15.useEffect)(() => {
43279
+ if (!holdsARange || typeof document === "undefined") return;
43280
+ const onPointerDown = (event) => {
43281
+ const target = event.target instanceof Element ? event.target : null;
43282
+ const container = catcherRef.current?.closest('[data-matrx-table-spreadsheet="true"]');
43283
+ if (!target || !container || !container.isConnected) return;
43284
+ const table = container.closest("[data-matrx-table]") ?? container;
43285
+ if (table.contains(target) || target.closest(LAYERS_THE_GRID_OPENS)) return;
43286
+ setRange(null);
43287
+ setFillTarget(null);
43288
+ const active = document.activeElement;
43289
+ if (active instanceof HTMLElement && container.contains(active)) active.blur();
43290
+ };
43291
+ document.addEventListener("pointerdown", onPointerDown, true);
43292
+ return () => document.removeEventListener("pointerdown", onPointerDown, true);
43293
+ }, [holdsARange]);
43276
43294
  const controller = (0, import_react15.useMemo)(() => ({ endEdit, select, focusGrid }), [endEdit, select, focusGrid]);
43277
43295
  const onKeyDown = (0, import_react15.useCallback)(
43278
43296
  (event) => {
@@ -48510,7 +48528,7 @@ function MatrxDataTableCore(coreProps) {
48510
48528
  const pageCount = Math.max(1, Math.ceil(totalItems / effectivePageSize));
48511
48529
  const safePage = appendQuery ? 1 : remoteQuery ? safeQueryPage(page, totalItems, effectivePageSize) : Math.min(page, pageCount);
48512
48530
  const sourceOwnsProcessing = sourceOwnsSearch || sourceOwnsSort || sourceOwnsColumnFilters;
48513
- const localProgressiveEnabled = !remoteQuery && !hidePagination && allRowsAreLoaded && (!sourceOwnsProcessing || sourceTotal !== void 0) && localPagination?.mode !== "numbered";
48531
+ const localProgressiveEnabled = !remoteQuery && !hidePagination && allRowsAreLoaded && (!sourceOwnsProcessing || sourceTotal !== void 0) && localPagination?.mode === "progressive";
48514
48532
  const progressiveRows = useProgressiveTableRows({
48515
48533
  rows: processed,
48516
48534
  pageSize,
@@ -48531,7 +48549,7 @@ function MatrxDataTableCore(coreProps) {
48531
48549
  }),
48532
48550
  containers: [scrollRef, cardsScrollRef],
48533
48551
  enabled: localProgressiveEnabled,
48534
- numberedPageHasMore: !hidePagination && !isLoading && !isFetching && processed.length > 0 && safePage < pageCount && (remoteQuery?.mode === "controlled" || !remoteQuery && localPagination?.mode === "numbered"),
48552
+ numberedPageHasMore: !hidePagination && !isLoading && !isFetching && processed.length > 0 && safePage < pageCount && (remoteQuery?.mode === "controlled" || !remoteQuery),
48535
48553
  onPageAdvance: setPage
48536
48554
  });
48537
48555
  const paginated = (0, import_react22.useMemo)(() => {
@@ -51433,7 +51451,7 @@ function MatrxDataTableCore(coreProps) {
51433
51451
  ] }) : !isLoading && appendQuery.pagination.totalItems !== void 0 && data.length === appendQuery.pagination.totalItems ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("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
51434
51452
  ]
51435
51453
  }
51436
- ) : !hidePagination && (totalItems > 0 || sourceTotal !== void 0) ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(MatrxTableChrome, { part: "pagination", epoch: paginationEpoch, render: () => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
51454
+ ) : !hidePagination ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(MatrxTableChrome, { part: "pagination", epoch: paginationEpoch, render: () => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
51437
51455
  GenericTablePagination,
51438
51456
  {
51439
51457
  totalItems,