@ai-matrx/design-system 0.20.8 → 0.20.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 +12 -0
- package/dist/data-table/index.cjs +36 -12
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.js +36 -12
- package/dist/data-table/index.js.map +1 -1
- package/dist/data-table/pagination.cjs +3 -8
- package/dist/data-table/pagination.cjs.map +1 -1
- package/dist/data-table/pagination.js +3 -8
- package/dist/data-table/pagination.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.20.10
|
|
4
|
+
|
|
5
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
6
|
+
`git diff npm/design-system/v0.20.9..npm/design-system/v0.20.10 -- apps/shared/design-system`).
|
|
7
|
+
No source changes intended and no consumer action required.
|
|
8
|
+
|
|
9
|
+
## 0.20.9
|
|
10
|
+
|
|
11
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
12
|
+
`git diff npm/design-system/v0.20.8..npm/design-system/v0.20.9 -- apps/shared/design-system`).
|
|
13
|
+
No source changes intended and no consumer action required.
|
|
14
|
+
|
|
3
15
|
## 0.20.8 — 2026-09-15
|
|
4
16
|
|
|
5
17
|
Keep column-reorder animation safe in browser-compatible runtimes and test
|
|
@@ -1398,6 +1398,35 @@ function useProgressiveTableRows({
|
|
|
1398
1398
|
onPageAdvance(nextPage);
|
|
1399
1399
|
}
|
|
1400
1400
|
};
|
|
1401
|
+
const warnedUnderfill = (0, import_react4.useRef)(null);
|
|
1402
|
+
(0, import_react4.useEffect)(() => {
|
|
1403
|
+
if (!hasMore) return;
|
|
1404
|
+
const surfaces = containers.map((entry) => entry && "current" in entry ? entry.current : entry).filter((entry) => entry !== null);
|
|
1405
|
+
const fillViewport = () => {
|
|
1406
|
+
for (const surface of surfaces) {
|
|
1407
|
+
if (surface.clientHeight <= 0 || surface.getClientRects().length === 0) continue;
|
|
1408
|
+
const content = surface.querySelector("table") ?? surface.lastElementChild;
|
|
1409
|
+
if (!content) continue;
|
|
1410
|
+
const bounds = surface.getBoundingClientRect();
|
|
1411
|
+
const contentBottom = content.getBoundingClientRect().bottom - bounds.top + surface.scrollTop;
|
|
1412
|
+
if (contentBottom <= 0 || contentBottom >= surface.clientHeight - 1) continue;
|
|
1413
|
+
if (warnedUnderfill.current !== progressionKey) {
|
|
1414
|
+
warnedUnderfill.current = progressionKey;
|
|
1415
|
+
console.warn("[MatrxDataTable] The initial local batch leaves unused table height while more rows are already loaded. Revealing additional rows to fill the viewport; this is not a network fetch.");
|
|
1416
|
+
}
|
|
1417
|
+
setProgression((current) => {
|
|
1418
|
+
if (current.key !== progressionKey) return current;
|
|
1419
|
+
const nextCount = Math.min(rows.length, visibleCount + pageSize);
|
|
1420
|
+
return current.shownCount >= nextCount ? current : { ...current, shownCount: nextCount };
|
|
1421
|
+
});
|
|
1422
|
+
break;
|
|
1423
|
+
}
|
|
1424
|
+
};
|
|
1425
|
+
fillViewport();
|
|
1426
|
+
const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(fillViewport);
|
|
1427
|
+
for (const surface of surfaces) observer?.observe(surface);
|
|
1428
|
+
return () => observer?.disconnect();
|
|
1429
|
+
}, [containers, hasMore, pageSize, progressionKey, rows.length, visibleCount]);
|
|
1401
1430
|
const scroll = useScrollPagination({
|
|
1402
1431
|
containers,
|
|
1403
1432
|
queryKey: progressionKey,
|
|
@@ -2002,6 +2031,7 @@ function GenericTablePagination({
|
|
|
2002
2031
|
const startItem = totalItems === 0 ? 0 : progressive ? 1 : (currentPage - 1) * effectiveItemsPerPage + 1;
|
|
2003
2032
|
const endItem = Math.min(progressive?.shownCount ?? currentPage * effectiveItemsPerPage, totalItems);
|
|
2004
2033
|
const defaultLabelFormat = (start, end, total) => {
|
|
2034
|
+
if (progressive) return `${end} shown / ${total} loaded`;
|
|
2005
2035
|
return compact ? `${start}-${end} of ${total}` : `Showing ${start} to ${end} of ${total} entries`;
|
|
2006
2036
|
};
|
|
2007
2037
|
const formatLabel = labelFormat || defaultLabelFormat;
|
|
@@ -2031,7 +2061,7 @@ function GenericTablePagination({
|
|
|
2031
2061
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2032
2062
|
SelectTrigger,
|
|
2033
2063
|
{
|
|
2034
|
-
"aria-label": "Rows per page",
|
|
2064
|
+
"aria-label": progressive ? "Rows per batch" : "Rows per page",
|
|
2035
2065
|
className: cn(
|
|
2036
2066
|
"focus:ring-0",
|
|
2037
2067
|
compact ? "h-11 min-w-20 rounded-md border border-border bg-card px-3 text-sm hover:bg-accent [&_svg]:size-5" : "h-8 w-[3.75rem] text-xs sm:w-36 sm:text-sm"
|
|
@@ -2053,13 +2083,7 @@ function GenericTablePagination({
|
|
|
2053
2083
|
{
|
|
2054
2084
|
className: cn("flex min-w-0 justify-center", infoContainerClassName),
|
|
2055
2085
|
children: showPageInfo && !hideEntriesInfo && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
2056
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.
|
|
2057
|
-
startItem,
|
|
2058
|
-
"-",
|
|
2059
|
-
endItem,
|
|
2060
|
-
" / ",
|
|
2061
|
-
totalItems
|
|
2062
|
-
] }),
|
|
2086
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "truncate text-xs tabular-nums text-muted-foreground sm:hidden", children: progressive ? `${endItem}/${totalItems} loaded` : `${startItem}-${endItem} / ${totalItems}` }),
|
|
2063
2087
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2064
2088
|
"span",
|
|
2065
2089
|
{
|
|
@@ -6379,8 +6403,8 @@ function projectColumnDragOrder(orderedIds, preview2) {
|
|
|
6379
6403
|
function inferTableSearchRole(field) {
|
|
6380
6404
|
const key = field.replace(/([a-z])([A-Z])/g, "$1_$2").toLowerCase().replace(/[\s-]+/g, "_");
|
|
6381
6405
|
if (key === "id" || key === "uuid" || key.endsWith("_id")) return "id";
|
|
6382
|
-
if (/^(name|label|title|key|slug|display_name|common_name|model_name)$/.test(key) || /_(name|label|title)$/.test(key)) return "name";
|
|
6383
|
-
if (/^(description|summary|details|blurb)$/.test(key) || key.endsWith("_description")) return "description";
|
|
6406
|
+
if (/^(name|alias|label|title|key|slug|display_name|common_name|model_name)$/.test(key) || /_(name|label|title)$/.test(key)) return "name";
|
|
6407
|
+
if (/^(description|summary|details|notes|blurb)$/.test(key) || key.endsWith("_description")) return "description";
|
|
6384
6408
|
return "other";
|
|
6385
6409
|
}
|
|
6386
6410
|
function searchableFields(row, columns) {
|
|
@@ -10451,7 +10475,7 @@ function MatrxDataTableCore({
|
|
|
10451
10475
|
"div",
|
|
10452
10476
|
{
|
|
10453
10477
|
"data-matrx-cell-content": true,
|
|
10454
|
-
className: "min-w-0 max-w-full flex-1 whitespace-normal break-words [overflow-wrap:anywhere] sm:[&_*]:min-w-0 sm:[&_*]:
|
|
10478
|
+
className: "min-w-0 max-w-full flex-1 whitespace-normal break-words [overflow-wrap:anywhere] sm:[&_*]:min-w-0 sm:[&_*]:whitespace-normal sm:[&_*]:[overflow-wrap:anywhere] sm:[&_.truncate]:whitespace-nowrap sm:[&_[data-slot=badge]]:whitespace-nowrap sm:[&_[data-slot=badge]]:[overflow-wrap:normal] sm:[&_[data-matrx-cell-control]]:w-max sm:[&_[data-matrx-cell-control]]:min-w-max sm:[&_[data-matrx-cell-control]]:max-w-none sm:[&_[data-matrx-cell-control]]:whitespace-nowrap sm:[&_[data-matrx-cell-control]]:[overflow-wrap:normal] sm:[&_[data-matrx-cell-control]_*]:whitespace-nowrap sm:[&_[data-matrx-cell-control]_*]:[overflow-wrap:normal]",
|
|
10455
10479
|
children: renderRecordCell(row, col, index)
|
|
10456
10480
|
}
|
|
10457
10481
|
)
|
|
@@ -10697,7 +10721,7 @@ function MatrxDataTableCore({
|
|
|
10697
10721
|
onClick: appendQuery.pagination.retrySource ?? (appendQuery.pagination.hasNextPage ? appendQuery.pagination.loadNextPage : appendQuery.pagination.refresh),
|
|
10698
10722
|
children: appendQuery.pagination.retrySource ? "Retry source" : appendQuery.pagination.hasNextPage ? "Retry" : "Reload rows"
|
|
10699
10723
|
}
|
|
10700
|
-
) : appendQuery.pagination.hasNextPage || scrollPagination.error ? /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex
|
|
10724
|
+
) : appendQuery.pagination.hasNextPage || scrollPagination.error ? /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex min-w-0 max-w-full flex-wrap gap-0", children: [
|
|
10701
10725
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
10702
10726
|
Button,
|
|
10703
10727
|
{
|