@open-mercato/ui 0.7.0 → 0.7.1-develop.7102.1.b41f7e3e51
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/.turbo/turbo-build.log +1 -1
- package/dist/ai/records/ActivityCard.js +4 -3
- package/dist/ai/records/ActivityCard.js.map +2 -2
- package/dist/ai/records/DealCard.js +4 -3
- package/dist/ai/records/DealCard.js.map +2 -2
- package/dist/ai/records/ProductCard.js +3 -2
- package/dist/ai/records/ProductCard.js.map +2 -2
- package/dist/backend/AppShell.js +129 -106
- package/dist/backend/AppShell.js.map +2 -2
- package/dist/backend/DataTable.js +20 -7
- package/dist/backend/DataTable.js.map +2 -2
- package/dist/backend/detail/NotesSection.js +26 -20
- package/dist/backend/detail/NotesSection.js.map +2 -2
- package/dist/backend/icons/lucideRegistry.generated.js +4 -0
- package/dist/backend/icons/lucideRegistry.generated.js.map +2 -2
- package/dist/backend/injection/useRegisteredComponent.js +24 -6
- package/dist/backend/injection/useRegisteredComponent.js.map +2 -2
- package/dist/backend/inputs/ComboboxInput.js +8 -4
- package/dist/backend/inputs/ComboboxInput.js.map +2 -2
- package/dist/backend/inputs/LookupSelect.js +8 -8
- package/dist/backend/inputs/LookupSelect.js.map +2 -2
- package/dist/backend/sidebar/SidebarCustomizationEditor.js +36 -30
- package/dist/backend/sidebar/SidebarCustomizationEditor.js.map +2 -2
- package/dist/backend/utils/crud.js.map +2 -2
- package/dist/primitives/alert.js +1 -1
- package/dist/primitives/alert.js.map +2 -2
- package/dist/primitives/icon-button.js +20 -1
- package/dist/primitives/icon-button.js.map +2 -2
- package/dist/primitives/pagination.js +14 -9
- package/dist/primitives/pagination.js.map +2 -2
- package/dist/primitives/rich-editor.js +14 -7
- package/dist/primitives/rich-editor.js.map +2 -2
- package/dist/utils/format.js +5 -5
- package/dist/utils/format.js.map +2 -2
- package/package.json +5 -4
- package/src/ai/parts/__tests__/ConfirmationCard.test.tsx +2 -0
- package/src/ai/records/ActivityCard.tsx +4 -3
- package/src/ai/records/DealCard.tsx +4 -3
- package/src/ai/records/ProductCard.tsx +3 -2
- package/src/backend/AppShell.tsx +89 -58
- package/src/backend/DataTable.tsx +44 -10
- package/src/backend/__tests__/AppShell.test.tsx +162 -1
- package/src/backend/__tests__/DataTable.cappedPagination.test.tsx +122 -0
- package/src/backend/__tests__/DataTable.headerWrap.test.tsx +111 -0
- package/src/backend/__tests__/DataTable.render.test.tsx +37 -0
- package/src/backend/__tests__/NotesSection.test.tsx +89 -0
- package/src/backend/__tests__/useRegisteredComponent.identity.test.tsx +305 -0
- package/src/backend/detail/NotesSection.tsx +92 -67
- package/src/backend/icons/lucideRegistry.generated.tsx +4 -0
- package/src/backend/injection/useRegisteredComponent.tsx +49 -8
- package/src/backend/inputs/ComboboxInput.tsx +21 -5
- package/src/backend/inputs/LookupSelect.tsx +8 -8
- package/src/backend/inputs/__tests__/ComboboxInput.test.tsx +142 -0
- package/src/backend/inputs/__tests__/LookupSelect.test.tsx +75 -0
- package/src/backend/sidebar/SidebarCustomizationEditor.tsx +14 -11
- package/src/backend/utils/crud.ts +2 -0
- package/src/primitives/__tests__/alert.test.tsx +41 -1
- package/src/primitives/__tests__/icon-button.test.tsx +70 -0
- package/src/primitives/__tests__/notification.test.tsx +1 -1
- package/src/primitives/__tests__/pagination.test.tsx +54 -0
- package/src/primitives/__tests__/rich-editor.test.tsx +43 -0
- package/src/primitives/alert.tsx +5 -2
- package/src/primitives/icon-button.tsx +20 -1
- package/src/primitives/pagination.tsx +40 -9
- package/src/primitives/rich-editor.tsx +9 -4
- package/src/utils/__tests__/format.test.ts +27 -14
- package/src/utils/format.ts +10 -5
|
@@ -1853,8 +1853,11 @@ function DataTable({
|
|
|
1853
1853
|
const paginationNode = React.useMemo(() => {
|
|
1854
1854
|
if (!pagination || pagination.total === 0) return null;
|
|
1855
1855
|
const { page, totalPages, onPageChange, durationMs, cacheStatus } = pagination;
|
|
1856
|
+
const totalIsCapped = pagination.totalIsCapped === true;
|
|
1857
|
+
const pageIsFull = data.length >= pagination.pageSize;
|
|
1856
1858
|
const startItem = (page - 1) * pagination.pageSize + 1;
|
|
1857
|
-
const endItem = Math.min(page * pagination.pageSize, pagination.total);
|
|
1859
|
+
const endItem = totalIsCapped ? Math.max(startItem, startItem + data.length - 1) : Math.min(page * pagination.pageSize, pagination.total);
|
|
1860
|
+
const pageIsEmpty = data.length === 0;
|
|
1858
1861
|
const effectiveDuration = typeof durationMs === "number" && Number.isFinite(durationMs) && durationMs >= 0 ? durationMs : measuredDurationMs ?? void 0;
|
|
1859
1862
|
const durationLabel = showQueryTime ? formatDurationLabel(effectiveDuration) : "";
|
|
1860
1863
|
const normalizedCacheStatus = cacheStatus === "hit" || cacheStatus === "miss" ? cacheStatus : null;
|
|
@@ -1887,6 +1890,8 @@ function DataTable({
|
|
|
1887
1890
|
page,
|
|
1888
1891
|
pageSize: pagination.pageSize,
|
|
1889
1892
|
total: pagination.total,
|
|
1893
|
+
totalIsCapped,
|
|
1894
|
+
hasNextPage: totalIsCapped ? pageIsFull : void 0,
|
|
1890
1895
|
onPageChange: (next) => {
|
|
1891
1896
|
onPageChange(next);
|
|
1892
1897
|
scrollTableIntoView();
|
|
@@ -1896,14 +1901,22 @@ function DataTable({
|
|
|
1896
1901
|
scrollTableIntoView();
|
|
1897
1902
|
} : void 0,
|
|
1898
1903
|
pageSizeOptions,
|
|
1899
|
-
formatPageInfo: () =>
|
|
1904
|
+
formatPageInfo: () => {
|
|
1905
|
+
if (totalIsCapped) {
|
|
1906
|
+
if (pageIsEmpty) {
|
|
1907
|
+
return t("ui.dataTable.pagination.resultsCappedNoRows", "No further results past {total}", { total: pagination.total });
|
|
1908
|
+
}
|
|
1909
|
+
return durationLabel ? t("ui.dataTable.pagination.resultsCappedWithDuration", "Showing {start} to {end} of {total}+ results in {duration}", { start: startItem, end: endItem, total: pagination.total, duration: durationLabel }) : t("ui.dataTable.pagination.resultsCapped", "Showing {start} to {end} of {total}+ results", { start: startItem, end: endItem, total: pagination.total });
|
|
1910
|
+
}
|
|
1911
|
+
return durationLabel ? t("ui.dataTable.pagination.resultsWithDuration", "Showing {start} to {end} of {total} results in {duration}", { start: startItem, end: endItem, total: pagination.total, duration: durationLabel }) : t("ui.dataTable.pagination.results", "Showing {start} to {end} of {total} results", { start: startItem, end: endItem, total: pagination.total });
|
|
1912
|
+
},
|
|
1900
1913
|
formatPageSizeLabel: (size) => `${size} ${t("ui.dataTable.pagination.perPage", "per page")}`,
|
|
1901
1914
|
"aria-label": t("ui.dataTable.pagination.navAriaLabel", "Table pagination"),
|
|
1902
1915
|
className: "flex-1"
|
|
1903
1916
|
}
|
|
1904
1917
|
)
|
|
1905
1918
|
] });
|
|
1906
|
-
}, [pagination, showQueryTime, measuredDurationMs, scrollTableIntoView, t]);
|
|
1919
|
+
}, [pagination, data, showQueryTime, measuredDurationMs, scrollTableIntoView, t]);
|
|
1907
1920
|
const resolvedEntityIds = React.useMemo(() => {
|
|
1908
1921
|
if (Array.isArray(entityIds) && entityIds.length) {
|
|
1909
1922
|
const dedup = /* @__PURE__ */ new Set();
|
|
@@ -2364,7 +2377,7 @@ function DataTable({
|
|
|
2364
2377
|
const shouldRenderHeader = hasTitle || renderToolbarInline || shouldRenderActionsWrapper || shouldRenderToolbarBelow;
|
|
2365
2378
|
const containerClassName = embedded ? "" : "rounded-lg border bg-card mx-1 sm:mx-2";
|
|
2366
2379
|
const headerWrapperClassName = embedded ? "pb-3" : "px-4 py-3 border-b";
|
|
2367
|
-
const headerContentClassName = "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between";
|
|
2380
|
+
const headerContentClassName = "flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center sm:justify-between";
|
|
2368
2381
|
const toolbarWrapperClassName = embedded ? "mt-2" : "mt-3 pt-3 border-t";
|
|
2369
2382
|
const tableScrollWrapperClassName = embedded ? "" : "overflow-auto";
|
|
2370
2383
|
const virtualScrollRef = React.useRef(null);
|
|
@@ -2398,8 +2411,8 @@ function DataTable({
|
|
|
2398
2411
|
return /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ jsxs("div", { ref: containerRef, className: containerClassName, "data-component-handle": resolvedReplacementHandle, children: [
|
|
2399
2412
|
shouldRenderHeader && /* @__PURE__ */ jsxs("div", { className: headerWrapperClassName, children: [
|
|
2400
2413
|
(hasTitle || shouldRenderActionsWrapper || renderToolbarInline) && /* @__PURE__ */ jsxs("div", { className: headerContentClassName, children: [
|
|
2401
|
-
/* @__PURE__ */ jsx("div", { className: "flex-1 min-w-0", children: renderToolbarInline ? builtToolbar : titleContent }),
|
|
2402
|
-
shouldRenderActionsWrapper ? /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2 min-h-[2.25rem]", children: [
|
|
2414
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 min-w-0 sm:basis-48", children: renderToolbarInline ? builtToolbar : titleContent }),
|
|
2415
|
+
shouldRenderActionsWrapper ? /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2 min-h-[2.25rem] sm:ml-auto sm:justify-end", children: [
|
|
2403
2416
|
refreshButtonConfig ? /* @__PURE__ */ jsxs(
|
|
2404
2417
|
Button,
|
|
2405
2418
|
{
|
|
@@ -2564,7 +2577,7 @@ function DataTable({
|
|
|
2564
2577
|
return;
|
|
2565
2578
|
}
|
|
2566
2579
|
if (onRowClick) {
|
|
2567
|
-
onRowClick(row.original);
|
|
2580
|
+
onRowClick(row.original, e);
|
|
2568
2581
|
} else if (defaultRowAction) {
|
|
2569
2582
|
if (defaultRowAction.href) {
|
|
2570
2583
|
router.push(defaultRowAction.href);
|